query-04849c727463a098187b8ed1ab770db6
title: Most common P31 for entities that develop games SELECT ?type ?typeLabel (COUNT(?game) as ?games) WHERE { ?game wdt:P31 wd:Q7889. ?game wdt:P178 ?developer. ?developer wdt:P31 ?type. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?type ?typeLabel ORDER BY DESC(?games)
Use at
- https://query.wikidata.org/sparql
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#>
#title: Most common P31 for entities that develop games
SELECT ?type ?typeLabel (COUNT(?game) as ?games) WHERE {
?game wdt:P31 wd:Q7889.
?game wdt:P178 ?developer.
?developer wdt:P31 ?type.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?type ?typeLabel
ORDER BY DESC(?games)
Query found at
- https://www.wikidata.org/wiki/Wikidata:Project_chat/Archive/2022/10
- https://www.wikidata.org/wiki/Wikidata_talk:WikiProject_Companies
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?developer")
v2("?game"):::projected
v5("?games")
v4("?type"):::projected
c5(["bd:serviceParam"]):::iri
c2(["wd:Q7889"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"wdt:P31"--> c2
v2 --"wdt:P178"--> v3
v3 --"wdt:P31"--> v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end
bind1[/"count(?game)"/]
v2 --o bind1
bind1 --as--o v5