SPARQL queries: Difference between revisions

(Created page with "Here you find some SPARQL queries that you can use, and also modify or combine. =Lexical Entries= <sparql tryit="1"> # this lists all lexcial entries, with lemma and pos, ordered alphabetically by lemma select ?entry ?lemma ?posLabel where {?entry a ontolex:LexicalEntry; wikibase:lemma ?lemma; wikibase:lexicalCategory [rdfs:label ?posLabel]. filter(lang(?posLabel)="en")} order by lcase(?lemma) </sparql> =Dialectal lemm...")
 
Line 23: Line 23:
       }
       }
GROUP BY ?dialect ?dialectLabel ?variants ORDER BY DESC(?variants)
GROUP BY ?dialect ?dialectLabel ?variants ORDER BY DESC(?variants)
</sparql>
=Part of speech (lexical category)=
<sparql tryit="1">
#defaultView:BarChart
PREFIX qdp: <https://qichwa.wikibase.cloud/prop/direct/>
select ?pos ?posLabel (count(?entry) as ?count)
where {
?entry a ontolex:LexicalEntry;
      wikibase:lemma ?lemma;
      wikibase:lexicalCategory ?pos_finegrained.
      ?pos_finegrained qdp:P4 ?pos. ?pos rdfs:label ?posLabel . filter(lang(?posLabel)="en")
} group by ?pos ?posLabel ?count
order by desc(?count)
</sparql>
</sparql>