Integration of JSONLD-Java with Clerezza
Java
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
.travis.yml
LICENCE
README.md
pom.xml

README.md

JSONLD-Java Clerezza Integration module

Build Status Coverage Status

This module provide a ParsingProviderand SerializingProvider for Apache Clerezza. Those Providers plug into the Clerezza Parser and Serializer service infrastructure. Meaning that adding this bundle will allow Clerezza to parse and serialize JSON-LD.

USAGE

From Maven

<dependency>
    <groupId>com.github.jsonld-java</groupId>
    <artifactId>jsonld-java-clerezza</artifactId>
    <version>0.8.3</version>
</dependency>

(Adjust for most recent , as found in pom.xml).

ClerezzaTripleCallback

The ClerezzaTripleCallback returns an instance of org.apache.clerezza.rdf.core.MGraph

See ClerezzaTripleCallbackTest.java for example Usage.

From OSGI

Assuming the above Bundle is active in the OSGI Environment one can simple inject the Serializer and/or Parser service.

@Reference
private Serializer serializer;

@Reference
private Parser parser;

Normal Java

Both the Parser and Serializer also support java.util.ServiceLoader. So when running outside an OSGI environment one can use the getInstance() to obtain an instance.

Serializer serializer = Serializer.getInstance();

Parser parser = Parser.getInstance();

Supported Formats

The JSON-LD parser implementation supports application/ld+json. The serializer supports both application/ld+json and application/json.

The rational behind this is that the parser can not parse any JSON however the Serializer does generate valid JSON.