• Keine Ergebnisse gefunden

APPLIGRAPH meeting on exchange formats for Graph Transformation Graph Drawing workshop on data exchange formats (GD 2000) CASCON 2000 WCRE 2000 Dagstuhl 2001

N/A
N/A
Protected

Academic year: 2022

Aktie "APPLIGRAPH meeting on exchange formats for Graph Transformation Graph Drawing workshop on data exchange formats (GD 2000) CASCON 2000 WCRE 2000 Dagstuhl 2001"

Copied!
15
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Exchanging Graphs with GXL

AndreasWinter

UniversitätKoblenz-Landau,InstitutfürSoftwaretechnik

D-56016Koblenz,Postfach201602

mailto:winter@uni-koblenz.de

http://www.gupro.de/winter

Abstract. GXL(GrapheXchangeLanguage)isdesignedtobeastan-

darddataexchangeformatfor graph-basedtools.GXLisdenedasan

XMLsublanguage, whichoerssupportfor exchanginginstancegraphs

togetherwiththeirappropriateschemainformationinauniformformat.

Formally,GXL isbased ontyped,attributed, directed, orderedgraphs

which are extended by concepts to represent hypergraphs and hierar-

chical graphs. Using this general graphmodel, GXL oers a versatile

supportforexchangingnearlyallkindsofgraphs.

1 Motivation and Background

A great variety of software tools relies on graphsas internal data representa-

tion.A standardizedlanguageforexchangingthosegraphsoersarst stepin

improvinginteroperabilitybetweenthesetools.Insoftwarereengineering,forin-

stance,various graph-basedtoolsareused. Theseinclude extractors (e.g.scan-

ner, parser), abstractors (e.g. query tools, structure recognition tools, slicing

toolsetc.),andvisualizer(e.g.graphanddiagramvisualizer,codebrowser).Cur-

rently,thesetoolcomponentsareusedmoreorlessindependently.[29]givesan

overviewonexistingcombinationsoftoolsusedinvariousreengineeringprojects.

Usingacommongraphinterchangeformat,thesetoolscanbecomposedtobuild

agenraland powerfulreengineeringworkbench.

ThedevelopmentofGXL (Graph eXchange Language) originallystarted to

support data interoperabilitybetweenreengineeringtools.But sinceGXL was

developed as a generalformat for describing graph structures, it is applicable

in further areasoftoolinteroperability.Especially, GXL isused to supportin-

teroperabilitybetweengraphtransformationsystems[45]orgraphvisualization

systems.Now,theworkonGXLaimsatoeringageneralexchange formatfor

graph-basedtools.

ExchanginggraphswithGXLdealswithboth,instancegraphsandtheircor-

respondinggraphschemas.Firstly,GXLoersaversatilesupportforexchanging

all kinds of data based on typed, attributed, directed, ordered graphs including

hypergraphs and hierarchical graphs. Secondly, GXL oers means for exchang-

ing graphschemas representingthe graphstructure i.e. thedenition of node

andedgeclasses,theirattributeschemasandtheirincidencestructure.Both,in-

stancegraphsandgraphschemas,areexchangedbyXMLdocuments(Extended

MarkupLanguage)[47].

?

c

SpringerVerlag:P.Mutzel(ed.) GraphDrawing -9thInterationalSymposium,

(2)

of GXLto exchangeinstance graphsare introduced insection 3.Thelanguage

denition ofGXLis givenbyitsXMLdocumenttypedenition (DTD)in sec-

tion 3.4. Section 4describesthe exchange of graph schemas. The current and

intendedusageofGXLissummarizedin section5.

Moreinformation on GXL canbefound in [29] and[27]. Up-to-date infor-

mation includingtutorials and further GXL documents arecollected at http:

//www.gupro.de/GXL.

2 Genealogy of GXL

GXLoriginatedinamergerofGRApheXchangeformat(GraX)[10],TupleAt-

tributeLanguage(TA)[26],andthegraphformatofthePROGRESgraphrewrit-

ingsystem[41].Thegraphmodelresultingfrom thismergerwassupplemented

byadditionalconceptstohandlehierarchicalgraphsandhypergraphs.Further-

more,GXLincludesideasfromcommonexchangeformatsusedinreengineering,

includingATerms[46],RelationPartitionAlgebra(RPA)[36],andRigiStandard

Format(RSF)[52].Furtherfeatures fromXML-basedexchangeofgraphtrans-

formation systems, developed by groups in Barcelona, Berlin, Budapest, and

Kent[22]wereincludedintoGXL.ThedevelopmentofGXLwasalsoinuenced

byvariousformatsusedingraphdrawinge.g.daVinci[13],GML/Graphlet [18],

GRL [33] XGMML [53], and GraphXML [25]. Thus, GXL covers most of the

importantgraphformats.Itcanbeviewedasageneralizationoftheseformats.

ThegenealogyofGXL isdepictedin gure2.

WoSEF 2000

APPLIGRAPH meeting on exchange formats for Graph Transformation Graph Drawing workshop on data exchange formats (GD 2000) CASCON 2000 WCRE 2000 Dagstuhl 2001

"Interoperability of Reengineering Tools"

GraX

GXL 0.4.2

PROGRES TA

RPA RSF ATerms

GXL 0.6.6

GXL 0.7 GraphXML

Barcelona Berlin Budapest

Kent WCRE 1999

AlGra 2000 GROOM 2000

GXL 0.7.2

GXL 1.0 daVinci

GML Graphlet

GML XGMML

Fig.1.GenealogyofGXL

ThedevelopmentofGXLwasadvancedduringvariousconferencesandwork-

shopssince1998.Firsteortsondening ageneralexchangeformatforreengi-

(3)

WCRE 1999 [50], AlGra 2000 [1], and GROOM 2000 [20]. These discussions

resulted in the rst version of GXL, which was presented at the ICSE 2000

workshop on standard exchange formats (WoSEF 2000) [43]. Subsequent ver-

