# Data dictionary for reporting-field aggregates

## Source and units of observation

The input is an unchanged JSON snapshot of ChemVerify's public export. Each element in `samples` is a sample record. Each element in a sample's `reports` array is a report record. Each element in a report's `results` array is a result row. Protocol URLs identify sample records in this snapshot. Report references and report URLs each identify report records. Result rows use their nested position and have no explicit identifier in the source. [ChemVerify dataset](https://www.chemverify.com/tests) · [JSON export](https://www.chemverify.com/tests/data.json)

The analysis includes all records and changes no raw data. It measures data availability in the export and makes no assessment of fields on the linked original reports. The file `snapshot-metadata.json` identifies the byte-for-byte source snapshot.

## Source fields used in the article

| Level | Source field | Definition for this analysis |
| --- | --- | --- |
| Sample | `protocol` | Public protocol URL used to identify one sample entry. |
| Sample | `label_batch_number` | Batch identifier recorded from the label, where populated. |
| Sample | `label_quantity_mg` | Quantity in milligrams recorded from the label, where populated. |
| Sample | `received_at`, `sent_to_lab_at` | Source calendar date strings for receipt and dispatch to the lab, where populated. |
| Sample | `analysed_at` | Calendar date on the sample entry. The earliest of these differs from the earliest nested report date. |
| Sample | `vendor_slug`, `laboratory` | Recorded vendor identifier and laboratory name. Used to describe the sample coverage. |
| Report | `reference`, `report_url` | Report reference and link as supplied by ChemVerify. Availability counts presence of a link string. |
| Report | `tested_at` | Calendar date on the individual report entry. |
| Report and result | `method` | Source method label at its own record level. Report and result labels can differ. |
| Result | `measurand` | Export category string, with `null` for unclassified rows. |
| Result | `value`, `unit` | Numeric field and unit as exported. A finite JSON number counts as numeric. |
| Result | `comparator` | Relation code as exported. `eq` means equal, `lt` means less than, and `gt` means greater than when paired with a number. |
| Result | `verdict` | Categorical result code as exported, such as `not_detected` or `pass`. Distinct from the top-level sample verdict. |
| Result | `uncertainty` | Uncertainty field as exported. All values in this snapshot are JSON `null`. |

## `field-availability.csv`

| Column | Meaning |
| --- | --- |
| `level` | One of `sample`, `report` or `result`. |
| `field` | A JSON key found at this level. |
| `records` | Total rows at this level, 28, 104 or 216. |
| `populated` | Records with the key present and a non-null, nonempty value. Zero counts as populated. |
| `json_null` | Records with the key present and a JSON `null` value. |
| `missing_key` | Records without the key. |
| `empty_string_or_container` | Records with a blank or whitespace-only string, empty array or empty object. |
| `numeric_zero` | Subset of populated records whose value is the number zero. |

The four availability categories `populated`, `json_null`, `missing_key` and `empty_string_or_container` sum to the denominator per field. `numeric_zero` is a subset.

## `result-status.csv`

`status` is a mutually exclusive result classification. `records` is the number of result rows in that class. `denominator` is all 216 result rows. A finite numeric value takes precedence in classification. A nonnumeric row is grouped by its verdict. The numeric equality and inequality codes retain the original comparator. No result values are converted to zero.

## `measurand-coverage.csv`

`measurand` uses the original category string or the display value `JSON null`. `samples_with_category` and `reports_with_category` count distinct parents with at least one result in that category. These parent counts can overlap across category rows. `results` counts result rows in the category. `numeric_value`, `json_null_value`, `unit_populated`, `uncertainty_populated` and the status columns are counts within that category.

## `summary.json`

The summary records source identity, retrieval time and hash, cohort sizes and date ranges, the number of reports per sample, the number of results per report, numeric-result coverage, comparator counts and the rows from each CSV. Values are counts unless the field names specify a date, URL, status or Boolean.
