A set of SPARQL examples that are used in different SIB resources
Select the number of reactions with status Approved
PREFIX rh:<http://rdf.rhea-db.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT (count(?reaction) as ?reactionCount) WHERE {
?reaction rdfs:subClassOf rh:Reaction .
?reaction rh:status rh:Approved .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?reaction"):::projected
v2("?reactionCount")
c4(["rh:Approved"]):::iri
c2(["rh:Reaction"]):::iri
v1 --"rdfs:subClassOf"--> c2
v1 --"rh:status"--> c4
bind1[/"count(?reaction)"/]
v1 --o bind1
bind1 --as--o v2