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

any_of ranges should appear as edges in gen-erdiagram and gen-plantuml diagrams #2034

Open
turbomam opened this issue Mar 27, 2024 · 2 comments

Comments

@turbomam
Copy link
Contributor

see also

@cmungall
Copy link
Member

Interesting question:

any_of is outside the expressivity of UML

I can't find the definitive documentation on this, there is lots of advice on how to rewrite a schema to map the union expression to a named superclass

This discussion on profiles may help: https://github.com/orgs/linkml/discussions/1962

In general, when applying a constuct in linkml some thought should be given to whether that construct is outside the profile of a desired target such as UML or relational databases.

I don't think this should be implemented by some kind of ad-hoc introduction of a new line type in the diagram not part of the UML standard.

Probably the best strategy would be to follow the same strategy as for generating SQL DDL we first employ a mapper to do a best effort attempt to map to the target formalism, possibly rewriting. For example RelationalModelTransformer will introduce linking tables for multivalued fields.

We could have a UML CD mapper or OO mapper that rewrites unions to named superclasses. This would presumably also be useful for target OO languages that don't support unions.

In the interim an acceptable workaround is to include a note below the UML diagram that indicates the schema includes some things that are inexpressible as traditional class diagrams.

@Silvanoc
Copy link
Contributor

Silvanoc commented Mar 28, 2024

AFAIK UML doesn't have any mechanisms to specify constraints.

Some googling has brought me to OCL as a way to specify constraints combined with UML.

Although OCL is apparently also part of UML, I haven't been able to find the right way to integrate both together. From what I've seen in different examples and tutorials, OCL extends the UML diagram and can be either provided separately or be integrated using comments in the diagram.

I've found this example on how to address it even using PlantUML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants