GraphML Transformation
Page 1
GraphML Transformation
GraphML Transformation
Ulrik Brandes and Christian Pich
Department of Computer & Information Science, University of Konstanz, Germany
{Ulrik.Brandes,Christian.Pich}@uni-konstanz.de
Abstract. The efforts put into XML-related technologies have exciting
consequences for XML-based graph data formats such as GraphML. We
here give a systematic overview of the possibilities offered by XSLT style
sheets for processing graph data, and illustrate that many basic tasks
required for tools used in graph drawing can be implemented by means of
style sheets, which are convenient to use, portable, and easy to customize.
1 Introduction
Among the multitude of software packages that process graphs, some are ded-
icated graph packages while others operate on graph structures implicitly. All
of them have in common the need to input existing data and to output their
computation results in files or streams. GraphML (Graph Markup Language) is
an XML-based format for the description of graph structures, designed to im-
prove tool interoperability and reduce communication overhead [1]. It is open
to user-defined extensions for application-specific data. Thanks to its XML syn-
tax, GraphML-aware applications can take advantage of a growing number of
XML-related technologies and tools, such as parsers and validators.
It is straightforward to provide access to graphs represented in GraphML
by adding input and output filters to an existing software application. However,
we find that Extensible Stylesheet Language Transformations (XSLT) [7] offer
a more natural way of utilizing XML formatted data, in particular when the
resulting format of a computation is again based on XML. The mappings that
transform input GraphML documents to output documents are defined in XSLT
style sheets and can be used stand-alone, as components of larger systems, or
in, say, web services.
This article is organized as follows. Section 2 provides some background on
GraphML, XSLT and their combination. Basic means and concepts of trans-
formations are outlined in Sect. 3, while different types of transformations are
discussed in Sect. 4. The integration of XSLT extension mechanisms is described
in Sect. 5, and results are discussed and summarized in Section 6.
Research partially supported by DFG under grant Br 2158/1-2 and EU under grant
IST-2001-33555 COSIN.
Corresponding author.
J. Pach (Ed.): GD 2004, LNCS 3383, pp. 89–99, 2004.
c© Springer-Verlag Berlin Heidelberg 2004
Ulrik Brandes and Christian Pich
Department of Computer & Information Science, University of Konstanz, Germany
{Ulrik.Brandes,Christian.Pich}@uni-konstanz.de
Abstract. The efforts put into XML-related technologies have exciting
consequences for XML-based graph data formats such as GraphML. We
here give a systematic overview of the possibilities offered by XSLT style
sheets for processing graph data, and illustrate that many basic tasks
required for tools used in graph drawing can be implemented by means of
style sheets, which are convenient to use, portable, and easy to customize.
1 Introduction
Among the multitude of software packages that process graphs, some are ded-
icated graph packages while others operate on graph structures implicitly. All
of them have in common the need to input existing data and to output their
computation results in files or streams. GraphML (Graph Markup Language) is
an XML-based format for the description of graph structures, designed to im-
prove tool interoperability and reduce communication overhead [1]. It is open
to user-defined extensions for application-specific data. Thanks to its XML syn-
tax, GraphML-aware applications can take advantage of a growing number of
XML-related technologies and tools, such as parsers and validators.
It is straightforward to provide access to graphs represented in GraphML
by adding input and output filters to an existing software application. However,
we find that Extensible Stylesheet Language Transformations (XSLT) [7] offer
a more natural way of utilizing XML formatted data, in particular when the
resulting format of a computation is again based on XML. The mappings that
transform input GraphML documents to output documents are defined in XSLT
style sheets and can be used stand-alone, as components of larger systems, or
in, say, web services.
This article is organized as follows. Section 2 provides some background on
GraphML, XSLT and their combination. Basic means and concepts of trans-
formations are outlined in Sect. 3, while different types of transformations are
discussed in Sect. 4. The integration of XSLT extension mechanisms is described
in Sect. 5, and results are discussed and summarized in Section 6.
Research partially supported by DFG under grant Br 2158/1-2 and EU under grant
IST-2001-33555 COSIN.
Corresponding author.
J. Pach (Ed.): GD 2004, LNCS 3383, pp. 89–99, 2004.
c© Springer-Verlag Berlin Heidelberg 2004
Page 2
90 Ulrik Brandes and Christian Pich
2 Background
A key feature of GraphML is the separation into structural and data layer, both
conceptually and syntactically; this enables applications to extend the stan-
dard GraphML vocabulary by custom data labels that are transparent to other
applications not aware of the extension. Furthermore, applications are free to
ignore unknown concepts appearing in the structural layer, such as <port>s,
<hyperedge>sornested<graph>s.
Thanks to its XML syntax, GraphML can be used in combination with other
XML based formats: On the one hand, its own extension mechanism allows to at-
tach <data> labels with complex content (possibly required to comply with other
XML content models) to GraphML elements, such as Scalable Vector Graph-
ics [5] describing the appearance of the nodes and edges in a drawing; on the
other hand, GraphML can be integrated into other applications, e.g. in SOAP
messages [6].
Since GraphML representations of graphs often need to be preprocessed or
converted to other XML formats, it is convenient to transform them using XSLT,
a language specifically designed for transforming XML documents; while origi-
nally created for formatting and presenting XML data, usually with HTML, it
also allows general restructuring, analysis, and evaluation of XML documents.
To reduce parsing overhead and to allow for XML output generation in a natural
andembeddedway,XSLTitselfisinXMLsyntax.
Basically, the transformations are defined in style sheets (sometimes also
called transformation sheets), which specify how an input XML document gets
transformed into an output XML document in a recursive pattern matching
process. The underlying data model for XML documents is the Document Object
Model (DOM), a tree of DOM nodes representing the elements, attributes, text
etc., which is held completely in memory. Fig. 1 shows the basic workflow of a
transformation.
Fig. 1. Workflow of an XSLT transformation. First, XML data is converted to a tree
representation, which is then used to build the result tree as specified in the style sheet.
Eventually, the result tree is serialized as XML.
2 Background
A key feature of GraphML is the separation into structural and data layer, both
conceptually and syntactically; this enables applications to extend the stan-
dard GraphML vocabulary by custom data labels that are transparent to other
applications not aware of the extension. Furthermore, applications are free to
ignore unknown concepts appearing in the structural layer, such as <port>s,
<hyperedge>sornested<graph>s.
Thanks to its XML syntax, GraphML can be used in combination with other
XML based formats: On the one hand, its own extension mechanism allows to at-
tach <data> labels with complex content (possibly required to comply with other
XML content models) to GraphML elements, such as Scalable Vector Graph-
ics [5] describing the appearance of the nodes and edges in a drawing; on the
other hand, GraphML can be integrated into other applications, e.g. in SOAP
messages [6].
Since GraphML representations of graphs often need to be preprocessed or
converted to other XML formats, it is convenient to transform them using XSLT,
a language specifically designed for transforming XML documents; while origi-
nally created for formatting and presenting XML data, usually with HTML, it
also allows general restructuring, analysis, and evaluation of XML documents.
To reduce parsing overhead and to allow for XML output generation in a natural
andembeddedway,XSLTitselfisinXMLsyntax.
Basically, the transformations are defined in style sheets (sometimes also
called transformation sheets), which specify how an input XML document gets
transformed into an output XML document in a recursive pattern matching
process. The underlying data model for XML documents is the Document Object
Model (DOM), a tree of DOM nodes representing the elements, attributes, text
etc., which is held completely in memory. Fig. 1 shows the basic workflow of a
transformation.
Fig. 1. Workflow of an XSLT transformation. First, XML data is converted to a tree
representation, which is then used to build the result tree as specified in the style sheet.
Eventually, the result tree is serialized as XML.
Sign up today - FREE
Mendeley saves you time finding and organizing research. Learn more
- All your research in one place
- Add and import papers easily
- Access it anywhere, anytime
Start using Mendeley in seconds!
Readership Statistics
6 Readers on Mendeley
by Discipline
33% Design
17% Earth Sciences
by Academic Status
33% Student (Master)
33% Ph.D. Student
17% Researcher (at a non-Academic Institution)
by Country
33% United States
17% Switzerland
17% Germany


