I've made the 4 private methods protected and added a protected "createCache".

By this rational, I'd consider DatasetImpl creating models (in instances
where the client code is not requesting a created model) a bug. There is no
reason for an abstraction, whose only purpose is to relate a collection of
models to the collection of their backing graphs, to create new models to
then represent those graphs.

There is a cache for the case of databases with very large numbers of graphs persistently on disk. If the DatasetImpl is churning through models, they will slowly fill up memory in a long-running program. Models aren't particularly cheap currently because of their own internal caches and state EnhGraph). And just creating a model each call through would not be good for code that looks like

loop:
    dataset.getNamedModel("fixed name"). .. model operations ...


Architecturally, maybe a reworking where the usual Model works (statelessly) over a Graph and the EnhGraph machinary only appears for OntModels would be good.

        Andy

Reply via email to