@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:117_biosodafrontend_glioblastoma_orthologs_rat a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Which are the proteins associated with glioblastoma and the orthologs expressed in the rat brain?"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX sio: <http://semanticscience.org/resource/>
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX lscr: <http://purl.org/lscr#>
PREFIX genex: <http://purl.org/genex#>
SELECT DISTINCT ?protein ?orthologous_protein ?gene ?annotation_text WHERE {
  {
  	SELECT ?protein ?annotation_text WHERE {
      ?protein a up:Protein ;
          up:organism taxon:9606 ;
          up:annotation ?annotation .
      ?annotation rdfs:comment ?annotation_text .
      ?annotation a up:Disease_Annotation .
      FILTER CONTAINS (?annotation_text, "glioblastoma")
    }
  }
  SERVICE <https://sparql.omabrowser.org/sparql/> {
    SELECT ?orthologous_protein ?protein ?gene WHERE {
    ?protein_OMA a orth:Protein .
    ?orthologous_protein a orth:Protein .
    ?cluster a orth:OrthologsCluster .
    ?cluster orth:hasHomologousMember ?node1 .
    ?cluster
    orth:hasHomologousMember ?node2 .
    ?node2 orth:hasHomologousMember* ?protein_OMA .
    ?node1 orth:hasHomologousMember* ?orthologous_protein .
    ?orthologous_protein orth:organism/obo:RO_0002162 taxon:10116 . # rattus norvegicus
    ?orthologous_protein sio:SIO_010079 ?gene .
    ?protein_OMA lscr:xrefUniprot ?protein .
    FILTER(?node1 != ?node2)
		}
	}
  SERVICE <https://www.bgee.org/sparql/> {
    ?gene genex:isExpressedIn ?a .
    ?a rdfs:label "brain" .
    ?gene orth:organism ?s . 
    ?s obo:RO_0002162 taxon:10116.
	}
}""" ;
    schema:target <https://sparql.uniprot.org/sparql> ;
    spex:federatesWith <https://sparql.omabrowser.org/sparql/>, <https://www.bgee.org/sparql/> .

