public class AggregationNodeImpl extends ExtendedProjectionNodeImpl implements AggregationNode
ExtendedProjectionNodeImpl.DescendingSubstitutionChildUpdateFunction, ExtendedProjectionNodeImpl.EmptyTreeException| Modifier | Constructor and Description |
|---|---|
protected |
AggregationNodeImpl(com.google.common.collect.ImmutableSet<Variable> groupingVariables,
ImmutableSubstitution<ImmutableFunctionalTerm> substitution,
SubstitutionFactory substitutionFactory,
IntermediateQueryFactory iqFactory,
AggregationNormalizer aggregationNormalizer,
ImmutableUnificationTools unificationTools,
ConstructionNodeTools constructionNodeTools,
ImmutableSubstitutionTools substitutionTools,
TermFactory termFactory,
CoreUtilsFactory coreUtilsFactory,
OntopModelSettings settings) |
| Modifier and Type | Method and Description |
|---|---|
AggregationNode |
acceptNodeTransformer(HomogeneousQueryNodeTransformer transformer)
"Accept" method for the "Visitor" pattern.
|
IQTree |
acceptTransformer(IQTree tree,
IQTreeVisitingTransformer transformer,
IQTree child) |
<T> T |
acceptVisitor(IQVisitor<T> visitor,
IQTree child) |
void |
acceptVisitor(QueryNodeVisitor visitor)
"Accept" method for the "Visitor" pattern.
|
IQTree |
applyFreshRenaming(InjectiveVar2VarSubstitution renamingSubstitution,
IQTree child,
IQTreeCache treeCache) |
AggregationNode |
clone()
See https://stackoverflow.com/questions/6837362/
|
protected Optional<ExtendedProjectionNode> |
computeNewProjectionNode(com.google.common.collect.ImmutableSet<Variable> newProjectedVariables,
ImmutableSubstitution<ImmutableTerm> theta,
IQTree newChild) |
static com.google.common.collect.ImmutableSet<Variable> |
extractChildVariables(com.google.common.collect.ImmutableSet<Variable> groupingVariables,
ImmutableSubstitution<ImmutableFunctionalTerm> substitution) |
com.google.common.collect.ImmutableSet<Variable> |
getChildVariables()
Variables that have to be provided by the child
|
com.google.common.collect.ImmutableSet<Variable> |
getGroupingVariables() |
com.google.common.collect.ImmutableSet<Variable> |
getLocallyDefinedVariables()
Locally defined variables must not appear in the sub-tree
|
com.google.common.collect.ImmutableSet<Variable> |
getLocallyRequiredVariables()
Set of variables that this node, INDEPENDENTLY OF THE REQUIREMENTS OF ITS ANCESTORS,
requires to be defined in the sub-tree.
|
com.google.common.collect.ImmutableSet<Variable> |
getLocalVariables()
Set of variables MENTIONED in the node, INDEPENDENTLY of its sub-tree.
|
com.google.common.collect.ImmutableSet<ImmutableSubstitution<NonVariableTerm>> |
getPossibleVariableDefinitions(IQTree child) |
com.google.common.collect.ImmutableSet<Variable> |
getRequiredVariables(IntermediateQuery query)
Set of variables which, individually, must be provided by at least one child,
INDEPENDENTLY OF THE REQUIREMENTS OF THIS NODE'S ANCESTORS.
|
ImmutableSubstitution<ImmutableFunctionalTerm> |
getSubstitution()
(Some) projected variable --> transformed variable
|
com.google.common.collect.ImmutableSet<Variable> |
getVariables()
Set of variables returned by any sub-tree where this node is the root.
|
com.google.common.collect.ImmutableSet<com.google.common.collect.ImmutableSet<Variable>> |
inferUniqueConstraints(IQTree child) |
boolean |
isDistinct(IQTree child) |
boolean |
isEquivalentTo(QueryNode queryNode)
Is syntactically equivalent
|
boolean |
isSyntacticallyEquivalentTo(QueryNode node)
TODO: explain
|
boolean |
isVariableNullable(IntermediateQuery query,
Variable variable)
Returns true if it cannot guarantee the projected variable to be non-null
Throws an IllegalArgumentException if the variable is not projected by the node
|
IQTree |
liftIncompatibleDefinitions(Variable variable,
IQTree child,
VariableGenerator variableGenerator)
By default does not lift.
|
IQTree |
normalizeForOptimization(IQTree child,
VariableGenerator variableGenerator,
IQProperties currentIQProperties) |
IQTree |
removeDistincts(IQTree child,
IQProperties iqProperties)
By default, blocks the distinct removal
TODO: detect when we can do it (absence of cardinality-sensitive aggregation functions)
|
String |
toString() |
protected void |
validateNode() |
void |
validateNode(IQTree child)
Only validates the node, not its child
|
applyDescendingSubstitution, applyDescendingSubstitutionWithoutOptimizing, getVariableNullability, isConstructed, propagateDownConstraintequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyDescendingSubstitution, applyDescendingSubstitutionWithoutOptimizing, getVariableNullability, isConstructed, propagateDownConstraintprotected AggregationNodeImpl(com.google.common.collect.ImmutableSet<Variable> groupingVariables, ImmutableSubstitution<ImmutableFunctionalTerm> substitution, SubstitutionFactory substitutionFactory, IntermediateQueryFactory iqFactory, AggregationNormalizer aggregationNormalizer, ImmutableUnificationTools unificationTools, ConstructionNodeTools constructionNodeTools, ImmutableSubstitutionTools substitutionTools, TermFactory termFactory, CoreUtilsFactory coreUtilsFactory, OntopModelSettings settings)
public static com.google.common.collect.ImmutableSet<Variable> extractChildVariables(com.google.common.collect.ImmutableSet<Variable> groupingVariables, ImmutableSubstitution<ImmutableFunctionalTerm> substitution)
protected Optional<ExtendedProjectionNode> computeNewProjectionNode(com.google.common.collect.ImmutableSet<Variable> newProjectedVariables, ImmutableSubstitution<ImmutableTerm> theta, IQTree newChild)
computeNewProjectionNode in class ExtendedProjectionNodeImplpublic IQTree normalizeForOptimization(IQTree child, VariableGenerator variableGenerator, IQProperties currentIQProperties)
normalizeForOptimization in interface UnaryOperatorNodepublic IQTree applyFreshRenaming(InjectiveVar2VarSubstitution renamingSubstitution, IQTree child, IQTreeCache treeCache)
applyFreshRenaming in interface UnaryOperatorNodepublic boolean isDistinct(IQTree child)
isDistinct in interface UnaryOperatorNodepublic IQTree liftIncompatibleDefinitions(Variable variable, IQTree child, VariableGenerator variableGenerator)
liftIncompatibleDefinitions in interface UnaryOperatorNodepublic IQTree acceptTransformer(IQTree tree, IQTreeVisitingTransformer transformer, IQTree child)
acceptTransformer in interface UnaryOperatorNodepublic <T> T acceptVisitor(IQVisitor<T> visitor, IQTree child)
acceptVisitor in interface UnaryOperatorNodepublic void acceptVisitor(QueryNodeVisitor visitor)
QueryNodeacceptVisitor in interface QueryNodepublic AggregationNode acceptNodeTransformer(HomogeneousQueryNodeTransformer transformer) throws QueryNodeTransformationException
QueryNodeacceptNodeTransformer in interface AggregationNodeacceptNodeTransformer in interface QueryNodeacceptNodeTransformer in interface UnaryOperatorNodeQueryNodeTransformationExceptionpublic com.google.common.collect.ImmutableSet<Variable> getLocalVariables()
QueryNodegetLocalVariables in interface QueryNodepublic boolean isVariableNullable(IntermediateQuery query, Variable variable)
QueryNodeisVariableNullable in interface QueryNodepublic boolean isSyntacticallyEquivalentTo(QueryNode node)
QueryNodeisSyntacticallyEquivalentTo in interface QueryNodepublic com.google.common.collect.ImmutableSet<Variable> getLocallyRequiredVariables()
QueryNodegetLocallyRequiredVariables in interface QueryNodepublic com.google.common.collect.ImmutableSet<Variable> getRequiredVariables(IntermediateQuery query)
QueryNodegetRequiredVariables in interface QueryNodepublic com.google.common.collect.ImmutableSet<Variable> getLocallyDefinedVariables()
QueryNodegetLocallyDefinedVariables in interface QueryNodepublic boolean isEquivalentTo(QueryNode queryNode)
QueryNodeisEquivalentTo in interface QueryNodepublic void validateNode(IQTree child) throws InvalidIntermediateQueryException
UnaryOperatorNodevalidateNode in interface UnaryOperatorNodeInvalidIntermediateQueryExceptionprotected void validateNode()
throws InvalidIntermediateQueryException
public com.google.common.collect.ImmutableSet<ImmutableSubstitution<NonVariableTerm>> getPossibleVariableDefinitions(IQTree child)
getPossibleVariableDefinitions in interface UnaryOperatorNodepublic IQTree removeDistincts(IQTree child, IQProperties iqProperties)
removeDistincts in interface UnaryOperatorNodepublic com.google.common.collect.ImmutableSet<com.google.common.collect.ImmutableSet<Variable>> inferUniqueConstraints(IQTree child)
inferUniqueConstraints in interface UnaryOperatorNodepublic ImmutableSubstitution<ImmutableFunctionalTerm> getSubstitution()
ExtendedProjectionNodegetSubstitution in interface AggregationNodegetSubstitution in interface ExtendedProjectionNodepublic com.google.common.collect.ImmutableSet<Variable> getGroupingVariables()
getGroupingVariables in interface AggregationNodepublic com.google.common.collect.ImmutableSet<Variable> getChildVariables()
ExtendedProjectionNodegetChildVariables in interface ExtendedProjectionNodepublic com.google.common.collect.ImmutableSet<Variable> getVariables()
ExplicitVariableProjectionNodegetVariables in interface ExplicitVariableProjectionNodepublic AggregationNode clone()
QueryNodeImplclone in interface AggregationNodeclone in interface QueryNodeclone in class QueryNodeImplCopyright © 2009–2020 Free University of Bozen-Bolzano. All rights reserved.