JSON-LD for xAPI Vocabularies

As you can see, the above RDF doesn’t look too bad in Turtle (be glad you’re spared from the RDF/XML rendering). But at the same time, there’s enough complication that things aren’t simple. By using JSON-LD, we’ll make it so straightforward documents can contain the same information as the above in a way anyone already comfortable with JSON will have no problem with them.

The key to this is the use of a ‘context’ that describes how different JSON attributes and values get turned into the IRIs used in RDF. JSON-LD pushes complexity into the context, which can be shared across documents, so applications or people writing and reading documents only deal with the simpler JSON representation. Don’t worry too much about the details if you’re just hearing about JSON-LD. It pretty much is as simple as it looks: the keys provide shorthand for the RDF properties described. When the @type is @id, the values of the key are IRIs, but in other cases they’re objects.

While any RDF (HTML/RDFa, Turtle, RDF/XML,etc.) can be expressed in JSON-LD and vice versa, in order to keep complexity low, the use of JSON-LD for xAPI vocabularies is restricted further, to focus on specific structures and properties. That is what makes it easy for producers and consumers to use it with standard JSON tools. This standard JSON-LD practice makes it a wonderful bridge between JSON and the Semantic Web. The more constrained JSON can be safely traversed by simpler, easy to write JSON-only clients, but the use of additional JSON-LD elements and expressivity on top of that structure can communicate arbitrarily rich information. JSON-LD will likely be a good starting point for systems looking to directly retrieve meaning from a number of different vocabularies, when provided the vocabulary IRI.

results matching ""

    No results matching ""