sparql-examples

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

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

8

Select all Rhea reactions mapped to GO molecular functions

Use at

PREFIX 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 .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?equation"):::projected 
  v1("?go"):::projected 
  v2("?rhea"):::projected 
  c3(["rh:Reaction"]):::iri 
  f0[["contains(str(?go),'GO_')"]]
  f0 --> v1
  v2 --"rdfs:subClassOf"-->  c3
  v2 --"rdfs:seeAlso"-->  v1
  v2 --"rh:equation"-->  v3