164_batch_go_annotations_from_mnemonics

rq turtle/ttl

Given a batch of UniProt mnemonic identifiers (Entry Names, e.g. MTMR1_HUMAN) rather than accessions, resolve each to its protein and retrieve its GO annotations in one query. This is the classic biomaRt batch-lookup pattern where a SPARQL VALUES clause replaces getBM(), and unlike biomaRt it naturally returns one row per (protein, GO term) pair instead of dropping or truncating the one-to-many result

Use at

PREFIX up: <http://purl.uniprot.org/core/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX GO: <http://purl.obolibrary.org/obo/GO_>

SELECT ?mnemonic ?protein ?goTerm ?goLabel
WHERE {
  VALUES ?mnemonic { "MTMR1_HUMAN" "P53_HUMAN" "INS_HUMAN" }
  ?protein up:mnemonic ?mnemonic ;
    up:classifiedWith ?goTerm .
  ?goTerm rdfs:label ?goLabel .
  FILTER(STRSTARTS(STR(?goTerm), STR(GO:)))
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?goLabel"):::projected 
  v1("?goTerm"):::projected 
  v2("?mnemonic"):::projected 
  v3("?protein"):::projected 
  f0[["starts-with(str(?goTerm),str('GO:'))"]]
  f0 --> v1
  bind1[/VALUES ?mnemonic/]
  bind1-->v2
  bind10(["MTMR1_HUMAN"])
  bind10 --> bind1
  bind11(["P53_HUMAN"])
  bind11 --> bind1
  bind12(["INS_HUMAN"])
  bind12 --> bind1
  v3 --"up:mnemonic"-->  v2
  v3 --"up:classifiedWith"-->  v1
  v1 --"rdfs:label"-->  v4