DataONEorg / rdataone

R package for reading and writing data at DataONE data repositories
http://doi.org/10.5063/F1M61H5X
36 stars 19 forks source link

Metadata object not linked to the resmap in metadata-only packages #269

Closed gothub closed 3 years ago

gothub commented 3 years ago

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

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 should be resolved by the R datapack package, see https://github.com/ropensci/datapack/issues/129

As a temporary stop-gap measure however, uploadDataPackage should check a package before upload to ensure that this relationship (both forward and inverse relationships) is present, and add them if not.

gothub commented 3 years ago

Fixed in commit https://github.com/DataONEorg/rdataone/commit/1bb3a3d55654fbb14ec14cef8830f5a0487c43f3