public class SailRepository extends RepositoryBase
Repository
interface that operates on a
(stack of) Sail
object(s). The behaviour of the repository is
determined by the Sail stack that it operates on; for example, the repository
will only support RDF Schema or OWL semantics if the Sail stack includes an
inferencer for this.
Creating a repository object of this type is very easy. For example, the following code creates and initializes a main-memory store with RDF Schema semantics:
Repository repository = new RepositoryImpl(new ForwardChainingRDFSInferencer(new MemoryStore())); repository.initialize();Or, alternatively:
Sail sailStack = new MemoryStore(); sailStack = new ForwardChainingRDFSInferencer(sailStack); Repository repository = new Repository(sailStack); repository.initialize();
Constructor and Description |
---|
SailRepository(Sail sail)
Creates a new repository object that operates on the supplied Sail.
|
Modifier and Type | Method and Description |
---|---|
SailRepositoryConnection |
getConnection()
Opens a connection to this repository that can be used for querying and
updating the contents of the repository.
|
File |
getDataDir()
Get the directory where data and logging for this repository is stored.
|
Sail |
getSail()
Gets the Sail object that is on top of the Sail stack that this repository
operates on.
|
ValueFactory |
getValueFactory()
Gets a ValueFactory for this Repository.
|
protected void |
initializeInternal() |
boolean |
isWritable()
Checks whether this repository is writable, i.e.
|
void |
setDataDir(File dataDir)
Set the directory where data and logging for this repository is stored.
|
protected void |
shutDownInternal() |
String |
toString() |
initialize, isInitialized, shutDown
public SailRepository(Sail sail)
sail
- A Sail object.public File getDataDir()
Repository
public void setDataDir(File dataDir)
Repository
dataDir
- the directory where data for this repository is storedprotected void initializeInternal() throws RepositoryException
initializeInternal
in class RepositoryBase
RepositoryException
protected void shutDownInternal() throws RepositoryException
shutDownInternal
in class RepositoryBase
RepositoryException
public Sail getSail()
public boolean isWritable() throws RepositoryException
Repository
RepositoryException
public ValueFactory getValueFactory()
Repository
public SailRepositoryConnection getConnection() throws RepositoryException
Repository
Connection con = repository.getConnection(); try { // perform operations on the connection } finally { con.close(); }
RepositoryException
- If something went wrong during the creation of the Connection.Copyright © 2001-2013 Aduna. All Rights Reserved.