A set of SPARQL examples that are used in different SIB resources
Retrieve the set of reactions catalyzed by human enzymes (reactions - EC - proteins from HUMAN reference proteome)
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh:<http://rdf.rhea-db.org/>
PREFIX CHEBI:<http://purl.obolibrary.org/obo/CHEBI_>
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 {
?reaction rdfs:subClassOf rh:Reaction .
?reaction rh:status rh:Approved .
?reaction rh:ec ?ecNumber .
?reaction rh:side ?reactionSide .
?reactionSide rh:contains ?participant .
?participant rh:compound ?compound .
# ?compound rh:chebi CHEBI:57970 .
?compound rh:chebi ?chebi .
?chebi rdfs:subClassOf+ CHEBI:18059 .
SERVICE <https://sparql.uniprot.org/sparql> {
?protein a up:Protein ;
up:reviewed true ;
up:organism taxon:83333 ;
up:classifiedWith keywords:1185 .
{?protein up:enzyme ?ecNumber}
UNION
{?protein up:domain/up:enzyme ?ecNumber}
UNION
{?protein up:component/up:enzyme ?ecNumber} .
}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?chebi")
v5("?compound")
v2("?ecNumber"):::projected
v4("?participant")
v7("?protein"):::projected
v1("?reaction"):::projected
v3("?reactionSide")
a1((" "))
a2((" "))
c17(["taxon:83333"]):::iri
c4(["rh:Approved"]):::iri
c19(["keywords:1185"]):::iri
c15(["true^^xsd:boolean"]):::literal
c2(["rh:Reaction"]):::iri
c10(["CHEBI:18059"]):::iri
c13(["up:Protein"]):::iri
v1 --"rdfs:subClassOf"--> c2
v1 --"rh:status"--> c4
v1 --"rh:ec"--> v2
v1 --"rh:side"--> v3
v3 --"rh:contains"--> v4
v4 --"rh:compound"--> v5
v5 --"rh:chebi"--> v6
v6 --"rdfs:subClassOf"--> c10
subgraph s1["https://sparql.uniprot.org/sparql"]
style s1 stroke-width:4px;
v7 --"a"--> c13
v7 --"up:reviewed"--> c15
v7 --"up:organism"--> c17
v7 --"up:classifiedWith"--> c19
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;
v7 --"up:component"--> a2
a2 --"up:enzyme"--> v2
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v7 --"up:domain"--> a1
a1 --"up:enzyme"--> v2
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v7 --"up:enzyme"--> v2
end
union0r <== or ==> union0l
end
end