Back to home page

EIC code displayed by LXR

 
 

    


Warning, /firebird/dex-schema/README.md is written in an unsupported language. File is not indexed.

0001 # Firebird DEX schema
0002 
0003 JSON Schema for the Firebird Data Exchange (DEX) format.
0004 
0005 - `firebird-dex-v1.schema.json` — DEX version 1.0 (current). Draft 2020-12.
0006 
0007 ## What the schema checks
0008 
0009 - File structure: `type`, `version`, `events[]`, each event has `id` and `pieces[]`.
0010 - Piece structure: `name`, `type`, `version`, `count`, `columns{}` of parallel
0011   arrays, optional `refs{}` declarations.
0012 - Known piece types (`BoxHit`, `PointTrajectory`): their required columns and
0013   type-specific payloads (`pointColumns`, ragged `points`).
0014 - Unknown piece types (extensions): base piece structure only. Extension
0015   column sets are open by design — a writer declares the columns it has.
0016 
0017 ## What the schema cannot check
0018 
0019 JSON Schema has no cross-field arithmetic, so column length consistency
0020 (scalar columns hold `count` values, flattened vector columns a whole multiple
0021 of `count`, `points` holds `count` lists) and reference validity (`refs`
0022 targets exist, index values are in range) are checked by readers:
0023 
0024 - the frontend reader raises on malformed files at load,
0025 - pyrobird tests validate converter output structurally beyond the schema.
0026 
0027 ## Format documentation
0028 
0029 The annotated format description lives in the documentation site page
0030 `docs/dex.md` (published at https://eic.github.io/firebird/dex).
0031 
0032 ## Validating a file
0033 
0034 ```bash
0035 python -c "
0036 import json, jsonschema
0037 schema = json.load(open('dex-schema/firebird-dex-v1.schema.json'))
0038 data = json.load(open('myfile.firebird.json'))
0039 jsonschema.validate(data, schema)
0040 print('valid')
0041 "
0042 ```