Examples

  1. 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 . }
  2. 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
  3. 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 . }
  4. 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 ) } }
  5. 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')) }
  6. 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 ) } }
  7. 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 ) } }
  8. 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 . }
  9. 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 . }
  10. 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 . }
  11. 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
  12. 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 . }
  13. 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 . }
  14. Select all Rhea reactions that have a given ChEBI ID as reaction participantPREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh: <http://rdf.rhea-db.org/> # Query 14 # Select all Rhea reactions that have CHEBI:29985 (L-glutamate) as reaction participant # # This query corresponds to the Rhea website query: # https://www.rhea-db.org/rhea?query=chebi:29985 SELECT distinct ?chebi ?rhea ?equation WHERE { ?rhea rdfs:subClassOf rh:Reaction . ?rhea rh:equation ?equation . ?rhea rh:side/rh:contains/rh:compound ?compound . # # the ChEBI can be used either as a small molecule, the reactive part of a macromolecule or as a polymer. # ?compound (rh:chebi|(rh:reactivePart/rh:chebi)|(rh:underlyingChebi/rh:chebi)) ?chebi . VALUES (?chebi) { (CHEBI:29985) } }
  15. Select all ChEBI compounds used in Rhea as reaction participantPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh: <http://rdf.rhea-db.org/> PREFIX up: <http://purl.uniprot.org/core/> # Query 15 # Select all ChEBI compounds used in Rhea as reaction participant # # This query can not be expressed in the Rhea website SELECT ?chebi ?name (count(?rhea) as ?countRhea) WHERE { ?rhea rdfs:subClassOf rh:Reaction . ?rhea rh:side/rh:contains/rh:compound ?compound . # # the ChEBI can be used either as a small molecule, the reactive part of a macromolecule or as a polymer. # ?compound (rh:chebi|(rh:reactivePart/rh:chebi)|(rh:underlyingChebi/rh:chebi)) ?chebi . ?chebi up:name ?name . } GROUP BY ?chebi ?name ORDER BY DESC(?countRhea)
  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,349,447 triples in this release (2025_02). 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