Schema & Mappings¶
The converter is schema-driven: the DistOPF CSV format is defined in LinkML YAML
under src/cimhub_distopf/schema/, and that schema is the single source of truth for
both the data structure and how each CSV column maps to CIM. The full, column-by-column
reference is generated from this schema and lives under
Schema Reference.
Importer / Exporter structure¶
LinkML YAML → distopf_schema.py → GraphModel → DistopfReader / DistopfWriter
↕
DistopfImporter / DistopfExporter
- Export walks a CIM
FeederModel, dispatches each object to its registered converter, and writes the per-type DistOPF CSV files. See Export. - Import reads a DistOPF case directory into typed LinkML records with
DistopfReader. See Import (CIM construction is a work in progress).
Reading the mappings¶
Every slot in the schema can carry mapping annotations that document how a DistOPF CSV column corresponds to a CIM class/field:
exact_mappings¶
A one-to-one correspondence: the CSV column and the CIM attribute represent the same
physical quantity (subject only to unit conversion, e.g. the per-unit ↔ SI conversions
against s_base / v_ln_base / z_base).
close_mappings¶
A near-equivalent correspondence that requires interpretation or a lossy transform —
for example, a per-unit or aggregated value that approximates a CIM concept. A
close_mapping signals "related but not interchangeable," so a converter applies logic
rather than copying the value.
For the complete column-by-column listing with every mapping rendered, browse the Schema Reference.