query-adbe9e6b55759fb996a6a9969287dd3b

rq turtle/ttl

(47) Graph of mitochondrial DNA relatives through inverse path: Elizabeth IINo.47 (2020.07.20T1800 created)

Use at

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 Elizabeth II's mitochondrial DNA relatives through inverse path
# also viewable as table
### Note: In comparison with the previous query "Graph of mitochondrial DNA relatives: Elizabeth II",
### this query uses inverse path (^) of mother (P25) so that one line is saved.
#defaultView:Graph
SELECT ?mtDNA ?mtDNALabel ?birthdate ?image ?mother ?motherLabel ?edgeLabel
WHERE {
  # define ?mtDNA as Elizabeth II (Q9682)'s any mother (P25) or mother of (^P25)'s mother or mother of's...
  wd:Q9682 (wdt:P25|^wdt:P25)* ?mtDNA.
  # limit ?mtDNA's gender (P21) to female (Q6581072)
  ?mtDNA wdt:P21 wd:Q6581072
  # optional: define ?mtDNA's mother (P25) as ?mother
  OPTIONAL {?mtDNA wdt:P25 ?mother.
            # get P25 (mother)'s property label and allow it to appear on graph edge
            ?edge wikibase:directClaim wdt:P25;
               a wikibase:Property}
  # optional: show ?mtDNA's birthdate (P569), which only appears in table, not graph
  OPTIONAL {?mtDNA wdt:P569 ?birthdate}
  # optional: show ?mtDNA's image (P18), which appears directly in graph, and as link in table
  OPTIONAL {?mtDNA 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; v4("?birthdate"):::projected v3("?edge") v5("?image"):::projected v2("?mother"):::projected v1("?mtDNA"):::projected c7(["wikibase:Property"]):::iri c4(["wd:Q6581072"]):::iri c2(["wdt:P25"]):::iri c11(["bd:serviceParam"]):::iri c1(["wd:Q9682"]):::iri c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 -->c2--> c1 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; c1 -->c2--> v1 end union0r <== or ==> union0l end v1 --"wdt:P21"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -->c2--> v2 v3 -."wikibase:directClaim".-> c2 v3 --"a"--> c7 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; c11 --"wikibase:language"--> c13 end