Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This document is to clarify the differences between the ideas of "deleting" a resource from Fedora and "purging" a resource from Fedora.

Delete

When you delete a resource from Fedora it is replaced by a "tombstone" that is returned when you try to access the resource.

...

Nothing is removed when the object is "deleted" instead the sidecar file fcr-root.json file is updated to change the value of the "deleted" key from "false" to "true" (as well as the "lastModifiedDate" value)

For example the above http://localhost:8080/rest/test-resource is stored in OCFL with the below layout

Expand
Code Block
.
└── ocfl-root/5ce/631/395/5ce63139564a3a617705f0169f200433debd2dd4b63b3fb583a5fe9f7de76539/
    ├── 0=ocfl_object_1.1
    ├── inventory.json
    ├── inventory.json.sha512
    ├── v1/
    │   ├── inventory.json
    │   ├── inventory.json.sha512
    │   └── content/
    │       ├── fcr-container.nt
    │       └── .fcrepo/
    │           └── fcr-root.json
    └── v2/
        ├── inventory.json
        ├── inventory.json.sha512
        └── content/
            └── .fcrepo/
                └── fcr-root.json
Version 1 being the creation of the object and version 2 being it's deletion.

Purge


Info

You CANNOT purge a resource that is part of an Archival Group. All resources inside an archival group share the same OCFL object with the actual archival group object. You can only purge the archival group object which removes all parts of the archival group.

...

In contrast to a delete, a purge completely removes the resource from your OCFL file-system. It also removes any empty parent sub-directories up to the OCFL root directory (called "ocfl-root" by default).

...

For example looking at the OCFL root directory of a respository with only the deleted resource "test-resource" before the purge.

Code Block
.
└── ocfl-root/
    ├── 0004-hashed-n-tuple-storage-layout.md
    ├── 0=ocfl_1.1
    ├── 141 <- the repository root resource
    ├── 5ce <- the deleted resource "test-resource"
    ├── extensions
    ├── ocfl_1.1.md
    ├── ocfl_extensions_1.0.md
    └── ocfl_layout.json

After purging the resource "test-resource", the OCFL root looks like this.

Code Block
.
└── ocfl-root/
    ├── 0004-hashed-n-tuple-storage-layout.md
    ├── 0=ocfl_1.1
    ├── 141 <- the repository root resource
    ├── extensions
    ├── ocfl_1.1.md
    ├── ocfl_extensions_1.0.md
    └── ocfl_layout.json

Because no other resource in the repository shared the same starting to the hash of the name, the entire directory structure was removed.