avroWriter.setProcessingOrder(graphTriplesMapsProcessingOrder);
}
}
}
int i=1;
TriplesMapPlanExecutor e = new TriplesMapPlanExecutor();
Map<TriplesMap, TriplesMapWorkerPlan> triplesMapToWorkerPlan = new HashMap<TriplesMap, TriplesMapWorkerPlan>() ;
for(TriplesMap triplesMap : kr2rmlMapping.getTriplesMapList())
{
try{
TriplesMapWorkerPlan workerPlan = new TriplesMapWorkerPlan(factory, triplesMap, kr2rmlMapping, uriFormatter, translator, addColumnContextInformation, hNodeToContextUriMap, selection);
triplesMapToWorkerPlan.put(triplesMap, workerPlan);
}
catch (Exception ex)
{
logger.error("unable to generate working plan for " + triplesMap.getId(), ex.getMessage());
}
}
for (Row row:rows) {
for(Entry<TriplesMapGraph, List<String>> entry : graphTriplesMapsProcessingOrder.entrySet())
{
TriplesMapPlanGenerator g = new TriplesMapPlanGenerator(triplesMapToWorkerPlan, row, outWriters);
TriplesMapPlan plan = g.generatePlan(entry.getKey(), entry.getValue());
errorReport.combine(e.execute(plan));
}
for(KR2RMLRDFWriter outWriter : outWriters)
{
outWriter.finishRow();
}
if (i++%2000 == 0)
logger.info("Done processing " + i + " rows");
}
e.shutdown(errorReport);
// Generate column provenance information if required
if (addColumnContextInformation) {
generateColumnProvenanceInformation();
}
} catch (Exception e)
{
logger.error("Unable to generate RDF: ", e);
errorReport.addReportMessage(new ReportMessage("General RDF Generation Error", e.getMessage(), Priority.high));
throw new IOException("Unable to generate RDF: " +e.getMessage());
}
finally {
if (closeWriterAfterGeneration) {
for(KR2RMLRDFWriter outWriter : outWriters)
{