query-ae19c76df963d3f9cef4df8c99adb45c

rq turtle/ttl

(6) Graph of master-disciple relations: Minoru KitaniNo.6 (2019.11.06T1529 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 master-disciple relations of Minoru Kitani (木谷实)
#defaultView:Graph
SELECT ?person ?personLabel ?birthdate ?image ?student ?studentLabel ?edgeLabel
WHERE {
  # define ?person as Minoru Kitani (Q724312)'s
  # any student (P802) or teacher (P1066)'s student or teacher's...
  wd:Q724312 (wdt:P802|wdt:P1066)* ?person
  # optional: define ?person's student (P802) as ?student
  OPTIONAL {?person wdt:P802 ?student.
           # show student (P802) on graph edges
           ?edge wikibase:directClaim wdt:P802;
               a wikibase:Property}
  # optional: show ?person's birthdate (P569), which only appears in table, not graph
  OPTIONAL {?person wdt:P569 ?birthdate}
  # optional: show ?person's image (P18), which appears directly in graph, and as link in table
  OPTIONAL {?person 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("?person"):::projected v2("?student"):::projected c1(["wd:Q724312"]):::iri c10(["bd:serviceParam"]):::iri c2(["wdt:P802"]):::iri c6(["wikibase:Property"]):::iri c12(["zh-hans,en"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; c1 --"wdt:P1066"--> v1 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; c1 -->c2--> v1 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -->c2--> v2 v3 -."wikibase:directClaim".-> c2 v3 --"a"--> c6 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; c10 --"wikibase:language"--> c12 end