query-0c07dd8ae74ecbe509b4743e7aa42b82
People on the moon
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 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 ?firstTimeOnMoon ?lastTimeOnMoon ?death ((?firstTimeOnMoon-?birth)/365.25 AS ?ageOnMoon) WHERE {
?astronaut wdt:P31 wd:Q5 .
?astronaut p:P793 ?moonwalk .
?moonwalk v:P793 wd:Q42882411 .
?moonwalk pq:P580 ?firstTimeOnMoon .
?moonwalk pq:P582 ?lastTimeOnMoon .
?astronaut wdt:P569 ?birth
OPTIONAL{?astronaut wdt:P570 ?death}
SERVICE wikibase:label{bd:serviceParam wikibase:language "en"}
} ORDER BY ?firstTimeOnMoon ?lastTimeOnMoon ?birth
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?ageOnMoon")
v4("?astronaut"):::projected
v3("?birth"):::projected
v6("?death"):::projected
v1("?firstTimeOnMoon"):::projected
v2("?lastTimeOnMoon"):::projected
v5("?moonwalk")
c5(["wd:Q42882411"]):::iri
c13(["en"]):::literal
c11(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
v4 --"p:direct/P31"--> c2
v4 --"p:P793"--> v5
v5 --"p:statement/P793"--> c5
v5 --"p:qualifier/P580"--> v1
v5 --"p:qualifier/P582"--> v2
v4 --"p:direct/P569"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:direct/P570".-> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end
bind0[/"?firstTimeOnMoon - ?birth / '365.25^^xsd:decimal'"/]
v1 --o bind0
v3 --o bind0
bind0 --as--o v7