sparql-examples

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

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

017

Anatomical entities where the ins zebrafish gene is expressed and its gene GO annotations.

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX genex: <http://purl.org/genex#>
PREFIX lscr: <http://purl.org/lscr#>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT DISTINCT ?anatomicalEntity ?goClass ?goLabel {
    {
        SELECT ?ensemblGene ?anatomicalEntity {
            ?geneB a orth:Gene ;
                genex:isExpressedIn ?anat ;
                rdfs:label ?geneLabel ;
                lscr:xrefEnsemblGene ?ensemblGene ;
                orth:organism/obo:RO_0002162 ?taxon2 .
            ?taxon2 up:commonName 'zebrafish' .
            FILTER (UCASE(?geneLabel) = UCASE('ins'))
            ?anat rdfs:label ?anatomicalEntity .
        }
    }
    SERVICE <https://sparql.uniprot.org/sparql> {
        ?uniprot rdfs:seeAlso/up:transcribedFrom ?ensemblGene ;
            a up:Protein ;
            up:classifiedWith ?goClass .
        ?goClass rdfs:label ?goLabel .
    }
} LIMIT 20
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?anat")
  v6("?anatomicalEntity"):::projected 
  v4("?ensemblGene")
  v2("?geneB")
  v1("?geneLabel")
  v8("?goClass"):::projected 
  v9("?goLabel"):::projected 
  v5("?taxon2")
  v7("?uniprot")
  a1((" "))
  a2((" "))
  c3(["orth:Gene"]):::iri 
  c10(["zebrafish"]):::literal 
  c14(["up:Protein"]):::iri 
  f0[["upper-case(?geneLabel) = upper-case('ins')"]]
  f0 --> v1
  v2 --"a"-->  c3
  v2 --"genex:isExpressedIn"-->  v3
  v2 --"rdfs:label"-->  v1
  v2 --"lscr:xrefEnsemblGene"-->  v4
  v2 --"orth:organism"-->  a1
  a1 --"obo:RO_0002162"-->  v5
  v5 --"up:commonName"-->  c10
  v3 --"rdfs:label"-->  v6
  subgraph s1["https://sparql.uniprot.org/sparql"]
    style s1 stroke-width:4px;
    v7 --"rdfs:seeAlso"-->  a2
    a2 --"up:transcribedFrom"-->  v4
    v7 --"a"-->  c14
    v7 --"up:classifiedWith"-->  v8
    v8 --"rdfs:label"-->  v9
  end