SARS-CoV-2-Queries

litSARSCoV2Variants.rq

Code examples: curl

SPARQL

#defaultView:BarChart
SELECT ?variant ?variantLabel (COUNT(?work) AS ?count) WHERE {
  ?variant wdt:P31 wd:Q104450895 .
  ?work wdt:P921 ?variant .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,en". }
} GROUP BY ?variant ?variantLabel
  ORDER BY ASC(?variantLabel)

run or edit

Output

variant count
Deltacron (edit) 2
Lineage B.1.1.7 with E484K (edit) 64
Lineage B.1.427 (edit) 3
Lineage B.1.620 (edit) 2
SARS-CoV-2 Alpha variant (edit) 70
SARS-CoV-2 Beta variant (edit) 33
SARS-CoV-2 Delta plus variant (edit) 1
SARS-CoV-2 Delta variant (edit) 18
SARS-CoV-2 Gamma variant (edit) 2
SARS-CoV-2 Iota variant (edit) 6
SARS-CoV-2 Kappa variant (edit) 2
SARS-CoV-2 Lambda variant (edit) 2
SARS-CoV-2 Lineage AY.4.2 (edit) 1
SARS-CoV-2 Lineage B.1.214.2 (edit) 1
SARS-CoV-2 Lineage B.1.429 (edit) 3
SARS-CoV-2 Lineage BA.1 (edit) 9
SARS-CoV-2 Lineage BA.2 (edit) 8
SARS-CoV-2 Lineage BA.2.12.1 (edit) 3
SARS-CoV-2 Lineage BA.3 (edit) 1
SARS-CoV-2 Lineage BA.4 (edit) 2
SARS-CoV-2 Lineage BA.5 (edit) 3
SARS-CoV-2 Lineage BQ.1 (edit) 1
SARS-CoV-2 Lineage C.1.2 (edit) 1
SARS-CoV-2 Lineage R.1 (edit) 1
SARS-CoV-2 Omicron variant (edit) 58
SARS-CoV-2 Zeta variant (edit) 3
SARS-CoV-2 lineage B.1.617 (edit) 12
SARS-CoV-2 lineage B.1.640.2 (edit) 1
SARS-CoV-2 lineage XBB.1 (edit) 1
SARS-CoV-2 lineage XBB.1.5 (edit) 1

Code examples

curl

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

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

This SPARQL query is available under CCZero.