A set of SPARQL examples that are used in different SIB resources
Find human proteins that catalyze reactions where substrates or product have a Cholestane skeleton
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh: <http://rdf.rhea-db.org/>
PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT
DISTINCT
?protein
?disease
?rhea
?chebi
?omim
WHERE {
# Find complete ChEBIs with a Cholestane skeleton, via the Czech Elixir node IDSM Sachem chemical substructure search.
SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/chebi> {
?chebi sachem:substructureSearch [
sachem:query
"[C@]12(CCC3CCCC[C@]3(C)[C@@]1([H])CC[C@]1(C)[C@@]([H])([C@@](C)([H])CCCC(C)C)CC[C@@]21[H])[H]"
].
}
# Use the fact that UniProt catalytic activities are annotated using Rhea
# Mapping the found ChEBIs to Rhea reactions
SERVICE <https://sparql.rhea-db.org/sparql>{
?rhea rh:side/rh:contains/rh:compound/rdfs:subClassOf ?chebi .
}
# Match the found Rhea reactions with human UniProtKB proteins
?protein up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea .
?protein up:organism taxon:9606 .
# Find only those human entries that have an annotated related disease, and optionaly map these to OMIM
?protein up:annotation/up:disease ?disease .
OPTIONAL {
?disease rdfs:seeAlso ?omim .
?omim up:database <http://purl.uniprot.org/database/MIM>
}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?chebi"):::projected
v4("?disease"):::projected
v5("?omim"):::projected
v3("?protein"):::projected
v2("?rhea"):::projected
a1((" "))
a2((" "))
a3((" "))
a4((" "))
a5((" "))
a6((" "))
a7((" "))
c3(["#91;C@#93;12(CCC3CCCC#91;C@#93;3(C)#91;C@@#93;1(#91;H#93;)CC#91;C@#93;1(C)#91;C@@#93;(#91;H#93;)(#91;C@@#93;(C)(#91;H#93;)CCCC(C)C)CC#91;C@@#93;21#91;H#93;)#91;H#93;"]):::literal
c14(["taxon:9606"]):::iri
c18([http://purl.uniprot.org/database/MIM]):::iri
subgraph s1["https://idsm.elixir-czech.cz/sparql/endpoint/chebi"]
style s1 stroke-width:4px;
a1 --"sachem:query"--> c3
v1 --"sachem:substructureSearch"--> a1
end
subgraph s2["https://sparql.rhea-db.org/sparql"]
style s2 stroke-width:4px;
v2 --"rh:side"--> a2
a2 --"rh:contains"--> a3
a3 --"rh:compound"--> a4
a4 --"rdfs:subClassOf"--> v1
end
v3 --"up:annotation"--> a5
a5 --"up:catalyticActivity"--> a6
a6 --"up:catalyzedReaction"--> v2
v3 --"up:organism"--> c14
v3 --"up:annotation"--> a7
a7 --"up:disease"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."rdfs:seeAlso".-> v5
v5 --"up:database"--> c18
end