@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:5 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Retrieve all genes that are paralogous to ENSG00000244734 Ensembl gene (identifier)."@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX ensembl: <http://rdf.ebi.ac.uk/resource/ensembl/>
PREFIX lscr: <http://purl.org/lscr#>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sio: <http://semanticscience.org/resource/>

SELECT ?protein2 ?OMA_LINK
WHERE {
    # The three that contains paralogs. The leafs are proteins.
    # This graph pattern defines the relationship protein1 is paralogous to protein2
    ?cluster a orth:ParalogsCluster ;
        orth:hasHomologousMember ?node1 ;
        orth:hasHomologousMember ?node2 .
    ?node2 orth:hasHomologousMember* ?protein2 .
    ?node1 orth:hasHomologousMember* ?protein1 .

    # Specify the protein to look for its paralogs
    ?protein1 sio:SIO_010079/lscr:xrefEnsemblGene ensembl:ENSG00000244734 .

    # The OMA link to the second protein
    ?protein2 rdfs:seeAlso ?OMA_LINK .

    FILTER(?node1 != ?node2)
}""" ;
    schema:target <https://sparql.omabrowser.org/sparql> .

