Class Rdf4jDataSource

java.lang.Object
cz.cvut.kbss.ontodriver.rdf4j.Rdf4jDataSource
All Implemented Interfaces:
Closeable, DataSource

public class Rdf4jDataSource extends Object implements DataSource
DataSource implementation representing the RDF4J OntoDriver.
  • Constructor Details

    • Rdf4jDataSource

      public Rdf4jDataSource()
  • Method Details

    • 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
    • getConnection

      public Connection getConnection() throws Rdf4jDriverException
      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
      Throws:
      Rdf4jDriverException
    • 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
    • setRepository

      public void setRepository(org.eclipse.rdf4j.repository.Repository repository) throws Rdf4jDriverException
      Sets the underlying repository.

      Note that this functionality is supported only for in-memory stores.

      Parameters:
      repository - The new repository
      Throws:
      Rdf4jDriverException - When setting repository fails