query-462f5cdefde378b65e5afae10ec77367

rq turtle/ttl

Number of dead people by month since 2000

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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/>
#defaultView:LineChart
SELECT  ?yearmonth (COUNT(?person) as ?count)
WHERE
{
  ?person wdt:P31 wd:Q5;
          p:P570/psv:P570 [
                wikibase:timePrecision "10"^^xsd:integer ; # precision of at least month
                wikibase:timeValue ?date ;
              ] .
  BIND(CONCAT(STR(YEAR(?date)),"-",STR(MONTH(?date))) as ?yearmonth).
  FILTER( ?date >= "2000-01-01T00:00:00"^^xsd:dateTime )
}
GROUP BY ?yearmonth

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?count") v1("?date") v2("?person"):::projected v3("?yearmonth"):::projected a2((" ")) a1((" ")) c3(["wd:Q5"]):::iri c5(["10^^xsd:integer"]):::literal f0[["?date >= '2000-01-01T00:00:00^^xsd:dateTime'"]] f0 --> v1 v2 --"p:direct/P31"--> c3 a1 --"wikibase:timePrecision"--> c5 a1 --"wikibase:timeValue"--> v1 v2 --"p:P570"--> a2 a2 --"p:statement/value/P570"--> a1 bind1[/"concat(str(year-from-dateTime(?date)),'-',str(month-from-dateTime(?date)))"/] v1 --o bind1 bind1 --as--o v3 bind3[/"count(?person)"/] v2 --o bind3 bind3 --as--o v4