Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Hawk » Suggestion for model comparison(comparison of model types at two different time stamp.)
Suggestion for model comparison [message #1810494] Mon, 12 August 2019 17:23 Go to next message
Saheed Popoola is currently offline Saheed PopoolaFriend
Messages: 21
Registered: June 2019
Junior Member
Hi, this may be a little bit off-topic.
I'm trying to compare instances of a model type at two different time stamps (a form of model differencing with two versions). I was thinking of using an external tool (e.g emfcompare), but I thought I should ask maybe you've done such comparison anywhere in Hawk or if you have an external tool that you think can be easily adapted to Hawk.
Re: Suggestion for model comparison [message #1810498 is a reply to message #1810494] Mon, 12 August 2019 18:02 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Hi Saheed,

We haven't done model comparison directly with Hawk, but it may be possible if you use a remote access descriptor [1]. You could use one descriptor to retrieve the version at a certain timepoint, and another descriptor for another timepoint. In theory, since this would expose each version as its own EMF resource, you should be able to use plain EMF Compare between the two.

Give it a try and let me know how it works for you.

[1]: https://github.com/mondo-project/mondo-hawk/wiki/Eclipse-based-clients#editor-for-remote-model-access-descriptors

Kind regards,
Antonio
Re: Suggestion for model comparison [message #1810504 is a reply to message #1810498] Mon, 12 August 2019 19:43 Go to previous messageGo to next message
Saheed Popoola is currently offline Saheed PopoolaFriend
Messages: 21
Registered: June 2019
Junior Member
Thanks for the suggestion. I'll give it a try and let you know how it goes.
Re: Suggestion for model comparison [message #1810641 is a reply to message #1810504] Thu, 15 August 2019 04:08 Go to previous messageGo to next message
Saheed Popoola is currently offline Saheed PopoolaFriend
Messages: 21
Registered: June 2019
Junior Member
I'm having some issues here. First I'm unable to access" the remote model access descriptor EDITOR" in the link you mentioned. How do I open the GUI from my Eclipse.
Secondly, if I call a method, e.g Model.allInstances, is it possible to save the results as a model ( .hawkmodel)
Re: Suggestion for model comparison [message #1810698 is a reply to message #1810641] Fri, 16 August 2019 13:18 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Hi Saheed,

Oh, I forgot to add a mention of how to access it to the wiki page. Just did that. To create a .hawkmodel file, use "File > New > Other... > Hawk > Remote Hawk Model Descriptor File" from the Eclipse IDE.

.hawkmodel files are views on an existing graph. What you do is create one, and then use the appropriate query in the "Contents > Query" field (see the screenshot on Github).

Kind regards,
Antonio
Re: Suggestion for model comparison [message #1811048 is a reply to message #1810698] Mon, 26 August 2019 04:45 Go to previous messageGo to next message
Saheed Popoola is currently offline Saheed PopoolaFriend
Messages: 21
Registered: June 2019
Junior Member
I tried following the steps (File>New>Other>Hawk>Local Hawk Model Descriptor) for a time-aware local hawk but I could not load any EMF resource in the localhawkmodel file. However, when I tried the same steps for a non-timeAware local Hawk, I was able to load the EMFresource in the .localhawkmodel file.
Secondly, the class "org.hawk.emfresource.impl.LocalHawkResourceImpl" requires a URI of a resource. Which URI/resource is this (is it from the location of the model file to be index or metamodel URI, etc), and is it possible to access the URI of a model resource within a class that extends the TimeAwareEOLQueryLanguage.

My guess at the first problem (which may be wrong) was that it was caused by a "typenode cannot be reloaded" or "null pointer error" that occur at "
at org.hawk.greycat.GreycatNode.getEdgesWithType(GreycatNode.java:692)
at org.hawk.greycat.GreycatNode.getOutgoingWithType(GreycatNode.java:679)
at org.hawk.greycat.GreycatNode.getOutgoingWithType(GreycatNode.java:1)
at org.hawk.graph.ModelElementNode.getFirstEndNode(ModelElementNode.java:321)
at org.hawk.graph.ModelElementNode.getTypeNode(ModelElementNode.java:87)
at org.hawk.emfresource.impl.LocalHawkResourceImpl.createOrUpdateEObject(LocalHawkResourceImpl.java:672)
at org.hawk.emfresource.impl.LocalHawkResourceImpl.createOrUpdateEObjects(LocalHawkResourceImpl.java:618)
at org.hawk.emfresource.impl.LocalHawkResourceImpl.fetchNodes(LocalHawkResourceImpl.java:356)".

because I do get the error when I run directly from the source code (as an instance of eclipse application) for the timeaware Hawk but I don't get such error for the non-time aware hawk.
Re: Suggestion for model comparison [message #1811130 is a reply to message #1811048] Tue, 27 August 2019 09:29 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

The issue is that the .localhawkmodel file will be loaded in the initial time instant (0), which by definition has nothing: I just tried it, with no errors ike the ones.

The URL would be the URL to the .localhawkmodel file, which simply contains the name of the Hawk index to be exposed as a resource. Unfortunately, this simple design does not allow for any options to be provided, so it is rather limited in that regard. You need to use a remote Hawk model descriptor file as indicated in my post above: that way you can specify a query that will give you the contents of the resource at the appropriate point in time. This means that you will need a Hawk server running in your machine: the Github wiki has instructions on how to set it up.

I'll give it a think and see if we can incorporate time-awareness into .localhawkmodel files in some simple way.
Re: Suggestion for model comparison [message #1811152 is a reply to message #1811130] Tue, 27 August 2019 16:58 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

I've tried remote model descriptors: trying to open a model as an EMF Resource using Model.allInstancesNow fails, because the graph-to-Thrift encoder does not handle well temporal graph nodes.

The local descriptors are limited in that they are only a name, so you can't provide a timepoint. It might be best to create a dedicated descriptor which adds a timepoint on top of the traditional local Hawk descriptor.

I've created Github issues for fixing the bug with the remote descriptor and adding this new kind of local descriptors:

https://github.com/mondo-project/mondo-hawk/issues/85
https://github.com/mondo-project/mondo-hawk/issues/86

Feel free to subscribe to them. I'll take a stab at both through this week, but it may take me a few days!
Re: Suggestion for model comparison [message #1811219 is a reply to message #1811152] Thu, 29 August 2019 00:44 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Issue 85 is now fixed. Once Hawk rebuilds in Travis, you should be able to upgrade to it and use .hawkmodel files (not .localhawkmodel files) with queries, and they should be compatible with EMF Compare. Say that you have two .hawkmodel files. Assuming your root model type is "Log":

* The first .hawkmodel file would use "return Log.latest.all.first;" -> oldest version of the root model element
* The second .hawkmodel file would use "return Log.latest.all.first.next;" -> next oldest version of the root model element

You could then select both in Eclipse and use the typical "Compare with -> Each Other" option to see their differences.

Issue 86 is still pending for now.

[Updated on: Thu, 29 August 2019 10:20]

Report message to a moderator

Re: Suggestion for model comparison [message #1811268 is a reply to message #1811219] Thu, 29 August 2019 22:23 Go to previous messageGo to next message
Saheed Popoola is currently offline Saheed PopoolaFriend
Messages: 21
Registered: June 2019
Junior Member
Thanks. For some time now, I've been having issues using the thrift-based remote hawk. I followed the process for connecting via the mondo-hawk server but I always seems to get the same problem.
When creating a new instance of Hawk, once I choose the remote thrift option, no backend or model updater is loaded and I cannot create a new remote instance. I'm able to run the server, although I'm not sure if the default URL matches the server URL (The server starts on TCP server port 2080, thrift protocol TUPLE, )[i tried both port 2080 and 8080]
Re: Suggestion for model comparison [message #1811344 is a reply to message #1811268] Sat, 31 August 2019 16:27 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

That can only happen if the Eclipse Hawk GUI cannot talk to the server. The default URL does match the server, which by default listens both on port 2080 (raw TCP) and port 8080 (HTTP).

Are you using Windows? It may be a firewall issue: we've had Windows users that have run into this.
Re: Suggestion for model comparison [message #1813512 is a reply to message #1811344] Sat, 31 August 2019 22:05 Go to previous message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Issue 86 has now been resolved as well: .localhawkmodel files can be created now with a custom timepoint, and they will show the contents of the graph at that timepoint. They are also associated with the EMF Compare content type, so you may select two and use Compare With -> Each Other.

Give it a try and let me know how it works for you!
Previous Topic:allInstancesAt return a numberFormat Excepotion
Next Topic:Indexing custom EMF Resources
Goto Forum:
  


Current Time: Wed Apr 24 22:01:02 GMT 2024

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

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

Back to the top