Function<String,String> nodePreprocessor=new Unescape$();
int myCnt=0;
WritableTriple writableTriple;
@Override
public void map(LongWritable arg0, Text arg1, Context c) throws IOException, InterruptedException {
PrimitiveTriple row3=p3Codec.decode(arg1.toString());
try {
String rawSubject = nodePreprocessor.apply(row3.getSubject());
String rawPredicate = nodePreprocessor.apply(row3.getPredicate());
String rawObject = nodePreprocessor.apply(row3.getObject());
Node_URI subject=(Node_URI) nodeParser.get(rawSubject);
Node_URI predicate=(Node_URI) nodeParser.get(rawPredicate);
Node object=nodeParser.get(rawObject);
Triple realTriple=new Triple(subject,predicate,object);
writableTriple = new WritableTriple(realTriple);
} catch(Throwable e) {
String factString=row3.getSubject()+"\t"+row3.getPredicate()+"\t"+row3.getSubject()+"\t.";
logger.warn("Caught exception while parsing fact ["+factString+"]",e);
reject(c, row3);
return;
}
accepted.write(writableTriple,writableTriple,c);