Class LockableOntModel


  • public class LockableOntModel
    extends Object
    Makes it easy to use a Jena OntModel in a try-with-resources block. At the end of the block, the close() method will not close the model, but will merely release the lock. Returned by the LockableOntModelSelector, or it can be wrapped around a bare OntModel. Cannot be used without locking.
     try (LockedOntModel m = lockableOms.getDisplayModel.read()) {
        ...
     }
     
    or
     try (LockedOntModel m = new LockableOntModel(ontModel).read()) {
        ...
     }
     
    • Constructor Detail

      • LockableOntModel

        public LockableOntModel​(org.apache.jena.ontology.OntModel ontModel)