query-a2a6bec816da32eb0836513f72f0ebad
(45) Graph of extended blood relatives + extended stepfamily members by single-headed arrows: Soong Mei-lingNo.45 (2020.07.20T1116 created)
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 bd: <http://www.bigdata.com/rdf#>
# graph of Soong Mei-ling's extended blood relatives + extended stepfamily members
# also viewable as table
#defaultView:Graph
SELECT ?relative ?relativeLabel ?birthdate ?image ?parent ?parentLabel ?edgeLabel
WHERE {
# define ?relative as Soong Mei-ling (Q17135)'s any father (P22) or mother (P25) or child (P40) or stepparent (P3448) or stepchild (^P3448)'s
# father or mother or child or stepparent or stepchild's...
### Note: A stepchild is reached through the inverse path (^) of stepparent (P3448).
wd:Q17135 (wdt:P22|wdt:P25|wdt:P40|wdt:P3448|^wdt:P3448)* ?relative
# optional: define ?relative's father (P22) or mother (P25) or stepparent (P3448) as ?parent
optional {?relative (wdt:P22|wdt:P25|wdt:P3448) ?parent
# To avoid showing any other relation,
# define ?relation as father (P22) or mother (P25) or stepparent (P3448)
VALUES ?relation {wdt:P22 wdt:P25 wdt:P3448}
# ?relation is from ?relative to ?parent
?relative ?relation ?parent.
# get ?relation's property label and allow it to appear on graph edge
?edge wikibase:directClaim ?relation;
a wikibase:Property}
# optional: show ?relative's birthdate (P569), which only appears in table, not graph
optional {?relative wdt:P569 ?birthdate}
# optional: show ?relative's image (P18), which appears directly in graph, and as link in table
optional {?relative wdt:P18 ?image}
# show label in auto language as default, and English when no default label exists
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?birthdate"):::projected
v4("?edge")
v6("?image"):::projected
v2("?parent"):::projected
v3("?relation")
v1("?relative"):::projected
c8(["wikibase:Property"]):::iri
c12(["bd:serviceParam"]):::iri
c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c1(["wd:Q17135"]):::iri
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
subgraph union3[" Union "]
subgraph union3l[" "]
style union3l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P3448"--> c1
end
subgraph union3r[" "]
style union3r fill:#abf,stroke-dasharray: 3 3;
c1 --"wdt:P3448"--> v1
end
union3r <== or ==> union3l
end
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
c1 --"wdt:P40"--> v1
end
union2r <== or ==> union2l
end
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
c1 --"wdt:P25"--> v1
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
c1 --"wdt:P22"--> v1
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
subgraph union4[" Union "]
subgraph union4l[" "]
style union4l fill:#abf,stroke-dasharray: 3 3;
subgraph union5[" Union "]
subgraph union5l[" "]
style union5l fill:#abf,stroke-dasharray: 3 3;
v1 -."wdt:P3448".-> v2
end
subgraph union5r[" "]
style union5r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P25"--> v2
end
union5r <== or ==> union5l
end
end
subgraph union4r[" "]
style union4r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P22"--> v2
end
union4r <== or ==> union4l
end
bind0[/VALUES ?relation/]
bind0-->v3
bind00(["wdt:P22"])
bind00 --> bind0
bind01(["wdt:P25"])
bind01 --> bind0
bind02(["wdt:P3448"])
bind02 --> bind0
v1 -->v3--> v2
v4 --"wikibase:directClaim"--> v3
v4 --"a"--> c8
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P569".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end