Data Schema

A data schema defines the fields, types, units, allowed values, and relationships that make a dataset interpretable. Without a schema, preprocessing and evaluation can silently change the task.

A simple dataset can be viewed as rows and typed fields:

where is a column or field name and is the value for row .

Schema Elements

  • Field name and semantic meaning.
  • Data type: numeric, categorical, ordinal, text, sequence, graph, coordinate, timestamp, or identifier.
  • Unit and scale.
  • Missing-value policy.
  • Censoring, weak-label, and unknown-label policy.
  • Allowed value range or vocabulary.
  • Entity relationships and keys.
  • Version and source.

Schema Contract

A useful schema distinguishes identity, input, label, metadata, and split fields.

Field classMeaningCommon risk
entity key molecule, protein, document, user, assay, structure idleaks duplicates or grouping
input features available to the modelincludes post-label information
label prediction targetunit/censoring/threshold ambiguity
metadata source, batch, time, protocolconfounding or leakage
split unit grouping for evaluationrow split hides related examples

The schema should say which fields are allowed at inference time. A field can be valid metadata but invalid model input.

Type and Unit Examples

Data kindSchema detail to record
moleculeidentifier type, salt/protonation handling, canonicalization policy
protein sequencealphabet, unknown residue policy, isoform or fragment boundary
structurecoordinate frame, missing residues/atoms, resolution or prediction source
assay labelunit, transform, censoring, target, protocol
text/documentsource, timestamp, section, chunking policy
image/videoresolution, color/channel convention, frame sampling

Inference Availability

For each field, ask whether it exists before prediction.

FieldUse as input?Reason
raw measurement used to derive labelnotarget leakage
assay/source batchmaybecan improve in-domain but harm transfer claim
molecule idusually nomemorization risk
public descriptor computable from inputyesreproducible at inference
split groupnoevaluation metadata only

Schema Versioning

Schema changes can change the task even when file names stay the same.

ChangeWhy it matters
unit conversiontarget scale changes
threshold changeclass boundary changes
missing-value encodingmodel may learn missingness artifact
canonicalization updateduplicates and splits can change
label harmonizationcomparable assays may be merged or separated

Why It Matters

  • Units can change the target without changing the column name.
  • Identifiers can leak split, batch, source, target, or label information.
  • Categorical vocabularies can drift between train and deployment.
  • Nested objects such as molecules, sequences, structures, and assays require schema-level relationships.

Checks

  • What is one row or example?
  • Which fields are identifiers rather than predictive signals?
  • Which fields are available at inference time?
  • Are units, transforms, and censoring rules explicit?
  • Are missing labels and weak labels encoded separately from true negatives?
  • Can another person reconstruct the same model-ready table?
  • Are identifiers and split fields excluded from model inputs unless explicitly justified?
  • Is the schema version tied to the dataset version and preprocessing contract?