/jsonld-java-rdf2go

Integration of JSONLD-Java with RDF2GO

Primary LanguageJavaBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

JSONLD-Java RDF2Go Integration module

Build Status Coverage Status

USAGE

From Maven

<dependency>
    <groupId>com.github.jsonld-java</groupId>
    <artifactId>jsonld-java-rdf2go</artifactId>
    <version>0.12.0</version>
</dependency>

Serializing RDF into JSON-LD using RDF2GoRDFParser

import com.github.jsonldjava.rdf2go.*;

ModelSet modelSet = ...; // also works with a Model
RDF2GoRDFParser parser = new RDF2GoRDFParser();
Object json = JSONLD.fromRDF(modelSet, parser);

Parsing JSON-LD, and convert it into a ModelSet

RDF2GoTripleCallback callback = new RDF2GoTripleCallback();
ModelSet model = (ModelSet) JSONLD.toRDF(input, callback);