query-59394d1ea8119147bf1cfe94b5998e08
TODO
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 DISTINCT ?item ?itemLabel ?rgb ?link ?linkLabel WHERE {
{
?item wdt:P31/wdt:P279* wd:Q55341040; # ?item is a video games database
wdt:P10568 ?link. # which is linked to ?link
}
UNION
{
?item ^wdt:P10568 ?vgd. # item is linked to from ?vgd
?vgd wdt:P31/wdt:P279* wd:Q55341040; # ?vgd is a video games database
OPTIONAL {
?item wdt:P10568 ?link. # item might be linked to ?link
}
}
OPTIONAL {
?item wdt:P1687 ?property.
}
BIND(IF(BOUND(?property),"FFA500","") AS ?rgb)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v2("?link"):::projected
v4("?property")
v5("?rgb"):::projected
v3("?vgd")
a1((" "))
a2((" "))
c7(["bd:serviceParam"]):::iri
c3(["wd:Q55341040"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P10568"--> v1
v3 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P10568".-> v2
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P10568"--> v2
end
union0r <== or ==> union0l
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P1687".-> v4
end
bind0[/"if(bound(?property),'FFA500','')"/]
v4 --o bind0
bind0 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end