Code examples: curl
#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)
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.