WikiPathways-SPARQL-book

pathwayCountBySpecies.rq

Code examples: curl

SPARQL

PREFIX dc:      <http://purl.org/dc/elements/1.1/> 
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>

SELECT DISTINCT ?organism (str(?label) as ?name) (count(?pw) as ?pathwayCount)
WHERE {
    ?pw dc:title ?title ;
      wp:organism ?organism ;
      wp:organismName ?label .
}
ORDER BY DESC(?pathwayCount)

Execute or Edit

Output

organism name pathwayCount
http://purl.obolibrary.org/obo/NCBITaxon_9606 Homo sapiens 1044
http://purl.obolibrary.org/obo/NCBITaxon_9913 Bos taurus 274
http://purl.obolibrary.org/obo/NCBITaxon_10090 Mus musculus 194
http://purl.obolibrary.org/obo/NCBITaxon_10116 Rattus norvegicus 155
http://purl.obolibrary.org/obo/NCBITaxon_4932 Saccharomyces cerevisiae 115
http://purl.obolibrary.org/obo/NCBITaxon_7955 Danio rerio 83
http://purl.obolibrary.org/obo/NCBITaxon_6239 Caenorhabditis elegans 61
http://purl.obolibrary.org/obo/NCBITaxon_9598 Pan troglodytes 46
http://purl.obolibrary.org/obo/NCBITaxon_9615 Canis familiaris 44
http://purl.obolibrary.org/obo/NCBITaxon_9031 Gallus gallus 40
http://purl.obolibrary.org/obo/NCBITaxon_3702 Arabidopsis thaliana 31
http://purl.obolibrary.org/obo/NCBITaxon_7227 Drosophila melanogaster 30
http://purl.obolibrary.org/obo/NCBITaxon_7165 Anopheles gambiae 14
http://purl.obolibrary.org/obo/NCBITaxon_1773 Mycobacterium tuberculosis 12
http://purl.obolibrary.org/obo/NCBITaxon_4530 Oryza sativa 11
http://purl.obolibrary.org/obo/NCBITaxon_562 Escherichia coli 9
http://purl.obolibrary.org/obo/NCBITaxon_3694 Populus trichocarpa 5
http://purl.obolibrary.org/obo/NCBITaxon_9796 Equus caballus 5
http://purl.obolibrary.org/obo/NCBITaxon_4081 Solanum lycopersicum 4
http://purl.obolibrary.org/obo/NCBITaxon_4577 Zea mays 4
http://purl.obolibrary.org/obo/NCBITaxon_1423 Bacillus subtilis 2
http://purl.obolibrary.org/obo/NCBITaxon_5833 Plasmodium falciparum 1
http://purl.obolibrary.org/obo/NCBITaxon_5518 Gibberella zeae 1

Code examples

curl

curl -o pathwayCountBySpecies.rq https://raw.githubusercontent.com/wikipathways/WikiPathways-SPARQL-book/master/sparql/pathwayCountBySpecies.rq
curl -H "Accept: text/tab-separated-values" -G http://sparql.wikipathways.org/ --data-urlencode [email protected]