sparql-examples

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

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

90_How_many_reactions_involve_CHEBI_17815

rq turtle/ttl

How many reactions involve CHEBI:17815 (a 1,2-diacyl-sn-glycerol)?

Use at

PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

PREFIX rh:<http://rdf.rhea-db.org/>
SELECT
  (count(?reaction) as ?reactionCount)
WHERE {
  ?reaction rdfs:subClassOf rh:Reaction .
  ?reaction rh:status rh:Approved .
  ?reaction rh:side ?reactionSide .

  ?reactionSide rh:contains ?participant .
  ?participant rh:compound ?compound .
  ?compound rh:chebi CHEBI:17815 .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?compound")
  v3("?participant")
  v1("?reaction"):::projected 
  v5("?reactionCount")
  v2("?reactionSide")
  c9(["CHEBI:17815"]):::iri 
  c4(["rh:Approved"]):::iri 
  c2(["rh:Reaction"]):::iri 
  v1 --"rdfs:subClassOf"-->  c2
  v1 --"rh:status"-->  c4
  v1 --"rh:side"-->  v2
  v2 --"rh:contains"-->  v3
  v3 --"rh:compound"-->  v4
  v4 --"rh:chebi"-->  c9
  bind1[/"count(?reaction)"/]
  v1 --o bind1
  bind1 --as--o v5