4 Schema and data dictionary

The descriptor’s fields list is the dataset’s data dictionary: it names each column of the primary measurement table and declares its type, nullability, optional unit, and value constraints. The schema figure renders this dictionary from the descriptor via schema_table_rows() in src/data_descriptor/figures.py.

Table listing measurement fields, types, nullability, units, and declared constraints.
Figure 2: Field schema / data dictionary: one row per declared field, with type, nullability, unit, and a compact constraint label, from schema_table_rows(). Identifier fields carry regular-expression patterns; the categorical fields carry closed enumerations; the quantitative field carries a unit and numeric bounds. The table is generated from data/example_descriptor.json.

4.1 Field contract

The declared fields exercise the constraint vocabulary the validator understands:

4.2 Schema fingerprint

descriptor_fingerprint() reduces the field list to a stable, order-independent sha256 fingerprint over (name, type, nullable) triples. Reordering the fields leaves the fingerprint unchanged, so two descriptors with the same schema hash identically regardless of authoring order — the property is asserted directly in the test suite. The fingerprint is what lets a release manifest reference “the field shape” without depending on authoring order. Units, bounds, descriptions, patterns, and allowed values fall outside this fingerprint. The release manifest separately records a hash of the full descriptor.

4.3 Constraint validation

The validator flags quantitative fields that lack a unit, categorical fields that lack allowed values, enumerations that are present but empty, numeric bounds where the minimum exceeds the maximum, and patterns declared on non-text fields. The shipped descriptor passes these checks. Field constraints are checked as declarations. Byte verification counts rows and checks digests, leaving cell values, key uniqueness, and foreign-key membership to dataset-specific checks.