query-84dd9fbff6a2f21482fbe33492a41e39
VG dashboard of “Videogame-like entities”, ie: (P31)instance of I want to make a (Listeria-based) dashboard of the counts of all (Q56196027)Stuff Pack , (Q56191369)Game Pack , (Q55632755)season pass , (Q7094106)online pass , (Q56196027)Stuff Pack , (Q1066707)downloadable content and all its subclasses ((Q209163)expansion pack (Q865493)video game mod (Q4393107)video game remake (Q60997816)video game edition (Q7058673)video game series (Q16070115)video game compilation (Q7889)video game because that includes all game mode, game genres, etc.) (Q7889)video game of Property:P279(I can’t just take all
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#>
SELECT ?type ?typeLabel ?count
WHERE {
{
SELECT ?type WHERE {
VALUES ?basetype {
wd:Q16070115
wd:Q7058673
wd:Q209163
wd:Q4393107
wd:Q865493
wd:Q60997816
}
?type wdt:P279* ?basetype.
}
}
{
SELECT ?type (COUNT(?item) as ?count) WHERE {
{
SELECT ?type WHERE {
VALUES ?basetype {
wd:Q16070115
wd:Q7058673
wd:Q209163
wd:Q4393107
wd:Q865493
wd:Q60997816
}
?type wdt:P279* ?basetype.
}
}
{
?item wdt:P31 ?type.
}UNION{
BIND(wd:Q7889 AS ?type).
?item wdt:P31 ?type.
}
}
GROUP BY ?type
}
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;
v4("?basetype")
v5("?count"):::projected
v4("?item")
v5("?type"):::projected
c4(["bd:serviceParam"]):::iri
c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/VALUES ?basetype/]
bind0-->v4
bind00(["wd:Q16070115"])
bind00 --> bind0
bind01(["wd:Q7058673"])
bind01 --> bind0
bind02(["wd:Q209163"])
bind02 --> bind0
bind03(["wd:Q4393107"])
bind03 --> bind0
bind04(["wd:Q865493"])
bind04 --> bind0
bind05(["wd:Q60997816"])
bind05 --> bind0
v5 --"wdt:P279"--> v4
bind1[/VALUES ?basetype/]
bind1-->v4
bind10(["wd:Q16070115"])
bind10 --> bind1
bind11(["wd:Q7058673"])
bind11 --> bind1
bind12(["wd:Q209163"])
bind12 --> bind1
bind13(["wd:Q4393107"])
bind13 --> bind1
bind14(["wd:Q865493"])
bind14 --> bind1
bind15(["wd:Q60997816"])
bind15 --> bind1
v5 --"wdt:P279"--> v4
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
bind2[/"'wd:Q7889'"/]
bind2 --as--o v5
v4 --"wdt:P31"--> v5
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v4 --"wdt:P31"--> v5
end
union0r <== or ==> union0l
end
bind4[/"count(?item)"/]
v4 --o bind4
bind4 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end