Class AGRepository
- All Implemented Interfaces:
AGAbstractRepository
,Closeable
,AutoCloseable
,Repository
AGCatalog
contains multiple repositories.
With the RDF4J API, most data operations on a repository are done through
the AGRepositoryConnection
returned by getConnection()
.-
Constructor Summary
ConstructorDescriptionAGRepository
(AGCatalog catalog, String repositoryID) Creates an AGRepository instance for a repository having the given repository id in the given catalog. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Calls Sesame methodAbstractRepository.shutDown()
.void
Waits until background db processes have gone idle.void
Forces a checkpoint for this repository.Gets the catalog to which this repository belongs.Create a connection to the repository.getConnection
(ScheduledExecutorService executor) Create a connection to the repository.Deprecated.not applicable to AllegroGraphReturns the repository's duplicate suppression policy.Gets the repository id for this repository.The AllegroGraph URL of this repository.getRepositoryURL
(boolean includeAuth) The AllegroGraph URL of this repository.Gets the server information object to which this repository belongs.getSpec()
void
Deprecated.boolean
Returns the repository's bulkMode setting.boolean
Returns true iff this repository is writable.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 AllegroGraphvoid
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
Creates an AGRepository instance for a repository having the given repository id in the given catalog.Preferred access is from
AGCatalog
methods such asAGCatalog.createRepository(String, boolean)
orAGCatalog.openRepository(String)
.- Parameters:
catalog
- the catalog in which to create the repositoryrepositoryID
- the name of the repository
-
-
Method Details
-
getServer
Gets the server information object to which this repository belongs.- Specified by:
getServer
in interfaceAGAbstractRepository
- Returns:
- the AGServer object
-
getCatalog
Gets the catalog to which this repository belongs.- Specified by:
getCatalog
in interfaceAGAbstractRepository
- Returns:
- the catalog
-
getRepositoryID
Gets the repository id for this repository.- Returns:
- the repository id
-
getCatalogPrefixedRepositoryID
-
getRepositoryURL
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
The AllegroGraph URL of this repository.- Returns:
- the URL of this repository
-
getValueFactory
- Specified by:
getValueFactory
in interfaceAGAbstractRepository
- Specified by:
getValueFactory
in interfaceRepository
-
getHTTPClient
- Returns:
AGHTTPClient
The http connection to AllegroGraph server
-
getConnection
public AGRepositoryConnection getConnection(ScheduledExecutorService executor) throws RepositoryException Create a connection to the repository.- Specified by:
getConnection
in interfaceAGAbstractRepository
- Parameters:
executor
- Executor service used to schedule maintenance tasks, such as calling ping() periodically. Set to null to disable such tasks. CallgetConnection()
to use the default executor specified by the server object. This argument is ignored if connection pooling is used- Throws:
RepositoryException
-
getConnection
Create a connection to the repository.- Specified by:
getConnection
in interfaceAGAbstractRepository
- Specified by:
getConnection
in interfaceRepository
- Throws:
RepositoryException
-
isWritable
Returns true iff this repository is writable.- Specified by:
isWritable
in interfaceRepository
- Throws:
RepositoryException
-
getSpec
- Specified by:
getSpec
in interfaceAGAbstractRepository
-
getDataDir
Deprecated.not applicable to AllegroGraphThe dataDir is not currently applicable to AllegroGraph.- Specified by:
getDataDir
in interfaceRepository
-
setDataDir
Deprecated.not applicable to AllegroGraphThe dataDir is not currently applicable to AllegroGraph.- Specified by:
setDataDir
in interfaceRepository
-
close
Calls Sesame methodAbstractRepository.shutDown()
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
RepositoryException
-
isBulkMode
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
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
Returns the repository's duplicate suppression policy.- Returns:
- the policy name
- Throws:
RepositoryException
- if there is an error during the request- See Also:
-
setDuplicateSuppressionPolicy
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
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
Forces a checkpoint for this repository.This is an internal and undocumented function.
- Throws:
RepositoryException
- if there is an error during the request
-
ensureDBIdle
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
-
initialize
Deprecated.* @deprecated UseAbstractRepository.init()
instead.
-