Class ContextAwareRepository
java.lang.Object
org.eclipse.rdf4j.repository.base.RepositoryWrapper
org.eclipse.rdf4j.repository.contextaware.ContextAwareRepository
- All Implemented Interfaces:
DelegatingRepository
,Repository
Allows contexts to be specified at the repository level.
- Author:
- James Leigh
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIRI[]
Deprecated.IRI[]
Deprecated.Opens a connection to this repository that can be used for querying and updating the contents of the repository.int
IRI[]
IRI[]
boolean
void
setAddContexts
(IRI... addContexts) Deprecated.void
setArchiveContexts
(IRI... archiveContexts) Deprecated.void
setBaseURI
(String baseURI) void
setIncludeInferred
(boolean includeInferred) void
setInsertContext
(IRI insertContext) void
setMaxQueryTime
(int maxQueryTime) void
void
setReadContexts
(IRI... readContexts) void
setRemoveContexts
(IRI... removeContexts) Methods inherited from class org.eclipse.rdf4j.repository.base.RepositoryWrapper
getDataDir, getDelegate, getValueFactory, init, isInitialized, isWritable, setDataDir, setDelegate, shutDown, toString
-
Constructor Details
-
ContextAwareRepository
public ContextAwareRepository() -
ContextAwareRepository
-
-
Method Details
-
getMaxQueryTime
public int getMaxQueryTime() -
setMaxQueryTime
public void setMaxQueryTime(int maxQueryTime) -
getAddContexts
Deprecated.- See Also:
-
getArchiveContexts
Deprecated.- See Also:
-
getInsertContext
- See Also:
-
getQueryLanguage
- See Also:
-
getBaseURI
- Returns:
- Returns the default baseURI.
-
getReadContexts
- See Also:
-
getRemoveContexts
- See Also:
-
isIncludeInferred
public boolean isIncludeInferred()- See Also:
-
setAddContexts
Deprecated.- See Also:
-
setArchiveContexts
Deprecated.- See Also:
-
setInsertContext
- See Also:
-
setIncludeInferred
public void setIncludeInferred(boolean includeInferred) - See Also:
-
setQueryLanguage
- See Also:
-
setBaseURI
- Parameters:
baseURI
- The default baseURI to set.
-
setReadContexts
- See Also:
-
setRemoveContexts
- See Also:
-
getConnection
Description copied from interface:Repository
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-with-resources block, as follows:try (RepositoryConnection conn = repository.getConnection()) { // perform operations on the connection }
Note that
RepositoryConnection
is not guaranteed to be thread-safe! The recommended pattern for repository access in a multi-threaded application is to share the Repository object between threads, but have each thread create and use its ownRepositoryConnection
s.- Specified by:
getConnection
in interfaceRepository
- Overrides:
getConnection
in classRepositoryWrapper
- Returns:
- A connection that allows operations on this repository.
- Throws:
RepositoryException
- If something went wrong during the creation of the Connection.
-