SARS-CoV-2-Queries

allSARSCoVVirusesTaxonomy.rq

Code examples: curl

SPARQL

SELECT ?virus ?virusLabel ?ncbi WHERE {
  ?virus wdt:P171+ wd:Q278567 .
  OPTIONAL { ?virus wdt:P685 ?ncbi }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,en". }
}

run or edit

Output

virus ncbi
Bat SARS-like coronavirus WIV1 (edit) 1415852
SARS-CoV-2 (edit) 2697049
SARS-CoV-1 (edit)
SHC014-CoV (edit) 1415851
Bat SARS coronavirus Rp1 (edit) 349342
SARS coronavirus B024 (edit) 305407
RaTG13 (edit) 2709072
Bat SARS CoV Rf1 (edit) 347537
Bat SARS CoV Rm1 (edit) 347536
Bat SARS CoV Rp3 (edit) 349344
RmYN02 (edit)
Civet SARS-CoV (edit)
RacCS203 (edit)
Rc-o319 (edit)
16BO133 (edit)
BtKY72/Rhinolophus sp./Kenya/2007 (edit)
BtCoV/BM48-31/Rhi bla/Bulgaria/2008 (edit)
RpYN06 (edit)
RhGB01 (edit)
BANAL-52 (edit)
BANAL-103 (edit)

Code examples

curl

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

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

This SPARQL query is available under CCZero.