getDataPackage function

Download data from the DataONE Federation as a DataPackage.

Download data from the DataONE Federation as a DataPackage.

This is convenience method that will download all the members in a DataONE data package and insert them into a DataPackage, including associated SystemMetadata for each package member.

getDataPackage(x, identifier, ...) ## S4 method for signature 'D1Client' getDataPackage( x, identifier, lazyLoad = FALSE, limit = "1MB", quiet = TRUE, checksumAlgorithm = as.character(NA) )

Arguments

  • x: A D1Client object.
  • identifier: The identifier of a package, package metadata or other package member
  • ...: (not yet used)
  • lazyLoad: A logical value. If TRUE, then only package member system metadata is downloaded and not data. The default is FALSE.
  • limit: A character value specifying maximum package member size to download. Specified with "KB", "MB" or "TB" for example: "100KB", "10MB", "20GB", "1TB". The default is "1MB". Only takes effect if 'lazyLoad=FALSE'.
  • quiet: A 'logical'. If TRUE (the default) then informational messages will not be printed.
  • checksumAlgorithm: A character value specifying the algorithm to use to re-calculate (after download) the system metadata checksum for the object's data bytes for example: "SHA-256". The default is "NA", which specifies that this re-calculation will not be performed.

Returns

A DataPackage or NULL if the package was not found in DataONE

Details

A 'data package' that resides on a DataONE member node is defined as a collection of digital objects that are described by a metadata document.

The lazyLoad parameter controls whether the data bytes for a DataONE package member are downloaded (the system metadata is always downloaded). When lazyLoad=FALSE, the limit parameter can be used to specify the maximum size of a data file that will be downloaded. If lazyLoad is TRUE, then limit

is ignored. The lazyLoad and limit parameters can be used together in the following ways:

'lazyLoad''limit'resultcomments
--------------------------------------------
TRUEAny valueData bytes are not downloadedThe 'limit' parameter is ignored
FALSENot specifiedData bytes are download if less than 1MBThe default 'limit' of 1MB is used
FALSE10MBData bytes are downloaded if less than 10MBThe specified 'limit' values is used

Examples

## Not run: library(dataone) d1c <- D1Client("PROD", "urn:node:KNB") pid <- "solson.5.1" pkg <- getDataPackage(d1c, pid) ## End(Not run)

See Also

D1Clientclass description.

  • Maintainer: Matthew B. Jones
  • License: Apache License 2.0
  • Last published: 2022-06-10