PG-JSON
PG-JSON (also written JSON-PG) is the JSON serialization of the Property Graph Exchange Format (PG), a specification for representing labeled property graphs. The underlying model and its two original serializations — a compact flat-text form (the PG format) and this JSON form — were first proposed by Hirokazu Chiba, Ryota Yamanaka, and Shota Matsumoto in 2019, and later revised into a formal specification together with Jakob Voß under the pg-format project. Its stated motivation is that, unlike RDF, the property-graph model used by engines such as Neo4j, Oracle Labs PGX, and Amazon Neptune has no standardized, engine-neutral interchange format; PG-JSON aims to fill that gap as a portable exchange representation.
The data model is a labeled property graph: nodes and edges each carry a unique identifier, an optional list of labels (non-empty Unicode strings, unique per element), and properties. Properties are mappings from a key to a non-empty list of values, where values may be strings, numbers, or booleans — so multi-valued properties are first-class rather than encoded by convention. Edges are directed by default, with an "undirected" boolean flag for undirected edges, and may themselves be labeled and carry properties, matching Neo4j-style relationship semantics.
A PG-JSON document is a single JSON object (RFC 8259) with exactly two fields, "nodes" and "edges", each an array. Each node and edge object exposes "id", "labels", and "properties". A line-oriented sibling, PG-JSONL, emits one JSON object per line with a "type" field distinguishing nodes from edges, which suits streaming and large graphs. The specification is deliberately forgiving: conforming readers may repair non-conforming input through implicit node creation and field normalization.
Within the format-conversion world, PG-JSON is closely tied to the pgraphs converter (pgraphs tools), a JavaScript tool that parses and serializes PG, PG-JSON, and PG-JSONL and bridges them to formats such as DOT, GraphML, GEXF, TGF, NCOL, Mermaid, and Neo4j Cypher/CSV, as well as live Neo4j (Neo4j) via Bolt. It thus overlaps the niche served by richer property-graph JSON formats like GraphSON and Cytoscape JSON.
Its main strengths are simplicity, an explicit multi-valued property model, and neutrality across graph engines; its limitations are modest adoption outside the pg-format toolchain, no schema or typing system beyond string/number/boolean scalars, and no provision for nested objects or graph-level metadata.
Alternative Names: JSON-PG, Property Graph Exchange Format (JSON)
| Feature | PG-JSON (Property Graph Format) |
|---|---|
| Nodes | |
| Undirected Edges | |
| Directed Edges | |
| Hyperedges | |
| Mixed-directionality Edges | |
| Parallel Edges | |
| Self-loops | |
| Edges on Edges | |
| Nested Graphs in Nodes | |
| Nested Graphs in Edges | |
| Nested Graphs in Graphs | |
| Node Labels | |
| Edge Labels | |
| Attributes on Nodes | |
| Attributes on Edges | |
| Attributes on Graphs | |
| Typed Edges | |
Tools(Read & Write)
Read-only Tools
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.