SwordDataverseClient | R Documentation |
This class models an Sword service Dataverse-specific API client
R6Class
object.
SwordDataverseClient
Object of R6Class
for modelling an Sword Dataverse-specific APIclient
atom4R::atom4RLogger
-> atom4R::AtomPubClient
-> atom4R::SwordClient
-> SwordDataverseClient
atom4R::atom4RLogger$ERROR()
atom4R::atom4RLogger$INFO()
atom4R::atom4RLogger$WARN()
atom4R::atom4RLogger$getClass()
atom4R::atom4RLogger$getClassName()
atom4R::atom4RLogger$logger()
atom4R::AtomPubClient$getPwd()
atom4R::AtomPubClient$getToken()
atom4R::AtomPubClient$getUser()
atom4R::AtomPubClient$listCollections()
new()
This method is to instantiate an Sword API Dataverse-specific Client.
The keyring_backend
can be set to use a different backend for storing
the SWORD DataVerse API user token with keyring (Default value is 'env').
The logger
allows to specify the level of log (default is NULL), either "INFO"
for atom4R logs or "DEBUG" for verbose HTTP client (curl) logs.
SwordDataverseClient$new( hostname, token = NULL, logger = NULL, keyring_backend = "env" )
hostname
host name
token
token
logger
logger
keyring_backend
keyring backend. Default is 'env'
getServiceDocument()
Get service document
SwordDataverseClient$getServiceDocument(force = FALSE)
force
force Force getting/refreshing of service document
object of class SwordServiceDocument
getCollectionMembers()
Get collection members
SwordDataverseClient$getCollectionMembers(collectionId)
collectionId
collection ID
a list of AtomFeed
getDataverses()
Get dataverses. Equivalent to listCollections()
from AtomPubClient
SwordDataverseClient$getDataverses(pretty = FALSE)
pretty
prettify output as data.frame
. Default is FALSE
an object of class data.frame
getDataverse()
Get dataverse members by dataverse name. Equivlaent to getCollectionMembers()
SwordDataverseClient$getDataverse(dataverse)
dataverse
dataverse name
a list of AtomFeed
editDataverseEntry()
Edits a dataverse entry
SwordDataverseClient$editDataverseEntry(identifier)
identifier
identifier
an object of class AtomEntry
getDataverseRecord()
Get dataverse record
SwordDataverseClient$getDataverseRecord(identifier)
identifier
identifier
an object of class AtomFeed
createDataverseRecord()
Creates a dataverse record
SwordDataverseClient$createDataverseRecord(dataverse, entry)
dataverse
dataverse name
entry
entry
the
created AtomEntry
updateDataverseRecord()
Updates a dataverse record
SwordDataverseClient$updateDataverseRecord(dataverse, entry, identifier)
dataverse
dataverse name
entry
entry
identifier
identifier of the entry to update
the
created AtomEntry
deleteDataverseRecord()
Deletes a dataverse record
SwordDataverseClient$deleteDataverseRecord(identifier)
identifier
identifier
TRUE
if deleted, or returns an error otherwise
publishDataverseRecord()
Publishes a dataverse record
SwordDataverseClient$publishDataverseRecord(identifier)
identifier
identifier
the published AtomEntry
addFilesToDataverseRecord()
Add files to a dataverse record
SwordDataverseClient$addFilesToDataverseRecord(identifier, files)
identifier
identifier
files
files
deleteFilesFromDataverseRecord()
Deletes files from a Dataverse record
SwordDataverseClient$deleteFilesFromDataverseRecord(identifier, files = NULL)
identifier
identifier
files
files
an object of class data.frame
giving each file and it's deletion status
clone()
The objects of this class are cloneable with this method.
SwordDataverseClient$clone(deep = FALSE)
deep
Whether to make a deep clone.
Emmanuel Blondel <emmanuel.blondel1@gmail.com>
## Not run: #connect to SWORD Dataverse API SWORD <- SwordDataverseClient$new( hostname = "localhost:8085", token = "<token>", logger = "DEBUG" ) #for detailed operations check the wiki at: #https://github.com/eblondel/atom4R/wiki#atom4R-publish-sword-dataverse ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.