ropensci / datapack

An R package to handle data packages
https://docs.ropensci.org/datapack
44 stars 9 forks source link

implement shortcut for associating metadata object with science objects #27

Closed gothub closed 9 years ago

gothub commented 9 years ago

Currently the insertRelationship method is called to associate a science object with a metadata object (which adds the isdocumented / documents relationships).

An simpler alternative to having the user call insertRelationships is to add a third parameter to the addData method to specify a metadata object to associate with a science object:

dp <- new("DataPackage")
metaObj <- new("DataObject", id=mdId, data, format="eml://ecoinformatics.org/eml-2.1.1", user, node)
addData(dp, metaObj)
sciObj <- new("DataObject", format="text/csv", user, node, filename=csvfile)
addData(dp, sciObj, metaObj)
gothub commented 9 years ago

Added in commit 655c9069b5940a0c2b5e85a3b42a4f215bbd3f26