SARS-CoV-2-Queries

humanCoronaviruses.rq

Code examples: curl

SPARQL

SELECT ?virus ?virusLabel ?ncbi WHERE {
  VALUES ?virus {
    wd:Q82069695 # SARS-CoV-2
    wd:Q16983360 # HKU1
    wd:Q16991954 # OC43
    wd:Q8351095  # NL63 
    wd:Q16983356 # 229E
    wd:Q4902157  # MERS-CoV
    wd:Q278567   # SARS-CoV
  }
  OPTIONAL { ?virus wdt:P685 ?ncbi }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,en". }
}

run or edit

Output

virus ncbi
SARSr-CoV (edit) 694009
SARSr-CoV (edit) 227859
Middle East respiratory syndrome coronavirus (edit) 1335626
human Coronavirus NL63 (edit) 277944
Human coronavirus 229E (edit) 11137
Human coronavirus HKU1 (edit) 290028
Human coronavirus OC43 (edit) 31631
SARS-CoV-2 (edit) 2697049

Code examples

curl

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

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

This SPARQL query is available under CCZero.