query-ece872a61c05b8e20727188a82b75a97

rq turtle/ttl

.on Mastodon and on TwitterOriginally posted

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?class ?classLabel ?classDescription ?count WHERE {
   {
  SELECT ?class (COUNT(*) AS ?count) WHERE {
    ?class wdt:P279+ wd:Q34379.
    ?instance wdt:P31 ?class.
  }
  GROUP BY ?class
}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?class"):::projected v4("?count"):::projected v3("?instance") c5(["bd:serviceParam"]):::iri c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal c2(["wd:Q34379"]):::iri v2 --"wdt:P279"--> c2 v3 --"wdt:P31"--> v2 bind1[/"count(*)"/] bind1 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end