class MergeRequestRest {

    @DELETE
    @Path("{requestId}/comments/{commentId}")
    @RolesAllowed("user")
    @ApiOperation("Deletes a Comment that has the provided commentId")
    public Response deleteComment(@Context ContainerRequestContext context,
                           @PathParam("requestId") String requestId,
                           @PathParam("commentId") String commentId) {
        try {
            Resource commentIRI = createIRI(commentId, vf);
            manager.getMergeRequest(createIRI(requestId, vf)).orElseThrow(() ->
                    ErrorUtils.sendError("Comment " + requestId + " could not be found",
                            Response.Status.NOT_FOUND));
            Comment comment = manager.getComment(commentIRI).orElseThrow(() ->
                    ErrorUtils.sendError("Comment " + commentId + " could not be found",
                            Response.Status.NOT_FOUND));
            Optional<com.mobi.rdf.api.Value> commentUser = comment.getProperty(vf.createIRI(_Thing.creator_IRI));
            User user = getActiveUser(context, engineManager);
            if (commentUser.isPresent() && commentUser.get().stringValue().equals(user.getResource().stringValue())) {
                manager.deleteComment(commentIRI);
            } else {
                throw ErrorUtils.sendError("User not permitted to delete comment " + commentId,
                        Response.Status.UNAUTHORIZED);
            }
            return Response.ok().build();
        } catch (IllegalArgumentException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.BAD_REQUEST);
        } catch (IllegalStateException | MobiException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.INTERNAL_SERVER_ERROR);
        }
    }

}