• Keine Ergebnisse gefunden

Graph Exchange Language

N/A
N/A
Protected

Academic year: 2022

Aktie "Graph Exchange Language"

Copied!
23
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

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

(and many more)

(2)

Contents

Motivation and Idea GXL Overview

– Exchanging graphs with GXL – Exchanging schemas with GXL

GXL current work

– GXL Tools

Conclusion

(3)

extract:

parser and fact extractors for multi-language

systems, Ada, C/C++, Cobol, Java, SQL ...

abstract:

analysis techniques like querying, browsing, data flow analysis,

architecture recovery, cluster analysis ...

view:

visualization

charts, diagrams, graphs, tables, source code, ...

GXL Background

Tools in Software Reengineering

source code source

code extract extract

repository repository

abstract abstract

view view

(4)

History

(5)

GXL Partners

(6)

1 function main (){

...

8 a := max(a,b);

...

19 b := min(b,a);

...

}

GXL Example

typed nodes attributed nodes

attributed edges

ordered incidences directed

edges

typed

edges

(7)

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)

(8)

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

(9)

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)

(10)

GXL Graph Model

typed graphs

attributed graphs

directed graphs

ordered graphs hierarchical

graphs hyper- graphs

graph part

(11)

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;)* >

(12)

Exchanging Graphs with GXL

Attributed, typed, directed Graphs Undirected Graphs

Ordered Graphs Hypergraphs

Hierarchical Graphs

(13)

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>

<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"

(14)

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

(15)

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 :

(16)

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

(17)

GXL Schema Representation

UML class diagram

Var file:string

line : int line : int

Proc

refs

Proc:NodeClas s

name="Proc"

a1:Attribu te

name="file"

s : String

refs:

EdgeClass

name="refs"

var:NodeClass

name="Var"

i :

Integer a2:Attribut

e

name="line"

comesFrom

goesTo has Attribute

has Domain

has

Attribute

has

Attribute

has Domain

schema graph

(18)

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>

(19)

GXL Metaschema (Graph

Part)

(20)

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)

(21)

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

(22)

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

(23)

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 information

http: www.gupro.de/GXL mailto:

gxl@uni-koblenz.de

Referenzen

ÄHNLICHE DOKUMENTE

Nokia Research Center (Software Technology Laboratory), Finland Philips Research (Software Architecture Group), The Netherlands RWTH Aachen (Department of Computer Science III),

mathematical model on instance and schema level – typed, attributed, directed

– graphs matching different graph schemas – graph classes matching a metaschema.. © Institut