sions were discussed and compared to similar approaches from related areas

at the APPLIGRAPH meeting for exchangeformats for graphtransformation

systems[22] andthe GraphDrawing2000 workshop onexchangeformats [16].

Improvementsof these versions werepresentedin CASCON2000tutorials [28]

andworkshops[44]andduringtheWCRE2000exchangeformatsworkshop[31].

GXL (version 1.0) was ratied as standard exchange format in software

reengineeringattheDagstuhlSeminar"InteroperabilityofReengineeringTools"

in January2001[7]. Current work dealswith gatheringexperiences with GXL

version1.0andprovidingtoolsupportforworkingwithGXL.

3 Exchanging Graphs

Duetotheirmathematicalfoundationandalgorithmicpower,graphsareacom-

mondatastructureinsoftwareengineering.Dierentgraphmodelse.g.directed

graphs,undirectedgraphs,nodeattributedgraphs,edgeattributedgraphs,node

typed graphs, edge typed graphs, ordered graphs, relational graphs, acyclic

graphs,trees, etc. orcombinationsof these graphmodelsare utilized in many

software systems.Tosupport interoperability of graph-based tools, the under-

lying graph model has to be asrich as possible to covermost of these graph

models.

Such a common graph model is given by typed, attributed, directed, or-

deredgraphs(TGraphs)[9],[10].TGraphsaredirectedgraphs,whosenodesand

edges may be attributed and typed. Each type can be assigned an individual

attributeschemaspecifyingthepossibleattributesofnodesandedges.Further-

more,TGraphsareordered,i.e.thenodeset,theedgeset, andthesetsofedges

incident to a node have a total ordering. This ordering givesmodeling power

todescribesequencesofobjects(e.g.parameterlists)andfacilitatestheimple-

mentationofdeterministicgraphalgorithms.InapplyingTGraphstotheother

graphmodels,notallpropertiesofTGraphshavetobeusedtotheirfullextent.

These graph models canbeviewed asspecializations of TGraphs.Exchanging

typed,attributed,directed,orderedgraphsortheirspecializationswithGXLis

introducedinsection3.1

Tooersupport for hypergraphs andhierarchical graphs,TGraphswereex-

tended by n-ary edges and by nodes and edges containing lowerlevelgraphs.

GXL languageconstructs for exchanging hypergraphs and hierarchical graphs

are sketched in section 3.2 and 3.3. The complete GXL languagedenition is

givenin section3.4in termsofaXMLdocumenttypedenition.

3.1 Exchanging typed, attributed,directed,ordered graphs

Theobjectdiagram(cf.[40])ingure2showsanodeandedgetyped,nodeand

(4)

in line 8 and function b =min(b;a) in line 19. Thefunctions main, max and

min arerepresentedbynodesoftypeFunction.Thesenodesareattributedwith

thefunctionname.FunctionCall nodesrepresentthecallsoffunctionsmax and

min. They are associated to the caller by isCaller edges and to the callee by

isCallee edges.isCaller edges are attributed with aline attribute showingthe

linenumberwhichcontainsthecall.Inputparameters(representedbyVariable

nodes that are attributed with the variable name) are associated by isInput

edges. The ordering of parameter lists is given by ordering the incidences of

isInput edges pointing to FunctionCall nodes. The rst edge of type isInput

incidenttofunctioncallv2 (modelingthecallofmax(a,b))comesfromnodev6

representingvariablea.ThesecondedgeoftypeisInputconnectstothesecond

parameterb (nodev7).TheincidencesofisInput edgesassociatedwithnodev3

model thereversedparameterorder.Outputparametersareassociatedtotheir

function callsbyisOutput edges.

v1 : Function name = "main"

v4 : Function name = "max"

v6 : Variable name = "a"

v7 : Variable name = "b"

v5 : Function name = "min"

v2 : FunctionCall v3 : FunctionCall

e1 : isCaller line = 8

e2 : isCaller line = 19

e3 : isCallee e4 : isCallee

e6 : isInput e7 : isInput

e5: isInput e8 : isInput {1}

{1} {2} {2}

e9 : isOutput e10 : isOutput

Fig.2.typed,attributed,directed,orderedgraph

Exchanginggraphsliketheonein gure2requires languageconstructsfor

representing nodes, edges and their incidence relation. Furthermore, support

for describing type information, attribute values, and ordering information is

needed.

Figure 3depicts thegraph from gure2 asGXL document. The complete

grammarforthesedocumentsisgiveninsection3.4.XMLdocumentsstartwith

specifyingtheXML versionandtheunderlying documenttypedenition, here

"gxl.dtd". The body of a GXL document is enclosed in

<gxl>

tags. The GXL

document in gure 3 contains one graph, enclosed in

<graph>

tags, with an

uniqueidentier"simpleGraph".Thegraphreferstoitsassociatedgraphschema

(cf. section 4) stored in le schema.gxl. GXL supports both, graphswith edges

havingauniqueobjectidentier,andgraphswithunnamededges.Theattribute

(5)

<!DOCTYPEgxlSYSTEM"gxl.dtd">

<gxl>

<graphid="simpleGraph"

edgeids="true">

<typexlink:href="schema.gxl"/>

<nodeid="v1">

<typexlink:href=

"schema.gxl#Function"/>

<attr

name="name"

>

<string>main</string>

</attr>

<node

id="v2"

>

<type

xlink:href=

"schema.gxl#FunctionCall"/>

</node>

<node

id="v3"

>

<type

xlink:href=

"schema.gxl#FunctionCall"/>

</node>

<node

id="v4"

>

<typexlink:href=

"schema.gxl#Function"/>

<attrname="name">

<string>max</string>

</attr>

</node>

<nodeid="v5">

<typexlink:href=

"schema.gxl#Function"/>

<attrname="name">

<string>min</string>

</attr>

</node>

<node

id="v6"

>

<type

xlink:href=

"schema.gxl#Variable"/>

<string>a</string>

</attr>

</node>

