sparql-examples

A set of SPARQL examples that are used in different TGX resources

View the Project on GitHub BiGCAT-UM/sparql-examples

008

rq turtle/ttl

List the species captured in WikiPathways and the number of pathways per species.

Use at

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

SELECT DISTINCT ?organism (str(?label) as ?name) (count(?pw) as ?pathwayCount)
WHERE {
    ?pw dc:title ?title ;
      wp:organism ?organism ;
      wp:organismName ?label .
} GROUP BY ?organism ?label
ORDER BY DESC(?pathwayCount)
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v5("?label"):::projected 
  v6("?name")
  v4("?organism"):::projected 
  v7("?pathwayCount")
  v2("?pw"):::projected 
  v3("?title")
  v2 --"dc:title"-->  v3
  v2 --"wp:organism"-->  v4
  v2 --"wp:organismName"-->  v5
  bind1[/"str(?label)"/]
  v5 --o bind1
  bind1 --as--o v6
  bind2[/"count(?pw)"/]
  v2 --o bind2
  bind2 --as--o v7