public static class ASTStaticBindingsOptimizer.VariableUsageInfo extends Object
Constructor and Description |
---|
ASTStaticBindingsOptimizer.VariableUsageInfo()
Constructor creating an empty object (no usages).
|
Modifier and Type | Method and Description |
---|---|
void |
extractVarSPUsageInfoChildren(GroupNodeBase<?> group)
Extracts usage information for the variable from statement patterns
being direct children of the current node (ignoring the node itself).
|
void |
extractVarSPUsageInfoChildrenOrSelf(GroupNodeBase<?> group)
Extracts usage information for the variable inside statement patterns
from the current node itself and its children (recursively).
|
void |
extractVarUsageInfoSelf(GroupNodeBase<?> group)
Extracts variable usage information (variables and the nodes they
occur in), investigating FILTERs, assignment nodes, and statement
pattern nodes, but /not/ recursing into children.
|
Map<IVariable<?>,List<IQueryNode>> |
getUsageMap()
Gets the map recoding all usages of all variables (internal data
structure maintained by the class).
|
List<IQueryNode> |
getVarUsages(IVariable<?> var)
Returns the list of variable usages.
|
static ASTStaticBindingsOptimizer.VariableUsageInfo |
merge(ASTStaticBindingsOptimizer.VariableUsageInfo x,
ASTStaticBindingsOptimizer.VariableUsageInfo y)
Merges two
ASTStaticBindingsOptimizer.VariableUsageInfo , creating a new one containing
the merged information. |
boolean |
varUsed(IVariable<?> var)
Returns true iff usage records for the var are available.
|
boolean |
varUsedInFilterOrAssignment(IVariable<?> var)
Returns true if a usage record for the given variable inside a FILTER
or BIND/VALUES node has been recorded.
|
public ASTStaticBindingsOptimizer.VariableUsageInfo()
public boolean varUsedInFilterOrAssignment(IVariable<?> var)
SELECT * WHERE { FILTER(!bound(?x)) { BIND(1 AS ?x) } } Expected result is the empty set, according to bottom-up semantics. We must *not* rewrite this query as SELECT * WHERE { FILTER(!bound(?x)) } VALUES ?x { 1 } The reason is that in this case the FILTER will pass, while ?x in the original query the BIND(1 AS ?x) is in scope and the filter fails. The same holds for queries where the FILTER is at the same level as the BIND/VALUES clause, such as: SELECT * WHERE { FILTER(!bound(?x)) { BIND(1 AS ?x) } }
var
- public boolean varUsed(IVariable<?> var)
var
- public List<IQueryNode> getVarUsages(IVariable<?> var)
var
- public Map<IVariable<?>,List<IQueryNode>> getUsageMap()
public void extractVarUsageInfoSelf(GroupNodeBase<?> group)
group
- the group where to extract filter var info (non-recursively)public void extractVarSPUsageInfoChildren(GroupNodeBase<?> group)
group
- the group node base in which we perform the lookuppublic void extractVarSPUsageInfoChildrenOrSelf(GroupNodeBase<?> group)
ASTBottomUpOptimizer.handleFiltersWithVariablesNotInScope(com.bigdata.rdf.sparql.ast.eval.AST2BOpContext, com.bigdata.rdf.sparql.ast.StaticAnalysis, com.bigdata.rdf.sparql.ast.QueryBase, com.bigdata.bop.IBindingSet[])
)!).
This maybe somewhat too strict (leading to situations where we do
not inline static variable bindings), but is safe.group
- public static ASTStaticBindingsOptimizer.VariableUsageInfo merge(ASTStaticBindingsOptimizer.VariableUsageInfo x, ASTStaticBindingsOptimizer.VariableUsageInfo y)
ASTStaticBindingsOptimizer.VariableUsageInfo
, creating a new one containing
the merged information. The original objects are not modified.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.