Versioned Features

specdraftimplproposal

Per-feature version selection, version history, and immutable mementoes.

Scope

Adds version-selection semantics to the existing Features resources and provides a Time Map resource. The datetime query parameter is reinterpreted to select the version of each feature that intersects the supplied instant or interval; when omitted, the current version is returned. Per-version responses carry a Memento-Datetime header and the link relations defined by RFC 7089 ({@code predecessor-version}, {@code successor-version}, {@code latest-version}, {@code version-history}, {@code timemap}, {@code memento}, {@code original}). Combined with the Transactions and CRUD building blocks, mutations create new versions (or retire existing ones) instead of overwriting rows in place.

Configuration

Options

NameDefaultDescriptionTypeSince
buildingBlock
Always VERSIONED_FEATURES.
string
v2.0
enabled
false
Enable the building block?
boolean
v2.0
timeAxis
null
Time axis along which the version intervals of a collection are interpreted. {@code VALIDITY_TIME} (the validity of the feature in the real world) or {@code TRANSACTION_TIME} (when the version was recorded in the system). Must be set when the building block is enabled for a collection.
string
v4.8
mutationTime
null
Source of the timestamp used when a mutation creates or retires a version. {@code SERVER} uses the request timestamp captured by the server; {@code CLIENT} uses a timestamp supplied by the client. Must be set when the collection accepts mutations.
string
v4.8
defaultDatetime
"now"
Default for the {@code datetime} query parameter on the Features and Feature resources of a versioned collection: a date or date-time (RFC 3339) or {@code now}. With the default {@code now}, requests without {@code datetime} return the current version of each feature; a fixed date or date-time selects the versions that were valid at that time. Intervals are not allowed.
string
v4.8
retireWithModifications
[]
Property paths (in dotted schema-id notation, e.g. {@code anl} or {@code lzi.beg}) that may be modified together with a non-null value for the {@code PRIMARY_INTERVAL_END} role in a single {@code Update} action. Properties not listed cause an {@code Update} that combines retirement with other modifications to be rejected with {@code 400 Bad Request}.
array
v4.8
compositeIdPattern
null
Regex pattern that splits a composite feature id (used in {@code <fes:ResourceId rid="\u2026"/>} filters and {@code gml:id} values) into a canonical id and an expected {@code PRIMARY_INTERVAL_START} suffix. The pattern must declare two named groups: {@code id} for the canonical id (stored verbatim in the database) and {@code start} for the packed timestamp suffix (parsed via {@code compositeIdTimestampFormat}). On {@code Replace}, {@code Update} and {@code Delete}, the parsed suffix is used as an If-Unmodified-Since-style predicate: the open version's start must equal it, else the action fails with 412 Precondition Failed. On {@code Insert} the suffix is simply stripped so the canonical id is what lands in the database (this lets clients reuse the same logical feature id more than once in one transaction by attaching a unique suffix to each {@code gml:id} \u2014 XML IDs must be unique).
string
v4.8
compositeIdTimestampFormat
"yyyyMMdd'T'HHmmss'Z'"
{@code java.time.format.DateTimeFormatter}-style pattern used to parse the suffix captured by {@code compositeIdPattern}. Defaults to {@code yyyyMMdd'T'HHmmss'Z'} \u2014 the compact ISO-8601 basic-format with explicit {@code T}/{@code Z} markers, e.g. {@code 20240215T121156Z}. Ignored when {@code compositeIdPattern} is unset.
string
v4.8

This building block does not require or support any additional configuration files.

Examples


- buildingBlock: VERSIONED_FEATURES
 enabled: true
 timeAxis: VALIDITY_TIME
 mutationTime: CLIENT
 retireWithModifications:
 - anl
 compositeIdPattern: "^(?<id>DE[A-Za-z0-9]{14})(?<start>\\d{8}T\\d{6}Z)$"