InputStream in = IO.openFile(filename) ;
Tokenizer tokenizer = TokenizerFactory.makeTokenizerUTF8(in) ;
ParserProfile profile = createParserProfile(runId, filename);
Lang lang = Lang.guess(filename, Lang.NQUADS) ;
if ( lang.isTriples() ) {
LangNTriples parser = new LangNTriples(tokenizer, profile, sink2) ;
parser.parse() ;
} else {
LangNQuads parser = new LangNQuads(tokenizer, profile, sink) ;
parser.parse() ;
}
IO.close(in) ; // TODO: final {}
}
sink.close() ;