query-9e17497c6c86b046ada00cbaa028017c

rq turtle/ttl

Count of forms with and without pronunciation audio for given languages

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
  ?language
  ?languageLabel
  ?total
  ?without
  ?with
  ?ratio
{
   {
  SELECT ?language (COUNT(*) AS ?with) {
    {
  SELECT ?language {
    VALUES ?language {
      wd:Q1321
    }
  }
}
    [] dct:language ?language;
       ontolex:lexicalForm [wdt:P443 []]
  }
  GROUP BY ?language
}
   {
  SELECT ?language (COUNT(*) AS ?total) {
     {
  SELECT ?language {
    VALUES ?language {
      wd:Q1321
    }
  }
}
    [] dct:language ?language;
       ontolex:lexicalForm [].
  }
  GROUP BY ?language
}
  BIND((?total - ?with) AS ?without)
  BIND(CONCAT(STR((?with/?total)), " %") AS ?ratio)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY DESC(?without)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?language"):::projected v5("?ratio"):::projected v4("?total"):::projected v3("?with"):::projected v5("?without"):::projected a1((" ")) a3((" ")) a4((" ")) a2((" ")) a5((" ")) c5(["bd:serviceParam"]):::iri c7(["en"]):::literal bind0[/VALUES ?language/] bind0-->v4 bind00(["wd:Q1321"]) bind00 --> bind0 a1 --"dct:language"--> v4 a2 --"wdt:P443"--> a3 a1 --"ontolex:lexicalForm"--> a2 bind2[/"count(*)"/] bind2 --as--o v3 bind3[/VALUES ?language/] bind3-->v4 bind30(["wd:Q1321"]) bind30 --> bind3 a4 --"dct:language"--> v4 a4 --"ontolex:lexicalForm"--> a5 bind5[/"count(*)"/] bind5 --as--o v4 bind6[/"?total - ?with"/] v4 --o bind6 v3 --o bind6 bind6 --as--o v5 bind7[/"concat(str(?with / ?total),' %')"/] v3 --o bind7 v4 --o bind7 bind7 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end