public class JSONLDFormatter implements Formatter {
@Override
public Model format(String raw) throws IOException {
Object json = JSONUtils.fromString(raw);
JenaTripleCallback callback = new JenaTripleCallback();
try {
JSONLD.toRDF(json, callback);
} catch (JSONLDProcessingError e) {
throw new IOException(e);
}
return callback.getJenaModel();
}