171_batch_id_mapping_style_lookup
- batch lookup
- id mapping
- organism
Given a batch of UniProt accessions, resolve each to its mnemonic entry name, recommended protein name, and organism in one query -- the SPARQL equivalent of the columns (EntryName, ProteinName, Organism) UniProt's own web-based ID mapping/retrieve service returns
Use at
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/>
SELECT
?protein
?mnemonic
?recommendedName
?organismName
WHERE {
VALUES ?protein { uniprotkb:P04637 uniprotkb:P01308 uniprotkb:Q13613 }
?protein up:mnemonic ?mnemonic ;
up:organism ?organism .
?protein up:reviewed ?reviewed .
OPTIONAL {
?protein up:recommendedName ?name .
}
OPTIONAL {
FILTER(!BOUND(?name))
?protein up:submittedName ?name .
}
?name up:fullName ?recommendedName .
?organism up:scientificName ?organismName .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?mnemonic"):::projected
v1("?name")
v4("?organism")
v7("?organismName"):::projected
v2("?protein"):::projected
v6("?recommendedName"):::projected
v5("?reviewed")
bind0[/VALUES ?protein/]
bind0-->v2
bind00(["uniprotkb:P04637"])
bind00 --> bind0
bind01(["uniprotkb:P01308"])
bind01 --> bind0
bind02(["uniprotkb:Q13613"])
bind02 --> bind0
v2 --"up:mnemonic"--> v3
v2 --"up:organism"--> v4
v2 --"up:reviewed"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."up:recommendedName".-> v1
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."up:submittedName".-> v1
end
v1 --"up:fullName"--> v6
v4 --"up:scientificName"--> v7