XML FORMAT

GraphML 1.0

GraphML

GraphML 1.0 is the first specified release of the Graph Markup Language, an XML-based file format for exchanging graph structure data. It grew out of the graph drawing community: a file-format workshop held on the eve of the Graph Drawing 2000 symposium in Williamsburg formed the task force, and a proposal for the structural layer was presented at GD 2001 in Vienna. The 1.0 schema was published under the namespace http://graphml.graphdrawing.org/xmlns/1.0/graphml-structure.xsd and carries a 2001/2002 GraphML Team copyright. It was conceived as a successor to the older ASCII-based format:gml (itself a Graph Drawing product from Passau) and as a general interchange target alongside peers such as format:gxl-1.0, format:xgmml-1.0, format:gexf-1.3, and the DOT language of format:dot.

The data model is deliberately minimal at its structural core. A root <graphml> element contains one or more <graph> elements, each holding <node> and <edge> children. Every node carries a unique id; each edge references endpoints via source and target. Directedness is controlled per graph through the edgedefault attribute (directed or undirected), and edges may override it individually, so directed, undirected, and mixed graphs are all expressible. Beyond simple graphs, GraphML supports nested (hierarchical/compound) graphs, in which a node may itself contain a <graph>; <hyperedge> elements with multiple <endpoint> children for edges spanning more than two nodes; and <port> elements on nodes, which may be nested, to give edges fine-grained attachment points.

Application data is carried through a separate attribute mechanism rather than baked into the topology. <key> elements, declared as children of <graphml>, define named data functions with a for scope (node, edge, graph, port, and so on), an attr.name, and an attr.type drawn from string, boolean, int, long, float, and double; a <default> supplies fallback values. <data> elements then attach concrete values to the corresponding structural elements. This clean separation of structure from semantics, plus permissive extension points, lets vendors layer their own namespaces (yFiles for tool:yed, for example) without breaking generic parsers.

GraphML 1.0 is widely readable: tool:networkx, tool:igraph, tool:gephi, tool:graphml2gv, and the Boost Graph Library import or export it, and the tool:graphinout converter treats it as a hub format. Its main limitations are practical: XML verbosity makes large graphs bulky, and full support for hyperedges, ports, and deep nested graphs is uneven across tools, so those features are often lost on round-trips. The later 1.1 revision refined the schema without changing the core model.

Alternative Names: Graph Markup Language

File Extensions: .graphml v1.0
FeatureGraphML
Multiple Graphs per Document supported
Nodes supported
Undirected Edges supported
Directed Edges supported
Hyperedges supported
Mixed-directionality Edges supported
Parallel Edges supported
Self-loops supported
Edges on Edges not supported
Nested Graphs in Nodes supported
Nested Graphs in Edges supported
Nested Graphs in Graphs supported
Node Labels partial
Edge Labels partial
Attributes on Nodes supported
Attributes on Edges supported
Attributes on Graphs supported
Typed Edges partial

See also

Frequently Asked Questions

What is a GraphML file?

A GraphML file stores a graph — its nodes, edges and attributes — in the GraphML format (also: Graph Markup Language). See the feature table above for what it supports.

How do I open a GraphML file?

Open it in a graph tool that supports GraphML, or convert it to a format your tool reads. With GraphInOut you can convert GraphML to GraphML, DOT, Connected JSON and more, right in your browser.

How do I convert a GraphML file to another format?

Use the Convert from GraphML link above: upload or paste your GraphML file (input preset to GraphML), choose a target format and download the result — free, no install.