SARS-CoV-2-Queries

articleCountPerProtein.rq

Code examples: curl

SPARQL

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

run or edit

Output

protein count
Helicase [SARS-CoV-2] (edit) 41
Host translation inhibitor nsp1 [SARS-CoV-2] (edit) 51
Non-structural protein 10 [SARS CoV-2] (edit) 57
Non-structural protein 11 [SARS CoV-2] (edit) 2
Non-structural protein 14 [SARS-CoV-2] (edit) 43
Non-structural protein 2 [SARS CoV-2] (edit) 14
Non-structural protein 4 [SARS-CoV-2] (edit) 9
Non-structural protein 7 [SARS-CoV-2] (edit) 26
Non-structural protein 9 [SARS-CoV-2] (edit) 17
Non-structural protein nsp8 [SARS-CoV-2] (edit) 25
ORF10 protein [SARS-CoV-2] (edit) 8
ORF3b protein [SARS-CoV-2] (edit) 7
ORF6 protein [SARS-CoV-2] (edit) 20
ORF8 protein [SARS-CoV-2] (edit) 31
ORF9c protein [SARS CoV-2] (edit) 2
Papain-like proteinase [SARS-CoV-2] (edit) 74
Protein 7a [SARS-CoV-2] (edit) 19
Protein ORF9b [SARS-CoV-2] (edit) 15
Protein non-structural 7b [SARS-CoV-2] (edit) 7
RNA-directed RNA polymerase [SARS-CoV-2] (edit) 57
Viroporin 3a [SARS-CoV-2] (edit) 30
envelope protein [SARS-CoV-2] (edit) 34
membrane protein [SARS-CoV-2] (edit) 25
non-structural protein 15 [SARS-CoV-2] (edit) 28
non-structural protein 16 [SARS-CoV-2] (edit) 45
non-structural protein 5 [SARS-CoV-2] (edit) 59
non-structural protein 6 [SARS-CoV-2] (edit) 12
nucleocapsid protein [SARS-CoV-2] (edit) 108
orf1ab polyprotein [SARS-Cov 2] (edit) 3
putative protein ORF3c (edit) 1
spike glycoprotein [SARS-CoV-2] (edit) 415

Code examples

curl

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

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

This SPARQL query is available under CCZero.