je4.github.io

gocfl / ocfl / extensions

View My GitHub Profile

Deutsch

Extracting Content (extract)

Although OCFL objects are readable directly in the filesystem, it may be necessary to extract the content of an object (or a specific version) to a separate directory, for example, for delivery to another system or for further processing without the OCFL structure.

1. The extract Command

With the extract command, gocfl copies the files of an object from the storage root to a target location. In doing so, the logical structure of the object (the “state”) is restored.

Basic Syntax:

gocfl extract [options] [path to storage root or object] [target directory]

Workshop Example:

To extract the current version of our test object into a temporary directory, we use:

gocfl --log-level DEBUG --config ./gocfl/config/gocfl.toml extract ./gocfl/temp/test42 ./gocfl/temp/extract_v2 --with-manifest -i urn:nbn:de:gbv:42-test1

Explanation:

2. Extracting Specific Versions

By default, gocfl always extracts the latest version (HEAD). If you want to extract an older version, you can control this via the -v (or --version) parameter:

gocfl --config ./gocfl/config/gocfl.toml extract --version v1 ./gocfl/temp/test42/ ./gocfl/temp/extract_v1/ --object-id urn:nbn:de:gbv:42-test1 --with-manifest

3. Important Options

4. What is Extracted?

During extraction, the logical state of the selected version is restored. This means:

The management of different data areas is handled by the NNNN-content-subpath extension. By default, only the content area is extracted unless otherwise specified (see --area).


Back to Display in Web Browser Next to Extracting Metadata Back to Table of Contents