Skip to contents

linkCollectionMembers() adds an IsPartOf link to the concept DOI of a collection record (see uploadCollectionToZenodo()) to each member of the collection, i.e. to each Zenodo record the collection links to with HasPart. Members that already have the link are left unchanged.

Use it after publishing a collection, with publish = TRUE, to publish the links that uploadCollectionToZenodo() added to the members, or to link the members of an existing collection. Links can only be added to records of your own Zenodo account; members that cannot be linked are reported in a warning.

Usage

linkCollectionMembers(doi, token = NULL, sandbox = FALSE, publish = FALSE)

Arguments

doi

DOI (e.g. "https://doi.org/10.5281/zenodo.1234567" or "10.5281/zenodo.1234567") or record ID of the collection record. Any version, or the concept DOI, can be given; the members of the latest version are linked.

token

Zenodo personal access token with the scopes deposit:write and deposit:actions. Default is the environment variable ZENODO_TOKEN (or ZENODO_SANDBOX_TOKEN if sandbox = TRUE). Never write the token in a script.

sandbox

logical. If TRUE, use the Zenodo sandbox (https://sandbox.zenodo.org). Default is FALSE.

publish

logical. If TRUE, the edits of the members are published directly, including edits with the link that are already open. Default is FALSE: the edits stay open on Zenodo.

Value

A data frame, invisibly, with per member: member (Zenodo record ID), added (number of links added), published (logical) and error (error message, or NA).

Author

Birgen Haest

Examples

if (FALSE) { # \dontrun{
# Publish the IsPartOf links of the members of a published collection
# ===========================================================================
linkCollectionMembers(
  doi     = "https://doi.org/10.5281/zenodo.7654321",
  publish = TRUE
)
} # }