JGF 1.0
JSON Graph Format (JGF) version 1.0 is a lightweight, schema-defined JSON convention for representing graph structure. It is published by the "jsongraph" open-source community project, with the specification hosted at jsongraphformat.info and a JSON Schema plus examples maintained on GitHub. The stated goal is to capture basic graph structure (nodes and edges) in a form that is convenient to read, write, and validate, while leaving room for arbitrary application data through metadata objects. Version 1.0 is the original release; a backward-incompatible version 2.0 (JGF 2.0) was published in January 2020, and the generic entry JGF refers to the family as a whole.
A v1.0 document takes one of two top-level shapes. The single-graph form wraps one graph object under a "graph" key; the multi-graph form uses a "graphs" array alongside optional top-level "label", "type", and "metadata". A graph object has optional "label", "type", "directed", "metadata", "nodes", and "edges" members (there is no graph-level id in v1.0). Nodes and edges are both JSON arrays. Each node object requires an "id" and may carry "label" and "metadata"; each edge object requires "source" and "target" (referencing node ids) and may add "relation", "directed", "label", and "metadata". The "directed" flag defaults to true at both graph and edge level, and per-edge "directed" can override the graph default, allowing mixed directed/undirected graphs. The open "metadata" object is the extension point for layout, styling, weights, algorithm results, or domain attributes.
The most significant change in v2.0 is that nodes became a map keyed by id rather than an array, enabling direct key lookup; v2.0 also reintroduced a top-level id, updated the JSON Schema draft reference, later added hyperedge support, and dropped some fields, making the two versions non-interoperable.
Within the graph-interchange landscape JGF occupies the same niche as other JSON encodings such as GraphJSON, NetworkX node-link, Cytoscape JSON, and GraphSON, trading the verbosity of GraphML or GEXF for JSON's ubiquity in web tooling. Its plainness is both a strength and a limitation: it is trivial to parse and generate, but it prescribes no typing, indexing, or property-graph semantics, so richer needs are pushed into free-form metadata. Tooling is modest, centered on the JavaScript "jay-gee-eff" libraries (jay-gee-eff) and a Cytoscape import app; general converters like NetworkX and GraphInOut can bridge it to other formats.
Alternative Names: JSON Graph Format
| Feature | JSON Graph Format 1.0 |
|---|---|
| Multiple Graphs per Document | |
| 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 | |
See also
Frequently Asked Questions
What is a JSON Graph Format 1.0 file?
A JSON Graph Format 1.0 file stores a graph — its nodes, edges and attributes — in the JSON Graph Format 1.0 format (also: JSON Graph Format). See the feature table above for what it supports.
How do I open a JSON Graph Format 1.0 file?
Open it in a graph tool that supports JSON Graph Format 1.0, or convert it to a format your tool reads. With GraphInOut you can convert JSON Graph Format 1.0 to GraphML, DOT, Connected JSON and more, right in your browser.
How do I convert a JSON Graph Format 1.0 file to another format?
Use the Convert from JSON Graph Format 1.0 link above: upload or paste your JSON Graph Format 1.0 file (input preset to JSON Graph Format 1.0), choose a target format and download the result — free, no install.