sparql-examples

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

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

40

Retrieve human enzymes that metabolize sphingolipids and are annotated in ChEMBL

Use at

PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh: <http://rdf.rhea-db.org/>
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT DISTINCT ?protein ?chemblEntry
WHERE {
  SERVICE <https://sparql.rhea-db.org/sparql> {
    ?rhea rdfs:subClassOf rh:Reaction ;
      rh:side/rh:contains/rh:compound/rh:chebi/rdfs:subClassOf+ CHEBI:26739 .
  }
  ?ca up:catalyzedReaction ?rhea .
  ?protein up:annotation/up:catalyticActivity ?ca ;
    up:organism taxon:9606 ;
    rdfs:seeAlso ?chemblEntry .
  ?chemblEntry up:database <http://purl.uniprot.org/database/ChEMBL> .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?ca")
  v4("?chemblEntry"):::projected 
  v3("?protein"):::projected 
  v1("?rhea")
  a1((" "))
  a2((" "))
  a3((" "))
  a4((" "))
  a5((" "))
  c16([http://purl.uniprot.org/database/ChEMBL]):::iri 
  c13(["taxon:9606"]):::iri 
  c3(["rh:Reaction"]):::iri 
  c8(["CHEBI:26739"]):::iri 
  subgraph s1["https://sparql.rhea-db.org/sparql"]
    style s1 stroke-width:4px;
    v1 --"rdfs:subClassOf"-->  c3
    v1 --"rh:side"-->  a1
    a1 --"rh:contains"-->  a2
    a2 --"rh:compound"-->  a3
    a3 --"rh:chebi"-->  a4
    a4 --"rdfs:subClassOf"-->  c8
  end
  v2 --"up:catalyzedReaction"-->  v1
  v3 --"up:annotation"-->  a5
  a5 --"up:catalyticActivity"-->  v2
  v3 --"up:organism"-->  c13
  v3 --"rdfs:seeAlso"-->  v4
  v4 --"up:database"-->  c16