query-b8dc282bd8105b31a155afe1574245b0
QueryThe following graph was generated thanks to wikidata with this query:
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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?age (COUNT (DISTINCT ?human) AS ?count) WHERE {
?human wdt:P31 wd:Q5 .
?human wdt:P136/wdt:P279 wd:Q11399 .
?human p:P569/psv:P569 ?birth_date_node .
?human p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
BIND(FLOOR((?death_date - ?birth_date)/365.25) as ?age)
FILTER(?age > 10 && ?age < 110) .
}
GROUP BY ?age
ORDER BY ?age
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?age"):::projected
v5("?birth_date")
v3("?birth_date_node")
v7("?count")
v6("?death_date")
v4("?death_date_node")
v2("?human"):::projected
a1((" "))
a2((" "))
a3((" "))
c4(["wd:Q5"]):::iri
c7(["wd:Q11399"]):::iri
f0[["?age > '10^^xsd:integer'?age < '110^^xsd:integer'"]]
f0 --> v7
v2 --"p:direct/P31"--> c4
v2 --"p:direct/P136"--> a1
a1 --"p:direct/P279"--> c7
v2 --"p:P569"--> a2
a2 --"p:statement/value/P569"--> v3
v2 --"p:P570"--> a3
a3 --"p:statement/value/P570"--> v4
v3 --"wikibase:timeValue"--> v5
v4 --"wikibase:timeValue"--> v6
bind1[/"numeric-floor(?death_date - ?birth_date / '365.25^^xsd:decimal')"/]
v6 --o bind1
v5 --o bind1
bind1 --as--o v7
bind3[/"count(?human)"/]
v2 --o bind3
bind3 --as--o v7