query-0163783ef5a4ddb1a55019cec0ae0da2
Deaths by decade
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
#defaultView:BarChart
PREFIX target: <http://www.wikidata.org/entity/Q3380319>
SELECT
(CONCAT(?year_, "0") AS ?year)
(COUNT(?person) AS ?persons)
WHERE {
?person wdt:P119 target: ;
wdt:P570 ?death_datetime .
BIND(SUBSTR(STR(YEAR(?death_datetime)), 1, 3) AS ?year_)
FILTER (!STRSTARTS(STR(?death_datetime), "http://www.wikidata.org/.well-known/genid/"))
}
GROUP BY ?year_ ?death_datetime
ORDER BY ?year
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?death_datetime")
v3("?person"):::projected
v5("?persons")
v5("?year")
v4("?year_"):::projected
c3([http://www.wikidata.org/entity/Q3380319]):::iri
f0[["not starts-with(str(?death_datetime),'http://www.wikidata.org/.well-known/genid/')"]]
f0 --> v2
v3 --"wdt:P119"--> c3
v3 --"wdt:P570"--> v2
bind1[/"substring(str(year-from-dateTime(?death_datetime)),'1^^xsd:integer','3^^xsd:integer')"/]
v2 --o bind1
bind1 --as--o v4
bind3[/"concat(?year_,'0')"/]
v4 --o bind3
bind3 --as--o v5
bind4[/"count(?person)"/]
v3 --o bind4
bind4 --as--o v5