39
CASCON 2000 Universität Koblenz-Landau Institut für Softwaretechnik Re-Group Toronto, 15.11.2000 Graph Exchange Language An overview Ric Holt Andreas Winter joint work with Andy Schürr and Susan Sim

G raph E x change L anguage An overview

  • Upload
    urbano

  • View
    46

  • Download
    0

Embed Size (px)

DESCRIPTION

G raph E x change L anguage An overview. Ric Holt Andreas Winter joint work with Andy Schürr and Susan Sim. Contents. GXL motivation and history GXL requirements GXL features nodes, edges and attributes ordering hypergraphs GXL extended features support for hierarchical graphs - PowerPoint PPT Presentation

Citation preview

Page 1: G raph E x change  L anguage An overview

CASCON 2000

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

Toronto, 15.11.2000

Graph Exchange Language

An overviewRic Holt

Andreas Winterjoint work with

Andy Schürr and Susan Sim

Page 2: G raph E x change  L anguage An overview

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

CASCON 2000 (2)

Contents

• GXL motivation and history• GXL requirements• GXL features

– nodes, edges and attributes– ordering – hypergraphs

• GXL extended features– support for hierarchical graphs– support for graph drawing– GXL extension– schemata

• Conclusion and Future Work

Page 3: G raph E x change  L anguage An overview

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

CASCON 2000 (3)

Interoperability of Tools (examples)

• Acacia C++ parser tool kit and AT&T graph drawing (TA)

• ASIS, GCC and GUPRO (TGraphs)

• Bauhaus Parsers and PBS/LSEDIT (TA)

• CPPANAL and GUPRO (TGraphs)

• Cxref extractor and TA• CFX (PBS) and TA (RSF, TA)• Dali tool kit and Rigi (TA)• Datrix C++ and TA• DaVinci, Graphlet and GUPRO

(TGraphs)

• EDGE and PROGRES• HTML and GUPRO (TGraphs)• Grok (RSF, TA)• GUPRO (multi-language)

Parsers, GReQL-Query and Code-Browser (TGraphs)

• JViews and PROGRES• Mathlab Stateflow and

Daimler-Chrysler CTE (PROGRES)

• PLIX-Parser and TA (RSF,TA)• Rigi parser, Rigi viewer and

TA (RSF)• SNIFF+ and TA

Page 4: G raph E x change  L anguage An overview

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

CASCON 2000 (4)

GXL Objective

standard exchange language– for interchanging data between

reengineering toolsmathematical model

– typed, attributed, directed graphsnotation

– eXtensible Markup Language (XML)– Unified Modeling Language (UML)

application to other areas in software engineering– graph transformation– graph drawing

Page 5: G raph E x change  L anguage An overview

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

CASCON 2000 (5)

History

Page 6: G raph E x change  L anguage An overview

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

CASCON 2000 (6)

GXL Partners

Bell Canada (Datrix Group), CanadaIBM Centre for Advanced Studies, CanadaMahindra British Telecom, India Nokia Research Center (Software Technology Laboratory), FinlandPhilips Research (Software Architecture Group), The NetherlandsRWTH Aachen (Department of Computer Science III), GermanyUniversity of Berne (Software Composition Group), Switzerland University Bw München (Institute for Software Technology), Germany University of Koblenz (IST, Re-Group), Germany University of Oregon (Department of Computer Science), U.S.A. University of Paderborn (AG Softwaretechnik), Germany University of Stuttgart (BAUHAUS Group), Germany University of Victoria (RIGI Group), Canada

University of Waterloo (Software Architecture Group), Canada

Page 7: G raph E x change  L anguage An overview

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

CASCON 2000 (7)

Quality Criteria• application domain independent • based on an open standard• efficient in time and space

• applicable to most – reengineering approaches

• independent of abstraction levels• independent of programming languages• applicable to large software software systems

– graph transformation approaches• independent of underlying graph models

– graph visualization approaches• independent of graph layout models

Page 8: G raph E x change  L anguage An overview

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

CASCON 2000 (8)

GXL Design Goals

• simple and compact representation of directed and undirected graphs

• suitable for a broad spectrum of graph models, including support for hypergraphs and hierarchical graphs

• uniform representation of graphs and graph schemas

• support for representation of complex attribute values

• extensibility of graph elements and attribute types

Page 9: G raph E x change  L anguage An overview

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

CASCON 2000 (9)

GXL Graph Model

Page 10: G raph E x change  L anguage An overview

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

CASCON 2000 (10)

GXL Attribute Model

Page 11: G raph E x change  L anguage An overview

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

CASCON 2000 (11)

GXL Document Type Definition

automatic generation of GXL DTD follows MOF/XMI standard entity types and attributes are not distinguished blows up the number of XML elements

