JSON FORMAT

PG-JSON

PG-JSON (Property Graph Format)

PG-JSON (also written JSON-PG) is the JSON serialization of the PG property graph format. The PG model and its two serializations, the compact text form (PG format) and this JSON form, were proposed in 2019 by Hirokazu Chiba, Ryota Yamanaka and Shota Matsumoto, who noted that unlike RDF, the property graphs used by engines such as Neo4j, Oracle Labs PGX and Amazon Neptune lacked a standardized data model. Version 1.0.0 of the specification, by Hirokazu Chiba and Jakob Voß, was published in 2024 by the pg-format project.

A PG-JSON document is a JSON object with exactly two fields, "nodes" and "edges", each an array. A node has an "id", a "labels" array (each label a non-empty string, unique per node) and "properties". An edge has "from" and "to", which name nodes, plus "labels" and "properties", and optionally an "id" and an "undirected" flag, so each edge is either directed or undirected. Properties map each key to a non-empty list of strings, numbers or booleans, so multi-valued properties are built in. Several edges may connect the same nodes, and an edge may connect a node to itself.

The specification also defines PG-JSONL, with one JSON object per line and a "type" field telling nodes from edges. Applications may repair documents that do not fully conform, for example by creating nodes that edges refer to but that are not listed.

The pgraphs converter (pgraphs tools) reads and writes PG, PG-JSON and PG-JSONL as well as DOT, TGF, NCOL, Cypher and a live Neo4j database (Neo4j), and it writes GraphML, GEXF, Mermaid and Neo4j CSV.

The model has no hyperedges, no graph-level attributes and no hierarchies, and property values cannot be nested objects or null.

Alternative Names: JSON-PG, Property Graph Exchange Format (JSON)

File Extensions: .pg.json.pgjson v1.0.0
FeaturePG-JSON (Property Graph Format)
Nodes supported
Undirected Edges supported
Directed Edges supported
Hyperedges not supported
Mixed-directionality Edges supported
Parallel Edges supported
Self-loops supported
Edges on Edges not supported
Nested Graphs in Nodes not supported
Nested Graphs in Edges not supported
Nested Graphs in Graphs not supported
Node Labels supported
Edge Labels supported
Attributes on Nodes supported
Attributes on Edges supported
Attributes on Graphs not supported
Typed Edges supported

Tools(Read & Write)

Frequently Asked Questions

What is a PG-JSON (Property Graph Format) file?

A PG-JSON (Property Graph Format) file stores a graph — its nodes, edges and attributes — in the PG-JSON (Property Graph Format) format (also: JSON-PG, Property Graph Exchange Format (JSON)). See the feature table above for what it supports.

How do I open a PG-JSON (Property Graph Format) file?

Open it in a graph tool that supports PG-JSON (Property Graph Format), or convert it to a format your tool reads. With GraphInOut you can convert PG-JSON (Property Graph Format) to GraphML, DOT, Connected JSON and more, right in your browser.

How do I convert a PG-JSON (Property Graph Format) file to another format?

Use the Convert from PG-JSON (Property Graph Format) link above: upload or paste your PG-JSON (Property Graph Format) file (input preset to PG-JSON (Property Graph Format)), choose a target format and download the result — free, no install.