# Introduction

Apache Marmotta offers versioning services that keep track of any resource updates in the triple store. Versioning is transaction based, i.e. every time a transaction is committed successfully, a new version entry is created by the versioning services. Marmotta currently supports listing versions (system-wide and for a single resource) as well as inspecting "snapshots" (i.e. going back in time).

# Version Access

Marmotta provides basic access to versioning information through the /versions web service:

- /versions/list (optionally with parameters resource, offset, limit) will list all versions of the system or all versions of the specified resource
- /versions/{id} will display details about the version with the id {id}

Be aware that listing all versions of the system might be a very expensive operation on large systems and should be used with care.

# Snapshots

The Snapshot service (accessible under /snapshot) allows to access a resource as it used to be at a certain point in time. The /snapshot service accepts the following query parameters:

- resource=... - the URI of the resource of which to return the snapshot; needs to be URL-encoded; REQUIRED
- time=... - the time for which to return the snapshot; time is in ISO8601 or in GMT format and needs to be URL-encoded
- version=... - the ID of the version for which to return the snapshot

The resource parameter is always required. Either the time or the version parameter must also be given. If both are present, the time parameter takes precedence.

### Examples

Retrieve version 6 of resource http://localhost:8080/marmotta/resource/1234:

        http://localhost:8080/marmotta/snapshot?resource=http%253A%252F%252Flocalhost%253A8080%252Fmarmotta%252Fresource%252F1234&version=6

# Memento Support

In case the versioning.memento configuration property is enabled, Marmotta also provides support for the Memento specification, which allows access to earlier versions of a resource through an extension of the HTTP protocol.

In case memento support is enabled, the Marmotta resource web service will produce additional "Link:" headers for each resource request pointing back to the Memento timegate service (located at /timegate?resource=...) provided by the versioning module. Depending on the Accept-Datetime header, the timegate service will redirect to the appropriate snapshot of the resource.

Several tools exist for accessing Memento archives, e.g. the MementoFox browser extension.