Interface NotifyingSailConnection
- All Superinterfaces:
AutoCloseable, SailConnection
- All Known Subinterfaces:
InferencerConnection
- All Known Implementing Classes:
AbstractForwardChainingInferencerConnection, AbstractNotifyingSailConnection, DedupingInferencerConnection, ElasticsearchStoreConnection, ExtensibleStoreConnection, InferencerConnectionWrapper, LmdbStoreConnection, LuceneSailConnection, MemoryStoreConnection, NativeStoreConnection, NotifyingSailConnectionWrapper, SailSourceConnection, SchemaCachingRDFSInferencerConnection, ShaclSailConnection
A connection to an RDF Sail object. A SailConnection is active from the moment it is created until it is closed. Care
should be taken to properly close SailConnections as they might block concurrent queries and/or updates on the Sail
while active, depending on the Sail-implementation that is being used.
- Author:
- James Leigh
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnectionListener(SailConnectionListener listener) Registers a SailConnection listener with this SailConnection.voidDeregisters a SailConnection listener with this SailConnection.Methods inherited from interface SailConnection
addStatement, addStatement, begin, begin, clear, clearNamespaces, close, commit, endUpdate, evaluate, explain, flush, getComparator, getContextIDs, getNamespace, getNamespaces, getStatements, getStatements, getSupportedOrders, hasStatement, isActive, isOpen, prepare, prepareQuery, removeNamespace, removeStatement, removeStatements, rollback, setNamespace, setTransactionSettings, size, startUpdateModifier and TypeMethodDescriptionvoidaddStatement(Resource subj, IRI pred, Value obj, Resource... contexts) Adds a statement to the store.voidaddStatement(UpdateContext op, Resource subj, IRI pred, Value obj, Resource... contexts) Adds a statement to the store.voidbegin()Begins a transaction requiringSailConnection.commit()orSailConnection.rollback()to be called to close the transaction.voidbegin(IsolationLevel level) Begins a transaction with the specifiedIsolationLevellevel, requiringSailConnection.commit()orSailConnection.rollback()to be called to close the transaction.voidRemoves all statements from the specified/all contexts.voidRemoves all namespace declarations from the repository.voidclose()Closes the connection.voidcommit()Commits any updates that have been performed since the last timeSailConnection.commit()orSailConnection.rollback()was called.voidIndicates that the givenopwill not be used in any call again.CloseableIteration<? extends BindingSet> evaluate(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred) Evaluates the supplied TupleExpr on the data contained in this Sail object, using the (optional) dataset and supplied bindings as input parameters.default Explanationexplain(Explanation.Level level, TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred, int timeoutSeconds) Explain how the TupleExpr will be (or has been) executed/evaluated by returning a TupleExpr (which may or may not be the provided TupleExpr) that has gone through zero or more of the stages prior to and also including execution as specified by the provided level.voidflush()Flushes any pending updates and notify changes to listeners as appropriate.default Comparator<Value> Different underlying datastructures may have different ways of ordering statements.CloseableIteration<? extends Resource> Returns the set of all unique context identifiers that are used to store statements.getNamespace(String prefix) Gets the namespace that is associated with the specified prefix, if any.CloseableIteration<? extends Namespace> Gets the namespaces relevant to the data contained in this Sail object.default CloseableIteration<? extends Statement> getStatements(StatementOrder statementOrder, Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) Gets all statements from the specified contexts that have a specific subject, predicate and/or object.CloseableIteration<? extends Statement> getStatements(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) Gets all statements from the specified contexts that have a specific subject, predicate and/or object.default Set<StatementOrder> getSupportedOrders(Resource subj, IRI pred, Value obj, Resource... contexts) The underlying store may support some, but not all, statement orders based on the statement pattern.default booleanhasStatement(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) Determines if the store contains any statements from the specified contexts that have a specific subject, predicate and/or object.booleanisActive()Indicates if a transaction is currently active on the connection.booleanisOpen()Checks whether this SailConnection is open.voidprepare()Checks for an error state in the active transaction that would force the transaction to be rolled back.prepareQuery(QueryLanguage ql, Query.QueryType type, String query, String baseURI) Allows the SailConnection to bypass the standard query parser and provide its own internalTupleExprimplementation.voidremoveNamespace(String prefix) Removes a namespace declaration by removing the association between a prefix and a namespace name.voidremoveStatement(UpdateContext op, Resource subj, IRI pred, Value obj, Resource... contexts) Removes all statements matching the specified subject, predicate and object from the repository.voidremoveStatements(Resource subj, IRI pred, Value obj, Resource... contexts) Removes all statements matching the specified subject, predicate and object from the repository.voidrollback()Rolls back the transaction, discarding any uncommitted changes that have been made in this SailConnection.voidsetNamespace(String prefix, String name) Sets the prefix for a namespace.default voidsetTransactionSettings(TransactionSetting... settings) Pass any transaction-specific settings to the SailConnection.longReturns the number of (explicit) statements in the store, or in specific contexts.voidSignals the start of an update operation.
-
Method Details
-
addConnectionListener
Registers a SailConnection listener with this SailConnection. The listener should be notified of any statements that are added or removed as part of this SailConnection.- Parameters:
listener- A SailConnectionListener.
-
removeConnectionListener
Deregisters a SailConnection listener with this SailConnection.- Parameters:
listener- A SailConnectionListener.
-