Versions Compared

Key

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

...

Excerpt

 

Request URI: /path/to/some/resource/fcr:versions

Methods: GET, POST, PATCH

 


Status
titleGET
 
Get a list of the available versions of an object

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:
Content-Type: text/turtle

Body:
 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> fedora:hasVersion/resource/fcr:versions/fcr:acl>; rel="acl"
	 Link: <http://mementoweb.org/ns#TimeMap>; rel="type"
	 Link: <http://localhost:8080/rest/path/to/resource/fcr:versions/87a0a8c317f1e749515d33-cb73-4fd7-9d1d-c715eb6947e0> .
/resource>; rel="original"
	 Link: <http://localhost:8080/rest/path/to/resource>; rel="timegate"
	 Link: <http://localhost:8080/rest/path/to/resource/fcr:versions/87a0a8c317f1e749515d33-cb73-4fd7-9d1d-c715eb6947e0> fedora:hasVersionLabel "v0"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:created "2014-12-03T23:55:38.47Z"^^<httpversions>; 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/2001/XMLSchema#dateTime>02/22-rdf-syntax-ns#> .

@prefix fedora:  <http://localhost:8080/rest/path/to/resource> fedora:hasVersionfedora.info/definitions/v4/repository#> .
@prefix ldp:  <http://localhost:8080/rest/path/to/resource/fcr:versions/87a0a8c317f1e7dae533ec-b1b6-4da1-8bb9-f1964e253572> .www.w3.org/ns/ldp#> .

<http://localhost:8080/rest/path/to/resource/fcr:versions/87a0a8c317f1e7dae533ec-b1b6-4da1-8bb9-f1964e253572> fedora:hasVersionLabel "v1: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#string>XMLSchema#dateTime> ;
        fedora:createdlastModified    "20142018-1205-03T2330T21:5603:1254.863Z88Z"^^<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
subtletrue
colourGreen
title200
OK

Status
subtletrue
colourRed
title404
Not Found: This resource is not versioned or this resource is not exist.

Response: The requested resource is not available.

 



Status
titleGET
Get a previous version of an object

Request Headers:

ACCEPT  application/ld+json, 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 http://localhost:8080/rest/resource/fcr:versions/<version-label><timestamp>

Response:

Code Block
Status: HTTP/1.1 200 OK

Headers:

Response Headers:
	
	Date: Wed, 30 May 2018 21:11:01 GMT
 	ETag: W/"39f0d8a01a066771e56f70be892a39a7b505843c706475b002bad44f8e5d874b8e7c3b1d35ff9a1c"
 	Last-Modified: TueWed, 2030 May 20142018 1921:2900:1048 GMT
Content-Type 	Link: text/turtle

Body:

<http://localhost:8080/rest/resource/fcr:versions/87a0a8c317f1e72c658170-624d-40f9-96cb-21ede3392155>www.w3.org/ns/ldp#Resource>;rel="type"
 	Link: <http://fedorawww.w3.infoorg/definitions/v4/repository#primaryType> "nt:frozenNode"^^<httpns/ldp#Container>;rel="type"
 	Link: <http://www.w3.org/2001ns/XMLSchema#string> ;
   ldp#BasicContainer>;rel="type"
	Memento-Datetime: Wed, 30 May 2018 21:03:54 GMT
	Link: <http://fedora.info/definitions/v4/repository#frozenPrimaryType> "nt:folder"^^<httpmementoweb.org/ns#Memento>; rel="type"
	Link: <http://localhost:8080/static/constraints/ContainerConstraints.rdf>; rel="http://www.w3.org/2001/XMLSchema#string> ;
   ns/ldp#constrainedBy"
	Link: <http:///fedora.info/definitions/v4/repository#created> "2014-05-20T19:29:00.192Z"^^<http://www.w3.org/2001/XMLSchema#string> ;
    <http://fedora.info/definitions/v4/repository#frozenMixinTypes> "fedora:resource"^^<http://www.w3.org/2001/XMLSchema#string> , "mix:versionable"^^<http://www.w3.org/2001/XMLSchema#string> , "fedora:object"^^<httplocalhost: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"
	Allow: GET,HEAD,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: 1793

