query-b5feff217fce5268a18d8f307baf3f8f

rq turtle/ttl

Graph version of above query

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 ?from ?fromLabel ?image1 ?to ?toLabel ?image2 ?edgeLabel 
WHERE {
  {
?from wdt:P361 wd:Q107663668.
wd:Q107663668 wdt:P18 ?image2.
      BIND(wd:Q107663668 AS ?to)
    BIND("part of" as ?edgeLabel)
    OPTIONAL{?from wdt:P18 ?image1}
  }
UNION { ?from wdt:P361 wd:Q107663668; wdt:P180 ?to. # depiction
       BIND("depicts" as ?edgeLabel)
       OPTIONAL{?from wdt:P18 ?image1}
  }
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; v6("?edgeLabel"):::projected v1("?from"):::projected v5("?image1"):::projected v2("?image2"):::projected v3("?to"):::projected c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal c2(["wd:Q107663668"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P361"--> c2 v1 --"wdt:P180"--> v3 bind0[/"'depicts'"/] bind0 --as--o v6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P18".-> v5 end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P361"--> c2 c2 --"wdt:P18"--> v2 bind1[/"'wd:Q107663668'"/] bind1 --as--o v3 bind2[/"'part of'"/] bind2 --as--o v6 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P18".-> v5 end end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end