org.openrdf.sail.inferencer.helpers
Class AutoCommitInferencerConnection

java.lang.Object
  extended by org.openrdf.sail.helpers.SailConnectionWrapper
      extended by org.openrdf.sail.helpers.AutoCommitSailConnection
          extended by org.openrdf.sail.helpers.AutoCommitNotifyingConnection
              extended by org.openrdf.sail.inferencer.helpers.AutoCommitInferencerConnection
All Implemented Interfaces:
InferencerConnection, NotifyingSailConnection, SailConnection

public class AutoCommitInferencerConnection
extends AutoCommitNotifyingConnection
implements InferencerConnection

Adds auto-commit functionality to sail connections by wrapping updates with calls to SailConnectionWrapper.begin() and SailConnectionWrapper.commit() when performed outside an explicit transactions.

Author:
James Leigh, Arjohn Kampman

Constructor Summary
AutoCommitInferencerConnection(InferencerConnection con)
           
 
Method Summary
 boolean addInferredStatement(Resource subj, URI pred, Value obj, Resource... contexts)
          Adds an inferred statement to a specific context.
 void flushUpdates()
          Flushes any pending updates to be processed and the resulting changes to be reported to registered SailConnectionListeners.
protected  InferencerConnection getDelegate()
          Gets the connection that is wrapped by this object.
 boolean removeInferredStatements(Resource subj, URI pred, Value obj, Resource... contexts)
          Removes an inferred statement from a specific context.
 
Methods inherited from class org.openrdf.sail.helpers.AutoCommitNotifyingConnection
addConnectionListener, removeConnectionListener
 
Methods inherited from class org.openrdf.sail.helpers.AutoCommitSailConnection
addStatement, clearNamespaces, removeNamespace, removeStatements, setNamespace
 
Methods inherited from class org.openrdf.sail.helpers.SailConnectionWrapper
begin, close, commit, evaluate, getContextIDs, getNamespace, getNamespaces, getStatements, getTransactionIsolation, getValueFactory, isAutoCommit, isOpen, isReadOnly, rollback, setReadOnly, setTransactionIsolation, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openrdf.sail.NotifyingSailConnection
addConnectionListener, removeConnectionListener
 
Methods inherited from interface org.openrdf.sail.SailConnection
addStatement, begin, clearNamespaces, close, commit, evaluate, getContextIDs, getNamespace, getNamespaces, getStatements, getTransactionIsolation, getValueFactory, isAutoCommit, isOpen, isReadOnly, removeNamespace, removeStatements, rollback, setNamespace, setReadOnly, setTransactionIsolation, size
 

Constructor Detail

AutoCommitInferencerConnection

public AutoCommitInferencerConnection(InferencerConnection con)
Method Detail

getDelegate

protected InferencerConnection getDelegate()
Description copied from class: SailConnectionWrapper
Gets the connection that is wrapped by this object.

Overrides:
getDelegate in class AutoCommitNotifyingConnection
Returns:
The SailConnection object that was supplied to the constructor of this class.

addInferredStatement

public boolean addInferredStatement(Resource subj,
                                    URI pred,
                                    Value obj,
                                    Resource... contexts)
                             throws StoreException
Description copied from interface: InferencerConnection
Adds an inferred statement to a specific context.

Specified by:
addInferredStatement in interface InferencerConnection
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:
StoreException - If the statement could not be added.

removeInferredStatements

public boolean removeInferredStatements(Resource subj,
                                        URI pred,
                                        Value obj,
                                        Resource... contexts)
                                 throws StoreException
Description copied from interface: InferencerConnection
Removes an inferred statement from a specific context.

Specified by:
removeInferredStatements in interface InferencerConnection
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:
StoreException - If the statement could not be removed.

flushUpdates

public void flushUpdates()
                  throws StoreException
Description copied from interface: InferencerConnection
Flushes any pending updates to be processed and the resulting changes to be reported to registered SailConnectionListeners.

Specified by:
flushUpdates in interface InferencerConnection
Throws:
StoreException - If the updates could not be processed.


Copyright © 2001-2009 Aduna. All Rights Reserved.