query-98e95c6aad67997ec51048cce7d8fb30

rq turtle/ttl

Lexeme classes

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX target: <http://www.wikidata.org/entity/Q9035>

SELECT 
  ?count
  ?class ?classLabel ?classDescription 
  ?example_lexeme ?example_lexemeLabel
  (CONCAT("#lexeme/", SUBSTR(STR(?example_lexeme), 32)) AS ?example_lexemeUrl)
WHERE {
   {
  SELECT 
    (COUNT(?lexeme) AS ?count)
    ?class
    (SAMPLE(?lexeme) AS ?example_lexeme)
  WHERE {
    ?lexeme dct:language target: ;
            wdt:P31 ?class .
  }
  GROUP BY ?class
}  ?example_lexeme wikibase:lemma ?example_lexemeLabel
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?class"):::projected v4("?count"):::projected v4("?example_lexeme"):::projected v5("?example_lexemeLabel"):::projected v6("?example_lexemeUrl") v2("?lexeme") c2([http://www.wikidata.org/entity/Q9035]):::iri c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"dct:language"--> c2 v2 --"wdt:P31"--> v3 bind2[/"count(?lexeme)"/] v2 --o bind2 bind2 --as--o v4 bind3[/"sample(?lexeme)"/] v2 --o bind3 bind3 --as--o v4 v4 --"wikibase:lemma"--> v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end bind4[/"concat('#lexeme/',substring(str(?example_lexeme),'32^^xsd:integer'))"/] v4 --o bind4 bind4 --as--o v6