Skip to content

JSON streams

Rob Speer edited this page Oct 31, 2016 · 3 revisions

JSON is a very convenient format for exchanging data that can be used by many different programming languages.

A slight disadvantage of JSON is that it doesn't come with a stream format. If you need to send a large number of JSON objects from one place to another, you don't want to put them all in one JSON list, because then you have to parse the entire list before you can get at any of the objects.

However, it's really easy to impose a stream format on top of JSON, by outputting a text file one JSON object per line. Many developers have converged on using this format. You could call it "line-delimited JSON", "JSON lines", "streaming JSON", or "JSON streams".

When ConceptNet produces a file with the extension .jsons, it's in JSON stream format.

The site http://jsonlines.org/ now exists to standardize this format.