public class MemoryStoreConnection extends NotifyingSailConnectionBase implements InferencerConnection
Modifier and Type | Class and Description |
---|---|
protected class |
MemoryStoreConnection.MemEvaluationStatistics
Uses the MemoryStore's statement sizes to give cost estimates based on the
size of the expected results.
|
Modifier and Type | Field and Description |
---|---|
protected MemoryStore |
store |
connectionLock, logger, updateLock
Modifier | Constructor and Description |
---|---|
protected |
MemoryStoreConnection(MemoryStore store) |
Modifier and Type | Method and Description |
---|---|
boolean |
addInferredStatement(Resource subj,
URI pred,
Value obj,
Resource... contexts)
Adds an inferred statement to a specific context.
|
protected boolean |
addStatementInternal(Resource subj,
URI pred,
Value obj,
boolean explicit,
Resource... contexts)
Adds the specified statement to this MemoryStore.
|
protected void |
addStatementInternal(Resource subj,
URI pred,
Value obj,
Resource... contexts) |
void |
clearInferred(Resource... contexts)
Removes all inferred statements from the specified/all contexts.
|
protected void |
clearInternal(Resource... contexts) |
protected void |
clearNamespacesInternal() |
protected void |
closeInternal() |
protected void |
commitInternal() |
protected CloseableIteration<? extends BindingSet,QueryEvaluationException> |
evaluateInternal(TupleExpr tupleExpr,
Dataset dataset,
BindingSet bindings,
boolean includeInferred) |
void |
flushUpdates()
Flushes any pending updates to be processed and the resulting changes to
be reported to registered
SailConnectionListener s. |
protected CloseableIteration<? extends Resource,SailException> |
getContextIDsInternal() |
protected String |
getNamespaceInternal(String prefix) |
protected CloseableIteration<? extends Namespace,SailException> |
getNamespacesInternal() |
protected CloseableIteration<? extends Statement,SailException> |
getStatementsInternal(Resource subj,
URI pred,
Value obj,
boolean includeInferred,
Resource... contexts) |
boolean |
hasStatement(Resource subj,
URI pred,
Value obj,
boolean includeInferred,
Resource... contexts) |
boolean |
removeInferredStatement(Resource subj,
URI pred,
Value obj,
Resource... contexts)
Removes an inferred statement from a specific context.
|
protected boolean |
removeIteratorStatements(CloseableIteration<MemStatement,SailException> stIter,
boolean explicit) |
protected void |
removeNamespaceInternal(String prefix) |
protected boolean |
removeStatementsInternal(Resource subj,
URI pred,
Value obj,
boolean explicit,
Resource... contexts)
Removes the statements that match the specified pattern of subject,
predicate, object and context.
|
protected void |
removeStatementsInternal(Resource subj,
URI pred,
Value obj,
Resource... contexts) |
protected void |
rollbackInternal() |
protected void |
setNamespaceInternal(String prefix,
String name) |
protected long |
sizeInternal(Resource... contexts) |
protected void |
startTransactionInternal() |
addConnectionListener, hasConnectionListeners, notifyStatementAdded, notifyStatementRemoved, removeConnectionListener
addStatement, addStatement, autoStartTransaction, begin, clear, clearNamespaces, close, commit, endUpdate, evaluate, finalize, getContextIDs, getExclusiveConnectionLock, getNamespace, getNamespaces, getSharedConnectionLock, getStatements, getTransactionLock, isActive, isOpen, iterationClosed, prepare, registerIteration, removeNamespace, removeStatement, removeStatements, rollback, setNamespace, size, startUpdate, transactionActive, verifyIsActive, verifyIsOpen
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addConnectionListener, removeConnectionListener
addStatement, addStatement, begin, clear, clearNamespaces, close, commit, endUpdate, evaluate, getContextIDs, getNamespace, getNamespaces, getStatements, isActive, isOpen, prepare, removeNamespace, removeStatement, removeStatements, rollback, setNamespace, size, startUpdate
protected final MemoryStore store
protected MemoryStoreConnection(MemoryStore store)
protected CloseableIteration<? extends BindingSet,QueryEvaluationException> evaluateInternal(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred) throws SailException
evaluateInternal
in class SailConnectionBase
SailException
protected void closeInternal() throws SailException
closeInternal
in class SailConnectionBase
SailException
protected CloseableIteration<? extends Resource,SailException> getContextIDsInternal() throws SailException
getContextIDsInternal
in class SailConnectionBase
SailException
protected CloseableIteration<? extends Statement,SailException> getStatementsInternal(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws SailException
getStatementsInternal
in class SailConnectionBase
SailException
public boolean hasStatement(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws SailException
SailException
protected long sizeInternal(Resource... contexts) throws SailException
sizeInternal
in class SailConnectionBase
SailException
protected CloseableIteration<? extends Namespace,SailException> getNamespacesInternal() throws SailException
getNamespacesInternal
in class SailConnectionBase
SailException
protected String getNamespaceInternal(String prefix) throws SailException
getNamespaceInternal
in class SailConnectionBase
SailException
protected void startTransactionInternal() throws SailException
startTransactionInternal
in class SailConnectionBase
SailException
protected void commitInternal() throws SailException
commitInternal
in class SailConnectionBase
SailException
protected void rollbackInternal() throws SailException
rollbackInternal
in class SailConnectionBase
SailException
protected void addStatementInternal(Resource subj, URI pred, Value obj, Resource... contexts) throws SailException
addStatementInternal
in class SailConnectionBase
SailException
public boolean addInferredStatement(Resource subj, URI 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.protected boolean addStatementInternal(Resource subj, URI pred, Value obj, boolean explicit, Resource... contexts) throws SailException
SailException
protected void removeStatementsInternal(Resource subj, URI pred, Value obj, Resource... contexts) throws SailException
removeStatementsInternal
in class SailConnectionBase
SailException
public boolean removeInferredStatement(Resource subj, URI 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.protected void clearInternal(Resource... contexts) throws SailException
clearInternal
in class SailConnectionBase
SailException
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 flushUpdates()
InferencerConnection
SailConnectionListener
s.flushUpdates
in interface InferencerConnection
protected boolean removeStatementsInternal(Resource subj, URI pred, Value obj, boolean explicit, Resource... contexts) throws SailException
subj
- The subject for the pattern, or null for a wildcard.pred
- The predicate for the pattern, or null for a wildcard.obj
- The object for the pattern, or null for a wildcard.explicit
- Flag indicating whether explicit or inferred statements should be
removed; true removes explicit statements that match the
pattern, false removes inferred statements that match the
pattern.SailException
protected boolean removeIteratorStatements(CloseableIteration<MemStatement,SailException> stIter, boolean explicit) throws SailException
SailException
protected void setNamespaceInternal(String prefix, String name) throws SailException
setNamespaceInternal
in class SailConnectionBase
SailException
protected void removeNamespaceInternal(String prefix) throws SailException
removeNamespaceInternal
in class SailConnectionBase
SailException
protected void clearNamespacesInternal() throws SailException
clearNamespacesInternal
in class SailConnectionBase
SailException
Copyright © 2001-2013 Aduna. All Rights Reserved.