Data Descriptor Template: Schema, Provenance, and Release Readiness

A FAIR-style exemplar for dataset papers

Daniel Ari Friedman

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:

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.).

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.

Bar chart comparing declared row counts for the measurement and subject CSV files.
Figure 1: File inventory: declared row counts per file, from 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.

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.


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).

Flowchart from collecting fixtures through cleaning, validation, and packaging.
Figure 3: Provenance chain from the descriptor. Each box shows a declared step and its responsible agent.

5.1 Methods

  1. Collect. Generate synthetic measurement and subject tables.
  2. Clean. Normalize identifiers and bound the measurement range.
  3. Validate. Check the descriptor and reconcile its inventory with the files.
  4. 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.

Bar chart showing no findings on the fixture and errors and warnings on the broken descriptor.
Figure 4: Structural findings by severity for the fixture descriptor and its deliberately broken copy. Counts come from 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.

Table of declared and recomputed rows and matching checksums for the two fixture files.
Figure 5: Checksum and row verification for the shipped CSVs. Declared and recomputed values agree for the fixture files. The displayed readiness score comes from the structural report.

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.py

The 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).

Frictionless Data. 2023. Data Package: A Simple Container Format for Describing a Coherent Collection of Data. Open Knowledge Foundation specification. https://specs.frictionlessdata.io/data-package/.
Friedman, Daniel Ari. n.d. Example Measurements: Dataset Descriptor. Machine-readable descriptor and public synthetic fixtures. https://github.com/docxology/template_data_descriptor/tree/14dd51b134df6ad4406a5773dc198a2860409607/data.
Gebru, Timnit, Jamie Morgenstern, Briana Vecchione, et al. 2021. “Datasheets for Datasets.” Communications of the ACM 64 (12): 86–92. https://doi.org/10.1145/3458723.
Moreau, Luc, and Paolo Missier. 2013. PROV-DM: The PROV Data Model. {W3C} Recommendation. World Wide Web Consortium (W3C). https://www.w3.org/TR/prov-dm/.
Wilkinson, Mark D., Michel Dumontier, IJsbrand Jan Aalbersberg, et al. 2016. “The FAIR Guiding Principles for Scientific Data Management and Stewardship.” Scientific Data 3: 160018. https://doi.org/10.1038/sdata.2016.18.