Linked Data for JSON

A global model for sharing information, once a dream, and then a reality with the Internet and the Web, is now becoming a fundamental part of the systems that we build. As we automate much of the sharing of information, we need to be able to express this shared data to computers in a way that is both easy for them to process and also easy for web developers to understand. The foundational standards of the web, specifically global naming conventions (IRIs), distributed computing (web servers and clients) and remote data access (TCP/IP and HTTP) are positively impacting the way we build software. One of the areas that this standardization is lacking is with the way that we build data services for the Web using JSON. This article discusses some new work that attempts to merge the power of Linked Data with the simplicity of JSON.

The Rising Swell of Web Application Data

Digital Bazaar is heavily involved in the latest Web research and development standards groups including XHTML+RDFa, HTML5+RDFa, Semantic Web, OpenID Connect, and WebID. We know that most of the Internet technology that survives on a long-term basis was standardized at some point. This is why we are committed to Internet standards – they are foundations of collaboration and innovation on the Web.

The world is slowly starting to depend on Web browsers to provide functionality that our desktop applications have historically provided. These web applications are rudimentary in some ways, but the most important expression of their nature is that they are fundamentally connected to the Web. Most of the data that they process comes from a website, and the number of websites providing services that allow new data sources to be added to these web applications are growing. Similarly, much of the logic for driving the web application is moving away from the web server and into the web browser. Many developers have chosen to implement large portions of their programs in JavaScript, HTML and CSS. This is a very good thing as a web application has another distinct advantage over desktop applications. A web application will run on many devices and systems – desktops, laptops, Windows, Mac, Android, cell phones, tablets, televisions, and a growing number of additional web-connected devices.

So, the way that we write these applications are distributed now, we use distributed protocols to get data, but the data that we retrieve remains locked in the old way of thinking about application data. That is – we tend to think of data as local to our computers, not global to the world. There is no widely-used global naming scheme for the data that we retrieve from websites. One could argue that we have XML, but that doesn’t identify data in a global way unless the developer builds that information into the data model. Modifying the data model of XML is difficult because it requires you to modify document schema, which is a very time consuming process – and in some cases, impossible if you do not own the document schema. We do have RDF, but most web developers don’t know what it is. The web developers that think they know RDF usually hate it because they confuse it with RDF/XML, a fairly inelegant way of working with data on the Web. Whatever solution that we end up with needs to use all of the positive aspects of these technologies, but cutting out the stuff that nobody really cares about. The learning curve must be shallow. It must stay focused on making developers lives easier.

There are a few technologies that web developers tend to use on a regular basis when developing web applications: HTML, JavaScript and JSON. With the continuing adoption of RDFa by the web development community and major search engines, developers now have a way to express data about events, recipes, videos, products and people in HTML. What is missing is the ability to express this data in JSON.

JSON-LD Leads the Way

There is a new specification in the works to address the issue of exchanging global data in JSON. It is called JSON-LD, and is a simple way of expressing Linked Data concepts in JSON. JSON-LD focuses on a few simple concepts:

Zero Edits
JSON-LD provides a mechanism that allows developers to specify their data’s context in a way that is out-of-band. This allows organizations that have already deployed large JSON-based infrastructure to add meaning to their JSON in a way that is not disruptive to their day-to-day operations and is transparent to their current customers. There is a non-disruptive migration path from JSON to JSON-LD.
Compatibility
The JSON-LD markup is 100% compatible with JSON, building on all of the libraries that have been created for working with JSON data.
Simplicity
Developers don’t need to know RDF in order to use the basic functionality provided by JSON-LD. You can use as much or as little JSON-LD as you want.
Expressiveness
All major RDF concepts must be expressible via the JSON-LD syntax. This ensures that there is a clean mapping to the most robust Web-native data model in use today.
Terseness
The JSON-LD syntax must be very terse and human readable. Since the markup is designed for developers first and foremost, it must be very easy to read and work with.
Universal
It works well with existing JSON data, Microformats, RDFa and Microdata.
Streaming
The format supports both document-based and stream-based processing, which means that it can be easily used across a variety of low-power and high-power devices.

We need to stop thinking of our data as local and start thinking of it as global. The concepts outlined above make JSON-LD a powerful, pragmatic solution to the problem of global data. JSON-LD can take us from what we have today, to the global, Linked Data that we are increasingly building into our web applications. If you are interested in learning more about JSON-LD, there is a website and community dedicated to the open standard.

Trackbacks/Pingbacks