Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Accessing MapInfo structure from ECL(Writing data from within a compare)
Accessing MapInfo structure from ECL [message #541771] Tue, 22 June 2010 13:42 Go to next message
Stephen Barrett is currently offline Stephen BarrettFriend
Messages: 46
Registered: May 2010
Member
Hi guys,

I can't figure out how to put a value into a match's info map after a successful compare. I can see the (empty) structure in the debugger, but can't access it from ECL.

The Epsilon Book states that it is possible to do so from within the do part of a compare for the established match. Trouble is, I don't know how to get a hold of the "established match".

Many thanks,
--Stephen
Re: Accessing MapInfo structure from ECL [message #541791 is a reply to message #541771] Tue, 22 June 2010 14:00 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Stephen,

You should be able to access the map using the implicit matchInfo
variable (and I should probably update the book :) ).

Cheers,
Dimitris

Stephen Barrett wrote:
> Hi guys,
>
> I can't figure out how to put a value into a match's info map after a
> successful compare. I can see the (empty) structure in the debugger, but
> can't access it from ECL.
> The Epsilon Book states that it is possible to do so from within the do
> part of a compare for the established match. Trouble is, I don't know
> how to get a hold of the "established match".
>
> Many thanks,
> --Stephen
Re: Accessing MapInfo structure from ECL [message #541797 is a reply to message #541791] Tue, 22 June 2010 14:39 Go to previous messageGo to next message
Stephen Barrett is currently offline Stephen BarrettFriend
Messages: 46
Registered: May 2010
Member
Yep Dimitris, that was the missing piece! Thanks again.

Is there a list of these implicit variables? Or a place to look in the code to find one? I knew this was a simple matter, I just didn't know the magic word.

--Stephen
Re: Accessing MapInfo structure from ECL [message #541962 is a reply to message #541797] Wed, 23 June 2010 11:30 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Stephen,

The book/documentation should really mention these as there's not a
single place in the code where all these implicit variables are defined
defined (e.g. matchInfo is added to the context in line 329 of
https://dev.eclipse.org/svnroot/modeling/org.eclipse.gmt.eps ilon/trunk/plugins/org.eclipse.epsilon.ecl.engine/src/org/ec lipse/epsilon/ecl/MatchRule.java)

Cheers,
Dimitris

Stephen Barrett wrote:
> Yep Dimitris, that was the missing piece! Thanks again.
>
> Is there a list of these implicit variables? Or a place to look in the
> code to find one? I knew this was a simple matter, I just didn't know
> the magic word.
>
> --Stephen
Re: Accessing MapInfo structure from ECL [message #544888 is a reply to message #541962] Mon, 05 July 2010 21:52 Go to previous messageGo to next message
Stephen Barrett is currently offline Stephen BarrettFriend
Messages: 46
Registered: May 2010
Member
Okay,

I am now passing values back to my application from match rules by adding do-parts of the following form to each rule:

  do {
    matchInfo.put("mirador", 0.7);
  }


with the key being the name of my application. Do you think that this robust enough, or are there some gotchas I may be unaware of?

Also, Dimitirs you mentioned to me that after matching a pair of model elements with ECL, that I might want to recalculate overall similarity measures for the remaining element pairs in my model. Trouble is, I can't remember why this is so. Could you please refresh my memory?

Many thanks,
--Stephen
Re: Accessing MapInfo structure from ECL [message #544891 is a reply to message #544888] Mon, 05 July 2010 22:20 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Stephen,

On 05/07/2010 22:52, Stephen Barrett wrote:
> Okay,
>
> I am now passing values back to my application from match rules by
> adding do-parts of the following form to each rule:
>
>
> do {
> matchInfo.put("mirador", 0.7);
> }
>
>
> with the key being the name of my application. Do you think that this
> robust enough, or are there some gotchas I may be unaware of?

That should be fine indeed.

>
> Also, Dimitirs you mentioned to me that after matching a pair of model
> elements with ECL, that I might want to recalculate overall similarity
> measures for the remaining element pairs in my model. Trouble is, I
> can't remember why this is so. Could you please refresh my memory?

I think I was referring to recalculating matches whenever the user
establishes an explicit (i.e. manual) match - if that's supported by
Mirador.

>
> Many thanks,
> --Stephen
>

Cheers,
Dimitris
Re: Accessing MapInfo structure from ECL [message #545160 is a reply to message #544891] Tue, 06 July 2010 20:07 Go to previous messageGo to next message
Stephen Barrett is currently offline Stephen BarrettFriend
Messages: 46
Registered: May 2010
Member
> I think I was referring to recalculating matches whenever the user
> establishes an explicit (i.e. manual) match - if that's supported by
> Mirador.

Yes, that's what you were referring to. So, I suppose, my real question is, why do you think a recalculation might be needed? And by recalculation, I assume you mean redoing all the element similarity measures, and then rematching the elements based on the new measures. Is that accurate?

Regards,
--Stephen
Re: Accessing MapInfo structure from ECL [message #545164 is a reply to message #545160] Tue, 06 July 2010 20:24 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Stephen,

Suppose that you're comparing trees and you have the following sample trees:

[a]
-- [b]

and

[c]
-- [b]

and the following rule

rule MatchTrees
match l : Left!Tree
with r : Right!Tree {

compare : l.label = r.label and
l.parent.matches(r.parent)
}

In the initial comparison, the two [b]'s won't match because their
parents don't match ([a] <> [c]). However, if the user explicitly
declares that [a] matches with [c] then the two [b]'s should now match.
Does this make any sense?

Cheers,
Dimitris

On 06/07/2010 21:07, Stephen Barrett wrote:
>> I think I was referring to recalculating matches whenever the user
>> establishes an explicit (i.e. manual) match - if that's supported by
>> Mirador.
>
> Yes, that's what you were referring to. So, I suppose, my real question
> is, why do you think a recalculation might be needed? And by
> recalculation, I assume you mean redoing all the element similarity
> measures, and then rematching the elements based on the new measures. Is
> that accurate?
>
> Regards,
> --Stephen
Re: Accessing MapInfo structure from ECL [message #545618 is a reply to message #545164] Thu, 08 July 2010 12:55 Go to previous messageGo to next message
Stephen Barrett is currently offline Stephen BarrettFriend
Messages: 46
Registered: May 2010
Member
Ah. The light goes on. Thanks Dimitris!
Re: Accessing MapInfo structure from ECL [message #590273 is a reply to message #541791] Tue, 22 June 2010 14:39 Go to previous messageGo to next message
Stephen Barrett is currently offline Stephen BarrettFriend
Messages: 46
Registered: May 2010
Member
Yep Dimitris, that was the missing piece! Thanks again.

Is there a list of these implicit variables? Or a place to look in the code to find one? I knew this was a simple matter, I just didn't know the magic word.

--Stephen
Re: Accessing MapInfo structure from ECL [message #590331 is a reply to message #541797] Wed, 23 June 2010 11:30 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Stephen,

The book/documentation should really mention these as there's not a
single place in the code where all these implicit variables are defined
defined (e.g. matchInfo is added to the context in line 329 of
https://dev.eclipse.org/svnroot/modeling/org.eclipse.gmt.eps ilon/trunk/plugins/org.eclipse.epsilon.ecl.engine/src/org/ec lipse/epsilon/ecl/MatchRule.java)

Cheers,
Dimitris

Stephen Barrett wrote:
> Yep Dimitris, that was the missing piece! Thanks again.
>
> Is there a list of these implicit variables? Or a place to look in the
> code to find one? I knew this was a simple matter, I just didn't know
> the magic word.
>
> --Stephen
Re: Accessing MapInfo structure from ECL [message #590439 is a reply to message #541962] Mon, 05 July 2010 21:52 Go to previous messageGo to next message
Stephen Barrett is currently offline Stephen BarrettFriend
Messages: 46
Registered: May 2010
Member
Okay,

I am now passing values back to my application from match rules by adding do-parts of the following form to each rule:


do {
matchInfo.put("mirador", 0.7);
}


with the key being the name of my application. Do you think that this robust enough, or are there some gotchas I may be unaware of?

Also, Dimitirs you mentioned to me that after matching a pair of model elements with ECL, that I might want to recalculate overall similarity measures for the remaining element pairs in my model. Trouble is, I can't remember why this is so. Could you please refresh my memory?

Many thanks,
--Stephen
Re: Accessing MapInfo structure from ECL [message #590450 is a reply to message #544888] Mon, 05 July 2010 22:20 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Stephen,

On 05/07/2010 22:52, Stephen Barrett wrote:
> Okay,
>
> I am now passing values back to my application from match rules by
> adding do-parts of the following form to each rule:
>
>
> do {
> matchInfo.put("mirador", 0.7);
> }
>
>
> with the key being the name of my application. Do you think that this
> robust enough, or are there some gotchas I may be unaware of?

That should be fine indeed.

>
> Also, Dimitirs you mentioned to me that after matching a pair of model
> elements with ECL, that I might want to recalculate overall similarity
> measures for the remaining element pairs in my model. Trouble is, I
> can't remember why this is so. Could you please refresh my memory?

I think I was referring to recalculating matches whenever the user
establishes an explicit (i.e. manual) match - if that's supported by
Mirador.

>
> Many thanks,
> --Stephen
>

Cheers,
Dimitris
Re: Accessing MapInfo structure from ECL [message #590508 is a reply to message #544891] Tue, 06 July 2010 20:07 Go to previous messageGo to next message
Stephen Barrett is currently offline Stephen BarrettFriend
Messages: 46
Registered: May 2010
Member
> I think I was referring to recalculating matches whenever the user
> establishes an explicit (i.e. manual) match - if that's supported by
> Mirador.

Yes, that's what you were referring to. So, I suppose, my real question is, why do you think a recalculation might be needed? And by recalculation, I assume you mean redoing all the element similarity measures, and then rematching the elements based on the new measures. Is that accurate?

Regards,
--Stephen
Re: Accessing MapInfo structure from ECL [message #590512 is a reply to message #545160] Tue, 06 July 2010 20:24 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Stephen,

Suppose that you're comparing trees and you have the following sample trees:

[a]
-- [b]

and

[c]
-- [b]

and the following rule

rule MatchTrees
match l : Left!Tree
with r : Right!Tree {

compare : l.label = r.label and
l.parent.matches(r.parent)
}

In the initial comparison, the two [b]'s won't match because their
parents don't match ([a] <> [c]). However, if the user explicitly
declares that [a] matches with [c] then the two [b]'s should now match.
Does this make any sense?

Cheers,
Dimitris

On 06/07/2010 21:07, Stephen Barrett wrote:
>> I think I was referring to recalculating matches whenever the user
>> establishes an explicit (i.e. manual) match - if that's supported by
>> Mirador.
>
> Yes, that's what you were referring to. So, I suppose, my real question
> is, why do you think a recalculation might be needed? And by
> recalculation, I assume you mean redoing all the element similarity
> measures, and then rematching the elements based on the new measures. Is
> that accurate?
>
> Regards,
> --Stephen
Re: Accessing MapInfo structure from ECL [message #590524 is a reply to message #545164] Thu, 08 July 2010 12:55 Go to previous message
Stephen Barrett is currently offline Stephen BarrettFriend
Messages: 46
Registered: May 2010
Member
Ah. The light goes on. Thanks Dimitris!
Previous Topic:[eol] problem with creating a native java String
Next Topic:EWL Guard Querying Stereotype
Goto Forum:
  


Current Time: Tue Apr 16 13:36:11 GMT 2024

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

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

Back to the top