ropensci / datapack

An R package to handle data packages
https://docs.ropensci.org/datapack
44 stars 9 forks source link

Add 'documents' relationship for metadata package members #129

Closed gothub closed 2 years ago

gothub commented 3 years ago

If a metadata-only package is created and then uploaded by dataone::uploadDataPackage(), the associated resource map in DataONE becomes 'marooned' from the metadata object.

This happens because the DataONE indexer looks at the 'documents' relationships in the resource map in order to populate the Solr resourceMap field for an object. This Solr field is used to identify the resource map for an object. For metadata-only packages, there are no 'documents' relationships, so the 'resourceMap' field is not populated, not even for the metadata object, resulting in the link between the metadata object back to the resource map to not be created.

This issue can be resolved by inserting a documents relationship for the metadata object itself.

The most appropriate place to apply this fix is in the addMember() function, where the package metadata object is declared by the mo=identifier argument.

earnaud commented 3 years ago

This explains my last results (as: https://test.arcticdata.io/view/resource_map_urn:uuid:9deddd40-63a9-46f7-aee4-d4ba37ae7db4). I will keep looking on this issue.

jeanetteclark commented 2 years ago

This was fixed over in dataone https://github.com/DataONEorg/rdataone/issues/269