Fix importer gaps: list_of_unit + name-only header sheets#14
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
LISTOFUNITSto file pattern recognition (LayoutDetector + FlatDirReader)MDC_C0100meta-class for:list_of_unittypeIssue 2: name-only header XLS (12 entities)
SheetSchema#finalize!now synthesizes property IDs fromPROPERTY_NAMEwhenPROPERTY_IDrow is emptyEntity.from_rowfalls back to all known code property IDs when entity-specific one is absentTest plan