gvpr
graph stream editor, similar to awk for graphs
TLDR
SYNOPSIS
gvpr [-icnqV?] [-o outfile] [-a args] 'prog' | -f progfile [files]
DESCRIPTION
gvpr (formerly gpr) is a graph pattern scanning and processing language, similar to awk but for graphs instead of text. Programs consist of pattern-action clauses (BEGIN, BEG_G, N for nodes, E for edges, END_G, END) that are matched against each input graph in turn.For each node or edge visited, gvpr evaluates the predicates in order and runs the associated action for the first (or every) match. The language provides C-like types, associative arrays, and built-in graph functions, letting programs filter, transform, restructure, or compute statistics over DOT graphs.
PARAMETERS
'prog'
Inline gvpr program text (a series of predicate-action clauses). Required unless -f is given.FILES
Input graph files in DOT format. Reads stdin if none given.-f progfile
Read the gvpr program from progfile instead of the command line.-o outfile
Write output to outfile instead of stdout.-a args
Pass a whitespace-separated argument string to the program, available as ARGV/ARGC.-c
Use the source graph as the output graph, so in-place edits are emitted.-i
Derive the output as the node-induced subgraph extension in the context of its root graph.-n
Disable graph read-ahead (affects the $NG variable).-q
Suppress warning messages.-V
Print version information and exit.-?
Display usage information and exit.
INSTALL
CAVEATS
Part of the Graphviz package. The pattern-action language has a learning curve, and complex programs over large graphs can be slow.
HISTORY
gvpr was developed as part of Graphviz at AT&T Labs to provide AWK-like processing for graph structures, replacing the earlier gpr tool.