DMLEX on Wikibase: Difference between revisions

No edit summary
Line 68: Line 68:
PREFIX lno: <https://lexbib.elex.is/prop/novalue/>
PREFIX lno: <https://lexbib.elex.is/prop/novalue/>


select ?lexeme ?lexeme_nr ?lemma (count (?sense) as ?num_of_senses)
select ?lexeme ?lexeme_nr ?lemma (count (distinct ?sense) as ?num_of_senses) (count (distinct ?def) as ?num_of_defs) (count (distinct ?expl) as ?num_of_examples)
where {
where {
   ?lexeme ldp:P207 lwb:Q34165; wikibase:lemma ?lemma; ontolex:sense ?sense.
   ?lexeme ldp:P207 lwb:Q34165; wikibase:lemma ?lemma; ontolex:sense ?sense.
  optional {?sense ldp:P209 ?def.} optional {?sense ldp:P208 ?expl.}
   bind (xsd:integer(strafter(str(?lexeme),"https://lexbib.elex.is/entity/L")) as ?lexeme_nr)
   bind (xsd:integer(strafter(str(?lexeme),"https://lexbib.elex.is/entity/L")) as ?lexeme_nr)
   filter (?lexeme_nr > 34) # this is because of bug https://phabricator.wikimedia.org/T363312
   filter (?lexeme_nr > 34) # this is because of bug https://phabricator.wikimedia.org/T363312
}
}
group by ?lexeme ?lexeme_nr ?lemma ?num_of_senses  
group by ?lexeme ?lexeme_nr ?lemma ?num_of_senses ?num_of_defs ?num_of_examples
order by ?lexeme_nr
order by ?lexeme_nr
</sparql>
</sparql>