コード例: curl
SELECT ?virus ?virusLabel ?gene ?geneLabel ?ncbigene WHERE {
VALUES ?virus {
wd:Q16000326 # SL-CoV-WIV1
wd:Q88162038 # Bat SARS coronavirus Rp1
wd:Q85939995 # SHC014-CoV
wd:Q82069695 # SARS-CoV-2
wd:Q34967815 # SARS coronavirus
wd:Q85438966 # severe acute respiratory syndrome coronavirus
wd:Q278567 # SARSr-CoV / SARS-CoV
}
?gene wdt:P703 ?virus ; wdt:P31 wd:Q7187 .
OPTIONAL { ?gene wdt:P351 ?ncbigene }
SERVICE wikibase:label { bd:serviceParam wikibase:language "ja,en". }
}
curl -s https://raw.githubusercontent.com/egonw/SARS-CoV-2-Queries/master/sparql/virusGenesSARSr.rq | sed 's+<lang/>+ja+' > virusGenesSARSr.rq
curl -H "Accept: text/tab-separated-values" -G https://query.wikidata.org/bigdata/namespace/wdq/sparql --data-urlencode query@virusGenesSARSr.rq
本SPARQLクエリはCC0ライセンスで利用可能です。