Body:


@prefix memento: <http://mementoweb.org/ns#> .
@prefix rdf: <http://www.w3.org/1999/2001/XMLSchema#string> ;
   02/22-rdf-syntax-ns#> .
@prefix fedora: <http://fedora.info/definitions/v4/repository#lastModified> "2014-05-20T19:29:10.555Z"^^<http://www.w3.org/2001/XMLSchema#string>repository#> .

<http://localhost:8080/rest/path/to/resource/fcr:versions/20180530210354>
 rdf:type ldp:RDFSource ;
 rdf:type ldp:Container ;
 <httprdf://fedora.info/definitions/v4/repository#frozenUuid> "fed529c6-2121-4b1d-83fc-cc4274563612"^^<http://www.w3.org/2001/XMLSchema#string>type fedora:Resource ;
 rdf:type ldp:BasicContainer ;
 rdf:type fedora:Container ;
 <http://fedora.info/definitions/v4/repository#lastModifiedBy> "bypassAdminfedora:created "2018-05-30T21:00:48.169Z"^^<http://www.w3.org/2001/XMLSchema#string>XMLSchema#dateTime> ;
 fedora:writable true ;
 <http://fedora.info/definitions/v4/repository#uuid>fedora:lastModified "87a0a8c317f1e72c6581702018-624d-40f9-96cb-21ede339215505-30T21:00:48.169Z"^^<http://www.w3.org/2001/XMLSchema#string>XMLSchema#dateTime> ;
 fedora:lastModifiedBy "bypassAdmin" ;
 <http://fedora.info/definitions/v4/repository#createdBy>fedora:createdBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
 rdf:type ldp:RDFSource ;
 ardf:type <http://www.jcp.org/jcr/nt/1.0frozenNode> , <http://www.jcp.org/jcr/nt/1.0base> , <http://www.jcp.org/jcr/mix/1.0referenceable> .
Status:
ldp:Container ;
 fedora:writable true .
* Connection #0 to host localhost left intact

Status
subtletrue
colourGreen
title200
OKStatus:

Status
subtletrue
colourRed
title404
Not Found: if the version or the resource does not exist

Response: The requested resource is not available.

 



Status
colourBlue
titlePOST
Create a new version of an object

Request Headers

SLUG (Required) A suggested name for the new child resource, which the repository may ignore.

Example:

Code Block
curl -X POST -H "Slug: newVersionName" http://localhost:8080/rest/path/to/resource/fcr:versions

Response:

Code Block
Status: 201 Created

 

Status:

Status
subtletrue
colourGreen
title201
Created: if a new version is created successfully

Status
subtletrue
colourRed
title404
Not Found: if the resource does not exist

Status
subtletrue
colourRed
title409
Conflict: if the version label is already in use for another version of this rexource

Response: The requested resource is not available.




Anchor
revert
revert
Status
colourBlue
titlePATCH
Revert to a previous version of an object

Example:

Code Block
curl -X PATCH http://localhost:8080/rest/path/to/resource/fcr:versions/existingVersionName

 

Response:

Code Block
Status: 204 No Content

Status:

Status
subtletrue
colourGreen
title204
No Content: if the version is reverted successfully

Status
subtletrue
colourRed
title404
Not Found: if the version does not exist

Response: The requested resource is not available.


 

Anchor
delete
delete
Request URI: /path/to/some/resource/fcr:versions/versionName

Methods: DELETE

Status
colourRed
titleDELETE
Remove a previous version of an object

Example:

Code Block
curl -X DELETE http://localhost:8080/rest/path/to/resource/fcr:versions/versionName


Response:

Code Block
Status: 204 No Content


Note

Trying to delete the current version of a resource will result in an error.  To revert to an old version of a resource, first revert to the old version using the PATCH method, and then delete the newer version.

Status:

Status
subtletrue
colourGreen
title204
No Content: if the version is reverted successfully

Status
subtletrue
colourRed
title400
Bad Request: if trying to delete the most recent version

Response: Cannot remove current version

Status
subtletrue
colourRed
title404
Not Found: if the version does not exist

Response: The requested resource is not available.

...