A set of SPARQL examples that are used in different SIB resources
Select the parent reaction(s) of a given reaction
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh:<http://rdf.rhea-db.org/>
SELECT
?reactionChild
?childEquation
?reactionParent
?parentEquation
WHERE {
BIND (rh:39155 AS ?reactionChild)
?reactionChild rdfs:subClassOf rh:Reaction .
?reactionChild rh:status rh:Approved .
?reactionChild rh:equation ?childEquation .
?reactionParent rdfs:subClassOf rh:Reaction .
?reactionParent rh:status rh:Approved .
?reactionParent rh:equation ?parentEquation .
?reactionChild rdfs:subClassOf ?reactionParent .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?childEquation"):::projected
v4("?parentEquation"):::projected
v1("?reactionChild"):::projected
v3("?reactionParent"):::projected
c4(["rh:Approved"]):::iri
c2(["rh:Reaction"]):::iri
bind0[/"'rh:39155'"/]
bind0 --as--o v1
v1 --"rdfs:subClassOf"--> c2
v1 --"rh:status"--> c4
v1 --"rh:equation"--> v2
v3 --"rdfs:subClassOf"--> c2
v3 --"rh:status"--> c4
v3 --"rh:equation"--> v4
v1 --"rdfs:subClassOf"--> v3