BiologicalRecordsCentre / ukotas

UK Overseas Territories Alien Species website work - https://dev-ceh-ukotas.pantheonsite.io/
GNU General Public License v3.0
0 stars 0 forks source link

Update import template to include taxonomic fields #17

Closed StephRorke closed 2 years ago

StephRorke commented 2 years ago

Include the following fields within the import template and import procedure:

@johnvanbreda I am uncertain if future imports will be added by you or whether the option for users e.g. Siobhan to import from csv files exists. I think Katy has sent all templated data to you to date.

johnvanbreda commented 2 years ago

A few notes for myself.

When manually saved with a link to the CoL, the API call response's taxonomic hierarchy is copied into some custom hidden form fields. The species account form's validate method then builds the taxonomic hierarchy on the warehouse and on the Drupal taxonomy. It then links the species account to the Drupal taxonomy term for the species, plus the warehouse taxa_taxon_list_id is saved in the node field.

I imported a copy of a species record with the Col ID and GBIF key filled in, then run cron, to test this. The account was saved OK but the following problems were noted:

So, we need to update the code so that if the CoL field is present but the species term is not linked, then an API call is made to the CoL and the response used to build the taxonomy (Drupal + warehouse) and link the node to the species term, plus the taxa_taxon_list_id. Also need to make sure that the save event then triggers the current node update hook code to copy the territory into the branch of the CoL Drupal taxonomy.

Need to consider if best to run the above during the node save hook, or perhaps on a cron hook.

johnvanbreda commented 2 years ago

@StephRorke please can I have a list of the possible islands?

DavidRoy commented 2 years ago

@johnvanbreda it will take a while to agree the territory divisions so we can leave as a text field for the time being

johnvanbreda commented 2 years ago

As discussed during the Zoom call, if you import a species with the "Catalogue of Life ID" field filled in, then it will use a background task to later look up the taxonomic hierarchy and make sure that the species account is linked properly so it appears in the correct territory's browser, as well as in the species list on the warehouse.

A field called "GBIF TaxonKey" can already be included in the import.

You can also import a field "Matched to species" with a value of true or false.

There is already a field "Island" but I've yet to resolve the best approach for importing several island names.

johnvanbreda commented 2 years ago

You can now specify multiple islands, using free-text. When importing, each island name can be separated by a semi-colon.