Difference between revisions of "VIATRA/Releases/Query/NewAndNoteWorthy0.9"
m (Harmath.incquerylabs.com moved page EMFIncQuery/Releases/NewAndNoteWorthy0.9 to VIATRA/Releases/Query/NewAndNoteWorthy0.9: Migration)
Latest revision as of 03:07, 28 February 2016
New and Noteworthy - EMF-IncQuery 0.9.0
Updated to Xtext 2.7
EMF-IncQuery 0.9 was developed and tested with Xtext 2.7. The runtime still works without Xtext installed, but the tooling requires Xtext 2.7 (available from the Luna update site since SR1).
Generalized API for non-EMF query scopes
Starting with version 0.9, it possible to instantiate an IncQueryEngine over non-EMF models and formulate queries appropriate against that kind of model. This required some minor changes to the API.
- An IncQueryEngine can now be instantiated for a scope of query evaluation defined by the newly introduced org.eclipse.incquery.runtime.api.scope.IncQueryScope interface. For querying over EMF models, use the org.eclipse.incquery.runtime.emf.EMFScope class, which encompasses an EMF model root (ResourceSet, Resource or containing EObject) as well as the EMF-specific BaseIndexOptions (such as dynamic mode or wildcard mode).
- Query specification declare the type of scope they can be evaluated on by the getPreferredScopeClass() method. For example, EMF model queries can only be evaluated on EMF models.
- The getBaseIndex() method on the IncQuery engine returns a non-EMF-specific interface of the base model index. To use EMF-specific features, refer to org.eclipse.incquery.runtime.emf.EMFScope.extractUnderlyingEMFIndex().
Warnings for recursive pattern calls
The use of recursive pattern calls is problematic in EMF-IncQuery: when used incorrectly, its usage may result in incorrectly updated match sets after deletion. Furthermore, using recursion in a negative pattern composition or match counter cannot be evaluated at all.
In version 0.9.0 a new validator was added to the language that warns when using recursive calls (for the usual cases it is better to use the transitive closure support), and issues an error when used with pattern composition.