sparql-examples

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

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

58_Give_me_the_reactions_involving_a_given_Rhea_generic

rq turtle/ttl

Give me the reactions involving a given Rhea generic (GENERIC:11964, "reduced [NADPH—hemoprotein reductase]")

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh: <http://rdf.rhea-db.org/>

SELECT
  ?genericSubClass
  ?labelGenericSubClass
  (count(?genericParticipant) as ?countGenericParticipant)
WHERE
{
  ?genericSubClass rdfs:subClassOf rh:GenericParticipant .
  ?genericSubClass rdfs:label ?labelGenericSubClass .
  ?genericParticipant rdfs:subClassOf* ?genericSubClass .
} GROUP BY ?genericSubClass ?labelGenericSubClass

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?countGenericParticipant")
  v3("?genericParticipant"):::projected 
  v1("?genericSubClass"):::projected 
  v2("?labelGenericSubClass"):::projected 
  c2(["rh:GenericParticipant"]):::iri 
  v1 --"rdfs:subClassOf"-->  c2
  v1 --"rdfs:label"-->  v2
  v3 --"rdfs:subClassOf"-->  v1
  bind1[/"count(?genericParticipant)"/]
  v3 --o bind1
  bind1 --as--o v4