sparql-examples

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

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

3

Retrieve all proteins in OMA that is encoded by the INS gene and their mnemonics and evidence types from Uniprot database (federated query).

Use at

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

SELECT DISTINCT ?proteinOMA ?species ?mnemonic ?evidenceType ?UniProt_URI
WHERE {
    ?proteinOMA a orth:Protein ;
        orth:organism/obo:RO_0002162/up:scientificName ?species ;
        rdfs:label 'INS' .
    ?proteinOMA lscr:xrefUniprot ?UniProt_URI .
    # Search the INS gene mnemonics and evidence types from Uniprot database
    SERVICE <https://sparql.uniprot.org/sparql> {
        ?UniProt_URI up:mnemonic ?mnemonic ;
            up:existence/rdfs:label ?evidenceType.
    }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?UniProt_URI"):::projected 
  v5("?evidenceType"):::projected 
  v4("?mnemonic"):::projected 
  v1("?proteinOMA"):::projected 
  v2("?species"):::projected 
  a1((" "))
  a2((" "))
  a3((" "))
  c2(["orth:Protein"]):::iri 
  c7(["INS"]):::literal 
  v1 --"a"-->  c2
  v1 --"orth:organism"-->  a1
  a1 --"obo:RO_0002162"-->  a2
  a2 --"up:scientificName"-->  v2
  v1 --"rdfs:label"-->  c7
  v1 --"lscr:xrefUniprot"-->  v3
  subgraph s1["https://sparql.uniprot.org/sparql"]
    style s1 stroke-width:4px;
    v3 --"up:mnemonic"-->  v4
    v3 --"up:existence"-->  a3
    a3 --"rdfs:label"-->  v5
  end