about summary refs log tree commit diff
path: root/docs
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-11 15:15:40 +0000
committerPjotr <wrk@bosa.lan>2026-11-11 15:15:40 +0000
commitee007a3731d186dc12c1b8b81589a03e8eb95acb (patch)
treee3bd07ae86d5219ba73530dc62a94b46e4c12f15 /docs
parent22e2d8fedcba427f15859ecd1b1cb79c3aefd59c (diff)
downloadgenenetwork4-ee007a3731d186dc12c1b8b81589a03e8eb95acb.tar.gz
genes: the alias reply carries the entity's label and its gene link-outs
The GTEx problem -- it is human-only, and a mouse symbol there is an empty
report -- is answered by the endpoint that already knows which entity it
matched: /genes/{symbol}/aliases now returns

  label   the entity's canonical symbol in that species ("Shh" for mouse,
          "SHH" for ?species=human) -- the symbol a human-only service needs
  links   [{name, href, description}] built for that symbol and species:
          RGD, MGI, BioAlliance, NCBI Gene, Wikidata (the QID), UniProt,
          STRING, GeneMANIA and GeneCup, plus GTEx/Open Targets/Protein
          Atlas/GWAS Catalog for a human entity or BioGPS/Allen Brain Atlas
          for a mouse one

So a mouse Shh reaches GTEx through the human ortholog's label rather than a
guessed one, and a client no longer holds the URL vocabulary. Only links
that answer are built: HomoloGene, UniGene, Genotation, GeneBridge and
PhenoGen are gone, and Panther is browser-only (see SKILL.md "Gene
link-outs", where each URL was checked).

A cached entity written before the label was kept is refreshed rather than
served -- otherwise the link-outs would be built on a symbol it does not
have -- and `stale: true` still says when Wikidata was unreachable and the
cached answer was used.

tests/wikidata.rs: a mouse gene gets the mouse services and no GTEx; the
human ortholog gets label SHH and a GTEx href built from it. Both halves
skip when the reply is stale, since a Wikidata timeout is not a failure.
Diffstat (limited to 'docs')
-rw-r--r--docs/www/SKILL.md18
1 files changed, 14 insertions, 4 deletions
diff --git a/docs/www/SKILL.md b/docs/www/SKILL.md
index 64faed5..ab403d4 100644
--- a/docs/www/SKILL.md
+++ b/docs/www/SKILL.md
@@ -421,10 +421,20 @@ did not read. For a **rat** symbol prefer RGD and GeneMANIA(rat); for a **mouse*
 symbol all of the above except Human Protein Atlas and GWAS apply; for a **human**
 symbol use GTEx, Open Targets and the Protein Atlas.
 
-**If an API is needed**: `/genes/{SYMBOL}/aliases` already returns the Wikidata
-QID and the aliases; the natural next step is a `links` array on that reply
-(`[{name, href, description}]`) built from the table above, so a client does not
-have to hold the URL vocabulary. Until then, build them from the templates.
+**The API builds them for you.** `GET /genes/{SYMBOL}/aliases` returns a
+`links` array (`[{name, href, description}]`) built from the table above for the
+symbol and species it actually matched -- RGD, MGI, BioGPS and the Allen Brain
+Atlas for a mouse gene; RGD, GeneMANIA and UniProt for a rat one. It also
+returns `label`, the entity's canonical symbol in that species, which is how you
+get the **human** symbol a human-only service needs:
+
+    GET /genes/Shh/aliases?species=human
+    → label "SHH", links […] including GTEx → https://www.gtexportal.org/home/gene/SHH
+
+So a mouse `Shh` reaches GTEx through the human ortholog's label, and you never
+hold a URL template yourself. `stale: true` means Wikidata was unreachable and
+the cached entity was served -- the links still work, the label may be absent
+from an older cache entry (retry and it refreshes).
 
 ## 4. Gotchas that cost time