Code examples: curl
SELECT DISTINCT ?variant ?variantLabel ?pango WHERE {
VALUES ?variantType { wd:Q15304597 wd:Q75913269 }
{ ?variant p:P31 [ ps:P31 ?variantType ; pq:P642 wd:Q82069695 ] . }
UNION
{ ?variant wdt:P31 wd:Q104450895 }
OPTIONAL { ?variant wdt:P9632 ?pango }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,en". }
}
curl -s https://raw.githubusercontent.com/egonw/SARS-CoV-2-Queries/master/sparql/sarscov2Variants.rq | sed 's+<lang/>+en+' > sarscov2Variants.rq
curl -H "Accept: text/tab-separated-values" -G https://query.wikidata.org/bigdata/namespace/wdq/sparql --data-urlencode query@sarscov2Variants.rq
This SPARQL query is available under CCZero.