25
Presenter : g9102 黃黃

Presenter : g9102 黃培智 Outline Motivation and Background GXL Overview Exchange Graphs Exchange Graph Schemas Conclusion

  • View
    237

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Presenter : g9102 黃培智

Page 2: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Outline

Motivation and Background GXL Overview Exchange Graphs Exchange Graph Schemas Conclusion

Page 3: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

GXL Background

Tools in Software Reengineering

sourcecode

sourcecode extractextract

repositoryrepository

abstractabstract

viewview

visualizer:graph and diagram visualizer, code browser

extractor:parser, scanner

abstractor:structure recognition

Page 4: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

GXL Simple Example

Page 5: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

GXL History

Page 6: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Requirements of Exchange Formats

Independence• application independence

- language independence (C/C++, Cobol, Java, JCL, SQL, multi-language etc.)

- abstraction level independence (AST, "middle level", Architecture)

- aspect independence(data flow, control flow, code structure, etc.)

• tool independence- data structure independence

(syntax trees, various types of graphs, relational databases,

object oriented databases, file and directory structures)

Page 7: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Requirements of Exchange Formats

Efficiency• efficiency in time• efficiency in space• efficiency in "building tools"

Extensibility• extensible for further applications

(CASE tools, visualization tools, etc)

Universality• used by others• standardized format

Page 8: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Outline

Motivation and Background GXL Overview Exchange Graphs Exchange Graph Schemas Conclusion

Page 9: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

GXL Objective Exchanged Data

• Instance data• Schemas data

Mathematical Model• Typed, attributed, ordered, directed graphs• Expanded by hypergraphs and hierarchical

graphs

Notation• eXtensible Markup Language (XML)• Unified Modeling Language (UML)

Page 10: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

GXL Graph Model

typedgraphs

attributedgraphs

directedgraphs

orderedgraphs

hierarchicalgraphs

hyper-graphs

Page 11: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

GXL Document Type Definition (1.0)

<!ENTITY % *-extension "" >

<!ENTITY % *-attr-extension "" >

<!ELEMENT gxl (graph* %gxl-extension; ) >

<!ATTLIST gxl xmlns:xlink CDATA #FIXED "www.w3.org/1999/xlink" %gxl-attr-extension>

<!ELEMENT type EMPTY>

<!ATTLIST type xlink:type (simple) #FIXED "simple" xlink:href CDATA #REQUIRED>

<!ELEMENT graph (type? , attr* , ( node | edge | rel )* %graph-extension; ) >

<!ATTLIST graph id ID #REQUIRED role NMTOKEN #IMPLIED edgeids ( true | false ) "false" hypergraph ( true | false ) "false" edgemode ( directed | undirected | defaultdirected | defaultundirected) "directed" %graph-attr-extension;>

<!ELEMENT node (type? , attr*, graph* %node-extension; ) >

<!ATTLIST node id ID #REQUIRED %node-attr-extension;>

<!ELEMENT edge (type?, attr*, graph* edge-extension; ) >

<!ATTLIST edge id ID #IMPLIED from IDREF #REQUIRED to IDREF #REQUIRED fromorder CDATA #IMPLIED toorder CDATA #IMPLIED isdirected ( true | false ) #IMPLIED %edge-attr-extension;>

<!ELEMENT rel (type? , attr*, graph*, relend* %rel-extension;) >

<!ATTLIST rel id ID #IMPLIED isdirected ( true | false ) #IMPLIED %rel-attr-extension;>

<!ELEMENT relend (attr* %relend-extension; ) >

<!ATTLIST relend target IDREF #REQUIRED role NMTOKEN #IMPLIED direction ( in | out | none ) #IMPLIED startorder CDATA #IMPLIED endorder CDATA #IMPLIED %relend-attr-extension; >

<!ELEMENT attr (type?, attr*, (%val;)) >

<!ATTLIST attr id IDREF #IMPLIED name NMTOKEN #REQUIRED kind NMTOKEN #IMPLIED >

<!ENTITY % val " locator | bool | int | float | string | enum | seq | set | bag |tup %value-extension; ">

<!ELEMENT locator EMPTY >

<!ATTLIST locator xlink:type (simple) #FIXED "simple" xlink:href CDATA #IMPLIED >

<!ELEMENT bool |int | float | string (#PCDATA) >

<!ELEMENT enum (#PCDATA) >

<!ELEMENT seq | set | bag | tup (%val;)* >

Page 12: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Outline

Motivation and Background GXL Overview Exchange Graphs Exchange Graph Schemas Conclusion

Page 13: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Supported Graph Type

Typed Graphs Attributed Graphs Directed Graphs Undirected Graphs Ordered Graphs Hypergraphs Hierarchical Graphs …..

Page 14: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Directed Graphs

Page 15: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Directed Typed Graphs

Page 16: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Typed, Attributed, Directed Graphs

Page 17: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Typed, Attributed, Directed, Ordered Graphs

Page 19: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Hierarchical Graphs

Nodes, edges, and hyperedges contain further graphs

Page 20: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Outline

Motivation and Background GXL Overview Exchange Graphs Exchange Graph Schemas Conclusion

Page 21: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Exchange Schemas with GXL

Graph Schema Definition with UML Class Diagrams

Representing UML Class Diagrams by Graphs (Schema Graphs)

Exchanging Schemas Graphs by GXL Documents

Page 22: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Exchange Schemas with GXL

Graph Class(UML class diagram)

Var

file : string

line : int

line : int

refs

Proc

Var

file="main.c"

line = 27

line = 42

e : refs

Graph

p : Proc

v :

Page 23: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

GXL Schema Representation

UML class diagram

Var

file:string

line : int

line : int

Proc

refs

Proc:NodeClass

name="Proc"

a1:Attributename="file"

s : String

refs: EdgeClass

name="refs"

var:NodeClass

name="Var"

i : Integer

a2:Attributename="line"

comesFrom

goesTo

hasAttribute

hasDomain

hasAttribute

hasAttribute

hasDomain

Schema Graph

Page 24: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

GXL Schema Representation

<?xml version="1.0"?><!DOCTYPE gxl SYSTEM "gxl.dtd"> <gxl> <graph id="simpleSchema"> <type xlink:href = "gxl.gxl"/> <node id = "n1"> <type xlink:href = "gxl.gxl#NodeClass"/> <attr name = "name"> <string>Proc</string> </attr> </node> <node id = "e"> <type xlink:href = "gxl.gxl#edgeClass"/> <attr name = "name"> <string>refs</string> </attr> </node>

<node id = "n2"> <type xlink:href = "gxl.gxl#nodeClass"/> <attr name = "name"> <string>Var</string> </attr> </node> ... <edge from = "e" to = "n1"> <type xlink:href = "gxl.gxl#comesFrom"/> </edge> <edge from = "e" to = "n2"> <type xlink:href = "gxl.gxl#goesTo"/> </edge> <graph></gxl>

Page 25: Presenter : g9102 黃培智 Outline  Motivation and Background  GXL Overview  Exchange Graphs  Exchange Graph Schemas  Conclusion

Conclusion

GXL : uniform language for• Exchanging graphs• Exchanging graph schemas

GXL : ratified as standard exchange format• Software Reengineering community

(Dagstuhl, January 26. 2001)• Usage within GTXL Graph Transformation

Exchange Language systems (APPLIGRAPH Subgroup Meeting, Bremen, March, 1-2. 2001)