opencaesar / oml-rosetta

An Eclipse IDE that supports OML natively
Apache License 2.0
11 stars 1 forks source link

EMF Compare Enhancements for OMLXMI files #2

Closed paulgaspardo closed 4 years ago

paulgaspardo commented 4 years ago

This change extends EMF Compare in Rosetta with a custom Model Resolver and Match Engine designed to improve the experience of OMLXMI model comparisons, considering comparisons within the workspace, comparisons between git revisions, and comparisons between git revisions and files in the workspace.

The new Model Resolver simplifies the traversal process to not do any traversal at all; it will only compare the files selected by the user for performing the comparison. It was observed that the default implementation may pick up unrelated model files if a Member name in one matches another, and that the traversal doesn't get invoked when comparing with git revisions leading to some inconsistency.

The new Match Engine includes a customized Object Matcher, Resource Matcher, and Comparison Factory.

The Object Matcher is an IdentifierEObjectMatcher with an OML-specific idComputation function, which in particular handles the fact that many elements in OML (for example property value assertions) are identified by the URIs of the objects they reference. The idComputation is specific to description models since those are typically in OMLXMI, where terminologies are typically in OML text.

The Resource Matcher is designed to work with the custom Model Resolver and match the single resources on each side together; as a fallback, it will match by ontology IRI and exact location.

The Comparison Factory compares proxy objects by their full absolute URI instead of the URI fragment. This requires normalizing the proxy URIs (which may not be directly comparable when comparing workspace files with files in git), which is performed by the Match Engine compare method override.

These changes will not apply to the OML textual syntax; it's assumed OML text files will be compared using textual diffs rather than EMF compare.