query-8e7bb2f632f0306d8d96ae0948d88c76
child (P40)
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) ('P40' AS ?P40) (STRAFTER(STR(?child), STR(wd:)) AS ?2) ('S3452' AS ?S3452) (?2 AS ?from) {
VALUES (?wdt1 ?wdt2) {
(wdt:P22 wdt:P25)
(wdt:P25 wdt:P22)
} .
?child ?wdt1 ?item .
MINUS { ?item p:P40/ps:P40 ?child } .
?child ?wdt2 [ p:P26/ps:P26 ?item ] .
} ORDER BY ?1
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?1")
v7("?2"):::projected
v6("?P40")
v8("?S3452")
v4("?child"):::projected
v9("?from")
v5("?item"):::projected
v2("?wdt1")
v3("?wdt2")
a1((" "))
a2((" "))
a3((" "))
bind0[/VALUES ?wdt1 ?wdt2/]
bind0-->v2
bind0-->v3
bind00(["p:direct/P22"])
bind00 --> bind0
bind01(["p:direct/P25"])
bind01 --> bind0
bind02(["p:direct/P25"])
bind02 --> bind0
bind03(["p:direct/P22"])
bind03 --> bind0
v4 -->v2--> v5
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v5 --"p:P40"--> a1
a1 --"p:statement/P40"--> v4
end
a2 --"p:P26"--> a3
a3 --"p:statement/P26"--> v5
v4 -->v3--> a2
bind2[/"substring-after(str(?item),str('wd:'))"/]
v5 --o bind2
bind2 --as--o v6
bind3[/"'P40'"/]
bind3 --as--o v6
bind4[/"substring-after(str(?child),str('wd:'))"/]
v4 --o bind4
bind4 --as--o v7
bind5[/"'S3452'"/]
bind5 --as--o v8
bind6[/"?2"/]
v7 --o bind6
bind6 --as--o v9