SwordDataverseClient: SWORD Dataverse client class

SwordDataverseClientR Documentation

SWORD Dataverse client class

Description

This class models an Sword service Dataverse-specific API client

Format

R6Class object.

Details

SwordDataverseClient

Value

Object of R6Class for modelling an Sword Dataverse-specific APIclient

Super classes

atom4R::atom4RLogger -> atom4R::AtomPubClient -> atom4R::SwordClient -> SwordDataverseClient

Methods

Public methods

Inherited methods

Method 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.

Usage
SwordDataverseClient$new(
  hostname,
  token = NULL,
  logger = NULL,
  keyring_backend = "env"
)
Arguments
hostname

host name

token

token

logger

logger

keyring_backend

keyring backend. Default is 'env'


Method getServiceDocument()

Get service document

Usage
SwordDataverseClient$getServiceDocument(force = FALSE)
Arguments
force

force Force getting/refreshing of service document

Returns

object of class SwordServiceDocument


Method getCollectionMembers()

Get collection members

Usage
SwordDataverseClient$getCollectionMembers(collectionId)
Arguments
collectionId

collection ID

Returns

a list of AtomFeed


Method getDataverses()

Get dataverses. Equivalent to listCollections() from AtomPubClient

Usage
SwordDataverseClient$getDataverses(pretty = FALSE)
Arguments
pretty

prettify output as data.frame. Default is FALSE

Returns

an object of class data.frame


Method getDataverse()

Get dataverse members by dataverse name. Equivlaent to getCollectionMembers()

Usage
SwordDataverseClient$getDataverse(dataverse)
Arguments
dataverse

dataverse name

Returns

a list of AtomFeed


Method editDataverseEntry()

Edits a dataverse entry

Usage
SwordDataverseClient$editDataverseEntry(identifier)
Arguments
identifier

identifier

Returns

an object of class AtomEntry


Method getDataverseRecord()

Get dataverse record

Usage
SwordDataverseClient$getDataverseRecord(identifier)
Arguments
identifier

identifier

Returns

an object of class AtomFeed


Method createDataverseRecord()

Creates a dataverse record

Usage
SwordDataverseClient$createDataverseRecord(dataverse, entry)
Arguments
dataverse

dataverse name

entry

entry

the

created AtomEntry


Method updateDataverseRecord()

Updates a dataverse record

Usage
SwordDataverseClient$updateDataverseRecord(dataverse, entry, identifier)
Arguments
dataverse

dataverse name

entry

entry

identifier

identifier of the entry to update

the

created AtomEntry


Method deleteDataverseRecord()

Deletes a dataverse record

Usage
SwordDataverseClient$deleteDataverseRecord(identifier)
Arguments
identifier

identifier

Returns

TRUE if deleted, or returns an error otherwise


Method publishDataverseRecord()

Publishes a dataverse record

Usage
SwordDataverseClient$publishDataverseRecord(identifier)
Arguments
identifier

identifier

Returns

the published AtomEntry


Method addFilesToDataverseRecord()

Add files to a dataverse record

Usage
SwordDataverseClient$addFilesToDataverseRecord(identifier, files)
Arguments
identifier

identifier

files

files


Method deleteFilesFromDataverseRecord()

Deletes files from a Dataverse record

Usage
SwordDataverseClient$deleteFilesFromDataverseRecord(identifier, files = NULL)
Arguments
identifier

identifier

files

files

Returns

an object of class data.frame giving each file and it's deletion status


Method clone()

The objects of this class are cloneable with this method.

Usage
SwordDataverseClient$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

Emmanuel Blondel <emmanuel.blondel1@gmail.com>

Examples

## 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)


atom4R documentation built on Nov. 18, 2022, 5:06 p.m.