Skip to content

Commit 6bc79c9

Browse files
committed
Add pure SPARQL federation example queries for Uniprot
1 parent 0890aed commit 6bc79c9

3 files changed

Lines changed: 66 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Select all Rhea reactions linked to protein sequences (enzymes and transporters) in UniProtKB
2+
# Datasources: https://sparql.uniprot.org/sparql https://sparql.rhea-db.org/sparql
3+
4+
PREFIX rh: <http://rdf.rhea-db.org/>
5+
PREFIX up: <http://purl.uniprot.org/core/>
6+
7+
# Query 12
8+
# Select all Rhea reactions used to annotate enzyme sequences in UniProtKB
9+
# return the number of UniProtKB entries
10+
# Federated query using a service to UniProt SPARQL endpoint
11+
#
12+
# This query corresponds to the Rhea website query:
13+
# https://www.rhea-db.org/rhea?query=uniprot:*
14+
#
15+
SELECT ?uniprotCount ?rhea ?accession ?equation
16+
WHERE {
17+
{
18+
SELECT ?rhea (count(?uniprot) as ?uniprotCount) {
19+
?uniprot up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea .
20+
}
21+
GROUP BY ?rhea
22+
}
23+
?rhea rh:accession ?accession .
24+
?rhea rh:equation ?equation .
25+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Select all Rhea reactions used in UniProtKB/Swiss-Prot for a given organism (NCBI taxonomy ID)
2+
# Datasources: https://sparql.uniprot.org/sparql https://sparql.rhea-db.org/sparql
3+
4+
PREFIX rh: <http://rdf.rhea-db.org/>
5+
PREFIX up: <http://purl.uniprot.org/core/>
6+
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
7+
PREFIX up: <http://purl.uniprot.org/core/>
8+
9+
# Query 13
10+
# Select all Rhea reactions used to annotate Escherichia coli (taxid=83333) in UniProtKB/Swiss-Prot
11+
# return the number of UniProtKB entries
12+
#
13+
# Federated query using a service to UniProt SPARQL endpoint
14+
#
15+
# This query cannot be performed using the Rhea search website
16+
SELECT ?uniprot ?mnemo ?rhea ?accession ?equation
17+
WHERE {
18+
{
19+
VALUES (?taxid) { (taxon:83333) }
20+
GRAPH <http://sparql.uniprot.org/uniprot> {
21+
?uniprot up:reviewed true .
22+
?uniprot up:mnemonic ?mnemo .
23+
?uniprot up:organism ?taxid .
24+
?uniprot up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea .
25+
}
26+
}
27+
?rhea rh:accession ?accession .
28+
?rhea rh:equation ?equation .
29+
}

settings.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,21 @@
7272
"name": "Wikidata",
7373
"url": "https://query.wikidata.org/bigdata/ldf"
7474
},
75+
{
76+
"name": "Wikidata SPARQL",
77+
"url": "https://query.wikidata.org/sparql"
78+
},
7579
{
7680
"name": "SNCB",
7781
"url": "https://graph.irail.be/sncb/connections"
82+
},
83+
{
84+
"name": "Uniprot",
85+
"url": "https://sparql.uniprot.org/sparql"
86+
},
87+
{
88+
"name": "Rhea",
89+
"url": "https://sparql.rhea-db.org/sparql"
7890
}
7991
],
8092
"prefixes": {

0 commit comments

Comments
 (0)