query-91467ecf9512da5043e3ebd426c8b909
diplomatic relation (P530)
Use at
- https://query.wikidata.org/sparql
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 DISTINCT (STRAFTER(STR(?item), STR(wd:)) AS ?1) ?prop (STRAFTER(STR(?second), STR(wd:)) AS ?2) ?qprop (STRAFTER(STR(?subject), STR(wd:)) AS ?3) ('S3452' AS ?S3452) (?2 AS ?from) {
VALUES (?prop ?qprop) {
('P530' 'P805')
} .
?second p:P530 [ ps:P530 ?item; pq:P805 ?subject ] .
MINUS { ?item p:P530 [ ps:P530 ?second; pq:P805 ?subject ] } .
} ORDER BY ?1 ?2
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?1")
v8("?2"):::projected
v8("?3")
v9("?S3452")
v10("?from")
v5("?item"):::projected
v3("?prop"):::projected
v4("?qprop"):::projected
v7("?second"):::projected
v6("?subject"):::projected
a1((" "))
a2((" "))
bind0[/VALUES ?prop ?qprop/]
bind0-->v3
bind0-->v4
bind00(["P530"])
bind00 --> bind0
bind01(["P805"])
bind01 --> bind0
a1 --"p:statement/P530"--> v5
a1 --"p:qualifier/P805"--> v6
v7 --"p:P530"--> a1
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
a2 --"p:statement/P530"--> v7
a2 --"p:qualifier/P805"--> v6
v5 --"p:P530"--> a2
end
bind2[/"substring-after(str(?item),str('wd:'))"/]
v5 --o bind2
bind2 --as--o v8
bind3[/"substring-after(str(?second),str('wd:'))"/]
v7 --o bind3
bind3 --as--o v8
bind4[/"substring-after(str(?subject),str('wd:'))"/]
v6 --o bind4
bind4 --as--o v8
bind5[/"'S3452'"/]
bind5 --as--o v9
bind6[/"?2"/]
v8 --o bind6
bind6 --as--o v10