class RdfEngine implements Engine {

    @Override
    public void storeUser(User user) {
        Literal username = user.getUsername().orElseThrow(() ->
                new IllegalArgumentException("User must have a username"));
        if (resourceExists(user.getResource()) || userExists(username.stringValue())) {
            throw new IllegalArgumentException("User with that id already exists");
        }

        try (RepositoryConnection conn = repository.getConnection()) {
            conn.add(user.getModel(), context);
        }
    }

}