query-c70d1d3602c655d9ea0bb4de7c99205b
TODO
Use at
- https://query.wikidata.org/sparql
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/>
SELECT ?comm ?dep1 ?dep2
{
?comm wdt:P31 wd:Q484170 .
MINUS { ?comm wdt:P576 [] }
MINUS { ?comm p:P31 [ ps:P31 wd:Q484170 ; pq:P582 [] ] . }
?comm wdt:P131 ?dep1 . ?dep1 wdt:P31 wd:Q6465 .
?comm wdt:P131 ?dep2 . ?dep2 wdt:P31 wd:Q6465 .
MINUS { ?dep1 wdt:P576 [] }
MINUS { ?comm p:P131 [ ps:P131 ?dep1 ; pq:P582 [] ] . }
MINUS { ?dep2 wdt:P576 [] }
MINUS { ?comm p:P131 [ ps:P131 ?dep2 ; pq:P582 [] ] . }
FILTER ( ?dep1 != ?dep2 )
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?comm"):::projected
v1("?dep1"):::projected
v2("?dep2"):::projected
a1((" "))
a3((" "))
a4((" "))
a2((" "))
a5((" "))
a8((" "))
a6((" "))
a7((" "))
a9((" "))
c8(["wd:Q6465"]):::iri
c2(["wd:Q484170"]):::iri
f0[["?dep1 != ?dep2"]]
f0 --> v1
f0 --> v2
v3 --"p:direct/P31"--> c2
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v3 --"p:direct/P576"--> a1
end
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
a2 --"p:statement/P31"--> c2
a2 --"p:qualifier/P582"--> a3
v3 --"p:P31"--> a2
end
v3 --"p:direct/P131"--> v1
v1 --"p:direct/P31"--> c8
v3 --"p:direct/P131"--> v2
v2 --"p:direct/P31"--> c8
subgraph minus3["MINUS"]
style minus3 stroke-width:6px,fill:pink,stroke:red;
v1 --"p:direct/P576"--> a4
end
subgraph minus4["MINUS"]
style minus4 stroke-width:6px,fill:pink,stroke:red;
a5 --"p:statement/P131"--> v1
a5 --"p:qualifier/P582"--> a6
v3 --"p:P131"--> a5
end
subgraph minus5["MINUS"]
style minus5 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:direct/P576"--> a7
end
subgraph minus6["MINUS"]
style minus6 stroke-width:6px,fill:pink,stroke:red;
a8 --"p:statement/P131"--> v2
a8 --"p:qualifier/P582"--> a9
v3 --"p:P131"--> a8
end