query-6a984d36827226afe3998a2aed28587d

rq turtle/ttl

Finding co-classes of computer-related items

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 (COUNT(?item) AS ?items)
WHERE
{
  VALUES ?classes {wd:Q5300 wd:Q241317 wd:Q259864 wd:Q272683 wd:Q1303814 wd:13407144}
  ?item wdt:P31 ?classes.
  ?item wdt:P31 ?class.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?class ?classLabel
ORDER BY DESC(?items)
LIMIT 25

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?class"):::projected v2("?classes") v3("?item"):::projected v5("?items") c3(["bd:serviceParam"]):::iri c5(["en"]):::literal bind0[/VALUES ?classes/] bind0-->v2 bind00(["wd:Q5300"]) bind00 --> bind0 bind01(["wd:Q241317"]) bind01 --> bind0 bind02(["wd:Q259864"]) bind02 --> bind0 bind03(["wd:Q272683"]) bind03 --> bind0 bind04(["wd:Q1303814"]) bind04 --> bind0 bind05(["wd:13407144"]) bind05 --> bind0 v3 --"wdt:P31"--> v2 v3 --"wdt:P31"--> v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c3 --"wikibase:language"--> c5 end bind2[/"count(?item)"/] v3 --o bind2 bind2 --as--o v5