A set of SPARQL examples that are used in different SIB resources
Select all the descendants of CHEBI:35179 (a 2-oxo carboxylate) in the ChEBI hierarchy (using rdfs:subClassOf+) used in Rhea reaction(s), and show the reaction(s)
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
?chebi
?compoundName
?reaction
?reactionEquation
WHERE {
?reaction rdfs:subClassOf rh:Reaction .
?reaction rh:status rh:Approved .
?reaction rh:equation ?reactionEquation .
?reaction rh:side ?reactionSide .
?reactionSide rh:contains ?participant .
?participant rh:compound ?compound .
?compound rh:name ?compoundName .
?compound rh:chebi ?chebi .
?chebi rdfs:subClassOf+ CHEBI:35179 .
}
ORDER BY ?chebi
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?chebi"):::projected
v6("?compound")
v7("?compoundName"):::projected
v5("?participant")
v2("?reaction"):::projected
v3("?reactionEquation"):::projected
v4("?reactionSide")
c11(["CHEBI:35179"]):::iri
c4(["rh:Approved"]):::iri
c2(["rh:Reaction"]):::iri
v2 --"rdfs:subClassOf"--> c2
v2 --"rh:status"--> c4
v2 --"rh:equation"--> v3
v2 --"rh:side"--> v4
v4 --"rh:contains"--> v5
v5 --"rh:compound"--> v6
v6 --"rh:name"--> v7
v6 --"rh:chebi"--> v1
v1 --"rdfs:subClassOf"--> c11