<nodeid="v7">

<typexlink:href=

"schema.gxl#Variable"/>

<attrname="name">

<string>b</string>

</attr>

</node>

<edge

id="e1"

from="v2"to= v1"/>

<type

xlink:href=

"schema.gxl#isCaller"/>

<attr

name="line"

>

<int>8</int>

</attr>

</edge>

<edge

id="e2"

from="v3"to= v1"/>

<typexlink:href=

"schema.gxl#isCaller"/>

<attrname="line">

<int>19</int>

</attr>

</edge>

<edgeid="e3"

from="v4"to=v2"/>

<typexlink:href=

"schema.gxl#isCallee"/>

</edge>

<edge

id="e9"

from="v6"to=v2"

<type

xlink:href=

"schema.gxl#isOutput"/>

</edge>

from="v6"to=v2"

toorder="1"/>

<typexlink:href=

"schema.gxl#isInput"/>

</edge>

<edgeid="e6"

from="v7"to=v2"

toorder="2"/>

<type

xlink:href=

"schema.gxl#isInput"/>

</edge>

<edge

id="e7"

from="v6"to=v3"

toorder=

"2"/>

<type

xlink:href=

"schema

.gxl#isInput"/>

</edge>

<edge

id="e8"

from="v7"to=v3"

toorder=

"1"/>

<typexlink:href=

"schema.gxl#isInput"/>

</edge>

<edgeid="e9"

from="v6"to=v2"

<typexlink:href=

"schema.gxl#isOutput"/>

</edge>

<edgeid="e10"

from="v7"to=v3"

<type

xlink:href=

"schema.gxl#isOutput"/>

</edge>

</graph>

</gxl>

Fig.3.GXLrepresentationofgraphfromgure2

Nodes and edges of a given graph are exchanged by <node> and <edge>

elementswhich can be addressedby their identier attribute. Incidence infor-

mation of edges including edge orientation is stored in from and to attributes

within

<edge>

tags.Orderingofincidencesisalsomodeledhere.Attributesfro-

morderand toorder representthe position of anedge in theincidence list of its

startandtargetnode.Nodeandedgetypesarerepresentedbylinkspointingto

theappropriateschemainformation.This linkisenclosedin

<type>

tags.

<node>

and

<edge>

elementsmayadditionallycontainfurtherattributein-

formation.

<attr>

elementsdescribeattribute name andvalue. LikeOCL [48],

GXL provides

<bool>, <int>, <oat>,

and

<string>

attributes. Furthermore,

enumeration values

(<enum>)

and URI-references

(<locator>)

pointing to ex-

ternallystoredobjectsaresupported.Attributevaluesmightbesubstructured.

Here,GXLoerscompositeattributeslikesequences(<seq>),sets(<set>),multi

sets(<bag>),andtuples(<tup>).

3.2 Exchanging Hypergraphs

Inadditiontographs,GXLprovidestheexchangeofhypergraphs.Hypergraphs[3]

(6)

undirected,orderedhypergraphs.

Figure 4shows ahypergraph in UML notation, modeling the function call

a=max(a;b)bya5-aryhyperedgeoftypeFunctionCall2.Thediamond,repre-

sentingthehyperedge,isconnectedbyundirectedlines(tentacles)toitsrelated

Function-and Variable-nodes.These tentaclesare markedwith roles, identify-

ingcaller, callee,input,andoutput.Numbersdescribingtheorderofincidences

of tentaclesaccordingthehyperedge,indicate theordering ofparameters.Like

edgee1 ingure2,thehyperedgeisattributedwithaline attribute.

TheGXL representation ofthis hyperedgeis given in gure5. Hyperedges

arerepresentedby<rel>elements(relation).Like<node>and<edge>elements,

<rel>

elementscan contain type

(<type>)

and attribute

(<attr>)

information.

Tentacles,which pointto therelatedgraphobjects(target),arerepresentedby

<relend>

subelements (relation end). Roles of tentacles are stored in role at-

tributes. Incidences accordingto thehyperedgeare exchangedbystartorder at-

tributes.Theorderingoftentaclesaccordingtheirtargetobjectscanbemodeled

byendorderattributes.Directed orundirectedhyperedgesandtentaclesare dis-

tinguishedbyattributesisdirectedanddirection(cf.theGXLDTDinsection3.4).

v1 : Function name = "main"

v4 : Function name = "max"

v6 : Variable name = "a"

v7 : Variable name = "b"

r1 : FunctionCall2 line = 8 callee

input input

{1} {2}

caller

output

Fig.4.Hypergraph

...

<rel

id="r1"

>

<type

xlink:href=

"schema2.gxl#FunctionCall2"/>

<attr

name="line"

>

<int>8</int>

</attr>

<relend

target="v1"role=

"caller"/>

<relend

target="v2"role=

"callee"/>

<relendtarget="v6"role="output"/>

<relendtarget="v6"role="input"

startorder="1"/>

<relendtarget="v7"role="input"

startorder="2"/>

</rel>

...

Fig.5.GXL representation

Edgescan be viewedas2-ary hyperedges.Thus, in GXL, edge information

canberepresentedby binary hyperedges. Sincegraphswith (binary)edges are

widespreadin softwareengineering and mostapplications dealwithgraphsin-

stead ofhypergraphs,GXL oersboth,theelement<rel>forhyperedges,and,

asashortcutforbinaryhyperedges,<edge>elements.

3.3 Exchanging Hierarchical Graphs

Graphs gather their popularity from their mathematical foundation and their

visualcapabilitiestoexpresscomplexcontexts.However,duetotheirsize,large

graphs become bulky and dicult to understand. This complexity can be re-

duced by structuringgraphs. Parts of graphsrepresenting related objectscan

begroupedtogetherto form encapsulated,higherlevelstructures. Hierarchical

graphs[4]support structuringgraphsbygroupingandencapsulation.

Figure 6 depicts a hierarchical graph. Node v4 (cf. gure 2) contains a

(7)

