query-13c218c82cfa4c0bd09fef1694816cb2

rq turtle/ttl

Languages

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT 
  ?glosses
  ?language_code
  ?language ?languageLabel
  (CONCAT("#language/", SUBSTR(STR(?language), 32)) AS ?languageUrl)
WHERE {
   {
  SELECT 
    (COUNT(?gloss) AS ?glosses)
    ?language_code
  WHERE {
    ?sense skos:definition ?gloss .
    BIND(LANG(?gloss) AS ?language_code)
  }
  GROUP BY ?language_code
}  OPTIONAL {
    ?language wdt:P305 ?language_code .
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?glosses)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?gloss") v5("?glosses"):::projected v5("?language"):::projected v6("?languageUrl") v4("?language_code"):::projected v2("?sense") c4(["bd:serviceParam"]):::iri c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"skos:definition"--> v3 bind0[/"?gloss"/] v3 --o bind0 bind0 --as--o v4 bind2[/"count(?gloss)"/] v3 --o bind2 bind2 --as--o v5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P305".-> v4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end bind3[/"concat('#language/',substring(str(?language),'32^^xsd:integer'))"/] v5 --o bind3 bind3 --as--o v6