query-5029efced84df5586af35bd7d94f6dfd
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?other ?otherLabel ?dirLabel ?otherdirLabel {
?item wdt:P1080 wd:Q17562848;
p:P47 [ ps:P47 ?other; pq:P560 ?dir ] .
MINUS {
?other p:P47 [ ps:P47 ?item; pq:P560/wdt:P461 ?dir ] .
} .
OPTIONAL { ?other p:P47 [ ps:P47 ?item; pq:P560 ?otherdir ] } .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?dir")
v1("?item"):::projected
v2("?other"):::projected
v4("?otherdir")
a1((" "))
a2((" "))
a3((" "))
a4((" "))
c2(["wd:Q17562848"]):::iri
c8(["bd:serviceParam"]):::iri
c10(["en"]):::literal
v1 --"p:direct/P1080"--> c2
a1 --"p:statement/P47"--> v2
a1 --"p:qualifier/P560"--> v3
v1 --"p:P47"--> a1
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
a2 --"p:statement/P47"--> v1
a2 --"p:qualifier/P560"--> a3
a3 --"p:direct/P461"--> v3
v2 --"p:P47"--> a2
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
a4 -."p:statement/P47".-> v1
a4 --"p:qualifier/P560"--> v4
v2 --"p:P47"--> a4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end