13. Conformance and Validation¶
13.1 Conformance Levels¶
Validation is cumulative — level N implies levels 1..N-1 pass first.
The reference implementation lives in zarr_vectors.validate.*; each
level corresponds to one submodule.
Level |
Submodule |
Checks |
|---|---|---|
1 |
|
Required filesystem layout: |
2 |
|
Root and per-level metadata schema (LinkML); conventions / capability tokens are recognized. |
3 |
|
Cross-array internal consistency: fragment counts ≤ bins-per-chunk, manifests reference live chunks/fragments, every link array’s name parses as a valid offsets segment, every |
4 |
|
Convention compliance: |
5 |
|
Multi-resolution coherence across the pyramid: nested |
The unified entry point is zarr_vectors.validate.validate(path, level=N); the result is a ValidationResult carrying passes,
warnings, and errors per check.
13.2 Validation Rules¶
Within each level, the implementation runs a fixed battery of checks. A representative (non-exhaustive) sample:
Structural: every present array or group has a
zarr.jsonwith a recognized"zv_array"discriminator; every name under alinks/<delta>/orlink_attributes/<name>/<delta>/group parses as a valid offsets segment for the family’slink_widthandsid_ndim;chunk_grid_origin, where present, hassid_ndimentries;object_index/manifestsdecodes without truncation.Metadata:
zv_version >= "0.9.0";chunk_shapelength matchessid_ndim;links_convention,object_index_convention,cross_chunk_strategy,cross_level_storageare in the canonical enumerations;format_capabilitiestokens are recognized (fragment_index,shared_fragments,preserved_object_ids,multiscale_links) — an unrecognized token is a validator finding, not grounds for a reader to fail, since the token set is open (Appendix H).object_index’slayoutequals"vlen_manifests_v1"; any other value MUST cause the store to be rejected outright rather than read on a best-effort basis. An unrecognized container discriminator means the store was written to a contract this document does not describe, and guessing at it yields plausible wrong answers instead of an error.Consistency: every
vertex_fragmentscell decodes to aFragmentIndexwhose ranges land within the row bounds of theverticescell at the same coordinate; manifest blocks reference fragments that exist;nonempty_chunksagrees with the cells actually present. For every populated link cell: row width islink_width + (1 if has_perm else 0)and the byte length is an exact multiple of one row;has_permequals what the family policy implies (§10.6.5); everyvi_kis within the vertex count of chunksrc + o_k, and that chunk exists at the endpoint’s level. The all-zero offsets array atdelta = 0has alink_fragmentscell for every cell it populates, and no other array has one. For every parallellink_attributes/<name>/<delta>/<offsets>cell at the matching coordinate, row count equals the link cell’s record count.Conformance: geometry-specific rules from
GEOMETRY_LINK_REQ— e.g.meshrequireslinks_convention == "explicit";streamlinerequiresimplicit_sequential.Multi-resolution: per-level
chunk_shape(if set) is a positive integer multiple of root; per-levelbin_shapedivides per-levelchunk_shape;preserves_object_idslevels carryinherited_num_objects.
13.3 Validation Tools¶
Reference validator:
zarr_vectors.validate.validate(store, level=N)returns aValidationResultwithpassed,warnings, anderrorslists.LinkML schema: the authoritative metadata schema is
schema/zarr_vectors.linkml.yamlin the zarr-vectors-py package. External tools may generate JSON Schema / Pydantic / SQLAlchemy artifacts from it.Error reporting: each result entry is a single-line string identifying the level (
<n>:), the array or chunk involved, and the failure mode.
13.4 Compatibility¶
OME-Zarr — Zarr Vectors reuses NGFF axes (RFC 4) and coordinate transformations (RFC 5); a level group’s
zarr.jsoncarries the samemultiscalesblock an OME-Zarr image pyramid would, so generic NGFF tools can at least enumerate the levels and read units.Zarr — only Zarr v3 is supported.
TRX — when
sid_ndimcollapses to 1 and the store has a single spatial chunk, the layout aligns conceptually with TRX (positionsoffsets + per-vertex / per-streamline / per-group data); see §14.8 for the TRX-aligned example. Zarr Vectors does not ship a TRX reader/writer; converters live in
zarr-vectors-tools.