addData: Add a D1Object containing a data object to a DataPackage

Description Usage Arguments Details Examples

Description

The D1Object do is added to the data package x.

Usage

1
2
## S4 method for signature 'DataPackage,D1Object'
addData(x, do, mo = as.character(NA))

Arguments

x

The "DataPackage" to which the data object should be added.

do

A D1Object to add to the DataPackage

mo

A D1Object (containing metadata describing "do" ) to associate with the data object.

Details

If the optional mo parameter is specified, then it is assumed that this DataObject is a metadata object that describes the data object that is being added. The DataObject specified in the mo parameter will also be added to the DataPackage, if it has not already been added. Then the addData function will add a relationship to the resource map that indicates that the metadata object describes the science object, using CiTO, the Citation Typing Ontology, documents and isDocumentedBy relationships.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
library(dataone)
library(datapack)
library(uuid)
dp <- new("DataPackage")
d1c <- D1Client("STAGING", "urn:node:mnStageUCSB2")
# Create metadata object that describes science data
newId <- sprintf("urn:uuid:%s", UUIDgenerate())
csvfile <- system.file("extdata/sample.csv", package="dataone")
sciObj <- new("DataObject", id=newId, format="text/csv",filename=csvfile)
dp <- addData(dp, do = sciObj)

## End(Not run)

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