Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicting logical paths #453

Closed
pwinckles opened this issue Apr 29, 2020 · 3 comments
Closed

Conflicting logical paths #453

pwinckles opened this issue Apr 29, 2020 · 3 comments
Assignees
Milestone

Comments

@pwinckles
Copy link

It's possible to create an object that is impossible to recreate on disk due to logical path parts being used both as directories and files. Here's an example:

{
    "id": "o1",
    "type": "https://ocfl.io/1.0/spec/#inventory",
    "digestAlgorithm": "sha512",
    "head": "v2",
    "contentDirectory": "content",
    "fixity": {},
    "manifest": {
        "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114": [
            "v2/content/sub/path"
        ],
        "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a": [
            "v1/content/sub"
        ]
    },
    "versions": {
        "v1": {
            "created": "2020-04-29T13:04:34Z",
            "state": {
                "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a": [
                    "sub"
                ]
            }
        },
        "v2": {
            "created": "2020-04-29T13:04:35Z",
            "state": {
                "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114": [
                    "sub/path"
                ],
                "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a": [
                    "sub"
                ]
            }
        }
    }
}

In this example, logical path sub is used both as a file in the object and as a directory that contains sub/path.

There are two ways to create objects like this:

  1. Logical paths are mapped directly to content paths and the conflicting logical paths are added in separate versions.
  2. Logical paths are not mapped directly to content paths and the conflicting logical paths are added in the same or in separate versions.

In either case, it is not possible to recreate the HEAD version of the object on disk.

I don't know if the spec or implementation notes want to address this or not. It feels like clients should not allow conflicting logical paths to be created within a version state, though it may be a pain to enforce.

@zimeon
Copy link
Contributor

zimeon commented Apr 29, 2020

Good point @pwinckles! In the current definition of state and logical paths within that (https://ocfl.io/draft/spec/#version) we make restrictions so that a the state for a particular version can be unpacked onto a filesystem. I think it would be consistent to say that the state for a particular version MUST NOT have entries that conflict in this way.

(I do think it is OK to have sub in v1, sub/file in v2, and sub again in v3 -- provided that in each version there isn't the conflicting entry)

@rosy1280
Copy link
Contributor

rosy1280 commented May 5, 2020

discussed at 2020-05-05 editor's meeting

neilsjefferies added a commit that referenced this issue May 14, 2020
)

* Add text to require version state logical paths be non-conflicting

Response to #453

* Update index.html

* Update index.html

* Update validation-codes.md

* Update index.html

Add full stop

* Update validation-codes.md

* Update index.html
@zimeon
Copy link
Contributor

zimeon commented May 19, 2020

Closed by #465

@zimeon zimeon closed this as completed May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants