use of org.openrdf.rio.trig.TriGParser in project eol-globi-data by jhpoelen.
the class LinkerTrustyNanoPubsTest method toTrigString.
private String toTrigString(InputStream rdfIn) throws IOException, RDFParseException, RDFHandlerException {
TriGParser rdfParser = new TriGParser();
Model model = new LinkedHashModel();
rdfParser.setRDFHandler(new StatementCollector(model));
rdfParser.parse(rdfIn, "http://example.com");
ByteArrayOutputStream out = new ByteArrayOutputStream();
Rio.write(model, out, RDFFormat.TRIG);
return new String(out.toByteArray(), "UTF-8");
}
Aggregations