Examples

  1. Generate a draft human metabolomePREFIX 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 { ?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 . SERVICE <https://sparql.uniprot.org/sparql> { ?uniprot up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea ; up:organism taxon:9606 ; up:mnemonic ?mnemonic . } }
  2. Search for Chemical names starting in Japanese, translated to english using alliePREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT * WHERE { SERVICE <https://data.allie.dbcls.jp/sparql>{ ?x rdfs:label "1,2,4-トリクロロベンゼン"@ja ; rdfs:label ?englishLabel . FILTER(lang(?englishLabel) = "en") } BIND(STR(?englishLabel) AS ?englishLabelStr) ?chebi rdfs:label|oboInOwl:hasSynonym ?englishLabelStr . }
  3. Select all Rhea reactionsPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh: <http://rdf.rhea-db.org/> # Query 1 # Select all Rhea reactions (unspecified direction) # and return identifier (id), accession, boolean attributes (isChemicallyBalanced, isTransport) and chemical equation. # SELECT ?rhea ?id ?accession ?isChemicallyBalanced ?isTransport ?equation WHERE { ?rhea rdfs:subClassOf rh:Reaction . ?rhea rh:id ?id . ?rhea rh:accession ?accession . ?rhea rh:equation ?equation . ?rhea rh:isTransport ?isTransport . ?rhea rh:isChemicallyBalanced ?isChemicallyBalanced . }
  4. Select all Rhea reactions annotated with a given Pubmed IDPREFIX pubmed: <http://rdf.ncbi.nlm.nih.gov/pubmed/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh: <http://rdf.rhea-db.org/> # Query 2 # Select all Rhea reactions annotated with a given Pubmed identifier (PMID = 29867142) # SELECT ?pubmed ?rhea ?accession ?isTransport ?equation WHERE { ?rhea rdfs:subClassOf rh:Reaction . ?rhea rh:accession ?accession . ?rhea rh:citation ?pubmed . VALUES (?pubmed) { (pubmed:29867142) } ?rhea rh:isTransport ?isTransport . ?rhea rh:equation ?equation . } ORDER BY ?rhea
  5. Select the specific form of RHEA:11628, a reaction that deals with general chemical classes (i.e. select the equivalent reactions involving instances of the chemical classes in RHEA:11628PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh: <http://rdf.rhea-db.org/> # Query 3 # Select the specific form of RHEA:11628. # This query mimics the Related reactions sections of # https://www.rhea-db.org/rhea/11628 # SELECT ?rhea ?equation ?childrenRhea ?childrenEquation WHERE { VALUES (?rhea) {(rh:11628)} ?rhea rh:equation ?equation . ?childrenRhea rdfs:subClassOf+ ?rhea . ?childrenRhea rh:equation ?childrenEquation . }
  6. Select all cross-references for a given reactionPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh: <http://rdf.rhea-db.org/> # Query 4 # Select all cross-references mapped to RHEA:21016 # # This query mimics the Cross-references section of # https://www.rhea-db.org/rhea/21016 # SELECT distinct ?rhea ?rheaDir ?xref WHERE { ?rhea rdfs:subClassOf rh:Reaction . VALUES (?rhea) {(rh:21016)} { ?rhea rdfs:seeAlso ?xref . BIND(?rhea as ?rheaDir) } UNION { ?rhea rh:directionalReaction ?directionalReaction . ?directionalReaction rdfs:seeAlso ?xref . BIND(?directionalReaction as ?rheaDir ) } UNION { ?rhea rh:bidirectionalReaction ?bidirectionalReaction . ?bidirectionalReaction rdfs:seeAlso ?xref . BIND(?bidirectionalReaction as ?rheaDir ) } }
  7. Select all Rhea reactions mapped to KEGG reactionsPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh: <http://rdf.rhea-db.org/> # Query 5 # Select all Rhea reactions mapped to KEGG reactions # KEGG reactions are mapped to Rhea bidirectional reactions # Rhea web query: https://www.rhea-db.org/rhea?query=kegg:* # SELECT ?rhea ?kegg ?rheaDir WHERE { ?rhea rdfs:subClassOf rh:Reaction . ?rhea rh:bidirectionalReaction ?rheaDir . ?rheaDir rdfs:seeAlso ?kegg . FILTER (regex(str(?kegg),'kegg')) }
  8. Select all Rhea reactions mapped to MetaCyc reactionsPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh: <http://rdf.rhea-db.org/> # Query 6 # Select all Rhea reactions mapped to MetaCyc reactions # MetaCyc reactions are mapped to either undirected, left-to-right, right-to-left or bidirectional reactions # Rhea web query: https://www.rhea-db.org/rhea?query=metacyc:* # SELECT distinct ?rhea ?rheaDir ?metacyc WHERE { ?rhea rdfs:subClassOf rh:Reaction . { ?rhea rdfs:seeAlso ?metacyc . FILTER CONTAINS(str(?metacyc), "METACYC") BIND(?rhea as ?rheaDir) } UNION { ?rhea rh:directionalReaction ?directionalReaction . ?directionalReaction rdfs:seeAlso ?metacyc . FILTER CONTAINS(str(?metacyc), "METACYC") BIND(?directionalReaction as ?rheaDir ) } UNION { ?rhea rh:bidirectionalReaction ?bidirectionalReaction . ?bidirectionalReaction rdfs:seeAlso ?metacyc . FILTER CONTAINS(str(?metacyc), "METACYC") BIND(?bidirectionalReaction as ?rheaDir ) } }
  9. Select all Rhea reactions mapped to Reactome reactionsPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh: <http://rdf.rhea-db.org/> # Query 7 # Select all Rhea reactions mapped to Reactome reactions # MetaCyc reactions are mapped to either undirected, left-to-right or right-to-left reactions # Rhea web query: https://www.rhea-db.org/rhea?query=reactome:* # SELECT distinct ?rhea ?rheaDir ?reactome WHERE { ?rhea rdfs:subClassOf rh:Reaction . { ?rhea rdfs:seeAlso ?reactome . FILTER CONTAINS(str(?reactome), "reactome") BIND(?rhea as ?rheaDir) } UNION { ?rhea rh:directionalReaction ?directionalReaction . ?directionalReaction rdfs:seeAlso ?reactome . FILTER CONTAINS(str(?reactome), "reactome") BIND(?directionalReaction as ?rheaDir ) } }
  10. Select all Rhea reactions mapped to GO molecular functionsPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh: <http://rdf.rhea-db.org/> # Query 8 # Select all Rhea reactions mapped to GO molecular function # # This query corresponds to the Rhea website query: # https://www.rhea-db.org/rhea?query=go:* # SELECT ?go ?rhea ?equation WHERE { ?rhea rdfs:subClassOf rh:Reaction . ?rhea rdfs:seeAlso ?go . FILTER CONTAINS(str(?go), "GO_") ?rhea rh:equation ?equation . }
  11. Select all Rhea reactions mapped to enzyme classification (EC numbers)PREFIX ec: <http://purl.uniprot.org/enzyme/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh: <http://rdf.rhea-db.org/> # Query 9 # Select all Rhea reactions mapped to EC numbers (enzyme classification) # # This query corresponds to the Rhea website query: # https://www.rhea-db.org/rhea?query=ec:* # SELECT ?ec ?ecNumber ?rhea ?accession ?equation WHERE { ?rhea rdfs:subClassOf rh:Reaction . ?rhea rh:accession ?accession . ?rhea rh:ec ?ec . BIND(strafter(str(?ec),str(ec:)) as ?ecNumber) ?rhea rh:isTransport ?isTransport . ?rhea rh:equation ?equation . }
  12. Select all Rhea reactions linked to an enzyme classification (sub)-classPREFIX ec: <http://purl.uniprot.org/enzyme/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh: <http://rdf.rhea-db.org/> # Query 10 # Select all Rhea reactions mapped to # # This query corresponds to the Rhea website query: # https://www.rhea-db.org/rhea?query=ec:1.* # https://www.rhea-db.org/rhea?query=ec:1.1.* # https://www.rhea-db.org/rhea?query=ec:1.1.1.* # SELECT ?ec ?ecNumber ?rhea ?accession ?equation WHERE { ?rhea rdfs:subClassOf rh:Reaction . ?rhea rh:accession ?accession . ?rhea rh:ec ?ec . BIND(strafter(str(?ec),str(ec:)) as ?ecNumber) # class (e.g EC 1.-.-.-) FILTER (regex(?ecNumber,'^1\\.')) # sub-class (e.g EC 1.1.-.-) #FILTER (regex(?ecNumber,'^1\\.1\\.')) # sub-sub-class (e.g EC 1.1.1.-) #FILTER (regex(?ecNumber,'^1\\.1\\.1\\.')) ?rhea rh:equation ?equation . }
  13. Distribution of reactions according to the first class of the enzyme classification (federated query)PREFIX ec: <http://purl.uniprot.org/enzyme/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh: <http://rdf.rhea-db.org/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> # Query 11 # Retrieve the count of reactions mapped to each level (main class) of the enzyme classification # # This query mimics the Filter section of the Rhea website (Browse all reactions) # https://www.rhea-db.org/rhea?query= SELECT ?ecClass (STR(?ecName) AS ?ecClassName) (COUNT(?rhea) AS ?rheaCount) WHERE { SERVICE <https://sparql.uniprot.org/sparql> { VALUES (?ecClass) { (ec:1.-.-.-)(ec:2.-.-.-)(ec:3.-.-.-)(ec:4.-.-.-)(ec:5.-.-.-) (ec:6.-.-.-) (ec:7.-.-.-)} ?ecNumber rdfs:subClassOf ?ecClass . ?ecClass skos:prefLabel ?ecName . } ?rhea rdfs:subClassOf rh:Reaction . ?rhea rh:ec ?ecNumber . } GROUP BY ?ecClass ?ecName
  14. Select all Rhea reactions linked to protein sequences (enzymes and transporters) in UniProtKBPREFIX rh: <http://rdf.rhea-db.org/> PREFIX up: <http://purl.uniprot.org/core/> # Query 12 # Select all Rhea reactions used to annotate enzyme sequences in UniProtKB # return the number of UniProtKB entries # Federated query using a service to UniProt SPARQL endpoint # # This query corresponds to the Rhea website query: # https://www.rhea-db.org/rhea?query=uniprot:* # SELECT ?uniprotCount ?rhea ?accession ?equation WHERE { SERVICE <https://sparql.uniprot.org/sparql> { SELECT ?rhea (count(?uniprot) as ?uniprotCount) { ?uniprot up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea . } GROUP BY ?rhea } ?rhea rh:accession ?accession . ?rhea rh:equation ?equation . }
  15. Select all Rhea reactions used in UniProtKB/Swiss-Prot for a given organism (NCBI taxonomy ID).PREFIX rh: <http://rdf.rhea-db.org/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX up: <http://purl.uniprot.org/core/> # Query 13 # Select all Rhea reactions used to annotate Escherichia coli (taxid=83333) in UniProtKB/Swiss-Prot # return the number of UniProtKB entries # # Federated query using a service to UniProt SPARQL endpoint # # This query cannot be performed using the Rhea search website SELECT ?uniprot ?mnemo ?rhea ?accession ?equation WHERE { SERVICE <https://sparql.uniprot.org/sparql> { VALUES (?taxid) { (taxon:83333) } GRAPH <http://sparql.uniprot.org/uniprot> { ?uniprot up:reviewed true . ?uniprot up:mnemonic ?mnemo . ?uniprot up:organism ?taxid . ?uniprot up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea . } } ?rhea rh:accession ?accession . ?rhea rh:equation ?equation . }
  16. More examples

About

This SPARQL endpoint contains Rhea reactions data (see statistics), and a snapshot of ChEBI data matching the Rhea release. It is free to access and supports the SPARQL 1.1 Standard.

There are 5,202,486 triples in this release (2024_06). The query timeout is 45 minutes. All triples are available in the default graph. There are two named graphs: Rhea and ChEBI.

Documentation

  1. Statistics and diagrams
  2. Tutorial on using SPARQL with Rhea
  3. Example queries
  4. Release data