Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.11 KB

README.md

File metadata and controls

32 lines (23 loc) · 1.11 KB

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