SARS-CoV-2-Queries

allBetacoronaViruses.rq

Code examples: curl

SPARQL

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

run or edit

Output

virus ncbi
16BO133 (edit)
BANAL-103 (edit)
BANAL-52 (edit)
Bat Hp-betacoronavirus Zhejiang2013 (edit)
Bat SARS CoV Rf1 (edit) 347537
Bat SARS CoV Rm1 (edit) 347536
Bat SARS CoV Rp3 (edit) 349344
Bat SARS coronavirus Rp1 (edit) 349342
Bat SARS-like coronavirus WIV1 (edit) 1415852
Betacoronavirus 1 (edit) 694003
BtCoV/BM48-31/Rhi bla/Bulgaria/2008 (edit)
BtKY72/Rhinolophus sp./Kenya/2007 (edit)
China Rattus coronavirus HKU24 (edit) 2501960
Civet SARS-CoV (edit)
Coronavirus Neoromicia/PML-PHE1/RSA/2011 (edit) 1368314
Eidolon bat coronavirus C704 (edit)
Embecovirus (edit) 2509481
Erinaceus amurensis hedgehog coronavirus HKU31 (edit) 2664184
Erinaceus coronavirus (edit)
Hedgehog coronavirus 1 (edit) 1965093
Hibecovirus (edit) 2509486
Hp-BatCoV HKU25 (edit)
Human coronavirus HKU1 (edit) 290028
Human coronavirus HKU1 (isolate N1) (edit) 443239
London1 novel CoV/2012 (edit)
Merbecovirus (edit) 2509494
Middle East respiratory syndrome coronavirus (edit) 1335626
Murine coronavirus (edit) 694005
Myodes coronavirus 2JL14 (edit)
Nobecovirus (edit) 2509502
Pipistrellus bat coronavirus HKU5 (edit) 694008
RaTG13 (edit) 2709072
Rabbit Coronavirus HKU14 (edit) 1160968
RacCS203 (edit)
Rc-o319 (edit)
RhGB01 (edit)
RmYN02 (edit)
Rousettus bat coronavirus GCCDC1 (edit) 2501962
Rousettus bat coronavirus HKU9 (edit) 694006
RpYN06 (edit)
SARS coronavirus B024 (edit) 305407
SARS-CoV-1 (edit)
SARS-CoV-2 (edit) 2697049
SARSr-CoV (edit) 694009
SARSr-CoV (edit) 227859
SHC014-CoV (edit) 1415851
Sarbecovirus (edit) 2509511
Tylonycteris bat coronavirus HKU4 (edit) 694007

Code examples

curl

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

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

This SPARQL query is available under CCZero.