Add mapping specification schema (ELF 5006 Annex B)#2
Add mapping specification schema (ELF 5006 Annex B)#2
Conversation
Add JSON Schema (draft-07) for validating mapping.yaml files per ELF 5006:2025 YAML serialization annex. Defines structure for entity mappings, attribute assertions, reference paths, SELECT extensions, alternative mappings, and subtype constraints. Validated against 588 mapping.yaml files in wg12-step with zero errors.
There was a problem hiding this comment.
Pull request overview
Adds a new JSON Schema (draft-07) to validate ELF 5006 Annex B mapping.yaml files and documents its availability in the repository README.
Changes:
- Introduce
mapping/v1/mapping_specification.yamldefining the mapping specification structure (entities, attributes, subtype constraints, refpaths). - Update
README.adocto document the new Mapping schema and link to ELF 5006.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| mapping/v1/mapping_specification.yaml | New draft-07 JSON Schema for validating mapping specification YAML structure (Annex B). |
| README.adoc | Adds a “Mapping” section linking to ELF 5006 and the new schema file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| refpath_extend: | ||
| type: object | ||
| description: >- | ||
| Reference path extension for SELECT type extensions. Provides | ||
| additional mapping path content for entities whose attributes | ||
| reference an extended SELECT type. | ||
| additionalProperties: false | ||
| properties: | ||
| content: | ||
| type: string | ||
| description: Extension reference path content | ||
| extended_select: | ||
| type: string | ||
| description: Name of the SELECT type being extended |
There was a problem hiding this comment.
refpath_extend defines content and extended_select but neither is required, so {} is a valid refpath extension. If the object is only meaningful when it has extension content (and likely the SELECT name), consider adding required (e.g., content and extended_select) to prevent silently-accepted incomplete extensions.
There was a problem hiding this comment.
Applied in commit 6124e9e: refpath_extend now requires both content and extended_select, so incomplete {} extensions no longer validate.
| subtype_constraint: | ||
| type: object | ||
| description: Subtype constraint declaration | ||
| additionalProperties: false | ||
| properties: | ||
| constraint: | ||
| type: string | ||
| description: Constraint name | ||
| entity: | ||
| type: string | ||
| description: Entity to which the constraint applies |
There was a problem hiding this comment.
subtype_constraint currently has no required fields, meaning an empty object is considered a valid subtype constraint entry. If subtype constraints must have identifying fields, consider requiring at least constraint and entity (and any other mandatory fields per Annex B) to avoid accepting unusable constraint stubs.
There was a problem hiding this comment.
Applied in e27cdd0: subtype_constraint now requires both constraint and entity, so empty or partial constraint stubs no longer validate. UI screenshot: N/A (schema-only change).
| source: | ||
| type: object | ||
| description: >- | ||
| ISO source reference. Legacy field, to be removed when subtype | ||
| constraint entries are migrated to use EXPRESS links. | ||
| properties: | ||
| content: | ||
| type: string | ||
| rules: |
There was a problem hiding this comment.
Inside subtype_constraint.source, additionalProperties is not set, so arbitrary keys will be accepted even though surrounding objects are strict (additionalProperties: false). If source is meant to only carry content, consider setting additionalProperties: false (and optionally requiring content when source is present) to keep validation consistent and catch typos.
There was a problem hiding this comment.
Applied in e27cdd0: subtype_constraint.source now has additionalProperties: false and requires content when present. UI screenshot: N/A (schema-only change).
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/expresslang/schemas/sessions/2ec205e1-50b7-4da1-90c0-c956b9e3138a Co-authored-by: TRThurman <1623380+TRThurman@users.noreply.github.com>
Agent-Logs-Url: https://github.com/expresslang/schemas/sessions/36af3136-1ecc-4235-8edb-8370dabfaf43 Co-authored-by: TRThurman <1623380+TRThurman@users.noreply.github.com>
Summary
mapping/v1/mapping_specification.yaml— JSON Schema (draft-07) for validatingmapping.yamlfilesSchema coverage
Entity mappings:
entity,aimelt,extensible,original_module,refpath,aa,alt_map,rules,descriptionAttribute mappings:
attribute,assertion_to,aimelt,refpath,refpath_extend(withextended_select),alt_map,rules,description,inherited_from_entity,inherited_from_moduleSubtype constraints:
constraint,entity,description,source(legacy),rulesValidation
Validated against 588
mapping.yamlfiles in wg12-step with zero errors.Usage
# yaml-language-server: $schema=https://www.expresslang.org/schemas/mapping/v1/mapping_specification.yamlRelated