Skip to content

Commit b7d927d

Browse files
author
Giovanni Moretti
committed
updated with new structure
1 parent 94c415c commit b7d927d

15 files changed

+348
-343
lines changed

UDante-affix.rq

+23-22
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
PREFIX powla: <http://purl.org/powla/powla.owl#>
2-
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3-
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4-
PREFIX dc: <http://purl.org/dc/elements/1.1/>
5-
prefix lilacorpora: <http://lila-erc.eu/ontologies/lila_corpora/>
6-
prefix lila: <http://lila-erc.eu/ontologies/lila/>
7-
8-
# Given an affix (e.g. “in- (negative)”), find all the occurrences of lammas with such affixin UDante and ITTB
9-
SELECT ?samePrefixLemmaLabel ?docTitle
10-
WHERE {
11-
VALUES ?copora {
12-
<http://lila-erc.eu/data/corpora/ITTB/id/corpus> <http://lila-erc.eu/data/corpora/UDante/id/corpus>
13-
}
14-
?samePrefixLemma lila:hasPrefix <http://lila-erc.eu/data/id/prefix/20> .
15-
?token rdf:type powla:Terminal;
16-
lila:hasLemma ?samePrefixLemma .
17-
?token lilacorpora:hasCitStructure/powla:hasDocument ?doc.
18-
?doc dc:title ?docTitle .
19-
?token lilacorpora:hasCitStructure/powla:hasDocument/^powla:hasSubDocument ?copora .
20-
?samePrefixLemma rdfs:label ?samePrefixLemmaLabel.
21-
}group by ?samePrefixLemma ?samePrefixLemmaLabel ?docTitle
22-
order by ?samePrefixLemma ?docTitle
1+
PREFIX powla: <http://purl.org/powla/powla.owl#>
2+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4+
PREFIX dc: <http://purl.org/dc/elements/1.1/>
5+
prefix lilacorpora: <http://lila-erc.eu/ontologies/lila_corpora/>
6+
prefix lila: <http://lila-erc.eu/ontologies/lila/>
7+
8+
# Given an affix (e.g. “in- (negative)”), find all the occurrences of lammas with such affixin UDante and ITTB
9+
SELECT ?samePrefixLemmaLabel ?docTitle
10+
WHERE {
11+
VALUES ?copora {
12+
<http://lila-erc.eu/data/corpora/ITTB/id/corpus> <http://lila-erc.eu/data/corpora/UDante/id/corpus>
13+
}
14+
?samePrefixLemma lila:hasPrefix <http://lila-erc.eu/data/id/prefix/20> .
15+
?token rdf:type powla:Terminal;
16+
lila:hasLemma ?samePrefixLemma .
17+
?token powla:hasLayer/powla:hasDocument ?doc.
18+
?doc dc:title ?docTitle .
19+
?token powla:hasLayer/powla:hasDocument/^powla:hasSubDocument ?copora .
20+
?samePrefixLemma rdfs:label ?samePrefixLemmaLabel.
21+
}group by ?samePrefixLemma ?samePrefixLemmaLabel ?docTitle
22+
order by ?samePrefixLemma ?docTitle
23+

