@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#> .
@prefix spex:<https://purl.expasy.org/sparql-examples/ontology#> . 

ex:15-rat-TP53-biosodafrontend a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Rattus norvegicus' proteins encoded by genes that are paralogous to its TP53 gene and their Uniprot function annotations."@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX up: <http://purl.uniprot.org/core/>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX lscr: <http://purl.org/lscr#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?PROTEIN ?IS_PARALOGOUS_TO_PROTEIN ?UNIPROT_XREF ?PARALOG_UNIPROT_XREF ?annotation_text WHERE {
	{
		?cluster a orth:ParalogsCluster .
		?cluster orth:hasHomologousMember ?node1 .
		?cluster orth:hasHomologousMember ?node2 .
		?node2 orth:hasHomologousMember* ?PROTEIN .
		?node1 orth:hasHomologousMember* ?IS_PARALOGOUS_TO_PROTEIN .
		?PROTEIN a orth:Protein .
		?PROTEIN orth:organism/obo:RO_0002162/up:scientificName 'Rattus norvegicus' ;
			rdfs:label 'TP53' ;
			lscr:xrefUniprot ?UNIPROT_XREF .
		?IS_PARALOGOUS_TO_PROTEIN a orth:Protein .
		?IS_PARALOGOUS_TO_PROTEIN orth:organism/obo:RO_0002162/up:scientificName 'Rattus norvegicus' .
		?IS_PARALOGOUS_TO_PROTEIN lscr:xrefUniprot ?PARALOG_UNIPROT_XREF .
	}
	SERVICE <https://sparql.uniprot.org/sparql> {
		?PARALOG_UNIPROT_XREF up:annotation ?annotation .
		?annotation a up:Function_Annotation .
		?annotation rdfs:comment ?annotation_text .
	}
}""" ;
    schema:target <https://sparql.omabrowser.org/sparql/> ;
    spex:federatesWith <https://sparql.uniprot.org/sparql> .

