Code examples: curl
#defaultView:BarChart
SELECT ?gene ?geneLabel (COUNT(?work) AS ?count) WHERE {
?gene wdt:P703 wd:Q82069695 ; wdt:P31 wd:Q7187 .
?work wdt:P921 ?gene .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,en". }
} GROUP BY ?gene ?geneLabel
ORDER BY ASC(?geneLabel)
| gene | count |
| ORF10 protein (edit) | 2 |
| ORF1a polyprotein;ORF1ab polyprotein (edit) | 1 |
| ORF3a protein-encoding gene (edit) | 2 |
| ORF3d (edit) | 2 |
| ORF6 protein (edit) | 1 |
| ORF7a protein (edit) | 1 |
| ORF7b (edit) | 4 |
| ORF8 protein (edit) | 6 |
| envelope protein (edit) | 1 |
| membrane glycoprotein (edit) | 1 |
| nucleocapsid phosphoprotein (edit) | 2 |
| surface glycoprotein (edit) | 2 |
curl -s https://raw.githubusercontent.com/egonw/SARS-CoV-2-Queries/master/sparql/articleCountPerGene.rq | sed 's+<lang/>+en+' > articleCountPerGene.rq
curl -H "Accept: text/tab-separated-values" -G https://query.wikidata.org/bigdata/namespace/wdq/sparql --data-urlencode query@articleCountPerGene.rq
This SPARQL query is available under CCZero.