[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: Solutions for quering EMF models

Hi, Nirmal,

See some replies in-line, below.

HTH,

Christian


On Fri, 2009-05-08 at 18:01 +0200, Nirmal Sasidharan wrote:
Hello,

I would like to know if these are the options available for querying a 
EMF model:

Do you mean, are these all of the solutions that have been implemented, anywhere?  Who can know that?  I'm sure that *somebody* has implemented some query infrastructure for EMF that you haven't listed.  They just haven't made it know at Eclipse.org.  :-)

Actually, I can think of one:  OCL on its own (without EMF Query).  In combination with allInstances() for finding the initial search extent, boolean expressions for selecting objects (including using the select and reject iterators), and Tuples for projecting values from objects, OCL effectively implements a full-featured query language.  It doesn't have as many higher-order constructs as, say, SQL, but it can get the job done.

1. Traversing your model manually
2. Using EMF Query
3. Using EMF Query (with OCL)
4. Using Teneo and running a SQL like query (Of course, if database 
persistency is not intended this wouldn't be a solution)
5. Using CDO (don't know if CDO integration would be advisable for non 
client-server applications)
....

Is there any solution like JoSQL (http://josql.sourceforge.net/) with 
which I could run a SQL like query on a EMF model?

I could be mistaken, but I think that CDO implements something like this.  I don't know about any actual connection with JoSQL, of course ... best to ask Eike or Simon about that.

I think it would be in the JoSQL project's interest to bridge their framework to EMF, to optimize it for EMF-generated models.  The nascent EMF Index component comes to mind in this context, too. :-)


Thanks in advance,

Regards,
Nirmal