Class JenaDataSource

java.lang.Object
cz.cvut.kbss.ontodriver.jena.JenaDataSource
All Implemented Interfaces:
Closeable, DataSource, ReloadableDataSource

public class JenaDataSource extends Object implements ReloadableDataSource
  • Constructor Details

    • JenaDataSource

      public JenaDataSource()
  • Method Details

    • getConnection

      public Connection getConnection()
      Description copied from interface: DataSource
      Requests a connection to the underlying data source.
      Specified by:
      getConnection in interface DataSource
      Returns:
      A Connection to the data source
    • setStorageProperties

      public void setStorageProperties(OntologyStorageProperties storageProperties)
      Description copied from interface: DataSource
      Sets storage properties for this data source.

      Note that if the data source is already connected to the underlying storage, the outcome of this method is not specified and is likely to have no effect.

      Specified by:
      setStorageProperties in interface DataSource
      Parameters:
      storageProperties - The properties to use
    • setProperties

      public void setProperties(Map<String,String> properties)
      Description copied from interface: DataSource
      Sets additional configuration properties on the data source.
      Specified by:
      setProperties in interface DataSource
      Parameters:
      properties - Map of properties
    • close

      public void close() throws OntoDriverException
      Description copied from interface: Closeable
      Closes this resource releasing any sub-resources it holds.

      After closing the resource is not usable any more and calling methods on it (except close and isOpen) will result in IllegalStateException.

      Calling close on already closed resource does nothing.

      Specified by:
      close in interface Closeable
      Throws:
      OntoDriverException - If an ontology access error occurs.
    • isOpen

      public boolean isOpen()
      Description copied from interface: Closeable
      Retrieves status of this resource.
      Specified by:
      isOpen in interface Closeable
      Returns:
      true if the resource is open, false otherwise
    • reload

      public void reload() throws JenaDriverException
      Description copied from interface: ReloadableDataSource
      Reloads data from the underlying storage, if possible.

      Does nothing if the underlying storage does not support reloading or it is not necessary (e.g. when connected to a remote triple store).

      Specified by:
      reload in interface ReloadableDataSource
      Throws:
      JenaDriverException
    • setDataset

      public void setDataset(org.apache.jena.query.Dataset dataset) throws JenaDriverException
      Sets dataset in the underlying storage.

      Not that this operation is supported only for in-memory storage.

      Parameters:
      dataset - Dataset to set
      Throws:
      JenaDriverException - If setting new dataset fails