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: VG counts ≤ bins-per-chunk, manifests reference live chunks/fragments, cross-chunk links land in existing chunks, per-level vertex counts agree with |
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 group has a
zarr.jsonwith a recognized"zv_array"discriminator; chunk keys are valid N-tuples of non-negative integers; the manifest blobobject_index/ datadecodes without truncation.Metadata:
zv_version >= "0.7.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).Consistency: every per-chunk
vertex_fragments/<chunk>decodes to aFragmentIndexwhose ranges land withinvertices/<chunk>row bounds; manifest blocks reference fragments that exist; CCL records reference chunks present at the relevant level.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 prefix (
resolution_<n>:), the array or chunk involved, and the failure mode.
13.4 Compatibility¶
OME-Zarr — ZV 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. Earlier ZV versions (pre-0.4) targeted Zarr v2; those stores are not readable by current implementations.
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. ZV does not ship a TRX reader/writer; converters live in
zarr-vectors-tools.