com.franz.ag.repository
Class AGRepository

java.lang.Object
  extended by com.franz.ag.repository.AGRepository
All Implemented Interfaces:
org.openrdf.repository.Repository

public class AGRepository
extends java.lang.Object
implements org.openrdf.repository.Repository

An implementation of the Repository interface that stores triples in an AllegroGraph triple store. The Java application communicates with the AllegroGraph server through a socket.


Nested Class Summary
static class AGRepository.V3_2Jan27
          The name of this class identifies the version of the AllegroGraph Java implementation.
 
Constructor Summary
AGRepository(AllegroGraph ts)
          Create a new Repository instance to access an AllegroGraph triple store.
 
Method Summary
 AllegroGraph getAllegroGraph()
           
 org.openrdf.repository.RepositoryConnection getConnection()
          Opens a connection to this repository that can be used for querying and updating the contents of the repository.
 java.io.File getDataDir()
           
 org.openrdf.model.ValueFactory getValueFactory()
           
 void initialize()
           
 boolean isWritable()
           
 void setBackgroundIndexing(boolean bi)
          Control the indexing mode of this access to the store.
 void setDataDir(java.io.File arg0)
           
 void setIndexAllOnCommit(boolean roc)
          Control the indexing strategy of this access to the store.
 void setReindexOnCommit(boolean roc)
          Specify whether indexing should be done at each commit.
 void shutDown()
           
static java.lang.String version()
          Query the current AGRepository version.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AGRepository

public AGRepository(AllegroGraph ts)
Create a new Repository instance to access an AllegroGraph triple store.

Parameters:
ts - An AllegroGraph instance created by the application. The application code is responsible for closing the store instance and disconnecting from the server.
Method Detail

version

public static java.lang.String version()
Query the current AGRepository version.

Returns:
a version string.

setReindexOnCommit

public void setReindexOnCommit(boolean roc)
Specify whether indexing should be done at each commit.

Parameters:
roc - When true, index the triples added up to the commit call.

setIndexAllOnCommit

public void setIndexAllOnCommit(boolean roc)
Control the indexing strategy of this access to the store.

Parameters:
roc - When true, reindex the entire store at each commit. Otherwise, index only the new triples.

setBackgroundIndexing

public void setBackgroundIndexing(boolean bi)
Control the indexing mode of this access to the store.

Parameters:
bi - When true, index triples asynchronously.

getAllegroGraph

public AllegroGraph getAllegroGraph()

getConnection

public org.openrdf.repository.RepositoryConnection getConnection()
                                                          throws org.openrdf.repository.RepositoryException
Opens a connection to this repository that can be used for querying and updating the contents of the repository. Created connections need to be closed to make sure that any resources they keep hold of are released. The best way to do this is to use a try-finally-block as follows:

 RepositoryConnection con = repository.getConnection();
 try {
        // perform operations on the connection
 }
 finally {
        con.close();
 }
 

Specified by:
getConnection in interface org.openrdf.repository.Repository
Returns:
A connection that allows operations on this repository. Only one connection instance is created for each Repository instance.
Throws:
org.openrdf.repository.RepositoryException - - If something went wrong during the creation of the Connection.

getDataDir

public java.io.File getDataDir()
Specified by:
getDataDir in interface org.openrdf.repository.Repository

getValueFactory

public org.openrdf.model.ValueFactory getValueFactory()
Specified by:
getValueFactory in interface org.openrdf.repository.Repository

initialize

public void initialize()
                throws org.openrdf.repository.RepositoryException
Specified by:
initialize in interface org.openrdf.repository.Repository
Throws:
org.openrdf.repository.RepositoryException

isWritable

public boolean isWritable()
                   throws org.openrdf.repository.RepositoryException
Specified by:
isWritable in interface org.openrdf.repository.Repository
Throws:
org.openrdf.repository.RepositoryException

setDataDir

public void setDataDir(java.io.File arg0)
Specified by:
setDataDir in interface org.openrdf.repository.Repository

shutDown

public void shutDown()
              throws org.openrdf.repository.RepositoryException
Specified by:
shutDown in interface org.openrdf.repository.Repository
Throws:
org.openrdf.repository.RepositoryException