Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 511253 - Opposite properties upper, lower, unique, ordered annotations
Summary: Opposite properties upper, lower, unique, ordered annotations
Status: RESOLVED WONTFIX
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: OCL Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-28 03:54 EST by Horacio Hoyos CLA
Modified: 2017-01-28 05:08 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Horacio Hoyos CLA 2017-01-28 03:54:25 EST
I was under the impression that similar to the 
http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName annotations the upper, lower, unique and ordered attributes of the opposite property where to be defined using 

http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeUpper, 
http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeLower and such annotations, creating a new annotation for each value.

However, looking at /org.eclipse.ocl.pivot/src/org/eclipse/ocl/pivot/internal/ecore/es2as/Ecore2ASReferenceSwitch.java it appears that the mentioned attributes should be specified as details in the #Property.oppositeRoleName annotation. 

Further, for example in line 260 the details for the lower value are queried using the key "lower". Same happens for other values at lines 266, 272 and 275. In all cases the single name of the property is uses as opposed to the complete Property.oppositeUpper key (although in lines 206-209 the full name is used). 

It will be useful if the name/method can be unified.

Thanks!
Comment 1 Ed Willink CLA 2017-01-28 05:08:25 EST
I was the originator of the observation that UML opposites needed some persistence in EMOF/Ecore to fully support OCL. My OMG MOF issue, http://www.omg.org/issues/mof2core-rtf.html#Issue12800, sat on the shelf for a long time and eventually appeared with differently spelled Tag names. My add-on comment, oops, we may need opposite-ordered/unique/lower/upper was ignored.

If/when, as a result of http://issues.omg.org/issues/MOF26-35, MOF endorses some more Tag spellings EMF should chase MOF, but I have no enthusiasm for doing anything until then.

I have only limited influence on what appears in EMF or UML and so while UML2Ecore does now provide the annotations, the spelling is what it is.

I see very little prospect of change for Eclipse spellings, and even if they changed the old names would have to be supported for legacy purposes.

QVTc middle model navigation and QVTc middle synthesis from QVTr demonstrates the need for the further annotations. UMLXforEcore also needs the annotations.

-- 

The current code is certainly confusing with different defaults depending on whether the opposite name is explicit or not. I fixed some odd corner cases in the last few weeks. But the bottom line is that if you are going to use an opposite you need to make sure it is declared fully.

See /org.eclipse.qvtd.xtext.qvtcore.tests/src/org/eclipse/qvtd/xtext/qvtcore/tests/forward2reverse/List2List.ecore

When I added the QVTr to middle synthesis, it became clear how many of the QVTc tests were working fortuitously with inadequate manually defined middle models.