Versioning in Fedora is composed of three specific types of resources - a versionable resource (a LDPRv), a versions container (a LDPCv), and the actual versioned resource (a LDPRm)- and a variety of strategies to interact with these resources. Each type of resource and the HTTP methods that can be used on them are discussed below.
Working with a versionable resource (a LDPRv)All (regular) resources - see RESTful HTTP API - Containers - are automatically versionable. Request URI: /path/to/resource Methods: GET Retrieve the versioned resource from a specific point in time.For more details about Fedora's datetime negotiation behaviors, see Memento Datetime Negotiation Algorithm. Request Headers: ACCEPT-datetime An RFC-1123 Date. (E.g. "Wed, 30 May 2018 23:02:44 GMT") Example:
Response:
Status: 302 Found Bad Request: Accept-Datetime header not properly formatted per RFC-1123 Unacceptable: No appropriate versioned resource found for the supplied Accept-Datetime value |
Working with a versions container (a LDPCv)Request URI: /path/to/resource/fcr:versions Methods: GET, POST Get a list of the available versions of an objectAlthough Fedora resources currently expose their "versions container" at the
Request Headers: ACCEPT application/ld+json, application/link-format, application/n-triples, application/rdf+xml, application/x-turtle, application/xhtml+xml, application/xml, text/html, text/n3, text/plain, text/rdf+n3, text/turtle Example:
Response:
Status: OK Not Found: Versions container resource does not exist. Create a new versioned resource (a new LDPRm)Versions are created such that the current time will be used by default and the current state of the versionable resource will be preserved. Any specified body will be ignored. Example:
Response:
Status: Created: if a new version is created successfully Not Found: if the version container resource does not exist |
Working with a versioned resource (a LDPRm)Request URI: /path/to/resource/fcr:versions/<timestamp> Methods: GET Get a specific versioned resourceRequest Headers: ACCEPT application/ld+json, application/link-format, application/n-triples, application/rdf+xml, application/x-turtle, application/xhtml+xml, application/xml, text/html, text/n3, text/plain, text/rdf+n3, text/turtle Example:
Response:
Status: OK Not Found: Versions container resource does not exist. |