Skip to content

Instantly share code, notes, and snippets.

@escowles
Last active September 21, 2017 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save escowles/69b8aeac25e4a3839df0710e03378c6a to your computer and use it in GitHub Desktop.
Save escowles/69b8aeac25e4a3839df0710e03378c6a to your computer and use it in GitHub Desktop.
  1. Check if a resource is versionable and discover the TimeMap/LDPCv
    1. HEAD on the LDPR: Link rel="type" http://fedora.info/definitions/fcrepo#VersionedResource indicates versioning support, Link rel="timemap" points to LDPCv/TimeMap
  2. Check if we can create versions
    1. OPTIONS on LDPCv/TimeMap: Allow: POST indicates that versions can be created
  3. Create a new version
    1. POST to LDPCv/TimeMap with Memento-Datetime header and body to create a historic version with the specified body and datetime
    2. POST to LDPCv/TimeMap with a body and no Memento-Datetime header to create a version with the specified body and the current datetime
    3. POST to LDPCv/TimeMap with Memento-Datetime header and no body to create a historic version with the current state of the LDPRv and the specified datetime
    4. POST to the LDPCv/TimeMap with no Memento-Datetime header or body to create version with current state of the resource and the resource's last-modified date as the datetime
  4. List existing versions:
    1. GET to LDPCv/TimeMap with Accept: application/link-format for link-value serialization
    2. GET to LDPCv/TimeMap without Accept header (or with an RDF type) for an RDF serialization
  5. Retrieve an existing version:
    1. GET to LDPRv/TimeGate with Accept-Datetime header
    2. GET to LDPRm/Memento (if the LDPRm/Memento has its own URI)
  6. Delete an existing version:
    1. DELETE to LDPRm/Memento
  7. Restore an existing version:
    1. PUT to LDPRv/TimeGate with Memento-Datetime header indicating the version to restore (conflicts with LDP)
    2. PATCH to LDPRv/TimeGate with no body and Memento-Datetime header indicating the version to restore
    3. Or: PUT to LDPRv/TimeGate with header (can't be Content-Location, but something like it) pointing to the LDPRm/Memento URI to indicate the version to restore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment