A set of SPARQL examples that are used in different SIB resources
Find all proteins linked to arachidonate (CHEBI:32395)
PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
PREFIX rh: <http://rdf.rhea-db.org/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT
DISTINCT
?uniprot
?uniprotID
?recname
?gene
?chebi
?uniprotName
WHERE {
SERVICE <https://sparql.rhea-db.org/sparql> {
VALUES (?chebi) { (CHEBI:32395) }
?rhea rh:side/rh:contains/rh:compound ?compound .
?compound rh:chebi ?chebi .
?chebi up:name ?uniprotName .
}
?uniprot up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea .
?uniprot up:mnemonic ?uniprotID .
?uniprot up:recommendedName/up:fullName ?recname .
OPTIONAL {?uniprot up:encodedBy/skos:prefLabel ?gene .}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?chebi"):::projected
v3("?compound")
v8("?gene"):::projected
v7("?recname"):::projected
v2("?rhea")
v5("?uniprot"):::projected
v6("?uniprotID"):::projected
v4("?uniprotName"):::projected
a1((" "))
a2((" "))
a3((" "))
a4((" "))
a5((" "))
a6((" "))
subgraph s1["https://sparql.rhea-db.org/sparql"]
style s1 stroke-width:4px;
bind0[/VALUES ?chebi/]
bind0-->v1
bind00(["CHEBI:32395"])
bind00 --> bind0
v2 --"rh:side"--> a1
a1 --"rh:contains"--> a2
a2 --"rh:compound"--> v3
v3 --"rh:chebi"--> v1
v1 --"up:name"--> v4
end
v5 --"up:annotation"--> a3
a3 --"up:catalyticActivity"--> a4
a4 --"up:catalyzedReaction"--> v2
v5 --"up:mnemonic"--> v6
v5 --"up:recommendedName"--> a5
a5 --"up:fullName"--> v7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."up:encodedBy".-> a6
a6 --"skos:prefLabel"--> v8
end