Home » Modeling » EMF » [EMF Query2]first steps with EMF query2
| | |
Re: [EMF Query2]first steps with EMF query2 [message #651580 is a reply to message #651523] |
Mon, 31 January 2011 12:43   |
Eclipse User |
|
|
|
Hi Aurelien,
Thanks for your comments
Please find answers to your questions below.
Quote: |
You recommend m eto use a nightly build? Is there a stable release? At least, when is planned the stable release? for Indigo?
|
We dont have a release yet, but we are planning to have a parallel release and in the M1 of the next mainstream eclipse release.
Quote: |
I think that I will use the builder on the project in my case. I suppose that the builder will incrementally modify the index on file save? Am I right? or is it also register on-the-fly modification (that are not already saved)?
|
Yes you are right.The builder will modify the index on file save, not on the on-the-fly modification.
Quote: |
On other hands, do you have some benchmarks? In order to have an idea of the gain than browsing "manually" the model.
|
We dont have the benchamark reports yet.But we have done some internally and are planning to publish the same very soon.
Quote: |
Also an idea of the time spent for indexing files? Do I need to reindex them at startup?
|
It will depend on how you load your resources.Generally the indexing engine is pretty fast.
For our Testing UI(Builder scenario) we store our indexes at the plug-in's metadata location, but it can be configured.Once the index is created it is not rebuilt on startup, only gets modified if you change something in the IDE session.
If the index is not built, then on the startup the indexes will be built.
I hope this helps.
Please let us know if you are stuck somewhere.
cheers,
Saurav
[Updated on: Mon, 31 January 2011 12:44] by Moderator
|
|
| | |
Re: [EMF Query2]first steps with EMF query2 [message #651739 is a reply to message #651580] |
Tue, 01 February 2011 07:38   |
Eclipse User |
|
|
|
Hi Saurav,
just out of curiosity. Have you guys tested the indexer with Resources
stored in a CDO Repository?
I wonder if how such indexer would work if there is a Resource that can
be modified remotely. I guess in that case, that indexer / builder
should be at server side, instead. Queries could be also, ideally, be
executed at server side to avoid latency-wise expensive roundtripping.
The good thing about CDO is that a Resource doesn't need to be fully
loaded to access any of its children EObjects, which seems to be the
optimization premise of the indexer.
My main concern is scalability. I actually integrated EMF Query v1 with
our own document generation engine, and it ends up traversing the whole
model. I think CDO could benefit from such indexer, but first is should
be analyzed whether the concepts are compatible in a distributed
environment.
So, any plans/ideas of integration? Do you foresee the indexer would
improve the query performance in such scenario?
Cheers!
saurav escribió:
> Hi Aurelien,
>
> Thanks for your comments :p
> Quote:
>> You recommend m eto use a nightly build? Is there a stable release? At
>> least, when is planned the stable release? for Indigo?
>
> We dont have a release yet, but we are planning to have a parallel
> release and in the M1 of the next mainstream eclipse release.
>
> Quote:
>> I think that I will use the builder on the project in my case. I
>> suppose that the builder will incrementally modify the index on file
>> save? Am I right? or is it also register on-the-fly modification (that
>> are not already saved)?
>
>
> Yes you are right.The builder will modify the index on file save, not on
> the on-the-fly modification.
>
> Quote:
>> On other hands, do you have some benchmarks? In order to have an idea
>> of the gain than browsing "manually" the model.
>
>
> We dont have the benchamark reports yet.But we have done some internally
> and are planning to publish the same very soon.
>
> Quote:
>> Also an idea of the time spent for indexing files? Do I need to
>> reindex them at startup?
>
>
> It will depend on how you load your resources.Generally the indexing
> engine is pretty fast.
>
> For our Testing UI(Builder scenario) we store our indexes at the
> plug-in's metadata location, but it can be configured.Once the index is
> created it is not rebuilt on startup, only gets modified if you change
> something in the IDE session.
>
> If the index is not built, then on the startup the indexes will be build.
>
> I hope this helps.
> Please let us know if you are stuck somewhere. :p
> cheers,
> Saurav
>
>
>
>
>
>
|
|
|
Re: [EMF Query2]first steps with EMF query2 [message #651775 is a reply to message #651726] |
Tue, 01 February 2011 09:57   |
Eclipse User |
|
|
|
Hi Aurelien,
Please find answers to your questions below.
Aurelien Pupier wrote on Tue, 01 February 2011 07:55 | Hi Saurav,
thanks for your answers.
I'm trying to make my first query correctly. I would like to have all element of that inherits of Type A inside an element.
I don't see how to query with abstract class.
|
You can mention your query by passing the abstract type.But in your case it will not return results since you are invoking the EObjectQuery directly.
If you want to use Query2 core instead of the direct index based queries i would suggest to go for a query language.
In a query language you can specify your queries with abstract types like this
SelectType: from AbstractType as AT select AT
Where AbstractType is your Abstract class.The Query engine in turn will look into all the concrete class instances and return the result for you.
Quote: |
To search into an element, I suppose that I need to use the scope variable that is in one of the example but what is its type? and what about isInclusiveScope?
Let's talk a look at my request:
final EObjectQuery<EObjectDescriptor> eObjectQuery = IndexQueryFactory.createEObjectQuery();
eObjectQuery.eClassURI(EcoreUtil.getURI(XXXPackage.Literals.YYY)); <<< here it seems that I can put only the concrete class
final List<URI> result = new ArrayList<URI>();
IndexFactory.getInstance().executeQueryCommand(new QueryCommand() {
public void execute(QueryExecutor queryExecutor) {
QueryResult<EObjectDescriptor> execute = queryExecutor.execute(eObjectQuery);
for (EObjectDescriptor objDesc : execute) {
URI candidateResourceUri = objDesc.getResourceURI();
//boolean isInScope = scope.contains(candidateResourceUri); <<<< What is the typeof scope?
// if (isInclusiveScope == isInScope) { <<<< What is isInclusiveScope?,
// add uri of instance to result
result.add(candidateResourceUri.appendFragment(objDesc.getFragment()));
// }
}
}
});
return result;
|
Generally there are two scopes one is the global scope which is actually the scope mentioned in the Query execution and the other is when user specify the inclusive scope in the query itself like.
ManuscriptsInBerlinOrHamburg2:
from
Library as lib
in resources {"platform:/resource/org.eclipse.emf.query2.librarytest/data/library/Hamburg.xmi",
"platform:/resource/org.eclipse.emf.query2.librarytest/data/library/Berlin.xmi"},
Book as b,
Manuscript as m
select m
where lib.books = b
and b.instanceOf = m
So the scope object is the scope calculated internally intersecting both the scopes.
Quote: |
some other questions:
Whaty is the recommended query language to use?
Are they sensible difference of performance between them?
|
We prefer the XText based Query language to be used.
For that you get the Query UI which can be used to test your queries and check the model data quickly.Performance wise we dont see any difference.
Quote: |
BTW, I updated the wiki for the ID of natures and builder. I think that an update for the exampe to get EObject of a certain type might be updated too , as soon as I will know how to use result correctly.
Regards,
|
Many thanks for updating for the wiki.
We hugely appreicate that.
Request you to open bugzilla for any kind of bugs, enhance ment or documenation request.
cheers,
Saurav
[Updated on: Tue, 01 February 2011 09:57] by Moderator
|
|
|
Re: [EMF Query2]first steps with EMF query2 [message #651792 is a reply to message #651739] |
Tue, 01 February 2011 10:55   |
Eclipse User |
|
|
|
Hi Victor,
Thanks for the comments/idea.
Please find the answers/comments below.
Victor Roldan Betancort wrote on Tue, 01 February 2011 07:38 | Hi Saurav,
just out of curiosity. Have you guys tested the indexer with Resources
stored in a CDO Repository?
I wonder if how such indexer would work if there is a Resource that can
be modified remotely. I guess in that case, that indexer / builder
should be at server side, instead. Queries could be also, ideally, be
executed at server side to avoid latency-wise expensive roundtripping.
|
Actually we had looked at this possibility.We tried of having Query2 as a common query language for CDO alongwith OCL.
I created a prototype for execution of Query2 in the MEMStore
More details and the prototypical code can be found here.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=329723
Quote: |
The good thing about CDO is that a Resource doesn't need to be fully
loaded to access any of its children EObjects, which seems to be the
optimization premise of the indexer.
My main concern is scalability. I actually integrated EMF Query v1 with
our own document generation engine, and it ends up traversing the whole
model. I think CDO could benefit from such indexer, but first is should
be analyzed whether the concepts are compatible in a distributed
environment.
So, any plans/ideas of integration? Do you foresee the indexer would
improve the query performance in such scenario?
Cheers!
|
I also strongly feel the query performance will improve in this scenario.We have plans for this integration.Do you wish to use Query2 for your engine ?We can probably work together to drive this forward.
Any further ideas/comments on this topic would be welcome.
cheers,
Saurav
|
|
| | | |
Re: [EMF Query2]first steps with EMF query2 [message #652258 is a reply to message #651792] |
Thu, 03 February 2011 06:32   |
Eclipse User |
|
|
|
Hi saurav,
sorry for the delayed answer, yesterday was day-off in Tenerife ;)
comments below:
saurav escribió:
> Hi Victor,
>
> Thanks for the comments/idea.
> Please find the answers/comments below.
>
> Victor Roldan Betancort wrote on Tue, 01 February 2011 07:38
>> Hi Saurav,
>>
>> just out of curiosity. Have you guys tested the indexer with Resources
>> stored in a CDO Repository?
>>
>> I wonder if how such indexer would work if there is a Resource that
>> can be modified remotely. I guess in that case, that indexer / builder
>> should be at server side, instead. Queries could be also, ideally, be
>> executed at server side to avoid latency-wise expensive roundtripping.
>
>
> Actually we had looked at this possibility.We tried of having Query2 as
> a common query language for CDO alongwith OCL.
> I created a prototype for execution of Query2 in the MEMStore More
> details and the prototypical code can be found here.
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=329723
As soon as I finish with some pending bugs, I'll look at your
contribution and perform some experiments :)
> Quote:
>> The good thing about CDO is that a Resource doesn't need to be fully
>> loaded to access any of its children EObjects, which seems to be the
>> optimization premise of the indexer.
>>
>> My main concern is scalability. I actually integrated EMF Query v1
>> with our own document generation engine, and it ends up traversing the
>> whole model. I think CDO could benefit from such indexer, but first is
>> should be analyzed whether the concepts are compatible in a
>> distributed environment.
>>
>> So, any plans/ideas of integration? Do you foresee the indexer would
>> improve the query performance in such scenario?
>>
>> Cheers!
>
>
> I also strongly feel the query performance will improve in this
> scenario.We have plans for this integration.Do you wish to use Query2
> for your engine ?We can probably work together to drive this forward.
>
> Any further ideas/comments on this topic would be welcome.
Sure, I think is a key feature for CDO. OCL is not exactly scalable at
server side...
Hope to come back to you with nice findings when ready ;)
Cheers!
|
|
| |
Goto Forum:
Current Time: Tue Jul 01 10:58:29 EDT 2025
Powered by FUDForum. Page generated in 0.13126 seconds
|