Class AGRepository

All Implemented Interfaces:
AGAbstractRepository, Closeable, AutoCloseable, Repository

public class AGRepository extends AbstractRepository implements AGAbstractRepository
Implements the RDF4J Repository interface for AllegroGraph, representing triple-stores on the server. In AllegroGraph, an AGCatalog contains multiple repositories. With the RDF4J API, most data operations on a repository are done through the AGRepositoryConnection returned by getConnection().
  • Constructor Details

  • Method Details

    • getServer

      public AGServer getServer()
      Gets the server information object to which this repository belongs.
      Specified by:
      getServer in interface AGAbstractRepository
      Returns:
      the AGServer object
    • 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(boolean includeAuth)
      The AllegroGraph URL of this repository.
      Parameters:
      includeAuth - boolean indicating whether or not to include auth (user:password) in the returned URL.
      Returns:
      the URL of this repository
    • 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 AGHTTPClient getHTTPClient()
      Returns:
      AGHTTPClient The http connection to AllegroGraph server
    • getConnection

      Create a connection to the repository.
      Specified by:
      getConnection in interface AGAbstractRepository
      Parameters:
      executor - Executor service used to schedule maintenance tasks, such as calling ping() periodically. Set to null to disable such tasks. Call getConnection() to use the default executor specified by the server object. This argument is ignored if connection pooling is used
      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

      @Deprecated public File getDataDir()
      Deprecated.
      not applicable to AllegroGraph
      The dataDir is not currently applicable to AllegroGraph.
      Specified by:
      getDataDir in interface Repository
    • setDataDir

      @Deprecated public void setDataDir(File dataDir)
      Deprecated.
      not applicable to AllegroGraph
      The dataDir is not currently applicable to AllegroGraph.
      Specified by:
      setDataDir in interface Repository
    • close

      public void close() throws RepositoryException
      Calls Sesame method AbstractRepository.shutDown().
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      RepositoryException
    • isBulkMode

      public boolean isBulkMode() throws RepositoryException
      Returns the repository's bulkMode setting.
      Returns:
      Boolean a value indicating the bulkMode setting
      Throws:
      RepositoryException - if there is an error during the request
      See Also:
    • 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.

      Parameters:
      bulkMode - boolean indicating the intended bulkMode
      Throws:
      RepositoryException - if there is an error during the request
      See Also:
    • getDuplicateSuppressionPolicy

      public String getDuplicateSuppressionPolicy() throws RepositoryException
      Returns the repository's duplicate suppression policy.
      Returns:
      the policy name
      Throws:
      RepositoryException - if there is an error during the request
      See Also:
    • setDuplicateSuppressionPolicy

      public void setDuplicateSuppressionPolicy(String policy) throws RepositoryException
      Sets the repository's duplicate suppression policy.

      This determines how/whether duplicates will be automatically removed at commit time.

      Legal policy names are "false" (turns automatic suppression off), "spo" (removes statements with the same s, p, and o), and "spog" (compares s, p, o, and g).

      For on-demand duplicate deletion, see AGRepositoryConnection.deleteDuplicates(String).

      See also the protocol documentation for suppressing duplicates.

      Parameters:
      policy - name of the suppression policy to use
      Throws:
      RepositoryException - if there is an error during the request
      See Also:
    • setConnPool

      public void setConnPool(AGConnPool pool)
      Sets the connection pool to use with this repository.

      Enables the repository to use a connection pool so that Sesame apps can transparently benefit from connection pooling. If pool is not null, getConnection() borrows a connection from the pool, and closing the connection returns it to the pool. The pool is closed when the Repository is shutdown.

      
       Note that the AGConnPool parameters:
      
               AGConnProp.serverUrl, "http://localhost:10035",
               AGConnProp.username, "test",
               AGConnProp.password, "xyzzy",
               AGConnProp.catalog, "/",
               AGConnProp.repository, "my_repo",
      
       are currently assumed to match those of this repository.
       
      Parameters:
      pool - the pool to use with this repository
      See Also:
    • forceCheckpoint

      public void forceCheckpoint() throws RepositoryException
      Forces a checkpoint for this repository.

      This is an internal and undocumented function.

      Throws:
      RepositoryException - if there is an error during the request
    • ensureDBIdle

      public void ensureDBIdle() throws RepositoryException
      Waits until background db processes have gone idle.

      This is an internal and undocumented function.

      Throws:
      RepositoryException - if there is an error during the request
    • repositoryConfig

      public AGRepositoryConfig repositoryConfig()
    • initialize

      @Deprecated public void initialize()
      Deprecated.
      * @deprecated Use AbstractRepository.init() instead.