JSON FORMAT

GraphJSON

GraphJSON is a JSON-based interchange format for graphs, created by the startup GraphAlchemist and published around 2013-2014 under the tagline "a standard format for Graph data." Its explicit ambition, stated in the project's documentation, was to be for graph visualization what GeoJSON is for geographic maps: a single web-native standard that lets browser applications render a graph without first parsing one of the many older, XML- or text-based exchange formats. It positions itself as a lighter, more visualization-oriented alternative to formats such as GEXF, GML, GraphML and Pajek, and to graph-database serializations like GraphSON.

A GraphJSON document is a single JSON object. The specification (labelled v0.1) requires two collections, _nodes and _edges, and allows an optional top-level _style object carrying layout, sizing and colour information for the whole graph. Each node object requires an _id (its unique identifier), a caption display label, x and y coordinates, and a per-node nodeStyle; each edge requires _source and _target fields that reference node _id values, plus a caption and per-edge edgeStyle. Arbitrary additional properties are permitted on both nodes and edges, so domain data can travel alongside the structural fields. The mandatory x/y coordinates and inline style keys reveal the format's priorities: it is designed to carry a rendered, laid-out picture of a graph, not merely its topology.

That visualization focus is both its strength and its limitation. GraphJSON is trivial to consume in JavaScript, self-describing, and captures layout and styling that most pure interchange formats discard. Because coordinates and captions are required on every node, however, it is awkward as a neutral topology-only format, and it lacks the schema, typed attributes and rich metadata of GraphML or the property-graph precision of GraphSON.

Adoption remained small. The reference tooling, an Angular.js editor called GraphJSON.io that generates and edits documents in the format, saw little activity, and the format is not to be confused with the unrelated GraphJSON pattern later used by some Gremlin/TinkerPop and Neo4j-style APIs (see Neo4j JSON and PG-JSON). Today GraphJSON is best regarded as an early, mostly historical attempt at a web-standard graph format rather than a widely supported one.

Alternative Names: GraphAlchemist GraphJSON

Frequently Asked Questions

What is a GraphJSON file?

A GraphJSON file stores a graph — its nodes, edges and attributes — in the GraphJSON format (also: GraphAlchemist GraphJSON). See the feature table above for what it supports.

How do I open a GraphJSON file?

Open it in a graph tool that supports GraphJSON, or convert it to a format your tool reads. With GraphInOut you can convert GraphJSON to GraphML, DOT, Connected JSON and more, right in your browser.

How do I convert a GraphJSON file to another format?

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