UDante-sentiment.rq

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2-
prefix ontolex: <http://www.w3.org/ns/lemon/ontolex#>
3-
prefix lila: <http://lila-erc.eu/ontologies/lila/>
4-
prefix lilacorpora: <http://lila-erc.eu/ontologies/lila_corpora/>
5-
prefix lime: <http://www.w3.org/ns/lemon/lime#>
6-
prefix marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
7-
prefix powla: <http://purl.org/powla/powla.owl#>
8-
prefix corpora: <http://lila-erc.eu/ontologies/lila_corpora/>
9-
10-
# List of negative lemmas in UDante
11-
12-
SELECT ?pnomlemma ?lablemma (count(?pnomlemma) as ?tot) WHERE {
13-
<http://lila-erc.eu/data/lexicalResources/LatinAffectus/Lexicon> lime:entry ?lexentry .
14-
?lexentry ontolex:canonicalForm ?pnomlemma ;
15-
ontolex:sense [ marl:hasPolarity marl:Negative ]
16-
VALUES ?corpora {
17-
<http://lila-erc.eu/data/corpora/UDante/id/corpus>
18-
}
19-
?t a powla:Terminal ;
20-
lila:hasLemma ?pnomlemma .
21-
?t lilacorpora:hasCitStructure/powla:hasDocument/^powla:hasSubDocument ?corpora .
22-
?pnomlemma rdfs:label ?lablemma
23-
}group by ?pnomlemma ?lablemma
1+
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2+
prefix ontolex: <http://www.w3.org/ns/lemon/ontolex#>
3+
prefix lila: <http://lila-erc.eu/ontologies/lila/>
4+
prefix lilacorpora: <http://lila-erc.eu/ontologies/lila_corpora/>
5+
prefix lime: <http://www.w3.org/ns/lemon/lime#>
6+
prefix marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
7+
prefix powla: <http://purl.org/powla/powla.owl#>
8+
prefix corpora: <http://lila-erc.eu/ontologies/lila_corpora/>
9+
10+
# List of negative lemmas in UDante
11+
12+
SELECT ?pnomlemma ?lablemma (count(?pnomlemma) as ?tot) WHERE {
13+
<http://lila-erc.eu/data/lexicalResources/LatinAffectus/Lexicon> lime:entry ?lexentry .
14+
?lexentry ontolex:canonicalForm ?pnomlemma ;
15+
ontolex:sense [ marl:hasPolarity marl:Negative ]
16+
VALUES ?corpora {
17+
<http://lila-erc.eu/data/corpora/UDante/id/corpus>
18+
}
19+
?t a powla:Terminal ;
20+
lila:hasLemma ?pnomlemma .
21+
?t powla:hasLayer/powla:hasDocument/^powla:hasSubDocument ?corpora .
22+
?pnomlemma rdfs:label ?lablemma
23+
}group by ?pnomlemma ?lablemma
2424
order by desc(?tot)

UDante-synset.rq

