adiwg / mdTranslator

Metadata translation tool built using Ruby
https://www.adiwg.org/mdTranslator/
The Unlicense
14 stars 12 forks source link

sbJSON contacts inherited from associated records #202

Open jlblcc opened 6 years ago

jlblcc commented 6 years ago

See adiwg/mdEditor#225.

Basically, the responsibility objects from associateResources should be excluded from the sbJSON output.

https://github.com/adiwg/mdTranslator/blob/f6868cb0c2eaae6c7611248fa23253c98b1478c7/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_contact.rb#L23

stansmith907 commented 6 years ago

I changed the method to exclude the search from any object named in the exclude list as shown below:

aResponsibility = @Namespace.nested_objs_by_element(intObj, 'roleName', ['associatedResources'])
jlblcc commented 6 years ago

Are we capturing the funding contacts in the search? Those contacts are only ids, see https://mdtools.adiwg.org/#viewer-page?v=2-6-0-0-0-3. We may need to add a role of "recipient" to support that....

stansmith907 commented 5 years ago

Not sure. In the sbJSON writer the name associated with sourceId and recipientId contacts are written into the annualBudgets.fundingSources array. They would also be written as contacts to sbJSON IF they were included in allocation.responsibleParty.

Thus there is no guarantee the sourceId and recipientId are included as contacts. This could be added using assumed role names.

jlblcc commented 5 years ago

I'd suggest writing out the sourceId as a funder and the recipient with no sbJSON role, since there's not an equivalent role in SB.

In retrospect, I suppose we should've just added allocation.responsibleParty from the start and a recipient role. That's what we get for trying to make things simpler...

jlblcc commented 5 years ago

Did this get resolved?