SARS-CoV-2-Queries

virusGenes.rq

Code examples: curl

SPARQL

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". }
}

run or edit

Output

gene ncbigene
surface glycoprotein (edit) 43740568
ORF1a polyprotein;ORF1ab polyprotein (edit) 43740578
ORF3a protein-encoding gene (edit) 43740569
envelope protein (edit) 43740570
membrane glycoprotein (edit) 43740571
ORF6 protein (edit) 43740572
ORF7a protein (edit) 43740573
ORF7b (edit) 43740574
ORF8 protein (edit) 43740577
nucleocapsid phosphoprotein (edit) 43740575
ORF10 protein (edit) 43740576
Record to support submission of GeneRIFs for a gene not in Gene (COVID-19 virus; HCoV-19; Human coronavirus 2019; SARS-2; SARS-CoV2; SARS2). (edit) 43562271
ORF3d (edit)

Code examples

curl

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.