dsg.getTripleTable().getNodeTupleTable().getTupleTable().close();
dsg.getQuadTable().getNodeTupleTable().getTupleTable().close();
// Later - attach prefix table to parser.
dsg.getPrefixes().close() ;
ProgressLogger monitor = new ProgressLogger(cmdLog, "Data", BulkLoader.DataTickPoint,BulkLoader.superTick) ;
OutputStream outputTriples = null ;
OutputStream outputQuads = null ;
try {
outputTriples = new FileOutputStream(dataFileTriples) ;
outputQuads = new FileOutputStream(dataFileQuads) ;
}
catch (FileNotFoundException e) { throw new AtlasException(e) ; }
NodeTableBuilder sink = new NodeTableBuilder(dsg, monitor, outputTriples, outputQuads) ;
monitor.start() ;
sink.startBulk() ;
for( String filename : datafiles)
{
if ( datafiles.size() > 0 )
cmdLog.info("Load: "+filename+" -- "+Utils.nowAsString()) ;
RiotReader.parse(filename, sink) ;
}
sink.finishBulk() ;
IO.close(outputTriples) ;
IO.close(outputQuads) ;
// ---- Stats
// See Stats class.
if ( ! location.isMem() )
Stats.write(dsg.getLocation().getPath(Names.optStats), sink.getCollector().results()) ;
// ---- Monitor
long time = monitor.finish() ;
long total = monitor.getTicks() ;
float elapsedSecs = time/1000F ;
float rate = (elapsedSecs!=0) ? total/elapsedSecs : 0 ;
String str = String.format("Total: %,d tuples : %,.2f seconds : %,.2f tuples/sec [%s]", total, elapsedSecs, rate, nowAsString()) ;
cmdLog.info(str) ;
}