DataFormats.GraphML History

Hide minor edits - Show changes to markup

Added lines 23-24:
  • GrapmML does not have the ability to express "this graph will have only [un]directed edges in it"; there's basically no good way (aside from reading through the entire file twice) to make sure taht a given graph is stricty directed or undirected. (You can specify a _default_ edge type, but that's not a constraint.)
Added lines 23-59:

Short Example:

<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns=""
 <graph id="G" edgedefault="undirected">
   <node id="n0"/>
   <node id="n1"/>
   <node id="n2"/>
   <node id="n3"/>
   <node id="n4"/>
   <node id="n5"/>
   <node id="n6"/>
   <node id="n7"/>
   <node id="n8"/>
   <node id="n9"/>
   <node id="n10"/>
   <edge source="n0" target="n2"/>
   <edge source="n1" target="n2"/>
   <edge source="n2" target="n3"/>
   <edge source="n3" target="n5"/>
   <edge source="n3" target="n4"/>
   <edge source="n4" target="n6"/>
   <edge source="n6" target="n5"/>
   <edge source="n5" target="n7"/>
   <edge source="n6" target="n8"/>
   <edge source="n8" target="n7"/>
   <edge source="n8" target="n9"/>
   <edge source="n8" target="n10"/>

Added lines 5-7:


Added lines 5-14:

Example Parsers


from JUNG


from Pigale

Links / info

GraphML Extension Package (yWorks)

Changed lines 2-3 from:


Main site:


  • I would use two tags edge and arc instead of edge+directed/undirected. This is not serious comment because the description is intended to be used mainly by programs. But in general I find GraphML powerful enough to express all the data that I can express in Pajek's format.
  • XML allows (user's) format extensions.
Added lines 1-3:

Seems like a bunch of projects use it, including JUNG