Looking for some help on a module that I’m working on. Basically, what I want to achieve is the ability to add an additional subproperty to a metadata property. From what I understand about Omeka-S, it is flat in this regard, and the most you can do is add a language subproperty but not really anything else (or is this considered an attribute? sorry if my terminology confuses json and xml).
Basically, my primary goal is to add a ‘relator’ subproperty to the dc creator property or the mods name property. We want to be able to indicate that this creator is a designer or an illustrator or an author, etc. The actual subproperty for mods is ‘role’, which if you import the mods vocabulary can be added as a property to items. However, there’s no way to have the ‘role’ property actually be linked to the creator/name that it refers to, e.g. if you have multiple creators/role its not clear which is linked to which.
So, I’ve been playing around with developing a module, and I think there are several different approaches that could be taken to cheat my way to this functionality. This is where I’m looking for some help/advice about which route seems less bad:
1st. Because I don’t anticipate much use by us for the language subproperty/attribute in the Value entity class, I can use the module to change all the built-in data types (literal, uri, and resource) so that it dumps relator data into the otherwise unused ‘lang’. Then, update the rendering and the json ld, and also modify the data-type partials so this can be inputted/displayed in the interface, all through the module. This is pretty straightforward, and I’ve gotten it to work, but seems wrong because I’m misusing ‘lang’ and I feel like there might be unintended consequences down the line. But clearly the easiest approach I’ve considered. I even think that I could go further with this approach and dump multiple subproperties there if needed.
2nd. Creating an entirely new relator entity through the module, which would then be tied to the value entity. This approach I haven’t exactly gotten to work. I’ve been able to add the entity, doctrine proxies, api adapter and representation through the module, but have only been able to make Omeka\Entity\Item the target entity, where it works but is useless. I need to be able to make Omeka\Entity\Value the target of this new relator entity. That I can’t exactly figure out. I would imagine this is done using each value’s id but I haven’t seen any methods to get a value’s id in the documentation/core code. This seems like it would be the most ‘true’ way to go about this, but I’m not sure if I understand how to do it/if it is possible.
3rd. Change the core code. I could update the Value entity class to include the additional ‘relator’ subproperty and update the data model. However, I’m very adverse to changing the core code. I did that before with Omeka Classic and it was always a hassle to upgrade. But am I wrong that I can’t change the Value entity class through the module. I tried playing around with this and couldn’t manage to do it that way. It seems that too many other classes rely on the Value entity class that I would practically need to have copies of everything in the module to get it to work.
4th. Just add the relator in parentheses after the name as part of the value/label itself, i.e. Chanel, Coco, 1883-1971 (designer). This is a very unsatisfying approach. Also I worry that it could cause problems with searching in cases where Chanel plays different functions.
Apologies for the rambling post. Really appreciate any help.