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