A set of SPARQL examples that are used in different SIB resources
Select the number of approved reactions using CHEBI:29985 (L-glutamate) as small molecule participant
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