Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Model visualization made easy: Incremental query-driven views in modeling tools


Published on

Presented at Ericsson modeling day 2015

Published in: Software
  • Be the first to comment

  • Be the first to like this

Model visualization made easy: Incremental query-driven views in modeling tools

  1. 1. Model visualization made easy: Incremental query-driven views in modeling tools Ákos Horváth, Ábel Hegedüs, Zoltán Ujhelyi, István Ráth IncQuery Labs Ltd. Gábor Bergmann, Csaba Debreceni, Dániel Varró Budapest University of Technology and Economics
  2. 2. Outline Motivation and background Queries Query-based view models • Overview • Evaluation Sirius integration • Overview • Evaluation Conclusion • Conclusion  Main Contributors o Csaba Debreceni o Ádám Lengyel o Gábor Bergmann o Ábel Hegedüs o Zoltán Ujhelyi o István Ráth o Ákos Horváth o Dániel Varró
  3. 3. Introduction ?? I don’t need all that information Can I define a simplified model? Can I define a view to visualize it? Maintanence Incrementally Immediately Maintenance: • Incrementally • Immediately Viewpoint: • Different view of the underlying model • Abstraction  hide complexity
  4. 4. Motivating scenario Avionics research project • MDD toolchain • Allocate SWs onto HWs Simplified Example FAM_PilotControl : Function FAM_Navigation : Function FAM_FMS : Function FAM_EMS : Function nav2ems :InformationLink provider consumer subFunctions provider consumer PilotControl SubS1 Navigation FMS SubS2 EMS tag: func tag: func tag: func tag: func EMS: Engine Management System FMS: Flight Management SystemInPort/OutPort nav2fms :InformationLink Simulink FAM Id Id Other SubSystem without tag Function SubSystem with "func" tag) Port Blocks id:Function id:InformationLink View More details on Matlab Simulink and Eclipse integration:
  5. 5. 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+ minutes o Despite being hand-coded in Java (no OCL, …)  Usability issues  Productivity issues How to address this? • Lazy evaluation • Incrementality: calculate once, update afterwards
  6. 6. Background: Comparison Normal queries • Java, OCL, … Live (incremental) queries Query Model Evaluator Results Model change Query Model Evaluator Updated results Model change Result deltas Efficient change propagation 1. Always up-to-date results without model traversal 2. Track changes of your model in terms of queries 3. Can provide detailed delta from fix point (Re-)traversal necessary if the model is changed
  7. 7. EMF-INCQUERY An EMF model query engine for live graph search • Expressive query language based on graph patterns and Xbase Language • Incremental evaluation based on the Rete algorithm • Instantaneous response for complex queries over large models Execution • Incremental model processing (validation, synchronization, ...) Tools
  8. 8. Query-based view models
  9. 9. EMF Model Live Queries 2. Change Notifications 1. Model Modification Live Queries Derived Model UI 3. Continuous, efficient synchronization 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 layer o Eclipse Data Binding o Simple callbacks Query-based view models
  10. 10. Definition of derived models Derivation rules • Graph patterns with annotations o Precondition: a pattern match o Execution rule: defined in annotations • Query Based Object / Feature function(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:ssys function(ssys) ... subBlock+ @TraceLookup(src = psys, trg = p)
  11. 11. 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 SubS1 Navigation FMS tag: func tag: func tag: func Simulink FAM subFunctions Query results Traceability function f_1 f_2 f_3 Trace Trace Trace a 2 3appear create add Query results functionIdentifier f_1 i_1 f_2 i_2 f_3 i_3 subFunction f_1 i_1 f_2 i_2 b appear 4 set
  12. 12. Viewers related annotations Special 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 = "$") @ContainsItem(src = par, trg = sub)containment(p, s) @Edge(src = provider, trg = consumer)subFunction(p, c)
  13. 13. Chaining of view models FAM_PilotControl : Function FAM_Navigation : Function FAM_FMS : Function provider subFunctions consumer nav2fms :InformationLink FAM subFunctions Traceability Trace Trace Trace Query results item edge c_1p_1 containment p_1 s_1 p_2 s_2 f_1 f_2 f_3 Notation Item Item Item Containment Contaimnent Edge Trace Trace Trace target source target source target source 1 2 3appear create add Source model Target model Traceability model View model … QBO QBF Target metamodel View model Render Module QBO: Query Based Object QBF: Query Based Feature Zest JFace yFiles
  14. 14. Updating view models Initial 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 Application Model manipulation Configuration Model manipulation 1 2 3 4 More details on the Event-Driven Virtual machine:
  15. 15. 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:
  16. 16. EMF-IncQuery to Sirius integration
  17. 17. Background: Sirius Sirius • Custom concrete syntax for visualization o Tree, table, graph, etc. • Provides viewpoint definition over EMF models • Abstraction can be defined using interpreted expressions o MTL – Acceleo Model-to-Text language o OCL- Object Constraint language o AQL (recommended as of 3.1) – Acceleo Query Language • Supports several viewpoints over the same abstract syntax
  18. 18. VSM Render Overview: IQPL as query language for Sirius Sirius provides API to provide custom expression interpreter • org.eclipse.sirius.common.expressionInterpreter • org.eclipse.sirius.common.proposalProvider 4. UI updates EMF Model B. Change Notifications A. Model Modification Live Queries Live Queries 2. Get queries 3. Query results 1. UI refresh More details EMF-IncQuery to Sirius integration:
  19. 19. Evaluation: Sirius Interpreted expression 0 5000 10000 15000 20000 25000 30000 35000 MTL AQL EIQ MTL AQL EIQ MTL AQL EIQ Small Medium Large ExecutionTime[Ms] Model Size First Execution Recalculation Models EObjects EReferences Eattributes Diagram nodesDiagram edges Small 3550 34222 9471 12 17 Medium 6994 124708 22129 17 13 Large 63580 1233581 457230 167 6154 Complex query with long navigation Profiler was used to isolate query execution time Sirius AQL • provides good performance • Low memory profile IncQuery • Recalculations < 100 ms • Requires up to 2x memory o Large ~1.2 Gb
  20. 20. Conclusions Summary • 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, Sirius o Commercial: yFiles
  21. 21. Final points The examples and more details are available form • EMF-IncQuery viewers: wers • EMF-IncQuery Sirius integration: • Complex example: Your contributions (feedback, forum posts, ideas, patches) are very welcome! • To what direction should we enhance this approach?