v4 : Function name = "max"

v4.4 : ReturnStmt

e4.7 : isPredicate

{1} {2}

v4.5: ReturnStmt

v4.6 : Variable name = "x"

v4.8 : Operator name = ">"

v4.7 : Variable name = "y"

v4.3 : OpExpr v4.2 : IfStmt

v4.1 : Interface

e4.1 : isFormalInput e4.2 : isFormalInput

e4.9 : isOperand e4.8 : isOperand

e4.10 : isOperator

{1} {2}

e4.11 : isReturn Value

e4.12 : isReturn Value e4.6: isFalseStmt e4.5 : isTrueStmt

e4.3: isFormalOutput e4.4: isFormalOutput

Fig.6.HierarchicalGraph

<node

id="v4"

>

<type

xlink:href="schema.gxl#Function"

/>

<attr

name="name"

>

<string>max</string>

</attr>

<graphid="max">

<typexlink:href="asg.gxl">

<nodeid="v4.1">

<typexlink:href="asg.gxl#Interface">

</node>

...

<edgeid="e4.12"

from="v4.7"to=v4.5"/>

<type

xlink:href=

"asg.gxl#isReturnValue"/>

</edge>

</graph>

</node>

...

Fig.7.GXLrepresentation

of function max. The GXL representation in gure 7 shows this subgraph as

<graph> subelement of node v4.Subgraphs associated to edges or hyperedges

areexchangedanalogously(cf.theGXLDTD insection3.4).

Thisrepresentationforhierarchicalgraphsworksforthosehierarchicalgraphs

with strong ownership for each graphobject. This representationalso permits

edgesandhyperedgescrossingtheboundariesofgraphhierarchies.Thoseedges

arecontainedintheleast-common-ancestor-graph.

Sincenogeneralmodelforhierarchicalgraphsexistssofar(cf.[4]),GXLpro-

videsfurthersupportforexchanginggraphhierarchies.Alternatively,references

to subgraphs and their elements can be exchanged using <locator> attributes

pointing to their appropriate GXL representation. Further support might be

oered in a next GXL version by graph-valued attributes orby special edges,

representinghierarchy.

3.4 GXL DocumentType Denition

The language features of GXL for exchangingtyped, attributed, directed, or-

deredgraphs,hypergraphs,andhierarchicalgraphsaresummarizedinaconcep-

tualmodeldeningthegraphmodelsupportedbyGXL.TheGXLgraphmodel

iscompletely describedat http://www.gupro.de/GXL/(graph model) withits

graphstructure partanditsattributepart.

Since GXL is a XML sublanguage, the GXL graph model had to betran-

scribed into a XML document type denition (DTD) oran appropriate XML

schema denition. Tokeep GXL simple and less verbose, this translation was

