OpenTreeOfLife / phylesystem-api

API access to Open Tree of Life treestore
BSD 2-Clause "Simplified" License
9 stars 5 forks source link

Add collection IDs and SHAs to `/tree_of_life/about` (verbose response) #228

Open jimallman opened 3 years ago

jimallman commented 3 years ago

Ideally the new collection editor will include its status vs. the latest published synthetic tree. It seems logical to add this information to the existing /tree_of_life/about method, rather than adding a new one.

Added response fields might look like this:

$ curl -X POST https://devapi.opentreeoflife.org/v3/tree_of_life/about -d '{"include_source_list":true}'
{
  "date_created": "2019-12-23 11:41:23",
  ...
  "num_source_collections": 14,
  ...
 "source_id_map": {
  "3.2draft9": {
    "taxonomy": "3.2draft9"
  },
  "ot_1000@tree1": {
   "git_sha": "3008105691283414a18a6c8a728263b2aa8e7960",
   "study_id": "ot_1000",
   "tree_id": "tree1",
   "collection_id": "opentreeoflife/default"    ADD this for each tree as well?
  },
  ... all trees listed, then all collections ...
  "opentreeoflife/default": {
    "git_sha": "3008105691283414a18a6c8a728263b2aa8e7960",
    "name": "Inputs to synthesis (default)", 
    "description": "Trees for synthesis, but ranked lower than other synthesis collections"
  },
  ...

If we don't feel good about adding collection details to the existing source_id_map, perhaps add a sibling structure collection_id_map to hold them?

jimallman commented 3 years ago

Apologies for the scattershot assignees on this issue. I've lost track of where this API method was actually implemented, and by whom.