bruvellu / cifonauta

Marine biology image database by CEBIMar/USP
http://cifonauta.cebimar.usp.br
GNU General Public License v3.0
21 stars 5 forks source link

Support non-canonical taxonomic ranks in the tree hierarchy #305

Open bruvellu opened 1 month ago

bruvellu commented 1 month ago

The taxon_update routine that fetches taxonomic information from the WoRMS database, only fetches and creates the canonical taxonomic ranks: Kingdom, Phylum, Class, Order, Family, Genus, Species. If someone adds a different rank like subphylum, infraclass or subspecies, they will not be properly integrated in the tree.

For example, adding Crustacea which is classified as a subphylum on WoRMS, does not link with its immediate descendants, such as the classes Malacostraca or Ostracoda:

crustacea

Importing the entire WoRMS database to have a full taxonomic record is one possibility, but that brings a high maintenance burden and complicates everything due to its large size. Something I want to avoid.

Another solution is checking during the taxon_update if the immediate ancestor exists in the Cifonauta database. If it exists, the current taxon is linked to it; if not, it links to the next canonical rank. This way we can add key taxa and still keep the ancestor/descendant relationships in order.

The tree will probably become unbalanced, but that should be fixed in another issue.