Skip to main content
Version: 2.5

Storage

The following operations are used to prepare and upload information into the repository system, by default a Fedora Commons.

Add custom metadato to METS RDF.

This action allows to add custom metadata to a SIP. It takes the information from a JSON files following the following definition:

{
"customMetadata": [
{"uri":"uri1", "name": "Name1", "type": "Type1", "value":"Value1"},
{"uri":"uri2", "name": "Name2", "type": "Type2", "value":"Value2"},
{"uri":"uri3", "name": "Name2", "type": "Type3", "value":"Value3"}
]
}

It parsed the JSON file and transform it into RDF triples. Each uri must already exist in the mets.nt file as a record resource or an instantiation.

<${uri}#custommetadata_${hash}> rdf:type <https://www.ica.org/standards/RiC/ontology#Thing>
<${uri}#custommetadata_${hash}> rico:isRelatedTo <${uri}>
<${uri}#custommetadata_${hash}> rico:hasOrHadCategory <http://docuteam.ch/vocab/thingcategory/custommetadata>
<${uri}#custommetadata_${hash}> rico:name "${name}"
<${uri}#custommetadata_${hash}> rico:type <${type}> if type is an url (starts with http:// or https://)
<${uri}#custommetadata_${hash}> rico:type "${type}" if type is not an url
<${uri}#custommetadata_${hash}> rico:textualValue "${value}"
<${uri}#custommetadata_${hash}> schema:position "${position}"

Finally the generated triples are appended to the mets.nt file of the SIP.

docuteam-actions addCustomMetadataToMets -c [/path/to/]config.json

Options:
--version Show version number [boolean]
--debug Set log level to debug [boolean]
-c, --config Configuration file path [string] [required]
--help Show help [boolean]
-d, --data Data file path, pointing to the folder package with mets.nt [string] [required]
--customMetadata Path to custom metadata JSON file [string] [required]

Create authenticity note for signed PDF files

This operation generates a JSON file for signed PDF files based on the presence of specific metadata in the mets.nt file. It checks for events of type signaturecheck and creates a JSON file named customMetadataAuthenticityNote.json in the same directory as the mets.nt file. If no such events are found, an empty JSON file is created.

The generated JSON file contains metadata about the authenticity of the signed PDF files, including the URI, name, type, and value.

docuteam-actions createAuthenticityNoteForSignedPdfFiles -d [/path/to/data]

Options:
--version Show version number [boolean]
--debug Set log level to debug [boolean]
-d, --data Path to the folder containing the `mets.nt` file [string] [required]
--help Show help [boolean]

Append Matterhorn RDF into box

With this operation, data can be appended to an existing Fedora 6 AIP. Both single files and folder structures can be appended at the position defined with the appendPositionPid parameter. This PID needs to belong to either the root folder or any other folder of the existing AIP. This action will expect an N-Triples file in the SIP-folder (usually produced using the convertMetsToRDF action). It will create all the resources listed in this file in the Fedora repository system using the box append API. The SIP-folder needs to reside in a folder defined as a shared folder in config.json, so box can access the SIP.

docuteam-actions appendRDFIntoBox -c [/path/to/]config.json -d /path/to/SIP -appendPositionPid "CH-00001-X:1"

Options:
--version Show version number [boolean]
--debug Set log level to debug [boolean]
-c, --config Configuration file path [string] [required]
--help Show help [boolean]
-d, --data Data file path [string] [required]
--appendPositionPid PID where the package will be appended [string] [required]

Convert Matterhorn METS to Matterhorn RDF

While the (pre-)ingest process by default requires the SIP to be in Matterhorn METS format, the repository system is based on the Linked Data Platform specification. With this action, the content and structure of the SIP is transformed into RDF. The resulting N-Triples file will be placed in the root folder of the SIP.

docuteam-actions convertMetsToRDF -c [/path/to/]config.json -d /path/to/SIP

Options:
--version Show version number [boolean]
--debug Set log level to debug [boolean]
-c, --config Configuration file path [string] [required]
--help Show help [boolean]
-d, --data Input file path [string] [required]

Delete AIP from box

This action will delete an Fedora AIP using the box delete API. It will automatically delete the resource with the PID given as the pid parameter and all its children. The deletion will be documented in the parent Record Resource or Deposition. In addition to the pid parameter, a note field documenting the deletion has to be provided using the deletionReason parameter.

docuteam-actions deleteAIPFromBox -c [/path/to/]config.json -pid"CH-00001-X:1" -deletionReason "some note field documenting the deletion"

Options:
--version Show version number [boolean]
--debug Set log level to debug [boolean]
-c, --config Configuration file path [string] [required]
--help Show help [boolean]
--pid PID to be deleted [string] [required]
--deletionReason Note field documenting the deletion [string] [required]

Download DIP from box

Based on a PID, this action will download a DIP from docuteam box and store it in the location specified using the path parameter. Currently only the DIP type MatterhornMETSv1.0 is supported.

