public abstract class KBQueryFilterAdapter extends KBQueryFilter
KBQueryFilter
Modifier and Type | Field and Description |
---|---|
protected Formula |
pattern
Pattern that must match to apply the filter adapter
|
Constructor and Description |
---|
KBQueryFilterAdapter(Formula formula)
Creates a new Filter
|
KBQueryFilterAdapter(String pttrn)
Creates a new filter.
|
Modifier and Type | Method and Description |
---|---|
QueryResult |
apply(Formula formula,
ArrayList falsityReasons,
QueryResult.BoolWrapper goOn)
TO BE REWRITTEN TO BE REWRITTEN TO BE REWRITTEN
By default, this method returns false as first element in the array,
meaning the filter is not applicable, and null as second element.
|
MatchResult |
doApply(Formula formula,
MatchResult match)
Performs the filter on the formula
formula . |
boolean |
doGetObserverTriggerPatterns(MatchResult match,
Set set) |
boolean |
getObserverTriggerPatterns(Formula formula,
Set set)
By default, this method does nothing.
|
String |
toString()
Returns the string representing the pattern
|
toStrings
getMyKBase, setMyKBase
protected Formula pattern
public KBQueryFilterAdapter(String pttrn)
pttrn
- a pattern. The pattern must contain a variable named "??agent"
representing the semantic agent itself.public KBQueryFilterAdapter(Formula formula)
formula
- a pattern. The pattern must contain a variable named "??agent"
representing the semantic agent itself.public final QueryResult apply(Formula formula, ArrayList falsityReasons, QueryResult.BoolWrapper goOn)
apply
in class KBQueryFilter
formula
- the formula on which the filter is appliedagent
- a term that represents the agent is trying to apply the filterKBase.query(Formula)
public MatchResult doApply(Formula formula, MatchResult match)
formula
. By default,
returns null
.formula
- a formulamatch
- the MatchResult corresponding to the match between
the incoming formula and the pattern of the filter.null
if not.public boolean getObserverTriggerPatterns(Formula formula, Set set)
getObserverTriggerPatterns
in class KBQueryFilter
formula
- an observed formulaset
- set of patterns. Each pattern corresponds to a kind a formula
which, if it is asserted in the base, triggers the observer that
observes the formula given in parameter.public boolean doGetObserverTriggerPatterns(MatchResult match, Set set)