Class InferencerConnectionWrapper
- java.lang.Object
-
- org.eclipse.rdf4j.sail.helpers.SailConnectionWrapper
-
- org.eclipse.rdf4j.sail.helpers.NotifyingSailConnectionWrapper
-
- org.eclipse.rdf4j.sail.inferencer.InferencerConnectionWrapper
-
- All Implemented Interfaces:
AutoCloseable,FederatedServiceResolverClient,ThreadSafetyAware,InferencerConnection,NotifyingSailConnection,SailConnection
public class InferencerConnectionWrapper extends NotifyingSailConnectionWrapper implements InferencerConnection
An extension of ConnectionWrapper that implements theInferencerConnectioninterface.- Author:
- Arjohn Kampman
-
-
Constructor Summary
Constructors Constructor Description InferencerConnectionWrapper(InferencerConnection con)Creates a new InferencerConnectionWrapper object that wraps the supplied transaction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddInferredStatement(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource... contexts)Adds an inferred statement to a specific context.voidclearInferred(org.eclipse.rdf4j.model.Resource... contexts)Removes all inferred statements from the specified/all contexts.voidcommit()CallsflushUpdates()before forwarding the call to the wrapped connection.org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends BindingSet,QueryEvaluationException>evaluate(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred)CallsflushUpdates()before forwarding the call to the wrapped connection.voidflush()voidflushUpdates()Flushes any pending updates to be processed and the resulting changes to be reported to registeredSailConnectionListeners.org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends org.eclipse.rdf4j.model.Resource,SailException>getContextIDs()CallsflushUpdates()before forwarding the call to the wrapped connection.org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends org.eclipse.rdf4j.model.Statement,SailException>getStatements(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, boolean includeInferred, org.eclipse.rdf4j.model.Resource... contexts)CallsflushUpdates()before forwarding the call to the wrapped connection.InferencerConnectiongetWrappedConnection()Gets the connection that is wrapped by this object.booleanhasStatement(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, boolean includeInferred, org.eclipse.rdf4j.model.Resource... contexts)voidprepare()CallsflushUpdates()before forwarding the call to the wrapped connection.booleanremoveInferredStatement(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource... contexts)Removes an inferred statement from a specific context.longsize(org.eclipse.rdf4j.model.Resource... contexts)CallsflushUpdates()before forwarding the call to the wrapped connection.-
Methods inherited from class org.eclipse.rdf4j.sail.helpers.NotifyingSailConnectionWrapper
addConnectionListener, removeConnectionListener
-
Methods inherited from class org.eclipse.rdf4j.sail.helpers.SailConnectionWrapper
addStatement, addStatement, begin, begin, clear, clearNamespaces, close, endUpdate, explain, getFederatedServiceResolver, getNamespace, getNamespaces, isActive, isOpen, pendingRemovals, prepareQuery, removeNamespace, removeStatement, removeStatements, rollback, setFederatedServiceResolver, setNamespace, setTransactionSettings, size, startUpdate, supportsConcurrentReads
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.sail.NotifyingSailConnection
addConnectionListener, removeConnectionListener
-
Methods inherited from interface org.eclipse.rdf4j.sail.SailConnection
addStatement, addStatement, begin, begin, clear, clearNamespaces, close, endUpdate, explain, getNamespace, getNamespaces, isActive, isOpen, pendingRemovals, prepareQuery, removeNamespace, removeStatement, removeStatements, rollback, setNamespace, setTransactionSettings, startUpdate
-
-
-
-
Constructor Detail
-
InferencerConnectionWrapper
public InferencerConnectionWrapper(InferencerConnection con)
Creates a new InferencerConnectionWrapper object that wraps the supplied transaction.
-
-
Method Detail
-
getWrappedConnection
public InferencerConnection getWrappedConnection()
Gets the connection that is wrapped by this object.- Overrides:
getWrappedConnectionin classNotifyingSailConnectionWrapper- Returns:
- The connection that was supplied to the constructor of this class.
-
addInferredStatement
public boolean addInferredStatement(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource... contexts) throws SailExceptionDescription copied from interface:InferencerConnectionAdds an inferred statement to a specific context.- Specified by:
addInferredStatementin interfaceInferencerConnection- Parameters:
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.- Throws:
SailException- If the statement could not be added.
-
removeInferredStatement
public boolean removeInferredStatement(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource... contexts) throws SailExceptionDescription copied from interface:InferencerConnectionRemoves an inferred statement from a specific context.- Specified by:
removeInferredStatementin interfaceInferencerConnection- Parameters:
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.- Throws:
SailException- If the statement could not be removed.
-
clearInferred
public void clearInferred(org.eclipse.rdf4j.model.Resource... contexts) throws SailExceptionDescription copied from interface:InferencerConnectionRemoves all inferred statements from the specified/all contexts. If no contexts are specified the method operates on the entire repository.- Specified by:
clearInferredin interfaceInferencerConnection- Parameters:
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.- Throws:
SailException- If the statements could not be removed.
-
flush
public void flush() throws SailException- Specified by:
flushin interfaceSailConnection- Overrides:
flushin classSailConnectionWrapper- Throws:
SailException
-
flushUpdates
public void flushUpdates() throws SailExceptionDescription copied from interface:InferencerConnectionFlushes any pending updates to be processed and the resulting changes to be reported to registeredSailConnectionListeners.- Specified by:
flushUpdatesin interfaceInferencerConnection- Throws:
SailException- If the updates could not be processed.
-
prepare
public void prepare() throws SailExceptionCallsflushUpdates()before forwarding the call to the wrapped connection.- Specified by:
preparein interfaceSailConnection- Overrides:
preparein classSailConnectionWrapper- Throws:
SailException
-
commit
public void commit() throws SailExceptionCallsflushUpdates()before forwarding the call to the wrapped connection.- Specified by:
commitin interfaceSailConnection- Overrides:
commitin classSailConnectionWrapper- Throws:
SailException
-
evaluate
public org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends BindingSet,QueryEvaluationException> evaluate(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred) throws SailException
CallsflushUpdates()before forwarding the call to the wrapped connection.- Specified by:
evaluatein interfaceSailConnection- Overrides:
evaluatein classSailConnectionWrapper- Throws:
SailException
-
getContextIDs
public org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends org.eclipse.rdf4j.model.Resource,SailException> getContextIDs() throws SailException
CallsflushUpdates()before forwarding the call to the wrapped connection.- Specified by:
getContextIDsin interfaceSailConnection- Overrides:
getContextIDsin classSailConnectionWrapper- Throws:
SailException
-
hasStatement
public boolean hasStatement(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, boolean includeInferred, org.eclipse.rdf4j.model.Resource... contexts) throws SailException- Specified by:
hasStatementin interfaceSailConnection- Overrides:
hasStatementin classSailConnectionWrapper- Throws:
SailException
-
getStatements
public org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends org.eclipse.rdf4j.model.Statement,SailException> getStatements(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, boolean includeInferred, org.eclipse.rdf4j.model.Resource... contexts) throws SailException
CallsflushUpdates()before forwarding the call to the wrapped connection.- Specified by:
getStatementsin interfaceSailConnection- Overrides:
getStatementsin classSailConnectionWrapper- Throws:
SailException
-
size
public long size(org.eclipse.rdf4j.model.Resource... contexts) throws SailExceptionCallsflushUpdates()before forwarding the call to the wrapped connection.- Specified by:
sizein interfaceSailConnection- Overrides:
sizein classSailConnectionWrapper- Throws:
SailException
-
-