SARS-CoV-2-Queries

deathsPerHundredThousand.rq

Code examples: curl

SPARQL

#defaultView:BubbleChart
SELECT ?countryLabel ((?maxDeath*100000)/?maxPopulation AS ?numOfDeathsPer100k) WITH {
  SELECT DISTINCT ?country (MAX(?numDeaths) AS ?maxDeath) (MAX(?population) AS ?maxPopulation) WHERE {
    ?outbreak p:P31 [ ps:P31 wd:Q3241045 ; pq:P642 wd:Q84263196 ] ;
              wdt:P276 ?country ; wdt:P1120 ?numDeaths .
    ?country wdt:P31 wd:Q3624078 ; wdt:P1082 ?population .
  } GROUP BY ?country
} AS %DATA {
  INCLUDE %DATA
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,en". }
}

run or edit

Output

numOfDeathsPer100k
51.24454922329939989729
170.58516789773861879603
1.47618167776213789076
36.51822672662401135426
237.95279036041839076102
66.24347501382509270502
11.73554469948897149711
274.85131395430136284458
7.7031578979087963506
289.75157123967339639547
310.06256588927225728674
66.29719988322287109436
139.81408565277972001554
21.07487522024392299727
43.95226917344920448982
747.1917049294728683838
4.45283288040022865997
113.92905776536383440453
17.38583596775533251501
7.5567513034047782262
41.21437999205748836825
20.52894902687205762105
5.56492058647145514461
0.78459171710447211394
355.49836082695250268778
1.46666152636722187488
100.3600246829563092097
3.66898487583202132969
200.07708862336140842182
14.42371925320576020841
17.09805423277927817453
116.90737757844863295932
19.09358813443460517915
1.25341207517810565631
37.3608791474051054422
291.90242271932132643555
11.08226133089503452789
392.43487595369174259427
3.67219892215064099136
1.09735319998530500932
333.37228220209555138418
253.7006696985198012936
76.2860754659777965487
253.8294756072057961177
228.42188023572884419701
99.92891227901398216223
1.458522657925791083
12.33752494926748098562
7.83154599544367939144
135.4207291526921942061
243.41044560214185156306
42.13860737477533365097
77.36437675864564300416
162.60830588579129538628
251.98167275641532613109
546.11124309450275919891
1.40113433594022783341
133.80667650878137174062
3.71904822117923580997
1.66728153186651373549
254.63283372266623831503
291.83869092773373411848
203.17068213442566564
312.22043536648042840327
96.38295161222459848048
162.55685048322910744741
94.70727494668287451568
177.71912640418355512022
169.96074585989051311438
58.77127058985837154506
0
18.29141791560002243384
73.64061257151452278185
464.56032581983778742523
166.19097152629050768636
4.76459219563687817696
426.57342840575517777081
21.60358866593831297858
210.04799946908532135587
12.37746812314704960091
335.52424089213923626627
460.97780447366996016995
128.79475599872851869564
62.6404167347275127209
5.88140972492467201176
58.19276147959183673469
13.69419194480852754367
526.04843543874301537584
334.21173424915913948342
7.6423642551154991678
130.24544632045494726987
26.06839695651465532691
14.09135745228257262731
161.41801582922684322403
3.4328404284876362177
215.68449443730214278811
122.22575677641675623052
32.37305218777803101097
386.01500751476803314939
116.54746110557096864085
15.11008884831001556932
330.31657929900298077911
312.98417326114119117035
9.45584309317820019847
23.73329324159813924429
11.6788096265151048308
451.1865338172983760177
185.07617178337462110837
220.35148622260794098503
456.56560221678189986818
104.0477453865243095196
318.08636903131562129097
177.95276944370416856512
342.44852144294782474067
183.62286852015447807602
82.55490019476314097673
202.64665633017055218589
10.64559353426762559293
14.43571727766037253617
122.82746232429208284346
0.32955844372095766215
72.20117498490089496513
363.01960901002767280626
174.70664928292046936115
0
19.74952585463722001912
97.51496959697493765889
17.84234020577426890734
76.24679123866951803334
166.86828846873276519266
202.36888776285786673423
11.05252720846407782846
95.82812228231610856655
25.02686707789244335831
249.20039332483732752102
74.2821787520593969654
297.80409152177993140985
7.37537423371192320487
5.65781171186203378193
2.42537153257724701014
52.48462200575231457183
210.69351807588507718263
134.20050070752149776859
4.68851585703606748942
29.14545454545454545455
0
37.68469169517489122828
15.67425968109339407745
228.69092617029366375165
23.75030332443581654938
44.68046966030294882137
49.77826401234688495126
15.07058055225305179256
220.72803153257593322513
111.92298242900170159331
179.46015880137307888943
0
152.99973801414723604925
2.4764428375082032169
100.10145417653026716266
78.48349188584219362059
84.92185382600054205439
71.27632755024866500126
30.11651326067724509195
1.93283873486919172198
234.69226306629397183693
41.41930139444981361314
14.76277743840358379149
2.94538175579067772376
55.86956521739130434783
0
7.49860100727476217124
12.03480836882058877986
7.32600732600732600733
267.02608239939494134367
60.70325288929480416272
7.2143529265643850796
44.88769988465942016392
26.1733196340077077114
33.80901011405271110622
167.05374969063480079094
339.06726139496437767201
119.01094275200996890779
344.36489193042189884857
1.68681925997787294096
68.94713855026971454852
326.68826477701544541799
238.39539084138493918314
1.49242641136282287191

Code examples

curl

curl -s https://raw.githubusercontent.com/egonw/SARS-CoV-2-Queries/master/sparql/deathsPerHundredThousand.rq | sed 's+<lang/>+en+' > deathsPerHundredThousand.rq

curl -H "Accept: text/tab-separated-values" -G https://query.wikidata.org/bigdata/namespace/wdq/sparql --data-urlencode query@deathsPerHundredThousand.rq

This SPARQL query is available under CCZero.