Versions Compared

Key

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

...

Code Block
POST /rest/fcr:new
  create a new child object with an automatically generated unique identifier
 
POST /rest/objects/fcr:new
  create a new child object under /objects with an automatically generated unique identifier
 
POST /rest/objects/sufia:123456789?mixin=fedora:datastream
  create a new child datastream for /objects/sufia:123456789 with an automatically generated unique identifier

 

Binary Content

/rest/{path}/fcr:content

- GET the bytes from {path}/jcr:content/jcr:data
- POST create a new nt:file at {path} with a binary value of the request entity
- PUT mutate the binary value of the nt:file at {path}
- DELETE remove the jcr:content child from the node at {path}

...

Code Block
GET /rest/objects/sufia:123456789/DS1/fcr:content
  get the binary content of DS1
 
POST /rest/objects/sufia:123456789/THUMBNAIL/fcr:content (with a request body)
  add the binary content from the request body to THUMBNAIL
 
PUT /rest/objects/sufia:123456789/THUMBNAIL/fcr:content (with a request body)
  update the binary content in the THUMBNAIL
 
DELETE /rest/objects/sufia:123456789/THUMBNAIL/fcr:content
  remove the binary content from THUMBNAIL (but leave the JCR node there..)
 
PATCH /restobject /objects/sufia:123456789/THUMBNAIL/fcr:content
  (I assume PATCH will work.. that'd be pretty cool there)

 

/rest/{path}/fcr:new/fcr:content
- POST create a new nt:file under {path} with a binary value of the request entity

Code Block
POST /rest/objects/sufia:123456789/fcr:new/fcr:content
  create a new child datastream (with an automatically generated unique identifier) with the content provided by the request body

Datastream Batch Operations

/rest/{path}/fcr:datastreams is only for batch DS operations
- GET
- POST
- DELETE

Code Block
GET /rest/objects/sufia:123456789/fcr:datastreams?dsid=DC&dsid=RELS-EXT&dsid=CONTENT_METADATA
  receive a multipart/mixed response of the 3 named datastreams under /objects/sufia:123456789
 
POST /rest/objects/sufia:123456789/fcr:datastreams (with a multipart body)
  create any number of datastreams under /objects/sufia:123456789
 
DELETE /rest/objects/sufia:123456789/fcr:datastreams?dsid=THUMBNAIL&dsid=CONTENT
  delete the two named datastreams under /objects/sufia:123456789

Fixity

/rest/{path}/fcr:fixity
- GET get the fixity report for the nt:file at {path}

Code Block
GET /rest/objects/sufia:123456789/THUMBNAIL/fcr:fixity
  retrieve the fixity report for the /objects/sufia:123456789/THUMBNAIL node

Versioning

Warning

Versioning is not fully implemented in the Fedora 4 alpha

 

/rest/{path}/fcr:versions
- GET the version history of the nt:file or the nt:folder (as appropriate) at {path}

Code Block
GET /rest/objects/sufia:123456789/fcr:versions
  get the version history of /objects/sufia:123456789 fedora object (not sure what the response looks like, though)
 
GET /rest/objects/sufia:123456789/THUMBNAIL/fcr:versions
  get the version history of the THUMBNAIL datastream
 
POST /rest/objects/sufia:123456789/THUMBNAIL/fcr:versions/XYZ
  tag the current verison of /objects/sufia:123456789/THUMBNAIL with the version label XYZ
GET /rest/objects/sufia:123456789/THUMBNAIL/fcr:content?version=XYZ
  get the jcr:content@jcr:data of  /objects/sufia:123456789/THUMBNAIL with version id 'XYZ'
 
GET /rest/objects/sufia:123456789/fcr:describe?version=XYZ
  get the profile/description of /objects/sufia:123456789 with version id 'XYZ'

 

Datastream Batch Operations

/rest/{path}/fcr:datastreams is only for batch DS operations
- GET
- POST
- DELETE

Code Block
GET /rest/objects/sufia:123456789/fcr:datastreams?dsid=DC&dsid=RELS-EXT&dsid=CONTENT_METADATA
  receive a multipart/mixed response of the 3 named datastreams under /objects/sufia:123456789
 
POST /rest/objects/sufia:123456789/fcr:datastreams (with a multipart body)
  create any number of datastreams under /objects/sufia:123456789
 
DELETE /rest/objects/sufia:123456789/fcr:datastreams?dsid=THUMBNAIL&dsid=CONTENT
  delete the two named datastreams under /objects/sufia:123456789

 

Fixity

...

Code Block
GET /rest/objects/sufia:123456789/THUMBNAIL/fcr:fixity
  retrieve the fixity report for the /objects/sufia:123456789/THUMBNAIL node

Export

/rest/{path}/fcr:export?format={format}
 
- GET an export of the (tree?) under the \{path\}

...

Code Block
POST /rest/fcr:tx
  the Location header sends you to the repository scoped by the transaction you requested (e.g. Location: /rest/tx:123456)
 
POST /rest/tx:123456/fcr:new
  you can use that transaction ID at the beginning of (most) requests to execute that action within the context of the transaction
 
POST /rest/tx:123456/fcr:tx/fcr:commit
  and then save the transaction. Any operations you made within the scope of the transaction will be applied together, meaning if any of them fail, the whole transaction will fail.
 
POST /rest/tx:123456/fcr:tx/fcr:rollback
  roll it back and forget it ever happened

Workspaces

Warning

The Fedora 4 workspace implementation is in heavy flux.

 

/rest/fcr:workspaces
 
 - GET /rest/fcr:workspaces/{workspace path}
  - POST /rest/fcr:workspaces/{workspace path}

 

Code Block
POST /rest/fcr:workspaces/abc
  create the workspace "abc" 
 
GET /rest/workspace:abc/{path/to/object}
  you can use the workspace identifier at the beginning of (most) requests, just like transactions
 

 

Relationships

See this fcrepo3 discussion: Supporting the Semantic Web and Linked Data

...

/rest/fcr:namespaces
- GET list the registered namespaces
/rest/fcr:namespaces/{prefix} - POST (with a request body for the URI the namespace prefix should resolve to)
- POST create the namespace prefixsparql update payload)

/rest/{path/to/object}/fcr:nextPIDpid
- POST mints an IDa new identifier at the given path