(GXL 0.7.2: 136/74 elements)

manual definition of GXL DTD manual work to do distinction between entity types and attributes

reflects design decisions small and simple DTD (20 elements)

Page 12: G raph E x change  L anguage An overview

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

CASCON 2000 (12)

GXL Document Type Definition

<!ENTITY % *-extension " " >

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

<!ENTITY % context " in | out" >

<!ENTITY % link " inlink | outlink" ><!ELEMENT gxl (%gxl-extension; graph) >

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

<!ELEMENT type EMPTY>

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

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

<!ATTLIST graph id ID #REQUIRED edgeids ( true | false ) hypergraph ( true | false ) direction ( directed | undirected)>

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

<!ATTLIST node id ID #REQUIRED direction ( directed | undirected >

<!ELEMENT in |out (%context-extension; attr*) >

<!ATTLIST in |out ref IDREF #REQUIRED role NMTOKEN #IMPLIED ><!ELEMENT edge (%edge-extension;

type? , attr*, graph*) ><!ATTLIST edge id ID #IMPLIED

from IDREF #REQUIRED to IDREF #REQUIRED direction ( directed | undirected )>

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

<!ATTLIST rel id ID #IMPLIED direction ( directed | undirected )>

<!ELEMENT inlink | outlink (%link-extension; attr)* > <!ATTLIST inlink | outlink

ref IDREF #REQUIRED role NMTOKEN #IMPLIED >

<!ELEMENT attr (type?, attr*, (%val;)) > <!ATTLIST attr name NMTOKEN #REQUIRED

kind NMTOKEN #IMPLIED > <!ELEMENT locator EMPTY > <!ATTLIST locator xlink:type (simple) #FIXED

xlink:href CDATA #IMPLIED >

