TOOL

GML-to-DOT

GML-to-DOT-converter

GML-to-DOT-converter is a small academic tool by Phil Gabardo (GitHub: PhilGabardo) that translates graphs written in Graph Modeling Language (GML) into the Graphviz DOT language (DOT). GML is a plain-text, attributed node-and-edge format common in network-analysis datasets, while DOT is the description language consumed by Graphviz for layout and rendering; the converter therefore bridges a data-exchange format and a visualization format, letting GML datasets be laid out and drawn as images.

The project is notable more for how it is built than for its feature scope. The parser is defined by an ANTLR4 grammar (GMLDot.g4), and the entire source, LaTeX documentation, and test cases are woven together with nuweb literate programming from a single GMLDot.w file (see the bundled GMLDot.pdf). Building it is a multi-step chore: run nuweb to emit the grammar and docs, run antlr4 to generate the Java lexer/parser/listeners, then compile with javac. It is invoked through ANTLR's grun test rig rather than as a packaged CLI, piping GML on stdin to a .dot file, which can then be rendered with dot -Tpng. The repository is largely TeX and Java with a small C component, and ships seven example GML inputs with expected DOT outputs plus rendered images of the classic karate-club, dolphins, and football network graphs.

Because it is grammar-driven, the tool cleanly parses GML structure, but its listener code explicitly carries NonTranslatableAttribute and UnsupportedAttribute cases, meaning some GML attributes have no DOT equivalent and are dropped or flagged rather than mapped. This reflects a genuine impedance mismatch between the two models: GML's arbitrary nested key-value attributes do not correspond one-to-one with DOT's flat attribute lists and layout-oriented properties.

In practice this is a teaching or reference implementation rather than a production utility. Anyone needing routine GML-to-DOT conversion is better served by Graphviz's own bundled gml2gv (and the reverse gv2gml), and general-purpose converters such as Graph::Easy or the multi-format graph-format-conv. cover broader format matrices; libraries like NetworkX and igraph can likewise read GML and emit DOT. GML-to-DOT-converter's value is as a compact, well-documented worked example of using ANTLR4 and literate programming to build a format translator between GML and DOT.

Input Formats

Output Formats

Frequently Asked Questions

What graph file formats does GML-to-DOT support?

See the list on this page — it shows every format GML-to-DOT can read, write and display.

How do I import a graph into GML-to-DOT?

Convert your file to a format GML-to-DOT can read, then open it in GML-to-DOT. Use GraphInOut to get a GML-to-DOT-compatible file in seconds.

How do I convert a file so GML-to-DOT can open it?

Use the convert links above — upload or paste your graph, pick a format GML-to-DOT accepts and download the result, right in your browser.