sparql-examples

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

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

88_How_many_descendants_of_CHEBI_17815

rq turtle/ttl

How many descendants of CHEBI:17815 (a 1,2-diacyl-sn-glycerol) in 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(?chebiDescendant) as ?countChild) WHERE {
  ?chebiDescendant rdfs:subClassOf+ CHEBI:17815 .
  ?chebiDescendant rdfs:label ?label .
}
rdfs:subClassOf
rdfs:label
as
?chebiDescendant
?countChild
?label
CHEBI:17815
count(?chebiDescendant)