@Override
public void parse(MGraph target, InputStream serializedGraph, String formatIdentifier, UriRef baseUri) {
BNodeManager bNodeMgr = new BNodeManager();
JSONParser parser = new JSONParser();
InputStreamReader reader;
try {
reader = new InputStreamReader(serializedGraph, "UTF-8");
} catch (UnsupportedEncodingException e) {
String msg = "Encoding 'UTF-8' is not supported by this System";
logger.error("{} (message: {})", msg, e.getMessage());
throw new IllegalStateException(msg, e);
}
try {
JSONObject root = (JSONObject) parser.parse(reader);
NonLiteral nonLiteral = null;
for (Object key : root.keySet()) {
String keyString = (String) key;
if (keyString.startsWith("_:")) {