Class FedXBooleanQuery
- java.lang.Object
-
- org.eclipse.rdf4j.query.impl.AbstractOperation
-
- org.eclipse.rdf4j.query.impl.AbstractQuery
-
- org.eclipse.rdf4j.query.impl.AbstractParserQuery
-
- org.eclipse.rdf4j.repository.sail.SailQuery
-
- org.eclipse.rdf4j.repository.sail.SailBooleanQuery
-
- org.eclipse.rdf4j.federated.structures.FedXBooleanQuery
-
- All Implemented Interfaces:
BooleanQuery
,Operation
,Query
public class FedXBooleanQuery extends SailBooleanQuery
Abstraction of aSailBooleanQuery
which takes care for tracking theFedXRepositoryConnection.BINDING_ORIGINAL_MAX_EXECUTION_TIME
during evaluation. All methods are delegated to the actualSailBooleanQuery
.- Author:
- Andreas Schwarte
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.rdf4j.query.impl.AbstractParserQuery
AbstractParserQuery.QueryInterruptIteration
-
Nested classes/interfaces inherited from interface org.eclipse.rdf4j.query.Query
Query.QueryType
-
-
Field Summary
Fields Modifier and Type Field Description protected SailBooleanQuery
delegate
-
Fields inherited from class org.eclipse.rdf4j.query.impl.AbstractParserQuery
DEFAULT_EXPLANATION_EXECUTION_TIMEOUT
-
Fields inherited from class org.eclipse.rdf4j.query.impl.AbstractOperation
bindings, dataset, includeInferred
-
-
Constructor Summary
Constructors Constructor Description FedXBooleanQuery(SailBooleanQuery delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearBindings()
Removes all previously set bindings.boolean
equals(Object obj)
boolean
evaluate()
Dataset
getActiveDataset()
Gets the "active" dataset for this query.BindingSet
getBindings()
Retrieves the bindings that have been set on this operation.Dataset
getDataset()
Gets the dataset that has been set usingOperation.setDataset(Dataset)
, if any.boolean
getIncludeInferred()
Returns whether or not this operation will return inferred statements (if any are present in the repository).int
getMaxExecutionTime()
Returns the maximum operation execution time.int
getMaxQueryTime()
Returns the maximum query evaluation time.ParsedBooleanQuery
getParsedQuery()
int
hashCode()
void
removeBinding(String name)
Removes a previously set binding on the supplied variable.void
setBinding(String name, Value value)
Binds the specified variable to the supplied value.void
setDataset(Dataset dataset)
Specifies the dataset against which to execute an operation, overriding any dataset that is specified in the operation itself.void
setIncludeInferred(boolean includeInferred)
Determine whether evaluation results of this operation should include inferred statements (if any inferred statements are present in the repository).void
setMaxExecutionTime(int maxExecutionTimeSeconds)
Specifies the maximum time that an operation is allowed to run.void
setMaxQueryTime(int maxQueryTime)
Specifies the maximum time that a query is allowed to run.String
toString()
-
Methods inherited from class org.eclipse.rdf4j.repository.sail.SailQuery
explain, getConnection
-
Methods inherited from class org.eclipse.rdf4j.query.impl.AbstractParserQuery
enforceMaxQueryTime
-
-
-
-
Field Detail
-
delegate
protected final SailBooleanQuery delegate
-
-
Constructor Detail
-
FedXBooleanQuery
public FedXBooleanQuery(SailBooleanQuery delegate)
-
-
Method Detail
-
evaluate
public boolean evaluate() throws QueryEvaluationException
- Specified by:
evaluate
in interfaceBooleanQuery
- Overrides:
evaluate
in classSailBooleanQuery
- Throws:
QueryEvaluationException
-
setMaxQueryTime
public void setMaxQueryTime(int maxQueryTime)
Description copied from interface:Query
Specifies the maximum time that a query is allowed to run. The query will be interrupted when it exceeds the time limit. Any consecutive requests to fetch query results will result inQueryInterruptedException
s.- Specified by:
setMaxQueryTime
in interfaceQuery
- Overrides:
setMaxQueryTime
in classAbstractQuery
- Parameters:
maxQueryTime
- The maximum query time, measured in seconds. A negative or zero value indicates an unlimited query time (which is the default).
-
getMaxQueryTime
public int getMaxQueryTime()
Description copied from interface:Query
Returns the maximum query evaluation time.- Specified by:
getMaxQueryTime
in interfaceQuery
- Overrides:
getMaxQueryTime
in classAbstractQuery
- Returns:
- The maximum query evaluation time, measured in seconds.
- See Also:
Query.setMaxQueryTime(int)
-
setBinding
public void setBinding(String name, Value value)
Description copied from interface:Operation
Binds the specified variable to the supplied value. Any value that was previously bound to the specified value will be overwritten.- Specified by:
setBinding
in interfaceOperation
- Overrides:
setBinding
in classAbstractOperation
- Parameters:
name
- The name of the variable that should be bound.value
- The (new) value for the specified variable.
-
getParsedQuery
public ParsedBooleanQuery getParsedQuery()
- Overrides:
getParsedQuery
in classSailBooleanQuery
-
removeBinding
public void removeBinding(String name)
Description copied from interface:Operation
Removes a previously set binding on the supplied variable. Calling this method with an unbound variable name has no effect.- Specified by:
removeBinding
in interfaceOperation
- Overrides:
removeBinding
in classAbstractOperation
- Parameters:
name
- The name of the variable from which the binding is to be removed.
-
clearBindings
public void clearBindings()
Description copied from interface:Operation
Removes all previously set bindings.- Specified by:
clearBindings
in interfaceOperation
- Overrides:
clearBindings
in classAbstractOperation
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractParserQuery
-
getBindings
public BindingSet getBindings()
Description copied from interface:Operation
Retrieves the bindings that have been set on this operation.- Specified by:
getBindings
in interfaceOperation
- Overrides:
getBindings
in classAbstractOperation
- Returns:
- A (possibly empty) set of operation variable bindings.
- See Also:
Operation.setBinding(String, Value)
-
setDataset
public void setDataset(Dataset dataset)
Description copied from interface:Operation
Specifies the dataset against which to execute an operation, overriding any dataset that is specified in the operation itself.- Specified by:
setDataset
in interfaceOperation
- Overrides:
setDataset
in classAbstractOperation
-
getDataset
public Dataset getDataset()
Description copied from interface:Operation
Gets the dataset that has been set usingOperation.setDataset(Dataset)
, if any.- Specified by:
getDataset
in interfaceOperation
- Overrides:
getDataset
in classAbstractOperation
-
setIncludeInferred
public void setIncludeInferred(boolean includeInferred)
Description copied from interface:Operation
Determine whether evaluation results of this operation should include inferred statements (if any inferred statements are present in the repository). The default setting is 'true'.- Specified by:
setIncludeInferred
in interfaceOperation
- Overrides:
setIncludeInferred
in classAbstractOperation
- Parameters:
includeInferred
- indicates whether inferred statements should be included in the result.
-
getActiveDataset
public Dataset getActiveDataset()
Description copied from class:AbstractParserQuery
Gets the "active" dataset for this query. The active dataset is either the dataset that has been specified usingAbstractOperation.setDataset(Dataset)
or the dataset that has been specified in the query, where the former takes precedence over the latter.- Overrides:
getActiveDataset
in classAbstractParserQuery
- Returns:
- The active dataset, or null if there is no dataset.
-
getIncludeInferred
public boolean getIncludeInferred()
Description copied from interface:Operation
Returns whether or not this operation will return inferred statements (if any are present in the repository).- Specified by:
getIncludeInferred
in interfaceOperation
- Overrides:
getIncludeInferred
in classAbstractOperation
- Returns:
- true if inferred statements will be returned, false otherwise.
-
setMaxExecutionTime
public void setMaxExecutionTime(int maxExecutionTimeSeconds)
Description copied from interface:Operation
Specifies the maximum time that an operation is allowed to run. The operation will be interrupted when it exceeds the time limit. Any consecutive requests to fetch query results will result inQueryInterruptedException
s orUpdateExecutionException
s (depending on whether the operation is a query or an update).- Specified by:
setMaxExecutionTime
in interfaceOperation
- Overrides:
setMaxExecutionTime
in classAbstractOperation
- Parameters:
maxExecutionTimeSeconds
- The maximum query time, measured in seconds. A negative or zero value indicates an unlimited execution time (which is the default).
-
getMaxExecutionTime
public int getMaxExecutionTime()
Description copied from interface:Operation
Returns the maximum operation execution time.- Specified by:
getMaxExecutionTime
in interfaceOperation
- Overrides:
getMaxExecutionTime
in classAbstractOperation
- Returns:
- The maximum operation execution time, measured in seconds.
- See Also:
Operation.setMaxExecutionTime(int)
-
toString
public String toString()
- Overrides:
toString
in classAbstractParserQuery
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classAbstractParserQuery
-
-