AGRepository (agraph-java-client 5.0.4-SNAPSHOT API)
Description: declaration: package: com.franz.agraph.repository, class: AGRepository

Package com.franz.agraph.repository

# Class AGRepository

java.lang.Object
org.eclipse.rdf4j.repository.base.AbstractRepository
com.franz.agraph.repository.AGRepository

All Implemented Interfaces:
  `AGAbstractRepository`, `Closeable`, `AutoCloseable`, `org.eclipse.rdf4j.repository.Repository`

public class AGRepository extends org.eclipse.rdf4j.repository.base.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 Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  Calls Sesame method `AbstractRepository.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.
  `AGRepositoryConnection`
  `getConnection(ScheduledExecutorService executor)`
  Create a connection to the repository.
  `File`
  `getDataDir()`
  Deprecated.
  not applicable to AllegroGraph
  `String`
  `getDuplicateSuppressionPolicy()`
  Returns the repository's duplicate suppression policy.
  `AGHTTPClient`
  `getHTTPClient()`
  `String`
  `getRepositoryID()`
  Gets the repository id for this repository.
  `String`
  `getRepositoryURL()`
  The AllegroGraph URL of this repository.
  `String`
  `getRepositoryURL(boolean includeAuth)`
  The AllegroGraph URL of this repository.
  `AGServer`
  `getServer()`
  Gets the server information object to which this repository belongs.
  `String`
  `getSpec()`
  `AGValueFactory`
  `getValueFactory()`
  `void`
  `initialize()`
  Deprecated.
  `boolean`
  `isBulkMode()`
  Returns the repository's bulkMode setting.
  `boolean`
  `isWritable()`
  Returns true iff this repository is writable.
  `AGRepositoryConfig`
  `repositoryConfig()`
  `void`
  `setBulkMode(boolean bulkMode)`
  Sets the repository's bulkMode (defaults to false).
  `void`
  `setConnPool(AGConnPool pool)`
  Sets the connection pool to use with this repository.
  `void`
  `setDataDir(File dataDir)`
  Deprecated.
  not applicable to AllegroGraph
  `void`
  `setDuplicateSuppressionPolicy(String policy)`
  Sets the repository's duplicate suppression policy.

  ### Methods inherited from class org.eclipse.rdf4j.repository.base.AbstractRepository

  `init, isInitialized, shutDown`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.eclipse.rdf4j.repository.Repository

  `init, isInitialized, shutDown`

- ## Constructor Details

  - ### 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)`.

    Parameters:
      `catalog` - the catalog in which to create the repository
      `repositoryID` - the name of the repository

- ## 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 `org.eclipse.rdf4j.repository.Repository`

  - ### getHTTPClient

    public AGHTTPClient getHTTPClient()
    Returns:
      `AGHTTPClient` The http connection to AllegroGraph server

  - ### getConnection

    public AGRepositoryConnection getConnection(ScheduledExecutorService executor) throws org.eclipse.rdf4j.repository.RepositoryException
    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:
      `org.eclipse.rdf4j.repository.RepositoryException`

  - ### getConnection

    public AGRepositoryConnection getConnection() throws org.eclipse.rdf4j.repository.RepositoryException
    Create a connection to the repository.
    Specified by:
      `getConnection` in interface `AGAbstractRepository`
    Specified by:
      `getConnection` in interface `org.eclipse.rdf4j.repository.Repository`
    Throws:
      `org.eclipse.rdf4j.repository.RepositoryException`

  - ### isWritable

    public boolean isWritable() throws org.eclipse.rdf4j.repository.RepositoryException
    Returns true iff this repository is writable.
    Specified by:
      `isWritable` in interface `org.eclipse.rdf4j.repository.Repository`
    Throws:
      `org.eclipse.rdf4j.repository.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 `org.eclipse.rdf4j.repository.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 `org.eclipse.rdf4j.repository.Repository`

  - ### close

    public void close() throws org.eclipse.rdf4j.repository.RepositoryException
    Calls Sesame method `AbstractRepository.shutDown()`.
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Throws:
      `org.eclipse.rdf4j.repository.RepositoryException`

  - ### isBulkMode

    public boolean isBulkMode() throws org.eclipse.rdf4j.repository.RepositoryException
    Returns the repository's bulkMode setting.
    Returns:
      Boolean a value indicating the bulkMode setting
    Throws:
      `org.eclipse.rdf4j.repository.RepositoryException` - if there is an error during the request
    See Also:
      - `setBulkMode(boolean)`

  - ### setBulkMode

    public void setBulkMode(boolean bulkMode) throws org.eclipse.rdf4j.repository.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:
      `org.eclipse.rdf4j.repository.RepositoryException` - if there is an error during the request
    See Also:
      - `isBulkMode()`

  - ### getDuplicateSuppressionPolicy

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

  - ### setDuplicateSuppressionPolicy

    public void setDuplicateSuppressionPolicy(String policy) throws org.eclipse.rdf4j.repository.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:
      `org.eclipse.rdf4j.repository.RepositoryException` - if there is an error during the request
    See Also:
      - `getDuplicateSuppressionPolicy()`

  - ### 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:
      - `AGConnPool`

  - ### forceCheckpoint

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

    This is an internal and undocumented function.

    Throws:
      `org.eclipse.rdf4j.repository.RepositoryException` - if there is an error during the request

  - ### ensureDBIdle

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

    This is an internal and undocumented function.

    Throws:
      `org.eclipse.rdf4j.repository.RepositoryException` - if there is an error during the request

  - ### repositoryConfig

    public AGRepositoryConfig repositoryConfig()

  - ### initialize

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