Versioned Features
specdraftimplproposalPer-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 (predecessor-version, successor-version, latest-version, version-history, timemap, memento, 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
| Name | Default | Description | Type | Since |
|---|---|---|---|---|
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. VALIDITY_TIME (the validity of the feature in the real world) or 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. SERVER uses the request timestamp captured by the server; CLIENT uses a timestamp supplied by the client. Must be set when the collection accepts mutations. | string | v4.8 |
defaultDatetime | "now" | Default for the datetime query parameter on the Features and Feature resources of a versioned collection: a date or date-time (RFC 3339) or now. With the default now, requests without 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. anl or lzi.beg) that may be modified together with a non-null value for the PRIMARY_INTERVAL_END role in a single Update action. Properties not listed cause an Update that combines retirement with other modifications to be rejected with 400 Bad Request. | array | v4.8 |
compositeIdPattern | null | Regex pattern that splits a composite feature id (used in <fes:ResourceId rid="..."/> filters and gml:id values) into a canonical id and an expected PRIMARY_INTERVAL_START suffix. The pattern must declare two named groups: id for the canonical id (stored verbatim in the database) and start for the packed timestamp suffix (parsed via compositeIdTimestampFormat). On Replace, Update and 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 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 gml:id - XML IDs must be unique). | string | v4.8 |
compositeIdTimestampFormat | "yyyyMMdd'T'HHmmss'Z'" | java.time.format.DateTimeFormatter-style pattern used to parse the suffix captured by compositeIdPattern. Defaults to yyyyMMdd'T'HHmmss'Z' - the compact ISO-8601 basic-format with explicit T/Z markers, e.g. 20240215T121156Z. Ignored when 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)$"