sparql-examples

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

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

50

Where are the human genes encoding enzymes metabolizing N-acyl sphingosines expressed in the human body (federated query, with Rhea and Bgee)

Use at

PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
PREFIX genex: <http://purl.org/genex#>
PREFIX lscr: <http://purl.org/lscr#>
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
    ?chebi
    ?reaction
    ?protein ?ensemblGene
    ?anatomicEntityLabel
    ?anatomicEntity
WHERE {
  SERVICE <https://sparql.rhea-db.org/sparql> {
    ?reaction rdfs:subClassOf rh:Reaction .
    ?reaction rh:equation ?reactionEquation .
    ?reaction rh:side ?reactionSide .
    ?reactionSide rh:contains ?participant .
    ?participant rh:compound ?compound .
    ?compound rh:chebi ?chebi .
    ?chebi rdfs:subClassOf* CHEBI:52639
}
  ?protein up:organism taxon:9606 .
  ?protein up:annotation ?a .
  ?a a up:Catalytic_Activity_Annotation .
  ?a up:catalyticActivity ?ca .
  ?ca up:catalyzedReaction ?reaction .
  ?protein rdfs:seeAlso / up:transcribedFrom ?ensemblGene .

  SERVICE  <https://www.bgee.org/sparql> {
    ?gene genex:isExpressedIn ?anatomicEntity .
    ?gene lscr:xrefEnsemblGene ?ensemblGene .
    ?anatomicEntity rdfs:label ?anatomicEntityLabel .
  }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v8("?a")
  v12("?anatomicEntity"):::projected 
  v13("?anatomicEntityLabel"):::projected 
  v9("?ca")
  v6("?chebi"):::projected 
  v5("?compound")
  v10("?ensemblGene"):::projected 
  v11("?gene")
  v4("?participant")
  v7("?protein"):::projected 
  v1("?reaction"):::projected 
  v2("?reactionEquation")
  v3("?reactionSide")
  a1((" "))
  c9(["CHEBI:52639"]):::iri 
  c11(["taxon:9606"]):::iri 
  c3(["rh:Reaction"]):::iri 
  c14(["up:Catalytic_Activity_Annotation"]):::iri 
  subgraph s1["https://sparql.rhea-db.org/sparql"]
    style s1 stroke-width:4px;
    v1 --"rdfs:subClassOf"-->  c3
    v1 --"rh:equation"-->  v2
    v1 --"rh:side"-->  v3
    v3 --"rh:contains"-->  v4
    v4 --"rh:compound"-->  v5
    v5 --"rh:chebi"-->  v6
    v6 --"rdfs:subClassOf"-->  c9
  end
  v7 --"up:organism"-->  c11
  v7 --"up:annotation"-->  v8
  v8 --"a"-->  c14
  v8 --"up:catalyticActivity"-->  v9
  v9 --"up:catalyzedReaction"-->  v1
  v7 --"rdfs:seeAlso"-->  a1
  a1 --"up:transcribedFrom"-->  v10
  subgraph s2["https://www.bgee.org/sparql"]
    style s2 stroke-width:4px;
    v11 --"genex:isExpressedIn"-->  v12
    v11 --"lscr:xrefEnsemblGene"-->  v10
    v12 --"rdfs:label"-->  v13
  end