query-5ad1516e8364df0c47cb3890864bafe3
Video game genres and OLAC catalogueHi, (P6352)OLAC video game genre vocabulary ID via (Q60440967)OLAC Video Game Genre Vocabulary and outline the ones that are linked to (Q659563)video game genre I want to make a graph of 17:07, 13 February 2019 (UTC)) talk (Jean-FredI got as far as the following (as well as many many variations) but I don’t seem to be able to get the colours properly… Any help appreciated!
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 ?genre ?genreLabel ?OLAC ?_subclass_of ?_subclass_ofLabel ?rgb WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?genre wdt:P31 wd:Q659563.
?genre wdt:P279 ?_subclass_of.
#?_subclass_of wdt:P31 wd:Q659563.
OPTIONAL { ?genre wdt:P6352 ?OLAC. }
#OPTIONAL { ?_subclass_of wdt:P6352 ?OLAC. }
BIND(IF(BOUND(?OLAC),"FFA500","7FFF00") AS ?rgb).
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?OLAC"):::projected
v2("?_subclass_of"):::projected
v1("?genre"):::projected
v4("?rgb"):::projected
c2(["bd:serviceParam"]):::iri
c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c6(["wd:Q659563"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v1 --"wdt:P31"--> c6
v1 --"wdt:P279"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P6352".-> v3
end
bind0[/"if(bound(?OLAC),'FFA500','7FFF00')"/]
v3 --o bind0
bind0 --as--o v4