Franz Inc, AllegroGraph

com.franz.agraph.repository
Class AGRepository

java.lang.Object
  extended by com.franz.agraph.repository.AGRepository
All Implemented Interfaces:
AGAbstractRepository, Closeable, Repository

public class AGRepository
extends Object
implements AGAbstractRepository, Closeable

Implements the Sesame Repository interface for AllegroGraph, representing triple-stores on the server. In AllegroGraph, a AGCatalog contains multiple repositories. With the Sesame API, most data operations on a repository are done through the AGRepositoryConnection returned by getConnection().


Constructor Summary
AGRepository(AGCatalog catalog, String repositoryID)
          Creates an AGRepository instance for a repository having the given repository id in the given catalog.
 
Method Summary
 void close()
          Calls Sesame method shutDown().
 void ensureDBIdle()
          Waits until background db processes have gone idle.
 void forceCheckpoint()
          Forces a checkpoint for this repository.
 AGCatalog getCatalog()
          Gets the catalog to which this repository belongs.
 String getCatalogPrefixedRepositoryID()
           
 AGRepositoryConnection getConnection()
          Create a connection to the repository.
 File getDataDir()
          Deprecated. not applicable to AllegroGraph
 String getDeleteDuplicatesMode()
          Returns the repository's deleteDuplicates mode.
 com.franz.agraph.http.AGHTTPClient getHTTPClient()
          The http connection to AllegroGraph server.
 String getRepositoryID()
          Gets the repository id for this repository.
 String getRepositoryURL()
          The AllegroGraph URL of this repository.
 String getSpec()
           
 AGValueFactory getValueFactory()
           
 void initialize()
          Required by OpenRDF/Sesame, a repository must be initialized before use.
 boolean isBulkMode()
          Returns the repository's bulkMode setting.
 boolean isWritable()
          Returns true iff this repository is writable.
 void setBulkMode(boolean bulkMode)
          Sets the repository's bulkMode (defaults to false).
 void setDataDir(File dataDir)
          Deprecated. not applicable to AllegroGraph
 void setDeleteDuplicatesMode(String mode)
          Sets the repository's deleteDuplicates mode (defaults to "false").
 void shutDown()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AGRepository

public AGRepository(AGCatalog catalog,
                    String repositoryID)
Creates an AGRepository instance for a repository having the given repository id in the given catalog.

Preferred access is from AGCatalog methods such as AGCatalog.createRepository(String, boolean) or AGCatalog.openRepository(String).

Method Detail

getCatalog

public AGCatalog getCatalog()
Gets the catalog to which this repository belongs.

Specified by:
getCatalog in interface AGAbstractRepository
Returns:
the catalog.

getRepositoryID

public String getRepositoryID()
Gets the repository id for this repository.

Returns:
the repository id.

getCatalogPrefixedRepositoryID

public String getCatalogPrefixedRepositoryID()

getRepositoryURL

public String getRepositoryURL()
The AllegroGraph URL of this repository.

Returns:
the URL of this repository.

getValueFactory

public AGValueFactory getValueFactory()
Specified by:
getValueFactory in interface AGAbstractRepository
Specified by:
getValueFactory in interface Repository

getHTTPClient

public com.franz.agraph.http.AGHTTPClient getHTTPClient()
The http connection to AllegroGraph server.


initialize

public void initialize()
                throws RepositoryException
Required by OpenRDF/Sesame, a repository must be initialized before use.

Specified by:
initialize in interface Repository
Throws:
RepositoryException

getConnection

public AGRepositoryConnection getConnection()
                                     throws RepositoryException
Create a connection to the repository.

Specified by:
getConnection in interface AGAbstractRepository
Specified by:
getConnection in interface Repository
Throws:
RepositoryException

isWritable

public boolean isWritable()
                   throws RepositoryException
Returns true iff this repository is writable.

Specified by:
isWritable in interface Repository
Throws:
RepositoryException

getSpec

public String getSpec()
Specified by:
getSpec in interface AGAbstractRepository

getDataDir

public File getDataDir()
Deprecated. not applicable to AllegroGraph

The dataDir is not currently applicable to AllegroGraph.

Specified by:
getDataDir in interface Repository

setDataDir

public void setDataDir(File dataDir)
Deprecated. not applicable to AllegroGraph

The dataDir is not currently applicable to AllegroGraph.

Specified by:
setDataDir in interface Repository

shutDown

public void shutDown()
              throws RepositoryException
Specified by:
shutDown in interface Repository
Throws:
RepositoryException

close

public void close()
           throws RepositoryException
Calls Sesame method shutDown().

Specified by:
close in interface Closeable
Throws:
RepositoryException
See Also:
Closeable.close()

setBulkMode

public void setBulkMode(boolean bulkMode)
                 throws RepositoryException
Sets the repository's bulkMode (defaults to false). When in bulkMode, data can be added/loaded more quickly, but there is no guarantee of durability in the event of a crash. The bulkMode setting persists when the repository is closed.

Throws:
RepositoryException
See Also:
isBulkMode()

isBulkMode

public boolean isBulkMode()
                   throws RepositoryException
Returns the repository's bulkMode setting.

Returns:
a boolean indicating the bulkMode setting.
Throws:
RepositoryException
See Also:
setBulkMode(boolean)

setDeleteDuplicatesMode

public void setDeleteDuplicatesMode(String mode)
                             throws RepositoryException
Sets the repository's deleteDuplicates mode (defaults to "false"). The deleteDuplicates mode must be one of: "false" (do not delete duplicates), "true" (delete duplicate quads), or "spo" (delete duplicate triples, ignoring graph).

Parameters:
mode - a String indicating the mode.
Throws:
RepositoryException
See Also:
getDeleteDuplicatesMode()

getDeleteDuplicatesMode

public String getDeleteDuplicatesMode()
                               throws RepositoryException
Returns the repository's deleteDuplicates mode.

Returns:
a String indicating the deleteDuplicates mode.
Throws:
RepositoryException
See Also:
setDeleteDuplicatesMode(String)

forceCheckpoint

public void forceCheckpoint()
                     throws RepositoryException
Forces a checkpoint for this repository. This is an internal and undocumented function.

Throws:
RepositoryException

ensureDBIdle

public void ensureDBIdle()
                  throws RepositoryException
Waits until background db processes have gone idle. This is an internal and undocumented function.

Throws:
RepositoryException

Copyright © 2008-2011 Franz Inc.