sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

117_biosodafrontend_glioblastoma_orthologs_rat

rq turtle/ttl

Which are the proteins associated with glioblastoma and the orthologs expressed in the rat brain?

Use at

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.
	}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v10("?a")
  v3("?annotation")
  v1("?annotation_text"):::projected 
  v8("?cluster")
  v9("?gene"):::projected 
  v4("?node1")
  v5("?node2")
  v7("?orthologous_protein"):::projected 
  v2("?protein"):::projected 
  v6("?protein_OMA")
  v11("?s")
  a1((" "))
  c8(["up:Disease_Annotation"]):::iri 
  c11(["orth:OrthologsCluster"]):::iri 
  c21(["brain"]):::literal 
  c5(["taxon:9606"]):::iri 
  c10(["orth:Protein"]):::iri 
  c15(["taxon:10116"]):::iri 
  c3(["up:Protein"]):::iri 
  f0[["contains(?annotation_text,'glioblastoma')"]]
  f0 --> v1
  v2 --"a"-->  c3
  v2 --"up:organism"-->  c5
  v2 --"up:annotation"-->  v3
  v3 --"rdfs:comment"-->  v1
  v3 --"a"-->  c8
  subgraph s1["https://sparql.omabrowser.org/sparql/"]
    style s1 stroke-width:4px;
    f1[["?node1 != ?node2"]]
    f1 --> v4
    f1 --> v5
    v6 --"a"-->  c10
    v7 --"a"-->  c10
    v8 --"a"-->  c11
    v8 --"orth:hasHomologousMember"-->  v4
    v8 --"orth:hasHomologousMember"-->  v5
    v5 --"orth:hasHomologousMember"-->  v6
    v4 --"orth:hasHomologousMember"-->  v7
    v7 --"orth:organism"-->  a1
    a1 --"obo:RO_0002162"-->  c15
    v7 --"sio:SIO_010079"-->  v9
    v6 --"lscr:xrefUniprot"-->  v2
  end
  subgraph s2["https://www.bgee.org/sparql/"]
    style s2 stroke-width:4px;
    v9 --"genex:isExpressedIn"-->  v10
    v10 --"rdfs:label"-->  c21
    v9 --"orth:organism"-->  v11
    v11 --"obo:RO_0002162"-->  c15
  end