@prefix ex: <https://sparql.rhea-db.org/.well-known/sparql-examples/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix spex:<https://purl.expasy.org/sparql-examples/ontology#> .

ex:18 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Use <a href=\"https://idsm.elixir-czech.cz/sparql\">IDSM Sachem</a> to find ChEBIs with a a <a href=\"https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:35516\">Cholestane</a> skeleton (in SMILES). Then match returned ChEBIs to Rhea undirected reactions."^^rdf:HTML ;
    sh:prefixes ex: ;
    sh:select """PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh: <http://rdf.rhea-db.org/>
PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>


SELECT 
  ?rhea 
  ?chebi
WHERE {
  SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/chebi> {
    ?chebi sachem:substructureSearch [
        sachem:query "[C@]12(CCC3CCCC[C@]3(C)[C@@]1([H])CC[C@]1(C)[C@@]([H])([C@@](C)([H])CCCC(C)C)CC[C@@]21[H])[H]" ].
  }
  ?rhea rh:side/rh:contains/rh:compound/rdfs:subClassOf ?chebi .
}""" ;
    schema:target <https://sparql.rhea-db.org/sparql> ;
    spex:federatesWith <https://idsm.elixir-czech.cz/sparql/endpoint/chebi> .

