@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:10 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "A GEM is primarily a set of reactions: here are all the reaction equations occurring in bigg_e_coli_core. NB: here the reac label is the one produced while compiling MetaNetX"@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#>

# A GEM is primarily a set of reactions: here are all the
# reaction equations occurring in *bigg_e_coli_core*. NB: here
# the reac label is the one produced while compiling MetaNetX

SELECT ?reac_label ?chem_name ?comp_name ?coef
WHERE{
    ?mnet rdfs:label 'bigg_e_coli_core' ;
          mnx:gpr/mnx:reac ?reac .
    ?reac rdfs:label ?reac_label ;
          ?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 )
}
ORDER BY ?reac_label""" ;
    schema:target <https://rdf.metanetx.org/sparql/> .

