org.openrdf.sail.inferencer.helpers
Class PreconditionInferencerConnection

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

public class PreconditionInferencerConnection
extends PreconditionSailConnection
implements InferencerConnection

Extension of PreconditionSailConnection that adds inferencer supoprt.

Author:
Arjohn Kampman

Field Summary
 
Fields inherited from class org.openrdf.sail.helpers.PreconditionSailConnection
logger
 
Constructor Summary
PreconditionInferencerConnection(InferencerConnection con)
           
 
Method Summary
 void addConnectionListener(SailConnectionListener listener)
          Registers a SailConnection listener with this SailConnection.
 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.
 void removeConnectionListener(SailConnectionListener listener)
          Deregisters a SailConnection listener with this SailConnection.
 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.PreconditionSailConnection
addStatement, begin, clearNamespaces, close, commit, evaluate, getContextIDs, getNamespace, getNamespaces, getStatements, removeNamespace, removeStatements, rollback, setNamespace, setReadOnly, size, verifyIsOpen, verifyNotReadOnly, verifyNotTxnActive, verifyTxnActive
 
Methods inherited from class org.openrdf.sail.helpers.SailConnectionWrapper
getTransactionIsolation, getValueFactory, isAutoCommit, isOpen, isReadOnly, setTransactionIsolation
 
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.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

PreconditionInferencerConnection

public PreconditionInferencerConnection(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 SailConnectionWrapper
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.

addConnectionListener

public void addConnectionListener(SailConnectionListener listener)
Description copied from interface: NotifyingSailConnection
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.

Specified by:
addConnectionListener in interface NotifyingSailConnection
Parameters:
listener - A SailConnectionListener.

removeConnectionListener

public void removeConnectionListener(SailConnectionListener listener)
Description copied from interface: NotifyingSailConnection
Deregisters a SailConnection listener with this SailConnection.

Specified by:
removeConnectionListener in interface NotifyingSailConnection
Parameters:
listener - A SailConnectionListener.


Copyright © 2001-2009 Aduna. All Rights Reserved.