query-9d5228ab7918bda647fdab840bb4391f
Apollo astronauts
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
SELECT ?astronaut ?astronautLabel ?birth ?death (MIN(?start) AS ?firstMission) (GROUP_CONCAT(?missionName;separator=", ") AS ?missions) (COUNT(?mission) AS ?numberOfMissions) WHERE {
?mission wdt:P31 wd:Q752783 .
?mission wdt:P361 wd:Q46611 .
?mission wdt:P619 ?start .
?mission wdt:P620 ?end .
?mission rdfs:label ?missionName . FILTER(lang(?missionName) = "en") .
?mission wdt:P1029 ?astronaut .
?astronaut wdt:P569 ?birth
OPTIONAL{?astronaut wdt:P570 ?death}
SERVICE wikibase:label{bd:serviceParam wikibase:language "en"}
}
GROUP BY ?astronaut ?astronautLabel ?birth ?death
ORDER BY ?firstMission
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?astronaut"):::projected
v7("?birth"):::projected
v8("?death"):::projected
v5("?end")
v9("?firstMission")
v3("?mission"):::projected
v2("?missionName"):::projected
v9("?missions")
v10("?numberOfMissions")
v4("?start"):::projected
c3(["wd:Q752783"]):::iri
c1(["en"]):::literal
c5(["wd:Q46611"]):::iri
c13(["bd:serviceParam"]):::iri
f0[["?missionName = 'en'"]]
f0 --> v2
v3 --"p:direct/P31"--> c3
v3 --"p:direct/P361"--> c5
v3 --"p:direct/P619"--> v4
v3 --"p:direct/P620"--> v5
v3 --"rdfs:label"--> v2
v3 --"p:direct/P1029"--> v6
v6 --"p:direct/P569"--> v7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:direct/P570".-> v8
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c1
end
bind4[/"min(?start)"/]
v4 --o bind4
bind4 --as--o v9
bind5[/"?missionName"/]
v2 --o bind5
bind5 --as--o v9
bind6[/"count(?mission)"/]
v3 --o bind6
bind6 --as--o v10