uchicago-library / uchicagoldr-premiswork

work to make the ldr premis compliant
GNU General Public License v3.0
8 stars 4 forks source link

Impossible to init Objects of objectCategory "intellectual entity" or "representation" #19

Open bnbalsamo opened 7 years ago

bnbalsamo commented 7 years ago

ObjectCategory is required in order to init an Object: see here

ObjectCategory can't be set if the objectCategory is set to "intellectual entity" or "representation": see here

Thus, it is currently impossible to init an Object whose objectCategory is set to "intellectual entity" or "representation" without raising a ValueError.

This original bug has led to further research which reveals that at the moment all object subnode requirements are based on the "file" objectCategory, rather than being dynamically determined by the objectCategory provided.

Proposed steps for solving this issue:

  1. Enumerate Object subnodes whose requirements (or repeatabilities?) are determined by the objectCategory.
  2. Fix object init logic to be conditional based on objectCategory 2.1. this will probably result in objectCategory becoming a kwarg for the object init
  3. Add calls to get_objectCategory() in the other setters, (as identified by 1) to enforce the different applicability constraints
  4. Probably re-implement tests for other objectCategory values so things like this can't fall through the cracks, see #10
bnbalsamo commented 7 years ago

"Top Level" (1.x in object specification) PREMIS object nodes which having differing requirements based on objectCategory