update_resource_map: Update an existing resource map object on a Member Node

View source: R/editing.R

update_resource_mapR Documentation

Update an existing resource map object on a Member Node

Description

This function first generates a new resource map RDF/XML document locally and then uses the dataone::updateObject() function to update an object on the specified MN.

Usage

update_resource_map(
  mn,
  resource_map_pid,
  metadata_pid,
  data_pids = NULL,
  child_pids = NULL,
  other_statements = NULL,
  identifier = NULL,
  public = TRUE,
  check_first = TRUE
)

Arguments

mn

(MNode) The Member Node.

resource_map_pid

(character) The PID of the resource map to be updated.

metadata_pid

(character) The PID of the metadata object to go in the package.

data_pids

(character) The PID(s) of the data objects to go in the package.

child_pids

(character) The resource map PIDs of the packages to be nested under the package.

other_statements

(data.frame) Extra statements to add to the resource map.

identifier

(character) Manually specify the identifier for the new metadata object.

public

(logical) Whether or not to make the new resource map public read.

check_first

(logical) Optional. Whether to check the PIDs passed in as arguments exist on the MN before continuing. This speeds up the function, especially when data_pids has many elements.

Details

If you only want to generate resource map RDF/XML, see generate_resource_map().

This function also can be used to add a new child packages to a parent package. For example, if you have:

Parent A B

and want to add C as a sibling package to A and B, e.g.:

Parent A B C

then you could use this function.

Note: This function currently replaces the rightsHolder on the resource map temporarily to allow updating but sets it back to the rightsHolder that was in place before the update.

Value

(character) The PID of the updated resource map.

Examples

## Not run: 
cn <- CNode('STAGING2')
mn <- getMNode(cn,"urn:node:mnTestKNB")

rm_pid <- "resource_map_urn:uuid:23c7cae4-0fc8-4241-96bb-aa8ed94d71fe"
meta_pid <- "urn:uuid:23c7cae4-0fc8-4241-96bb-aa8ed94d71fe"
data_pids <- c("urn:uuid:3e5307c4-0bf3-4fd3-939c-112d4d11e8a1",
"urn:uuid:23c7cae4-0fc8-4241-96bb-aa8ed94d71fe")

rm_new <- update_resource_map(mn, rm_pid, meta_pid, data_pids)

## End(Not run)

NCEAS/arcticdatautils documentation built on Aug. 28, 2023, 12:10 p.m.