sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

84_Select_the_number_of_approved_reactions_involving_lipids

rq turtle/ttl

Select the number of approved reactions involving lipids (subclass of CHEBI:18059) based on the ChEBI ontology

Use at

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 .
}
rdfs:subClassOf
rh:status
rh:side
rh:contains
rh:compound
rh:chebi
rdfs:subClassOf
as
?chebi
?compound
?participant
?reaction
?reactionCount
?reactionSide
rh:Approved
rh:Reaction
CHEBI:18059
count(?reaction)