Skip to content

Fix importer gaps: list_of_unit + name-only header sheets#14

Merged
ronaldtse merged 1 commit into
mainfrom
fix/importer-gaps
Jul 22, 2026
Merged

Fix importer gaps: list_of_unit + name-only header sheets#14
ronaldtse merged 1 commit into
mainfrom
fix/importer-gaps

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

Fixes both importer gaps documented in cdd-data PR #5 (IMPORTER_GAP_REPORT.md).

Issue 1: list_of_unit entity type unrecognized (394 entities)

  • Added LISTOFUNITS to file pattern recognition (LayoutDetector + FlatDirReader)
  • Registered MDC_C0100 meta-class for :list_of_unit type
  • Result: all 394 iec62720 list_of_unit entities now parse with preferred_name

Issue 2: name-only header XLS (12 entities)

  • SheetSchema#finalize! now synthesizes property IDs from PROPERTY_NAME when PROPERTY_ID row is empty
  • Entity.from_row falls back to all known code property IDs when entity-specific one is absent
  • Result: ACI301-310 relations, ABB525/ABB622 properties, CBA016 all extract preferred_name + definition

Test plan

  • 882 specs pass (0 failures)
  • All 7 scraped dictionaries parse cleanly (24,675 entities)
  • 394 list_of_units with preferred_name
  • 10/10 iec62683 relations with preferred_name + definition

Two importer bugs documented in cdd-data PR #5 (IMPORTER_GAP_REPORT.md):

Issue 1: list_of_unit entity type unrecognized (394 iec62720 entities)
- Added LISTOFUNITS to LayoutDetector::FILE_PATTERN regex
- Added "LISTOFUNITS" => :list_of_unit to FlatDirReader::TYPE_BY_PREFIX
- Registered MDC_C0100 meta-class (type :list_of_unit, code prop C0101)
  in MetaClasses::TYPE_BY_META_CLASS, CODE_PROPERTY_IDS, built_in_registry
- Result: all 394 list_of_unit entities now parse with preferred_name

Issue 2: entities with name-only header XLS (10 iec62683 relations,
2 iec61987 properties, 1 iec61360-7 property)
- SheetSchema#finalize! now falls back to synthesizing property IDs
  from PROPERTY_NAME when PROPERTY_ID directives are empty
- Added NAME_TO_PROPERTY_ID mapping (45 IEC 62656-1 column names →
  property IDs) with language suffix preservation (.EN → .en)
- Entity.from_row now tries all known code property IDs as fallback
  when the entity-specific one is absent (handles "Code" synthesizing
  to MDC_P001_5 for relations that expect MDC_P001_13)
- Result: ACI301-310 all have preferred_name and definition

Verified against all 7 scraped dictionaries (24,675 entities, 0 failures).
882 specs pass, 0 failures.
@ronaldtse
ronaldtse merged commit 8a88e0e into main Jul 22, 2026
1 check passed
@ronaldtse
ronaldtse deleted the fix/importer-gaps branch July 22, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant