@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:10 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Retrieve all human proteins that are paralogous to the HBB gene and their UniProt cross-references."@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """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 up: <http://purl.uniprot.org/core/>

SELECT DISTINCT ?PROTEIN_HBB ?IS_PARALOGOUS_TO_PROTEIN ?PARALOG_GENE_LABEL ?HBB_UNIPROT_XREF ?PARALOG_UNIPROT_XREF
WHERE {
    ?cluster a orth:OrthologsCluster ;
        orth:hasHomologousMember ?node1 ;
        orth:hasHomologousMember ?node2 .
    ?node2 orth:hasHomologousMember* ?PROTEIN_HBB .
    ?node1 orth:hasHomologousMember* ?IS_PARALOGOUS_TO_PROTEIN .
    ?PROTEIN_HBB a orth:Protein ;
        orth:organism/obo:RO_0002162/up:scientificName 'Homo sapiens' ;
        rdfs:label 'HBB';
        lscr:xrefUniprot ?HBB_UNIPROT_XREF .
    ?IS_PARALOGOUS_TO_PROTEIN a orth:Protein ;
        orth:organism/obo:RO_0002162/up:scientificName 'Homo sapiens' ;
        lscr:xrefUniprot ?PARALOG_UNIPROT_XREF ;
        rdfs:label ?PARALOG_GENE_LABEL .
    FILTER(?node1 != ?node2)
}""" ;
    schema:target <https://sparql.omabrowser.org/sparql> .

