Yes, definite bug in metaproc3.py code in the python3lib code in that it remaps all refines targeted at a primary dc metadata element (such as dc:contributor) to be additional attribute/value pair in the attribute dictionary of that specific element. The problem is the property ("role" in this case) is used at the key in the attribute dictionary and so that multiple refines with role properties will simply overwrite each other for the same dc metadata element.
I will either have to allow each property that exists be mapped to a list of values (messy and error prone unless all dictionary values are treated as lists everywhere), convert the attribute dictionary to a simple list of attribute name/value pairs so that multiple role/value pairs can exist in the list, or keep track of the fact that multiple roles for one person can exist by assigning using "role_1", "role_2", etc as keys to keep things unique.
Any approach to fixing this will take time and require some messing around. The sad fact is the whole idea/concept of "refines" and refines on refines is going away in epub 3.1 as an unworkable mess!!!
I will look into better handling this case. As it stands multiple refines are properly handled for epub3 dc metadata elements but only if the property itself is unique. The case of multiple "roles" obviously violates that constraint and needs to be fixed somehow.
FWIW - Few if other cases would need multiple definitions of the exact same property as different properties are given to different title types, and etc.
KevinH
|