Old Release

This documentation covers an old version of Fedora. Looking for another version? See all documentation.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

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

Methods: GET, POST, PATCH

 


 

GET Get a list of the available versions of an object

Request Headers:

ACCEPT  text/turtle, text/rdf+n3, application/n3, text/n3, application/rdf+xml, application/json+rdf, application/n-triples, text/html

Example:

curl -H "Accept: text/turtle" "http://localhost:8080/rest/

Response:

Status: 200 OK

Headers:
Content-Type: text/turtle

Body:
<http://localhost:8080/rest/path/to/resource> <http://fedora.info/definitions/v4/repository#hasVersion> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/jcr:rootVersion/jcr:frozenNode> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/jcr:rootVersion/jcr:frozenNode> <http://fedora.info/definitions/v4/repository#primaryType> "nt:frozenNode"^^<http://www.w3.org/2001/XMLSchema#string> ;
    <http://fedora.info/definitions/v4/repository#frozenPrimaryType> "nt:folder"^^<http://www.w3.org/2001/XMLSchema#string> ;
    <http://fedora.info/definitions/v4/repository#frozenMixinTypes> "fedora:resource"^^<http://www.w3.org/2001/XMLSchema#string> , "fedora:object"^^<http://www.w3.org/2001/XMLSchema#string> ;
    <http://fedora.info/definitions/v4/repository#frozenUuid> "19cd1832-a5d7-4965-9564-579b1684a003"^^<http://www.w3.org/2001/XMLSchema#string> ;
    <http://fedora.info/definitions/v4/repository#uuid> "87a0a8c317f1e702f0967e-c1bd-49cf-a78f-7b132fbabbb3"^^<http://www.w3.org/2001/XMLSchema#string> .

 



GET Get a previous version of an object

Request Headers:

ACCEPT  text/turtle, text/rdf+n3, application/n3, text/n3, application/rdf+xml, application/json+rdf, application/n-triples, text/html

Example:

curl http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b

Response:

Status: 200 OK Headers: Link: http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b?limit=-1&amp;offset=0;rel="first"
Content-Type: text/turtleBody:<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b> <http://fedora.info/definitions/v4/rest-api#exportsAs> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/fcr:export?format=jcr/xml> ;
 <http://fedora.info/definitions/v4/rest-api#hasVersions> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/fcr:versions> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/fcr:export?format=jcr/xml> <http://www.w3.org/2000/01/rdf-schema#label> "jcr/xml"^^<http://www.w3.org/2001/XMLSchema#string> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b> <http://www.w3.org/ns/ldp#nextPage> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b?limit=-1&amp;offset=-1> ;
 <http://www.w3.org/ns/ldp#firstPage> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b?limit=-1&amp;offset=0> ;
 <http://www.w3.org/ns/ldp#inlinedResource> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/jcr:versionLabels> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/jcr:versionLabels> <http://fedora.info/definitions/v4/repository#hasParent> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b> <http://fedora.info/definitions/v4/repository#hasChild> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/jcr:versionLabels> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/jcr:versionLabels> <http://fedora.info/definitions/v4/repository#primaryType> "nt:versionLabels"^^<http://www.w3.org/2001/XMLSchema#string> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b> <http://www.w3.org/ns/ldp#inlinedResource> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/jcr:rootVersion> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/jcr:rootVersion> <http://fedora.info/definitions/v4/repository#hasParent> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b> <http://fedora.info/definitions/v4/repository#hasChild> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/jcr:rootVersion> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/jcr:rootVersion> <http://fedora.info/definitions/v4/repository#primaryType> "nt:version"^^<http://www.w3.org/2001/XMLSchema#string> ;
 <http://fedora.info/definitions/v4/repository#created> "2013-12-12T14:31:52.41Z"^^<http://www.w3.org/2001/XMLSchema#string> ;
 <http://fedora.info/definitions/v4/repository#uuid> "85edf2a7-287d-49bd-b834-d49fbaa1ea23"^^<http://www.w3.org/2001/XMLSchema#string> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b> <http://www.w3.org/ns/ldp#membersInlined> "true"^^<http://www.w3.org/2001/XMLSchema#string> ;
 a <http://www.w3.org/ns/ldp#Container> ;
 <http://www.w3.org/ns/ldp#membershipSubject> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b> ;
 <http://www.w3.org/ns/ldp#membershipPredicate> <http://fedora.info/definitions/v4/repository#hasChild> ;
 <http://www.w3.org/ns/ldp#membershipObject> <http://www.w3.org/ns/ldp#MemberSubject> ;
 a <http://www.w3.org/ns/ldp#Page> ;
 <http://www.w3.org/ns/ldp#pageOf> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b> ;
 <http://fedora.info/definitions/v4/repository#hasParent> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f> <http://fedora.info/definitions/v4/repository#hasChild> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b> <http://www.w3.org/ns/ldp#inlinedResource> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f> <http://fedora.info/definitions/v4/repository#primaryType> "mode:versionHistoryFolder"^^<http://www.w3.org/2001/XMLSchema#string> .

<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b> <http://fedora.info/definitions/v4/repository#primaryType> "nt:versionHistory"^^<http://www.w3.org/2001/XMLSchema#string> ;
 <http://fedora.info/definitions/v4/repository#versionableUuid> "19cd1832-a5d7-4965-9564-579b1684a003"^^<http://www.w3.org/2001/XMLSchema#string> ;
 <http://fedora.info/definitions/v4/repository#uuid> "19cd1832-a5d7-4965-9564-579b1684a003"^^<http://www.w3.org/2001/XMLSchema#string> .

 



POST Create a new version of an object

Example:

curl -X POST http://localhost:8080/rest/path/to/resource/fcr:versions

Response:

Status: 204 No Content

 



POST Create a new named version of an object

Example:

curl -X POST http://localhost:8080/rest/path/to/resource/fcr:versions/newVersionName

Response:

Status: 204 No Content




PATCH Revert to a named version of an object

Example:

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

Response:

Status: 204 No Content
  • No labels