class OntologyRepositoryCache extends AbstractDatasetRepositoryCache<String, Ontology> {

    @Override
    public boolean replace(String key, Ontology ontology, Ontology newOntology) {
        requireNotClosed();
        IRI datasetIRI = OntologyDatasets.createDatasetIRIFromKey(key, vf);
        boolean success = false;
        try (DatasetConnection dsConn = getDatasetConnection(datasetIRI, false)) {
            Ontology repoOntology = getValueFromRepo(dsConn, key);
            if (ontology.equals(repoOntology)) {
                success = removeValueFromRepo(datasetIRI);
            }
        } catch (IllegalArgumentException e) {
            return false;
        }
        if (success) {
            put(key, newOntology);
            return true;
        }
        return false;
    }

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

}