@Override
protected void exec()
{
// This formats the location correctly.
// But we're not really interested in it all.
DatasetGraphTDB dsg = DatasetBuilderStd.build(location) ;
// so close indexes and the prefix table.
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() ;