public String getExampleOutput() throws IOException, ExtractionException {
if (factory.getExampleInput() == null) {
return null;
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
TripleHandler writer = new TurtleWriter(out);
new SingleDocumentExtraction(
new StringDocumentSource(getExampleInput(), getExampleURI()),
factory,
writer).run();
try {
writer.close();
} catch (TripleHandlerException e) {
throw new ExtractionException("Error while closing the triple handler", e);
}
return out.toString("utf-8");
}