graphml2gv
Convert from any graph formatto graphml2gv Convert from graphml2gvto any other format
graphml2gv is a small command-line converter, part of the Graphviz distribution, that reads graphs written in the XML-based GraphML format and emits them in Graphviz's native DOT (formerly called the GV format). It is one of a family of import filters bundled with the Graphviz suite alongside gxl2gv and gv2gxl (for GXL) and gml2gv (for GML), giving Graphviz a set of front ends that normalize several graph-interchange formats into DOT for layout and rendering by dot, neato and the other engines.
The program was written by Emden R. Gansner, a longtime Graphviz author, and the source (cmd/tools/graphml2gv.c) carries an AT&T Intellectual Property copyright, reflecting Graphviz's origins at AT&T Bell Laboratories. Invocation is straightforward: graphml2gv [-?v] [-g gname] [-o outfile] [files]. It accepts one or more GraphML files as operands, or reads from standard input when none are given, and writes DOT to standard output unless -o redirects it to a file. The -g flag sets the name of the generated graph (appending integers when a file contains several graphs), and -v enables verbose mode. It returns 0 on success and non-zero on error.
The tool's most important characteristic is that the translation is deliberately approximate. GraphML and DOT rest on different graph and graphics models, so graphml2gv preserves only the basic graph topology: nodes, directed or undirected edges, and nesting into subgraphs. It has no representation for GraphML constructs such as hyperedges or edges that themselves contain graphs, and in practice it does not fully interpret the <key>/<data> attribute machinery that GraphML uses to attach typed properties, ports and visual styling. Rich attribute payloads and layout hints therefore tend to be dropped rather than carried across.
Within the format-conversion landscape this makes graphml2gv useful chiefly as a quick bridge for getting the structure of a GraphML graph into a Graphviz pipeline for automatic layout, rather than as a fidelity-preserving round-trip converter. Users who need attribute-complete GraphML/DOT interchange usually reach for library-based routes such as NetworkX or igraph, or dedicated converters like dot2graphml, GXL XSLT and GraphInOut, while graphml2gv remains valuable precisely because it is tiny, dependency-free and always present wherever Graphviz is installed.
Input Formats
Output Formats
Frequently Asked Questions
What graph file formats does graphml2gv support?
See the list on this page — it shows every format graphml2gv can read, write and display.
How do I import a graph into graphml2gv?
Convert your file to a format graphml2gv can read, then open it in graphml2gv. Use GraphInOut to get a graphml2gv-compatible file in seconds.
How do I convert a file so graphml2gv can open it?
Use the convert links above — upload or paste your graph, pick a format graphml2gv accepts and download the result, right in your browser.
