sparql-examples

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

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

6

Show the reaction equation catalyzed by lactate dehydrogenase (KEGG reaction R00703). NB: Stoichiometric coefficients for substrates are given a negative value.

Use at

PREFIX keggR: <https://identifiers.org/kegg.reaction:>
PREFIX mnx: <https://rdf.metanetx.org/schema/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

# Show the reaction equation catalyzed by lactate
# dehydrogenase (KEGG reaction *R00703*). NB: Stoichiometric
# coefficients for substrates are given a negative value

SELECT ?chem ?chem_name ?comp ?comp_name ?coef
FROM <https://rdf.metanetx.org/> WHERE{
    ?reac mnx:reacXref keggR:R00703 .
    ?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 )
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v6("?c")
  v4("?chem"):::projected 
  v7("?chem_name"):::projected 
  v9("?coef"):::projected 
  v5("?comp"):::projected 
  v8("?comp_name"):::projected 
  v3("?part")
  v2("?reac")
  v1("?side")
  c4(["kegg.reaction:R00703"]):::iri 
  list0c2(["mnx:right"]):::iri 
  list0c1(["mnx:left"]):::iri 
  list0c1 --o f0
  list0c2 --o f0
  f0[[" in "]]
  f0 --> v1
  v2 --"mnx:reacXref"-->  c4
  v2 -->v1--> v3
  v3 --"mnx:chem"-->  v4
  v3 --"mnx:comp"-->  v5
  v3 --"mnx:coef"-->  v6
  v4 --"rdfs:comment"-->  v7
  v5 --"rdfs:comment"-->  v8
  bind1[/"if(?side = 'mnx:left','-1^^xsd:integer' * ?c,?c)"/]
  v1 --o bind1
  v6 --o bind1
  bind1 --as--o v9