Today, IPTC announces the release of version 2.0 of the news industry’s standard for exchanging content in JSON: ninjs.
The new version introduces a completely new way of declaring multiple headlines, body texts and description fields, which is compatible with binary data serialisation formats such as Avro and Protocol Buffers.
“We are very excited about releasing the 2.0-version of News in JSON (ninjs),” says Johan Lindgren (TT), lead of the working group responsible for developing the standard. “When working on improving the 1.3 version, we realised that a number of suggestions would mean breaking changes and after some consideration we took that step. Now we have a version of ninjs that is better suited for APIs, databases like Elastic and conversion to binary methods like Protocol Buffers.”
The IPTC News in JSON Working Group has kept the original focus on two main use cases: data in transit and data at rest.
In recent years, more systems have started to convert from JSON formats into binary data serialisation protocols such as Avro and Protocol Buffers for data in transit. However ninjs 1.x couldn’t be converted into these protocols because of the dynamic way that keys could be defined, for example “headline_main” and “headline_subhead”. In ninjs 2.0, all properties are given well-defined names, so they can be converted into Protobufs schemas. The GitHub repository for ninjs now includes a demonstration of how ninjs 2.0 can be used with Protocol Buffers.
Other tools included in the repository are an example GraphQL server for ninjs and example XSLTs to convert from IPTC XML-based formats like NewsML and NITF.
The ninjs Generator tool has been updated to create ninjs 2.0. In fact, using the tool, users can switch between generating ninjs 1.3 and ninjs 2.0 output at the click of a radio button.
The official location of the ninjs 2.0 JSON Schema is https://iptc.org/std/ninjs/ninjs-schema_2.0.json.
A full list of the changes in ninjs 2.0 can be viewed in section 7.5 of the ninjs User Guide.