-
Notifications
You must be signed in to change notification settings - Fork 0
/
count_LexEntry_by_PoS.rq
52 lines (48 loc) · 1.83 KB
/
count_LexEntry_by_PoS.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
41
42
43
44
45
46
47
48
49
50
51
52
###############################################
# TITLE: Velez's Dictionary - Number of Lexical Entries
# DESCRIPTION: Compute the number of lexical entries according to part-of-speech in Velez's and in Lewis and Short's lexica.
###############################################
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX lila: <http://lila-erc.eu/ontologies/lila/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX lime: <http://www.w3.org/ns/lemon/lime#>
PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
SELECT ?partofspeech ?VelezIndex (xsd:decimal(10000*?VelezIndex/?VZtotal)/100 AS ?VelezIndex_pc) ?LewisShort (xsd:decimal(10000*?LewisShort/?LStotal)/100 AS ?LewisShort_pc)
{
# compute lexical entries per PoS
{
SELECT ?partofspeech (count(?V_lexentry) as ?VelezIndex) (count(?LS_lexentry) as ?LewisShort)
{
{
{
<http://lila-erc.eu/data/lexicalResources/LatinPortuguese/Velez/Lexicon> lime:entry ?V_lexentry .
?V_lexentry ontolex:canonicalForm ?V_lemma .
?V_lemma lila:hasPOS ?UPOS.
?UPOS rdfs:label ?partofspeech .
}
} UNION {
{
<http://lila-erc.eu/data/lexicalResources/LewisShort/Lexicon> lime:entry ?LS_lexentry .
?LS_lexentry ontolex:canonicalForm ?LS_lemma .
?LS_lemma lila:hasPOS ?UPOS.
?UPOS rdfs:label ?partofspeech .
}
}
} group by ?partofspeech order by desc(?VelezIndex)
}
# compute total numbers
{
SELECT (count(?V_lexentry) as ?VZtotal) (count(?LS_lexentry) as ?LStotal)
{
{
{
<http://lila-erc.eu/data/lexicalResources/LatinPortuguese/Velez/Lexicon> lime:entry ?V_lexentry .
}
} UNION {
{
<http://lila-erc.eu/data/lexicalResources/LewisShort/Lexicon> lime:entry ?LS_lexentry .
}
}
}
}
}