class SimpleApplicationWrapper implements ApplicationWrapper {

    @Override
    public Application getApplication() {
        try (RepositoryConnection conn = repository.getConnection()) {
            Model appModel = modelFactory.createModel();
            conn.getStatements(factory.createIRI(NAMESPACE + applicationId), null, null).forEach(appModel::add);
            return appFactory.getExisting(factory.createIRI(NAMESPACE + applicationId), appModel).orElseThrow(() ->
                    new IllegalStateException("Unable to retrieve application: " + NAMESPACE + applicationId));
        }
    }

}