query-7a039190a53b925a1a03adaf617df669
(10) Graph of matrilineal ancestors: Queen VictoriaNo.10 (2019.11.07T0931 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#>
# find matrilineal ancestors (mother's mother's...) of Queen Victoria
#defaultView:Graph
SELECT ?maternal ?maternalLabel ?birthdate ?image ?mother ?motherLabel ?edgeLabel
WHERE {
# define ?maternal as Queen Victoria (Q9439)'s any mother (P25)'s mother's...
wd:Q9439 wdt:P25* ?maternal
# optional: define ?maternal's mother (P25) as ?mother
OPTIONAL {?maternal wdt:P25 ?mother.
# show mother (P25) on graph edges
?edge wikibase:directClaim wdt:P25;
a wikibase:Property}
# optional: show ?maternal's birthdate (P569), which only appears in table, not graph
OPTIONAL {?maternal wdt:P569 ?birthdate}
# optional: show ?maternal's image (P18), which appears directly in graph, and as link in table
OPTIONAL {?maternal wdt:P18 ?image}
# show label in simplified Chinese (zh-hans) as default, and English when no default label exists
SERVICE wikibase:label { bd:serviceParam wikibase:language "zh-hans,en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?birthdate"):::projected
v3("?edge")
v5("?image"):::projected
v1("?maternal"):::projected
v2("?mother"):::projected
c2(["wdt:P25"]):::iri
c9(["bd:serviceParam"]):::iri
c5(["wikibase:Property"]):::iri
c1(["wd:Q9439"]):::iri
c11(["zh-hans,en"]):::literal
c1 -->c2--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -->c2--> v2
v3 -."wikibase:directClaim".-> c2
v3 --"a"--> c5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P569".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end