final StringWriter aggregationWarningWriter = new StringWriter();
final StringWriter aggregationErrorWriter = new StringWriter();
try {
Model model = ModelFactory.createDefaultModel();
// model.read(url.toString());
JenaReader jenaReader = new JenaReader();
jenaReader.setErrorHandler(new RDFErrorHandler() {
public void error(Exception e) {
aggregationErrorWriter.write(e.getMessage());
}
public void fatalError(Exception e) {
aggregationErrorWriter.write("FATAL: ");
aggregationErrorWriter.write(e.getMessage());
log.info("Fatal Error aggregating "+aggregatedSource, e);
throw new AllreadyLoggedRuntimeException(e);
}
public void warning(Exception e) {
aggregationWarningWriter.write(e.getMessage());
}
});
jenaReader.read(model, url.toString());
String errorMessage = aggregationErrorWriter.toString();
if (errorMessage.equals("")) {
Graph graph = JenaUtil.getGraphFromModel(model, true);
store.updateGraph(aggregatedSource, new FCAGraphImpl(graph));
} else {