+52-51
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,52 @@
1-
PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
2-
prefix wn: <http://wordnet-rdf.princeton.edu/ontology#>
3-
PREFIX lila: <http://lila-erc.eu/ontologies/lila/>
4-
PREFIX lilacorpora: <http://lila-erc.eu/ontologies/lila_corpora/>
5-
PREFIX powla: <http://purl.org/powla/powla.owl#>
6-
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
7-
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
8-
PREFIX dc: <http://purl.org/dc/elements/1.1/>
9-
10-
# Find all the lemmas of the synset (to reign) http://wordnet-rdf.princeton.edu/wn30/02587375-v
11-
SELECT ?lemma ?lemmaWrs ?docTitle
12-
WHERE {
13-
VALUES ?documentSummaCG {
14-
<http://lila-erc.eu/data/corpora/ITTB/id/citationUnit/005.>
15-
} .
16-
{
17-
SELECT ?lemma (GROUP_CONCAT (DISTINCT ?wr ;
18-
separator=", ") as ?lemmaWrs)
19-
WHERE {
20-
VALUES ?syn {
21-
<http://wordnet-rdf.princeton.edu/wn30/02587375-v>
22-
} .
23-
{
24-
SELECT ?wnLemma ?syn
25-
WHERE {
26-
{
27-
?le ontolex:evokes ?syn;
28-
ontolex:canonicalForm ?wnLemma .
29-
}
30-
UNION{
31-
?syn wn:hypernym ?hyp .
32-
?le ontolex:evokes ?hyp;
33-
ontolex:canonicalForm ?wnLemma .
34-
}
35-
}group by ?wnLemma ?syn
36-
}
37-
?wnLemma lila:hasBase ?base .
38-
?lemma lila:hasBase ?base ;
39-
lila:hasPOS lila:verb ;
40-
ontolex:writtenRep ?wr .
41-
} group by ?lemma
42-
}
43-
VALUES ?copora {
44-
<http://lila-erc.eu/data/corpora/ITTB/id/corpus> <http://lila-erc.eu/data/corpora/UDante/id/corpus>
45-
}
46-
?token lila:hasLemma ?lemma;
47-
rdfs:label ?tokenLabel.
48-
?token lilacorpora:hasCitStructure/powla:hasDocument ?doc.
49-
?token lilacorpora:hasCitStructure/powla:hasDocument/^powla:hasSubDocument ?copora .
50-
?doc dc:title ?docTitle .
51-
}group by ?lemma ?lemmaWrs ?docTitle
1+
PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
2+
prefix wn: <http://wordnet-rdf.princeton.edu/ontology#>
3+
PREFIX lila: <http://lila-erc.eu/ontologies/lila/>
4+
PREFIX lilacorpora: <http://lila-erc.eu/ontologies/lila_corpora/>
5+
PREFIX powla: <http://purl.org/powla/powla.owl#>
6+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
7+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
8+
PREFIX dc: <http://purl.org/dc/elements/1.1/>
9+
10+
# Find all the lemmas of the synset (to reign) http://wordnet-rdf.princeton.edu/wn30/02587375-v
11+
SELECT ?lemma ?lemmaWrs ?docTitle
12+
WHERE {
13+
VALUES ?documentSummaCG {
14+
<http://lila-erc.eu/data/corpora/ITTB/id/citationUnit/005.>
15+
} .
16+
{
17+
SELECT ?lemma (GROUP_CONCAT (DISTINCT ?wr ;
18+
separator=", ") as ?lemmaWrs)
19+
WHERE {
20+
VALUES ?syn {
21+
<http://wordnet-rdf.princeton.edu/wn30/02587375-v>
22+
} .
23+
{
24+
SELECT ?wnLemma ?syn
25+
WHERE {
26+
{
27+
?le ontolex:evokes ?syn;
28+
ontolex:canonicalForm ?wnLemma .
29+
}
30+
UNION{
31+
?syn wn:hypernym ?hyp .
32+
?le ontolex:evokes ?hyp;
33+
ontolex:canonicalForm ?wnLemma .
34+
}
35+
}group by ?wnLemma ?syn
36+
}
37+
?wnLemma lila:hasBase ?base .
38+
?lemma lila:hasBase ?base ;
39+
lila:hasPOS lila:verb ;
40+
ontolex:writtenRep ?wr .
41+
} group by ?lemma
42+
}
43+
VALUES ?copora {
44+
<http://lila-erc.eu/data/corpora/ITTB/id/corpus> <http://lila-erc.eu/data/corpora/UDante/id/corpus>
45+
}
46+
?token lila:hasLemma ?lemma;
47+
rdfs:label ?tokenLabel.
48+
?token powla:hasLayer/powla:hasDocument ?doc.
49+
?token powla:hasLayer/powla:hasDocument/^powla:hasSubDocument ?copora .
50+
?doc dc:title ?docTitle .
51+
}group by ?lemma ?lemmaWrs ?docTitle
52+

UDante-syntax.rq

