query-7f30f846e8ac593e245f9098f3851259

rq turtle/ttl

Attestors per language

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#>
SELECT 
  ?attestors
  (CONCAT("#language/", SUBSTR(STR(?language), 32), "/lexemeattestor") AS ?attestorsUrl)

  ?language ?languageLabel
  (CONCAT("#language/", SUBSTR(STR(?language), 32)) AS ?languageUrl)

  ?example_attestor ?example_attestorLabel
  (CONCAT("#lexemeattestor/", SUBSTR(STR(?example_attestor), 32)) AS ?example_attestorUrl)

WHERE {
   {
  SELECT 
    (COUNT(DISTINCT ?attestor) AS ?attestors)
    ?language
    (SAMPLE(?attestor) AS ?example_attestor)
  WHERE {
    [] dct:language ?language ;
       wdt:P5323 ?attestor .
  }
  GROUP BY ?language
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?attestors)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?attestor") v4("?attestors"):::projected v5("?attestorsUrl") v4("?example_attestor"):::projected v7("?example_attestorUrl") v2("?language"):::projected v6("?languageUrl") a1((" ")) c4(["bd:serviceParam"]):::iri c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal a1 --"dct:language"--> v2 a1 --"wdt:P5323"--> v3 bind2[/"count(?attestor)"/] v3 --o bind2 bind2 --as--o v4 bind3[/"sample(?attestor)"/] v3 --o bind3 bind3 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end bind4[/"concat('#language/',substring(str(?language),'32^^xsd:integer'),'/lexemeattestor')"/] v2 --o bind4 bind4 --as--o v5 bind5[/"concat('#language/',substring(str(?language),'32^^xsd:integer'))"/] v2 --o bind5 bind5 --as--o v6 bind6[/"concat('#lexemeattestor/',substring(str(?example_attestor),'32^^xsd:integer'))"/] v4 --o bind6 bind6 --as--o v7