query-c2531903eb45a1510e6ab31d759cdad0

rq turtle/ttl

Lexical categories for language

Use at

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

SELECT
  ?lexemes
  (CONCAT("#language/", SUBSTR(STR(target:), 32), "/lexicalcategory/", SUBSTR(STR(?lexical_category), 32)) AS ?lexemesUrl)

  ?lexical_category ?lexical_categoryLabel
  (CONCAT("#lexicalcategory/", SUBSTR(STR(?lexical_category), 32)) AS ?lexical_categoryUrl)

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

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?example_lemma"):::projected v4("?example_lexeme"):::projected v8("?example_lexemeLabel") v9("?example_lexemeUrl") v2("?lexeme") v4("?lexemes"):::projected v6("?lexemesUrl") v3("?lexical_category"):::projected v7("?lexical_categoryUrl") c2([http://www.wikidata.org/entity/Q9035]):::iri c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"dct:language"--> c2 v2 --"wikibase:lexicalCategory"--> 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('#language/',substring(str(http://www.wikidata.org/entity/Q9035),'32^^xsd:integer'),'/lexicalcategory/',substring(str(?lexical_category),'32^^xsd:integer'))"/] v3 --o bind4 bind4 --as--o v6 bind5[/"concat('#lexicalcategory/',substring(str(?lexical_category),'32^^xsd:integer'))"/] v3 --o bind5 bind5 --as--o v7 bind6[/"?example_lemma"/] v5 --o bind6 bind6 --as--o v8 bind7[/"concat('#lexeme/',substring(str(?example_lexeme),'32^^xsd:integer'))"/] v4 --o bind7 bind7 --as--o v9