@prefix ex: <https://sparql.omabrowser.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#> .

ex:8 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Retrieve all genes per species that are orthologous to Rabbit's APOCI or APOC1 gene and their cross-reference links to OMA and Uniprot including the corresponding Ensembl gene identifier."@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX dc: <http://purl.org/dc/terms/>
PREFIX lscr: <http://purl.org/lscr#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sio: <http://semanticscience.org/resource/>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT ?protein1 ?protein2 ?geneName2 ?species2 ?Prot2_uniprot ?prot2_ensemblGeneId
WHERE {
    ?cluster a orth:OrthologsCluster ;
        orth:hasHomologousMember ?node1 ;
        orth:hasHomologousMember ?node2 .
    ?node2 orth:hasHomologousMember* ?protein2 .
    ?node1 orth:hasHomologousMember* ?protein1 .
    ?protein1 a orth:Protein ;
        orth:organism/obo:RO_0002162/up:scientificName 'Oryctolagus cuniculus';
        rdfs:label 'APOCI' .
    ?protein2 a orth:Protein ;
        lscr:xrefUniprot ?Prot2_uniprot ;
        sio:SIO_010079/lscr:xrefEnsemblGene/dc:identifier ?prot2_ensemblGeneId ;
        rdfs:label ?geneName2 ;
        orth:organism/obo:RO_0002162/up:scientificName ?species2.
    FILTER(?node1 != ?node2)
}""" ;
    schema:target <https://sparql.omabrowser.org/sparql> .

