sparql-examples

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

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

60_Select_the_number_of_approved_reactions_using_CHEBI_29985_as_small_molecule_participant

rq turtle/ttl

Select the number of approved reactions using CHEBI:29985 (L-glutamate) as small molecule participant

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh:<http://rdf.rhea-db.org/>
SELECT
  ?reaction
  ?reactionSide
  ?coefficient
  ?participant
  ?name
WHERE {
  ?reaction rdfs:subClassOf rh:Reaction .
  ?reaction rh:side ?reactionSide .
  ?contains rdfs:subPropertyOf rh:contains .
  ?contains rh:coefficient ?coefficient .
  ?reactionSide ?contains ?participant .
  ?participant rh:compound ?compound .
  ?compound rh:name ?name .

  FILTER (?reaction=rh:11680)
}
ORDER BY ?reactionSide

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?coefficient"):::projected 
  v6("?compound")
  v3("?contains")
  v7("?name"):::projected 
  v5("?participant"):::projected 
  v2("?reaction"):::projected 
  v1("?reactionSide"):::projected 
  c3(["rh:Reaction"]):::iri 
  c6(["rh:contains"]):::iri 
  f0[["?reaction = 'rh:11680'"]]
  f0 --> v2
  v2 --"rdfs:subClassOf"-->  c3
  v2 --"rh:side"-->  v1
  v3 --"rdfs:subPropertyOf"-->  c6
  v3 --"rh:coefficient"-->  v4
  v1 -->v3--> v5
  v5 --"rh:compound"-->  v6
  v6 --"rh:name"-->  v7