Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » sub metamodel detection
sub metamodel detection [message #1799357] Wed, 05 December 2018 14:41 Go to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Hi there,

I have got two ecore metamodels. I am looking for a tool which gives 'Yes' for the attached metamodels as the metamodel2 conforms to the metamodel1 . I know the terms "conform" is used for an instance of a metamodel, but I have used this term because I need something like that.

Best Rgards,
Banafsheh


Member of MDSE Research Group
http://mdse.ui.ac.ir

[Updated on: Wed, 05 December 2018 14:54]

Report message to a moderator

Re: sub metamodel detection [message #1799363 is a reply to message #1799357] Wed, 05 December 2018 16:04 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

IMHO there is no conformance between your two examples, just an accidental name match.

Since metamodel conformance is not a known concept, you will have to start by defining what you mean.

A URI-blind check that all instances of the conforming metamodel are hierarchicaly name-consistent and valid instances of the base metamodel might be a start, and you will see that metamodel2 does not conform since a Femae with a null fullName is valid for metamodel2 but not metamodel1.

Once you have codified your rules you can write a model transformation to validate conformance, or more usefully produce a report model of correlations / non-conformances. You might find that Edapt has some useful capabilities.

Regards

Ed Willink

Re: sub metamodel detection [message #1799375 is a reply to message #1799363] Wed, 05 December 2018 19:39 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
I have made a mistake. The Female class with a null fullname attribute is not valid in metamodel2. I have attached the correct metamodels.
What I mean by conformance is:
If the metamodel2 confroms to the metamodel1,
- All classess of the metamodel2 exists in the metamodel1.
-All its attributes and references exists in the attributes and references of the corresponding class in the metamodel1 or its parents in a hierarchy.
-The default value of its attributes is the same as the corresponding attribute in the metamodel1.
Anyway, you mean to say there are not any tools that help me in this regard? Can not tools such as EMF Compare or solvers help me and I should write the code from scratch? Would you tell me a bit more about the transformation you have said?


Member of MDSE Research Group
http://mdse.ui.ac.ir

[Updated on: Wed, 05 December 2018 19:45]

Report message to a moderator

Re: sub metamodel detection [message #1799378 is a reply to message #1799375] Wed, 05 December 2018 20:02 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

It is certainly not an EMF Compare problem. EMF Compare should be concerned about the URI, and if both metamodels have the same URI that would be at best confusing, IMHO illegal, but if different then different.

If you look at ATL it has a weak metamodel usage that might tolerate your 'conformance'.

QVTo has a non-strict metamodel usage that I have never studied.

Edapt has a migration capability. I think Epsilon has a migration tool too.

Basically it is a research area since there is not a clear industrial use case and considerable arbitrariness about what is supported. Search the literature or write your own tool that does what you actually want.

In your case, you have now requested reference migration up the hierarchy, which is particularly troublesome for bidirectional references since an inverse target must be downcast.

As soon as you get your tool 'working' expect someone to say that they still want it to work after name refactoring, so your easy hook on 'similar' vanishes and you are into much harder matching challenges.

Regards

Ed Willink
Re: sub metamodel detection [message #1799860 is a reply to message #1799378] Sat, 15 December 2018 07:15 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Thanks for your kind help

Member of MDSE Research Group
http://mdse.ui.ac.ir
Re: sub metamodel detection [message #1799867 is a reply to message #1799363] Sat, 15 December 2018 16:38 Go to previous messageGo to next message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Ed Willink wrote on Wed, 05 December 2018 16:04

Femae with a null fullName is valid for metamodel2 but not metamodel1.

I have got a question about lowerBound of the EAttribute. Why can I have an instance of this metamodel with null value for the fullName attribute, when the lowerBound of the attribute in the metamodel is 1?


Member of MDSE Research Group
http://mdse.ui.ac.ir

[Updated on: Sat, 15 December 2018 16:40]

Report message to a moderator

Re: sub metamodel detection [message #1799869 is a reply to message #1799867] Sat, 15 December 2018 18:35 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

In your original question only Metamodel2::Female could legitimately be null.

However EMF is not always as pedantic as it could be about null-valued slots with unit lowerbounds, since necessarily when loading a model from XMI, a missing slot assignment will give a null. Similarly construction gradually evolves an EObject from something substantially null-valued to something more useful. Yo should find that use of EMF Validate diagnoses the bad null.

It seems to have come as something of a surprise to the OCL/UML community that the distinction between [0..1] and [1..1] multiplicities could give similar functionality to @Nullable and @NonNull in JDT. This is supported by the Pivot-based OCL; see [1].

Regards

Ed Willink

[1] http://www.eclipse.org/modeling/mdt/ocl/docs/publications/OCL2015SafeNavigation/SafeNavigation.pdf
Re: sub metamodel detection [message #1800336 is a reply to message #1799869] Mon, 24 December 2018 20:37 Go to previous message
Banafsheh Azizi is currently offline Banafsheh AziziFriend
Messages: 328
Registered: July 2016
Senior Member
Thanks

Member of MDSE Research Group
http://mdse.ui.ac.ir
Previous Topic:[EMF Forms] EMFFormsSWTLayoutDelayed: invalid thread accsess
Next Topic:[EMF Forms] ViewModel, FeaturePath and Table controls
Goto Forum:
  


Current Time: Thu Apr 25 16:45:53 GMT 2024

Powered by FUDForum. Page generated in 0.03324 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top