graph

Werbung
Universität Koblenz-Landau
Institut für Softwaretechnik
Re-Group
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)
Graph Drawing
Vienna, September 26, 2001
Contents
Motivation and Idea
GXL Overview
– Exchanging graphs with GXL
– Exchanging schemas with GXL
GXL current work
– GXL Tools
Conclusion
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (2)
Graph Drawing 2001
GXL Background
Tools in Software Reengineering
source
code
extract
abstract:
extract:
view:
analysis techniques
parser and fact extractors
visualization
like querying, browsing,
for multi-language
charts,
diagrams,
data flow analysis,
systems,tables,
graphs,
Ada, C/C++,
architecture recovery,
Cobol, Java,
source
code,SQL
... ...
cluster analysis ...
©
Institut für Softwaretechnik
Universität Koblenz-Landau
repository
view
abstract
Vienna, September 26, 2001 (3)
Graph Drawing 2001
History
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (4)
Graph Drawing 2001
GXL Partners
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (5)
Graph Drawing 2001
GXL Example
attributed nodes
1
attributed
edges 8
19
©
typed nodes
function main (){
...
directed
a :=edges
max(a,b);
...
ordered
incidences
b :=
min(b,a);
...
}
Institut für Softwaretechnik
Universität Koblenz-Landau
typed
edges
Vienna, September 26, 2001 (6)
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)
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (7)
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
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (8)
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)
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (9)
Graph Drawing 2001
GXL Graph Model
typed
graphs
hierarchical
graphs
hypergraphs
©
Institut für Softwaretechnik
Universität Koblenz-Landau
graph part
attributed
graphs
directed
graphs
ordered
graphs
Vienna, September 26, 2001 (10)
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;>
©
Institut für Softwaretechnik
Universität Koblenz-Landau
<!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
name
kind
IDREF
#IMPLIED
NMTOKEN #REQUIRED
NMTOKEN #IMPLIED >
<!ENTITY % val " locator | bool | int | float | string | enum |
seq | set | bag |tup %value-extension; ">
<!ELEMENT locator EMPTY >
<!ATTLIST locator xlink:type (simple)
xlink:href CDATA
#FIXED "simple"
#IMPLIED >
<!ELEMENT bool |int | float | string (#PCDATA) >
<!ELEMENT enum
(#PCDATA) >
<!ELEMENT seq | set | bag | tup (%val;)* >
Vienna, September 26, 2001 (11)
Graph Drawing 2001
Exchanging Graphs with GXL
Attributed, typed, directed Graphs
Undirected Graphs
Ordered Graphs
Hypergraphs
Hierarchical Graphs
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (12)
Graph Drawing 2001
Exchanging Graphs with GXL
typed attributed graph
p : Proc
file = "main.c"
r : refs
v : Var
line = 27
©
Institut für Softwaretechnik
Universität Koblenz-Landau
<gxl>
<graph id="example">
<type xlink:href = "schema.gxl"/>
<node id = "p">
<type xlink:href =
"schema.gxl#Proc"/>
<attr name = "file">
<string>main.c</string></attr>
</node>
<node id = "v">
<type xlink:href =
"schema.gxl#Var"/>
<attr name = "line">
<int>27</int></attr>
</node>
<edge id = "r"
from = "p" to = "v">
<type xlink:href =
"schema.gxl#refs"/>
</edge>
<graph></gxl>
Vienna, September 26, 2001 (13)
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
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (14)
Graph Drawing 2001
Exchanging Schemas with GXL
Graph
(UML object diagram)
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
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (15)
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
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (16)
Graph Drawing 2001
GXL Schema Representation
UML class
diagram
Proc
schema graph
a1:Attribute
has
has
name="Proc" Attribute name="file" Domain
Proc:NodeClass
file:string
refs
comesFrom
refs: EdgeClass
line : int
name="refs"
has
Attribute
a2:Attribute
goesTo
Var
line : int
var:NodeClass
name="Var"
©
s : String
Institut für Softwaretechnik
Universität Koblenz-Landau
name="line"
has
Domain
i : Integer
has
Attribute
Vienna, September 26, 2001 (17)
Graph Drawing 2001
GXL Schema Representation
<?xml version="1.0"?>
<node id = "n2">
<!DOCTYPE gxl SYSTEM "gxl.dtd">
<type xlink:href =
<gxl>
"gxl.gxl#nodeClass"/>
<graph id="simpleSchema">
<attr name = "name">
<type xlink:href = "gxl.gxl"/>
<string>Var</string>
<node id = "n1">
</attr>
<type xlink:href =
</node>
"gxl.gxl#NodeClass"/>
...
<attr name = "name">
<edge from = "e" to = "n1">
<string>Proc</string>
<type xlink:href =
</attr>
"gxl.gxl#comesFrom"/>
</node>
</edge>
<node id = "e">
<edge from = "e" to = "n2">
<type xlink:href =
<type xlink:href =
"gxl.gxl#edgeClass"/>
"gxl.gxl#goesTo"/>
<attr name = "name">
</edge> <graph>
<string>refs</string>
</gxl>
</attr>
</node>
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (18)
Graph Drawing 2001
GXL Metaschema (Graph Part)
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (19)
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)
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (20)
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
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (21)
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
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (22)
Graph Drawing 2001
Conclusion
GXL: uniform language for
more information
– exchanging graphs
http: www.gupro.de/GXL
– exchanging graph schemas
GXL: ratified as standard
exchange format
mailto:
[email protected]
– 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
©
Institut für Softwaretechnik
Universität Koblenz-Landau
Vienna, September 26, 2001 (23)
Graph Drawing 2001
Herunterladen