public class RuleState extends Object implements IRuleState
Modifier and Type | Field and Description |
---|---|
protected static org.apache.log4j.Logger |
log |
protected IVariable[][] |
requiredVars
Each step in the join has a set of variables that are required, either
by that tail or by something downstream, be it another tail or the
projection (select or construct) or the aggregation phase.
|
Modifier | Constructor and Description |
---|---|
protected |
RuleState(IRule rule)
For test cases.
|
|
RuleState(IRule rule,
IJoinNexus joinNexus) |
Modifier and Type | Method and Description |
---|---|
protected IKeyOrder[] |
computeKeyOrderForEachTail(IRule rule,
IJoinNexus joinNexus,
int[] order,
int[] nvars)
Return an array indicating the
IKeyOrder that will be used when
reading on each of the tail predicates. |
static IVariable[][] |
computeRequiredVarsForEachTail(IRule rule,
int[] order)
Return an array indicated what variables are required for each tail
index.
|
IKeyOrder[] |
getKeyOrder()
An array of the
IKeyOrder that will be used for each predicate in
the tail of the rule. |
int[] |
getNVars()
The #of unbound variables for the predicates in the tail of the
Rule for the evaluation plan . |
IEvaluationPlan |
getPlan()
The evaluation plan.
|
IVariable[][] |
getRequiredVars()
A list of variables required for each tail, by tailIndex.
|
IRule |
getRule()
The
IRule being evaluated. |
String |
toString()
Externalizes the rule and the evaluation order.
|
String |
toString(IBindingSet bindingSet)
Shows the bindings (if given), the computed evaluation order, the
computed
IKeyOrder , and the required variables for each
IPredicate in the rule. |
protected static final transient org.apache.log4j.Logger log
protected final IVariable[][] requiredVars
protected RuleState(IRule rule)
public RuleState(IRule rule, IJoinNexus joinNexus)
rule
- The rule.joinNexus
- The IJoinNexus
.public IRule getRule()
IRuleState
IRule
being evaluated.getRule
in interface IRuleState
public IEvaluationPlan getPlan()
IRuleState
getPlan
in interface IRuleState
public int[] getNVars()
IRuleState
Rule
for the evaluation plan
. The array is
correlated with the predicates index in the tail of the rule NOT with its
evaluation order.getNVars
in interface IRuleState
public IKeyOrder[] getKeyOrder()
IRuleState
IKeyOrder
that will be used for each predicate in
the tail of the rule. The array is correlated with the predicates index
in the tail of the rule NOT with its evaluation order.
Note: The fully qualified index name for a given predicate is the name of
the relation for that predicate plus IKeyOrder.getIndexName()
.
getKeyOrder
in interface IRuleState
public IVariable[][] getRequiredVars()
IRuleState
getRequiredVars
in interface IRuleState
public String toString()
toString
in interface IRuleState
toString
in class Object
public String toString(IBindingSet bindingSet)
IKeyOrder
, and the required variables for each
IPredicate
in the rule.toString
in interface IRuleState
bindingSet
- When non-null
, the current variable bindings
will be displayed. Otherwise, the names of variables will be
displayed rather than their bindings.protected IKeyOrder[] computeKeyOrderForEachTail(IRule rule, IJoinNexus joinNexus, int[] order, int[] nvars)
IKeyOrder
that will be used when
reading on each of the tail predicates. The array is formed using a
private IBindingSet
and propagating
fake bindings
to each
predicate in turn using the given evaluation order.order
- The evaluation order.nvars
- The #of unbound variables for each tail predicate is assigned
by side-effect.IKeyOrder
s for each tail predicate. The
array is correlated with the predicates index in the tail of the
rule NOT its evaluation order.public static IVariable[][] computeRequiredVarsForEachTail(IRule rule, int[] order)
rule
- The rule being executed.order
- The evaluation order.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.