public class InferencerConnectionWrapper extends NotifyingSailConnectionWrapper implements InferencerConnection
InferencerConnection
interface.Constructor and Description |
---|
InferencerConnectionWrapper(InferencerConnection con)
Creates a new InferencerConnectionWrapper object that wraps the supplied transaction.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addInferredStatement(Resource subj,
IRI pred,
Value obj,
Resource... contexts)
Adds an inferred statement to a specific context.
|
void |
clearInferred(Resource... contexts)
Removes all inferred statements from the specified/all contexts.
|
void |
commit()
Calls
flushUpdates() before forwarding the call to the wrapped connection. |
CloseableIteration<? extends BindingSet,QueryEvaluationException> |
evaluate(TupleExpr tupleExpr,
Dataset dataset,
BindingSet bindings,
boolean includeInferred)
Calls
flushUpdates() before forwarding the call to the wrapped connection. |
void |
flush()
Flushes any pending updates and notify changes to listeners as appropriate.
|
void |
flushUpdates()
Flushes any pending updates to be processed and the resulting changes to be reported to registered
SailConnectionListener s. |
CloseableIteration<? extends Resource,SailException> |
getContextIDs()
Calls
flushUpdates() before forwarding the call to the wrapped connection. |
CloseableIteration<? extends Statement,SailException> |
getStatements(Resource subj,
IRI pred,
Value obj,
boolean includeInferred,
Resource... contexts)
Calls
flushUpdates() before forwarding the call to the wrapped connection. |
InferencerConnection |
getWrappedConnection()
Gets the connection that is wrapped by this object.
|
boolean |
hasStatement(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.
|
void |
prepare()
Calls
flushUpdates() before forwarding the call to the wrapped connection. |
boolean |
removeInferredStatement(Resource subj,
IRI pred,
Value obj,
Resource... contexts)
Removes an inferred statement from a specific context.
|
long |
size(Resource... contexts)
Calls
flushUpdates() before forwarding the call to the wrapped connection. |
addConnectionListener, removeConnectionListener
addStatement, addStatement, begin, begin, clear, clearNamespaces, close, endUpdate, explain, getNamespace, getNamespaces, isActive, isOpen, pendingRemovals, prepareQuery, removeNamespace, removeStatement, removeStatements, rollback, setFederatedServiceResolver, setNamespace, setTransactionSettings, size, startUpdate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addConnectionListener, removeConnectionListener
addStatement, addStatement, addStatement, addStatement, begin, begin, clear, clearNamespaces, close, endUpdate, explain, getNamespace, getNamespaces, getStatements, isActive, isOpen, pendingRemovals, prepareQuery, removeNamespace, removeStatement, removeStatement, removeStatements, removeStatements, rollback, setNamespace, setTransactionSettings, startUpdate
public InferencerConnectionWrapper(InferencerConnection con)
public InferencerConnection getWrappedConnection()
getWrappedConnection
in class NotifyingSailConnectionWrapper
public boolean addInferredStatement(Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException
InferencerConnection
addInferredStatement
in interface InferencerConnection
subj
- The subject of the statement to add.pred
- The predicate of the statement to add.obj
- The object of the statement to add.contexts
- The context(s) to add the statement to. Note that this parameter is a vararg and as such is
optional. If no contexts are supplied the method operates on the entire repository.SailException
- If the statement could not be added.public boolean removeInferredStatement(Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException
InferencerConnection
removeInferredStatement
in interface InferencerConnection
subj
- The subject of the statement that should be removed.pred
- The predicate of the statement that should be removed.obj
- The object of the statement that should be removed.contexts
- The context(s) from which to remove the statements. Note that this parameter is a vararg and as
such is optional. If no contexts are supplied the method operates on the entire repository.SailException
- If the statement could not be removed.public void clearInferred(Resource... contexts) throws SailException
InferencerConnection
clearInferred
in interface InferencerConnection
contexts
- The context(s) from which to remove the statements. Note that this parameter is a vararg and as
such is optional. If no contexts are supplied the method operates on the entire repository.SailException
- If the statements could not be removed.public void flush() throws SailException
SailConnection
SailConnection.prepare()
. This method may be called multiple times
within the same transaction.flush
in interface SailConnection
flush
in class SailConnectionWrapper
SailException
- If the updates could not be processed, for example because no transaction is
active.public void flushUpdates() throws SailException
InferencerConnection
SailConnectionListener
s.flushUpdates
in interface InferencerConnection
SailException
- If the updates could not be processed.public void prepare() throws SailException
flushUpdates()
before forwarding the call to the wrapped connection.prepare
in interface SailConnection
prepare
in class SailConnectionWrapper
UnknownSailTransactionStateException
- If the transaction state can not be determined (this can happen for
instance when communication between client and server fails or
times-out). It does not indicate a problem with the integrity of the
store.SailException
- If there is an active transaction and it cannot be committed.public void commit() throws SailException
flushUpdates()
before forwarding the call to the wrapped connection.commit
in interface SailConnection
commit
in class SailConnectionWrapper
UnknownSailTransactionStateException
- If the transaction state can not be determined (this can happen for
instance when communication between client and server fails or
times-out). It does not indicate a problem with the integrity of the
store.SailException
- If the SailConnection could not be committed.public CloseableIteration<? extends BindingSet,QueryEvaluationException> evaluate(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred) throws SailException
flushUpdates()
before forwarding the call to the wrapped connection.evaluate
in interface SailConnection
evaluate
in class SailConnectionWrapper
tupleExpr
- The tuple expression to evaluate.dataset
- The dataset to use for evaluating the query, null to use the Sail's default
dataset.bindings
- A set of input parameters for the query evaluation. The keys reference variable names that
should be bound to the value they map to.includeInferred
- Indicates whether inferred triples are to be considered in the query result. If false, no
inferred statements are returned; if true, inferred statements are returned if availableSailException
- If the Sail object encountered an error or unexpected situation internally.public CloseableIteration<? extends Resource,SailException> getContextIDs() throws SailException
flushUpdates()
before forwarding the call to the wrapped connection.getContextIDs
in interface SailConnection
getContextIDs
in class SailConnectionWrapper
SailException
public boolean hasStatement(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) throws SailException
SailConnection
hasStatement
in interface SailConnection
hasStatement
in class SailConnectionWrapper
subj
- A Resource specifying the subject, or null for a wildcard.pred
- An IRI specifying the predicate, or null for a wildcard.obj
- A Value specifying the object, or null for a wildcard.includeInferred
- if false, no inferred statements are returned; if true, inferred statements are returned
if availablecontexts
- The context(s) to get the data from. Note that this parameter is a vararg and as such is
optional. If no contexts are specified the method operates on the entire repository. A
null value can be used to match context-less statements.true
iff the store contains any statements matching the supplied criteria,
false
otherwise.SailException
- If the Sail object encountered an error or unexpected situation internally.public CloseableIteration<? extends Statement,SailException> getStatements(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) throws SailException
flushUpdates()
before forwarding the call to the wrapped connection.getStatements
in interface SailConnection
getStatements
in class SailConnectionWrapper
subj
- A Resource specifying the subject, or null for a wildcard.pred
- A URI specifying the predicate, or null for a wildcard.obj
- A Value specifying the object, or null for a wildcard.includeInferred
- if false, no inferred statements are returned; if true, inferred statements are returned
if availablecontexts
- The context(s) to get the data from. Note that this parameter is a vararg and as such is
optional. If no contexts are specified the method operates on the entire repository. A
null value can be used to match context-less statements.SailException
- If the Sail object encountered an error or unexpected situation internally.public long size(Resource... contexts) throws SailException
flushUpdates()
before forwarding the call to the wrapped connection.size
in interface SailConnection
size
in class SailConnectionWrapper
contexts
- The context(s) to determine the size of. Note that this parameter is a vararg and as such is
optional. If no contexts are specified the method operates on the entire repository. A
null value can be used to match context-less statements.SailException
Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.