Closed gothub closed 4 years ago
It would be great to get this implemented - we share species and site tables across multiple datasets and currently do not have a way to upload these datasets in R unless we create different identifiers for the same table; we would prefer not to do that if possible!
Existing DataONE objects can now be included into new DataPackages. The workflow to use is:
library(dataone)
library(datapack)
d1c <- D1Client("STAGING2", "urn:node:mnTestKNB") dp <- new("DataPackage")
emlFile <- system.file("extdata/strix-pacific-northwest.xml", package="dataone") metadataObj <- new("DataObject", format="eml://ecoinformatics.org/eml-2.1.1", filename=emlFile) dp <- addMember(dp, metadataObj)
progFile <- system.file("extdata/filterObs.R", package="dataone") progObj <- new("DataObject", format="application/R", filename=progFile, mediaType="text/x-rsrc") dp <- addMember(dp, progObj, metadataObj)
sourceObj <- getDataObject(d1c, id="urn:uuid:4dc4a896-31c2-4185-b1d7-ebb37f3f9cd6", lazyLoad=T, limit="1GB", quiet=F); dp <- addMember(dp, sourceObj, metadataObj)
pkgId <- uploadDataPackage(d1c, dp, public=TRUE, quiet=FALSE)
A minor fix was made to `uploadDataPackage` that prevented downloaded items to be used. This fix was made in commit ce5f02c4a0a05fb1ea18800a8823f47a36f8491b
A typical DataONE use case is to have the same data object in multiple packages.
It should be possible to download a package using
getDataPackage()
, add a package member for a pid that already exists in DataONE (in another package, for example), and upload the package usinguploadDataPackage()
. In this case,uploadDataPackage()
should not try to upload the 'common' data object to DataONE again, and should include this new package member in the resource map.