// Create and set the cache.
if (cachingPolicyString.equals(CachingPolicy.CENTRALISED.name())) {
// this.cache = OWLOntologyManagerFactory.createOWLOntologyManager(offlineResources);
if (cache == null) {
log.warn("Caching policy is set as Centralised, but no ontology provider is supplied. Will use new in-memory tcProvider.");
cache = new ClerezzaOntologyProvider(TcManager.getInstance(), offline, Parser.getInstance());
}
// else sta bene cosi'
} else if (cachingPolicyString.equals(CachingPolicy.DISTRIBUTED.name())) {
this.cache = null;
}
riFactory = new RegistryItemFactoryImpl(cache);
// Build the model.
createModel(regOnts);
// Set the cache on libraries.
Set<RegistryItem> visited = new HashSet<RegistryItem>();
for (Registry reg : getRegistries())
for (RegistryItem child : reg.getChildren())
if (!visited.contains(child)) {
if (child instanceof Library) {
if (this.cache != null) ((Library) child).setCache(this.cache);
else ((Library) child).setCache(new ClerezzaOntologyProvider(TcManager.getInstance(),
offline, Parser.getInstance()));
}
visited.add(child);
}