package edu.isi.karma.mapreduce.driver;

import java.io.IOException;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapreduce.Mapper;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class IdentityJSONMapper extends Mapper<Writable, Text, Text, Text> {
	private static Logger LOG = LoggerFactory.getLogger(IdentityJSONMapper.class);

	@Override
	public void map(Writable key, Text value, Context context) throws IOException, InterruptedException {
		try {
			JSONObject obj = new JSONObject(value.toString());
			if (obj.has("uri")) {
				context.write(new Text(obj.getString("uri")), value);
			}
			if (obj.has("@id")) {
				context.write(new Text(obj.getString("@id")), value);
			}
			else {
				context.write(new Text(obj.toString()), value);
			}
		}catch(Exception e) {
			LOG.error("something is wrong", e);
		}
	}
}

@@ -685,24 +685,29 @@
 e);%0A%09%09%09%7D%0A%09%09%09
+else 
 if (obj.has(

Fix error with mapper