BU-Spark / se-Symbiota-portal

The Symbiota Virtual Flora/Fauna project is an open source software project, with central goal of developing on-line tools that aid in the generation, exploration and management of biodiversity data (collection specimens, observations, images, checklist, keys, etc.). See also: http://bdj.pensoft.net/articles.php?id=1114 and http://symbiota.org/
GNU General Public License v2.0
1 stars 3 forks source link

Automatically assign images to batch upon ingestion #64

Closed Tian-Tan closed 4 months ago

Tian-Tan commented 6 months ago

We need to investigate how to:

  1. Create a new entry in the batch table on ingestion to signify the creation of a new batch
  2. Assign all image_id from the same ingestion batch to the same batch number in the batch_XREF table

The above should probably be done in the ingestion PHP code

ttaliacc commented 6 months ago

Here are the related files:

/collections/admin/specupload.php:

/collections/admin/specuploadmap.php:

/collections/admin/specuploadprocessor.php:

/classes/SpecUploadFile.php:

/collections/admin/specuploadprocessor.php:

/classes/SpecUploadDwca.php:

/classes/SpecUploadBase.php:

If you have time, it ill be helpful dig into all php files included in the beginning of all above files.

Tian-Tan commented 6 months ago

Another important note here is that the ingestion first adds the records to a temporary table, and only moves them to the real tables after confirmation.

The temporary tables for the occurrence records and images are uploadspectemp and uploadimagetemp

Tian-Tan commented 5 months ago

The commit 18d847885aae248e3184083cb8b58940f3dd08d9 successfully creates a new batch upon ingestion. Further steps are:

  1. Add a GUID for the batch
  2. Beautify the batch name by defaulting it to a timestamp using the PHP code
  3. Automatically assign images to batch
Tian-Tan commented 4 months ago

To address the problems above:

  1. A GUID is not necessary as we are using a batch timestamp which is unique enough to use as the batch name.
  2. There is a slight problem with the timestamp being used being not too human readable. This will need a minor fix.
  3. Solved in ba4b0cb0ebbe70879ddcab30100591de056ef87e
Tian-Tan commented 4 months ago
  1. is solved by a quick fix in 0919f10d41ea7a83629d59440904e4ffb65dee2f.