in.close();
} catch (Exception e) {
urlExists = false;
}
if (!urlExists) {
uc.add(new AbstractUpdate() {
public void generateJson(String prefix, PrintWriter pw,
VWorkspace vWorkspace) {
JSONObject outputObject = new JSONObject();
try {
outputObject.put(JsonKeys.updateType.name(), "RefreshModel");
outputObject.put(JsonKeys.messages.name(), "URL broken");
//.put(JsonKeys.fileUrl.name(), graphUrl);
pw.println(outputObject.toString());
} catch (JSONException e) {
//e.printStackTrace();
logger.error("Error occured while generating JSON!");
}
}
});
return uc;
}
TripleStoreUtil util = new TripleStoreUtil();
try {
util.deleteMappingFromTripleStore(tripleStoreURL, context, mappingURI);
SaveR2RMLModelCommandFactory scf = new SaveR2RMLModelCommandFactory();
SaveR2RMLModelCommand command = scf.createCommand(workspace, mappingURI, tripleStoreURL, context, "URL");
command.doIt(workspace);
} catch (KarmaException e) {
return new UpdateContainer(new ErrorUpdate("Error occured while deleting R2RML model!"));
}
uc.add(new AbstractUpdate() {
public void generateJson(String prefix, PrintWriter pw,
VWorkspace vWorkspace) {
JSONObject outputObject = new JSONObject();
try {
outputObject.put(JsonKeys.updateType.name(), "RefreshModel");