diff --git a/TODO.final/19-condition-grammar-and-lutaml-migration.md b/TODO.final/19-condition-grammar-and-lutaml-migration.md index 0c08f0f..06d6e4e 100644 --- a/TODO.final/19-condition-grammar-and-lutaml-migration.md +++ b/TODO.final/19-condition-grammar-and-lutaml-migration.md @@ -3,6 +3,17 @@ **From:** cdd-data session 2026-07-23 **User decisions:** All 3 lutaml decisions resolved; condition grammar Option 2 approved. +## Status (2026-07-24) + +| Item | Status | Where | +|------|--------|-------| +| **Item 1** β€” Condition grammar (ClassReference subclass) | βœ… **SHIPPED** | commit `bae0c56` on `main`, merged via PR [#17](https://github.com/opencdd/opencdd-ruby/pull/17). Released in gem v0.3.1. | +| **Item 2** β€” lutaml-model migration | πŸ“‹ **PLAN-ONLY** | [`19b-lutaml-model-migration.md`](19b-lutaml-model-migration.md) β€” Phases 2.1 & 2.2 already shipped via TODO.impl/33–35; Phases 2.3, 2.4, 2.5 remain. | + +TS team: `Opencdd::Condition::ClassReference` is real API on `main`, +not a proposal. See `lib/opencdd/condition.rb:141`. The `lutaml-model` +work is the only outstanding piece. + ## Item 1: Condition Grammar β€” ClassReference subclass (TODO 18) ### Problem diff --git a/bin/lint-no-raw-mdc b/bin/lint-no-raw-mdc index b1bbdfb..c9b91f6 100755 --- a/bin/lint-no-raw-mdc +++ b/bin/lint-no-raw-mdc @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # lint-no-raw-mdc β€” fail if any raw MDC_P### / MDC_C### / EXT_P### / # EXT_C### / CIM_P### string literal appears in lib/opencdd/ outside # the designated SSOT files. diff --git a/lib/opencdd/entity/name_synthesizer.rb b/lib/opencdd/entity/name_synthesizer.rb index 401495a..811b914 100644 --- a/lib/opencdd/entity/name_synthesizer.rb +++ b/lib/opencdd/entity/name_synthesizer.rb @@ -12,56 +12,12 @@ class Entity # Extracted from SheetSchema so SheetSchema focuses on header # parsing + Column construction. Name synthesis is a separate # concern with its own test surface. + # + # The nameβ†’ID table itself lives in Opencdd::PropertyIds::IEC_COLUMN_NAMES + # (the lint-exempt SSOT). NAME_TO_PROPERTY_ID is kept here as a + # back-compat alias so existing callers see no public-API change. module NameSynthesizer - # IEC 62656-1 defined column names mapped to canonical - # property IDs. These names appear in the #PROPERTY_NAME - # directive row when #PROPERTY_ID is absent. - NAME_TO_PROPERTY_ID = { - "Code" => "MDC_P001_5", - "Version" => "MDC_P002_1", - "Revision" => "MDC_P002_2", - "VersionInitiationDate" => "MDC_P003_1", - "VersionReleaseDate" => "MDC_P003_2", - "RevisionReleaseDate" => "MDC_P003_3", - "PreferredName" => "MDC_P004", - "SynonymousName" => "MDC_P007", - "ShortName" => "MDC_P005", - "Definition" => "MDC_P006", - "DefinitionSource" => "MDC_P006_1", - "Note" => "MDC_P008", - "Remark" => "MDC_P009", - "Drawing" => "MDC_P008_1", - "GUID" => "MDC_P066", - "TimeStamp" => "MDC_P067", - "ClassType" => "MDC_P011", - "Superclass" => "MDC_P010", - "IsCaseOf" => "MDC_P013", - "ApplicableProperties" => "MDC_P014", - "ImportedProperties" => "MDC_P090", - "SubClassSelection" => "MDC_P016", - "DataType" => "MDC_P022", - "ValueFormat" => "MDC_P024", - "DefinitionClass" => "MDC_P021", - "Unit" => "MDC_P041", - "Condition" => "MDC_P028", - "ListType" => "MDC_P046", - "CodeList" => "MDC_P044", - "TermList" => "MDC_P043", - "EnumerationCode" => "MDC_P044", - "RelationType" => "MDC_P200", - "RelationDomain" => "MDC_P201", - "FunctionDomain" => "MDC_P202", - "FunctionCodomain" => "MDC_P203", - "Formula" => "MDC_P204", - "FormulaLanguage" => "MDC_P205", - "FormulaExternalSolver" => "MDC_P206", - "TriggerEvent" => "MDC_P207", - "DomainElementType" => "MDC_P208", - "CodomainElementType" => "MDC_P209", - "Role" => "MDC_P210", - "Segment" => "MDC_P211", - "SuperRelation" => "MDC_P212", - }.freeze + NAME_TO_PROPERTY_ID = Opencdd::PropertyIds::IEC_COLUMN_NAMES # Given a PROPERTY_NAME directive row (Array of name strings), # returns a parallel Array of property IDs (or nil where the diff --git a/lib/opencdd/property_ids.rb b/lib/opencdd/property_ids.rb index 0e48fd8..36f43ee 100644 --- a/lib/opencdd/property_ids.rb +++ b/lib/opencdd/property_ids.rb @@ -142,6 +142,58 @@ module PropertyIds # ontology registry). Kept here as an alias for back-compat. PARCEL_VARIANT_TO_CANONICAL = Opencdd::Parcel::SheetSchema::VARIANT_TO_CANONICAL + # IEC 62656-1 defined PROPERTY_NAME directive column names mapped + # to canonical property IDs. Used by Opencdd::Entity::NameSynthesizer + # when a Parcel sheet omits the #PROPERTY_ID directive row and + # only carries #PROPERTY_NAME. Declared here so the raw IDs live + # in the lint-exempt SSOT instead of in the synthesis module. + IEC_COLUMN_NAMES = { + "Code" => "MDC_P001_5", + "Version" => "MDC_P002_1", + "Revision" => "MDC_P002_2", + "VersionInitiationDate" => "MDC_P003_1", + "VersionReleaseDate" => "MDC_P003_2", + "RevisionReleaseDate" => "MDC_P003_3", + "PreferredName" => "MDC_P004", + "SynonymousName" => "MDC_P007", + "ShortName" => "MDC_P005", + "Definition" => "MDC_P006", + "DefinitionSource" => "MDC_P006_1", + "Note" => "MDC_P008", + "Remark" => "MDC_P009", + "Drawing" => "MDC_P008_1", + "GUID" => "MDC_P066", + "TimeStamp" => "MDC_P067", + "ClassType" => "MDC_P011", + "Superclass" => "MDC_P010", + "IsCaseOf" => "MDC_P013", + "ApplicableProperties" => "MDC_P014", + "ImportedProperties" => "MDC_P090", + "SubClassSelection" => "MDC_P016", + "DataType" => "MDC_P022", + "ValueFormat" => "MDC_P024", + "DefinitionClass" => "MDC_P021", + "Unit" => "MDC_P041", + "Condition" => "MDC_P028", + "ListType" => "MDC_P046", + "CodeList" => "MDC_P044", + "TermList" => "MDC_P043", + "EnumerationCode" => "MDC_P044", + "RelationType" => "MDC_P200", + "RelationDomain" => "MDC_P201", + "FunctionDomain" => "MDC_P202", + "FunctionCodomain" => "MDC_P203", + "Formula" => "MDC_P204", + "FormulaLanguage" => "MDC_P205", + "FormulaExternalSolver" => "MDC_P206", + "TriggerEvent" => "MDC_P207", + "DomainElementType" => "MDC_P208", + "CodomainElementType" => "MDC_P209", + "Role" => "MDC_P210", + "Segment" => "MDC_P211", + "SuperRelation" => "MDC_P212", + }.freeze + REGISTRY.each_key do |id| const_set(id, id.freeze) unless const_defined?(id, false) end