public class FedXConnection extends AbstractSailConnection
FederationEvalStrategy to evaluate provided queries.
Prior to evaluation various optimizations are performed, see
FedXOptimizer for further details.
Since 4.0 FedX supports write operations using the supplied WriteStrategy, e.g. by writing to a designated
federation member. Note: the WriteStrategy is initialized lazily upon first access to a write operation, see
getWriteStrategyInternal().
Implementation notes: - not all methods are implemented as of now
FederationEvalStrategy,
WriteStrategy| Modifier and Type | Class and Description |
|---|---|
protected static class |
FedXConnection.SailBaseDefaultImpl
A default implementation for
AbstractSail. |
| Modifier and Type | Field and Description |
|---|---|
protected FedX |
federation |
protected FederationContext |
federationContext |
connectionLock, updateLock| Constructor and Description |
|---|
FedXConnection(FedX federation,
FederationContext federationContext) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addStatementInternal(Resource subj,
IRI pred,
Value obj,
Resource... contexts) |
protected void |
clearInternal(Resource... contexts) |
protected void |
clearNamespacesInternal() |
protected void |
closeInternal() |
protected void |
commitInternal() |
protected CloseableIteration<? extends BindingSet,QueryEvaluationException> |
evaluateInternal(TupleExpr query,
Dataset dataset,
BindingSet bindings,
boolean includeInferred) |
Explanation |
explain(Explanation.Level level,
TupleExpr tupleExpr,
Dataset dataset,
BindingSet bindings,
boolean includeInferred,
int timeoutSeconds)
Explain how the TupleExpr will be (or has been) executed/evaluated by returning a TupleExpr (which may or may not
be the provided TupleExpr) that has gone through zero or more of the stages prior to and also including execution
as specified by the provided level.
|
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,
IRI pred,
Value obj,
boolean includeInferred,
Resource... contexts) |
protected WriteStrategy |
getWriteStrategyInternal()
Return the initialized
writeStrategy. |
boolean |
pendingRemovals()
Indicates if the Sail has any statement removal operations pending (not yet
flushed) for the
current transaction. |
protected void |
removeNamespaceInternal(String prefix) |
protected void |
removeStatementsInternal(Resource subj,
IRI pred,
Value obj,
Resource... contexts) |
protected void |
rollbackInternal() |
protected void |
setNamespaceInternal(String prefix,
String name) |
void |
setTransactionSettings(TransactionSetting... settings)
Pass any transaction-specific settings to the SailConnection.
|
protected long |
sizeInternal(Resource... contexts) |
protected void |
startTransactionInternal() |
addStatement, addStatement, autoStartTransaction, begin, begin, clear, clearNamespaces, close, commit, endUpdate, endUpdateInternal, evaluate, flush, getContextIDs, getExclusiveConnectionLock, getNamespace, getNamespaces, getSharedConnectionLock, getStatements, getTransactionIsolation, getTransactionLock, isActive, isActiveOperation, isOpen, iterationClosed, pendingAdds, prepare, prepareInternal, registerIteration, removeNamespace, removeStatement, removeStatements, rollback, setNamespace, size, startUpdate, transactionActive, verifyIsActive, verifyIsOpenclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddStatement, addStatement, getStatements, hasStatement, prepareQuery, removeStatement, removeStatementsprotected final FedX federation
protected final FederationContext federationContext
public FedXConnection(FedX federation, FederationContext federationContext) throws SailException
SailExceptionpublic void setTransactionSettings(TransactionSetting... settings)
SailConnectionstarted .
Sail implementations can override this method to receive the transaction settings (to inspect and/or pass them
along to any wrapped sail objects). Remember to call super.setTransactionSettings(settings) if you
override this method.
settings - the transaction settings on which the next transaction operates. It may or may not contain the
isolation level.protected CloseableIteration<? extends BindingSet,QueryEvaluationException> evaluateInternal(TupleExpr query, Dataset dataset, BindingSet bindings, boolean includeInferred) throws SailException
evaluateInternal in class AbstractSailConnectionSailExceptionprotected void clearInternal(Resource... contexts) throws SailException
clearInternal in class AbstractSailConnectionSailExceptionprotected void clearNamespacesInternal()
throws SailException
clearNamespacesInternal in class AbstractSailConnectionSailExceptionprotected void closeInternal()
throws SailException
closeInternal in class AbstractSailConnectionSailExceptionprotected void commitInternal()
throws SailException
commitInternal in class AbstractSailConnectionSailExceptionprotected CloseableIteration<? extends Resource,SailException> getContextIDsInternal() throws SailException
getContextIDsInternal in class AbstractSailConnectionSailExceptionprotected String getNamespaceInternal(String prefix) throws SailException
getNamespaceInternal in class AbstractSailConnectionSailExceptionprotected CloseableIteration<? extends Namespace,SailException> getNamespacesInternal() throws SailException
getNamespacesInternal in class AbstractSailConnectionSailExceptionprotected CloseableIteration<? extends Statement,SailException> getStatementsInternal(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) throws SailException
getStatementsInternal in class AbstractSailConnectionSailExceptionprotected void addStatementInternal(Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException
addStatementInternal in class AbstractSailConnectionSailExceptionprotected void removeNamespaceInternal(String prefix) throws SailException
removeNamespaceInternal in class AbstractSailConnectionSailExceptionprotected void removeStatementsInternal(Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException
removeStatementsInternal in class AbstractSailConnectionSailExceptionprotected void rollbackInternal()
throws SailException
rollbackInternal in class AbstractSailConnectionSailExceptionprotected void setNamespaceInternal(String prefix, String name) throws SailException
setNamespaceInternal in class AbstractSailConnectionSailExceptionprotected long sizeInternal(Resource... contexts) throws SailException
sizeInternal in class AbstractSailConnectionSailExceptionprotected void startTransactionInternal()
throws SailException
startTransactionInternal in class AbstractSailConnectionSailExceptionprotected WriteStrategy getWriteStrategyInternal() throws SailException
writeStrategy. If this has not been done yet, WriteStrategy#initialize()
is returned. This method guarantees lazy initialization upon the first write operation on this
FedXConnection instance.WriteStrategySailExceptionpublic boolean pendingRemovals()
SailConnectionflushed) for the
current transaction.pendingRemovals in interface SailConnectionpendingRemovals in class AbstractSailConnectionSailConnection.flush()public Explanation explain(Explanation.Level level, TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred, int timeoutSeconds)
SailConnectionExplain how the TupleExpr will be (or has been) executed/evaluated by returning a TupleExpr (which may or may not be the provided TupleExpr) that has gone through zero or more of the stages prior to and also including execution as specified by the provided level.
This method is used by the Query interface.
WARNING: This method is experimental and is subject to change or removal without warning. There is currently only partial support for this method in RDF4J and and UnsupportedOperationException where support is lacking.
level - the explanation level, eg. OPTIMIZEDtupleExpr - The tuple expression to evaluate. Mutable.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 availabletimeoutSeconds - for explanations that require execution a timeout can be provided in secondsCopyright © 2015-2020 Eclipse Foundation. All Rights Reserved.