Skip to content
LITHOEN

Evidence platform and governance

Document

ADR-0034 — Sample and Measurement, and why they arrived in Phase 12

Repository path
docs/decisions/ADR-0034-sample-and-measurement-architecture.md
Size · SHA-256
4.2 KB · 46f9c1d844643fff06fa8d155766167dd68c7b535f540e64f26e023d312e71c5

Status

Accepted (Phase 12).

Context

ADR-0014 (Phase 2) recorded a decision not to build Sample and Measurement records. The reasoning was sound: the corpus held concentrations that belonged to reservoirs and to deposits, both of which are entities, and inventing a laboratory ontology for them would have been architecture in search of a subject.

Phase 12 acquired a subject. USGS Data Series 801 reports 4,857 soil samples, and in the C-horizon table 113,000 of the cells are not numbers: they are five different statements about why there is no number. There is nowhere in the Claim model to put that. A claim asserts something; a cell reading N.S. asserts that a sample was lost in shipping.

Decisions

1. Sample is a record kind, not an entity type.

The corpus has 29 entity types and did not need a thirtieth. An entity is a thing claims are made about; a sample is an observation, closer to a spatial record or a visual than to a mineral. It joins the record kinds rather than the entity vocabulary, and the ID_PATTERN is now derived from RECORD_KINDS rather than repeating it — the two had already drifted the moment sample was added.

2. Measurements live inside their sample.

Not as separate records. A sample is a collection of determinations on one material at one place, and 239 samples with 73 determinations each is 239 files rather than 17,447. The alternative would have made the store unreadable to buy a normalisation nothing needs.

3. The measurement value is a discriminated union of eight kinds.

Not a nullable number with a flag. The alternative fails in one specific way that this whole record type exists to prevent: <1 becomes 1, or 0, or null, and each is a different false statement about the same sample. The union makes the wrong thing unrepresentable rather than merely discouraged.

The vocabulary separates two questions that "missing" runs together: did the analysis run, and did it return a magnitude. Below detection answers yes and no. No sample answers no and no. One is about the soil and the other is about the shipping.

4. Every measurement keeps the source's cell verbatim.

valueAsStated was not in the first design and was added when a precision audit could not be performed without it. It is what makes the interpretation checkable by a validator rather than trusted from a script that ran once, and the same reasoning as Phase 9's source-verbatim strings and Phase 11's raw-artefact checksums.

5. Measured and computed are different, and the record says which.

Not planned, and forced by the data. Inorganic carbon in this dataset is a stoichiometric calculation from XRD mineral abundances by a stated formula; organic carbon is total carbon minus that calculation. Both sit in a row of instrument determinations with nothing in the row's shape to distinguish them. The gate found it by refusing a measured value with no method — which is the gate working as intended, on a case nobody anticipated.

6. Samples are INTERNAL, enforced by the schema.

A .refine on the schema, not a convention. Publishing raw samples would put one page per sample on the public site and assert a curation nobody performed.

7. There is no deposit field on a Sample.

The commonest way an exploration database quietly becomes a prospectivity engine is by attaching samples to deposits on proximity and then reasoning about the attachment. Making the field absent means the association cannot be made silently: it would have to be a claim, with evidence, and would face every gate a claim faces.

Consequences

The public surface gained three claims and no pages. That is the intended shape: 17,447 observations behind three sentences about what they can and cannot support.

Alternatives considered

Storing measurements as claims. Rejected. A claim is an assertion with evidence, support and assertion semantics; 17,447 of them would drown the corpus and none of them would be a scientific statement in the sense the Claim model means.

A general missing flag with a reason string. Rejected. Free text is not checkable, and the five reasons in this one dataset would have become five spellings within a year.