sparql-examples

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

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

72_Select_children_of_CHEBI_35179_in_the_ChEBI_hierarchy_used_in_Rhea_reactions_or_not

rq turtle/ttl

Select children of CHEBI:35179 (a 2-oxo carboxylate) in the ChEBI hierarchy (using rdfs:subClassOf), used in Rhea reactions or not

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
  ?chebiChild
  (str(?label) as ?chebiChildName)
WHERE {
  ?chebiChild rdfs:subClassOf CHEBI:35179 .
  ?chebiChild rdfs:label ?label .
}
ORDER BY ?chebiChild
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?chebiChild"):::projected 
  v3("?chebiChildName")
  v2("?label"):::projected 
  c2(["CHEBI:35179"]):::iri 
  v1 --"rdfs:subClassOf"-->  c2
  v1 --"rdfs:label"-->  v2
  bind0[/"str(?label)"/]
  v2 --o bind0
  bind0 --as--o v3