gocfl / ocfl / extensions
A crucial advantage of OCFL is integrity assurance. With gocfl, it is possible to verify at any time whether a storage root or an individual object still complies with the specification and whether all checksums (digests) are correct.
validate CommandThe validate command (or the alias check) performs a deep check of the OCFL structure. It checks both the formal requirements of the specification and the consistency of the data against the inventory.
gocfl validate [path to storage root or object]
We validate the specific object in the storage root that we created and updated in the previous steps:
gocfl --log-level INFO --config ./gocfl/config/gocfl.toml validate ./gocfl/temp/test42/ -i urn:nbn:de:gbv:42-test1
Explanation of Parameters:
validate: The command to verify integrity../gocfl/temp/test42/: The path to the storage root.-i urn:nbn:de:gbv:42-test1: The specific object ID to be checked. If this ID (or the flag -i) is omitted, gocfl validates all objects found in the storage root sequentially.During validation, gocfl performs the following steps:
inventory.json well-formed? Are all versions present without gaps?state point to existing files in the manifest? Are there “orphaned” files in the content folder that are not listed in any manifest?If a storage root contains many objects, validation can be time-consuming. gocfl offers flags to narrow down the check:
gocfl validate ./gocfl/temp/test42/ --object-id urn:nbn:de:gbv:42-test1
gocfl validate ./gocfl/temp/test42/ --object-path 1f7/d28/1ac/1f7d281acc...
When the validation is complete, gocfl outputs a summary. It is important to distinguish between errors and warnings.
{"level":"info","time":"2026-03-14T17:13:59Z","message":"loading configuration from "}
2026-03-14T17:13:59Z INF validating '/home/ocfl/gocfl/temp/test42' host=gocfl timestamp="..."
2026-03-14T17:13:59Z WRN extension NNNN-gocfl-extension-manager is not registered ... validationErrorCode=W013 validationErrorMessage="‘In an OCFL Object, extension sub-directories SHOULD be named according to a registered extension name.’"
2026-03-14T17:13:59Z WRN extension NNNN-content-subpath is not registered ... validationErrorCode=W013
...
2026-03-14T17:13:59Z INF object 'urn:nbn:de:gbv:42-test1' with object version '1.1' found host=gocfl task=checker ...
[extension NNNN-content-subpath is not registered]
#W013 - ‘In an OCFL Object, extension sub-directories SHOULD be named according to a registered extension name.’ []
...
no errors found
2026-03-14T17:14:00Z INF Duration: 221.808179ms host=gocfl ...
W013.NNNN-content-subpath) are not officially registered with the OCFL community (hence the NNNN- prefix).E001, E066) would indicate a violation of the OCFL core specification (MUST requirements).| Back to Updating an Object | Back to Table of Contents | Next to Display (display) |