+35-34
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
1-
PREFIX powla: <http://purl.org/powla/powla.owl#>
2-
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3-
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4-
PREFIX dc: <http://purl.org/dc/elements/1.1/>
5-
prefix lilacorpora: <http://lila-erc.eu/ontologies/lila_corpora/>
6-
prefix lila: <http://lila-erc.eu/ontologies/lila/>
7-
prefix UDSynFunction: <https://universaldependencies.org/u/dep/>
8-
prefix ITTBSynFunction: <http://lila-erc.eu/data/corpora/ITTB/id/synFunction/>
9-
10-
# Given the lemma "loquor" gives all the lemmas that are annotated as nsubj in Dante and subj ITTB
11-
12-
SELECT ?subLemmaLabel ?docTitle
13-
WHERE {
14-
VALUES ?copora {
15-
<http://lila-erc.eu/data/corpora/ITTB/id/corpus> <http://lila-erc.eu/data/corpora/UDante/id/corpus>
16-
}
17-
VALUES ?synFunctions {
18-
UDSynFunction:nsubj ITTBSynFunction:Sb
19-
}
20-
?token rdf:type powla:Terminal;
21-
lila:hasLemma <http://lila-erc.eu/data/id/lemma/110805> .
22-
?rel rdf:type ?synFunctions;
23-
lilacorpora:hasHead ?token ;
24-
lilacorpora:hasDep ?subj .
25-
?subj lila:hasLemma ?subjLemma .
26-
?token lilacorpora:hasCitStructure/powla:hasDocument/^powla:hasSubDocument ?copora .
27-
?token lilacorpora:hasCitStructure/powla:hasDocument ?doc.
28-
?doc dc:title ?docTitle .
29-
VALUES ?nounPos {
30-
lila:proper_noun lila:noun
31-
}
32-
?subjLemma lila:hasPOS ?nounPos .
33-
?subjLemma rdfs:label ?subLemmaLabel.
34-
}group by ?subjLemma ?subLemmaLabel ?docTitle
1+
PREFIX powla: <http://purl.org/powla/powla.owl#>
2+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4+
PREFIX dc: <http://purl.org/dc/elements/1.1/>
5+
prefix lilacorpora: <http://lila-erc.eu/ontologies/lila_corpora/>
6+
prefix lila: <http://lila-erc.eu/ontologies/lila/>
7+
prefix UDSynFunction: <https://universaldependencies.org/u/dep/>
8+
prefix ITTBSynFunction: <http://lila-erc.eu/data/corpora/ITTB/id/synFunction/>
9+
10+
# Given the lemma "loquor" gives all the lemmas that are annotated as nsubj in Dante and subj ITTB
11+
12+
SELECT ?subLemmaLabel ?docTitle
13+
WHERE {
14+
VALUES ?copora {
15+
<http://lila-erc.eu/data/corpora/ITTB/id/corpus> <http://lila-erc.eu/data/corpora/UDante/id/corpus>
16+
}
17+
VALUES ?synFunctions {
18+
UDSynFunction:nsubj ITTBSynFunction:Sb
19+
}
20+
?token rdf:type powla:Terminal;
21+
lila:hasLemma <http://lila-erc.eu/data/id/lemma/110805> .
22+
?rel rdf:type ?synFunctions;
23+
lilacorpora:hasHead ?token ;
24+
lilacorpora:hasDep ?subj .
25+
?subj lila:hasLemma ?subjLemma .
26+
?token powla:hasLayer/powla:hasDocument/^powla:hasSubDocument ?copora .
27+
?token powla:hasLayer/powla:hasDocument ?doc.
28+
?doc dc:title ?docTitle .
29+
VALUES ?nounPos {
30+
lila:proper_noun lila:noun
31+
}
32+
?subjLemma lila:hasPOS ?nounPos .
33+
?subjLemma rdfs:label ?subLemmaLabel.
34+
}group by ?subjLemma ?subLemmaLabel ?docTitle
35+

