A set of SPARQL examples that are used in different SIB resources
Select all Rhea reactions that have a given ChEBI ID as reaction participant
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/>
# Query 14
# Select all Rhea reactions that have CHEBI:29985 (L-glutamate) as reaction participant
#
# This query corresponds to the Rhea website query:
# https://www.rhea-db.org/rhea?query=chebi:29985
SELECT distinct ?chebi ?rhea ?equation
WHERE {
?rhea rdfs:subClassOf rh:Reaction .
?rhea rh:equation ?equation .
?rhea rh:side/rh:contains/rh:compound ?compound .
#
# the ChEBI can be used either as a small molecule, the reactive part of a macromolecule or as a polymer.
#
?compound (rh:chebi|(rh:reactivePart/rh:chebi)|(rh:underlyingChebi/rh:chebi)) ?chebi .
VALUES (?chebi) { (CHEBI:29985) }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?chebi"):::projected
v3("?compound")
v2("?equation"):::projected
v1("?rhea"):::projected
a1((" "))
a2((" "))
a3((" "))
a4((" "))
c2(["rh:Reaction"]):::iri
v1 --"rdfs:subClassOf"--> c2
v1 --"rh:equation"--> v2
v1 --"rh:side"--> a1
a1 --"rh:contains"--> a2
a2 --"rh:compound"--> v3
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v3 --"rh:underlyingChebi"--> a4
a4 --"rh:chebi"--> v5
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v3 --"rh:reactivePart"--> a3
a3 --"rh:chebi"--> v5
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"rh:chebi"--> v5
end
union0r <== or ==> union0l
end
bind0[/VALUES ?chebi/]
bind0-->v5
bind00(["CHEBI:29985"])
bind00 --> bind0