sparql-examples

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

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

67_draft_human_metabolome

Generate a draft human metabolome

Use at

PREFIX chebislash: <http://purl.obolibrary.org/obo/chebi/>
PREFIX rh: <http://rdf.rhea-db.org/>
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT
?uniprot ?mnemonic ?rhea ?chebi ?smiles ?inchiKey
WHERE
{
  ?uniprot up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea ;
        up:organism taxon:9606 ;
        up:mnemonic ?mnemonic .
  SERVICE <https://sparql.rhea-db.org/sparql> {
	?rhea rh:side/rh:contains/rh:compound ?compound .
    ?compound (rh:chebi|(rh:reactivePart/rh:chebi)|(rh:underlyingChebi/rh:chebi)) ?chebi .
   }
   ?chebi chebislash:smiles ?smiles ;
          chebislash:inchikey ?inchiKey .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v5("?chebi"):::projected 
  v4("?compound")
  v7("?inchiKey"):::projected 
  v3("?mnemonic"):::projected 
  v2("?rhea"):::projected 
  v6("?smiles"):::projected 
  v1("?uniprot"):::projected 
  a1((" "))
  a2((" "))
  a3((" "))
  a4((" "))
  a5((" "))
  a6((" "))
  c5(["taxon:9606"]):::iri 
  v1 --"up:annotation"-->  a1
  a1 --"up:catalyticActivity"-->  a2
  a2 --"up:catalyzedReaction"-->  v2
  v1 --"up:organism"-->  c5
  v1 --"up:mnemonic"-->  v3
  subgraph s1["https://sparql.rhea-db.org/sparql"]
    style s1 stroke-width:4px;
    v2 --"rh:side"-->  a3
    a3 --"rh:contains"-->  a4
    a4 --"rh:compound"-->  v4
    subgraph union0[" Union "]
    subgraph union0l[" "]
      style union0l fill:#abf,stroke-dasharray: 3 3;
      subgraph union1[" Union "]
      subgraph union1l[" "]
        style union1l fill:#abf,stroke-dasharray: 3 3;
        v4 --"rh:underlyingChebi"-->  a6
        a6 --"rh:chebi"-->  v5
      end
      subgraph union1r[" "]
        style union1r fill:#abf,stroke-dasharray: 3 3;
        v4 --"rh:reactivePart"-->  a5
        a5 --"rh:chebi"-->  v5
      end
      union1r <== or ==> union1l
      end
    end
    subgraph union0r[" "]
      style union0r fill:#abf,stroke-dasharray: 3 3;
      v4 --"rh:chebi"-->  v5
    end
    union0r <== or ==> union0l
    end
  end
  v5 --"chebislash:smiles"-->  v6
  v5 --"chebislash:inchikey"-->  v7