-
Couldn't load subscription status.
- Fork 40
Description
Problem
Currently, there is no straightforward way to rebuild the fullName fields for our trees (taxon, geography, storage, tectonicunit, geologictimeperiod, and lithostrat).
This was most recently requested by Philippe Verley at IRD on the Speciforum, but we have been asked by users for quite some time for a more straightforward approach to rebuilding names.
Describe the solution you'd like
I would like a new API endpoint that allows a user to trigger a rebuild of the fullName field for all nodes within a specified tree. This endpoint should be flexible enough to handle all supported tree types in Specify.
The endpoint should accept arguments to specify which tree to rebuild.
- It must support the following tree types:
taxon,geography,storage,tectonicunit,geologictimeperiod, andlithostrat. - The user must provide the specific
idfor the tree that needs rebuilding. - By default, the operation should only rebuild the
fullNamefor preferred nodes (isPreferred=true). - An optional boolean argument, such as
rebuild_synonyms, should be included. When set totrue, it would rebuild thefullNamefor all nodes in the tree, including synonyms.
We should be able to build an interface for this when #6124 comes along.
The API calls might look like this:
Rebuilding preferred names for a taxon tree:
POST /api/specify/trees/taxon/2/rebuild-full-nameRebuilding all names (including synonyms) for a geography tree:
POST /api/specify/trees/geography/4/rebuild-full-name?rebuild_synonyms=trueDescribe alternatives you've considered
The main alternative is the current method of running a SQL script directly on the database or making a modification to the tree definition items and reverting it afterwards. This is not a good long-term solution, and there is no option now to rebuild names for synonyms beyond unsynonymizing them temporarily.
Reported By
IRD (Institut de Recherche pour le Développement)
Additional context
This feature was most recently requested by Philippe Verley at IRD on the Speciforum