250 likes | 407 Views
Presenter : g9102 黃培智. Outline. Motivation and Background GXL Overview Exchange Graphs Exchange Graph Schemas Conclusion. source code. extract. view. repository. abstract. visualizer: graph and diagram visualizer, code browser. extractor: parser, scanner. abstractor:
E N D
Outline • Motivation and Background • GXL Overview • Exchange Graphs • Exchange Graph Schemas • Conclusion
sourcecode extract view repository abstract visualizer: graph and diagram visualizer, code browser extractor: parser, scanner abstractor: structure recognition GXL Background • Tools in Software Reengineering
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)
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
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)
typedgraphs attributedgraphs directedgraphs hierarchicalgraphs hyper-graphs orderedgraphs GXL Graph Model
<!ENTITY % *-extension "" > <!ENTITY % *-attr-extension "" > <!ELEMENTgxl (graph* %gxl-extension; ) > <!ATTLISTgxl xmlns:xlink CDATA #FIXED "www.w3.org/1999/xlink" %gxl-attr-extension> <!ELEMENTtype EMPTY> <!ATTLIST type xlink:type (simple) #FIXED "simple" xlink:href CDATA #REQUIRED> <!ELEMENTgraph (type? , attr* , ( node | edge | rel )* %graph-extension; ) > <!ATTLISTgraph id ID #REQUIRED role NMTOKEN #IMPLIED edgeids ( true | false ) "false" hypergraph ( true | false ) "false" edgemode ( directed | undirected | defaultdirected | defaultundirected) "directed" %graph-attr-extension;> <!ELEMENTnode (type? , attr*, graph* %node-extension; ) > <!ATTLISTnode id ID #REQUIRED %node-attr-extension;> <!ELEMENTedge (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;> GXL Document Type Definition (1.0) <!ELEMENTrel (type? , attr*, graph*, relend* %rel-extension;) > <!ATTLISTrel id ID #IMPLIED isdirected ( true | false ) #IMPLIED %rel-attr-extension;> <!ELEMENTrelend (attr* %relend-extension; ) > <!ATTLISTrelend target IDREF #REQUIRED role NMTOKEN #IMPLIED direction ( in | out | none ) #IMPLIED startorder CDATA #IMPLIED endorder CDATA #IMPLIED%relend-attr-extension; > <!ELEMENTattr (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; "> <!ELEMENTlocator EMPTY > <!ATTLIST locator xlink:type (simple) #FIXED "simple" xlink:href CDATA #IMPLIED > <!ELEMENTbool |int | float | string (#PCDATA) > <!ELEMENTenum (#PCDATA) > <!ELEMENTseq | set | bag | tup (%val;)* >
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 • …..
Hypergraphs <node id="u"><type xlink:href=“s.gxl#U"/></node><node id="v"><type xlink:href="s.gxl#V"/></node> <node id="w"><type xlink:href="s.gxl#W"/></node><rel id="r"><type xlink:href="s.gxl#R"/><relend target="v" role="theV" direction="in"/><relend target="w" role="theW" direction="out"/><relend target="u" role="theFirstU" direction="out" endorder="1"/><relend target="u" role="theSecondU" direction="out" endorder="2"/></rel>
Hierarchical Graphs • Nodes, edges, and hyperedges contain further graphs
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
Graph Graph Class(UML class diagram) p : Proc Proc file="main.c" file : string e : refs refs line = 42 line : int v : Var Var line = 27 line : int Exchange Schemas with GXL
UML class diagram Schema Graph a1:Attribute s : String Proc:NodeClass has Domain has Attribute name="Proc" name="file" Proc file:string comesFrom refs refs: EdgeClass has Attribute line : int name="refs" a2:Attribute i : Integer has Domain goesTo Var name="line" line : int var:NodeClass has Attribute name="Var" GXL Schema Representation
<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> <?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> GXL Schema Representation
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)