Versions Compared

Key

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

...

Excerpt
Within Fedora 4, snapshots of the current state of an object may be saved into the version history.  The properties or content of a node saved in these versions may be accessed later to serve as a historical record of the object.  Future feature development may allow for easy export of the entire history or other useful actions.

Enabling Versioning

By default, nodes do not have the mix:versionable mixin, which means that they do not have any versioning triples, or versions listed.  When you make a request to create a version, the mix:versionable mixin is added to that node automatically.

This mixin can also be added manually using SPARQL Update:

Code Block
languagebash
titleEnable Versioning via the REST API
echo "insert data { <> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.jcp.org/jcr/mix/1.0versionable> . }" \
| curl -X PATCH --upload-file - http://localhost:8080/rest/path/to/object 

Enabling versioning by default for all nodes is incompatible with read/write filesystem federation.  If you are not using filesystem federation (or only read-only), you can make all nodes versionable by default.

Creating versions

When you wish to save a snapshot of the current version of a node to the version history you can use the REST API.  When saving these versions you must provide a label that both serves to easily differentiate a version from another and allows easy retrieval of that version.

...