0
Developing	  and	  Visualizing	                                     Live	  Model	  Queries	                               ...
What	  is	  a	  Model	  Query?	    ModelQuery(A,B)	     Cond(A,B)	     o  Retrieve	  tuples	  of	        model	  element...
What	  is	  a	  Model	  Query?	    ModelQuery(A,B)	                            AUTOSAR	     Cond(A,B)	                  ...
What	  is	  a	  Model	  Query?	    ModelQuery(A,B)	                            AUTOSAR	     Cond(A,B)	                  ...
Live	  Model	  Queries	    Live	  Query	  EvaluaOon:	     Incremental	  cache	  of	  matches	      o  Maintain	  a	  chea...
Live	  Model	  Queries	    Live	  Query	  EvaluaOon:	     Incremental	  cache	  of	  matches	      o  Maintain	  a	  chea...
Live	  Model	  Queries	    Live	  Query	  EvaluaOon:	     Incremental	  cache	  of	  matches	      o  Maintain	  a	  chea...
Live	  Model	  Queries	    Live	  Query	  EvaluaOon:	                             Live	  Model	  Queries	  for	  	       ...
Example:	  ValidaOon	  of	  BPMN	  Models	    BPMN	  models	     o Describing	  business	  processes	     o Models	  cont...
Example:	  ValidaOon	  of	  BPMN	  Models	    Well-­‐formedness	  validaOon	  during	  ediOng	     o Sink	  AcOvity:	  ac...
Example:	  ValidaOon	  of	  BPMN	  Models	    Well-­‐formedness	  validaOon	  during	  ediOng	     o Sink	  AcOvity:	  ac...
EMF-­‐IncQuery  Framework  
EMF-­‐IncQuery:	  Architecture	  Overview	  Application                      Application code                     Generate...
EMF-­‐IncQuery:	  Architecture	  Overview	  Application                                          •  Graph pattern-based   ...
EMF-­‐IncQuery:	  Architecture	  Overview	  Application                                              •  Graph pattern-base...
EMF-­‐IncQuery:	  Architecture	  Overview	  Application                                                           •  Graph...
EMF-­‐IncQuery:	  Architecture	  Overview	   Application                                                              •  G...
Simple	  Graph	  Pajern	  in	  EMF-­‐IncQuery	  pattern  sequenceFlowEdge                (Flow:SequenceEdge,       Src:Act...
And	  Some	  More	  Complex	  Examples…	  pattern  hasOutEdge(A:  Activity)  {    find  sequenceFlowEdge(_Fr,  A,  _Other)...
EMF-­‐INCQUERY	  Development	  Tools	  
EMF-­‐INCQUERY	  Development	  Tools	         Pajern	  Editor	       EMF	  Instance	  Model	                              ...
EMF-­‐INCQUERY	  Development	  Tools	         Pajern	  Editor	       EMF	  Instance	  Model	                              ...
EMF-­‐INCQUERY	  Development	  Tools	                                        •  Works	  with	  most	  	                   ...
Visualiza<on  of  Live  Model  Queries           in  EMF-­‐IncQuery  
Requirements	  for	  Query	  VisualizaOon	  Genericity	                                  Incrementality	  •  MulOple	  Mod...
Proposed	  Architecture	  of	  Query	  Visualizer	                                       Edited	                          ...
Model	  Source	  Connectors	  for	  Genericity	    Different	  model	  sources	                                 Edited	   ...
Query-­‐based	  Indexing	  for	  Incrementality	    Update	  query	  results	                                            ...
Traceability	  and	  NavigaOon	    Maintaining	  source	  models	                        Query	                          ...
Traceability	  in	  Query	  Visualizer	        Pajern	  Editor	           EMF	  Instance	  Model	                         ...
Traceability	  in	  Query	  Visualizer	        Pajern	  Editor	           EMF	  Instance	  Model	                         ...
Grouping	  and	  Filtering	  for	  PresentaOon	    Define	  query	  groups	     („related”	  queries)	                   Q...
Result	  Viewer	           33	  
Result	  Viewer	  Different	  model	      Szöveg	     sources	                    34	  
Result	  Viewer	                         Loaded	                         Queries	           35	  
Result	  Viewer	                         Query	  Results	           36	  
Filtering	  Visible	  Queries	                   37	  
Filtering	  Visible	  Queries	  Elements	  in	  Query	      Registry	                                38	  
Filtering	  Visible	  Queries	                             Queries	  Loaded	                   39	  
Query	  Result	  Filtering	                 40	  
Query	  Result	  Filtering	                 41	  
Conclusions	  and	  Future	  Work	   R1.	  Genericity	                  Edited	                                     Model	...
Conclusions	  and	  Future	  Work	      R1.	  Genericity	                   Edited	                                       ...
Upcoming SlideShare
Loading in...5
×

Developing and Visualizing Live Model Queries

312

Published on

1st Analysis of Model Transformations Workshop, 2012

Several important tasks performed by model driven development tools — such as well-formedness constraint validation or model transformations — rely on evaluating model queries. If the model changes rapidly or frequently, it is beneficial to provide live queries that automatically propagate these model changes into the query results. To ease the development and debugging of live queries, the development environment should provide a way to evaluate the query results continuously, helping to understand how the created query works.
This presentation presents a generic live model query visualizer that displays and updates the query results depending on their source models. It has been implemented for the EMF-IncQuery framework and presented here for validating BPMN models.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
312
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
2
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Developing and Visualizing Live Model Queries"

  1. 1. Developing  and  Visualizing   Live  Model  Queries   Zoltán  Ujhelyi,  Tamás  Szabó   István  Ráth,  Dániel  Varró   Ábel  Hegedüs  (demonstrator)  Budapest  University  of  Technology  and  Economics  Department  of  Measurement  and  Informa<on  Systems  
  2. 2. What  is  a  Model  Query?    ModelQuery(A,B)   Cond(A,B)   o  Retrieve  tuples  of   model  elements  A,B   o  SaOsfying  the  query   condiOon  Cond   o  Enumerate     one  /  all  instances   o  With  A,B  as     input  or  output   parameters   2  
  3. 3. What  is  a  Model  Query?    ModelQuery(A,B)   AUTOSAR   Cond(A,B)   •  Select  pairs  of  SystemSignal  and   o  Retrieve  tuples  of   its  signal  group  which  are  not  in   the  same  IPDU   model  elements  A,B   o  SaOsfying  the  query   condiOon  Cond   IMA   •  Find  instances  of  cri;cal  func;ons   o  Enumerate     not  running  on  different   one  /  all  instances   processors  of  different  chassis   o  With  A,B  as     input  or  output   BPMN   parameters   •  Show  sink  ac;vi;es  with  no   outgoing  flow   3  
  4. 4. What  is  a  Model  Query?    ModelQuery(A,B)   AUTOSAR   Cond(A,B)   •  Select  pairs  of  SystemSignal  and   o  Retrieve  tuples  of   its  signal  group  which  are  not  in   the  same  IPDU   model  elements  A,B   o  SaOsfying  the  query   condiOon  Cond   IMA   •  Find  instances  of  cri;cal  func;ons   o  Enumerate     not  running  on  different   one  /  all  instances   processors  of  different  chassis   o  With  A,B  as     input  or  output   BPMN   parameters   •  Show  sink  ac;vi;es  with  no   outgoing  flow   4  
  5. 5. Live  Model  Queries    Live  Query  EvaluaOon:   Incremental  cache  of  matches   o  Maintain  a  cheap  cache     (only  memory  overhead)   o  NoOfy  about  relevant  changes   o  Enable  reacOons  to  complex        structural  events   5  
  6. 6. Live  Model  Queries    Live  Query  EvaluaOon:   Incremental  cache  of  matches   o  Maintain  a  cheap  cache     (only  memory  overhead)   o  NoOfy  about  relevant  changes   o  Enable  reacOons  to  complex        structural  events   6  
  7. 7. Live  Model  Queries    Live  Query  EvaluaOon:   Incremental  cache  of  matches   o  Maintain  a  cheap  cache     (only  memory  overhead)   o  NoOfy  about  relevant  changes   o  Enable  reacOons  to  complex        structural  events   7  
  8. 8. Live  Model  Queries    Live  Query  EvaluaOon:   Live  Model  Queries  for     Model  TransformaOons   Incremental  cache  of  matches   o  Maintain  a  cheap  cache     •  Find  all  contexts  a  MT  rule  is   applicable  for   (only  memory  overhead)   •  Live  MT  rules:  triggered   o  NoOfy  about  relevant  changes   automaOcally  upon  change   o  Enable  reacOons  to  complex        structural  events   Live  Model  Queries  for     Early  ValidaOon   •  Find  all  violaOons  of     a  well-­‐formedness  constraint   •  Immediate  re-­‐validaOon     upon  model  change   Live  Model  Queries  for     Traceability  Management   •  See  talk  tomorrow  at  11:30   8  
  9. 9. Example:  ValidaOon  of  BPMN  Models    BPMN  models   o Describing  business  processes   o Models  control  and  dataflow   •  Flowchart-­‐like  notaOon   9  
  10. 10. Example:  ValidaOon  of  BPMN  Models    Well-­‐formedness  validaOon  during  ediOng   o Sink  AcOvity:  acOvity  without  outgoing  edge   10  
  11. 11. Example:  ValidaOon  of  BPMN  Models    Well-­‐formedness  validaOon  during  ediOng   o Sink  AcOvity:  acOvity  without  outgoing  edge   11  
  12. 12. EMF-­‐IncQuery  Framework  
  13. 13. EMF-­‐IncQuery:  Architecture  Overview  Application Application code Generated pattern Generative tooling Query matcher specificationAPI Validation Derived feature Interpreted Engine support pattern matcherINCQUERY Base RETE Core INCQUERY Core Framework
  14. 14. EMF-­‐IncQuery:  Architecture  Overview  Application •  Graph pattern-based query language Application code •  Xtext2-based tooling •  Execution, testing and debugging for queries Generated pattern Generative tooling Query matcher specificationAPI Validation Derived feature Interpreted Engine support pattern matcherINCQUERY Base RETE Core INCQUERY Core Framework
  15. 15. EMF-­‐IncQuery:  Architecture  Overview  Application •  Graph pattern-based query language Application code •  Xtext2-based toolingTypesafe querywrappers (DTOs) •  Execution, testing andfor easy integration debugging for queries Generated pattern Generative tooling Query matcher specificationAPI Validation Derived feature Interpreted Engine support pattern matcher INCQUERY Base RETE Core INCQUERY Core Framework
  16. 16. EMF-­‐IncQuery:  Architecture  Overview  Application •  Graph pattern-based query language Application code •  Xtext2-based toolingTypesafe querywrappers (DTOs) •  Execution, testing andfor easy integration debugging for queries Generated pattern Generative tooling Query matcher specificationAPI Validation Derived feature Interpreted Engine support pattern matcher •  Easy-to-use API forOn-the-fly validation Efficient maintenance queryand problem marker of derived attributes managementmanagement and references •  Support for programmed and INCQUERY Base RETE Core INCQUERY Core dynamic queries •  Fully dynamic parameterization Framework
  17. 17. EMF-­‐IncQuery:  Architecture  Overview   Application •  Graph pattern-based query language Application code •  Xtext2-based tooling Typesafe query wrappers (DTOs) •  Execution, testing and for easy integration debugging for queries Generated pattern Generative tooling Query matcher specification API Validation Derived feature Interpreted Engine support pattern matcher •  Easy-to-use API for On-the-fly validation Efficient maintenance query and problem marker of derived attributes management management and references •  Support for programmed and INCQUERY Base RETE Core INCQUERY Core dynamic queries •  Fully dynamicHigh performance Scalable evaluation for parameterizationbackward getters and complex queries Frameworktransitive closure (over 2 000 000 EObjects)
  18. 18. Simple  Graph  Pajern  in  EMF-­‐IncQuery  pattern  sequenceFlowEdge           (Flow:SequenceEdge,  Src:Activity,  Dst:Activity)=  { SequenceEdge.source(Flow,  Src); SequenceEdge.target(Flow,  Dst);} source   Flow:   target   Src  :   Dst:   Sequence AcOvity   AcOvity   Edge   18  
  19. 19. And  Some  More  Complex  Examples…  pattern  hasOutEdge(A:  Activity)  {    find  sequenceFlowEdge(_Fr,  A,  _Other);  }  or  {    find  messageFlowEdge(_Fr,  A,  _Other); Pajern  composiOon  } (for  reuse)  pattern  sinkActivityNames(Name)  { Activity(A); Activity.name(A,  Name); neg  find  hasOutEdge(A);} NegaOve  composiOon   (negaOon,  quanOficaOon)   19  
  20. 20. EMF-­‐INCQUERY  Development  Tools  
  21. 21. EMF-­‐INCQUERY  Development  Tools   Pajern  Editor   EMF  Instance  Model   Query  Explorer  
  22. 22. EMF-­‐INCQUERY  Development  Tools   Pajern  Editor   EMF  Instance  Model   Query  Explorer  
  23. 23. EMF-­‐INCQUERY  Development  Tools   •  Works  with  most     EMF  editors     out-­‐of-­‐the-­‐box   •  Reveals  matches     as  selecOon   Pajern  Editor   EMF  Instance  Model  Query  results  recalculated    on-­‐the-­‐fly   Query  Explorer  
  24. 24. Visualiza<on  of  Live  Model  Queries   in  EMF-­‐IncQuery  
  25. 25. Requirements  for  Query  VisualizaOon  Genericity   Incrementality  •  MulOple  Model  Sources   •  Query  Changes   •  Model  Editors   •  Model  Changes   •  Current  SelecOon  Traceability   PresentaOon  •  Query  DefiniOons   •  Filtering  •  Input  Model   •  Grouping   25  
  26. 26. Proposed  Architecture  of  Query  Visualizer   Edited   Model   Edited   Query   Other  Model   Query   Editors   Sources   Connectors   Model  and   Filtered  group  of   NoOficaOons   queries   Query   Query   Repository   Engine   Query   Query  Result   Query  Results   DefiniOon   Deltas   Query  Result  Viewer   26  
  27. 27. Model  Source  Connectors  for  Genericity    Different  model  sources   Edited   Edited   Model   Other   Query   Model   o  Graphical  (e.g  BPMN,  UML)   Query   Editors   Sources   o  Textual  (e.g.  OCL)   Connectors   o  Different  implementaOon   Model  and   technologies   Query   NoOficaOons  Model  source  connectors   Engine    OperaOons   Genericity Incrementality o  Open  model   • Multiple Model Sources • Query  Changes o  Send  noOficaOon  upon  model   • Model  Editors • Current  Selection • Model  Changes change   o  Get  current  selecOon   Traceability • Query  Definitions Presentation • Filtering o  Close  editor   • Input  Model • Grouping 27  
  28. 28. Query-­‐based  Indexing  for  Incrementality    Update  query  results   Query-­‐based  indexing   incrementally  upon   o  Model  updates   • Contains  model  elements  accessed   •  E.g.  using  the  built-­‐in  editor   by  the  query   •  Engine:  handles  this  case   • Populated  by  an  exhausOve  model   internally   traversal  (can  be  slow!)   o  Query  updates   • Goal:  Avoid  unnecessary  re-­‐ •  E.g.  using  the  query  editor   traversal   •  Engine:  rebuilds  internal  model   indexes   Strategy  1:     Generic  model  indexer   Genericity Incrementality • “Wildcard  mode”:     • Multiple Model Sources • Query  Changes • Model  Editors • Model  Changes index  every  model  element   • Current  Selection • Higher  memory  consumpOon   Traceability Presentation Strategy  2:     • Query  Definitions • Filtering Group  iniOalizaOon   • Input  Model • Grouping • IniOalize  several  pajerns  together   28  
  29. 29. Traceability  and  NavigaOon    Maintaining  source  models   Query   Editor   Edited   Edited   Model   Query   Query   Editors   Other  Model   Sources   and  queries   Connectors    Support  for  navigaOng  to/ highlighOng   Query   Repository   Query   Engine   o Corresponding  query   definiOons   Query  Result  Viewer   •  HighlighOng  funcOonality  in  the   query  editor   Genericity Incrementality o Referenced  model  element(s)  • Multiple Model Sources • Model  Editors • Query  Changes • Model  Changes •  Editor-­‐dependent   • Current  Selection implementaOon   Traceability Presentation •  Model  source  connector     • Query  Definitions • Filtering handles  funcOonality   • Input  Model • Grouping 29  
  30. 30. Traceability  in  Query  Visualizer   Pajern  Editor   EMF  Instance  Model   Query  Explorer  
  31. 31. Traceability  in  Query  Visualizer   Pajern  Editor   EMF  Instance  Model   Query  Explorer  
  32. 32. Grouping  and  Filtering  for  PresentaOon    Define  query  groups   („related”  queries)   Query   Query   Query  Result   o StaOc  groups   DefiniOons   Results   Deltas   •  E.g.  Namespaces   Query  Result  Viewer   o Dynamic  groups   •  E.g.  Dependency  based    Filtering   Genericity Incrementality o Filter  visible  queries   • Multiple Model Sources • Query  Changes • Model  Editors • Model  Changes •  Uses  hints  from  developer   • Current  Selection •  Manual  overriding   Traceability Presentation o Filter  query  results   • Query  Definitions • Filtering • Input  Model • Grouping •  By  binding  query  parameters   32  
  33. 33. Result  Viewer   33  
  34. 34. Result  Viewer  Different  model   Szöveg   sources   34  
  35. 35. Result  Viewer   Loaded   Queries   35  
  36. 36. Result  Viewer   Query  Results   36  
  37. 37. Filtering  Visible  Queries   37  
  38. 38. Filtering  Visible  Queries  Elements  in  Query   Registry   38  
  39. 39. Filtering  Visible  Queries   Queries  Loaded   39  
  40. 40. Query  Result  Filtering   40  
  41. 41. Query  Result  Filtering   41  
  42. 42. Conclusions  and  Future  Work   R1.  Genericity   Edited   Model   Edited   Other  Model  R3.  Traceability   Query   Query   Editors   Sources  R3.  Traceability   Connectors  R4.  PresentaOon   Model  and   Filtered  group  of   R2.  Incrementality   NoOficaOons   queries   Query   Query   Repository   Engine   Query  Result   Query   Query  Results   Deltas   DefiniOon   Query  Result  Viewer   R4.  PresentaOon   42  
  43. 43. Conclusions  and  Future  Work   R1.  Genericity   Edited   Model   Edited   Other  Model   R3.  Traceability   Query   Query   Editors   Sources   R3.  Traceability   Connectors   R4.  PresentaOon   Model  and   Filtered  group  of   R2.  Incrementality   NoOficaOons   queries   Query   Query   Repository   Engine   Query  Result   Query   Query  Results   Deltas   DefiniOon   Query  Result  Viewer   R4.  PresentaOon  Future  Plans  •  Analysis-­‐based  grouping  •  Graph-­‐based  result  visualizaOon   43  
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×