EMF-IncQuery

Introductory example: School

Overview

The aim of this page is to provide an easy-to-understand, step-by-step guide to EMF-IncQuery. For this purpose, the school example features a simple EMF model and some simple graph patterns to show the very basics of the query language and the core add-ons.

Obtaining the example

In the simple case, you can install the School example from the IncQuery Extra update site.

Alternatively (for advanced users): you will need two Eclipse workspaces to try this example.

Metamodel pattern matching example: Ecore Queries

Overview

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.

EMF-IncQuery New Generation development progress

A new, completely redesigned EMF-IncQuery is now in the works, with many new features - including an Xtext2-based query development tool and an interpretative query API to allow queries without having to generate code. Check out details at the corresponding page.

EMF-IncQuery Examples and Demos

The examples below correspond to updated versions of the old examples.

Introductory example: school

The school example features a simple EMF model and some simple graph patterns to show the very basics of using EMF-IncQuery. Read this first before anything else!

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.

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).  You only need to add a single line of hand-written code per pattern, to initialize the generated pattern builder as follows:

Metamodel pattern matching example: ECore Queries

Overview

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.

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.

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.

Syndicate content