@prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/> .
@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:70_enzymes_interacting_with_molecules_similar_to_dopamine a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Look for enzymes catalyzing reactions with molecules similar to dopamine."@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
PREFIX rh: <http://rdf.rhea-db.org/>
PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT
  ?protein
  ?rhea
  ?chebi
WHERE {
  # Use the smiles of dopamine CHEBI:18243
  SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/chebi>{
    ?chebi sachem:similarCompoundSearch [
      sachem:query "NCCc1ccc(O)c(O)c1" ] .
  }
  GRAPH<https://sparql.rhea-db.org/rhea>{
    ?rhea rh:side/rh:contains/rh:compound ?compound .
    ?compound (rh:chebi|(rh:reactivePart/rh:chebi)|rh:underlyingChebi) ?chebi .
  }
  ?protein up:reviewed true ;
    up:annotation ?caa .
  ?caa up:catalyticActivity/up:catalyzedReaction ?rhea .
}""" ;
    schema:keywords "chemical similarity",
        "small molecule",
        "enzyme",
        "idsm",
        "rhea",
        "sachem" ;
    schema:target <https://sparql.uniprot.org/sparql/> ;
    schema:subjectOf <https://education.expasy.org/cours/SIB_UniProtKB_Enzymes_2024/> ;
    spex:federatesWith <https://idsm.elixir-czech.cz/sparql/endpoint/chebi> .
