query-0be221b5f41a156021fdcbf575badaa3

rq turtle/ttl

The Apollo example on bound and filterThe « bound » trick is not necessary here,

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#>
SELECT distinct ?astronaut ?astronautLabel
WHERE
{
  ?astronaut wdt:P31 wd:Q5;
             wdt:P106 wd:Q11631.
  {
    ?astronaut wdt:P450/wdt:P31 wd:Q495307.
  } union {
    ?astronaut wdt:P450 wd:Q182252.
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?astronaut"):::projected a1((" ")) c7(["wd:Q182252"]):::iri c9(["bd:serviceParam"]):::iri c11(["#91;AUTO_LANGUAGE#93;"]):::literal c2(["wd:Q5"]):::iri c4(["wd:Q11631"]):::iri c6(["wd:Q495307"]):::iri v1 --"wdt:P31"--> c2 v1 --"wdt:P106"--> c4 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P450"--> c7 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P450"--> a1 a1 --"wdt:P31"--> c6 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end