This storage root extension describes an OCFL storage layout combining a pairtree-like root directory structure derived from prefix-omitted object identifiers, followed by the prefix-omitted object identifier themselves. The OCFL object identifiers are expected to contain prefixes which are removed in the mapping to directory names. The OCFL object identifier prefix is defined as all characters before and including a configurable delimiter. Where the prefix-omitted identifier length is less than tuple size * number of tuples, the remaining object id (prefix omitted) is left or right-side, zero-padded (configurable, left default), and optionally reversed (default false). The object id is then divided into N n-tuple segments, and used to create nested paths under the OCFL storage root, followed by the prefix-omitted object id directory.
This layout combines the advantages of 0006-flat-omit-prefix-storage-layout (directory name transparency) and the 0004-hashed-n-tuple-storage-layout (enhanced file system/bucket performance).
The limitations of this layout are filesystem dependent (with one exception), and are generally as follows:
delimiter
tupleSize
numberOfTuples
zeroPadding
reverseObjectRoot
The following is an outline of the steps to map an OCFL object identifier to an OCFL object root path:
zeroPadding
configuration.reverseObjectRoot
numberOfTuples
each containing tupleSize
characters.This example demonstrates mappings where the single-character delimiter is found one or more times in the OCFL object
identifier, with default zeroPadding
, modified tupleSize
and numberOfTuples
, and reverseObjectRoot
true.
{
"extensionName": "0007-n-tuple-omit-prefix-storage-layout",
"delimiter": ":",
"tupleSize": 4,
"numberOfTuples": 2,
"zeroPadding": "left",
"reverseObjectRoot": true
}
Object ID | Object Root Path |
---|---|
namespace:12887296 | 6927/8821/12887296 |
urn:uuid:6e8bc430-9c3a-11d9-9669-0800200c9a66 | 66a9/c002/6e8bc430-9c3a-11d9-9669-0800200c9a66 |
abc123 | 321c/ba00/abc123 |
[storage_root]/
├── 0=ocfl_1.0
├── ocfl_layout.json
├── extensions/
│ └── 0007-n-tuple-omit-prefix-storage-layout/
│ └── config.json
├── 6927/
│ └── 8821/
│ └── 12887296/
│ ├── 0=ocfl_object_1.0
│ ├── inventory.json
│ ├── inventory.json.sha512
│ └── v1 [...]
├── 66a9/
│ └── c002/
│ └── 6e8bc430-9c3a-11d9-9669-0800200c9a66/
│ ├── 0=ocfl_object_1.0
│ ├── inventory.json
│ ├── inventory.json.sha512
│ └── v1 [...]
└── 321c/
└── ba00/
└── abc123/
├── 0=ocfl_object_1.0
├── inventory.json
├── inventory.json.sha512
└── v1 [...]
This example demonstrates mappings where the multi-character delimiter is found one or more times in the OCFL object
identifier, with default tupleSize
, numberOfTuples
, and reverseObjectRoot
, and modified zeroPadding
.
{
"extensionName": "0007-n-tuple-omit-prefix-storage-layout",
"delimiter": "edu/",
"tupleSize": 3,
"numberOfTuples": 3,
"zeroPadding": "right",
"reverseObjectRoot": false
}
Object ID | Object Root Path |
---|---|
https://institution.edu/3448793 | 344/879/300/3448793 |
https://institution.edu/abc/edu/f8.05v | f8./05v/000/f8.05v |
[storage_root]/
├── 0=ocfl_1.0
├── ocfl_layout.json
├── extensions/
│ └── 0007-n-tuple-omit-prefix-storage-layout/
│ └── config.json
├── 344/
│ └── 879/
│ └── 300/
│ └── 3448793/
│ ├── 0=ocfl_object_1.0
│ ├── inventory.json
│ ├── inventory.json.sha512
│ └── v1 [...]
└── f8./
└── 05v/
└── 000/
└── f8.05v/
├── 0=ocfl_object_1.0
├── inventory.json
├── inventory.json.sha512
└── v1 [...]