class OntologyRepositoryCache extends AbstractDatasetRepositoryCache<String, Ontology> {

    @Override
    public Iterator<Cache.Entry<String, Ontology>> iterator() {
        try (RepositoryConnection conn = repository.getConnection()) {
            Set<String> keys = RepositoryResults.asList(
                    conn.getStatements(null, vf.createIRI(RDF.TYPE.stringValue()), vf.createIRI(Dataset.TYPE)))
                    .stream()
                    .map(Statement::getSubject)
                    .map(Resource::stringValue)
                    .map(resourceStr -> StringUtils.removeStart(resourceStr,
                            OntologyDatasets.DEFAULT_DS_NAMESPACE))
                    .map(ResourceUtils::decode)
                    .collect(Collectors.toSet());
            return getAll(keys)
                    .entrySet()
                    .stream()
                    .map(entry -> cacheEntryFor(entry.getKey(), entry.getValue()))
                    .collect(Collectors.toSet())
                    .iterator();
        }
    }

    public  OntologyRepositoryCache(String name, Repository repository, CacheManager cacheManager,
                                   Configuration configuration);

}