Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » EMF-IncQuery » how load xml emf resource using api
how load xml emf resource using api [message #1422119] Fri, 12 September 2014 10:57 Go to next message
Tom Hassan is currently offline Tom HassanFriend
Messages: 3
Registered: September 2014
Junior Member
Hi ! How can I load the xml emf resource in order to call the queries using EMF IncQuery API ? I do not find anywhere . Thank you !
Re: how load xml emf resource using api [message #1422207 is a reply to message #1422119] Fri, 12 September 2014 13:45 Go to previous messageGo to next message
Gabor Bergmann is currently offline Gabor BergmannFriend
Messages: 28
Registered: July 2009
Junior Member
Hi,

Which "xml emf resource" do you mean? The one that contains the EMF instance model, the contents of which you wish to query?

If so, you can use the standard EMF API to instantiate a ResourceSet and use it to load the Resource. This is a general mechanism of EMF, not specific to EMF-IncQuery.

Hope that helps,
Gábor
Re: how load xml emf resource using api [message #1422213 is a reply to message #1422207] Fri, 12 September 2014 13:54 Go to previous messageGo to next message
Made Leine is currently offline Made LeineFriend
Messages: 11
Registered: September 2014
Junior Member
Yes . So , I loaded the instance model , but how can I query on this model ? I managed through API to load the model , the .eiq file , to get its content , but I am stuck here . I am sorry , I really can't understand . I used IncQueryHeadlessAdvanced for headless example.
Re: how load xml emf resource using api [message #1422227 is a reply to message #1422213] Fri, 12 September 2014 14:19 Go to previous messageGo to next message
Gabor Bergmann is currently offline Gabor BergmannFriend
Messages: 28
Registered: July 2009
Junior Member
Made Leine wrote on Fri, 12 September 2014 15:54
Yes . So , I loaded the instance model , but how can I query on this model ? I managed through API to load the model

I recommend reading the Javadoc of IncQueryEngine.
You should use e.g. IncQueryEngine.on(myResourceSet) to obtain an IncQuery instance that can evaluate queries against the model in the given resource set. You can then obtain Matcher objects associated with individual query specifications.

Made Leine wrote on Fri, 12 September 2014 15:54
I used IncQueryHeadlessAdvanced for headless example.

Well, this example method takes a parameter fileURI, which should be the URI of the instance model. However, you should not call this method, but rather read its code Smile

The headless example code, as well as its advanced version, is meant as a code example for you to read, in order to demonstrate the usage of the EMF-IncQuery API. It is not the API itself, it merely uses the API in one specific way. If you read the code, I believe it will be easy to follow.

I hope this clears it up for you,
Gábor
Re: how load xml emf resource using api [message #1422230 is a reply to message #1422227] Fri, 12 September 2014 14:23 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 342
Registered: July 2015
Senior Member
Hi,

I would add that it is better to look at the Usage examples part of the documentation: https://wiki.eclipse.org/EMFIncQuery/UserDocumentation/API#Typical_programming_patterns

It contains several different examples about using the IncQuery runtime API.

Cheers,
Zoltán
Re: how load xml emf resource using api [message #1423871 is a reply to message #1422230] Mon, 15 September 2014 05:28 Go to previous message
Made Leine is currently offline Made LeineFriend
Messages: 11
Registered: September 2014
Junior Member
Thank you so much for the answers!
I was giving as a parameter to IncQueryEngine.on(resource) the path to the ecore file . Now I understand.
Previous Topic:call queries IncQuery API
Next Topic:Duplication issue of Item and Edge in Zest graph
Goto Forum:
  


Current Time: Wed Sep 26 10:18:12 GMT 2018

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

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

Back to the top