Skip to content

KerML Root model #3365

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

Merged
merged 19 commits into from
Jul 4, 2024
Merged

KerML Root model #3365

merged 19 commits into from
Jul 4, 2024

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented Jun 25, 2024

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is new?

Gaphor has a minimal core model.

This PR implements (part of) the KerML spec for the core model. I think this is a nice stepping stone to implementing, as KerML is the basis got SysML v2.

The idea is to slowly migrate to the KerML metamodel as a basis for Gaphor.

The new model can be viewed in the readthedocs build.

Issue Number: #2584

Other information

  • Move Relationship to core model
  • Move Dependency to core model
  • Move name to Element (as is, not as a derived property)
  • Remove use of NamedElement, once name is moved to Element NamedElement is used all over the place
  • Move Namespace to core model
  • Move DependencyItem to diagram package? Hard, since it still depends on UML elements too.
  • Deal with Relationship.abstraction. It's not part of the core model. Leave as exception for now. We also have some properties for Namespace, but it looks like we do not use those (MyPy is not complaining at least).
  • Restore Named interface again on DirectedRelationshipPropertyPathItem, DependencyItem, and InterfaceRealizationItem.

Review notes:

This PR has become pretty big.

A lot of files changed due to name and namespace now being part of the Element class: no casting is required in watch() operations

I tried to remove NamedElement. So far I got it out of the Model Browser, but there's some other places that depend on it still. Although NamedElement only contains a visibility attribute (not sure if we even use that).

I think we need a base type for Element at some point, so Element can be used for "normal" model elements and we can derive "gaphor-internal" types like Presentation and StyleSheet from the base type. This way Element can more easily replace NamedElement.

I tried to change the semantics of the model as little as possible. E.g. I did not implement the Membership and OwnedMembership relations.

@amolenaar amolenaar marked this pull request as draft June 25, 2024 06:48
@github-actions github-actions bot added the python Pull requests that update Python code label Jun 25, 2024
Drop `directedRelationship` property from the model.

For dependency items, drop the Named marker interface.
We can restore this after `name` is moved to the base class.
@amolenaar amolenaar requested a review from danyeaw June 27, 2024 12:32
@amolenaar amolenaar marked this pull request as ready for review June 27, 2024 12:32
Eventually this class should go away, but for now we need it or a lot of
code breaks.
Now all elements are properly grouped.
Slots are used by stereotypes.
@amolenaar amolenaar mentioned this pull request Jun 30, 2024
4 tasks
@danyeaw danyeaw removed the python Pull requests that update Python code label Jul 4, 2024
@danyeaw danyeaw added the feature A new feature label Jul 4, 2024
Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

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

Hi @amolenaar, these changes look great, nice start on our way to KerML 👍

@danyeaw danyeaw merged commit 7ce4547 into main Jul 4, 2024
@danyeaw danyeaw deleted the kerml-core-model branch July 4, 2024 18:58
@amolenaar amolenaar mentioned this pull request Oct 19, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants