Project:Example Queries: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 110: Line 110:


The {{code|inline=y|lang=sparql|OPTIONAL}} argument here keeps in versions where the mappings do not exist in all of them.
The {{code|inline=y|lang=sparql|OPTIONAL}} argument here keeps in versions where the mappings do not exist in all of them.
=== Lexemes ===
==== Lexical Categories ===
This query returns the different lexical categories and the number of lexemes in each:
<syntaxhighlight lang="sparql">SELECT ?item ?itemLabel ?count
WITH {
  SELECT ?item (COUNT(*) AS ?count) {
    [] wikibase:lexicalCategory ?item
  } GROUP BY ?item
} AS %stats
WHERE
{
  include %stats.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY DESC(?count)</syntaxhighlight>


== Complex Queries ==
== Complex Queries ==

Navigation menu