@prefix ex: <https://sparql.metanetx.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#> .

ex:7 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Show the reaction equation for the tartrate/succinate antiporter (rhea:34763). NB: there are two generic compartments here.)"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX mnx: <https://rdf.metanetx.org/schema/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh: <http://rdf.rhea-db.org/>

# Show the reaction equation for the tartrate/succinate
# antiporter (*rh:34763*). NB: there are two generic
# compartments here.

SELECT ?chem ?chem_name ?comp ?comp_name ?coef
WHERE{
    ?reac mnx:reacXref rh:34763 .
    ?reac ?side ?part .
    ?part mnx:chem ?chem ;
          mnx:comp ?comp ;
          mnx:coef ?c    .
    ?chem rdfs:comment ?chem_name .
    ?comp rdfs:comment ?comp_name .
    FILTER( ?side IN ( mnx:left , mnx:right ))
    BIND( IF( ?side = mnx:left, - ?c, ?c ) AS ?coef )
}""" ;
    schema:target <https://rdf.metanetx.org/sparql/> .

