G raph E x change L anguage

23
Graph Drawing Universität Koblenz-Landau Institut für Softwaretechnik Re-Group Vienna, September 26, 2001 Graph Exchange Language Andreas Winter joint work with Ric Holt (University of Waterloo) Susan Elliott Sim (University of Toronto) Andy Schürr (Universität BW München) (and many more)

description

G raph E x change L anguage. Andreas Winter joint work with Ric Holt (University of Waterloo) Susan Elliott Sim (University of Toronto) Andy Schürr (Universität BW München). (and many more). Contents. Motivation and Idea GXL Overview Exchanging graphs with GXL - PowerPoint PPT Presentation

Transcript of G raph E x change L anguage

Page 1: G raph E x change  L anguage

Graph Drawing

Universität Koblenz-LandauInstitut für SoftwaretechnikRe-Group

Vienna, September 26, 2001

Graph Exchange LanguageAndreas Winter

joint work with

Ric Holt (University of Waterloo)Susan Elliott Sim (University of

Toronto)Andy Schürr (Universität BW

München) (and many more)

Page 2: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (2)Graph Drawing 2001

Contents

Motivation and Idea

GXL Overview– Exchanging graphs with GXL

– Exchanging schemas with GXL

GXL current work– GXL Tools

Conclusion

Page 3: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (3)Graph Drawing 2001

extract:parser and fact extractorsfor multi-languagesystems, Ada, C/C++, Cobol, Java, SQL ...

abstract:analysis techniqueslike querying, browsing,data flow analysis, architecture recovery, cluster analysis ...

view:visualizationcharts, diagrams,graphs, tables, source code, ...

GXL Background

Tools in Software Reengineering

sourcecode

sourcecode extractextract

repositoryrepository

abstractabstract

viewview

Page 4: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (4)Graph Drawing 2001

History

Page 5: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (5)Graph Drawing 2001

GXL Partners

Page 6: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (6)Graph Drawing 2001

1 function main (){ ... 8 a := max(a,b); ...19 b := min(b,a); ... }

GXL Example

typed nodesattributed nodes

attributededges

ordered incidences

directededges

typededges

Page 7: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (7)Graph Drawing 2001

Requirements of Exchange Formats (1)

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 8: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (8)Graph Drawing 2001

Requirements of Exchange Formats (2)

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 9: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (9)Graph Drawing 2001

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: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (10)Graph Drawing 2001

GXL Graph Model

typedgraphs

attributedgraphs

directedgraphs

orderedgraphs

hierarchicalgraphs

hyper-graphs

graph part

Page 11: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (11)Graph Drawing 2001

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: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (12)Graph Drawing 2001

Exchanging Graphs with GXL

Attributed, typed, directed GraphsUndirected GraphsOrdered GraphsHypergraphsHierarchical Graphs

Page 13: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (13)Graph Drawing 2001

Exchanging Graphs with GXL

p :

v :

graph

r :

typed

refs

Proc

Var

attributed

file = "main.c"

line = 27

<gxl><graph id="example"> <type xlink:href = "schema.gxl"/><node id = "p">

</node><node id = "v">

</node><edge from = "p" to = "v">

</edge><graph></gxl>

<type xlink:href = "schema.gxl#Proc"/>

<type xlink:href = "schema.gxl#Var"/>

<type xlink:href = "schema.gxl#refs"/>

<attr name = "file"> <string>main.c</string></attr>

<attr name = "line"> <int>27</int></attr>

id = "r"

Page 14: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (14)Graph Drawing 2001

Exchanging Schemas with GXL

Graph Schema Definition with UML Class Diagrams– attributed, typed, directed, ordered graphs

– hypergraphs

– hierarchical graphs

GXL Representation of class diagrams

GXL Metaschema

Page 15: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (15)Graph Drawing 2001

Exchanging 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(UML object diagram)

p : Proc

v :

Page 16: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (16)Graph Drawing 2001

Representing Schemas

• Schemas (graph classes) are represented as graphs as well

• Schemas are exchanged as GXL documents suiting a metaschema for graph classes

• only one common and simple DTD for exchanging – graphs matching different graph schemas

– graph classes matching a metaschema

Page 17: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (17)Graph Drawing 2001

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 18: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (18)Graph Drawing 2001

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 19: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (19)Graph Drawing 2001

GXL Metaschema (Graph Part)

Page 20: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (20)Graph Drawing 2001

GXL Current Work

GXL Usage– Software Reengineering– Graph Transformation Systems (GTXL)

GXL Standard Schemas– Ferenc, Gyimothy, Holt, Koschke, Sim:

C++-Reference-Schema– Lethbridge, Tichelaar et al.:

Dagstuhl Middle Level Model– Jahnke, Mylopoulos, Wadsack, Hainaut,

Henrard: Data Reverse Engineering Reference-Schema (DRE)

Page 21: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (21)Graph Drawing 2001

GXL Tools and Applications • CPPX (C++ AST Extractor), U Waterloo• Columbus/CAN (C++ Extractor and Analyzer), U Szeged • ECW (Edinburgh Concurrency Workbench), U Edinburgh• Fujaba (Roundtrip Engineering for UML diagrams) U Paderborn• GenSet (simple graph transformations), U Oregon• GRAS (Graph Data Base) U Aachen• GXL reader/writer for Bauhaus Resource Graphs, U Stuttgart• GXL2RPA, RPA2GXL, Philips, Eindhoven• GXL2G, G2GXL, U Koblenz• GXL2Progres, Progres2GXL, U Aachen• GXLQuery, U Koblenz• GXL2RSF, RSF2GXL, U Victoria, Nokia• GXL2XMI, U BW München• GXLFramework, U BW München• GXL2TA, TA2GXL, U Waterloo, U Toronto• Royere (graph visualization), CWI Amsterdam• SugiBib (UML diagram layout), U Würzburg• UPGRADE (visual languages), RWTH Aachen• yFiles (graph visualization), U Tübingen

Page 22: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (22)Graph Drawing 2001

GXL Change Requests

XML Schema– instead of XML DTD– more powerful extension mechanism

Packages– attributes - structure (GXL) - GTXL - GraphML/GD ...

Hierarchical Graphs– graph valued attributes

Additional Attribute Types– free type attributes– structs

References to GXL Schemas– textual attributes instead of XLINK-References

Additional features– implicit node definition by edges

Page 23: G raph E x change  L anguage

© Institut für Softwaretechnik Universität Koblenz-Landau

Vienna, September 26, 2001 (23)Graph Drawing 2001

Conclusion

GXL: uniform language for – exchanging graphs– exchanging graph schemas

GXL: ratified as standard exchange format

– Software Reengineering community (Dagstuhl, January 26. 2001)

– Graph Transformation Systems community (APPLIGRAPH Subgroup Meeting, Bremen, March, 1.-2., 2001)

GXL: standards activities– cited in XML OASIS Cover Pages and

XML.org XML Standards Report– planed to become an IEEE Software Engineering Standard– will be introduced to OMG

more informationhttp: www.gupro.de/GXLmailto: [email protected]