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

Fix stereotypes feature #125

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Conversation

claudenirmf
Copy link
Member

This PR introduces the "Fix Stereotypes" feature, which runs through the model replacing stereotypes that are incorrect due to misspelling or version of OntoUML (mapping certain stereotypes to others of the current set). This feature also corrects the direction of associations in case their inversion can fix any inconsistencies.

Ideally this feature should be implemented in the backend (see issue #89), but this process would demand too much time, specially considering the inversion of association which may not yet be possible with the current deserialization.

Other minor fixes include the cleaing of bites of code and adjusting used icons.

This PR changes the plugin version to 0.5.4 and should be part of a new release.

@claudenirmf
Copy link
Member Author

The mapping old of stereotypes is still being updated.

@claudenirmf
Copy link
Member Author

The following mappings were added. Notice that comparissons are made with "normalized" stereotypes, all lowercase, no hyphens and no spaces.

classStereotypesMap.put("hou",Stereotype.TYPE);
classStereotypesMap.put("highordertype",Stereotype.TYPE);
classStereotypesMap.put("higherordertype",Stereotype.TYPE);
classStereotypesMap.put("powertype",Stereotype.TYPE);
classStereotypesMap.put("universal",Stereotype.TYPE);
classStereotypesMap.put("collectivekind",Stereotype.COLLECTIVE);
classStereotypesMap.put("quantitykind",Stereotype.QUANTITY);
classStereotypesMap.put("relatorkind",Stereotype.RELATOR);
classStereotypesMap.put("qualitykind",Stereotype.QUALITY);
classStereotypesMap.put("modekind",Stereotype.MODE);
associationStereotypesMap.put("characterizes",Stereotype.CHARACTERIZATION);
associationStereotypesMap.put("externaldependenceon",Stereotype.EXTERNAL_DEPENDENCE);
associationStereotypesMap.put("externallydepends",Stereotype.EXTERNAL_DEPENDENCE);
associationStereotypesMap.put("externallydependson",Stereotype.EXTERNAL_DEPENDENCE);
associationStereotypesMap.put("mediates",Stereotype.MEDIATION);
associationStereotypesMap.put("iof",Stereotype.INSTANTIATION);
associationStereotypesMap.put("instanceof",Stereotype.INSTANTIATION);
associationStereotypesMap.put("terminates",Stereotype.TERMINATION);
associationStereotypesMap.put("participates",Stereotype.PARTICIPATION);
associationStereotypesMap.put("historicallydepends",Stereotype.HISTORICAL_DEPENDENCE);
associationStereotypesMap.put("creates",Stereotype.CREATION);
associationStereotypesMap.put("manifests",Stereotype.MANIFESTATION);

@claudenirmf
Copy link
Member Author

To ease the testing process the "Reload Pluginn" button has a special feature temporarily attached to it. Select some class or association on the diagram and click on "Reload Plugin" to enter a custom stereotype it should have. This avoids having to use the complex menus necessary to add new stereotypes. If no stereotype is provided, the plugin is reloaded as normal.

Screen Shot 2022-01-07 at 02 28 34

@pedropaulofb
Copy link
Member

pedropaulofb commented Jan 11, 2022

The RSRO [1] and the ROoST [2] ontologies, which are part of the SEON [3] ontology, use the <<2ndOT>> stereotype. Maybe this stereotype could be also mapped to <<type>>.

[1] https://dev.nemo.inf.ufes.br/seon/RSRO.html
[2] https://dev.nemo.inf.ufes.br/seon/ROoST.html
[3] https://dev.nemo.inf.ufes.br/seon/

@pedropaulofb
Copy link
Member

In models with many diagrams the fix stereotypes process can take some time (e.g., the ANTT ontology took 20 seconds). Is it feasible to include a throbbed (aka "loading icon") so the user can be sure that the action is being performed?

@claudenirmf
Copy link
Member Author

claudenirmf commented Mar 18, 2022

Note:

  • check if the algorithm overrides the aggregation kind on existing «componentOf» relations

@pedropaulofb
Copy link
Member

pedropaulofb commented Apr 1, 2022

@claudenirmf , please include an additional correction:

  • from <<enum>> to <<enumeration>>

This situation was found in the ANTT ontology.

@claudenirmf
Copy link
Member Author

@pedropaulofb I didn't understand your request

@pedropaulofb
Copy link
Member

I'm sorry, I haven't noticed that the terms were not inside the <> (the GitHub message syntax changed what I wrote).

My request was to map the term "enum" to "enumeration".

claudenirmf and others added 5 commits April 11, 2022 03:08
- fix direction wherever possible
- show navigability in all associations
- wrap sanitize on loader
- filters out views with no model element from the serialization
- bugfix detection of mismatches between source/target and source end/target end
@pedropaulofb
Copy link
Member

@claudenirmf, can you please include a feature for:

  1. checking if any diagram has an invalid character according to the Windows or Linux file systems, and
  2. if they have, I recommend substituting them for a "-"

This prevents the generation of files (e.g., exported images) with invalid filenames.

The characters that could be substituted are:

< (less than)
> (greater than)
: (colon - sometimes works, but is actually NTFS Alternate Data Streams)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)

Thank you in advance.

@pedropaulofb
Copy link
Member

@Claudenir, I noticed another correction to be added to this feature. Can you please check OntoUML/ontouml-models#265?

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.

2 participants