Skip to content

Add mapping specification schema (ELF 5006 Annex B)#2

Open
TRThurman wants to merge 4 commits intomainfrom
feature/add-mapping-specification-schema
Open

Add mapping specification schema (ELF 5006 Annex B)#2
TRThurman wants to merge 4 commits intomainfrom
feature/add-mapping-specification-schema

Conversation

@TRThurman
Copy link
Copy Markdown

Summary

  • Add mapping/v1/mapping_specification.yaml — JSON Schema (draft-07) for validating mapping.yaml files
  • Defines the post-migration format per ELF 5006:2025 Annex B (merged in Add EXPRESS links and YAML serialization annex express-q#10)
  • Update README with mapping schema section and documentation link

Schema coverage

Entity mappings: entity, aimelt, extensible, original_module, refpath, aa, alt_map, rules, description

Attribute mappings: attribute, assertion_to, aimelt, refpath, refpath_extend (with extended_select), alt_map, rules, description, inherited_from_entity, inherited_from_module

Subtype constraints: constraint, entity, description, source (legacy), rules

Validation

Validated against 588 mapping.yaml files in wg12-step with zero errors.

Usage

# yaml-language-server: $schema=https://www.expresslang.org/schemas/mapping/v1/mapping_specification.yaml

Related

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.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yaml defining the mapping specification structure (entities, attributes, subtype constraints, refpaths).
  • Update README.adoc to 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.

Comment thread mapping/v1/mapping_specification.yaml
Comment on lines +124 to +137
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
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied in commit 6124e9e: refpath_extend now requires both content and extended_select, so incomplete {} extensions no longer validate.

Comment on lines +174 to +184
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
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment on lines +187 to +195
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:
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
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.

3 participants