class RestUtils {

    public static String groupedModelToSkolemizedString(Model model, RDFFormat format, SesameTransformer transformer,
                                                        BNodeService service) {
        long start = System.currentTimeMillis();
        try {
            StringWriter sw = new StringWriter();
            RDFHandler rdfWriter = new BufferedGroupingRDFHandler(Rio.createWriter(format, sw));
            Rio.write(new SkolemizedStatementIterable(model, transformer, service), rdfWriter);
            return sw.toString();
        } finally {
            LOG.trace("groupedModelToSkolemizedString took {}ms", System.currentTimeMillis() - start);
        }
    }

}