query-1a2e1676e95151143cf052fa01eb2499
spouse (P26)
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 p: <http://www.wikidata.org/prop/>
SELECT DISTINCT (STRAFTER(STR(?item), STR(wd:)) AS ?1) ('P26' AS ?P26) (STRAFTER(STR(?target), STR(wd:)) AS ?2) ('S3452' AS ?S3452) (?2 AS ?from) {
?target p:P26/ps:P26 ?item .
MINUS { ?item p:P26/ps:P26 ?target } .
?item wdt:P40/^wdt:P40 ?target;
wdt:P21/wdt:P461/^wdt:P21 ?target .
} ORDER BY ?1
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?1")
v5("?2"):::projected
v4("?P26")
v6("?S3452")
v7("?from")
v3("?item"):::projected
v2("?target"):::projected
a1((" "))
a2((" "))
a3((" "))
a4((" "))
a5((" "))
v2 --"p:P26"--> a1
a1 --"p:statement/P26"--> v3
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v3 --"p:P26"--> a2
a2 --"p:statement/P26"--> v2
end
v3 --"p:direct/P40"--> a3
v2 --"p:direct/P40"--> a3
v3 --"p:direct/P21"--> a4
a4 --"p:direct/P461"--> a5
v2 --"p:direct/P21"--> a5
bind1[/"substring-after(str(?item),str('wd:'))"/]
v3 --o bind1
bind1 --as--o v4
bind2[/"'P26'"/]
bind2 --as--o v4
bind3[/"substring-after(str(?target),str('wd:'))"/]
v2 --o bind3
bind3 --as--o v5
bind4[/"'S3452'"/]
bind4 --as--o v6
bind5[/"?2"/]
v5 --o bind5
bind5 --as--o v7