1 Abstract
This exemplar demonstrates a data descriptor
workflow in which the schema, file inventory, provenance chain, license
boundary, and validation gate are treated as first-class research
artifacts rather than afterthoughts. It ships a public synthetic
measurement and subject tables and a machine-readable descriptor
(data/example_descriptor.json) that declares each file’s
media type, sha256 checksum, and row count alongside a typed data
dictionary. The validation library checks the descriptor’s shape and
recomputes the checksum and row count for each available file. It can
also generate a metadata-only manifest for release review. The synthetic
fixtures demonstrate how to describe and verify a dataset release.
2 Introduction
A data descriptor records what a dataset contains, how it was produced, how it is licensed, and which quality checks its release supports. The FAIR guiding principles — Findable, Accessible, Interoperable, Reusable (Wilkinson et al. 2016) — frame why this matters: a dataset is only reusable to the extent that its structure and provenance are legible to both humans and machines. Datasheets and the Data Package specification provide examples of structured dataset documentation and machine-readable packaging (Gebru et al. 2021; Frictionless Data 2023).
2.1 What this template provides
This exemplar packages the recurring moving parts of a data descriptor so that a fork can start from a working, tested baseline:
- A schema / data dictionary: named fields with declared types, nullability, units, and value constraints (patterns, enumerations, numeric bounds).
- A file inventory: each shipped file with its media type, a sha256 checksum, and a row count.
- A provenance chain: the ordered steps and agents that produced the release.
- A license boundary: an explicit reuse license, and the discipline of publishing metadata and checksums rather than bundling restricted bytes.
- A validation gate: a tested library that rejects malformed, unsafe, or incomplete descriptors and verifies declared checksums against real bytes.
2.2 Scope and honesty
The checked-in synthetic dataset enables local replay of schema and byte checks. Its observed values provide evidence about the release workflow. A fork should adapt its descriptor, byte readers, tests, and figures to the structure and media types of the dataset it intends to publish.
3 Data description
The demonstration dataset consists of two comma-separated files under
data/fixtures/, described by the machine-readable
descriptor data/example_descriptor.json (Friedman,
n.d.).
fixtures/measurements.csv— one row per synthetic sample, with a bounded measurement, an assignment group, a capture instrument, and a collection date.fixtures/subjects.csv— one row per synthetic subject, with an enrollment site and date. Each measurement references a subject through thesubject_idforeign key. The subject table carries its own enrollment fields. The descriptor’s field dictionary covers the measurement table.
3.1 File inventory
The descriptor declares each file’s media type, sha256 checksum, and
row count. The file inventory figure shows the declared row counts, read
directly from the descriptor by file_inventory_rows() in
src/data_descriptor/figures.py and plotted by
scripts/generate_figures.py.
file_inventory_rows(). The
measurement table is the larger of the two files; the subject table is
its dimension companion. Both are declared as text/csv. The
bars show the counts declared in the descriptor. Byte verification
compares these declarations with actual file rows.File paths in the descriptor resolve relative to its directory. Rerun the figure producer after changing the descriptor or fixtures so the embedded figures and their provenance registry reflect the same inputs.
3.2 Release boundary
The descriptor is deliberately a metadata object. For a real dataset, the descriptor and its checksums can be published even when the underlying bytes are access-controlled: the checksums let a downstream user verify integrity once they obtain the files through the appropriate channel. In this template the fixture bytes are public and small, so they are shipped alongside the descriptor and used to demonstrate end-to-end verification.
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.
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:
sample_id(string, not null) — the primary key, constrained to the pattern^S[0-9]{3}$.subject_id(string, not null) — foreign key intofixtures/subjects.csv, constrained to^P[0-9]{3}$.group(category, not null) — a closed enumeration ofcontrolandtreatment.value(number, not null) — the measurement, carrying the unitnormalized_scoreand numeric bounds[0, 1].collected_on(date, not null) — an ISO-8601 collection date.instrument(category, not null) — a closed enumeration ofsensor_aandsensor_b.
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.
5 Provenance
The descriptor records each step in order and names its responsible agent. The W3C PROV model provides a broader vocabulary for describing entities, activities, and agents (Moreau and Missier 2013).
5.1 Methods
- Collect. Generate synthetic measurement and subject tables.
- Clean. Normalize identifiers and bound the measurement range.
- Validate. Check the descriptor and reconcile its inventory with the files.
- Package. Emit the metadata-only release manifest.
The descriptor records the first two steps as fixture provenance. The standalone checkout supplies the resulting CSVs as inputs and replays validation and packaging from those bytes. The validator reports a warning when fewer than two provenance steps are declared. When adapting the template, name the concrete tools, versions, operators, and inputs used to create the files being released.
6 Quality validation
Structural validation checks descriptor declarations. Byte verification compares the inventory with the available files. Each check yields its own evidence.
6.1 Structural checks and negative control
validate_descriptor() returns severity-tagged findings
for problems such as missing required keys, unsafe or duplicate paths,
malformed checksums, malformed fields, inconsistent constraints, missing
primary keys, and a thin provenance chain. The readiness score penalizes
errors and warnings from these structural checks.
The quality gate figure compares the example descriptor with a copy
modified by demo_broken_descriptor(). The copy drops the
license, changes a checksum to an invalid value, sets one row count to
zero, and removes a measurement unit.
severity_counts().6.2 Checking the file inventory
verify_descriptor_files() recomputes the SHA-256 digest
and data-row count for each accessible file. It reports
verified, checksum_mismatch,
row_mismatch, unsupported_media,
unsafe_path, or absent. A file omitted from a
metadata-only release remains absent until the recipient obtains the
bytes through the appropriate channel.
6.3 Release review
build_release_bundle_manifest() assembles a JSON-ready
record with the schema fingerprint, full descriptor hash, file digests
and row counts, field constraint summaries, provenance, and the
structural readiness verdict. The manifest uses descriptor metadata. Use
the separate file verification results to confirm whether the local
bytes match it.
The tests cover descriptor validation, order-independent schema fingerprints, checksum and row-count mismatch controls, figure-data preparation, and end-to-end generation of PNGs and release artifacts.
7 Usage notes
7.1 Regenerating the artifacts
Run these commands from the standalone project root with uv installed.
uv run --locked python scripts/generate_figures.py
uv run --locked python scripts/generate_release_artifacts.pyThe first command updates the manuscript PNGs and publishes their
mirrors and registry under output/figures/. The second
command writes a descriptor report, field-constraint summary, and
metadata-only release manifest to output/reports/. Inspect
the descriptor report’s findings, then use the checksum verification
results to check the files.
7.2 Adapting the descriptor
Replace the fixture-specific inventory, data dictionary, primary key, license, and provenance when adapting the project. Compute hashes and row counts from the bytes intended for release. Keep restricted files in their authorized storage and record the access conditions in the dataset documentation. Retain negative controls that detect changed bytes and invalid descriptors.
The metadata manifest supports review. An actual publication receipt requires explicit owner approval bound to the artifact digest.
8 References
The descriptor and synthetic fixture files accompany the exemplar (Friedman, n.d.). The documentation draws on the FAIR principles (Wilkinson et al. 2016), datasheets for datasets (Gebru et al. 2021), the W3C provenance model (Moreau and Missier 2013), and the Data Package specification (Frictionless Data 2023).