@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:116_biosodafrontend_rabit_mouse_orthologs a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Rabbit's proteins encoded by genes that are orthologous to Mouse's HBB-Y gene and their cross reference links to Uniprot"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX lscr: <http://purl.org/lscr#>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?PROTEIN_1 ?PROTEIN_2 ?UNIPROT_XREF_1 ?UNIPROT_XREF_2 WHERE {
	?taxon_1 up:commonName 'Mouse' .
	?taxon_2 up:commonName 'Rabbit' .
	SERVICE <https://sparql.omabrowser.org/sparql/> {
		?cluster a orth:OrthologsCluster .
		?cluster orth:hasHomologousMember ?node1 .
		?cluster orth:hasHomologousMember ?node2 .
		?node2 orth:hasHomologousMember* ?PROTEIN_2 .
		?node1 orth:hasHomologousMember* ?PROTEIN_1 .
		?PROTEIN_1 a orth:Protein .
		?PROTEIN_1 orth:organism/obo:RO_0002162 ?taxon_1 ;
			rdfs:label 'HBB-Y' ;
			lscr:xrefUniprot ?UNIPROT_XREF_1 .
		?PROTEIN_2 a orth:Protein .
		?PROTEIN_2 orth:organism/obo:RO_0002162 ?taxon_2 .
		?PROTEIN_2 lscr:xrefUniprot ?UNIPROT_XREF_2 .
		FILTER ( ?node1 != ?node2 )
	}
}""" ;
    schema:target <https://sparql.uniprot.org/sparql> ;
    spex:federatesWith <https://sparql.omabrowser.org/sparql/> .

