query-8653da5dfea46328956bc066fd9c87bd

rq turtle/ttl

(41) Graph of Y-chromosomal relatives: JesusNo.41 (2020.07.15T1347 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#>
# find Jesus's Y-chromosomal relatives, i.e., those males who share a Y-chromosomal common ancestor with Jesus
### Note: In comparison with the previous query "Graph of Y chromosome descendants of a common ancestor (paternal relatives): Jesus",
### this query removes "wd:Q302 (wdt:P22|wdt:P40)* ?Y" (unnecessarily defining ?Y as Jesus (Q302)'s any father (P22) or child (P40)'s father or child's...)
### and has a structure more similar to that in the parent section "Graph of blood relatives: Jia Baoyu".
#defaultView:Graph
SELECT DISTINCT ?Y ?YLabel ?birthdate ?image ?father ?fatherLabel ?edgeLabel
WHERE {
  # define ?Adam as Jesus (Q302)'s any father (P22)'s father's...
  wd:Q302 wdt:P22* ?Adam.
  # define ?Y as one whose any father (P22)'s father's... is ?Adam
  ?Y wdt:P22* ?Adam.
  # limit ?Y's gender (P21) to male (Q6581097)
  ?Y wdt:P21 wd:Q6581097
  # optional: define ?Y's father (P22) as ?father
  OPTIONAL {?Y wdt:P22 ?father.
            # get P22 (father)'s property label and allow it to appear on graph edge
            ?edge wikibase:directClaim wdt:P22;
               a wikibase:Property}
  # optional: show ?Y's birthdate (P569), which only appears in table, not graph
  OPTIONAL {?Y wdt:P569 ?birthdate}
  # optional: show ?Y's image (P18), which appears directly in graph, and as link in table
  OPTIONAL {?Y 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; v1("?Adam") v2("?Y"):::projected v5("?birthdate"):::projected v4("?edge") v3("?father"):::projected v6("?image"):::projected c7(["wikibase:Property"]):::iri c4(["wd:Q6581097"]):::iri c1(["wd:Q302"]):::iri c2(["wdt:P22"]):::iri c11(["bd:serviceParam"]):::iri c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal c1 -->c2--> v1 v2 -->c2--> v1 v2 --"wdt:P21"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -->c2--> v3 v4 -."wikibase:directClaim".-> c2 v4 --"a"--> c7 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P569".-> v5 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P18".-> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end