Code examples: curl
SELECT ?gene ?geneLabel ?ncbigene WHERE {
?gene wdt:P703 wd:Q82069695 ; wdt:P31 wd:Q7187 .
OPTIONAL { ?gene wdt:P351 ?ncbigene }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,en". }
}
curl -s https://raw.githubusercontent.com/egonw/SARS-CoV-2-Queries/master/sparql/virusGenes.rq | sed 's+<lang/>+en+' > virusGenes.rq
curl -H "Accept: text/tab-separated-values" -G https://query.wikidata.org/bigdata/namespace/wdq/sparql --data-urlencode query@virusGenes.rq
This SPARQL query is available under CCZero.