sparql-examples

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

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

1

Select all Rhea reactions

Use at

PREFIX 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 .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?accession"):::projected 
  v4("?equation"):::projected 
  v2("?id"):::projected 
  v6("?isChemicallyBalanced"):::projected 
  v5("?isTransport"):::projected 
  v1("?rhea"):::projected 
  c2(["rh:Reaction"]):::iri 
  v1 --"rdfs:subClassOf"-->  c2
  v1 --"rh:id"-->  v2
  v1 --"rh:accession"-->  v3
  v1 --"rh:equation"-->  v4
  v1 --"rh:isTransport"-->  v5
  v1 --"rh:isChemicallyBalanced"-->  v6