donemanually. Theresulting DTD (cf. gure8,a commented versionis given

athttp://www.gupro.de/GXL(DTD))requiresonly18XML elements.Incon-

trast, an appropriate DTD generated with IBMs XMI Toolkit [30] according

theXMLMetadataInterchange(XMI)principlesfordevelopingDTDs[35,sec-

tion 3]requires 66elementsfor the GXL coreand andadditional 63 elements

(8)

extensions

<!ENTITY

%gxl-extension ""

>

<!ENTITY

%graph-extension ""

>

<!ENTITY

%node-extension ""

>

<!ENTITY

%edge-extension ""

>

<!ENTITY

%rel-extension ""

>

<!ENTITY

%value-extension ""

>

<!ENTITY

%relend-extension ""

>

<!ENTITY

%gxl-attr-extension ""

>

<!ENTITY

%graph-attr-extension""

>

<!ENTITY%node-attr-extension"">

<!ENTITY%edge-attr-extension"">

<!ENTITY%rel-attr-extension "">

<!ENTITY%relend-attr-extension"">

<!attributevalues>

<!ENTITY%val"locatorjbooljintjoatjstringj

enumjseqjsetjbagjtup

%value-extension;">

<!gxl>

<!ELEMENT

gxl(graph*%gxl-extension;)

>

<!ATTLIST

gxl

xmlns:xlink CDATA #FIXED

"www.w3.org/1999/xlink"

%gxl-attr-extension;

>

<!

type

>

<!ELEMENT

type

EMPTY>

<!ATTLIST

type

xlink:type (simple) #FIXED"simple"

xlink:href CDATA #REQUIRED

>

<!

graph

>

<!ELEMENT

graph(type?,attr*,

(nodejedgejrel)*

%graph-extension;)>

<!ATTLISTgraph

id ID #REQUIRED

role NMTOKEN #IMPLIED

edgeids (truejfalse) "false"

hypergraph(truejfalse) "false"

edgemode (directedjundirectedj

defaultdirectedjdefaultundirected)

"directed"

%graph-attr-extension;>

<!

node

>

<!ELEMENT

node(type?,attr*,graph*

%node-extension;)

>

<!ATTLIST

node

id ID #REQUIRED

%node-attr-extension;

>

<!

edge

>

<!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 (truejfalse) #IMPLIED

%edge-attr-extension;>

<!rel>

<!ELEMENTrel(type?,attr*,graph*,relend*

%rel-extension;)>

<!ATTLISTrel

id ID #IMPLIED

isdirected (truejfalse) #IMPLIED

%rel-attr-extension;>

<!relend>

<!ELEMENT

relend(attr*%relend-extension;)

>

<!ATTLIST

relend

target IDREF #REQUIRED

role NMTOKEN #IMPLIED

direction (injoutjnone) #IMPLIED

startorder CDATA #IMPLIED

endorder CDATA #IMPLIED

%relend-attr-extension;

>

<!

attr

>

<!ELEMENT

attr(type?,attr*,(%val;))

>

<!ATTLIST

attr

id IDREF #IMPLIED

name NMTOKEN #REQUIRED

kind NMTOKEN #IMPLIED>

<!locator>

<!ELEMENTlocatorEMPTY>

<!ATTLISTlocator

xlink:type (simple) #FIXED"simple"

xlink:href CDATA #IMPLIED>

<!attributevalues>

<!ELEMENTbool(#PCDATA)>

<!ELEMENT

int(#PCDATA)

>

<!ELEMENToat(#PCDATA)>

<!ELEMENT

string(#PCDATA)

>

<!ELEMENT

enum(#PCDATA)

>

<!ELEMENT

seq(%val;)*

>

<!ELEMENT

set(%val;)*

>

<!ELEMENT

bag(%val;)*

>

<!ELEMENT

tup(%val;)*

>

Fig.8.GXL DocumentTypeDenition

4 Exchanging Graph Schemas

Graphs onlyoer aplain structured meansfor describingobjects(nodes) and

their interrelationship (edges, hyperedges). Graphs have no meaning of their

own.Themeaningofgraphscorrespondstothecontextinwhichtheyareused

andexchanged.Theapplicationand interchangecontextdetermines

whichnode,edge,andhyperedgeclassesareused,

whichrelationsexistbetweennodes,edges,andhyperedgesofgivenclasses,

(9)

whichadditionalconstraints(likeorderingofincidences,degree-restrictions

etc.)havetobecomplied.

This schematicdata canbedescribedbyconceptual modeling techniques. Class

diagramsoerasuiteddeclarativelanguagetodenegraphclasseswithrespect

toagivenapplicationorinterchangecontext[10].

4.1 Describing graph classesby class diagrams

InGXLgraphclassesaredenedbyUMLclassdiagrams[40].Figure9showsa

graphschemadeningclassesofgraphsliketheonegiveningure2.Nodeclasses

(FunctionCall,Function,and Variable) aredened byclasses.Edgeclasses(is-

Callee,isInput,andisOutput)aredenedbyassociations.Attributededgeclasses

(isCaller)aredescribedbyassociatedclasses.Likeclasses,theycontaintheas-

sociated attribute structures. The orientation of edges is depicted by a lled

triangle (cf. [40, p. 155]. Since most of the available UML tools do not oer

this UMLconstruct, directed arrows(depictingvisibilityin original UML)can

be used alternatively (cf. gure 13). Multiplicities denote degree restrictions.

Orderingofincidencesisindicatedbythekeyword{ordered}.

Function

name : string

Variable

name : string

FunctionCall isCallee

0 ..*

1

1

0 ..* 0 ..*

0 ..*

isCaller

line : int {ordered}

isCaller

isInput

isOutput

1 0 ..*

Fig.9.Graph-Schema

In asimilar way, UML class diagrams oer language constructs to specify

classesofhypergraphsandhierarchicalgraphs.Figure10showsaclassdiagram

dening hypergraphs liketheonein gure4.Classesofhyperedgesaredened

by n-ary associations depicted by a diamond. This diamond is connected by

links to the related node classes. These links can be annotated by multiplic-

ity information to demand cardinalities, and by names indicating the role of

participating classes. The keyword {ordered} demands ordering of tentacles in

appropriateinstancegraphs.

ThedenitionofhierarchicalgraphsinUMLrequiresanadditionallanguage

constructrepresentinggraphclassesthemselves.Thestereotype<<GraphClass>>

distinguishesclassesrepresentinggraphclassesfromclassesdeningnodeclasses.

<<GraphClasses>>composeclassesand associationsto denethegraphschema

onthenextlevelofhierarchy.UMLprovidesanestednotationtorepresentthese

subschemaswithinthe<<GraphClass>>classes.Strong ownershipofsubgraphs

tographelementsisexpressedbycomposition(lleddiamond).Figure11denes

agraphclassforhierarchicalgraphsliketheone,depictedin gure6.Nodesof

ClassFunctioncontaingraphsofgraphclassasg.

To oer up-to-date conceptual modeling power,the GXL schema notation

(10)

Function name : string

Variable name : string FunctionCall

line : int

callee

input

{ordered}

caller

1

1 1

0..n output

Fig.10.Hypergraph-Schema

Function name : string

is Operand

Interface

isReturnValue

{ordered}

Stmt

Operator name : string

Variable name : string

Expression is

Predicate is Operator

isFormal Input isFormalOutput

0 .. n 0 .. n

0 .. 1 isTrueStmt

isFalseStmt

0 .. 1

1 0 .. n

0 .. n 0 .. n

0 .. n

0 .. n

IfStmt

1 0 .. n

OpExpr

0 .. n

0 .. n

{ordered}

ReturnStmt

1

0 .. n

<< GraphClass >> asg

Fig.11.HierarchicalGraph-Schema

aggregation and composition by using the appropriate UML notation (cf. the

denition of<<GraphClass>> asg ingure11.

4.2 Describing graph classesby graphs

SinceUML classdiagrams arestructuredinformation themselves,theymay be

representedasgraphsaswell.ForexchanginggraphschemasinGXL,UMLclass

diagrams are transfered into equivalent graph representations. Thus, instance

graphsand schemasare exchangedwiththe same type of document,i.e. XML

documentsmatchingtheGXLDTD (cf.section3.4).

Figure12depicts thetransformationof theclassdiagram in gure9intoa

nodeandedgetyped,nodeandedgeattributed,directedgraph.Node-,edge-and

hyperedge-classes,attributes and their domains are modeled by nodes of suit-

ablenodetypes.Theirattributesdescribefurtherproperties.Interrelationships

between surrogates of these classes are represented by edges of proper types.

Attribute information is associated with surrogates of node, edge, and hyper-

edge classesand associations byhasAttribute and hasDomain edges. from and

toedgesmodelincidencesofassociationsincludingtheirorientation.Multiplici-

tiesofassociationsarestoredinlimits-attributes.ThebooleanattributeisOrdered

indicatesordered incidences.

GXLdocuments,representinginstancegraphstoagivengraphschema,refer

tothosenodesoftheequivalentschemagraphrepresentingnodeclasses(Node-

Class), edge classes (EdgeClass) and hyperedge classes (RelClass). The nodes

representingtheseclass denitionsin gure12which arereferredby thegraph

in gure2areshaded.

Class diagrams dening hypergraphs or hierarchical graphs can be trans-

formedintographsanalogously.EachclassdiagramdeningaGXLgraphschema

can be transformed into a graph (schema graph) matching a suited schema,

representing GXL schema graphs. Schema graphs are instances of the GXL

(11)

sentingtheGXL metaschema,is aninstance ofitself, it isexchangedby aself

referringGXL document.

name = "isCallee"

isAbstract = false isDirected = true

name = "isInput"

isAbstract = false isDirected = true name = "isCaller"

isAbstract = false isDirected = true e1 : to

limits = (0,-1) isOrdered = false

name = "Function"

isAbstract = false

name = "Variable"

isAbstract = false v7: AttributeClass

name = "line"

v9 : Int

v8: AttributeClass name = "name"

v10 : String

e5 : to limits = (0,-1) isOrdered = true e3 : to

limits = (0,-1) isOrdered = false

e2 : from limits = (1,1) isOrdered = false

e4 : from limits = (1,1) isOrdered = false

e7 : hasAttribute

e8 : hasDomain

e9 : hasAttribute e10 : hasAttribute

e11 : hasDomain

name = "isOutput"

isAbstract = false isDirected = true e11 : to

limits = (0,-1) isOrdered = false

e6 : from limits = (0,-1) isOrdered = false

e12 : from limits = (1,1) isOrdered = false FunctionCall :

NodeClass name = "FunctionCall"

isAbstract = false

isCallee : EdgeClass

isCaller : EdgeClass

isInput : EdgeClass

isOutput : EdgeClass

Function : NodeClass

Variable : NodeClass

Fig.12.Graph-Schema(schemagraph)

IncontrasttothestrategyproposedbyXMLMetaDataInterchange(XMI)

[35],GXLschemasarenotexchangedbyXMLdocumentsaccordingtotheMeta

ObjectFacility(MOF)[34].XMI/MOFoersageneral,butveryverboseformat

for exchangingUML class diagrams as XML streams. Nextto itsexaggerated

verbosity, which contradicts the requirement for exchange formats of ascom-

pactaspossibledocuments,theXMI/MOFapproachrequiresdierenttypes of

documentsfor representingschema andinstance graphs. Especially in applica-

tionsdealingwithschemainformationoninstancelevel(e.g.intoolsforediting

and analyzing schemas), this leadsto the disadvantageof dierent documents

representing the same information, one on instance level (as XML document)

andoneonschemalevel(asXMLDTD).TheGXLapproachtreatsschemaand

instance informationin exactlythesameway.Schemaand instancegraphsare

exchangedaccordingthesameDTDgivenin gure8.

4.3 GXL Metaschema

TheGXLmetaschemadenesthesetofgraphsrepresentingcorrectGXLschema

graphs.Theclassdiagramin gure13showsthegraphpartoftheGXLmeta-

schema.Thisgraphclassprovidesconstructstodeneclassesofgraphelements

i.e.nodes(NodeClass),edges(EdgeClass),andhyperedges(RelClass)includingtheir

interrelationships. Their attributes distinguish abstract classes, classes of di-

rectedorundirectededgesorhyperedgesorcontainmultiplicityconstraintsetc.

To express associated attribute structures GraphElementClasses can be con-

nectedtoattributestructures(AttributedElementClass).Thedenitionofattribute

structuressupportsthestructured attributesusedinGXL includingthedeni-

(12)

andvalueparts,athttp://www.gupro.de/GXL/(metaschema)).Generalization

isprovidedforallGraphElementClassesbyisAedges.GraphElementClassescontaining

lowerlevelgraphsareassociatedto therepresentationof thelowerlevelGraph-

Classrepresentationbycontainsedges.TheGraphClasscontainsthosenode-,edge-,

andhyperedgeclassesrepresentingitsstructure.Aggregation(AggregationClass)

andcomposition(CompositonClass)aremodeledbyspecializationsofEdgeClasses.

5 Using GXL

AttheDagstuhlseminaron"InteroperabilityofReengineeringTools"GXLver-

sion1.0 wasratiedasthestandardexchange format insoftware reengineering

[7].Currently,variousgroupsinsoftware(re)engineeringareimplementingGXL

import and export facilities to their tools (e.g. Bauhaus [2], Columbus [11],

CPPX [6],Fujaba [14],GUPRO[23], PBS[37], RPA (PhilipsResearch),PRO-

GRES[38],Rigi[39],Shrimp[42]).Othersaregoingtoimplementtoolstosup-

portworkingwithGXL.Forinstance,aframeworkforGXLConverters[15]and

aXMI2GXLtranslator[54]arebeingdevelopedatUniv.BWMünchen.Further

activities deal with providing graph query machines (GReQL, Univ. Koblenz)

toGXL graphsorGXL-basedgraphdatabases(Univ.Aachen).

AnimportantfeatureofGXLisitssupportforexchangingschemainforma-

tion.Basedonthiscapability,referenceschemasforcertainstandardapplications

in reengineeringare currentlyunder development. These activitiesaddressref-

(13)

C++[6],[12].

Furthermore,groupsdevelopinggraphtransformationtools(e.g.GenSet[17],

PROGRES[38])orgraphvisualizationtools(e.g.GVF[24],Shrimp[42],yFiles

[55]) already use GXL or pronounced to use GXL. At University of Toronto,

GXL is applied within anundergraduate software engineering courseto create

agrapheditor/layouter[8].

GXL also serves as foundation to dene further graph oriented exchange

formats.Thus,GXLdenesthegraphpartintheexchangeformatGTXL(Graph

TransformationeXchange Language)[21],[45]. Activitiesin thegraphdrawing

community also deal with the development of an exchange format for graphs

includinglayoutinformation[16].Thereis evidenceof combiningthestructure

partofGXLwiththegraphlayoutpartandthemodularizationpartofGraphML

[19]to formageneralandcomprehensivegraphexchangeformat.

6 Conclusion

The previous sections gave ashort introduction in the GXL Graph eXchange

Languageversion1.0and itscurrentapplication.

Summarizing,GXL oersanalready widelyused XML sublanguageforin-

terchangingtyped, attributed, directed,ordered graphsincluding hypergraphs

andhierarchicalgraphstogetherwiththeirappropriateschemas.Byfocusingon

graphstructure,GXLcontributesthecorefordeningafamilyofspecialsuited

graphexchange formats.

Acknowledgment.I would liketo thank theGXL co-authorsRichard C.

Holt,AndySchürr,andSusanElliottSimforvariousfruitfuldiscussionsonthe

development of GXL, Jürgen Ebert, Bernt Kullbach, and Volker Riediger for

manyinterestingdiscussionsonTGraphs andGXL,andKevinHirschmannfor

implementingtheGUPROrelatedGXLtools.ThankstoallusersofGXL,who

currentlyapplying andtestingGXL 1.0in theirtools.Theirexperiencewill be

animportantaidto improveGXL.

References

1. WorkshoponAlgebraicandGraph-TheoreticApproachesinSoftwareReengineer-

ing, Koblenz, February 28, 2000. http://www.uni-koblenz.de/~wi nter/ AlGra /

algra.html(14.9.2001).

2. Bauhaus:SoftwareArchitecture,SoftwareReengineering,ProgramUnderstanding.

http://www.informatik.uni-stutt gart. de/i fi/ps /bau haus/ (1.9.2001).

3. C.Berge. GraphsandHypergraphs. North-Holland,Amsterdam,2edition,1976.

4. G. Busatto. An Abstract Model of Hierarchical Graphs and Hierarchical

GraphTransformation(currentdraft). http://www.informatik.uni-brem en.de /

~giorgio/papers/phd-thesis.ps.g z (16.9.2001).

5. DataExchangeGroup,ConclusionsfromMeetingatCASCON1998,30.Nov1998.

(14)

(1.9.2001).

7. J.Ebert,K.Kontogiannis,J.Mylopoulos:InteroperabilityofReengineeringTools.

http://www.dagstuhl.de/DATA/Repo rts/ 01041 / (18.4.2001), 2001.

8. S.Easterbrook. CSC444F:Software EngineeringI(Fallterm2001),Universityof

Toronto. http://www.cs.toronto.edu/~sme/C SC44 4F/ (15.9.2001),2001.

9. J. Ebert and A. Franzke. A Declarative Approach to Graph Based Modeling.

In E. Mayr,G. Schmidt, and G. Tinhofer, editors. Graphtheoretic Concepts in

Computer Science,LNCS903. Springer,Berlin,pages3850.1995.

10. J.Ebert,B.Kullbach,andA.Winter.GraXAnInterchangeFormatforReengi-

neeringTools. In[50],pages8998.1999.

11. R.Ferenc,F.Magyar,Á.Beszédes,Á.Kiss,andM.Tarkiainen. Columbus-Tool

for Reverse Engineering Large Object Oriented Software Systems. In Proceed-

ings SPLST 2001, Szeged, Hungary (http://www.inf.u-szeged.hu/~ferenc/

research/ferencr_columbus.pdf, (1.9.2001)),pages1627.June2001.

12. R. Ferenc,S.Elliott Sim,R. C.Holt,R. Koschke,and T.Gyimòthy. Towards a

Standard Schemafor C/C++. Toappear in8thWorking Conferenceon Reverse

Engineering. IEEEComputerSoc.,2001.

13. M.FröhlichandM.Werner.daVinciV2.0.xOnlineDocumentation.http://www.

tzi.de/~davinci/docs/ (18.4.2001),June1996.

14. Fujaba:FromUMLtoJavaandbackagain. http://www.uni-paderborn.de/cs /

fujaba/(1.9.2001).

15. GCF-aGXLConverterFramework.

http://www2.informatik.unibw-mu enche n.de /GXL/ trie bsees /(1.9.2001).

16. Workshop on Data Exchange Formats, Graph Drawing 2000. http://www.cs.

virginia.edu/~gd2000/gd-satelli te.ht ml(14.9.2001),2001.

17. GenSet: Design Information Fusion. http://www.cs.uoregon.edu/res earch /

perpetual/dasada/Software/GenSet / (1.9.2001).

18. TheGMLFileFormat.

http://www.infosun.fmi.uni-pass au.de /Gra phlet /GML / (18.4.2001).

19. TheGraphMLFileFormat. http://www.graphdrawing.org/grap hml/

(31.8.2001), 2001.

20. 7-ter Workshop des GI-Arbeitskreises GROOM, UML - Erweiterungen und

Konzepte der Metamodellierung, 4.-5. April 2000, Universität Koblenz-Landau.

http://www2.informatik.unibw-mu enche n.de /GROO M/ME TA/ (14.9.2001).

21. GraphTransformationSystemExchange Language. http://tfs.cs.tu-berlin.

de/projekte/gxl-gtxl.html (18.08.2001).

22. First APPLIGRAPH meeting on GXL (graph exchange language) and GTXL

(graph transformation exchange language) Paderborn (September 5-6, 2000).

http://tfs.cs.tu-berlin.de/proj ekte/ gxl-gtxl /pade rbor n.htm l (11.9.2001).

23. GUPRO:GenericUnderstandingofPrograms.http://www.gupro.de/(1.9.2001).

24. GVF-GraphVisualizationFramework.http://www.cwi.nl/InfoVisu(1.9.2001).

25. I.HermanandM.S.Marshall. GraphXMLAnXMLbasedgraphinterchange

format. ReportINS-0009,CWI,Amsterdam,April2000.

26. R.C.Holt. AnIntroductiontoTA:TheTuple-AttributeLanguage.

http://plg.uwaterloo.ca/~holt/pa pers /ta.h tml (18.4.2001),1997.

27. R.C.Holtand A.Winter. AShortIntroductiontotheGXLSoftwareExchange

Format. In[51], pages299301.2000.

28. R.C.HoltandA.Winter.SoftwareDataInterchangewithGXL:Introductionand

Tutorial,CASCON 2000. http://www.cas.ibm.com/archives/ 2000 /work shops /

(15)

In[51],pages162171.2000.

30. XMIToolkit1.15. http://alphaworks.ibm.com/tec h/xm itool kit (1.9.2001).

31. K.Kontogiannis. ExchangeFormatsWorkshop. In[51],pages277301.2000.

32. T. Lethbridge, E. Plödereder, S.Tichelar,C. Riva,and P.Linos. The Dagstuhl

MiddleLevelModel(DMM). internalnote,2001.

33. F. Newbery Paulish. The Design of an Extendible Graph Editor, LNCS 704.

Springer,Berlin, 1991.

34. Meta Object Facility (MOF) Specication. http://www.omg.org/technology /

documents/formal/mof.htm (2.9.2001), March2000.

35. XML Meta Data Interchange (XMI) Specication. http://www.omg.org/

technology/documents/formal/xmi. htm (1.9.2001),November2000.

36. R. Ommering,L. vanFeijs, and R. Krikhaar. A relational approachto support

softwarearchitectureanalysis.SoftwarePracticeandExperience,28(4),pages371

400, April1998.

37. PBS:ThePortableBookshelf. http://swag.uwaterloo.ca/pbs/ (1.9.2001).

38. A Graph Grammar Programming Environment - PROGRES. http://www-i3.

informatik.rwth-aachen.de/resea rch/p roje cts/p rogr es/ (1.9.2001).

39. RIGI:avisualtoolforunderstandinglegacysystems.http://www.rigi.csc.uvic.

ca/(1.9.2001).

40. J.Rumbaugh,I.Jacobson, andG.Booch. TheUniedModeling LanguageRefer-

enceManual. AddisonWesley,Reading,1999.

41. A.Schürr,A.J.Winter,andA.Zündorf.PROGRES:LanguageandEnvironment.

InH.Ehrig,G.Engels,H.-J.Kreowski, andG.Rozenberg,editors. Handbook on

GraphGrammars,volume2. WorldScientic,Singapore,pages487550.1999.

42. ShriMPViews: simpleHierarchicalMulti-Perspective. http://www.shrimpviews.

com/(1.9.2001).

43. S.ElliotSim,R.C.Holt,and R.Koschke. ProceedingsICSE2000 Workshopon

StandardExchangeFormat(WoSEF). Technicalreport,Limerick,2000.

44. S.ElliottSim.SoftwareDataInterchangewithGXL:ImplementationIssues,CAS-

CON2000.http://www.cas.ibm.com/archives /2000 /wor kshop s/de scrip tions .

shtml\#17(14.9.2001), November13-16,2000.

45. G.Taenzer.TowardsCommonExchangeFormatsforGraphsandGraphTransfor-

mationSystems. InProceedingsUNIGRAsatelliteworkshopof ETAPS'01.2001.

46. M.vandenBrand,H.A.deJong,P.Klint,andP.A.Olivier. Ecientannotated

Terms. Software:Practice andExperience,30(3),pages259291,March2000.

47. ExtensibleMarkupLanguage(XML)1.0.W3crecommendation,W3CXMLWork-

ingGroup,http://www.w3.org/XML/ (17.4.2001),February1998.

48. J.B.WarmerandA.G.Kleppe. The ObjectConstraintLanguage:PreciseMod-

elingWithUML. Addison-Wesley,1998.

49. 5thWorkingConference onReverseEngineering. IEEEComputerSoc.,1998.

50. 6thWorkingConference onReverseEngineering. IEEEComputerSoc.,1999.

51. 7thWorkingConference onReverseEngineering. IEEEComputerSoc.,2000.

52. K. Wong. RIGI User'sManual, Version 5.4.4. http://www.rigi.csc.uvic.ca/

rigi/rigiframe1.shtml?Download (18.4.2001),30.June1998.

53. Extensible Graph Markup and Modeling Language). http://www.cs.rpi.edu/

~puninj/XGMML/ (19.8.2001),2001.

54. XIG -AnXSLT-basedXMI2GXL-Translator. http://ist.unibw-muenchen.de /

GXL/volk/(1.9.2001).

55. yFiles - Interactive Visualization of Graph Strucutres. http://www-pr.

informatik.uni-tuebingen.de/yfi les/ (1.9.2001).

Abbildung

Fig. 2. typed, attributed, directed, ordered graph
Fig. 3. GXL representation of graph from gure 2
Figure 4 shows a hypergraph in UML notation, modeling the function call
Fig. 6. Hierarchical Graph
+5

Referenzen

ÄHNLICHE DOKUMENTE

A 2D layout is obtained by first choosing a spectral layout to display the core with maximum value and then adding the lower cores iteratively by force-based methods.. Using 2.5D

Given is a graph G = (V, E, ω) with nonnegative weights, without self-loops and the Laplace matrix L(G). The assertion is the upper gershgorin bound of N.. GRAPH RELATED MATRICES

The shift method is a linear-time algorithm to pro- duce a straight-line drawing of maximally triconnected, that is, triangulated graphs on a grid with an area bound quadratic in

A conclusion from a more recent experimental study on distance-based graph drawing from Brandes and Pich (2008) is that, given a goal to represent distances well in a graph,

Motifs are distinguished subgraphs which should be used in a graph drawing algorithm to clarify the structure of the network.. The second network is a social network that

[r]

In case of λ ≥ 5, the tree T bas of all basic minimum and minimum+1 cuts extended by the auxiliary edges is planar, by Lemma 2.5.8. However, when λ = 5, implanting the local model

Keywords and phrases graph drawing, experimental design, algorithm engineering, user studies, empirical evaluation, information visualization.. Digital Object