sparql-examples

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

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

1

Find all Rattus norvegicus proteins present in OMA RDF database.

Use at

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

SELECT ?protein ?OMA_link
WHERE {
    ?protein a orth:Protein ;
        orth:organism ?organism .
    ?organism obo:RO_0002162 ?taxon . # in taxon
    ?taxon up:scientificName 'Rattus norvegicus' .
    ?protein rdfs:seeAlso ?OMA_link .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?OMA_link"):::projected 
  v2("?organism")
  v1("?protein"):::projected 
  v3("?taxon")
  c2(["orth:Protein"]):::iri 
  c6(["Rattus norvegicus"]):::literal 
  v1 --"a"-->  c2
  v1 --"orth:organism"-->  v2
  v2 --"obo:RO_0002162"-->  v3
  v3 --"up:scientificName"-->  c6
  v1 --"rdfs:seeAlso"-->  v4