Class ModelMakerWithPersistentEmptyModels

  • All Implemented Interfaces:
    org.apache.jena.rdf.model.ModelGetter, org.apache.jena.rdf.model.ModelMaker, org.apache.jena.rdf.model.ModelSource

    public class ModelMakerWithPersistentEmptyModels
    extends AbstractModelMakerDecorator
    This ModelMaker will remember the URIs of models you create, even if you don't add triples to them. Of course, when VIVO is shut down, this ModelMaker forgets. This is a useful decorator for some triple stores which do not remember empty models. SDB, for example. With this decorator, a GUI can offer to let you create a model, and then offer to let you add triples to it. Without this decorator, you would need to do that in a single step. If you are dealing with a triple store where listModels() is a costly operation, you might be better off using a ListCachingModelMaker instead. The drawback is that ListCachingModelMaker will not see models that were created at a lower level; perhaps by RDFServiceDataset.getNamedModel(). The methods that create a model must add its name to the list. The methods that remove a model must remove its name from the list.
    • Constructor Detail

      • ModelMakerWithPersistentEmptyModels

        public ModelMakerWithPersistentEmptyModels​(org.apache.jena.rdf.model.ModelMaker inner)
    • Method Detail

      • listModels

        public org.apache.jena.util.iterator.ExtendedIterator<String> listModels()
        Specified by:
        listModels in interface org.apache.jena.rdf.model.ModelMaker
        Overrides:
        listModels in class AbstractModelMakerDecorator
      • getModel

        public org.apache.jena.rdf.model.Model getModel​(String URL)
        Specified by:
        getModel in interface org.apache.jena.rdf.model.ModelGetter
        Overrides:
        getModel in class AbstractModelMakerDecorator
      • getModel

        public org.apache.jena.rdf.model.Model getModel​(String URL,
                                                        org.apache.jena.rdf.model.ModelReader loadIfAbsent)
        Specified by:
        getModel in interface org.apache.jena.rdf.model.ModelGetter
        Overrides:
        getModel in class AbstractModelMakerDecorator
      • createModel

        public org.apache.jena.rdf.model.Model createModel​(String name,
                                                           boolean strict)
        Specified by:
        createModel in interface org.apache.jena.rdf.model.ModelMaker
        Overrides:
        createModel in class AbstractModelMakerDecorator
      • createModel

        public org.apache.jena.rdf.model.Model createModel​(String name)
        Specified by:
        createModel in interface org.apache.jena.rdf.model.ModelMaker
        Overrides:
        createModel in class AbstractModelMakerDecorator
      • openModel

        public org.apache.jena.rdf.model.Model openModel​(String name)
        Specified by:
        openModel in interface org.apache.jena.rdf.model.ModelSource
        Overrides:
        openModel in class AbstractModelMakerDecorator
      • openModel

        public org.apache.jena.rdf.model.Model openModel​(String name,
                                                         boolean strict)
        Specified by:
        openModel in interface org.apache.jena.rdf.model.ModelMaker
        Overrides:
        openModel in class AbstractModelMakerDecorator