Table of Contents |
---|
Some Definitions
jcr - java content repository http://www.day.com/day/en/products/jcr.html; used by fcrepo4 for storing object structure and content
...
namespace - JCR nodes MAY have a namespace component to their identifier. Unlike fcrepo 3.x, a namespace prefix must be explicitly registered before it can be used. (I assume we can create nodes with the fully-qualified namespace without registering it?)
External-ish services
/rest/fcr:sitemap
- GET retrieve a sitemap of all the "fedora:object" in the repository (wrapped as a sitemap index, pointing to other sitemaps..)
...
/rest/fcr:nextPID
- POST mints an ID
Nodes
/rest/{path}
- GET describe object
- POST create a new node of QueryParam "mixin" at {path}
- POST (with an application/sparql-update payload)
...
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 |
Versioning
/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
/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 |
Export
/rest/{path}/fcr:export?format={format}
- GET an export of the (tree?) under the \{path\}
...
Code Block |
---|
GET /rest/objects/sufia:123456789/fcr:export retrieve a JCR/XML export of the content under /objects/sufia:123456789 POST /rest/objects/fcr:import with the request body retrieved as above add sufia:123456789 to the tree at /objects, with all its properties, child nodes, etc POST /rest/fcr:importand this works too |
Transactions
/rest/fcr:tx
- POST create a new transaction session
...
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 |
Relationships
See this fcrepo3 discussion: Supporting the Semantic Web and Linked Data
...