query-99fad0589dd62f644378fa545afd8edb
People who are dead aggregated by decade/yearI wanted to create a counts by decade or year of death of a person. I created this query but it unfortunately it times out
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?year (COUNT(?human) AS ?numHumans)
WHERE
{
?human wdt:P31 wd:Q5;
wdt:P570 ?dateOfDeath .
BIND(YEAR(?dateOfDeath) AS ?year)
}GROUP BY ?year
ORDER BY DESC(?year)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?dateOfDeath")
v2("?human"):::projected
v4("?numHumans")
v4("?year"):::projected
c2(["wd:Q5"]):::iri
v2 --"wdt:P31"--> c2
v2 --"wdt:P570"--> v3
bind0[/"year-from-dateTime(?dateOfDeath)"/]
v3 --o bind0
bind0 --as--o v4
bind2[/"count(?human)"/]
v2 --o bind2
bind2 --as--o v4