Skip to content

ebremer/titanium-json-ld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON-LD 1.1 Processor & API

An implementation of the JSON-LD 1.1 (JSON-based Serialization for Linked Data) specification in Java utilizing JSONP (Java API for JSON Processing).

Java CI with Maven License

Conformance

The goal is to pass the official test suite and conform to the JSON-LD 1.1 specification.

Status

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.

Roadmap

Examples

Titanium JSON-LD implements the JsonLdProcessor interface and custom interface based on the builder design pattern.

JsonLd Builder API

// 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();

About

A JSON-LD 1.1 Processor & API for Java

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%