Linked Data / JSON-LD Context
Linked Data
The key characteristic of Linked Data is that elements of data can be linked to more resources.
The main aspects of this are:
- Schema elements and data contents can be unambiguously identified - allowing all sorts of downstream operations to be performed with confidence.
- Elements of schemas can be linked to explanations and documentation
- Data values can be linked to controlled vocabularies with definitions
- Data values can be links to other data objects
The key enabler for Linked Data is the use of RDF - and this can be done with “native RDF” - but the focus on the Building Blocks is “semantic uplift” of JSON.
This can be done with JSON-LD. Whilst it has its limitations JSON-LD is a commonly used standard that provides an enabler.
The challenges with JSON-LD lie in its mirroring of underlying JSON schema structures - it doesnt support significant structure reorganisation, and its complex to build JSON-LD contexts that mirror complex schemas.
The OGC Building Blocks solve this by allowing unit-testing of simple JSON-LD contexts for sub-schemas, and compilation of reliable context documents for schemas that re-use these sub-schemas. (Note this is currently the only Open Source tooling known to support this, and was developed in consultation with JSON schema design leads.)
For more information see the Use Cases.
Tooling for consuming and displaying Linked Data
Producing well-formed JSON-LD is only half the story — someone still has to render it for a human.
@opengeospatial/jsonld-ui-utils
(npm) is a JavaScript/TypeScript
library that takes a JSON-LD feature and its context and renders it as a nested HTML properties
table, resolving property names and values against RDF metadata (labels, descriptions) fetched
from the vocabularies they point to. It also ships a Leaflet plugin that turns a GeoJSON
FeatureCollection into a map layer whose popups are these semantically-enriched tables rather
than raw property dumps.
bblocks-viewer uses this library to render the “Examples” tab whenever an example is a GeoJSON feature or collection, but the library itself is standalone and reusable in any application that needs to display JSON-LD data with resolved semantics.