super.setup(context);
}
@Override
protected void map(LongWritable key, Text value, Mapper.Context context) throws IOException, InterruptedException {
PrimitiveTriple pt=codec.decode(value.toString());
final String prefix = "/wikipedia/en_title/";
if(pt.getPredicate().equals("<http://rdf.basekb.com/ns/type.object.key>")) {
String fbKey=pt.getObject();
if (fbKey.startsWith("\"") || fbKey.endsWith("\"")) {
fbKey=fbKey.substring(1,fbKey.length()-1);
if(fbKey.startsWith(prefix)) {
String wikiKey=fbKey.substring(prefix.length());
String dbpediaURI="http://dbpedia.org/resource/"+mapKey(wikiKey);
context.write(
new Text(pt.getSubject()),
new Text("<http://www.w3.org/2002/07/owl#sameAs>\t<"+dbpediaURI+">\t.")
);
}
}
}