Technology Overview

"New Generation" (versions 0.6.x and beyond) represent an almost complete rewrite of IncQuery technology.

IncQuery New Generation Architecture

IncQuery supports the following new features (with respect to 0.4):

  • an interpretative query API, enabling query developers to invoke model queries without having to generate code (to speed up development)
  • a new, Xtext2-based development environment, with full support for any EMF domain
  • full support for incremental transitive closures and core backward getters through IncQuery Base
  • integrated support for add-ons such as derived features, standalone mode and the Validation Engine

Runtime and API

The complex query evaluator of the EMF-IncQuery framework is built on a graph pattern matching engine that uses the Rete algorithm, adapted from expert systems to facilitate the efficient storage and retrieval of partial views of graph-like models. EMF-IncQuery also features the Base component that provides incremental support for backward getters as well as transitive closures for the efficient computation of e.g. reachability regions. EMF-IncQuery relies on the EMF Notification facility to incrementally update its internal cache to guarantee the consistency of the result set with respect to the actual contents of the model.

As an interface over the core algorithms, the new IncQuery runtime consists of:

  • a query / pattern matching API that provides a typesafe wrapper for instantiating and executing queries over EMF Notifiers (Resources, ResourceSets and EObject hierarchies)
  • add-ons such as the Validation Framework (for the specification and on-the-fly execution of well-formedness rules, corresponding to Eclipse Resource Markers) or Derived feature support (for the efficient evaluation of derived EAttributes and EReferences with IncQuery queries as back-ends, that can be used for soft interlinks)

The runtime is designed to be compatible with standard Eclipse-EMF configurations as well as a headless, standalone execution mode. The efficiency of the execution engine has been demonstrated in an industrial setting as well as in several academic research case studies.

Tooling and language

The new IncQuery tooling consists of an Xtext-based pattern language editor, and a development UI that can be used to execute, test and debug queries within the Eclipse IDE. The tooling can make use of the interpretative runtime API for on-the-fly query execution and testing, while it can also generate type-safe wrappers that ease the integration of queries into application code. The tooling also interfaces with IncQuery’s add-ons to generate feature-specific adapter code.

IncQuery’s declarative queries can be evaluated over EMF models without manual (programmed) traversal. The query language is built upon the concepts of graph patterns (which is a key concept in many transformation tools) to provide a concise, reusable and easy way to specify complex structural model queries. The key features are:

  • complex interconnections of EMF objects can be easily formulated as a graph pattern,
  • the language is highly expressive and provides powerful features such as negation or counting,
  • queries can be evaluated with great freedom, i.e. input and output parameters can be bound freely at evaluation time,
  • graph patterns are composable, making it possible to build reusable query libraries.