Skip to content

Write one sample document per resource from the service itself - #57

Merged
estebanzimanyi merged 2 commits into
masterfrom
feat/sample-documents
Aug 29, 2026
Merged

Write one sample document per resource from the service itself#57
estebanzimanyi merged 2 commits into
masterfrom
feat/sample-documents

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

mfapi -emit <dir> reads every resource the service serves, through the routing table it serves them with, and writes each answer, so a sample states what the code answers. The emitter names no collection, feature or property of its own: it reads the collections the service lists and takes the first, then that collection's features, then that feature's temporal properties, so it answers for whatever database it is pointed at.

samples/ holds the thirteen documents the conformance fixture produces, with an index naming each one, the request that produced it and the status the tier answered with. A status other than 200 is a sample too: the tier answers 501 for an acceleration under linear interpolation, since a speed that is constant on every segment has no acceleration the motion model carries.

The conformance job re-emits the set and fails when a committed document is not what the service writes, so a sample cannot drift from the code. It normalises one field, the TemporalProperties timeStamp, which the standard defines as the moment the document is written.

Stacked on #56: the TemporalProperty sample carries the type token that PR corrects, so this branch sits on top of it and owes a rebase once it squash-merges. Review #56 first; the second commit here is this PR's own.

A TemporalProperty document names its type with one of the five tokens the
standard declares — `components/schemas/temporalProperty/properties/type` admits
TBoolean, TText, TInteger, TReal and TImage — so an integer property is written
TInteger and a boolean one TBoolean, where they read TInt and TBool. The token
is the tier's internal name for the type as well, so the aggregation table and
the window dispatch carry the same spelling and a stream query over either
property resolves as before; the spellings a caller may write when storing a
property are unchanged, `tint` and `tbool` among them. A test reads the admitted
set out of the vendored schema and checks the token of every spelling the tier
accepts, which is what the suite lacked: the plural TemporalProperties document
was validated against its schema and the singular one was not.
The service writes its own sample documents: `mfapi -emit <dir>` reads every
resource it serves through the routing table it serves them with, and writes
each answer, so a sample states what the code answers rather than what its
author believed it answers. The emitter names no collection, feature or
property of its own — it reads the collections the service lists and takes the
first, then that collection's features, then that feature's temporal
properties — so it answers for whatever database it is pointed at. `samples/`
holds the thirteen documents the conformance fixture produces, with an index
naming each one, the request that produced it and the status the tier answered
with; a status other than 200 is a sample too, since the tier answers 501 for
an acceleration under linear interpolation. The conformance job re-emits the
set and fails when a committed document is not what the service writes,
normalising only the TemporalProperties `timeStamp`, which the standard
defines as the moment the document was written.
@estebanzimanyi
estebanzimanyi merged commit 85652c1 into master Aug 29, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the feat/sample-documents branch August 29, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant