HASMAC JSON-LD is a fork of Titanium JSON-LD for the purpose of incorporating performance improvements. Merging the performance improvements back into Titanium JSON-LD is a work in progress. Once complete, HASMAC JSON-LD will be deprecated and eventually removed.
The goal is to pass the official test suite and conform to the JSON-LD 1.1 specification.
Feature | Tests | Pass | Status | Notes |
---|---|---|---|---|
Expansion | 371 | 371 | 100% | |
Compaction | 242 | 242 | 100% | |
Flattening | 55 | 55 | 100% | |
JSON-LD to RDF | 451 | 449 | 99.5% | |
RDF to JSON-LD | 51 | 51 | 100% | |
Framing | 89 | 88 | 98.8% | |
Remote Document and Context Retrieval | 18 | 17 | 94.4% |
See [EARL results from the JSON-LD 1.1 Test Suite](https://w3c.github.io/json-ld-api/reports/#subj_HASMAC JSON-LD_JSON_LD_Java) for more details.
LD-CLI is a native command line utility for Ubuntu, Mac, Windows
- JSON-LD-star expansion and compaction built-in support (experimental)
- Universal RDF Dataset Normalization Algorithm - URDNA2015
Java 11 or higher
<dependency>
<groupId>no.hasmac</groupId>
<artifactId>hasmac-json-ld</artifactId>
<version>1.0.0</version>
</dependency>
Java 8+, Android API Level >=21
compile group: 'no.hasmac', name: 'hasmac-json-ld-jre8', version: '1.3.2'
Add JSON-P provider, if it is not on the classpath already.
Maven
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.json</artifactId>
<version>2.0.1</version>
</dependency>
Gradle
compile group: 'org.glassfish', name: 'jakarta.json', version: '2.0.1'
HASMAC JSON-LD provides high-level JsonLd API to interact with the processor.
// Expansion
JsonLd.expand("https://w3c.github.io/json-ld-api/tests/expand/0001-in.jsonld")
.ordered()
.get();
JsonLd.expand("file:/home/filip/document.json") // HTTP(S) and File schemes supported
.context("file:/home/filip/context.jsonld") // external context
.get();
// Compaction
JsonLd.compact("https://example/expanded.jsonld", "https://example/context.jsonld")
.compactToRelative(false)
.get();
// Flattening
JsonLd.flatten("https://example/document.jsonld").get();
// JSON-LD to RDF
JsonLd.toRdf("https://example/document.jsonld").get();
// RDF to JSON-LD
JsonLd.fromRdf("https://example/document.nq").options(options).get();
// Framing
JsonLd.frame("https://example/document.jsonld", "https://example/frame.jsonld").get();
// Local document
Document document = JsonDocument.of(InputStream) or JsonDocument.of(Reader) ...
JsonLd.expand(document).get();
JsonLd.compact(document, contextDocument).get();
...
All PR's welcome!
- develop
- implement a new feature
- fix an existing issue
- improve an existing implementation
- test
- report a bug
- implement a test case
- document
- write javadoc
- write a tutorial
- proofread an existing documentation
- promote
- star, share, the project
- write an article
- sponsor
- your requests get top priority
- you will get a badge
Fork and clone the project repository.
> cd hasmac-json-ld
> ./mvnw clean package
> cd hasmac-json-ld
> ./mvnw -f pom_jre8.xml clean package
- JSON-LD 1.1
- JSON-LD 1.1 Processing Algorithms and API
- JSON-LD 1.1 Framing
- JSON-LD Best Practices
- JSON-LD-star
- JSON-LD Playground
Commercial support is available at filip26@gmail.com