addCORSOrigin(servletContext, rb, headers);
return rb.build();
}
// Remove rule from recipe
RemoveRule remove = new RemoveRule(ruleStore);
ok = remove.removeRuleFromRecipe(IRI.create(rule), IRI.create(recipe));
if (ok) {
ruleStore.saveOntology();
ResponseBuilder rb = Response.ok();
rb.header(HttpHeaders.CONTENT_TYPE, TEXT_HTML + "; charset=utf-8");
addCORSOrigin(servletContext, rb, headers);
return rb.build();
} else {
ResponseBuilder rb = Response.status(Status.NO_CONTENT);
rb.header(HttpHeaders.CONTENT_TYPE, TEXT_HTML + "; charset=utf-8");
addCORSOrigin(servletContext, rb, headers);
return rb.build();
}
}
// Delete from the ontology
if ((recipe == null) && (rule != null)) {
rule = rule.replace(" ", "").trim();
// Get the rule
GetRule getrule = new GetRule(ruleStore);
this.map = getrule.getRule(IRI.create(rule));
if (map == null) {
ResponseBuilder rb = Response.status(Status.NOT_FOUND);
rb.header(HttpHeaders.CONTENT_TYPE, TEXT_HTML + "; charset=utf-8");
addCORSOrigin(servletContext, rb, headers);
return rb.build();
}
// Remove the old rule
RemoveRule remove = new RemoveRule(ruleStore);
ok = remove.removeRule(IRI.create(rule));
if (ok) {
ruleStore.saveOntology();
ResponseBuilder rb = Response.ok();
rb.header(HttpHeaders.CONTENT_TYPE, TEXT_HTML + "; charset=utf-8");
addCORSOrigin(servletContext, rb, headers);