An implementation of the JSON-LD 1.1 (JSON-based Serialization for Linked Data) specification in Java utilizing JSONP (Java API for JSON Processing).
The goal is to pass the official test suite and conform to the JSON-LD 1.1 specification.
work in progress
Feature | Tests | Pass | Status | Notes |
---|---|---|---|---|
Expansion | 369 | 369 | 100% | |
Compaction | 239 | 239 | 100% | |
Flattening | 55 | 55 | 100% | |
JSON-LD to RDF | 449 | 447 | 99.5% | |
RDF to JSON-LD | 51 | 51 | 100% | |
Framing | 89 | 88 | 98.8% |
See EARL results from the JSON-LD 1.1 Test Suite for more details.
- 0.1 -
Expansion Algorithms - 0.2 -
Compaction Algorithms - 0.3 -
Flattening Algorithms - 0.4 -
JSON-LD to RDF - 0.5 -
RDF to JSON-LD - 0.6 -
Framing - 0.7 - Document & Context loaders
- 0.8 - JSON-LD API
- 1.0 - Documented, A+ code
Titanium JSON-LD implements the JsonLdProcessor interface and custom interface based on the builder design pattern.
// Expansion
JsonLd.expand("https://w3c.github.io/json-ld-api/tests/expand/0001-in.jsonld")
.ordered()
.get();
JsonLd.expand("https://example.com/document.json")
.context("https://example.com/context.jsonld") // external context
.get();
// Compaction
JsonLd.compact("https://example.com/expanded.jsonld", "https://example.com/context.jsonld").get();
// Flattening
JsonLd.flatten("https://example.com/document.jsonld").get();
// JSON-LD to RDF
JsonLd.toRdf("https://example.com/document.jsonld").get();
// RDF to JSON-LD
RdfDataset dataset = Rdf.createReader(reader, RdfFormat.N_QUADS).readDataset();
JsonLd.fromRdf(dataset).options(options).get();
// Framing
JsonLd.frame("https://example.com/document.jsonld", "https://example.com/frame.jsonld").get();