gv2gml
Convert Graphviz graphs to GML format
TLDR
Convert a graph from gv to gml format
Convert a graph using stdin and stdout
Display help
SYNOPSIS
gv2gml [ -h ] [ -v ] [ -? ] [ files ]
PARAMETERS
-h
Print command synopsis and list of options.
-v
Enable verbose output; shows filenames as processed.
-?
Print command synopsis and list of options (same as -h).
DESCRIPTION
The gv2gml command is a utility from the Graphviz suite designed to convert graphs represented in Graphviz's DOT language into the Graph Modeling Language (GML) format. Graphviz is a powerful open-source toolset for graph visualization and layout, where DOT files describe directed or undirected graphs using a simple textual syntax.
Usage is straightforward: provide one or more DOT files as arguments, or pipe input via stdin. The tool reads the input graph structure—including nodes, edges, attributes—and emits equivalent GML to stdout, preserving essential properties like labels, colors, and shapes where possible. GML is a plain text format for storing and exchanging graph data, widely used in graph analysis tools.
This converter is ideal for interoperability, allowing Graphviz users to export graphs for use in software supporting GML, such as network analysis platforms like yEd or Pajek. It handles multiple input files in sequence, outputting concatenated GML. Verbose mode aids in processing logs for batch operations.
CAVEATS
Outputs to stdout; redirect to file for saving (e.g., > output.gml). Supports standard Graphviz DOT graphs; complex attributes may lose fidelity in GML.
EXAMPLE USAGE
Single file: gv2gml graph.dot > graph.gml
Stdin: cat graph.dot | gv2gml > graph.gml
Multiple files: gv2gml *.dot > combined.gml
INPUT/OUTPUT
Expects valid Graphviz DOT format on stdin or files. Writes plain text GML to stdout; no direct file output option.
HISTORY
Developed as part of Graphviz by AT&T Labs Research (now AT&T Research). First appeared in Graphviz releases around 2004; maintained in modern versions for DOT-GML conversion.


