kitodo-production icon indicating copy to clipboard operation
kitodo-production copied to clipboard

`ImportService` statically sets parent process type to `MultiVolumeWork`

Open solth opened this issue 1 year ago • 0 comments

Describe the bug During hierarchical metadata import, if a parent process is classified as document type Monograph, the document type is statically overwritten and replaced with MultiVolumeWork if the imported child records are classified as Volume, even if the current ruleset does not actually define a division with the name MultiVolumeWork. Additionally, the document type of all child processes is set to Volume, without regard to the actual classification result:

https://github.com/kitodo/kitodo-production/blob/0e6e0ee5dfe7e88ebb07889bb052b32e5536928d/Kitodo/src/main/java/org/kitodo/production/services/data/ImportService.java#L448-L459

This is an old workaround that was indroduced during the development of hierarchical metadata import of Kitodo.Production 3. This was only intended as a temporary solution but still exists in the code to the present day.

To Reproduce Steps to reproduce the behavior:

  1. Configure a ruleset that allows hierarchical import but does not define the division MultiVolumeWork
  2. Create a corresponding mapping file that classifies the imported parent process as Monograph, as defined in the ruleset, but not as MultivolumeWork, and the child processes as Volume
  3. Add a project and an import configuration that uses the ruleset and import mapping created above
  4. Create a parent process with child processes from a search interface that supports hierarchical import using this configuration
  5. Open the newly created parent process in metadata editor and see that it's type is set to MultiVolumeWork, which is not defined in the ruleset and therefore should be marked with a yellow background.

Expected behavior The hierarchical import should not statically and incorrectly set the document type of processes to MultiVolumeWork. If a correct classification is not possible using the imported data and the classification rules in the import mapping file, or two document types are determined for child and parent process that are not allowed in a hierarchical relation according to the rules in the ruleset, a corresponding warning/error message should be displayed.

solth avatar Aug 12 '24 15:08 solth