query-7e3b4e534fbbf7f9d490e60bc9136ad1

rq turtle/ttl

genre vs. subclass) which are used as a class: (Q7889)video game There are over 100 genres (which are also subclass of

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 ?cnt) (SAMPLE(?item) as ?example) WHERE {
  ?item wdt:P31 ?class.
  ?item wdt:P31/wdt:P279+ wd:Q7889.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?class ?classLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?class"):::projected v3("?cnt") v4("?example") v1("?item"):::projected a1((" ")) c5(["bd:serviceParam"]):::iri c3(["wd:Q7889"]):::iri c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"wdt:P31"--> v2 v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end bind2[/"count(?item)"/] v1 --o bind2 bind2 --as--o v3 bind3[/"sample(?item)"/] v1 --o bind3 bind3 --as--o v4