use of org.apache.stanbol.ontologymanager.servicesapi.ontology.OrphanOntologyKeyException in project stanbol by apache.
the class RootResource method deleteOntology.
@DELETE
@Path("/{ontologyId:.+}")
public Response deleteOntology(@PathParam("ontologyId") String ontologyId, @Context HttpHeaders headers) {
OWLOntologyID key = OntologyUtils.decode(ontologyId);
ResponseBuilder rb;
try {
if (!ontologyProvider.hasOntology(key)) {
rb = Response.status(NOT_FOUND);
} else {
try {
// TODO check aliases!
ontologyProvider.removeOntology(key);
rb = Response.ok();
} catch (OntologyHandleException e) {
rb = Response.status(CONFLICT);
}
}
} catch (OrphanOntologyKeyException e) {
log.warn("Orphan ontology key {}. No associated graph found in store.", e.getOntologyKey());
rb = Response.status(NOT_FOUND);
}
// addCORSOrigin(servletContext, rb, headers);
return rb.build();
}
Aggregations