@prefix ex: <https://sparql.rhea-db.org/.well-known/sparql-examples/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix spex: <https://purl.expasy.org/sparql-examples/ontology#> .

ex:28_Select_all_reactions_with_Xrefs a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Select all reactions with cross-references"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX rh:<http://rdf.rhea-db.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT 
  DISTINCT ?reaction 
WHERE {
  ?reaction rdfs:subClassOf rh:Reaction .
  ?reaction rh:directionalReaction ?directionalReaction .
  ?reaction rh:bidirectionalReaction ?bidirectionalReaction .
  OPTIONAL { ?directionalReaction rdfs:seeAlso ?xref . }
  OPTIONAL { ?bidirectionalReaction rdfs:seeAlso ?xref . }
  FILTER (BOUND(?xref))
}
ORDER BY ?reaction
""" ;
    schema:target <https://sparql.rhea-db.org/sparql/> .
