Package cz.cvut.kbss.ontodriver.jena
Class JenaDataSource
java.lang.Object
cz.cvut.kbss.ontodriver.jena.JenaDataSource
- All Implemented Interfaces:
Closeable,DataSource,ReloadableDataSource
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this resource releasing any sub-resources it holds.Requests a connection to the underlying data source.booleanisOpen()Retrieves status of this resource.voidreload()Reloads data from the underlying storage, if possible.voidsetDataset(org.apache.jena.query.Dataset dataset) Sets dataset in the underlying storage.voidsetProperties(Map<String, String> properties) Sets additional configuration properties on the data source.voidsetStorageProperties(OntologyStorageProperties storageProperties) Sets storage properties for this data source.
-
Constructor Details
-
JenaDataSource
public JenaDataSource()
-
-
Method Details
-
getConnection
Description copied from interface:DataSourceRequests a connection to the underlying data source.- Specified by:
getConnectionin interfaceDataSource- Returns:
- A
Connectionto the data source
-
setStorageProperties
Description copied from interface:DataSourceSets 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:
setStoragePropertiesin interfaceDataSource- Parameters:
storageProperties- The properties to use
-
setProperties
Description copied from interface:DataSourceSets additional configuration properties on the data source.- Specified by:
setPropertiesin interfaceDataSource- Parameters:
properties- Map of properties
-
close
Description copied from interface:CloseableCloses this resource releasing any sub-resources it holds.After closing the resource is not usable any more and calling methods on it (except
closeandisOpen) will result inIllegalStateException.Calling
closeon already closed resource does nothing.- Specified by:
closein interfaceCloseable- Throws:
OntoDriverException- If an ontology access error occurs.
-
isOpen
public boolean isOpen()Description copied from interface:CloseableRetrieves status of this resource. -
reload
Description copied from interface:ReloadableDataSourceReloads 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:
reloadin interfaceReloadableDataSource- Throws:
JenaDriverException
-
setDataset
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
-