sparql-examples

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

View the Project on GitHub sib-swiss/sparql-examples

32_Select_the_distribution_of_reactions_according_to_their_status

rq turtle/ttl

Select the distribution of reactions according to their status

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh:<http://rdf.rhea-db.org/>

SELECT
  ?status
  (count(?reaction) as ?reactionCount)
WHERE {
  ?reaction rdfs:subClassOf rh:Reaction .
  ?reaction rh:status ?status .
}
GROUP BY ?status
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?reaction"):::projected 
  v3("?reactionCount")
  v2("?status"):::projected 
  c2(["rh:Reaction"]):::iri 
  v1 --"rdfs:subClassOf"-->  c2
  v1 --"rh:status"-->  v2
  bind1[/"count(?reaction)"/]
  v1 --o bind1
  bind1 --as--o v3