uploadDataPackage: Upload a DataPackage to a DataONE member node.

Description Usage Arguments Details Value Note See Also Examples

Description

Upload all DataObjects contained in the DataPackage by calling uploadDataObject on each of the members. Also a resourceMap object is created from the recorded relationships between DataObjects, and this is uploaded as well.

Usage

1
2
3
4
5
6
7
8
uploadDataPackage(x, ...)

## S4 method for signature 'D1Client'
uploadDataPackage(x, dp, replicate = NA,
  numberReplicas = NA, preferredNodes = NA, public = as.logical(FALSE),
  accessRules = NA, quiet = as.logical(TRUE),
  resolveURI = as.character(NA), packageId = as.character(NA),
  as = "character", ...)

Arguments

x

A D1Client instance.

...

(Not yet used.)

dp

The DataPackage instance to be submitted to DataONE for creation.

replicate

A value of type "logical", if TRUE then DataONE will replicate this object to other member nodes

numberReplicas

A value of type "numeric", for number of supported replicas.

preferredNodes

A list of "character", each of which is the node identifier for a node to which a replica should be sent.

public

A 'logical', if TRUE then all objects in this package will be accessible by any user

accessRules

Access rules of 'data.frame' that will be added to the access policy of each object in the datapackage.

quiet

A 'logical'. If TRUE (the default) then informational messages will not be printed.

resolveURI

A URI to prepend to identifiers (i.e. for use when creating the ResourceMap). See serializePackage

packageId

A value of type "character" specifying a unique identifier to use for the uploaded package (resource map pid)

as

A value of type "character" that specifies the return value. Possible values are "character" (the default) or "DataPackage".

Details

The DataPackage describes the collection of data object and their associated metadata object, with the relationships and members serialized into a document stored under, and retrievable with, the packageId as it's own distinct object. Any objects in the data map that have a dataUploaded value are assumed to be pre-existing in the system, and skipped.

Value

id The identifier of the resource map for this data package

Note

Member objects are created serially, and most errors in creating one object will interrupt the create process for the whole, with the result that some members will be created, and the remainder not.

See Also

D1Client class description.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
library(dataone)
library(datapack)
dp <- new("DataPackage")
sampleData <- system.file("extdata/sample.csv", package="dataone")
dataObj <- new("DataObject", format="text/csv", file=sampleData)
dataObj <- setPublicAccess(dataObj)
sampleEML <- system.file("extdata/strix-pacific-northwest.xml", package="dataone")
metadataObj <- new("DataObject", format="eml://ecoinformatics.org/eml-2.1.1", file=sampleEML)
metadataObj <- setPublicAccess(metadataObj)
dp <- addMember(dp, do = dataObj, mo = metadataObj)
d1c <- D1Client("STAGING", "urn:node:mnStageUCSB2")
# Upload all members of the DataPackage to DataONE (requires authentication)
packageId <- uploadDataPackage(d1c, dp, replicate=TRUE, public=TRUE, numberReplicas=2)

## End(Not run)

dataone documentation built on July 2, 2018, 1:02 a.m.