<!ELEMENT bool | int | float | string (#PCDATA) ><!ELEMENT seq | set | bag | tup (%val;)* >

Page 13: G raph E x change  L anguage An overview

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

CASCON 2000 (13)

Nodes, Edges and Attributes

p :

v :

graph <?xml version="1.0"?> <!DOCTYPE gxl SYSTEM "gxl.dtd"> <gxl><graph><node id = "p">

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

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

</edge><graph></gxl>

e :

id = "e"

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

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

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

refers

typed

Proc

Var

attributed

file = "main.c"

line = 27

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

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

Page 14: G raph E x change  L anguage An overview

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

CASCON 2000 (14)

Attributed Edges

<edge id = "e" from = "p" to = "v"> <type xlink:href = "schema.gxl#refers"/> <attr name = "line"> <int>42</int> </attr></edge>

p :

v :

Proc

Var

file = "main.c"

line = 27

e : refers

line = 42

Page 15: G raph E x change  L anguage An overview

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

CASCON 2000 (15)

GXL Documents (DTD)

<!ELEMENT gxl (%gxl-extension; graph) > <!ATTLIST gxl xmlns:xlink CDATA #FIXED

"www.w3.org/1999/xlink">

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

<!ATTLIST graph id ID #REQUIRED edgeids ( true | false ) "false" hypergraph ( true | false ) "false"

direction ( directed | undirected ) "directed" >

Page 16: G raph E x change  L anguage An overview

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

CASCON 2000 (16)

Nodes and Edges (DTD)

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

<!ATTLIST node id ID #REQUIRED direction (directed|undirected ) #IMPLIED>

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

<!ATTLIST edge id ID #IMPLIED from IDREF #REQUIRED to IDREF #REQUIRED direction (directed|undirected ) #IMPLIED>

Page 17: G raph E x change  L anguage An overview

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

CASCON 2000 (17)

<graph direction = "undirected" >...<edge id = "e" from = "p" to = "v"></edge>...</graph>

undirected graph

<graph direction = "directed" >...<edge id = "e" direction = "undirected" from = "p" to = "v"></edge>...</graph>

undirected edgein directed graph

Undirected Graphs

p :

v :

Proc

Var

file = "main.c"

line = 27

e :

edges are always noted as directedbut can be interpreted as undirected

Page 18: G raph E x change  L anguage An overview

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

CASCON 2000 (18)

Prog

authors = { Ric, Andy, Susan, Andreas }

p :

GXL supports•set,•sequence,•bag,•tuple

of•bool,•int,•float,•string,•complex values

Complex Attributes

<node id = "p"> <type xlink:href = "schema.gxl#prog"/> <attr name = "authors"> <set> <string>Ric</string> <string>Andy</string> <string>Susan</string> <string>Andreas</string> </set> </attr></node>

Page 19: G raph E x change  L anguage An overview

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

CASCON 2000 (19)

Attributes (DTD)

<!ENTITY % val " %value-extension; locator |

bool | int | float | string | seq | set | bag | tup ">

<!ELEMENT attr (type?, attr*, (%val;)) > <!ATTLIST attr name NMTOKEN #REQUIRED kindNMTOKEN #IMPLIED >

Page 20: G raph E x change  L anguage An overview

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

CASCON 2000 (20)

Attribute Values (DTD)<!ELEMENT locator EMPTY > <!ATTLIST locator xlink:type (simple) #FIXED "simple" xlink:href CDATA #IMPLIED >

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

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

pointers to external objects

simple attributes

complex attributes

Page 21: G raph E x change  L anguage An overview

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

CASCON 2000 (21)

Ordering of Incidences

p :

a : b :

c :d :

e :{1} {3}

{2}

{4}

{5} {6}

<node id = "p" >

</node>

<in ref = "a" /> <in ref = "b" /><out ref = "b" /><in ref = "e" /><out ref = "d" /><in ref = "c" />

Page 22: G raph E x change  L anguage An overview

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

CASCON 2000 (22)

{1}

{2}

v : V

w : W

u : U r :

theSecondU

theFirstU

theV

theW

directed

Hypergraphs

<rel id = "r" direction = "directed"> <outlink ref = "u" role = "theFirstU"/> <outlink ref = "u" role = "theSecondU"/> <inlink ref = "v" role = "theV" /> <outlink ref = "w" role = "theW" /> </rel>

<node id = "u">

<in ref = "u" role = "theSecondU" />

<in ref = "u" role = "thefirstU" />

</node>

v : V

w : W

u : U

theSecondU

theFirstU

theV

theW

{1}

{2}

undirected

r :

"undirected">

direction = "undirected">

Page 23: G raph E x change  L anguage An overview

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

CASCON 2000 (23)

Hypergraphs (DTD)

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

<!ATTLIST rel id ID #IMPLIED

direction (directed | undirected) #IMPLIED>

Page 24: G raph E x change  L anguage An overview

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

CASCON 2000 (24)

Context and Link (DTD)

Node Incidences<!ENTITY % context " in | out" >

<!ELEMENT in | out (%context-extension; attr*) >

<!ATTLIST in |out ref IDREF #REQUIREDrole NMTOKEN #IMPLIED >

Edge Incidences <!ENTITY % link " inlink | outlink" >

<!ELEMENT inlink | outlink (%link-extension; attr)* >

<!ATTLIST inlink | outlinkref IDREF #REQUIREDrole NMTOKEN #IMPLIED >

Page 25: G raph E x change  L anguage An overview

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

CASCON 2000 (25)

u :

t :

f :

Support for Hierarchical Graphs

v : w :e :<graph> <node id = "v"/> <node id = "w"/> <edge id = "e" from = "v" to = "w"/></graph>

innergraph.xml

<graph> <node id = "t"> <attr name = "inner"> <locator xlink:href = "innergraph.xml"/> </attr> </node> <node id = "u"/> <edge id = "f" from = "t" to = "u"/></graph>

main.xml

by graph-valued attributes

Page 26: G raph E x change  L anguage An overview

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

CASCON 2000 (26)

Support for Hierarchical Graphs

u :

t :

f :

v : w :e :

Edges crossing hierarchies

<graph> <node id = "t"> <attr name = "inner"> <locator xlink:href = "innergraph.xml"/> </attr> </node> <node id = "u"> <attr name = "inner"> <locator xlink:href = "innergraph.xml#w"/> </attr> </node> <edge id = "f" from = "t" to = "u"/></graph>

main.xml

Page 27: G raph E x change  L anguage An overview

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

CASCON 2000 (27)

u :

t :

f :

Support for Hierarchical Graphs

v : w :e :

by nested graphs

<node id = "t">

</node><node id = "u"/> <edge id = "f" from = "t" to = "u"/>

<graph> <node id = "v"/> <node id = "w"/> <edge id = "e" from = "v" to = "w"/></graph>

Page 28: G raph E x change  L anguage An overview

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

CASCON 2000 (28)

Support for Hierarchical Graphs

u :

t :

f :

v : w :e :

Edges crossing hierarchies

g :

<node id = "t"> <graph> <node id = "v"/> <node id = "w"/> <edge id = "e" from = "v" to = "w"/> </graph></node><node id = "u"/> <edge id = "f" from = "t" to = "u"/>

<edge id = "g" from = "u" to = "w"/>

Page 29: G raph E x change  L anguage An overview

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

CASCON 2000 (29)

Support for Graph Drawing

<node id = "v" <attr name = "position"> <tup> <float>0.0</float> <float>0.0</float> </tup> </attr> <attr name = "width"> <float>2</float> </attr> <attr name = "height"> <float>1.5</float> </attr></edge>

<edge id = "e" from = "v" to = "w"> <attr name = "polyline"> <tup> <float>0.0</float> <float>0.0</float> </tup> <tup> <float>5.0</float> <float>5.0</float> </tup> </attr></edge>

layout data is represented as ordinary attribute

Page 30: G raph E x change  L anguage An overview

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

CASCON 2000 (30)

GXL Extension

• by redefining entities• by including GXL DTD (external entities)

<!ENTITY % gxl-extension "FOO ," ><!ELEMENT FOO (#PCDATA)>

<!ENTITY % basegxl SYSTEM "gxl.dtd">

%basegxl;

• GXL offers extending– GXL documents– graphs– nodes– edges– hyperedges (rel)– contexts and links – values

Page 31: G raph E x change  L anguage An overview

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

CASCON 2000 (31)

GXL Extension (DTD)

<!ENTITY % gxl-extension "" > <!ENTITY % graph-extension "" > <!ENTITY % node-extension "" > <!ENTITY % edge-extension "" > <!ENTITY % rel-extension "" > <!ENTITY % value-extension "" > <!ENTITY % context-extension "" > <!ENTITY % link-extension "" >

Page 32: G raph E x change  L anguage An overview

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

CASCON 2000 (32)

Graph Schema

UML class diagram(schema)

Var

file : string

line : int

line : int

refers

Proc

v : Var

file="main.c"

line = 27

line = 42

e : refers

UML object diagram(graph)

p : Proc

?

Page 33: G raph E x change  L anguage An overview

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

CASCON 2000 (33)

GXL Schema Representation

UML class diagram

Var

file:string

line : int

line : int

Proc

refers

:Nodetype

name="Proc"

: Attributename="file"

: Domain

name="string"

: Edgetype

name="refers"

: Nodetype

name="Var"

: Domain

name="int"

: Attributename="line"

from

to

hasAttr hasDom

hasAttr

hasAttr

hasDom

approach

schema graph

?

Page 34: G raph E x change  L anguage An overview

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

CASCON 2000 (34)

GXL Schema Representation

UML class diagram

Var

file:string

line : int

line : int

Proc

refers

Ric´s approach

schema graph

refers :

line : int

Proc :

file : string

Var :

line : int

<node id = "Proc"> <attr name = "file"> <string/> </attr></node><node id = "Var"> <attr name = "line"> <int/> </attr></node><edge id = "refers" from = "Proc" to = "Var"> <attr name = "line"> <int/> </attr></edge>

?

Page 35: G raph E x change  L anguage An overview

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

CASCON 2000 (35)

GXL Schema Representation

IST Approach clear distinction of

instance and schema level

same notation for all meta levels

conforms UML meta modeling

edges and nodes on Mi are represented by nodes on Mi+1

blows up graph size

Ric´s Approach different interpretation of

attributes depending from meta level

requires "kind"-attributes to distinguish attributes and meta attriubtes

edges/nodes on Mi are represented as edges/nodes on Mi+1

small graphs isomor-phic

to class diagram

Page 36: G raph E x change  L anguage An overview

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

CASCON 2000 (36)

GXL Tools

converters to/from GXL• progress2gxl, gxl2progress (UAachen)• g2gxl, gxl2g, gxl2sg, gxl2html (UKoblenz) • gxl2rsf (Claudio Riva, Nokia)• gxl2dot (Michal Young, UOregon)• gxl2rsf, rsf2gxl (Jeff Michaud, UVictoria) • gxl2ta, ta2gxl (UWaterloo)

Page 37: G raph E x change  L anguage An overview

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

CASCON 2000 (37)

GXL Tools: GXL2HTML

p :

v :

e : refers

Proc

Var

file = "main.c"

line = 27

<?xml version="1.0"?> <!DOCTYPE gxl SYSTEM "gxl.dtd"> <gxl><graph><node id = "p">

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

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

</edge><graph></gxl>

id = "e"

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

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

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

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

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

Page 38: G raph E x change  L anguage An overview

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

CASCON 2000 (38)

Conclusion

GXL offers a standard exchange language for– directed and undirected– typed– attributed – graphs and hypergraphs

GXL offers a standard exchange language in – Software Reengineering– Graph Transformation– Graph Drawing

more information – http://www.gupro.de/GXL

Page 39: G raph E x change  L anguage An overview

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

CASCON 2000 (39)

Upcoming Events

• Workshop "Practical Data Interchange Issues with GXL" (after lunch)

• Workshop "Exchange Formats" (WCRE 2000)

• Dagstuhl Seminar "Interoperability of Reengineering Tools"

• APPLIGRAPH Meeting "Exchange Formats for Graph Transformation"

• WoSEF 2001 ???