@prefix ex: <https://sparql.rhea-db.org/.well-known/sparql-examples/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .

ex:9 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Select all Rhea reactions mapped to enzyme classification (EC numbers)"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """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 .
}""" ;
    schema:target <https://sparql.rhea-db.org/sparql/> .

