TOOL

pgraphs tools

pgraphs (Property Graph Exchange Format) tools

pgraphs is a property graph converter from the pg-format project, available as a command-line application (pgraph) and a JavaScript library. It parses and serializes labeled property graphs and converts between graph exchange formats and graph databases. It implements the Property Graph Exchange Format (PG), first proposed by Hirokazu Chiba, Ryota Yamanaka and Shota Matsumoto in 2019 and later revised into a specification together with Jakob Voß. pgraphs is distributed as an npm package and a Docker image under the MIT license and requires Node.js 18 or newer. The pg-format project also offers the Python package pgformat and pg-formatter, a web application to try out, validate and visualize graphs in PG format.

The data model is the labeled property graph: nodes and edges carry labels and properties, and each property maps a key to a non-empty list of values (strings, numbers or booleans). The PG text format has one statement per line, and a statement may continue on the next line. A node statement is an identifier followed by optional :Label labels and key: value properties; an edge statement is a source identifier, -> for a directed or -- for an undirected edge, a target identifier, then optional labels and properties. Identifiers may be quoted or unquoted, and # starts a comment. The specification also defines two JSON serializations, PG-JSON and the line-based PG-JSONL, which is the default output of pgraphs.

Besides the PG family, pgraphs reads and writes DOT, TGF, NCOL, JSON Canvas (experimental), Graphology JSON and Cypher CREATE statements, and it can read from and write to a Neo4j database over the Bolt protocol; other databases that support Cypher and Bolt, such as Memgraph or Kuzu, may work but are untested. It also writes GraphML, GEXF, Mermaid, OpenCypher/Neo4j CSV, Amazon Neptune CSV, CYPHERL and YARS-PG.

Conversions are not always lossless: by the project's own account, converting between PG and Neo4j or Neptune round-trips apart from identifiers, undirected edges and some data types, and Cypher has no null property values or mixed types in repeated values. The tool targets labeled property graphs, not RDF; for broader conversions see NetworkX and GraphInOut.

Graph Formats(Input & Output)

Output Formats

Frequently Asked Questions

What graph file formats does pgraphs tools support?

See the list on this page — it shows every format pgraphs tools can read, write and display.

How do I import a graph into pgraphs tools?

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

How do I convert a file so pgraphs tools can open it?

Use the convert links above — upload or paste your graph, pick a format pgraphs tools accepts and download the result, right in your browser.