class RdfEngine implements Engine {

    @Override
    public void deleteUser(String username) {
        try (RepositoryConnection conn = repository.getConnection()) {
            Optional<Resource> optId = getUserId(username, conn);
            if (!optId.isPresent()) {
                throw new IllegalArgumentException("User with that id does not exist");
            }
            conn.remove(optId.get(), null, null, context);
            conn.remove(null, null, (Value) optId.get(), context);
        }
    }

}