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 <resource-URI>/fcr:versions endpoint, it is recommended that this endpoint be "discovered" by inspecting the Fedora resource's Link header of with rel="timemap" : No Format |
---|
Link: <http://localhost:8080/rest/path/to/resource/fcr:versions>; rel="timemap" |
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: Code Block |
---|
curl -H "Accept: text/turtle" http://localhost:8080/rest/path/to/resource/fcr:versions |
Response: Code Block |
---|
Status: HTTP/1.1 200 OK
Headers:
ETag: W/"671df2a47622331ffb6b70b6156526a67e5ab760"
Last-Modified: Wed, 30 May 2018 21:03:54 GMT
Link: <http://www.w3.org/ns/ldp#Resource>;rel="type"
Link: <http://www.w3.org/ns/ldp#RDFSource>;rel="type"
Link: <http://localhost:8080/rest/path/to/resource/fcr:versions/fcr:acl>; rel="acl"
Link: <http://mementoweb.org/ns#TimeMap>; rel="type"
Link: <http://localhost:8080/rest/path/to/resource>; rel="original"
Link: <http://localhost:8080/rest/path/to/resource>; rel="timegate"
Link: <http://localhost:8080/rest/path/to/resource/fcr:versions>; rel="timemap"
Vary-Post: Memento-Datetime
Allow: POST,HEAD,GET,OPTIONS,DELETE
Preference-Applied: return=representation
Vary: Prefer
Vary: Accept
Vary: Range
Vary: Accept-Encoding
Vary: Accept-Language
Content-Type: text/turtle;charset=utf-8
Content-Length: 1944
Body:
@prefix memento: <http://mementoweb.org/ns#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix fedora: <http://fedora.info/definitions/v4/repository#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
<http://localhost:8080/rest/path/to/resource/fcr:versions>
rdf:type fedora:TimeMap ;
rdf:type fedora:Resource ;
fedora:lastModifiedBy "bypassAdmin" ;
fedora:createdBy "bypassAdmin" ;
fedora:created "2018-05-30T21:00:48.169Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
fedora:lastModified "2018-05-30T21:03:54.88Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
memento:original <http://localhost:8080/rest/path/to/resource> ;
rdf:type ldp:RDFSource ;
fedora:writable true ;
ldp:contains <http://localhost:8080/rest/path/to/resource/fcr:versions/20180530210300> ;
ldp:contains <http://localhost:8080/rest/path/to/resource/fcr:versions/20180530210354> . |
Status: Status |
---|
subtle | true |
---|
colour | Green |
---|
title | 200 |
---|
| OK Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | 404 |
---|
| 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: Code Block |
---|
# Create version from current state of the object
curl -X POST http://localhost:8080/rest/path/to/resource/fcr:versions
|
Response: Code Block |
---|
HTTP/1.1 201 Created
Date: Wed, 29 Aug 2018 21:21:34 GMT
Set-Cookie: JSESSIONID=dmqpuv06yty7b0tf9y94z3rx;Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Tue, 28-Aug-2018 21:21:34 GMT
ETag: W/"f7c04eb7e3f04c17d1fc852bef5f6b030ea271e7"
Last-Modified: Wed, 29 Aug 2018 20:22:11 GMT
Link: <http://localhost:8080/static/constraints/ContainerConstraints.rdf>; rel="http://www.w3.org/ns/ldp#constrainedBy"
Link: <http://localhost:8080/rest/path/to/resource>; rel="timegate"
Link: <http://localhost:8080/rest/path/to/resource>; rel="original"
Link: <http://localhost:8080/rest/path/to/resource/fcr:versions>; rel="timemap"
Memento-Datetime: Wed, 29 Aug 2018 21:21:34 GMT
Link: <http://mementoweb.org/ns#Memento>; rel="type"
Location: http://localhost:8080/rest/path/to/resource/fcr:versions/20180829212134
Content-Type: text/plain
Content-Length: 68
Server: Jetty(9.3.1.v20150714)
http://localhost:8080/rest/versioning/v9/fcr:versions/20180829212134 |
Status: Status |
---|
| |
---|
subtle | true |
---|
colour | Green |
---|
title | 201 |
---|
| Created: if a new version is created successfully Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | 404 |
---|
| Not Found: if the version container resource does not exist |