sparql-examples

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

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

018

Which are the mouse's proteins encoded by genes which are expressed in the liver and are orthologous to human's INS gene?

Use at

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

SELECT ?humanProtein ?mouseProtein ?mouseOmaLink {
    {
        ?humanTaxon up:commonName 'human' .
        ?mouseTaxon up:commonName 'mouse' .
    }
    SERVICE <https://sparql.omabrowser.org/sparql> {
        ?cluster a orth:OrthologsCluster ;
            orth:hasHomologousMember ?node1 ;
            orth:hasHomologousMember ?node2 .
        ?node2 orth:hasHomologousMember* ?mouseProtein .
        ?node1 orth:hasHomologousMember* ?humanProtein .
        ?humanProtein a orth:Protein ;
            rdfs:label 'INS' ;
            orth:organism/obo:RO_0002162 ?humanTaxon .
        ?mouseProtein a orth:Protein ;
            sio:SIO_010079 ?mouseGene ; # is encoded by
            orth:organism/obo:RO_0002162 ?mouseTaxon ;
            rdfs:seeAlso ?mouseOmaLink .
        ?mouseGene lscr:xrefEnsemblGene ?mouseGeneEnsembl .
        FILTER ( ?node1 != ?node2 )
    }
    {
        ?mouseGeneBgee a orth:Gene ;
            lscr:xrefEnsemblGene ?mouseGeneEnsembl ;
            genex:isExpressedIn ?cond ;
            orth:organism/obo:RO_0002162 ?mouseTaxon .
        ?cond genex:hasAnatomicalEntity/rdfs:label 'liver' .
    }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v5("?cluster")
  v12("?cond")
  v7("?humanProtein"):::projected 
  v1("?humanTaxon")
  v8("?mouseGene")
  v11("?mouseGeneBgee")
  v10("?mouseGeneEnsembl")
  v9("?mouseOmaLink"):::projected 
  v6("?mouseProtein"):::projected 
  v2("?mouseTaxon")
  v3("?node1")
  v4("?node2")
  a1((" "))
  a2((" "))
  a3((" "))
  a4((" "))
  c19(["liver"]):::literal 
  c6(["orth:OrthologsCluster"]):::iri 
  c16(["orth:Gene"]):::iri 
  c10(["INS"]):::literal 
  c8(["orth:Protein"]):::iri 
  c3(["mouse"]):::literal 
  c2(["human"]):::literal 
  v1 --"up:commonName"-->  c2
  v2 --"up:commonName"-->  c3
  subgraph s1["https://sparql.omabrowser.org/sparql"]
    style s1 stroke-width:4px;
    f0[["?node1 != ?node2"]]
    f0 --> v3
    f0 --> v4
    v5 --"a"-->  c6
    v5 --"orth:hasHomologousMember"-->  v3
    v5 --"orth:hasHomologousMember"-->  v4
    v4 --"orth:hasHomologousMember"-->  v6
    v3 --"orth:hasHomologousMember"-->  v7
    v7 --"a"-->  c8
    v7 --"rdfs:label"-->  c10
    v7 --"orth:organism"-->  a1
    a1 --"obo:RO_0002162"-->  v1
    v6 --"a"-->  c8
    v6 --"sio:SIO_010079"-->  v8
    v6 --"orth:organism"-->  a2
    a2 --"obo:RO_0002162"-->  v2
    v6 --"rdfs:seeAlso"-->  v9
    v8 --"lscr:xrefEnsemblGene"-->  v10
  end
  v11 --"a"-->  c16
  v11 --"lscr:xrefEnsemblGene"-->  v10
  v11 --"genex:isExpressedIn"-->  v12
  v11 --"orth:organism"-->  a3
  a3 --"obo:RO_0002162"-->  v2
  v12 --"genex:hasAnatomicalEntity"-->  a4
  a4 --"rdfs:label"-->  c19