class RestUtils {

    public static Model jsonldToModel(String jsonld, SesameTransformer transformer) {
        long start = System.currentTimeMillis();
        try {
            return transformer.mobiModel(Rio.parse(IOUtils.toInputStream(jsonld), "", RDFFormat.JSONLD));
        } catch (Exception e) {
            throw ErrorUtils.sendError("Invalid JSON-LD", Response.Status.BAD_REQUEST);
        } finally {
            LOG.trace("jsonldToModel took {}ms", System.currentTimeMillis() - start);
        }
    }

}