public class IntermediateQueryImpl extends Object implements IntermediateQuery
| Modifier and Type | Class and Description |
|---|---|
static class |
IntermediateQueryImpl.InconsistentIntermediateQueryException
Thrown when the internal state of the intermediate query is found to be inconsistent.
|
| Constructor and Description |
|---|
IntermediateQueryImpl(DistinctVariableOnlyDataAtom projectionAtom,
QueryTreeComponent treeComponent,
ExecutorRegistry executorRegistry,
IntermediateQueryValidator validator,
OntopModelSettings settings,
IntermediateQueryFactory iqFactory)
For IntermediateQueryBuilders ONLY!!
|
| Modifier and Type | Method and Description |
|---|---|
<R extends ProposalResults,P extends QueryOptimizationProposal<R>> |
applyProposal(P propagationProposal)
Central method for submitting a proposal.
|
<R extends ProposalResults,P extends QueryOptimizationProposal<R>> |
applyProposal(P proposal,
boolean disableValidationTests)
May disable the (possible) validation tests
|
IntermediateQuery |
clone()
Not appearing in the interface because users do not
have to worry about it.
|
boolean |
contains(QueryNode node) |
IntermediateQuery |
createSnapshot()
Keeps the same query node objects but clones the tree edges
(since the latter are mutable by default).
|
Variable |
generateNewVariable()
Returns a variable that is not used in the intermediate query.
|
Variable |
generateNewVariable(Variable formerVariable)
Returns a variable that is not used in the intermediate query.
|
it.unibz.inf.ontop.com.google.common.collect.ImmutableList<QueryNode> |
getAncestors(QueryNode descendantNode)
From the parent to the oldest ancestor.
|
Optional<QueryNode> |
getChild(QueryNode currentNode,
BinaryOrderedOperatorNode.ArgumentPosition position) |
it.unibz.inf.ontop.com.google.common.collect.ImmutableList<QueryNode> |
getChildren(QueryNode node) |
Stream<QueryNode> |
getChildrenStream(QueryNode node) |
ConstructionNode |
getClosestConstructionNode(QueryNode node)
Returns itself if is a ConstructionNode or its first ancestor that is a construction node otherwise.
|
ExecutorRegistry |
getExecutorRegistry()
Not for end-users!
Needed using when using specialized intermediate queries
|
IntermediateQueryFactory |
getFactory() |
Optional<QueryNode> |
getFirstChild(QueryNode node) |
Stream<IntensionalDataNode> |
getIntensionalNodes() |
it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<Variable> |
getKnownVariables() |
Optional<QueryNode> |
getNextSibling(QueryNode node) |
it.unibz.inf.ontop.com.google.common.collect.ImmutableList<QueryNode> |
getNodesInBottomUpOrder() |
it.unibz.inf.ontop.com.google.common.collect.ImmutableList<QueryNode> |
getNodesInTopDownOrder() |
Optional<BinaryOrderedOperatorNode.ArgumentPosition> |
getOptionalPosition(QueryNode child) |
Optional<BinaryOrderedOperatorNode.ArgumentPosition> |
getOptionalPosition(QueryNode parentNode,
QueryNode childNode)
TODO: explain
|
Stream<QueryNode> |
getOtherChildrenStream(QueryNode parent,
QueryNode childToOmit) |
Optional<QueryNode> |
getParent(QueryNode node) |
DistinctVariableOnlyDataAtom |
getProjectionAtom() |
QueryNode |
getRootNode() |
IntermediateQuery |
getSubquery(QueryNode subQueryRoot,
DistinctVariableOnlyDataAtom projectionAtom) |
it.unibz.inf.ontop.com.google.common.collect.ImmutableList<QueryNode> |
getSubTreeNodesInTopDownOrder(QueryNode currentNode)
EXCLUDES the root of the sub-tree (currentNode).
|
Stream<TrueNode> |
getTrueNodes() |
it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<Variable> |
getVariables(QueryNode subTreeRootNode)
Set of variables that are returned by the sub-tree.
|
it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<Variable> |
getVariablesRequiredByAncestors(QueryNode queryNode)
Minimal set of variables such that a construction node projecting exactly these variables could be inserted
just above this node without altering the query semantics.
|
UUID |
getVersionNumber() |
boolean |
hasAncestor(QueryNode descendantNode,
QueryNode ancestorNode)
TODO: replace by a more efficient implementation
|
IntermediateQueryBuilder |
newBuilder()
Creates a uninitialized query builder.
|
String |
toString() |
public IntermediateQueryImpl(DistinctVariableOnlyDataAtom projectionAtom, QueryTreeComponent treeComponent, ExecutorRegistry executorRegistry, IntermediateQueryValidator validator, OntopModelSettings settings, IntermediateQueryFactory iqFactory)
public DistinctVariableOnlyDataAtom getProjectionAtom()
getProjectionAtom in interface IntermediateQuerypublic it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<Variable> getKnownVariables()
getKnownVariables in interface IntermediateQuerypublic IntermediateQuery createSnapshot()
IntermediateQuerycreateSnapshot in interface IntermediateQuerypublic Stream<QueryNode> getOtherChildrenStream(QueryNode parent, QueryNode childToOmit)
getOtherChildrenStream in interface IntermediateQuerypublic boolean hasAncestor(QueryNode descendantNode, QueryNode ancestorNode)
hasAncestor in interface IntermediateQuerypublic it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<Variable> getVariables(QueryNode subTreeRootNode)
IntermediateQuerygetVariables in interface IntermediateQuerypublic UUID getVersionNumber()
getVersionNumber in interface IntermediateQuerypublic IntermediateQueryBuilder newBuilder()
IntermediateQuerynewBuilder in interface IntermediateQuerypublic QueryNode getRootNode() throws IntermediateQueryImpl.InconsistentIntermediateQueryException
getRootNode in interface IntermediateQueryIntermediateQueryImpl.InconsistentIntermediateQueryExceptionpublic it.unibz.inf.ontop.com.google.common.collect.ImmutableList<QueryNode> getNodesInBottomUpOrder() throws IntermediateQueryImpl.InconsistentIntermediateQueryException
getNodesInBottomUpOrder in interface IntermediateQueryIntermediateQueryImpl.InconsistentIntermediateQueryExceptionpublic it.unibz.inf.ontop.com.google.common.collect.ImmutableList<QueryNode> getNodesInTopDownOrder()
getNodesInTopDownOrder in interface IntermediateQuerypublic it.unibz.inf.ontop.com.google.common.collect.ImmutableList<QueryNode> getChildren(QueryNode node)
getChildren in interface IntermediateQuerypublic Stream<QueryNode> getChildrenStream(QueryNode node)
getChildrenStream in interface IntermediateQuerypublic Optional<QueryNode> getChild(QueryNode currentNode, BinaryOrderedOperatorNode.ArgumentPosition position)
getChild in interface IntermediateQuerypublic it.unibz.inf.ontop.com.google.common.collect.ImmutableList<QueryNode> getSubTreeNodesInTopDownOrder(QueryNode currentNode)
IntermediateQuerygetSubTreeNodesInTopDownOrder in interface IntermediateQuerypublic Stream<IntensionalDataNode> getIntensionalNodes()
getIntensionalNodes in interface IntermediateQuerypublic Stream<TrueNode> getTrueNodes()
getTrueNodes in interface IntermediateQuerypublic boolean contains(QueryNode node)
contains in interface IntermediateQuerypublic <R extends ProposalResults,P extends QueryOptimizationProposal<R>> R applyProposal(P proposal, boolean disableValidationTests) throws InvalidQueryOptimizationProposalException, EmptyQueryException
IntermediateQueryapplyProposal in interface IntermediateQueryInvalidQueryOptimizationProposalExceptionEmptyQueryExceptionpublic <R extends ProposalResults,P extends QueryOptimizationProposal<R>> R applyProposal(P propagationProposal) throws InvalidQueryOptimizationProposalException, EmptyQueryException
IntermediateQueryapplyProposal in interface IntermediateQueryInvalidQueryOptimizationProposalExceptionEmptyQueryExceptionpublic Optional<BinaryOrderedOperatorNode.ArgumentPosition> getOptionalPosition(QueryNode parentNode, QueryNode childNode)
IntermediateQuerygetOptionalPosition in interface IntermediateQuerypublic Optional<BinaryOrderedOperatorNode.ArgumentPosition> getOptionalPosition(QueryNode child)
getOptionalPosition in interface IntermediateQuerypublic it.unibz.inf.ontop.com.google.common.collect.ImmutableList<QueryNode> getAncestors(QueryNode descendantNode)
IntermediateQuerygetAncestors in interface IntermediateQuerypublic Optional<QueryNode> getParent(QueryNode node)
getParent in interface IntermediateQuerypublic Optional<QueryNode> getNextSibling(QueryNode node)
getNextSibling in interface IntermediateQuerypublic Optional<QueryNode> getFirstChild(QueryNode node)
getFirstChild in interface IntermediateQuerypublic ConstructionNode getClosestConstructionNode(QueryNode node)
IntermediateQuerygetClosestConstructionNode in interface IntermediateQuerypublic Variable generateNewVariable()
IntermediateQuerygenerateNewVariable in interface IntermediateQuerypublic Variable generateNewVariable(Variable formerVariable)
IntermediateQuerygenerateNewVariable in interface IntermediateQuerypublic IntermediateQuery clone()
public ExecutorRegistry getExecutorRegistry()
IntermediateQuerygetExecutorRegistry in interface IntermediateQuerypublic IntermediateQueryFactory getFactory()
getFactory in interface IntermediateQuerypublic it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<Variable> getVariablesRequiredByAncestors(QueryNode queryNode)
IntermediateQuerygetVariablesRequiredByAncestors in interface IntermediateQuerypublic IntermediateQuery getSubquery(QueryNode subQueryRoot, DistinctVariableOnlyDataAtom projectionAtom)
getSubquery in interface IntermediateQueryCopyright © 2009–2020 Free University of Bozen-Bolzano. All rights reserved.