class SimpleMergeRequestManager implements MergeRequestManager {

    @Override
    public void deleteComment(Resource commentId) {
        try (RepositoryConnection conn = configProvider.getRepository().getConnection()) {
            // Adjust comment chain pointers if they exist
            Comment comment = getComment(commentId, conn).orElseThrow(
                    () -> new IllegalArgumentException("Comment " + commentId + " does not exist"));
            Iterator<Statement> statements = conn.getStatements(null, vf.createIRI(Comment.replyComment_IRI),
                    commentId);
            if (statements.hasNext()) {
                Resource parentCommentIRI = statements.next().getSubject();
                Optional<Comment> parentCommentOpt = getComment(parentCommentIRI, conn);
                Optional<Resource> childCommentResourceOpt = comment.getReplyComment_resource();
                if (childCommentResourceOpt.isPresent() && parentCommentOpt.isPresent()) {
                    Comment childComment = getComment(childCommentResourceOpt.get(), conn).orElseThrow(
                            () -> new IllegalArgumentException("Child comment " + childCommentResourceOpt.get()
                                    + " does not exist"));
                    Comment parentComment = parentCommentOpt.get();
                    parentComment.setReplyComment(childComment);
                    updateComment(parentComment.getResource(), parentComment);
                } else if (!childCommentResourceOpt.isPresent() && parentCommentOpt.isPresent()) {
                    Comment parentComment = parentCommentOpt.get();
                    parentComment.removeProperty(commentId, vf.createIRI(Comment.replyComment_IRI));
                    updateComment(parentComment.getResource(), parentComment);
                }
            }
            catalogUtils.validateResource(commentId, commentFactory.getTypeIRI(), conn);
            catalogUtils.remove(commentId, conn);
        }
    }

}