SARS-CoV-2-Queries

virusProteinsPDBBubbleChart.rq

Code examples: curl

SPARQL

#defaultView:BubbleChart
SELECT ?protein ?proteinLabel (COUNT(?pdb) AS ?count) WHERE {
  ?protein wdt:P703 wd:Q82069695 ; wdt:P31 wd:Q8054 .
  ?protein wdt:P638 ?pdb .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,en". }
} GROUP BY ?protein ?proteinLabel

run or edit

Output

protein count
Non-structural protein 10 [SARS CoV-2] (edit) 1
non-structural protein 15 [SARS-CoV-2] (edit) 2
non-structural protein 16 [SARS-CoV-2] (edit) 1
Papain-like proteinase [SARS-CoV-2] (edit) 2
non-structural protein 5 [SARS-CoV-2] (edit) 8
nucleocapsid protein [SARS-CoV-2] (edit) 29
spike glycoprotein [SARS-CoV-2] (edit) 595
orf1ab polyprotein [SARS-Cov 2] (edit) 830
Viroporin 3a [SARS-CoV-2] (edit) 2
envelope protein [SARS-CoV-2] (edit) 3
ORF1a polyprotein (edit) 52
Protein 7a [SARS-CoV-2] (edit) 2
ORF8 protein [SARS-CoV-2] (edit) 2

Code examples

curl

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

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

This SPARQL query is available under CCZero.