EMF-IncQuery examples 0.4

 

This page is relevant for EMF-IncQuery version 0.4 and before! For the current version, go here!

EMF-IncQuery examples

Toy example: school

The school example features a simple EMF model and some simple graph patterns to show the very basics of using EMF-IncQuery.

Model validation example: Papyrus UML

Although model queries and incrementally evaluated queries in particular have many usage scenarios, our case study in particular focuses on finding violations of structural well-formedness constraints. The domain (Ecore metamodel) used in the example is (the standard EMF representation of) UML2, and the example contains some graph patterns over UML2 models that express conditions when well-formedness or modeling convention rules are violated.

Metamodel pattern matching example: ECore Queries

Have you ever tried to query a meta-model, i.e. a model consisting of EClasses, EAttributes, and EReferences, against a meta-model pattern? For an example, look here. In this case, we want to look for a certain sub-configuration in an ECore metamodel, where two EClasses (each having an EAttribute of type EString) are connected by a 0-* EReference.

Use-cases of this technique include meta-transformation, meta-model analysis, higher-order transformations where transformation rules are generated/parameterized by metamodel analysis etc.

Using IncQuery in standalone EMF configurations

IncQuery can now also be used in standalone EMF configurations, i.e. outside of the Eclipse/OSGi environment (e.g. in command line apps or Java Enterprise applications).

Using queries for derived features

We demonstrate how our high performance queries can be easily integrated with other EMF tools using an entirely new case study in which EMF-IncQuery is deeply integrated into the EMF modeling infrastructure to facilitate the incremental evaluation of derived EAttributes and EReferences.