Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement mapping between elements, namespaces and files #602

Conversation

atextor
Copy link
Contributor

@atextor atextor commented Jul 8, 2024

Description

This PR provides a clean implementation of the model that distinguishes between
model elements, namespaces and single aspect model files as described in
ADR-0007.
This has many implications on the code base:

  • Introduction of the AspectModelFile interface and the new core abstraction,
    AspectModel, which combines knowledge about model elements, namespaces the
    elements are contained in and files they were defined in. The AspectModel
    retains information about the underlying RDF graph of the model.
  • The abstraction of the VersionedModel class which contains only a merged RDF
    graph but no information about the underlying source files can not work
    anymore and is removed. Similarly, the AspectContext file which encapsulates
    a VersionedModel with a single Aspect can not work and is also removed.
  • The process of Aspect Model resolution and Aspect Model loading is unified
    and simplified. The AspectModelResolver is removed as it is not needed as a
    standalone mechanism any more. Loading (and resolving) an Aspect Model is now
    only done using new AspectModelLoader().load(...); the AspectModelLoader
    constructor can also be augmented with custom ResolutionStrategys.
  • Due to the above changes, APIs for artifact generation and validation are
    changed, all tests are subsequently also adjusted.
  • The "migrate" command in samm-cli and the Maven plugin is removed, as its
    functionality does not differ from the "prettyprint" command.
  • Tests are not parameterized over meta model versions any more, since the
    AspectModelLoader automatically migrates files to the latest meta model
    version (which is necessary to instantiate the model elements). This means
    that test aspect model files are not needed for every meta model version.
  • Due to integrated loading/resolving functionality of the AspectModelLoader,
    there is no need for the following separate modules: esmf-aspect-meta-model-types,
    esmf-aspect-meta-model-version-migrator and esmf-aspect-model-resolver; those
    modules are therefore removed. Only the esmf-aspect-meta-model-interface
    module is needed as a runtime dependency for generated Java Code, and only
    the esmf-aspect-meta-model-java module is needed for loading Aspect Models.

Fixes #579.

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Additional notes:

Add any other notes or comments here.

@atextor atextor marked this pull request as draft July 8, 2024 08:00
atextor added 2 commits July 8, 2024 14:36
Since the AspectModelLoader automatically migrates meta model versions - which
is necessary to correctly instantiate model elements - running tests for
multiple meta model versions does not bring any benefits. This in turn means
that test aspect models are not required for all meta model versions but only
the current/latest version.
This is is necessary because the number of files in the PR is too large for the
reviewdog API
@atextor atextor force-pushed the 579-implement-mapping-elements-namespaces-files branch from 8392a8e to 30308d3 Compare July 8, 2024 12:37
Copy link
Contributor

@Yauhenikapl Yauhenikapl left a comment

Choose a reason for hiding this comment

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

LGTM!

@atextor atextor marked this pull request as ready for review July 8, 2024 13:58
@Yauhenikapl Yauhenikapl self-requested a review July 8, 2024 14:08
@atextor atextor merged commit 720d916 into eclipse-esmf:main Jul 9, 2024
4 checks passed
@atextor atextor deleted the 579-implement-mapping-elements-namespaces-files branch July 9, 2024 04:58
@atextor atextor mentioned this pull request Jul 9, 2024
4 tasks
Copy link

Release v2.9.0 addresses this.

@eclipse-esmf eclipse-esmf deleted a comment from github-actions bot Jul 11, 2024
@eclipse-esmf eclipse-esmf deleted a comment from github-actions bot Jul 11, 2024
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.

[Task] Implement mapping of model namespaces to files
3 participants