Upload
akos-horvath
View
470
Download
1
Embed Size (px)
Citation preview
Model visualization made easy:Incremental query-driven views
in modeling tools
Ákos Horváth, Ábel Hegedüs, Zoltán Ujhelyi, István RáthIncQuery Labs Ltd.
Gábor Bergmann, Csaba Debreceni, Dániel VarróBudapest University of Technology and Economics
Outline
Motivation and backgroundQueries
Query-based view models• Overview• Evaluation
Sirius integration• Overview• Evaluation
Conclusion• Conclusion
Main Contributorso Csaba Debrecenio Ádám Lengyelo Gábor Bergmanno Ábel Hegedüso Zoltán Ujhelyio István Rátho Ákos Horvátho Dániel Varró
Introduction??
I don’t need all that information
Can I define a simplified model?
Can I define a view to visualize it?
MaintanenceIncrementallyImmediately
Maintenance:• Incrementally• Immediately
Viewpoint:• Different view of the
underlying model• Abstraction hide
complexity
Motivating scenarioAvionics research project• MDD toolchain• Allocate SWs onto HWsSimplified Example
FAM_PilotControl
: Function
FAM_Navigation
: Function
FAM_FMS : Function
FAM_EMS : Function
nav2ems:InformationLi
nkprovider
consumer
subFunctions
provider
consumer
PilotControl
SubS1Navigatio
n
FMS
SubS2
EMS
tag: func
tag: func
tag: func
tag: func
EMS: Engine Management System FMS: Flight Management SystemInPort/OutPort
nav2fms:InformationLi
nk
Simulink FAM
IdId Other SubSystem without tag
Function SubSystem with "func" tag)
Port Blocks
id:Function id:InformationLink
View
More details on Matlab Simulink and Eclipse integration: https://github.com/FTSRG/massif
Background: Incremental queries
Key observation: model queries are expensive• Models are getting larger (1-5-10+ M elements)• Queries are complex (attribute value checks +
navigation/joins + iterations)• An other industrial example: well-formedness
validation of a 4M element AUTOSAR model takes 30+ minuteso Despite being hand-coded in Java (no OCL, …) Usability issues Productivity issues
How to address this?• Lazy evaluation• Incrementality: calculate once, update afterwards
Background: ComparisonNormal queries• Java, OCL, …
Live (incremental) queries
Query Model
Evaluator
Results
Model change
Query Model
Evaluator
Updated results
Model change
Result deltas
Efficient changepropagation
1. Always up-to-date resultswithout model traversal
2. Track changes of your modelin terms of queries
3. Can provide detailed delta from fix point
(Re-)traversal necessary ifthe model is changed
EMF-INCQUERYAn EMF model query engine for live graph search
• Expressive query language based on graph patterns and Xbase
Language
• Incrementalevaluation based on the Rete algorithm
• Instantaneous response for complex queries over large models
Execution
• Incremental model processing (validation, synchronization, ...)
Tools
http://eclipse.org/incquery
Query-based view models
EMF Model
Live Queries
2. ChangeNotifications
1. Model Modification
Live Queries
DerivedModel
UI
3. Continuous,efficientsynchronization
4. UI updates
Labeled, hierarchic property graph
On-the-fly abstractions over the model
Visualize things that are not (directly) present in your model Provides an easy-to-use API for integration into your presentation
layero Eclipse Data Bindingo Simple callbacks
Query-based view models
Definition of derived modelsDerivation rules• Graph patterns with annotations
o Precondition: a pattern matcho Execution rule: defined in annotations
• Query Based Object / Featurefunction(ss)
@TraceLookup(src = ss, trg = f)
@QBO(eClass = Function)
@QBF(src = f, trg = id, f = id)functionIdentifier(ss, id)
@TraceLookup(src = ssys, trg = s)@QBF(src = p, trg = s, f
=subFunctions)
subFunction(psys, ssys)function(psys)
B:psys B:ssysfunction(ssys)
...
subBlock+
@TraceLookup(src = psys, trg = p)
More matches can appear at the same time• Ordered execution schema (priority for rules)Internal traceability for created objects• Explicit definition
Execution of motivating example
11
FAM_PilotControl : Function
FAM_Navigation
: Function
FAM_FMS : Function
subFunctions
consumer
PilotControl
SubS1Navigatio
n
FMS
tag: func
tag: func
tag: func
Simulink FAM
subFunctions
Query results Traceabilityfunctionf_1f_2f_3
TraceTraceTrace
a 2 3appear create add
Query results
functionIdentifierf_1 i_1
f_2 i_2f_3 i_3
subFunctionf_1 i_1f_2 i_2
b appear 4 set
Viewers related annotationsSpecial annotations• Uses a specific target metamodel
(notation)• Simplifies the tracing of (notation) model
elements• Enables faster implementation on user side
12
item(func) @Item(label = "$func.id")
@ContainsItem(src = par, trg = sub)containment(p, s)
@Edge(src = provider, trg = consumer)subFunction(p, c)
Chaining of view models
FAM_PilotControl : Function
FAM_Navigation
: Function
FAM_FMS : Function
provider
subFunctions
consumer
nav2fms:InformationLin
k
FAM
subFunctions
Traceability
Trace
Trace
Trace
Query results
item
edgec_1p_1
containmentp_1 s_1p_2 s_2
f_1f_2f_3
Notation
ItemItemItem
Containment
Contaimnent
Edge
Trace
Trace
Trace
target
sourcetarget
source
targetsource
1 2 3appear create add
Source model Target model
Traceability model
View model
…QBO QBF
Target metamodel
View model
RenderModule
QBO: Query Based ObjectQBF: Query Based Feature
ZestJFace
yFiles
Updating view modelsInitial setup of derivation rules• EClassifiers, EStructuralFeatures
Query result deltas rule activations• Delta = (Found, Lost, Updated)
Intergration architecture
Source model
Derivation rules
Query engine
Event-Driven Virtual Machine View model
Change notifications
Match set delta
ApplicationModel
manipulation Configuration
Model manipulation
1
23
4
More details on the Event-Driven Virtual machine: http://www.eclipse.org/viatra/
TrainBenchmark• 6 different size examples• Source: 6.000 – 180.000 | View models: 150 – 4.500• Wide variety of patterns such as transitive closure, attribute
checks, etc.
Evaluation
More details on the TrainBenchmark: https://github.com/FTSRG/trainbenchmark
EMF-IncQuery to Sirius integration
Background: SiriusSirius• Custom concrete syntax for visualization
o Tree, table, graph, etc.• Provides viewpoint definition over EMF
models• Abstraction can be defined using
interpreted expressionso MTL – Acceleo Model-to-Text languageo OCL- Object Constraint languageo AQL (recommended as of 3.1) – Acceleo
Query Language• Supports several viewpoints over
the same abstract syntax
VSM Render
Overview: IQPL as query language for SiriusSirius provides API to provide custom expression interpreter• org.eclipse.sirius.common.expressionInterpreter• org.eclipse.sirius.common.proposalProvider
4. UI updates
EMF Model
B. ChangeNotifications
A. Model Modification
Live QueriesLive
Queries
2. Get queries
3. Query results
1. UI refresh
More details EMF-IncQuery to Sirius integration: https://github.com/FTSRG/iq-sirius-integration
Evaluation: Sirius Interpreted expression
MTL AQL EIQ MTL AQL EIQ MTL AQL EIQSmall Medium Large
0
5000
10000
15000
20000
25000
30000
35000First Execution Recalculation
Model Size
Exec
utio
n Ti
me
[Ms]
Models EObjects EReferences Eattributes Diagram nodes Diagram edgesSmall 3550 34222 9471 12 17Medium 6994 124708 22129 17 13Large 63580 1233581 457230 167 6154
Complex query with long navigationProfiler was used to isolate query execution timeSirius AQL • provides good
performance• Low memory
profileIncQuery• Recalculations
< 100 ms• Requires up to
2x memoryo Large ~1.2 Gb
ConclusionsSummary• Deriving and synchronizing view models
o Incrementally and live Fast recalculation
o Derivation rules Definition
• Annotation over graph queries for JFace• EMF Configuration
Explicit tracing mechanism• Multiple visualization modules support
o Open-source: Zest, JFace, Siriuso Commercial: yFiles
Final pointsThe examples and more details are available form• EMF-IncQuery viewers:
https://wiki.eclipse.org/EMFIncQuery/UserDocumentation/IncQuery_Viewers
• EMF-IncQuery Sirius integration:https://github.com/FTSRG/iq-sirius-integration
• Complex example:https://github.com/IncQueryLabs/incquery-examples-cps
Your contributions (feedback, forum posts, ideas, patches) are very welcome!• To what direction should we enhance this approach?