A set of SPARQL examples that are used in different SIB resources
Select the number of approved reactions involving lipids (subclass of CHEBI:18059) based on the ChEBI ontology
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
(count(distinct ?reaction) as ?reactionCount)
WHERE {
?reaction rdfs:subClassOf rh:Reaction .
?reaction rh:status rh:Approved .
?reaction rh:side ?reactionSide .
?reactionSide rh:contains ?participant .
?participant rh:compound ?compound .
?compound rh:chebi ?chebi .
?chebi rdfs:subClassOf+ CHEBI:18059 .
}