ZenodoRecord
ZenodoRecord
R6Class
object.
Object of R6Class
for modelling an ZenodoRecord
Internal method. Prefer using addCreator
or addContributor
Internal method. Prefer using removeCreator
or removeContributor
See examples in download_zenodo
utility function.
zen4R::zen4RLogger
-> ZenodoRecord
created
record creation date
updated
record update date
revision_id
revision id
is_draft
is draft
is_published
is published
status
record status
versions
versions
access
access policies
files
list of files associated to the record
id
record id
links
list of links associated to the record
metadata
metadata elements associated to the record
parent
parent record
pids
pids
stats
stats
new()
method is used to instantiate a ZenodoRecord
ZenodoRecord$new(obj = NULL, logger = "INFO")
setDOI()
Set the DOI. This method can be used if a DOI has been already assigned outside Zenodo.
getConceptDOI()
Get the concept (generic) DOI. The concept DOI is a generic DOI common to all versions of a Zenodo record.
setAccessPolicyRecord()
Set the access policy for record, among values "public" (default) or "restricted" In Zenodo, in principle, the access policy 'restricted' is not available for records.
ZenodoRecord$setAccessPolicyRecord(access = c("public", "restricted"))
setAccessPolicyFiles()
Set the access policy for files, among values "public" (default) or "restricted"
ZenodoRecord$setAccessPolicyFiles(access = c("public", "restricted"))
setPublicationType()
Set the publication type (mandatory if upload type is 'publication'). Deprecated since zen4R 1.0
publicationType
record publication type among the following values: 'annotationcollection', 'book', 'section', 'conferencepaper', 'datamanagementplan', 'article', 'patent', 'preprint', 'deliverable', 'milestone', 'proposal', 'report', 'softwaredocumentation', 'taxonomictreatment', 'technicalnote', 'thesis', 'workingpaper', 'other'
setImageType()
Set the image type (mandatory if image type is 'image'). Deprecated since zen4R 1.0
setPublicationDate()
Set the publication date. For more information on the accepted format, please check https://inveniordm.docs.cern.ch/reference/metadata/#publication-date-1
addAdditionalTitle()
Add additional record title
removeAdditionalTitle()
Removes additional record title.
addAdditionalDescription()
Add additional record description
removeAdditionalDescription()
Removes additional record description
addPersonOrOrg()
Add a person or organization for the record. For persons, the approach is to use the firstname
and
lastname
arguments, that by default will be concatenated for Zenodo as lastname, firstname
.
For organizations, use the name
argument.
ZenodoRecord$addPersonOrOrg(
firstname = NULL,
lastname = NULL,
name = paste(lastname, firstname, sep = ", "),
orcid = NULL,
gnd = NULL,
isni = NULL,
ror = NULL,
role = NULL,
affiliations = NULL,
sandbox = FALSE,
type
)
firstname
person first name
lastname
person last name
name
organization name
orcid
person or organization ORCID (optional)
gnd
person or organization GND (optional)
isni
person or organization ISNI (optional)
ror
person or organization ROR (optional)
role
role, values among: contactperson, datacollector, datacurator, datamanager, distributor, editor, funder, hostinginstitution, producer, projectleader, projectmanager, projectmember, registrationagency, registrationauthority, relatedperson, researcher, researchgroup, rightsholder, supervisor, sponsor, workpackageleader, other
affiliations
person or organization affiliations (optional)
sandbox
Use the Zenodo sandbox infrastructure as basis to control available affiliations. Default is FALSE
type
type of person or org (creators/contributors)
removePersonOrOrg()
Removes a person or organization by a property. The by
parameter should be the name
of the person or organization property ('name', 'affiliation','orcid','gnd','isni','ror').
addCreator()
Add a creator for the record. For persons, the approach is to use the firstname
and
lastname
arguments, that by default will be concatenated for Zenodo as lastname, firstname
.
For organizations, use the name
argument.
ZenodoRecord$addCreator(
firstname = NULL,
lastname = NULL,
name = paste(lastname, firstname, sep = ", "),
orcid = NULL,
gnd = NULL,
isni = NULL,
ror = NULL,
role = NULL,
affiliations = NULL,
sandbox = FALSE
)
firstname
person first name
lastname
person last name
name
organization name
orcid
creator ORCID (optional)
gnd
creator GND (optional)
isni
creator ISNI (optional)
ror
creator ROR (optional)
role
role, values among: contactperson, datacollector, datacurator, datamanager, distributor, editor, funder, hostinginstitution, producer, projectleader, projectmanager, projectmember, registrationagency, registrationauthority, relatedperson, researcher, researchgroup, rightsholder, supervisor, sponsor, workpackageleader, other
affiliations
creator affiliations (optional)
sandbox
Use the Zenodo sandbox infrastructure as basis to control available affiliations. Default is FALSE
addContributor()
Add a contributor for the record. For persons, the approach is to use the firstname
and
lastname
arguments, that by default will be concatenated for Zenodo as lastname, firstname
.
For organizations, use the name
argument.
ZenodoRecord$addContributor(
firstname = NULL,
lastname = NULL,
name = paste(lastname, firstname, sep = ", "),
orcid = NULL,
gnd = NULL,
isni = NULL,
ror = NULL,
role = NULL,
affiliations = NULL,
sandbox = FALSE
)
firstname
person first name
lastname
person last name
name
organization name
orcid
contributor ORCID (optional)
gnd
contributor GND (optional)
isni
contributor ISNI (optional)
ror
contributor ROR (optional)
role
role, values among: contactperson, datacollector, datacurator, datamanager, distributor, editor, funder, hostinginstitution, producer, projectleader, projectmanager, projectmember, registrationagency, registrationauthority, relatedperson, researcher, researchgroup, rightsholder, supervisor, sponsor, workpackageleader, other
affiliations
contributor affiliations (optional)
sandbox
Use the Zenodo sandbox infrastructure as basis to control available affiliations. Default is FALSE
addRight()
Add right/license. Please see https://inveniordm.docs.cern.ch/reference/metadata/#rights-licenses-0-n
setLicense()
Set license. The license should be set with the Zenodo id of the license. If not
recognized by Zenodo, the function will return an error. The list of licenses can
fetched with the ZenodoManager
and the function $getLicenses()
.
addRelatedIdentifier()
Adds a related identifier with a given scheme and relation type.
identifier
identifier
scheme
scheme among following values: ark, arxiv, bibcode, doi, ean13, eissn, handle, igsn, isbn, issn, istc, lissn, lsid, pubmed id, purl, upc, url, urn, w3id
relation_type
relation type among following values: iscitedby, cites, issupplementto, issupplementedby, iscontinuedby, continues, isdescribedby, describes, hasmetadata, ismetadatafor, isnewversionof, ispreviousversionof, ispartof, haspart, isreferencedby, references, isdocumentedby, documents, iscompiledby, compiles, isvariantformof, isoriginalformof, isidenticalto, isalternateidentifier, isreviewedby, reviews, isderivedfrom, issourceof, requires, isrequiredby, isobsoletedby, obsoletes
resource_type
optional resource type
removeRelatedIdentifier()
Removes a related identifier with a given scheme/relation_type
identifier
identifier
scheme
scheme among following values: ark, arxiv, bibcode, doi, ean13, eissn, handle, igsn, isbn, issn, istc, lissn, lsid, pubmed id, purl, upc, url, urn, w3id
relation_type
relation type among following values: iscitedby, cites, issupplementto, issupplementedby, iscontinuedby, continues, isdescribedby, describes, hasmetadata, ismetadatafor, isnewversionof, ispreviousversionof, ispartof, haspart, isreferencedby, references, isdocumentedby, documents, iscompiledby, compiles, isvariantformof, isoriginalformof, isidenticalto, isalternateidentifier, isreviewedby, reviews, isderivedfrom, issourceof, requires, isrequiredby, isobsoletedby, obsoletes
addGrant()
Adds a grant to the record metadata.
grant
grant to add. The grant should be set with the id of the grant. If not
recognized by Zenodo, the function will return an warning only. The list of grants can
fetched with the ZenodoManager
and the function $getAwards()
.
sandbox
Use the Zenodo sandbox infrastructure as basis to control available grants. Default is FALSE
setGrants()
Set a vector of character strings identifying grants
grants
a vector or list of grants Values should among known grants The list of grants can
fetched with the ZenodoManager
and the function $getAwards()
. Each grant should be set with
the Zenodo id of the grant If not recognized by Zenodo, the function will raise a warning only.
sandbox
Use the Zenodo sandbox infrastructure as basis to control available grants. Default is FALSE
addThesisSupervisor()
Adds thesis supervisor
removeThesisSupervisor()
Removes a thesis supervisor by a property. The by
parameter should be the name
of the thesis supervisor property ('name' - in the form 'lastname, firstname', 'affiliation',
'orcid' or 'gnd').
exportAs()
Exports record to a file by format.
format
the export format to use. Possibles values are: BibTeX, CSL, DataCite, DublinCore, DCAT, JSON, JSON-LD, GeoJSON, MARCXML
filename
the target filename (without extension)
append_format
wether format name has to be appended to the filename. Default is TRUE
(for
backward compatibility reasons). Set it to FALSE
if you want to use only the filename
.
exportAsAllFormats()
Exports record in all Zenodo record export formats. This function will create one file per Zenodo metadata formats.
listFiles()
list files attached to the record
downloadFiles()
Downloads files attached to the record
ZenodoRecord$downloadFiles(
path = ".",
files = list(),
parallel = FALSE,
parallel_handler = NULL,
cl = NULL,
quiet = FALSE,
overwrite = TRUE,
timeout = 60,
...
)
path
target download path (by default it will be the current working directory)
files
(list of) file(s) to download. If not specified, by default all files will be downloaded.
parallel
whether download has to be done in parallel using the chosen parallel_handler
. Default is FALSE
parallel_handler
The parallel handler to use eg. mclapply
. To use a different parallel handler (such as eg
parLapply
or parSapply
), specify its function in parallel_handler
argument. For cluster-based parallel
download, this is the way to proceed. In that case, the cluster should be created earlier by the user with makeCluster
and passed as cl
argument. After downloading all files, the cluster will be stopped automatically.
cl
an optional cluster for cluster-based parallel handlers
quiet
(default is FALSE
) can be set to suppress informative messages (not warnings).
overwrite
(default is TRUE
) can be set to FALSE to avoid re-downloading existing files.
timeout
(default is 60s) see download.file
.
...
arguments inherited from parallel::mclapply
or the custom parallel_handler
can be added (eg. mc.cores
for mclapply
)
print()
Prints a ZenodoRecord
...
any other parameter. Not used
format
format to use for printing. By default, internal
uses an zen4R internal
printing method. Other methods available are those supported by Zenodo for record export, and can be used
only if the record has already been published (with a DOI). Attemps to print using a Zenodo export format
for a record will raise a warning message and revert to "internal" format
depth
an internal depth parameter for indentation of print statements, in case of listing or recursive use of print
getVersions()
Get record versions with creation/publication date, version (ordering number) and DOI.