emf-incquery eclipsecon europe 2011 modeling symposium talk

11
EMF-INCQUERY: A high-performance model query engine for EMF models István Ráth [email protected] Budapest University of Technology and Economics Fault Tolerant Systems Research Group

Upload: istvan-rath

Post on 21-Jan-2015

2.805 views

Category:

Technology


3 download

DESCRIPTION

Have a look at

TRANSCRIPT

Page 1: EMF-IncQuery EclipseCon Europe 2011 Modeling Symposium Talk

EMF-INCQUERY:A high-performance model query engine for EMF

models

István Rá[email protected]

Budapest University of Technology and EconomicsFault Tolerant Systems Research Group

Page 2: EMF-IncQuery EclipseCon Europe 2011 Modeling Symposium Talk

Overview A model query engine

o Supports batch querieso Optimized for incremental queries!

Incrementalityo Compute once, update afterwardso Gain: Instant re-evaluationo Price: Uses some more memory

• Manageable with proper life cycles

Why?o Queries are everywhere

• UI (views), business logic (transformations), tooling (validation)o Existing technology has performance issues with large modelso Current query languages are difficult (to reuse)

Query: a piece of code that looks/iterates

through certain parts of an (EMF) instance

model

Page 3: EMF-IncQuery EclipseCon Europe 2011 Modeling Symposium Talk

Benefits Makes on-the-fly well-formedness validation, view maintenance, …

feasible over really large instance modelso Large: >1M elementso Difference is noticeable for a few hundred elements too, depending on your

queries Simplifies writing really complex queries

o Graph pattern languageo Highly reusable, you can even build query librarieso Performance does not (significantly) depend on query complexity!

Easy-to-integrate into existing appso works with any EMF DSLo Query engine can be attached to any Notifier or TransactionalEditingDomain

Page 4: EMF-IncQuery EclipseCon Europe 2011 Modeling Symposium Talk

EXAMPLE

“All Behaviors must have an Operation as their specification.”o Otherwise they do not have any

“interface” through which they could be accessed “dead code”

Bad case:

A simple UML validation constraint

• Uses the IncQuery Validation Engine to manage validation markers on-the-fly

• No manual coding necessary• Generically integrates into EMF tree editors and

GMF editors

Expressive declarative query language by graph patterns

Capture local + global queriesCompositionality + Reusabilility „Arbitrary” Recursion, Negation

Page 5: EMF-IncQuery EclipseCon Europe 2011 Modeling Symposium Talk

Batch mode

Linear function of model size, orders of magnitude faster

Page 6: EMF-IncQuery EclipseCon Europe 2011 Modeling Symposium Talk

Incremental mode

Evaluation time is uniformly near zero

(independent of model size)

Page 7: EMF-IncQuery EclipseCon Europe 2011 Modeling Symposium Talk

Application

Framework

API

EMF-INCQUERY Architecture v0.7

RETE Core EMF INC PM Core

Your code

Pattern/Query

specification

Generated pattern matcher

IncQuery BASE

tooling

Reflective pattern matcher

Validation Engine

• The RETE algorithm makes all the magic work

• Well-known in rule-based systems

Page 8: EMF-IncQuery EclipseCon Europe 2011 Modeling Symposium Talk

IncQuery BASE Light-weight Java library for simple (yet very powerful) EMF model

queries, with incremental evaluation Supports

o Get all instance elements by typeo Reverse navigation along referenceso Get model elements by attribute value/type

Very easy to integrate into any EMF tool (pure Java) – standalone! Same high performance and scalability as IncQuery Incremental transitive closure

o Computation of e.g. reachability regions, connected model partitions, …o Innovative new algorithm for general graphs

Page 9: EMF-IncQuery EclipseCon Europe 2011 Modeling Symposium Talk

Development roadmap: IncQuery v0.7 Tooling

o Xtext2-based toolingo Incorporating

• Unlimited recursion and transitive closure• Short attribute notation• Aggregate functions• Match (or even exceed) most of the expressive power of OCL, while providing

better re-use and more concise notation

Runtimeo Reflective queries

• Build and execute queries on-the-fly, using Java and IQ PLo RETE construction optimizations

• Goal: to significantly reduce memory footprint

Page 10: EMF-IncQuery EclipseCon Europe 2011 Modeling Symposium Talk

Further plans & collaboration opportunities

Integrate IncQuery Base and IncQuery to EMF modeling toolso Support for Epsilon, ATL, OCL, …

Performance boost for derived EFeatureso and notifications!

Page 11: EMF-IncQuery EclipseCon Europe 2011 Modeling Symposium Talk

Check it out! Pointers

o http://viatra.inf.mit.bme.hu/incquery• Documentation, language reference• Tutorials• Examples

o http://viatra.inf.mit.bme.hu/incquery/baseo [email protected] [email protected]