query-893a56922db139177ef1efecc12a6572

rq turtle/ttl

Genres & OLAC (P6352)OLAC video game genre vocabulary ID and outline the ones that are linked to (Q659563)video game genre I want to make a graph of Graph of video games genres (P6352)OLAC video game genre vocabulary ID and outline the ones that are linked to (Q659563)video game genre Graph 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#>
#defaultView:Graph
SELECT DISTINCT ?genre ?genreLabel ?rgb ?OLAC ?_subclass_of ?_subclass_ofLabel WHERE {
  ?genre wdt:P31 wd:Q659563.
  OPTIONAL {
    ?genre wdt:P279 ?_subclass_of.
    { ?_subclass_of wdt:P31 wd:Q659563. } UNION {?_subclass_of wdt:P279 wd:Q2249149.}
  }

  OPTIONAL { ?genre wdt:P6352 ?OLAC. }
  BIND(IF(BOUND(?OLAC), "FFA500", "7FFF00") 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; v3("?OLAC"):::projected v2("?_subclass_of"):::projected v1("?genre"):::projected v4("?rgb"):::projected c4(["wd:Q2249149"]):::iri c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal c2(["wd:Q659563"]):::iri v1 --"wdt:P31"--> c2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P279".-> v2 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P279"--> c4 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c2 end union0r <== or ==> union0l end end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P6352".-> v3 end bind0[/"if(bound(?OLAC),'FFA500','7FFF00')"/] v3 --o bind0 bind0 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end