Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMF Compare Match Engine: overwrite absoluteMetric()
EMF Compare Match Engine: overwrite absoluteMetric() [message #509502] Fri, 22 January 2010 16:09 Go to next message
Eclipse UserFriend
Originally posted by: d.hofmann.seeburger.de

Hi,

I evaluated EMF Compare and I think the generic match algorithm is
suitable for most cases. When I created a custom match engine, I found
that the very important method absoluteMetric() is private, so it's
impossible to overwrite it. The problem is specifically, that the basic
computation algorithm for the similarity metrics can't be changed and
also all weights are hardcoded.

Could you consider to make absoluteMetric() and also
relationsSimilarity() protected?

Thanks in advance!
David
Re: EMF Compare Match Engine: overwrite absoluteMetric() [message #510360 is a reply to message #509502] Wed, 27 January 2010 05:58 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020703080505070700070708
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

David,

Implementing a custom matching engine for EMF Compare is usually a
matter of overriding findMostSimilar() and isSimilar(). Could you
elaborate on why these methods aren't satisfactory for your need?

Laurent Goubet
Obeo

David Hofmann wrote:
> Hi,
>
> I evaluated EMF Compare and I think the generic match algorithm is
> suitable for most cases. When I created a custom match engine, I found
> that the very important method absoluteMetric() is private, so it's
> impossible to overwrite it. The problem is specifically, that the basic
> computation algorithm for the similarity metrics can't be changed and
> also all weights are hardcoded.
>
> Could you consider to make absoluteMetric() and also
> relationsSimilarity() protected?
>
> Thanks in advance!
> David


--------------020703080505070700070708
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------020703080505070700070708--
Re: EMF Compare Match Engine: overwrite absoluteMetric() [message #511671 is a reply to message #510360] Tue, 02 February 2010 08:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: d.hofmann.seeburger.de

Hello Laurent,

I'm trying to explain for which reason I want to override these methods:

- For my model name similarity is not interesting, but it has a weight
of 80% by default

- for the position similarity, only URI equality is checked, not similarity

- the relation similarity compares the object's feature names. If you
have containment features, the children should also be involved in
comparison. Imagine you have some objects having children and
grandchilden, and only the grandchildren are different. The generic
match engine considers them as equal (similarity 1.0), which is not
correct from my point of view.
Consider the following example: the reference model contains the objects
ABC, and now B is removed. When comparing ABC and AC , C is matched with
B and no more siblings are compared (similarity is already 1.0). I would
like the match engine to compare the objects including their children,
so that it considers C and B as different.

When I tried to achieve this by overriding isSimilar() and
findMostSimilar(), I noticed that absoluteMetric() is also invoked from
mapLists() and recursiveMappings() (for creating match elements). So to
keep similarities consistent, I would have to re-implement the whole
call hierarchy of these methods, am I right?
Or can I implement my custom relation similarity only by overriding the
two methods you mentioned?

Thank you for your feedback,
David
Re: EMF Compare Match Engine: overwrite absoluteMetric() [message #511859 is a reply to message #511671] Wed, 03 February 2010 09:34 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040009090103000803050201
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

David,

mapLists() and recursiveMappings() in turn call back isSimilar() and
findMostSimilar() to match your objects. Object C will not be matched
with B whatsoever if you override "IsSimilar()" and force it to return
false for these two objects. absoluteMetric() is more of an internal
process we use to handle generic case, and I don't believe it is
necessary to override it whatever the need (though I may have overlooked
a possibility).

Feel free to come back to us if you do not manage to achieve your goals
with only those two methods. Though we try to avoid it, we're not closed
to promoting internal to API when necessary.

Laurent Goubet
Obeo

David Hofmann wrote:
> Hello Laurent,
>
> I'm trying to explain for which reason I want to override these methods:
>
> - For my model name similarity is not interesting, but it has a weight
> of 80% by default
>
> - for the position similarity, only URI equality is checked, not similarity
>
> - the relation similarity compares the object's feature names. If you
> have containment features, the children should also be involved in
> comparison. Imagine you have some objects having children and
> grandchilden, and only the grandchildren are different. The generic
> match engine considers them as equal (similarity 1.0), which is not
> correct from my point of view.
> Consider the following example: the reference model contains the objects
> ABC, and now B is removed. When comparing ABC and AC , C is matched with
> B and no more siblings are compared (similarity is already 1.0). I would
> like the match engine to compare the objects including their children,
> so that it considers C and B as different.
>
> When I tried to achieve this by overriding isSimilar() and
> findMostSimilar(), I noticed that absoluteMetric() is also invoked from
> mapLists() and recursiveMappings() (for creating match elements). So to
> keep similarities consistent, I would have to re-implement the whole
> call hierarchy of these methods, am I right?
> Or can I implement my custom relation similarity only by overriding the
> two methods you mentioned?
>
> Thank you for your feedback,
> David


--------------040009090103000803050201
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------040009090103000803050201--
Re: EMF Compare Match Engine: overwrite absoluteMetric() [message #512518 is a reply to message #511859] Fri, 05 February 2010 06:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: d.hofmann.seeburger.de

Thank you Laurent,

it indeed works only by overriding the two methods, although the
absoluteMetric() is stored in the MatchModel, not the metric my custom
implementation computes. But that is not that interesting, since the
changes are shown correctly in the compare editor.

Thanks for your feedback,
David
Re: EMF Compare Match Engine: overwrite absoluteMetric() [message #622052 is a reply to message #509502] Wed, 27 January 2010 10:48 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020703080505070700070708
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

David,

Implementing a custom matching engine for EMF Compare is usually a
matter of overriding findMostSimilar() and isSimilar(). Could you
elaborate on why these methods aren't satisfactory for your need?

Laurent Goubet
Obeo

David Hofmann wrote:
> Hi,
>
> I evaluated EMF Compare and I think the generic match algorithm is
> suitable for most cases. When I created a custom match engine, I found
> that the very important method absoluteMetric() is private, so it's
> impossible to overwrite it. The problem is specifically, that the basic
> computation algorithm for the similarity metrics can't be changed and
> also all weights are hardcoded.
>
> Could you consider to make absoluteMetric() and also
> relationsSimilarity() protected?
>
> Thanks in advance!
> David


--------------020703080505070700070708
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------020703080505070700070708--
Re: EMF Compare Match Engine: overwrite absoluteMetric() [message #622066 is a reply to message #622052] Tue, 02 February 2010 13:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: d.hofmann.seeburger.de

Hello Laurent,

I'm trying to explain for which reason I want to override these methods:

- For my model name similarity is not interesting, but it has a weight
of 80% by default

- for the position similarity, only URI equality is checked, not similarity

- the relation similarity compares the object's feature names. If you
have containment features, the children should also be involved in
comparison. Imagine you have some objects having children and
grandchilden, and only the grandchildren are different. The generic
match engine considers them as equal (similarity 1.0), which is not
correct from my point of view.
Consider the following example: the reference model contains the objects
ABC, and now B is removed. When comparing ABC and AC , C is matched with
B and no more siblings are compared (similarity is already 1.0). I would
like the match engine to compare the objects including their children,
so that it considers C and B as different.

When I tried to achieve this by overriding isSimilar() and
findMostSimilar(), I noticed that absoluteMetric() is also invoked from
mapLists() and recursiveMappings() (for creating match elements). So to
keep similarities consistent, I would have to re-implement the whole
call hierarchy of these methods, am I right?
Or can I implement my custom relation similarity only by overriding the
two methods you mentioned?

Thank you for your feedback,
David
Re: EMF Compare Match Engine: overwrite absoluteMetric() [message #622068 is a reply to message #622066] Wed, 03 February 2010 09:34 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040009090103000803050201
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

David,

mapLists() and recursiveMappings() in turn call back isSimilar() and
findMostSimilar() to match your objects. Object C will not be matched
with B whatsoever if you override "IsSimilar()" and force it to return
false for these two objects. absoluteMetric() is more of an internal
process we use to handle generic case, and I don't believe it is
necessary to override it whatever the need (though I may have overlooked
a possibility).

Feel free to come back to us if you do not manage to achieve your goals
with only those two methods. Though we try to avoid it, we're not closed
to promoting internal to API when necessary.

Laurent Goubet
Obeo

David Hofmann wrote:
> Hello Laurent,
>
> I'm trying to explain for which reason I want to override these methods:
>
> - For my model name similarity is not interesting, but it has a weight
> of 80% by default
>
> - for the position similarity, only URI equality is checked, not similarity
>
> - the relation similarity compares the object's feature names. If you
> have containment features, the children should also be involved in
> comparison. Imagine you have some objects having children and
> grandchilden, and only the grandchildren are different. The generic
> match engine considers them as equal (similarity 1.0), which is not
> correct from my point of view.
> Consider the following example: the reference model contains the objects
> ABC, and now B is removed. When comparing ABC and AC , C is matched with
> B and no more siblings are compared (similarity is already 1.0). I would
> like the match engine to compare the objects including their children,
> so that it considers C and B as different.
>
> When I tried to achieve this by overriding isSimilar() and
> findMostSimilar(), I noticed that absoluteMetric() is also invoked from
> mapLists() and recursiveMappings() (for creating match elements). So to
> keep similarities consistent, I would have to re-implement the whole
> call hierarchy of these methods, am I right?
> Or can I implement my custom relation similarity only by overriding the
> two methods you mentioned?
>
> Thank you for your feedback,
> David


--------------040009090103000803050201
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------040009090103000803050201--
Re: EMF Compare Match Engine: overwrite absoluteMetric() [message #622079 is a reply to message #511859] Fri, 05 February 2010 11:00 Go to previous message
Eclipse UserFriend
Originally posted by: d.hofmann.seeburger.de

Thank you Laurent,

it indeed works only by overriding the two methods, although the
absoluteMetric() is stored in the MatchModel, not the metric my custom
implementation computes. But that is not that interesting, since the
changes are shown correctly in the compare editor.

Thanks for your feedback,
David
Previous Topic:Check invokation during mwe-generation
Next Topic:Check invokation during mwe-generation
Goto Forum:
  


Current Time: Tue Jun 15 16:17:28 GMT 2021

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

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

Back to the top