A set of SPARQL examples that are used in different SIB resources
Retrieve the set of reactions catalyzed by enzymes of the ECOLI reference proteome (
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh:<http://rdf.rhea-db.org/>
PREFIX ec:<http://purl.uniprot.org/enzyme/>
PREFIX up:<http://purl.uniprot.org/core/>
PREFIX taxon:<http://purl.uniprot.org/taxonomy/>
PREFIX keywords:<http://purl.uniprot.org/keywords/>
SELECT ?protein ?ecNumber ?reaction where {
SERVICE <https://sparql.uniprot.org/sparql> {
?protein a up:Protein .
?protein up:reviewed true .
?protein up:organism taxon:83333 .
?protein up:classifiedWith keywords:1185 .
{?protein up:enzyme ?ecNumber}
UNION
{?protein up:domain/up:enzyme ?ecNumber}
UNION
{?protein up:component/up:enzyme ?ecNumber} .
}
?reaction rdfs:subClassOf rh:Reaction .
?reaction rh:status rh:Approved .
?reaction rh:ec ?ecNumber .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?ecNumber"):::projected
v1("?protein"):::projected
v3("?reaction"):::projected
a1((" "))
a2((" "))
c7(["taxon:83333"]):::iri
c16(["rh:Approved"]):::iri
c9(["keywords:1185"]):::iri
c5(["true^^xsd:boolean"]):::literal
c14(["rh:Reaction"]):::iri
c3(["up:Protein"]):::iri
subgraph s1["https://sparql.uniprot.org/sparql"]
style s1 stroke-width:4px;
v1 --"a"--> c3
v1 --"up:reviewed"--> c5
v1 --"up:organism"--> c7
v1 --"up:classifiedWith"--> c9
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v1 --"up:component"--> a2
a2 --"up:enzyme"--> v2
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v1 --"up:domain"--> a1
a1 --"up:enzyme"--> v2
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"up:enzyme"--> v2
end
union0r <== or ==> union0l
end
end
v3 --"rdfs:subClassOf"--> c14
v3 --"rh:status"--> c16
v3 --"rh:ec"--> v2