@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:53 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Find mouse homologs in OMABrowser of human enzymes that catalyze reactions involving sterols (CHEBI:15889). Federating with Rhea and OMABrowser."@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
PREFIX lscr: <http://purl.org/lscr#>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh: <http://rdf.rhea-db.org/>
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT
  DISTINCT
    ?chebi
    ?reaction
    ?humanProtein
    ?mouseProtein
    ?cluster 
WHERE {
  SERVICE <https://sparql.rhea-db.org/sparql> {
    ?reaction rdfs:subClassOf rh:Reaction .
    ?reaction rh:side/rh:contains/rh:compound ?compound .
    ?compound rh:chebi ?chebi .
    ?chebi rdfs:subClassOf* CHEBI:15889
  }

  ?humanProtein up:organism taxon:9606 .
  ?humanProtein up:annotation ?a .
  ?a a up:Catalytic_Activity_Annotation .
  ?a up:catalyticActivity ?ca .
  ?ca up:catalyzedReaction ?reaction .

  SERVICE  <https://sparql.omabrowser.org/sparql/> {
    ?cluster a orth:ParalogsCluster .
    ?cluster orth:hasHomologousMember ?node1 , ?node2 .
    ?node1 orth:hasHomologousMember* ?orthoProtein1 .
    ?node2 orth:hasHomologousMember* ?orthoProtein2 .
    ?orthoProtein1 lscr:xrefUniprot ?mouseProtein .
    ?orthoProtein2 lscr:xrefUniprot ?humanProtein .
    # inTaxon mouse
    ?orthoProtein1 orth:organism/<http://purl.obolibrary.org/obo/RO_0002162> taxon:10090 . 
  }
}""" ;
    schema:keywords "enzyme" , "ortholog" , "small molecule" , "federated query" , "OMA" , "Rhea"  ;
    schema:target <https://sparql.uniprot.org/sparql/> ;
    spex:federatesWith <https://sparql.rhea-db.org/sparql> , <https://sparql.omabrowser.org/sparql/> .