docuteam-actions downloadDIPFromBox -c [/path/to/]config.json -pid 'CH-00000-X:1' -p /path/to/DIP.zip --dipType 'MatterhornMETSv1.0'

Options:
--version Show version number [boolean]
--debug Set log level to debug [boolean]
-c, --config Configuration file path [string] [required]
--help Show help [boolean]
-p, --path Path where the DIP will be stored [string] [required]
--pid PID of the AIP [string] [required]
--dipType Package format of the DIP [string] [required]

Download metadata from box

Based on a PID, this action will download a metadata file from docuteam box and store it in the location specified using the path parameter. Currently only the metadata type EAD is supported.

docuteam-actions downloadMetadataFromBox -c [/path/to/]config.json -pid 'CH-00000-X:1' -p /path/to/EAD.xml --metadataType 'EAD'

Options:
--version Show version number [boolean]
--debug Set log level to debug [boolean]
-c, --config Configuration file path [string] [required]
--help Show help [boolean]
-p, --path Path where the metadata file will be stored [string] [required]
--pid PID of the AIP [string] [required]
--metadataType Metadata type [string] [required]

Import Matterhorn RDF into box

This action will expect an N-Triples file in the SIP-folder (usually produced using the convertMetsToRDF action). It will create all the resources listed in this file in the Fedora repository system using the box insert API. The SIP-folder needs to reside in a folder defined as a shared folder in config.json, so box can access the SIP.

docuteam-actions importRDFIntoBox -c [/path/to/]config.json -d /path/to/SIP

Options:
--version Show version number [boolean]
--debug Set log level to debug [boolean]
-c, --config Configuration file path [string] [required]
--help Show help [boolean]
-d, --data Data file path [string] [required]

Import Matterhorn RDF into Fedora

This action will expect an N-Triples file in the SIP-folder (usually produced using the convertMetsToRDF action). It will create all the resources listed in this file in the Fedora repository system. To prevent duplicate URIs, it adds a hash-bashed suffix to deposition and record resource URIs. Resources will be sent in parallel requests. The initial size of the batch can be set manually, but the process will adapt to response status during the execution.

docuteam-actions importRDFIntoFedora -c [/path/to/]config.json -d /path/to/SIP

Options:
--version Show version number [boolean]
--debug Set log level to debug [boolean]
-c, --config Configuration file path [string] [required]
--help Show help [boolean]
--batch-size Initial batch size (default: 100) [number]
-d, --data Data file path [string] [required]

Replace Fedora instantiation

This action will expect a single file and an N-Triples file (mets.nt) in the SIP-folder (usually produced using the convertMetsToRDF action). Additionally a mets.xml file can also be present, but will not be used. It will send the binary file to the replace endpoint of the box API in order to replace the existing binary file in Fedora. For this, a new instantiation is created in Fedora (based on the RDF metadata in the mets.nt file) and the old instantiation is modified. The operation will read out the mets.nt metadata in order to find the correct Fedora resource. The parameter ricoIdentifierType defines which identifier is used to find the existing instantiation. By default it searches for the PID (option pid), it can also search for other identifiers like refcode of the existing resource. If the search for another identifier finds multiples files in Fedora, they are updated in turn. By default the new instantiation will have the file name of the file provided in the SIP-Folder, setting the parameter keepRepositoryFileName to true renames the file in the SIP-folder with the file name of the file in Fedora.

docuteam-actions replaceInstantiation -c [/path/to/]config.json -d /path/to/SIP

Options:
--version Show version number [boolean]
--debug Set log level to debug [boolean]
-c, --config Configuration file path [string] [required]
--help Show help [boolean]
-d, --data Data file path [string] [required]
--ricoIdentifierType Identifier type of the existing file [string]
--keepRepositoryFileName Keep the file name of the file in the repository [boolean]

Update metadata in box for customer 2118

This customer specific action will update the descriptive metadata in record resources stored in Fedora 6 using the box API. As an input it will expect an xml file with metadata in the workbench. Three types of metadata formats are supported: marc, fnMeta, fnRights. The xml file is parsed and the record resource to be updated is identified. Selected descriptive metadata elements are then updated (assuming the values stored in the repository are different from the values extracted from the xml). For the metadata types marc and fnMeta, the metadata of the root record resource of the package is updated, with the metadata type fnRightsthe accessPolicy of the files inside the package are updated. If no record resource in box can be found, a log message will be written, but no error will occur.

docuteam-actions updateMetadataInBoxFor2118 -c [/path/to/]config.json -d /path/to/metadata/file --metadataType 'marc'

Options:
--version Show version number [boolean]
--debug Set log level to debug [boolean]
-c, --config Configuration file path [string] [required]
--help Show help [boolean]
-d, --data Metadata file path [string] [required]
--metadataType Type of metadata file [string] [required]