Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF-IncQuery » Non-persisted resources for AdvancedAPI
Non-persisted resources for AdvancedAPI [message #1061630] Mon, 03 June 2013 11:16 Go to next message
Emre T is currently offline Emre TFriend
Messages: 119
Registered: April 2013
Senior Member
Hello there!

Normally, we use the serialized pattern models (e.f. GlobalEiqModel.xmi) within the AdvancedAPI of IncQuery to search for patterns, exploit them etc. And we call them through their URI's.

My question is, wouldn't it work to give a valid pattern model resource to the AdvancedAPI without persisting it? So the call won't be over an URI, since this pattern model resource is not persisted. But it will exist in the memory, and a special method can be implemented to call it. When I do such a thing, I get a long error, that in the end says to consult the developers. Smile

Something like the following:

The following error occurred during the preparation of an EMF-IncQuery pattern matcher: Error during constructing Rete pattern matcher; please review Error Log and consult developers

1 [main] FATAL org.eclipse.incquery.runtime.1406134113 - EMF-IncQuery Base encountered an error while traversing the EMF model to gather new information.
org.eclipse.incquery.runtime.rete.construction.RetePatternBuildException: Error during constructing Rete pattern matcher; please review Error Log and consult developers
...
...
...
Caused by: java.lang.IllegalArgumentException: Classifier org.eclipse.emf.ecore.impl.EClassImpl@122a0071 (eProxyURI: file:/Users/user/Documents/plugin/x.y.z/model/model.ecore#//something/Something) is an unresolved proxy
...
...
...

org.eclipse.incquery.runtime.exception.IncQueryException: The following error occurred during the preparation of an EMF-IncQuery pattern matcher: Error during constructing Rete pattern matcher; please review Error Log and consult developers!ENTRY org.eclipse.incquery.patternlanguage.emf.ui 4 0 2013-06-03 13:03:37.079
!MESSAGE EMF-IncQuery Base encountered an error while traversing the EMF model to gather new information.

!STACK 0
org.eclipse.incquery.runtime.rete.construction.RetePatternBuildException: Error during constructing Rete pattern matcher; please review Error Log and consult developers
...
...
...
Caused by: java.lang.IllegalArgumentException: Classifier org.eclipse.emf.ecore.impl.EClassImpl@122a0071 (eProxyURI: file:/Users/user/Documents/plugin/x.y.z/model/model.ecore#//something/Something) is an unresolved proxy


Do you have any comments on that? I would be very glad for any kind of help.

Thank you!

P.S. If you would like to see the whole error log, I can post it, too.

[Updated on: Mon, 03 June 2013 11:18]

Report message to a moderator

Re: Non-persisted resources for AdvancedAPI [message #1061637 is a reply to message #1061630] Mon, 03 June 2013 11:35 Go to previous messageGo to next message
Istvan Rath is currently offline Istvan RathFriend
Messages: 54
Registered: July 2009
Member
Hi Emre,

EMF-IncQuery does not place any restriction on what kind of Resource the Pattern model resides in. Your setup seems to be somewhat special as your Pattern model contains dynamic EClass references.

Judging from the error message, the following might happen: when our engine attempts to read and traverse this model, these references are not resolvable. This is very likely not an EMF-IncQuery issue, but some problem with your model and/or approach. For instance, are you sure that the references are correct? (Are the paths correct?)

cheers
Istvan
Re: Non-persisted resources for AdvancedAPI [message #1061640 is a reply to message #1061637] Mon, 03 June 2013 11:43 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 222
Registered: July 2009
Senior Member
Hi, Emre

the issue is that EMF resolves proxies with regards to a resource/resourceset. I don't see why you do need proxies, but if there are any, then you have to use an EMF Resource/ResourceSet.

Cheers,
Zoltán
Re: Non-persisted resources for AdvancedAPI [message #1061648 is a reply to message #1061637] Mon, 03 June 2013 11:48 Go to previous messageGo to next message
Emre T is currently offline Emre TFriend
Messages: 119
Registered: April 2013
Senior Member
Hello Istvan,

thanks for the quick reply. Yes, indeed, my pattern models have dynamic references, instead of namespaces, but as you sad, this has something to with how I realize my pattern models. I can eliminate this difference on the other side of my approach/application, when I persist my models. But my goal is to do the same without the persistence of the pattern models.

But it is a clear answer for me to know, that IncQuery does not differentiate in what kind of resources the pattern models reside in.

If I am not mistaking, you had sad, that the support for dynamic references are on the way. Do you mind if I ask, when this will be available to the developers?

Best regards,
Emre
Re: Non-persisted resources for AdvancedAPI [message #1061654 is a reply to message #1061648] Mon, 03 June 2013 12:06 Go to previous messageGo to next message
Istvan Rath is currently offline Istvan RathFriend
Messages: 54
Registered: July 2009
Member
Quote:
But it is a clear answer for me to know, that IncQuery does not differentiate in what kind of resources the pattern models reside in.


As Zoltán has pointed out, the only thing that is important is that they should be inside some Resource/ResourceSet for the proxy resolution to work. I.e. you have to make sure to instantiate your Pattern instance and add it to an (in-memory) Resource or ResourceSet.

Quote:
If I am not mistaking, you had sad, that the support for dynamic references are on the way. Do you mind if I ask, when this will be available to the developers?


If everything goes as planned, we'll be pushing out an integration build towards the 2nd half of this week. The novelty (from your perspective) will be that you will be allowed to mix-n-match dynamic references with URI-based ones, because the pattern matcher will treat EClasses that have the same "fully qualified name" (i.e. package . classname) as identical types, regardless of how they are referenced. This will also mean that the Query Explorer will work with dynamic instance models too.
Re: Non-persisted resources for AdvancedAPI [message #1061839 is a reply to message #1061654] Tue, 04 June 2013 10:26 Go to previous message
Gabor Bergmann is currently offline Gabor BergmannFriend
Messages: 21
Registered: July 2009
Junior Member
Istvan Rath wrote on Mon, 03 June 2013 14:06
But it This will also mean that the Query Explorer will work with dynamic instance models too.


Not with unresolvable proxies in the pattern model, though.

Emre: if the pattern model is not a readable EMF model, i.e. EMF cannot resolve the proxies to external elements such as referenced types, then clearly there is nothing that EMF-IncQuery can do about it.

Why do you put in proxies in the first place? Why not actual references to EClasses etc.? How do you assemble your pattern model?

Quote:
Normally, we use the serialized pattern models (e.f. GlobalEiqModel.xmi) within the AdvancedAPI of IncQuery to search for patterns, exploit them etc.

Do I understand correctly that you want to match patterns _on_ pattern models as instance models? Wow, this is an interesting use case Smile I don't think we have any advertised way of doing that, but anyways BaseGeneratedQuerySpecification.getModelRoot(String bundleName) should parse the pattern model the same way that the generated matcher API does.

Quote:
And we call them through their URI's.(...)So the call won't be over an URI, since this pattern model resource is not persisted.

What does this mean? Nowhere in the EMF-IncQuery API do we use URIs, I have no idea what you are talking about.

[Updated on: Tue, 04 June 2013 10:26]

Report message to a moderator

Previous Topic:Running IncQuery transformation inside an Eclipse WorkspaceJob
Next Topic:Support for Xtext 2.4?
Goto Forum:
  


Current Time: Sat Dec 20 16:43:38 GMT 2014

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

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