query-ac331e695e7c3844921e74decece4a96

rq turtle/ttl

Grammatical genders

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 
  ?lexemes

  ?gender ?genderLabel
  (CONCAT("#grammaticalgender/", SUBSTR(STR(?gender), 32)) AS ?genderUrl)
  ?genderDescription

  ?example_lexeme ?example_lexemeLabel
  (CONCAT("#lexeme/", SUBSTR(STR(?example_lexeme), 32)) AS ?example_lexemeUrl)

WHERE {
   {
  SELECT 
    (COUNT(?lexeme) AS ?lexemes)
    ?gender
    (SAMPLE(?lexeme) AS ?example_lexeme)
  WHERE {
    ?lexeme dct:language target: ; 
            wdt:P5185 ?gender .
  }
  GROUP BY ?gender
}  ?example_lexeme wikibase:lemma ?example_lexemeLabel
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}
ORDER BY DESC(?lexemes)

Query found at

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