| Title: | Interface to 'Zenodo' REST API |
|---|---|
| Description: | Provides an Interface to 'Zenodo' (<https://zenodo.org>) REST API, including management of depositions, attribution of DOIs by 'Zenodo' and upload and download of files. |
| Authors: | Emmanuel Blondel [aut, cre] (ORCID: <https://orcid.org/0000-0002-5870-5762>), Julien Barde [ctb] (ORCID: <https://orcid.org/0000-0002-3519-6141>), Stephen Eglen [ctb] (ORCID: <https://orcid.org/0000-0001-8607-8025>), Hans Van Calster [ctb] (ORCID: <https://orcid.org/0000-0001-8595-8426>), Floris Vanderhaeghe [ctb] (ORCID: <https://orcid.org/0000-0002-6378-6229>), Jemma Stachelek [ctb] (ORCID: <https://orcid.org/0000-0002-5924-2464>), Collin Schwantes [ctb] (ORCID: <https://orcid.org/0000-0002-9882-941X>), Nicholas Tierney [ctb] (ORCID: <https://orcid.org/0000-0003-1460-8722>) |
| Maintainer: | Emmanuel Blondel <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.10.5 |
| Built: | 2026-05-26 23:19:14 UTC |
| Source: | https://github.com/eblondel/zen4R |
download_zenodo allows to download archives attached to a Zenodo
record, identified by its DOI or concept DOI.
download_zenodo( doi, path = ".", files = list(), sandbox = FALSE, logger = NULL, quiet = FALSE, ... )download_zenodo( doi, path = ".", files = list(), sandbox = FALSE, logger = NULL, quiet = FALSE, ... )
doi |
a Zenodo DOI or concept DOI |
path |
the target directory where to download files |
files |
subset of filenames to restrain to download. If ignored, all files will be downloaded. |
sandbox |
Use the sandbox infrastructure. Default is |
logger |
a logger to print Zenodo API-related messages. The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" (for complete curl http calls logs) |
quiet |
Logical ( |
... |
any other arguments for downloading (more information at
ZenodoRecord, |
## Not run: #simple download (sequential) download_zenodo("10.5281/zenodo.2547036") library(parallel) #download files as parallel using a cluster approach (for both Unix/Win systems) download_zenodo("10.5281/zenodo.2547036", parallel = TRUE, parallel_handler = parLapply, cl = makeCluster(2)) #download files as parallel using mclapply (for Unix systems) download_zenodo("10.5281/zenodo.2547036", parallel = TRUE, parallel_handler = mclapply, mc.cores = 2) ## End(Not run)## Not run: #simple download (sequential) download_zenodo("10.5281/zenodo.2547036") library(parallel) #download files as parallel using a cluster approach (for both Unix/Win systems) download_zenodo("10.5281/zenodo.2547036", parallel = TRUE, parallel_handler = parLapply, cl = makeCluster(2)) #download files as parallel using mclapply (for Unix systems) download_zenodo("10.5281/zenodo.2547036", parallel = TRUE, parallel_handler = mclapply, mc.cores = 2) ## End(Not run)
export_zenodo allows to export a Zenodo record, identified by its
DOI or concept DOI, using one of the export formats supported by Zenodo.
export_zenodo( doi, filename, format, append_format = TRUE, sandbox = FALSE, logger = NULL )export_zenodo( doi, filename, format, append_format = TRUE, sandbox = FALSE, logger = NULL )
doi |
a Zenodo DOI or concept DOI |
filename |
a base file name (without file extension) to export to. |
format |
a valid Zenodo export format among the following: BibTeX, CSL, DataCite (or DataCiteXML), DublinCore, DCAT, JSON, JSON-LD, GeoJSON, MARCXML, DataCiteJSON, CodeMeta, DataPackage, CFF. |
append_format |
wether format name has to be appended to the filename. Default is |
sandbox |
Use the sandbox infrastructure. Default is |
logger |
a logger to print Zenodo API-related messages. The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" (for complete curl http calls logs) |
the exported file name (with extension)
## Not run: export_zenodo("10.5281/zenodo.2547036", filename = "test", format = "BibTeX", append_format = F) ## End(Not run)## Not run: export_zenodo("10.5281/zenodo.2547036", filename = "test", format = "BibTeX", append_format = F) ## End(Not run)
get_citation allows to get the styled citation for Zenodo record, identified by
its DOI or concept DOI, and the style name
get_citation( doi, sandbox = FALSE, style = c("havard-cite-them-right", "apa", "modern-language-association", "vancouver", "chicago-fullnote-bibliography", "ieee", "bibtex"), logger = NULL )get_citation( doi, sandbox = FALSE, style = c("havard-cite-them-right", "apa", "modern-language-association", "vancouver", "chicago-fullnote-bibliography", "ieee", "bibtex"), logger = NULL )
doi |
a Zenodo DOI or concept DOI |
sandbox |
Use the sandbox infrastructure. Default is |
style |
the style character string among. Possible values "havard-cite-them-right", "apa", "modern-language-association","vancouver","chicago-fullnote-bibliography", "ieee", or "bibtex". |
logger |
a logger to print messages. The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" (for complete curl http calls logs) |
an object of class data.frame giving the record versions
including date, version number and version-specific DOI.
the record citation
## Not run: get_citation(doi = "10.5281/zenodo.2547036", style = "ieee") ## End(Not run)## Not run: get_citation(doi = "10.5281/zenodo.2547036", style = "ieee") ## End(Not run)
get_licenses allows to list all licenses supported by Zenodo.
get_licenses(pretty = TRUE, sandbox = FALSE)get_licenses(pretty = TRUE, sandbox = FALSE)
pretty |
output delivered as |
sandbox |
Use the sandbox infrastructure. Default is |
the licenses as list or data.frame
## Not run: get_licenses(pretty = TRUE) ## End(Not run)## Not run: get_licenses(pretty = TRUE) ## End(Not run)
get_versions allows to execute a workflow
get_versions(doi, sandbox = FALSE, logger = NULL)get_versions(doi, sandbox = FALSE, logger = NULL)
doi |
a Zenodo DOI or concept DOI |
sandbox |
Use the sandbox infrastructure. Default is |
logger |
a logger to print messages. The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" (for complete curl http calls logs) |
an object of class data.frame giving the record versions
including date, version number and version-specific DOI.
## Not run: get_versions("10.5281/zenodo.2547036") ## End(Not run)## Not run: get_versions("10.5281/zenodo.2547036") ## End(Not run)
get_zenodo allows to get a Zenodo record, identified by
its DOI or concept DOI.
get_zenodo(doi, sandbox = FALSE, logger = NULL)get_zenodo(doi, sandbox = FALSE, logger = NULL)
doi |
a Zenodo DOI or concept DOI |
sandbox |
Use the sandbox infrastructure. Default is |
logger |
a logger to print messages. The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" (for complete curl http calls logs) |
an object of class data.frame giving the record versions
including date, version number and version-specific DOI.
object of class ZenodoRecord
## Not run: get_zenodo("10.5281/zenodo.2547036") ## End(Not run)## Not run: get_zenodo("10.5281/zenodo.2547036") ## End(Not run)
Provides an Interface to 'Zenodo' (<https://zenodo.org>) REST API, including management of depositions, attribution of DOIs by 'Zenodo', upload and download of files.
Emmanuel Blondel [email protected]
Useful links:
zen4RLogger
zen4RLogger
R6Class object.
Object of R6Class for modelling a simple logger
verbose.infologger info status
verbose.debuglogger debug status
loggerTypeLogger type, either "INFO", "DEBUG" or NULL (if no logger)
logger()
internal logger function for the Zenodo manager
zen4RLogger$logger(type, text)
typelogger message type, "INFO", "WARN", or "ERROR"
textlog message
INFO()
internal INFO logger function
zen4RLogger$INFO(text)
textlog message
WARN()
internal WARN logger function
zen4RLogger$WARN(text)
textlog message
ERROR()
internal ERROR logger function
zen4RLogger$ERROR(text)
textlog message
new()
initialize the Zenodo logger
zen4RLogger$new(logger = NULL)
loggerlogger type NULL, 'INFO', or 'DEBUG'
getClassName()
Get object class name
zen4RLogger$getClassName()
the class name, object of class character
getClass()
Get object class
zen4RLogger$getClass()
the class, object of class R6
clone()
The objects of this class are cloneable with this method.
zen4RLogger$clone(deep = FALSE)
deepWhether to make a deep clone.
Logger class used internally by zen4R
Get Zenodo personal access token, looking in env var 'ZENODO_PAT'
zenodo_pat(quiet = TRUE)zenodo_pat(quiet = TRUE)
quiet |
Hide log message, default is |
ZenodoException
ZenodoException
R6Class object.
Object of R6Class for modelling a generic Zenodo service exception
zen4R::zen4RLogger -> ZenodoException
messagemessage
statusstatus
new()
Initializes a ZenodoException
ZenodoException$new(message, status, logger = NULL)
messagemessage
statusstatus
loggerthe logger type
clone()
The objects of this class are cloneable with this method.
ZenodoException$clone(deep = FALSE)
deepWhether to make a deep clone.
Abstract class used internally by zen4R
Emmanuel Blondel <[email protected]>
ZenodoManager
ZenodoManager
R6Class object.
Object of R6Class for modelling an ZenodoManager
zen4R::zen4RLogger -> ZenodoManager
sandboxZenodo manager sandbox status, TRUE if we interact with Sandbox infra
anonymousZenodo manager anonymous status, TRUE when no token is specified
new()
initializes the Zenodo Manager
ZenodoManager$new( url = "https://zenodo.org/api", token = zenodo_pat(), sandbox = FALSE, logger = NULL, keyring_backend = "env" )
urlZenodo API URL. By default, the url is set to "https://zenodo.org/api". For tests, the Zenodo sandbox API URL can be used: https://sandbox.zenodo.org/api
tokenthe user token. By default an attempt will be made to retrieve token using zenodo_pat
sandboxIndicates if the Zenodo sandbox platform should be used. Default is FALSE
loggerlogger type. The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" (for complete curl http calls logs)
keyring_backendThe keyring backend used to store user token. The keyring_backend
can be set to use a different backend for storing the Zenodo token with keyring (Default value is 'env').
getToken()
Get user token
ZenodoManager$getToken()
the token, object of class character
checkUserAuthentication()
Check whether the user is authenticated
ZenodoManager$checkUserAuthentication()
getLanguages()
Get Languages supported by Zenodo.
ZenodoManager$getLanguages(pretty = TRUE)
prettyPrettify the output. By default the argument pretty is set to
TRUE which will returns the list of languages as data.frame.
Set pretty = FALSE to get the raw list of languages
list of languages as data.frame or list
getLanguageById()
Get language by Id.
ZenodoManager$getLanguageById(id)
idlicense id
the license
getLicenses()
Get Licenses supported by Zenodo.
ZenodoManager$getLicenses(pretty = TRUE)
prettyPrettify the output. By default the argument pretty is set to
TRUE which will returns the list of licenses as data.frame.
Set pretty = FALSE to get the raw list of licenses.
list of licenses as data.frame or list
getLicenseById()
Get license by Id.
ZenodoManager$getLicenseById(id)
idlicense id
the license
getResourceTypes()
Get Resource types supported by Zenodo.
ZenodoManager$getResourceTypes(pretty = TRUE)
prettyPrettify the output. By default the argument pretty is set to
TRUE which will returns the list of resource types as data.frame.
Set pretty = FALSE to get the raw list of resource types
list of resource types as data.frame or list
getResourceTypeById()
Get resource type by Id.
ZenodoManager$getResourceTypeById(id)
idresource type id
the resource type
getCommunities()
Get Communities supported by Zenodo.
ZenodoManager$getCommunities(pretty = TRUE, q = "", size = 500)
prettyPrettify the output. By default the argument pretty is set to
TRUE which will returns the list of communities as data.frame.
Set pretty = FALSE to get the raw list of communities
qan ElasticSearch compliant query, object of class character. Default is emtpy.
Note that the Zenodo API restrains a maximum number of 10,000 records to be retrieved. Consequently,
not all communities can be listed from Zenodo, a query has to be specified.
sizenumber of communities to be returned. By default equal to 500
list of communities as data.frame or list
getCommunityById()
Get community by Id.
ZenodoManager$getCommunityById(id)
idcommunity id
the community
submitRecordToCommunities()
Submit a published record to one or more community
ZenodoManager$submitRecordToCommunities( record, communities = list(), message = NULL )
recordan object of class ZenodoRecord
communitiescommunities to which the record will be submitted
messagemessage to send to the community curator(s), either a text or a named list for each community in case a community-specific message should be sent
a submission object of class list, or NULL if nothing was submitted
removeRecordFromCommunities()
Remove a record from one or more community
ZenodoManager$removeRecordFromCommunities(record, communities = list())
recordan object of class ZenodoRecord
communitiescommunities to which the record will be submitted
TRUE if removed, FALSE otherwise
getRecordCommunities()
Get record communities
ZenodoManager$getRecordCommunities(record)
recordobject of class ZenodoRecord
the list of communities in which the record was included
createReviewRequest()
Creates a record review request in a community
ZenodoManager$createReviewRequest(record, community)
recordan object of class ZenodoRecord
communitya community to which the record is submitted for review and publication
a review request object of class list, or NULL if nothing was submitted
getReviewRequest()
Get a record review request
ZenodoManager$getReviewRequest(record)
recordan object of class ZenodoRecord
a review request object of class list, or NULL if nothing exists
deleteReviewRequest()
Deletes a review request
ZenodoManager$deleteReviewRequest(record)
recordan object of class ZenodoRecord
TRUE if deleted, FALSE otherwise
submitRecordForReview()
Submits a record for review. Prior to this submission, a community
has to be selected for a record. This is done by using the method createReviewRequest(record, community).
ZenodoManager$submitRecordForReview(recordId, message = NULL)
recordIdthe ID of a Zenodo record
messagemessage content for the submission. Optional
TRUE if submitted, FALSE otherwise
getGrants()
Get Grants supported by Zenodo. DEPRECATED: replaced by getAwards
ZenodoManager$getGrants(q = "", pretty = TRUE, size = 500)
qan ElasticSearch compliant query, object of class character. Default is emtpy.
Note that the Zenodo API restrains a maximum number of 10,000 records to be retrieved. Consequently,
not all grants can be listed from Zenodo, a query has to be specified.
prettyPrettify the output. By default the argument pretty is set to
TRUE which will returns the list of grants as data.frame.
Set pretty = FALSE to get the raw list of grants
sizenumber of grants to be returned. By default equal to 500.
list of grants as data.frame or list
getAwards()
Get Awards supported by Zenodo.
ZenodoManager$getAwards(q = "", pretty = TRUE, size = 500)
qan ElasticSearch compliant query, object of class character. Default is emtpy.
Note that the Zenodo API restrains a maximum number of 10,000 records to be retrieved. Consequently,
not all awards can be listed from Zenodo, a query has to be specified.
prettyPrettify the output. By default the argument pretty is set to
TRUE which will returns the list of awards as data.frame.
Set pretty = FALSE to get the raw list of awards
sizenumber of awards to be returned. By default equal to 500.
list of awards as data.frame or list
getGrantsByName()
Get grants by name. DEPRECATED: replaced by getAwardByName
ZenodoManager$getGrantsByName(name, pretty = TRUE)
namename
prettyPrettify the output. By default the argument pretty is set to
TRUE which will returns the list of grants as data.frame.
Set pretty = FALSE to get the raw list of grants
list of grants as data.frame or list
getAwardsByName()
Get awards by name.
ZenodoManager$getAwardsByName(name, pretty = TRUE)
namename
prettyPrettify the output. By default the argument pretty is set to
TRUE which will returns the list of awards as data.frame.
Set pretty = FALSE to get the raw list of awards
list of awards as data.frame or list
getGrantById()
Get grant by Id.DEPRECATED: replaced by getAwardById
ZenodoManager$getGrantById(id)
idgrant id
the grant
getAwardById()
Get award by Id.
ZenodoManager$getAwardById(id)
idaward id
the award
getAffiliations()
Get Affiliations supported by Zenodo.
ZenodoManager$getAffiliations(q = "", pretty = TRUE, size = 500)
qan ElasticSearch compliant query, object of class character. Default is emtpy.
Note that the Zenodo API restrains a maximum number of 10,000 records to be retrieved. Consequently,
not all affiliations can be listed from Zenodo, a query has to be specified.
prettyPrettify the output. By default the argument pretty is set to
TRUE which will returns the list of affiliations as data.frame.
Set pretty = FALSE to get the raw list of affiliations
sizenumber of affiliations to be returned. By default equal to 500.
list of affiliations as data.frame or list
getAffiliationByName()
Get affiliations by name.
ZenodoManager$getAffiliationByName(name, pretty = TRUE)
namename
prettyPrettify the output. By default the argument pretty is set to
TRUE which will returns the list of affiliations as data.frame.
Set pretty = FALSE to get the raw list of affiliations
list of affiliations as data.frame or list
getAffiliationById()
Get affiliation by Id.
ZenodoManager$getAffiliationById(id)
idaffiliation id
the affiliation
getFunders()
Get Funders supported by Zenodo based on a query.
ZenodoManager$getFunders(q = "", pretty = TRUE, size = 500)
qan ElasticSearch compliant query, object of class character. Default is emtpy.
Note that the Zenodo API restrains a maximum number of 10,000 records to be retrieved. Consequently,
not all funders can be listed from Zenodo, a query has to be specified.
prettyPrettify the output. By default the argument pretty is set to
TRUE which will returns the list of funders as data.frame.
Set pretty = FALSE to get the raw list of funders
sizenumber of funders to be returned. By default equal to 500
list of funders as data.frame or list
getFundersByName()
Get funders by name.
ZenodoManager$getFundersByName(name, pretty = TRUE)
namename
prettyPrettify the output. By default the argument pretty is set to
TRUE which will returns the list of funders as data.frame.
Set pretty = FALSE to get the raw list of funders
list of funders as data.frame or list
getFunderById()
Get funder by Id.
ZenodoManager$getFunderById(id)
idfunder id
the funder
getDepositions()
Get the list of Zenodo records deposited in your Zenodo workspace (user records). By default
the list of depositions will be returned by page with a size of 10 results per page (default size of
the Zenodo API). The parameter q allows to specify an ElasticSearch-compliant query to filter
depositions (default query is empty to retrieve all records). The argument all_versions, if set
to TRUE allows to get all versions of records as part of the depositions list. The argument exact
specifies that an exact matching is wished, in which case paginated search will be disabled (only the first
search page will be returned).
Examples of ElasticSearch queries for Zenodo can be found at https://help.zenodo.org/guides/search/.
ZenodoManager$getDepositions( q = "", size = 10, all_versions = FALSE, exact = TRUE, quiet = FALSE )
qElastic-Search-compliant query, as object of class character. Default is ""
sizenumber of depositions to be retrieved per request (paginated). Default is 10
all_versionsobject of class logical indicating if all versions of deposits have to be retrieved. Default is FALSE
exactobject of class logical indicating if exact matching has to be applied. Default is TRUE
quietobject of class logical indicating if logs have to skipped. Default is FALSE
a list of ZenodoRecord
getDepositionByConceptDOI()
Get a Zenodo deposition record by concept DOI (generic DOI common to all deposition record versions).
ZenodoManager$getDepositionByConceptDOI(conceptdoi)
conceptdoithe concept DOI, object of class character
an object of class ZenodoRecord if record does exist, NULL otherwise
getDepositionByDOI()
Get a Zenodo deposition record by DOI.
ZenodoManager$getDepositionByDOI(doi)
doithe DOI, object of class character
an object of class ZenodoRecord if record does exist, NULL otherwise
getDepositionById()
Get a Zenodo deposition record by ID.
ZenodoManager$getDepositionById(recid)
recidthe record ID, object of class character
an object of class ZenodoRecord if record does exist, NULL otherwise
getDepositionByConceptId()
Get a Zenodo deposition record by concept ID.
ZenodoManager$getDepositionByConceptId(conceptrecid)
conceptrecidthe record concept ID, object of class character
an object of class ZenodoRecord if record does exist, NULL otherwise
depositRecord()
Deposits a record on Zenodo.
ZenodoManager$depositRecord(record, reserveDOI = TRUE, publish = FALSE)
recordthe record to deposit, object of class ZenodoRecord
reserveDOIreserve DOI. By default TRUE
publishobject of class logical indicating if record has to be published (default FALSE).
Can be set to TRUE (to use CAUTIOUSLY, only if you want to publish your record)
object of class ZenodoRecord
reserveDOI()
Reserves a DOI for a deposition (draft record)
ZenodoManager$reserveDOI(record)
recordthe record to deposit, object of class ZenodoRecord
object of class ZenodoRecord
deleteDOI()
Reserves a DOI for a deposition (draft record)
ZenodoManager$deleteDOI(record)
recordthe record for which DOI has to be deleted, object of class ZenodoRecord
object of class ZenodoRecord
depositRecordVersion()
Deposits a record version on Zenodo.
ZenodoManager$depositRecordVersion( record, delete_latest_files = TRUE, files = list(), publish = FALSE )
recordthe record version to deposit, object of class ZenodoRecord
delete_latest_filesobject of class logical indicating if latest files have to be deleted. Default is TRUE
filesa list of files to be uploaded with the new record version
publishobject of class logical indicating if record has to be published (default FALSE)
TRUE if deposited (and eventually published), FALSE otherwise
deleteRecord()
Deletes a record given its ID
ZenodoManager$deleteRecord(recordId)
recordIdthe ID of the record to be deleted
TRUE if deleted, FALSE otherwise
deleteRecordByDOI()
Deletes a record by DOI
ZenodoManager$deleteRecordByDOI(doi)
doithe DOI of the record to be deleted
TRUE if deleted, FALSE otherwise
deleteRecords()
Deletes all Zenodo deposited (unpublished) records.
The parameter q allows to specify an ElasticSearch-compliant query to filter depositions (default query
is empty to retrieve all records). Examples of ElasticSearch queries for Zenodo can be found at
https://help.zenodo.org/guides/search/.
ZenodoManager$deleteRecords(q = "", size = 10)
qan ElasticSearch compliant query, object of class character
sizenumber of records to be passed to $getDepositions method
TRUE if all records have been deleted, FALSE otherwise
createEmptyRecord()
Creates an empty record in the Zenodo deposit. Returns the record
newly created in Zenodo, as an object of class ZenodoRecord with an
assigned identifier.
ZenodoManager$createEmptyRecord(reserveDOI = TRUE)
reserveDOIreserve DOI. By default TRUE
an object of class ZenodoRecord
editRecord()
Unlocks a record already submitted. Required to edit metadata of a Zenodo record already published.
ZenodoManager$editRecord(recordId)
recordIdthe ID of the record to unlock and set in editing mode.
an object of class ZenodoRecord
discardChanges()
Discards changes on a Zenodo record. Deleting a draft for an unpublished record will remove the draft and associated files from the system. Deleting a draft for a published record will remove the draft but not the published record.
ZenodoManager$discardChanges(recordId)
recordIdthe ID of the record for which changes have to be discarded.
an object of class ZenodoRecord
publishRecord()
Publishes a Zenodo record.
ZenodoManager$publishRecord(recordId)
recordIdthe ID of the record to be published.
an object of class ZenodoRecord
getFiles()
Get list of files attached to a Zenodo record.
ZenodoManager$getFiles(recordId)
recordIdthe ID of the record.
list of files
getFile()
Get a file record metadata.
ZenodoManager$getFile(recordId, filename)
recordIdthe ID of the record.
filenamefilename
the file metadata
startFileUpload()
Start a file upload. The method will create a key for the file to be uploaded
This method is essentially for internal purpose, and is called directly in uploadFile
for user convenience and for backward compatibility with the legacy Zenodo API.
ZenodoManager$startFileUpload(path, recordId)
pathLocal path of the file
recordIdID of the record
completeFileUpload()
Completes a file upload. The method will complete a file upload through a commit operation
This method is essentially for internal purpose, and is called directly in uploadFile
for user convenience and for backward compatibility with the legacy Zenodo API.
ZenodoManager$completeFileUpload(path, recordId)
pathLocal path of the file
recordIdID of the record
uploadFile()
Uploads a file to a Zenodo record. With the new Zenodo Invenio RDM API, this method
internally calls startFileUpload to create a file record (with a filename key) at start, followed
by the actual file content upload. At this stage, the file upload is in "pending" status. At the end,
the function calls completeFileUpload to commit the file which status becomes "completed".
ZenodoManager$uploadFile(path, record = NULL)
pathLocal path of the file
recordobject of class ZenodoRecord
deleteFile()
Deletes a file for a record. With the new Zenodo Invenio RDM API, if a file is deleted although its status was pending, only the upload content is deleted, and the file upload record (identified by a filename key) is kept. If the status was completed (with a file commit), the file record is deleted.
ZenodoManager$deleteFile(recordId, filename)
recordIdID of the record
filenamename of the file to be deleted
getRecords()
Get the list of Zenodo records. By defaut the list of records will be returned by
page with a size of 10 results per page (default size of the Zenodo API). The parameter
q allows to specify an ElasticSearch-compliant query to filter depositions
(default query is empty to retrieve all records). The argument all_versions,
if set to TRUE allows to get all versions of records as part of the depositions list.
The argument exact specifies that an exact matching is wished, in which case
paginated search will be disabled (only the first search page will be returned).
Examples of ElasticSearch queries for Zenodo can be found at https://help.zenodo.org/guides/search/.
ZenodoManager$getRecords(q = "", size = 10, all_versions = FALSE, exact = TRUE)
qElastic-Search-compliant query, as object of class character. Default is ""
sizenumber of records to be retrieved per request (paginated). Default is 10
all_versionsobject of class logical indicating if all versions of records have to be retrieved. Default is FALSE
exactobject of class logical indicating if exact matching has to be applied. Default is TRUE
quietobject of class logical indicating if logs have to skipped. Default is FALSE
a list of ZenodoRecord
getRecordByConceptDOI()
Get Record by concept DOI
ZenodoManager$getRecordByConceptDOI(conceptdoi)
conceptdoithe concept DOI
a object of class ZenodoRecord
getRecordByDOI()
Get Record by DOI
ZenodoManager$getRecordByDOI(doi)
doithe DOI
a object of class ZenodoRecord
getRecordById()
Get Record by ID
ZenodoManager$getRecordById(recid)
recidthe record ID
a object of class ZenodoRecord
getRecordByConceptId()
Get Record by concept ID
ZenodoManager$getRecordByConceptId(conceptrecid)
conceptrecidthe concept ID
a object of class ZenodoRecord
getRequests()
Search requests
ZenodoManager$getRequests(q = "", sort = "bestmatch", size = 10)
qSearch query used to filter results based on ElasticSearch's query string syntax. e.g. https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax
sortSort search results. Built-in options are "bestmatch", "name", "newest", "oldest" (default: "bestmatch" or "newest").
sizenumber of records to be retrieved per request (paginated). Default is 10
a list of ZenodoRecord
getRequest()
Get a request
ZenodoManager$getRequest(request_id)
request_idthe request ID
the request list object, NULL otherwise
isActionableRequest()
Checks if the request can be subject to an operation (accept, decline, cancel) depending on its status. To be subject to an operation, a request should not be closed or expired
ZenodoManager$isActionableRequest(request_id)
request_idthe request ID
TRUE if
acceptRequest()
Accepts a request
ZenodoManager$acceptRequest(request_id, message = NULL)
request_idthe request ID
messageoptional message reason for acceptance
TRUE if accepted, FALSE otherwise
declineRequest()
Declines a request
ZenodoManager$declineRequest(request_id, message = NULL)
request_idthe request ID
messageoptional message reason for declination
TRUE if declined, FALSE otherwise
cancelRequest()
Cancels a request
ZenodoManager$cancelRequest(request_id, message = NULL)
request_idthe request ID
messageoptional message reason for cancelation
TRUE if canceled, FALSE otherwise
clone()
The objects of this class are cloneable with this method.
ZenodoManager$clone(deep = FALSE)
deepWhether to make a deep clone.
Main user class to be used with zen4R
Emmanuel Blondel <[email protected]>
## Not run: ZENODO <- ZenodoManager$new( url = "https://sandbox.zenodo.org/api", token = "<your_token>", logger = "INFO" ) #create (deposit) an empty record newRec <- ZENODO$createEmptyRecord() #create and fill a local (not yet deposited) record myrec <- ZenodoRecord$new() myrec$setTitle("my R package") myrec$setDescription("A description of my R package") myrec$setUploadType("software") myrec$addCreator( firstname = "John", lastname = "Doe", affiliation = "Independent", orcid = "0000-0000-0000-0000" ) myrec$setLicense("mit") myrec$setAccessRight("open") myrec$setDOI("mydoi") #use this method if your DOI has been assigned elsewhere, outside Zenodo #deposit the record myrec <- ZENODO$depositRecord(myrec) #publish a record (with caution!!) #this method will PUBLISH the deposition done earlier ZENODO$publishRecord(myrec$id) #With even more caution the publication can be done with a shortcut argument at deposit time ZENODO$depositRecord(myrec, publish = TRUE) #delete a record (by id) #this methods only works for unpublished deposits #(if a record is published, it cannot be deleted anymore!) ZENODO$deleteRecord(myrec$id) #HOW TO UPLOAD FILES to a deposit #upload a file ZENODO$uploadFile("path/to/your/file", record = myrec) #list files zen_files <- ZENODO$getFiles(myrec$id) #delete a file? ZENODO$deleteFile(myrec$id, zen_files[[1]]$filename) ## End(Not run)## Not run: ZENODO <- ZenodoManager$new( url = "https://sandbox.zenodo.org/api", token = "<your_token>", logger = "INFO" ) #create (deposit) an empty record newRec <- ZENODO$createEmptyRecord() #create and fill a local (not yet deposited) record myrec <- ZenodoRecord$new() myrec$setTitle("my R package") myrec$setDescription("A description of my R package") myrec$setUploadType("software") myrec$addCreator( firstname = "John", lastname = "Doe", affiliation = "Independent", orcid = "0000-0000-0000-0000" ) myrec$setLicense("mit") myrec$setAccessRight("open") myrec$setDOI("mydoi") #use this method if your DOI has been assigned elsewhere, outside Zenodo #deposit the record myrec <- ZENODO$depositRecord(myrec) #publish a record (with caution!!) #this method will PUBLISH the deposition done earlier ZENODO$publishRecord(myrec$id) #With even more caution the publication can be done with a shortcut argument at deposit time ZENODO$depositRecord(myrec, publish = TRUE) #delete a record (by id) #this methods only works for unpublished deposits #(if a record is published, it cannot be deleted anymore!) ZENODO$deleteRecord(myrec$id) #HOW TO UPLOAD FILES to a deposit #upload a file ZENODO$uploadFile("path/to/your/file", record = myrec) #list files zen_files <- ZENODO$getFiles(myrec$id) #delete a file? ZENODO$deleteFile(myrec$id, zen_files[[1]]$filename) ## End(Not run)
ZenodoRecord
ZenodoRecord
R6Class object.
Object of R6Class for modelling an ZenodoRecord
zen4R::zen4RLogger -> ZenodoRecord
createdrecord creation date
updatedrecord update date
revision_idrevision id
is_draftis draft
is_publishedis published
statusrecord status
versionsversions
accessaccess policies
fileslist of files associated to the record
idrecord id
linkslist of links associated to the record
metadatametadata elements associated to the record
parentparent record
pidspids
statsstats
new()
method is used to instantiate a ZenodoRecord
ZenodoRecord$new(obj = NULL, logger = "INFO")
objan optional list object to create the record
loggera logger to print log messages. It can be either NULL, "INFO" (with minimum logs), or "DEBUG" (for complete curl http calls logs)
getStats()
Get record statistics
ZenodoRecord$getStats()
statistics as data.frame
getId()
Get the record Id
ZenodoRecord$getId()
the Id, object of class character
getParentId()
Get the parent record Id
ZenodoRecord$getParentId()
the parent Id, object of class character
getConceptId()
Get the concept record Id
ZenodoRecord$getConceptId()
the concept Id, object of class character
setDOI()
Set the DOI. This method can be used if a DOI has been already assigned outside Zenodo.
ZenodoRecord$setDOI(doi, provider = NULL, client = NULL)
doiDOI to set for the record
providerDOI provider
clientDOI client
getDOI()
Get the record DOI.
ZenodoRecord$getDOI()
the DOI, object of class character
getConceptDOI()
Get the concept (generic) DOI. The concept DOI is a generic DOI common to all versions of a Zenodo record.
ZenodoRecord$getConceptDOI()
the concept DOI, object of class character
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"))accessaccess policy ('public' or 'restricted')
setAccessPolicyFiles()
Set the access policy for files, among values "public" (default) or "restricted"
ZenodoRecord$setAccessPolicyFiles(access = c("public", "restricted"))accessaccess policy ('public' or 'restricted')
setAccessPolicyEmbargo()
Set access policy embargo options
ZenodoRecord$setAccessPolicyEmbargo(active = FALSE, until = NULL, reason = "")
activewhether embargo is active or not. Default is FALSE
untilembargo date, object of class Date. Default is NULL. Must be provided if embargo is active
reasonembargo reason, object of class character. Default is an empty string
setResourceType()
Set the resource type (mandatory).
ZenodoRecord$setResourceType(resourceType)
resourceTyperecord resource type
setUploadType()
Set the upload type (mandatory). Deprecated since zen4R 1.0
ZenodoRecord$setUploadType(uploadType)
uploadTyperecord upload type among the following values: 'publication', 'poster', 'presentation', 'dataset', 'image', 'video', 'software', 'lesson', 'physicalobject', 'other'
setPublicationType()
Set the publication type (mandatory if upload type is 'publication'). Deprecated since zen4R 1.0
ZenodoRecord$setPublicationType(publicationType)
publicationTyperecord 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
ZenodoRecord$setImageType(imageType)
imageTyperecord publication type among the following values: 'figure','plot', 'drawing','diagram','photo', or 'other'
setPublisher()
Set the publisher
ZenodoRecord$setPublisher(publisher)
publisherpublisher object of class character
setPublicationDate()
Set the publication date. For more information on the accepted format, please check https://inveniordm.docs.cern.ch/reference/metadata/#publication-date-1
ZenodoRecord$setPublicationDate(publicationDate)
publicationDateobject of class character
addDate()
Add date
ZenodoRecord$addDate(date, type, description = NULL)
datedate
typetype of date, among following values: 'accepted', 'available', 'collected', 'copyrighted', 'created', 'issued', 'other', 'submitted', 'updated', 'valid', 'withdrawn'
descriptionfree text, specific information about the date
removeDate()
Remove a date
ZenodoRecord$removeDate(date, type)
datethe date to remove
typethe date type of the date to be removed
TRUE if removed, FALSE otherwise
setTitle()
Set the record title.
ZenodoRecord$setTitle(title)
titleobject of class character
addAdditionalTitle()
Add additional record title
ZenodoRecord$addAdditionalTitle(title, type, lang = "eng")
titletitle free text
typetype of title, among following values: alternative-title, subtitle, translated-title, other
langlanguage id
TRUE if added, FALSE otherwise
removeAdditionalTitle()
Removes additional record title.
ZenodoRecord$removeAdditionalTitle(title, type, lang = "eng")
titletitle free text
typetype of title, among following values: abstract, methods, series-information, table-of-contents, technical-info, other
langlanguage id
TRUE if removed, FALSE otherwise
setDescription()
Set the record description
ZenodoRecord$setDescription(description)
descriptionobject of class character
addAdditionalDescription()
Add additional record description
ZenodoRecord$addAdditionalDescription(description, type, lang = "eng")
descriptiondescription free text
typetype of description, among following values: abstract, methods, series-information, table-of-contents, technical-info, other
langlanguage id
TRUE if added, FALSE otherwise
removeAdditionalDescription()
Removes additional record description
ZenodoRecord$removeAdditionalDescription(description, type, lang = "eng")
descriptiondescription free text
typetype of description, among following values: abstract, methods, series-information, table-of-contents, technical-info, other
langlanguage id
TRUE if removed, FALSE otherwise
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 )
firstnameperson first name
lastnameperson last name
nameorganization name
orcidperson or organization ORCID (optional)
gndperson or organization GND (optional)
isniperson or organization ISNI (optional)
rorperson or organization ROR (optional)
rolerole, values among: contactperson, datacollector, datacurator, datamanager, distributor, editor, funder, hostinginstitution, producer, projectleader, projectmanager, projectmember, registrationagency, registrationauthority, relatedperson, researcher, researchgroup, rightsholder, supervisor, sponsor, workpackageleader, other
affiliationsperson or organization affiliations (optional)
sandboxUse the Zenodo sandbox infrastructure as basis to control available affiliations. Default is FALSE
typetype of person or org (creators/contributors)
TRUE if added, FALSE otherwise
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').
ZenodoRecord$removePersonOrOrg(by, property, type)
byproperty used as criterion to remove the person or organization
propertyproperty value used to remove the person or organization
typetype of person or org (creators / contributors)
TRUE if removed, FALSE otherwise
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 )
firstnameperson first name
lastnameperson last name
nameorganization name
orcidcreator ORCID (optional)
gndcreator GND (optional)
isnicreator ISNI (optional)
rorcreator ROR (optional)
rolerole, values among: contactperson, datacollector, datacurator, datamanager, distributor, editor, funder, hostinginstitution, producer, projectleader, projectmanager, projectmember, registrationagency, registrationauthority, relatedperson, researcher, researchgroup, rightsholder, supervisor, sponsor, workpackageleader, other
affiliationscreator affiliations (optional)
sandboxUse the Zenodo sandbox infrastructure as basis to control available affiliations. Default is FALSE
TRUE if added, FALSE otherwise
removeCreatorByName()
Removes a creator by name.
ZenodoRecord$removeCreatorByName(name)
namecreator name
TRUE if removed, FALSE otherwise
removeCreatorByAffiliation()
Removes a creator by affiliation.
ZenodoRecord$removeCreatorByAffiliation(affiliation)
affiliationcreator affiliation
TRUE if removed, FALSE otherwise
removeCreatorByORCID()
Removes a creator by ORCID.
ZenodoRecord$removeCreatorByORCID(orcid)
orcidcreator ORCID
TRUE if removed, FALSE otherwise
removeCreatorByGND()
Removes a creator by GND.
ZenodoRecord$removeCreatorByGND(gnd)
gndcreator GND
TRUE if removed, FALSE otherwise
removeCreatorByISNI()
Removes a creator by ISNI.
ZenodoRecord$removeCreatorByISNI(isni)
isnicreator ISNI
TRUE if removed, FALSE otherwise
removeCreatorByROR()
Removes a creator by ROR.
ZenodoRecord$removeCreatorByROR(ror)
rorcreator ROR
TRUE if removed, FALSE otherwise
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 )
firstnameperson first name
lastnameperson last name
nameorganization name
orcidcontributor ORCID (optional)
gndcontributor GND (optional)
isnicontributor ISNI (optional)
rorcontributor ROR (optional)
rolerole, values among: contactperson, datacollector, datacurator, datamanager, distributor, editor, funder, hostinginstitution, producer, projectleader, projectmanager, projectmember, registrationagency, registrationauthority, relatedperson, researcher, researchgroup, rightsholder, supervisor, sponsor, workpackageleader, other
affiliationscontributor affiliations (optional)
sandboxUse the Zenodo sandbox infrastructure as basis to control available affiliations. Default is FALSE
TRUE if added, FALSE otherwise
removeContributorByName()
Removes a contributor by name.
ZenodoRecord$removeContributorByName(name)
namecontributor name
TRUE if removed, FALSE otherwise
removeContributorByAffiliation()
Removes a contributor by affiliation.
ZenodoRecord$removeContributorByAffiliation(affiliation)
affiliationcontributor affiliation
TRUE if removed, FALSE otherwise
removeContributorByORCID()
Removes a contributor by ORCID.
ZenodoRecord$removeContributorByORCID(orcid)
orcidcontributor ORCID
TRUE if removed, FALSE otherwise
removeContributorByGND()
Removes a contributor by GND.
ZenodoRecord$removeContributorByGND(gnd)
gndcontributor GND
TRUE if removed, FALSE otherwise
removeContributorByISNI()
Removes a contributor by ISNI.
ZenodoRecord$removeContributorByISNI(isni)
isnicontributor ISNI
TRUE if removed, FALSE otherwise
removeContributorByROR()
Removes a contributor by ROR.
ZenodoRecord$removeContributorByROR(ror)
rorcontributor ROR
TRUE if removed, FALSE otherwise
addRight()
Add right/license. Please see https://inveniordm.docs.cern.ch/reference/metadata/#rights-licenses-0-n
ZenodoRecord$addRight( id = NULL, title = NULL, description = NULL, link = NULL, sandbox = FALSE )
idlicense id
titlelicense title
descriptiona multi-lingual list
linklicense link
sandboxUse the Zenodo sandbox infrastructure as basis to control available licenses. Default is FALSE
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().
ZenodoRecord$setLicense(licenseId, sandbox = FALSE)
licenseIda license Id
sandboxUse the Zenodo sandbox infrastructure as basis to control available licenses. Default is FALSE
TRUE if set, FALSE otherwise
setVersion()
Set record version.
ZenodoRecord$setVersion(version)
versionthe record version to set
addLanguage()
Adds a language.
ZenodoRecord$addLanguage(language)
languageISO 639-2 or 639-3 code
setLanguage()
Set the language
ZenodoRecord$setLanguage(language)
languageISO 639-2 or 639-3 code
addRelatedIdentifier()
Adds a related identifier with a given scheme and relation type.
ZenodoRecord$addRelatedIdentifier( identifier, scheme, relation_type, resource_type = NULL )
identifieridentifier
schemescheme among following values: ark, arxiv, bibcode, doi, ean13, eissn, handle, igsn, isbn, issn, istc, lissn, lsid, pubmed id, purl, upc, url, urn, w3id
relation_typerelation 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_typeoptional resource type
TRUE if added, FALSE otherwise
removeRelatedIdentifier()
Removes a related identifier with a given scheme/relation_type
ZenodoRecord$removeRelatedIdentifier(identifier, scheme, relation_type)
identifieridentifier
schemescheme among following values: ark, arxiv, bibcode, doi, ean13, eissn, handle, igsn, isbn, issn, istc, lissn, lsid, pubmed id, purl, upc, url, urn, w3id
relation_typerelation 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
TRUE if removed, FALSE otherwise
setReferences()
Set references
ZenodoRecord$setReferences(references)
referencesa vector or list of references to set for the record
addReference()
Add a reference
ZenodoRecord$addReference(reference)
referencethe reference to add
TRUE if added, FALSE otherwise
removeReference()
Remove a reference
ZenodoRecord$removeReference(reference)
referencethe reference to remove
TRUE if removed, FALSE otherwise
setSubjects()
Set subjects
ZenodoRecord$setSubjects(subjects)
subjectsa vector or list of subjects to set for the record
setKeywords()
Set keywords
ZenodoRecord$setKeywords(keywords)
keywordsa vector or list of keywords to set for the record
addSubject()
Add a subject
ZenodoRecord$addSubject(subject)
subjectthe subject to add
TRUE if added, FALSE otherwise
addKeyword()
Add a keyword
ZenodoRecord$addKeyword(keyword)
keywordthe keyword to add
TRUE if added, FALSE otherwise
removeSubject()
Remove a subject
ZenodoRecord$removeSubject(subject)
subjectthe subject to remove
TRUE if removed, FALSE otherwise
removeKeyword()
Remove a keyword
ZenodoRecord$removeKeyword(keyword)
keywordthe keyword to remove
TRUE if removed, FALSE otherwise
setNotes()
Set notes. HTML is not allowed
ZenodoRecord$setNotes(notes)
notesobject of class character
addFunding()
Adds funding. Used internally, prefer using addGrant instead.
ZenodoRecord$addFunding(funder = NULL, grant = NULL, sandbox = FALSE)
funderfunder id or name
grantgrant id or title
sandboxUse the Zenodo sandbox infrastructure as basis to control available grants. Default is FALSE
addGrant()
Adds a grant to the record metadata.
ZenodoRecord$addGrant(grant, sandbox = FALSE)
grantgrant 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().
sandboxUse the Zenodo sandbox infrastructure as basis to control available grants. Default is FALSE
TRUE if added, FALSE otherwise
setGrants()
Set a vector of character strings identifying grants
ZenodoRecord$setGrants(grants, sandbox = FALSE)
grantsa 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.
sandboxUse the Zenodo sandbox infrastructure as basis to control available grants. Default is FALSE
removeGrant()
Removes a grant from the record metadata.
ZenodoRecord$removeGrant(grant)
grantgrant to remove. The grant should be set with the Zenodo id of the grant
TRUE if removed, FALSE otherwise
setJournalTitle()
Set Journal title to the record metadata
ZenodoRecord$setJournalTitle(title)
titlea title, object of class character
setJournalVolume()
Set Journal volume to the record metadata
ZenodoRecord$setJournalVolume(volume)
volumea volume
setJournalIssue()
Set Journal issue to the record metadata
ZenodoRecord$setJournalIssue(issue)
issuean issue
setJournalPages()
Set Journal pages to the record metadata
ZenodoRecord$setJournalPages(pages)
pagesnumber of pages
setConferenceTitle()
Set conference title to the record metadata
ZenodoRecord$setConferenceTitle(title)
titleconference title, object of class character
setConferenceAcronym()
Set conference acronym to the record metadata
ZenodoRecord$setConferenceAcronym(acronym)
acronymconference acronym, object of class character
setConferenceDates()
Set conference dates to the record metadata
ZenodoRecord$setConferenceDates(dates)
datesconference dates, object of class character
setConferencePlace()
Set conference place to the record metadata
ZenodoRecord$setConferencePlace(place)
placeconference place, object of class character
setConferenceUrl()
Set conference url to the record metadata
ZenodoRecord$setConferenceUrl(url)
urlconference url, object of class character
setConferenceSession()
Set conference session to the record metadata
ZenodoRecord$setConferenceSession(session)
sessionconference session, object of class character
setConferenceSessionPart()
Set conference session part to the record metadata
ZenodoRecord$setConferenceSessionPart(part)
partconference session part, object of class character
setImprintPublisher()
Set imprint publisher to the record metadata
ZenodoRecord$setImprintPublisher(publisher)
publisherthe publisher, object of class character
setImprintISBN()
Set imprint ISBN to the record metadata
ZenodoRecord$setImprintISBN(isbn)
isbnthe ISBN, object of class character
setImprintPlace()
Set imprint place to the record metadata
ZenodoRecord$setImprintPlace(place)
placethe place, object of class character
setPartofTitle()
Set title to which record is part of
ZenodoRecord$setPartofTitle(title)
titlethe title, object of class character
setPartofPages()
Set pages to which record is part of
ZenodoRecord$setPartofPages(pages)
pagesthe pages, object of class character
setThesisUniversity()
Set thesis university
ZenodoRecord$setThesisUniversity(university)
universitythe university, object of class character
addThesisSupervisor()
Adds thesis supervisor
ZenodoRecord$addThesisSupervisor( firstname, lastname, affiliation = NULL, orcid = NULL, gnd = NULL )
firstnamesupervisor first name
lastnamesupervisor last name
affiliationsupervisor affiliation (optional)
orcidsupervisor ORCID (optional)
gndsupervisor GND (optional)
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').
ZenodoRecord$removeThesisSupervisor(by, property)
byproperty used as criterion to remove the thesis supervisor
propertyproperty value used to remove the thesis supervisor
TRUE if removed, FALSE otherwise
removeThesisSupervisorByName()
Removes a thesis supervisor by name.
ZenodoRecord$removeThesisSupervisorByName(name)
namethesis supervisor name
TRUE if removed, FALSE otherwise
removeThesisSupervisorByAffiliation()
Removes a thesis supervisor by affiliation
ZenodoRecord$removeThesisSupervisorByAffiliation(affiliation)
affiliationthesis supervisor affiliation
TRUE if removed, FALSE otherwise
removeThesisSupervisorByORCID()
Removes a thesis supervisor by ORCID
ZenodoRecord$removeThesisSupervisorByORCID(orcid)
orcidthesis supervisor ORCID
TRUE if removed, FALSE otherwise
removeThesisSupervisorByGND()
Removes a thesis supervisor by GND
ZenodoRecord$removeThesisSupervisorByGND(gnd)
gndthesis supervisor GND
TRUE if removed, FALSE otherwise
addLocation()
Adds a location to the record metadata.
ZenodoRecord$addLocation(place, description = NULL, lat = NULL, lon = NULL)
placeplace (required)
descriptiondescription
latlatitude
lonlongitude
removeLocation()
Removes a grant from the record metadata.
ZenodoRecord$removeLocation(place)
placeplace (required)
TRUE if removed, FALSE otherwise
exportAs()
Exports record to a file by format.
ZenodoRecord$exportAs(format, filename, append_format = TRUE)
formata valid Zenodo export format among the following: BibTeX, CSL, DataCite (or DataCiteXML), DublinCore, DCAT, JSON, JSON-LD, GeoJSON, MARCXML, DataCiteJSON, CodeMeta, DataPackage, CFF.
filenamethe target filename (without extension)
append_formatwether 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.
the writen file name (with extension)
exportAsBibTeX()
Exports record as BibTeX
ZenodoRecord$exportAsBibTeX(filename)
filenamethe target filename (without extension)
the writen file name (with extension)
exportAsCSL()
Exports record as CSL
ZenodoRecord$exportAsCSL(filename)
filenamethe target filename (without extension)
the writen file name (with extension)
exportAsDataCite()
Exports record as DataCite (same as exportAsDataCiteXML)
ZenodoRecord$exportAsDataCite(filename)
filenamethe target filename (without extension)
the writen file name (with extension)
exportAsDataCiteXML()
Exports record as DataCite XML
ZenodoRecord$exportAsDataCiteXML(filename)
filenamethe target filename (without extension)
the writen file name (with extension)
exportAsDataCiteJSON()
Exports record as DataCite JSON
ZenodoRecord$exportAsDataCiteJSON(filename)
filenamethe target filename (without extension)
the writen file name (with extension)
exportAsDublinCore()
Exports record as DublinCore
ZenodoRecord$exportAsDublinCore(filename)
filenamethe target filename (without extension)
the writen file name (with extension)
exportAsDCAT()
Exports record as DCAT
ZenodoRecord$exportAsDCAT(filename)
filenamethe target filename (without extension)
the writen file name (with extension)
exportAsJSON()
Exports record as JSON
ZenodoRecord$exportAsJSON(filename)
filenamethe target filename (without extension)
the writen file name (with extension)
exportAsJSONLD()
Exports record as JSONLD
ZenodoRecord$exportAsJSONLD(filename)
filenamethe target filename (without extension)
exportAsGeoJSON()
Exports record as GeoJSON
ZenodoRecord$exportAsGeoJSON(filename)
filenamethe target filename (without extension)
the writen file name (with extension)
exportAsMARCXML()
Exports record as MARCXML
ZenodoRecord$exportAsMARCXML(filename)
filenamethe target filename (without extension)
the writen file name (with extension)
exportAsCodeMeta()
Exports record as CodeMeta
ZenodoRecord$exportAsCodeMeta(filename)
filenamethe target filename (without extension)
the writen file name (with extension)
exportAsCFF()
Exports record as Citation File Format
ZenodoRecord$exportAsCFF(filename)
filenamethe target filename (without extension)
the writen file name (with extension)
exportAsDataPackage()
Exports record as DataPackage
ZenodoRecord$exportAsDataPackage(filename)
filenamethe target filename (without extension)
the writen file name (with extension)
exportAsAllFormats()
Exports record in all Zenodo record export formats. This function will create one file per Zenodo metadata formats.
ZenodoRecord$exportAsAllFormats(filename)
filenamethe target filename (without extension)
getCitation()
Get record citation
ZenodoRecord$getCitation(
style = c("havard-cite-them-right", "apa", "modern-language-association", "vancouver",
"chicago-fullnote-bibliography", "ieee", "bibtex")
)stylethe style character string among. Possible values "havard-cite-them-right", "apa", "modern-language-association","vancouver","chicago-fullnote-bibliography", "ieee", or "bibtex"
the citation text
listFiles()
list files attached to the record
ZenodoRecord$listFiles(pretty = TRUE)
prettywhether a pretty output (data.frame) should be returned (default TRUE), otherwise
the raw list of files is returned.
the files, as data.frame or list
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, ... )
pathtarget 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.
parallelwhether download has to be done in parallel using the chosen parallel_handler. Default is FALSE
parallel_handlerThe 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.
clan 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
ZenodoRecord$print(..., format = "internal", depth = 1)
...any other parameter. Not used
formatformat 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
depthan internal depth parameter for indentation of print statements, in case of listing or recursive use of print
toDCEntry()
Maps to an atom4R DCEntry. Note: applies only to published records.
ZenodoRecord$toDCEntry()
an object of class DCEntry
getFirstDOI()
Get DOI of the first record version.
ZenodoRecord$getFirstDOI()
the first DOI, object of class character
getLastDOI()
Get DOI of the latest record version.
ZenodoRecord$getLastDOI()
the last DOI, object of class character
getVersions()
Get record versions with creation/publication date, version (ordering number) and DOI.
ZenodoRecord$getVersions()
a data.frame with the record versions
clone()
The objects of this class are cloneable with this method.
ZenodoRecord$clone(deep = FALSE)
deepWhether to make a deep clone.
Internal method. Prefer using addCreator or addContributor
Internal method. Prefer using removeCreator or removeContributor
See examples in download_zenodo utility function.
Emmanuel Blondel <[email protected]>
ZenodoRequest
ZenodoRequest
R6Class object.
Object of R6Class for modelling a generic Zenodo request
zen4R::zen4RLogger -> ZenodoRequest
new()
Initializes a ZenodoRequest
ZenodoRequest$new( url, type, request, data = NULL, file = NULL, progress = FALSE, accept = "application/vnd.inveniordm.v1+json", token, logger = NULL, ... )
urlrequest URL
typeType of request: 'GET', 'POST', 'PUT', 'DELETE'
requestthe method request
datapayload (optional)
fileto be uploaded (optional)
progresswhether a progress status has to be displayed for download/upload
acceptaccept header. Default is "application/vnd.inveniordm.v1+json"
tokenuser token
loggerthe logger type
...any other arg
execute()
Executes the request
ZenodoRequest$execute()
getRequest()
Get request
ZenodoRequest$getRequest()
getRequestHeaders()
Get request headers
ZenodoRequest$getRequestHeaders()
getStatus()
Get request status
ZenodoRequest$getStatus()
getResponse()
Get request response
ZenodoRequest$getResponse()
getException()
Get request exception
ZenodoRequest$getException()
hasException()
has exception?
ZenodoRequest$hasException()
TRUE if request has exception, FALSE otherwise
getResult()
Get request result
ZenodoRequest$getResult()
setResult()
Set request result
ZenodoRequest$setResult(result)
resultresult to be set
clone()
The objects of this class are cloneable with this method.
ZenodoRequest$clone(deep = FALSE)
deepWhether to make a deep clone.
Abstract class used internally by zen4R
Emmanuel Blondel <[email protected]>