distinctivelammas-DVE.rq

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ WHERE {
1212
{
1313
SELECT ?lemma (count(?lemma) as ?freq)
1414
WHERE {
15-
?CitationLayer powla:hasDocument <http://lila-erc.eu/data/corpora/UDante/id/corpus/De%20Vulgari%20Eloquentia> .
15+
?DocumentLayer powla:hasDocument <http://lila-erc.eu/data/corpora/UDante/id/corpus/De%20Vulgari%20Eloquentia> .
1616
?tokenQuer rdf:type powla:Terminal;
17-
corpora:hasCitStructure ?CitationLayer.
17+
powla:hasLayer ?DocumentLayer.
1818
?tokenQuer lila:hasLemma ?lemma
1919
} group by ?lemma
2020
order by desc (?freq)
@@ -31,7 +31,7 @@ WHERE {
3131
<http://lila-erc.eu/data/corpora/UDante/id/corpus/Quaestio%20de%20aqua%20et%20terra>
3232
}
3333
?OtherToken rdf:type powla:Terminal;
34-
corpora:hasCitStructure ?OtherCitationLayer .
34+
powla:hasLayer ?OtherCitationLayer .
3535
?OtherCitationLayer powla:hasDocument ?OtherCitationLayerDocument.
3636
Filter NOT EXISTS {
3737
?OtherCitationLayer powla:hasDocument <http://lila-erc.eu/data/corpora/UDante/id/corpus/De%20Vulgari%20Eloquentia> .
@@ -45,3 +45,4 @@ WHERE {
4545
order by desc (?freq)
4646

4747

48+

distinctivelemmas-Fibonacci.rq

+39-39
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2-
prefix ontolex: <http://www.w3.org/ns/lemon/ontolex#>
3-
prefix lila: <http://lila-erc.eu/ontologies/lila/>
4-
prefix powla: <http://purl.org/powla/powla.owl#>
5-
prefix corpora: <http://lila-erc.eu/ontologies/lila_corpora/>
6-
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
7-
8-
# Find all the lemmas that are used only by Fibonacci, thus are not present in the other corpora currently linked in the LiLa KB
9-
SELECT (GROUP_CONCAT(DISTINCT ?wr ;
10-
separator=", ") as ?wrs) ?lemma ?freq
11-
WHERE {
12-
{
13-
SELECT ?lemma (count(?lemma) as ?freq)
14-
WHERE {
15-
?CitationLayer powla:hasDocument <http://lila-erc.eu/data/corpora/CorpusFibonacci/id/corpus/Liber%20Abbaci> .
16-
?tokenQuer rdf:type powla:Terminal;
17-
corpora:hasCitStructure ?CitationLayer.
18-
?tokenQuer lila:hasLemma ?lemma
19-
} group by ?lemma
20-
order by desc (?freq)
21-
}
22-
OPTIONAL {
23-
?lemma lila:isHypolemma ?originalLemmaHypo
24-
}
25-
OPTIONAL {
26-
?lemma lila:lemmaVariant ?originalLemmaVariant
27-
}
28-
minus {
29-
?OtherToken rdf:type powla:Terminal;
30-
corpora:hasCitStructure ?OtherCitationLayer .
31-
Filter NOT EXISTS {
32-
?OtherCitationLayer powla:hasDocument <http://lila-erc.eu/data/corpora/CorpusFibonacci/id/corpus/Liber%20Abbaci> .
33-
}
34-
?OtherToken lila:hasLemma ?lemma .
35-
BIND(?lemma AS ?originalLemmaVariant).
36-
BIND(?lemma AS ?originalLemmaHypo).
37-
}
38-
?lemma ontolex:writtenRep ?wr .
39-
} group by ?lemma ?freq
1+
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2+
prefix ontolex: <http://www.w3.org/ns/lemon/ontolex#>
3+
prefix lila: <http://lila-erc.eu/ontologies/lila/>
4+
prefix powla: <http://purl.org/powla/powla.owl#>
5+
prefix corpora: <http://lila-erc.eu/ontologies/lila_corpora/>
6+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
7+
8+
# Find all the lemmas that are used only by Fibonacci, thus are not present in the other corpora currently linked in the LiLa KB
9+
SELECT (GROUP_CONCAT(DISTINCT ?wr ;
10+
separator=", ") as ?wrs) ?lemma ?freq
11+
WHERE {
12+
{
13+
SELECT ?lemma (count(?lemma) as ?freq)
14+
WHERE {
15+
?DocumentLayer powla:hasDocument <http://lila-erc.eu/data/corpora/CorpusFibonacci/id/corpus/Liber%20Abbaci> .
16+
?tokenQuer rdf:type powla:Terminal;
17+
powla:hasLayer ?DocumentLayer.
18+
?tokenQuer lila:hasLemma ?lemma
19+
} group by ?lemma
20+
order by desc (?freq)
21+
}
22+
OPTIONAL {
23+
?lemma lila:isHypolemma ?originalLemmaHypo
24+
}
25+
OPTIONAL {
26+
?lemma lila:lemmaVariant ?originalLemmaVariant
27+
}
28+
minus {
29+
?OtherToken rdf:type powla:Terminal;
30+
powla:hasLayer ?OtherCitationLayer .
31+
Filter NOT EXISTS {
32+
?OtherCitationLayer powla:hasDocument <http://lila-erc.eu/data/corpora/CorpusFibonacci/id/corpus/Liber%20Abbaci> .
33+
}
34+
?OtherToken lila:hasLemma ?lemma .
35+
BIND(?lemma AS ?originalLemmaVariant).
36+
BIND(?lemma AS ?originalLemmaHypo).
37+
}
38+
?lemma ontolex:writtenRep ?wr .
39+
} group by ?lemma ?freq
4040
order by desc (?freq)

0 commit comments

Comments
 (0)