A set of SPARQL examples that are used in different SIB resources
Select all reactions with no links to EC numbers
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh:<http://rdf.rhea-db.org/>
SELECT ?reaction WHERE {
?reaction rdfs:subClassOf rh:Reaction .
FILTER (NOT EXISTS {?reaction rh:ec ?ecNumber .})
}
ORDER BY ?reaction
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?ecNumber")
v1("?reaction"):::projected
c3(["rh:Reaction"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"rh:ec"--> e0v2
e0v2("?ecNumber"):::projected
e0v1("?reaction"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"rh:ec"--> v2
v1 --"rdfs:subClassOf"--> c3