Code examples: curl
#defaultView:LineChart
SELECT
?date ?deaths
?country ?countryLabel
WHERE {
?item wdt:P31 wd:Q3241045.
?item wdt:P17 ?country.
?item p:P1120 ?deathsStatement.
?deathsStatement ps:P1120 ?deaths.
FILTER(?deaths > 0)
?deathsStatement pq:P585 ?date .
{ ?item wdt:P1269 wd:Q81068910. } UNION
{ ?item wdt:P361 wd:Q83741704. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "pt,en". }
} ORDER BY ASC(?countryLabel) DESC(?date) DESC(?deaths)
curl -s https://raw.githubusercontent.com/egonw/SARS-CoV-2-Queries/master/sparql/graphDeaths.rq | sed 's+<lang/>+pt+' > graphDeaths.rq
curl -H "Accept: text/tab-separated-values" -G https://query.wikidata.org/bigdata/namespace/wdq/sparql --data-urlencode query@graphDeaths.rq
This SPARQL query is available under CCZero.