query-0113d7105e018347d783fbcb8b04fd2a

rq turtle/ttl

Humans whose occupation is Go professional or Go player SELECT ?goplayer ?goplayerLabel ?nativename ?occupationLabel ?genderLabel ?nationalityLabel ?birthdate ?goratings ?teacherLabel WHERE { # define occupation as Go professional (Q3186699) or Go player (Q12039558) values ?occupation {wd:Q3186699 wd:Q12039558} # find humans whose occupation (P106) is as defined above ?goplayer wdt:P106 ?occupation optional {?goplayer wdt:P1559 ?nativename} # P1559: name in native language optional {?goplayer wdt:P27 ?nationality} # P27: country of citizenship optional {?goplayer wdt:P2805 ?goratings} # P2805: Goratings ID optional {?goplayer wdt:P21 ?gender} # P21: sex or gender optional {?goplayer wdt:P569 ?birthdate} # P569: date of birth optional {?goplayer wdt:P1066 ?teacher} # P1066: student of # 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".} }

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#>
# Humans whose occupation is Go professional or Go player
SELECT ?goplayer ?goplayerLabel ?nativename ?occupationLabel ?genderLabel ?nationalityLabel ?birthdate ?goratings ?teacherLabel
WHERE {
  # define occupation as Go professional (Q3186699) or Go player (Q12039558)
  values ?occupation {wd:Q3186699 wd:Q12039558} 
  # find humans whose occupation (P106) is as defined above
  ?goplayer wdt:P106 ?occupation
  optional {?goplayer wdt:P1559 ?nativename} # P1559: name in native language
  optional {?goplayer wdt:P27 ?nationality} # P27: country of citizenship
  optional {?goplayer wdt:P2805 ?goratings} # P2805: Goratings ID
  optional {?goplayer wdt:P21 ?gender} # P21: sex or gender
  optional {?goplayer wdt:P569 ?birthdate} # P569: date of birth
  optional {?goplayer wdt:P1066 ?teacher} # P1066: student of
  # 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; v7("?birthdate"):::projected v6("?gender") v2("?goplayer"):::projected v5("?goratings"):::projected v4("?nationality") v3("?nativename"):::projected v1("?occupation") v8("?teacher") c9(["bd:serviceParam"]):::iri c11(["zh-hans,en"]):::literal bind0[/VALUES ?occupation/] bind0-->v1 bind00(["wd:Q3186699"]) bind00 --> bind0 bind01(["wd:Q12039558"]) bind01 --> bind0 v2 --"wdt:P106"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P1559".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P27".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P2805".-> v5 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P21".-> v6 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P569".-> v7 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P1066".-> v8 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end