public class ASTUnknownTermOptimizer extends Object implements IASTOptimizer
GRAPH uri {}
where uri is not a named graph.
TODO From BigdataEvaluationStrategyImpl3#945 Prunes the sop tree of optional join groups containing values not in the lexicon. sopTree = stb.pruneGroups(sopTree, groupsToPrune); If after pruning groups with unrecognized values we end up with a UNION with no subqueries, we can safely just return an empty iteration. if (SOp2BOpUtility.isEmptyUnion(sopTree.getRoot())) { return new EmptyIterationand also if we encounter a value not in the lexicon, we can still continue with the query if the value is in either an optional tail or an optional join group (i.e. if it appears on the right side of a LeftJoin). We can also continue if the value is in a UNION. Otherwise we can stop evaluating right now.(); }
} catch (UnrecognizedValueException ex) { if (sop.getGroup() == SOpTreeBuilder.ROOT_GROUP_ID) { throw new UnrecognizedValueException(ex); } else { groupsToPrune.add(sopTree.getGroup(sop.getGroup())); } }ASTPruneUnknownTerms : If an unknown terms appears in a StatementPatternNode then we get to either fail the query or prune that part of the query. If it appears in an optional, then prune the optional. if it appears in union, the prune that part of the union. if it appears at the top-level then there are no solutions for that query. This is part of what BigdataEvaluationStrategyImpl3#toPredicate(final StatementPattern stmtPattern) is doing. Note that toVE() as called from that method will throw an UnknownValueException if the term is not known to the database. FIXME Isolate pruning logic since we need to use it in more than one place.
Constructor and Description |
---|
ASTUnknownTermOptimizer() |
Modifier and Type | Method and Description |
---|---|
QueryNodeWithBindingSet |
optimize(AST2BOpContext context,
QueryNodeWithBindingSet input)
Optimize the AST.
|
public QueryNodeWithBindingSet optimize(AST2BOpContext context, QueryNodeWithBindingSet input)
IASTOptimizer
optimize
in interface IASTOptimizer
context
- The evaluation context.input
- The input to the optimizer, consisting of a queryNode and
input binding set.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.