Class AbstractJoinTransferLJTransformer
- java.lang.Object
-
- it.unibz.inf.ontop.iq.transform.impl.DefaultNonRecursiveIQTreeTransformer
-
- it.unibz.inf.ontop.iq.optimizer.impl.lj.AbstractJoinTransferLJTransformer
-
- All Implemented Interfaces:
IQTreeTransformer,IQTreeVisitingTransformer
- Direct Known Subclasses:
CardinalityInsensitiveJoinTransferLJOptimizer.CardinalityInsensitiveTransformer,CardinalitySensitiveJoinTransferLJOptimizer.Transformer
public abstract class AbstractJoinTransferLJTransformer extends DefaultNonRecursiveIQTreeTransformer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractJoinTransferLJTransformer.DataNodeAndReplacementprotected static classAbstractJoinTransferLJTransformer.RenamingAndEqualitiesprotected static classAbstractJoinTransferLJTransformer.ReplaceNodeByTrueTransformerprotected static classAbstractJoinTransferLJTransformer.SelectedNode
-
Field Summary
Fields Modifier and Type Field Description protected OptimizationSingletonsoptimizationSingletonsprotected RequiredExtensionalDataNodeExtractorrequiredDataNodeExtractorprotected RightProvenanceNormalizerrightProvenanceNormalizerprotected VariableGeneratorvariableGenerator
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractJoinTransferLJTransformer(Supplier<VariableNullability> variableNullabilitySupplier, VariableGenerator variableGenerator, RequiredExtensionalDataNodeExtractor requiredDataNodeExtractor, RightProvenanceNormalizer rightProvenanceNormalizer, OptimizationSingletons optimizationSingletons)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Stream<ExtensionalDataNode>extractRightDataNodes(IQTree rightChild)Can be overridden to put restrictionsprotected Optional<IQTree>furtherTransformLeftJoin(LeftJoinNode rootNode, IQTree leftChild, IQTree rightChild)Returns empty if no optimization has been appliedprotected VariableNullabilitygetInheritedVariableNullability()protected Optional<it.unibz.inf.ontop.com.google.common.collect.ImmutableList<Integer>>matchForeignKey(ForeignKeyConstraint fk, it.unibz.inf.ontop.com.google.common.collect.ImmutableCollection<ExtensionalDataNode> leftNodes, it.unibz.inf.ontop.com.google.common.collect.ImmutableMap<Integer,? extends VariableOrGroundTerm> rightArgumentMap)protected Optional<it.unibz.inf.ontop.com.google.common.collect.ImmutableList<Integer>>matchFunctionalDependency(FunctionalDependency functionalDependency, it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<ExtensionalDataNode> sameRelationLeftNodes, it.unibz.inf.ontop.com.google.common.collect.ImmutableMap<Integer,? extends VariableOrGroundTerm> rightArgumentMap)protected Optional<it.unibz.inf.ontop.com.google.common.collect.ImmutableList<Integer>>matchIndexes(it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<ExtensionalDataNode> sameRelationLeftNodes, it.unibz.inf.ontop.com.google.common.collect.ImmutableMap<Integer,? extends VariableOrGroundTerm> rightArgumentMap, it.unibz.inf.ontop.com.google.common.collect.ImmutableList<Integer> indexes)protected Optional<it.unibz.inf.ontop.com.google.common.collect.ImmutableList<Integer>>matchUniqueConstraint(UniqueConstraint uniqueConstraint, it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<ExtensionalDataNode> sameRelationLeftNodes, it.unibz.inf.ontop.com.google.common.collect.ImmutableMap<Integer,? extends VariableOrGroundTerm> rightArgumentMap)Matches an unique constraint whose determinants are nullable in the treeprotected IQTreepreTransformLJRightChild(IQTree rightChild)Can be overriddenprotected abstract Optional<AbstractJoinTransferLJTransformer.SelectedNode>selectForTransfer(ExtensionalDataNode rightDataNode, it.unibz.inf.ontop.com.google.common.collect.ImmutableMultimap<RelationDefinition,ExtensionalDataNode> leftMultimap)protected it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<AbstractJoinTransferLJTransformer.SelectedNode>selectRightDataNodesToTransfer(it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<ExtensionalDataNode> leftDataNodes, it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<ExtensionalDataNode> rightDataNodes)protected IQTreetransformBinaryNonCommutativeNode(IQTree tree, BinaryNonCommutativeOperatorNode rootNode, IQTree leftChild, IQTree rightChild)protected IQTreetransformBinaryNonCommutativeNode(IQTree tree, BinaryNonCommutativeOperatorNode rootNode, IQTree leftChild, IQTree rightChild, Function<IQTree,IQTree> childTransformation)protected abstract IQTreetransformBySearchingFromScratch(IQTree tree)IQTreetransformDistinct(IQTree tree, DistinctNode rootNode, IQTree child)IQTreetransformFilter(IQTree tree, FilterNode rootNode, IQTree child)IQTreetransformInnerJoin(IQTree tree, InnerJoinNode rootNode, it.unibz.inf.ontop.com.google.common.collect.ImmutableList<IQTree> children)IQTreetransformLeftJoin(IQTree tree, LeftJoinNode rootNode, IQTree leftChild, IQTree rightChild)protected IQTreetransformNaryCommutativeNode(IQTree tree, NaryOperatorNode rootNode, it.unibz.inf.ontop.com.google.common.collect.ImmutableList<IQTree> children)protected IQTreetransformNaryCommutativeNode(IQTree tree, NaryOperatorNode rootNode, it.unibz.inf.ontop.com.google.common.collect.ImmutableList<IQTree> children, Function<IQTree,IQTree> childTransformation)IQTreetransformOrderBy(IQTree tree, OrderByNode rootNode, IQTree child)IQTreetransformSlice(IQTree tree, SliceNode sliceNode, IQTree child)protected IQTreetransformUnaryNode(IQTree tree, UnaryOperatorNode rootNode, IQTree child)protected IQTreetransformUnaryNode(IQTree tree, UnaryOperatorNode rootNode, IQTree child, Function<IQTree,IQTree> childTransformation)-
Methods inherited from class it.unibz.inf.ontop.iq.transform.impl.DefaultNonRecursiveIQTreeTransformer
transformAggregation, transformConstruction, transformEmpty, transformExtensionalData, transformIntensionalData, transformLeaf, transformNonStandardBinaryNonCommutativeNode, transformNonStandardLeafNode, transformNonStandardNaryNode, transformNonStandardUnaryNode, transformTrue, transformUnion, transformValues
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface it.unibz.inf.ontop.iq.transform.IQTreeVisitingTransformer
transform
-
-
-
-
Field Detail
-
variableGenerator
protected final VariableGenerator variableGenerator
-
requiredDataNodeExtractor
protected final RequiredExtensionalDataNodeExtractor requiredDataNodeExtractor
-
rightProvenanceNormalizer
protected final RightProvenanceNormalizer rightProvenanceNormalizer
-
optimizationSingletons
protected final OptimizationSingletons optimizationSingletons
-
-
Constructor Detail
-
AbstractJoinTransferLJTransformer
protected AbstractJoinTransferLJTransformer(Supplier<VariableNullability> variableNullabilitySupplier, VariableGenerator variableGenerator, RequiredExtensionalDataNodeExtractor requiredDataNodeExtractor, RightProvenanceNormalizer rightProvenanceNormalizer, OptimizationSingletons optimizationSingletons)
-
-
Method Detail
-
transformLeftJoin
public IQTree transformLeftJoin(IQTree tree, LeftJoinNode rootNode, IQTree leftChild, IQTree rightChild)
- Specified by:
transformLeftJoinin interfaceIQTreeVisitingTransformer- Overrides:
transformLeftJoinin classDefaultNonRecursiveIQTreeTransformer
-
furtherTransformLeftJoin
protected Optional<IQTree> furtherTransformLeftJoin(LeftJoinNode rootNode, IQTree leftChild, IQTree rightChild)
Returns empty if no optimization has been applied
-
selectRightDataNodesToTransfer
protected it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<AbstractJoinTransferLJTransformer.SelectedNode> selectRightDataNodesToTransfer(it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<ExtensionalDataNode> leftDataNodes, it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<ExtensionalDataNode> rightDataNodes)
-
selectForTransfer
protected abstract Optional<AbstractJoinTransferLJTransformer.SelectedNode> selectForTransfer(ExtensionalDataNode rightDataNode, it.unibz.inf.ontop.com.google.common.collect.ImmutableMultimap<RelationDefinition,ExtensionalDataNode> leftMultimap)
-
getInheritedVariableNullability
protected VariableNullability getInheritedVariableNullability()
-
matchUniqueConstraint
protected Optional<it.unibz.inf.ontop.com.google.common.collect.ImmutableList<Integer>> matchUniqueConstraint(UniqueConstraint uniqueConstraint, it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<ExtensionalDataNode> sameRelationLeftNodes, it.unibz.inf.ontop.com.google.common.collect.ImmutableMap<Integer,? extends VariableOrGroundTerm> rightArgumentMap)
Matches an unique constraint whose determinants are nullable in the tree
-
matchForeignKey
protected Optional<it.unibz.inf.ontop.com.google.common.collect.ImmutableList<Integer>> matchForeignKey(ForeignKeyConstraint fk, it.unibz.inf.ontop.com.google.common.collect.ImmutableCollection<ExtensionalDataNode> leftNodes, it.unibz.inf.ontop.com.google.common.collect.ImmutableMap<Integer,? extends VariableOrGroundTerm> rightArgumentMap)
-
matchFunctionalDependency
protected Optional<it.unibz.inf.ontop.com.google.common.collect.ImmutableList<Integer>> matchFunctionalDependency(FunctionalDependency functionalDependency, it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<ExtensionalDataNode> sameRelationLeftNodes, it.unibz.inf.ontop.com.google.common.collect.ImmutableMap<Integer,? extends VariableOrGroundTerm> rightArgumentMap)
-
matchIndexes
protected Optional<it.unibz.inf.ontop.com.google.common.collect.ImmutableList<Integer>> matchIndexes(it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<ExtensionalDataNode> sameRelationLeftNodes, it.unibz.inf.ontop.com.google.common.collect.ImmutableMap<Integer,? extends VariableOrGroundTerm> rightArgumentMap, it.unibz.inf.ontop.com.google.common.collect.ImmutableList<Integer> indexes)
-
extractRightDataNodes
protected Stream<ExtensionalDataNode> extractRightDataNodes(IQTree rightChild)
Can be overridden to put restrictions
-
transformFilter
public IQTree transformFilter(IQTree tree, FilterNode rootNode, IQTree child)
- Specified by:
transformFilterin interfaceIQTreeVisitingTransformer- Overrides:
transformFilterin classDefaultNonRecursiveIQTreeTransformer
-
transformDistinct
public IQTree transformDistinct(IQTree tree, DistinctNode rootNode, IQTree child)
- Specified by:
transformDistinctin interfaceIQTreeVisitingTransformer- Overrides:
transformDistinctin classDefaultNonRecursiveIQTreeTransformer
-
transformSlice
public IQTree transformSlice(IQTree tree, SliceNode sliceNode, IQTree child)
- Specified by:
transformSlicein interfaceIQTreeVisitingTransformer- Overrides:
transformSlicein classDefaultNonRecursiveIQTreeTransformer
-
transformOrderBy
public IQTree transformOrderBy(IQTree tree, OrderByNode rootNode, IQTree child)
- Specified by:
transformOrderByin interfaceIQTreeVisitingTransformer- Overrides:
transformOrderByin classDefaultNonRecursiveIQTreeTransformer
-
transformInnerJoin
public IQTree transformInnerJoin(IQTree tree, InnerJoinNode rootNode, it.unibz.inf.ontop.com.google.common.collect.ImmutableList<IQTree> children)
- Specified by:
transformInnerJoinin interfaceIQTreeVisitingTransformer- Overrides:
transformInnerJoinin classDefaultNonRecursiveIQTreeTransformer
-
transformUnaryNode
protected IQTree transformUnaryNode(IQTree tree, UnaryOperatorNode rootNode, IQTree child)
- Overrides:
transformUnaryNodein classDefaultNonRecursiveIQTreeTransformer
-
transformUnaryNode
protected IQTree transformUnaryNode(IQTree tree, UnaryOperatorNode rootNode, IQTree child, Function<IQTree,IQTree> childTransformation)
-
transformNaryCommutativeNode
protected IQTree transformNaryCommutativeNode(IQTree tree, NaryOperatorNode rootNode, it.unibz.inf.ontop.com.google.common.collect.ImmutableList<IQTree> children)
- Overrides:
transformNaryCommutativeNodein classDefaultNonRecursiveIQTreeTransformer
-
transformNaryCommutativeNode
protected IQTree transformNaryCommutativeNode(IQTree tree, NaryOperatorNode rootNode, it.unibz.inf.ontop.com.google.common.collect.ImmutableList<IQTree> children, Function<IQTree,IQTree> childTransformation)
-
transformBinaryNonCommutativeNode
protected IQTree transformBinaryNonCommutativeNode(IQTree tree, BinaryNonCommutativeOperatorNode rootNode, IQTree leftChild, IQTree rightChild)
- Overrides:
transformBinaryNonCommutativeNodein classDefaultNonRecursiveIQTreeTransformer
-
transformBinaryNonCommutativeNode
protected IQTree transformBinaryNonCommutativeNode(IQTree tree, BinaryNonCommutativeOperatorNode rootNode, IQTree leftChild, IQTree rightChild, Function<IQTree,IQTree> childTransformation)
-
transformBySearchingFromScratch
protected abstract IQTree transformBySearchingFromScratch(IQTree tree)
-
-