class RdfEngine implements Engine {

    @Override
    public Optional<Role> getRole(String roleName) {
        if (!roles.contains(roleName)) {
            return Optional.empty();
        }

        Model roleModel = mf.createModel();
        try (RepositoryConnection conn = repository.getConnection()) {
            RepositoryResult<Statement> statements = conn.getStatements(vf.createIRI(roleNamespace + roleName),
                    null, null, context);
            statements.forEach(roleModel::add);
        }

        return roleFactory.getExisting(vf.createIRI(roleNamespace + roleName), roleModel);
    }

}