Skip to content

fix: QEA to XMI export parity - #33

Draft
HassanAkbar wants to merge 7 commits into
mainfrom
fix/issue-32-xmi-parity
Draft

fix: QEA to XMI export parity#33
HassanAkbar wants to merge 7 commits into
mainfrom
fix/issue-32-xmi-parity

Conversation

@HassanAkbar

@HassanAkbar HassanAkbar commented Aug 10, 2026

Copy link
Copy Markdown
Member

Fixes #32.

Makes our QEA→XMI export match EA's own output.

  • Reproduces EA's synthesized ID scheme (LI/SL/OE/RT counters).
  • Fixes xref serialization and the $XREFPROP mini-language.
  • Fixes diagram geometry, Path encoding, and trailing separators.
  • Emits * for unlimited bounds, never -1.
  • Omits bounds entirely when cardinality is blank, like EA.
  • Adds nested classifiers, dependencies, signals, and primitive types.
  • Adds a parity ratchet spec over all 5 example models.
  • basic.qea distance: 421/368/237 down to 147/148/100.

Depends on unreleased xmi features. Companion PR: lutaml/xmi#94.

CI notes, both temporary until xmi 0.7.0 ships:

  • The Gemfile resolves xmi from the companion branch on GitHub.
  • The gemspec floor is loosened to >= 0.6.2 for that resolution.
  • Cleanup after the xmi release: drop the pin, tighten to ~> 0.7.
  • Do not release ea before that cleanup lands.

Known gaps, tracked for follow-up:

  • EAJava primitive hierarchy for Java-gentype models.
  • uml:PackageImport for Package connectors.
  • Deep-nested classifier sibling order needs a real EA model.

@HassanAkbar
HassanAkbar marked this pull request as draft August 10, 2026 17:04
@suleman-uzair suleman-uzair changed the title fix: QEA to XMI export parity (issue #32) fix: QEA to XMI export parity Aug 10, 2026
@HassanAkbar
HassanAkbar requested a lite review from Copilot August 11, 2026 06:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens QEA → Sparx XMI export parity by aligning synthesized IDs, visibility handling, xref/$XREFPROP serialization, diagram geometry/path encoding, and emitting additional UML elements (nested classifiers, dependencies, signals, primitive types). It also adds a parity “ratchet” spec to prevent regressions against the checked-in EA reference exports.

Changes:

  • Reworked synthesized ID allocation (LI/SL/OE/RT) and classifier walk/allocation order to better match EA’s counters and nesting conventions.
  • Implemented/expanded Extension serialization: populated <xrefs> via $XREFPROP, added <primitivetypes>, and improved diagram <elements> geometry/style/path output.
  • Added/expanded specs for parity, visibility/textual scopes, run-state operator handling, MDG registry discovery, and CLI export behavior.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
spec/ea/transformers/qea_to_xmi/visibility_spec.rb Adds coverage for textual scope values and Public suppression.
spec/ea/transformers/qea_to_xmi/transformer_spec.rb Updates expectations for nested classifiers, visibility, synthesized IDs, signals, primitive hrefs, deps, and realizations.
spec/ea/transformers/qea_to_xmi/run_state_spec.rb Updates expectations to keep multi-char operators verbatim.
spec/ea/transformers/qea_to_xmi/parity_spec.rb New parity ratchet over example models + self-parse check.
spec/ea/transformers/qea_to_xmi/id_allocator_spec.rb Refactors allocator specs to assert EA-derived ID shape/counters.
spec/ea/transformers/qea_to_xmi/extension_serializer_spec.rb Adds expectations for xrefs, signals, primitivetypes, diagram element serialization.
spec/ea/transformers/qea_to_xmi/cardinality_spec.rb Updates unlimited upper bound wire form to * and treats stored -1 as unlimited.
spec/ea/qea/models/ea_xref_spec.rb Adds mapping coverage for Visibility/Behavior/Partition.
spec/ea/qea/models/ea_connector_spec.rb Adds UK spelling realization coverage.
spec/ea/mdg/registry_from_paths_spec.rb New tests for registry loading from files/dirs with graceful skipping.
spec/ea/cli/command/export_spec.rb New CLI export specs for --mdg behavior (xmi-only).
lib/ea/transformers/qea_to_xmi/visibility.rb Supports textual scopes with integer fallback.
lib/ea/transformers/qea_to_xmi/transformer.rb Implements EA-like walk/nesting, bounds preallocation, dependency endpoint refs, signals, classifier ref resolution, realization filtering.
lib/ea/transformers/qea_to_xmi/run_state.rb Emits run-state operator verbatim in OpaqueExpression bodies.
lib/ea/transformers/qea_to_xmi/primitive_types.rb New helper to synthesize EA’s primitivetypes extension hierarchy + OMG href mapping.
lib/ea/transformers/qea_to_xmi/id_allocator.rb Redesigns allocator to memoize by (owner,prefix,seed) with global vs per-owner counters and EA-like tail/width rules.
lib/ea/transformers/qea_to_xmi/extension_serializer.rb Populates xrefs via $XREFPROP, adds primitivetypes section, improves diagram element serialization and Path separator handling.
lib/ea/transformers/qea_to_xmi/cardinality.rb Switches unlimited wire form to * and expands unlimited token normalization.
lib/ea/transformers/qea_to_xmi.rb Autoloads PrimitiveTypes.
lib/ea/qea/models/ea_xref.rb Adds visibility/behavior/partition attributes for xref serialization.
lib/ea/qea/models/ea_object.rb Centralizes transformer type mapping (adds Signal) and keeps enum stereotype override.
lib/ea/qea/models/ea_connector.rb Treats both Realization/Realisation as realizations.
lib/ea/mdg/registry.rb Adds from_paths and recursive directory expansion with safe skipping.
lib/ea/cli/command/mdg.rb Uses Registry.from_paths for MDG discovery.
lib/ea/cli/command/export.rb Threads optional MDG registry through xmi exporter only.
lib/ea/cli/app.rb Adds --mdg CLI option (xmi only).
Gemfile Temporarily pins xmi to a GitHub branch for unreleased features.
ea.gemspec Loosens xmi dependency floor to support the temporary pin.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/ea/transformers/qea_to_xmi/cardinality.rb Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 28 out of 28 changed files in this pull request and generated no new comments.

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.

QEA→XMI export does not match EA's output

2 participants