public class FBRuleInfGraph extends BasicForwardRuleInfGraph implements BackwardRuleInfGraphI
| Modifier and Type | Class and Description |
|---|---|
static class |
FBRuleInfGraph.RuleStore
Structure used to wrap up pre-processed/compiled rule sets.
|
BaseInfGraph.InfCapabilities, BaseInfGraph.InfFindSafeCapabilities, BaseInfGraph.InfTransactionHandler| Modifier and Type | Field and Description |
|---|---|
static boolean |
useRETE
Static switch from Basic to RETE implementation of the forward component
|
filterFunctorsTOSTRING_TRIPLE_BASE, TOSTRING_TRIPLE_LIMITemptyGraph| Constructor and Description |
|---|
FBRuleInfGraph(Reasoner reasoner,
Graph schema)
Constructor.
|
FBRuleInfGraph(Reasoner reasoner,
List<Rule> rules,
Graph schema)
Constructor.
|
FBRuleInfGraph(Reasoner reasoner,
List<Rule> rules,
Graph schema,
Graph data)
Constructor.
|
FBRuleInfGraph(Reasoner reasoner,
List<Rule> rules,
Graph schema,
ReificationStyle style) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(Object tin)
Post-filter query results to hide unwanted
triples from the glare of publicity.
|
void |
addBRule(Rule brule)
Adds a new Backward rule as a rusult of a forward rule process.
|
void |
addBRules(List<Rule> rules)
Adds a set of new Backward rules
|
void |
addDeduction(Triple t)
Add a new deduction to the deductions graph.
|
void |
addPreprocessingHook(RulePreprocessHook hook)
Add a new preprocessing hook defining an operation that
should be run when the preparation phase is underway.
|
void |
addRuleDuringPrepare(Rule rule)
Add a new rule to the rule set.
|
ValidityReport.Report |
checkLiteral(Node prop,
Triple triple)
Check a given literal value for a property against the set of
known range constraints for it.
|
void |
close()
Free all resources, any further use of this Graph is an error.
|
void |
deleteBRule(Rule brule)
Deletes a new Backward rule as a rules of a forward rule process.
|
com.hp.hpl.jena.util.iterator.ExtendedIterator<Triple> |
find(TriplePattern pattern)
Basic pattern lookup interface.
|
com.hp.hpl.jena.util.iterator.ExtendedIterator<Triple> |
findDataMatches(Node subject,
Node predicate,
Node object)
Search the combination of data and deductions graphs for the given triple pattern.
|
com.hp.hpl.jena.util.iterator.ExtendedIterator<Triple> |
findDataMatches(TriplePattern pattern)
Search the combination of data and deductions graphs for the given triple pattern.
|
com.hp.hpl.jena.util.iterator.ExtendedIterator<Triple> |
findFull(TriplePattern pattern)
Internal variant of find which omits the filters which block illegal RDF data.
|
com.hp.hpl.jena.util.iterator.ExtendedIterator<Triple> |
findWithContinuation(TriplePattern pattern,
Finder continuation)
Extended find interface used in situations where the implementator
may or may not be able to answer the complete query.
|
List<Rule> |
getBRules()
Return an ordered list of all registered backward rules.
|
long |
getNRulesFired()
Return the number of rules fired since this rule engine instance
was created and initialized.
|
List<Rule> |
getRules()
Return the originally supplied set of rules, may be a mix of forward
and backward rules.
|
Node |
getTemp(Node instance,
Node prop,
Node pclass)
Retrieve or create a bNode representing an inferred property value.
|
com.hp.hpl.jena.util.iterator.ExtendedIterator<Triple> |
graphBaseFind(Node subject,
Node property,
Node object)
Returns an iterator over Triples.
|
void |
hideNode(Node n)
Called to flag that a node should be hidden from external queries.
|
void |
performAdd(Triple t)
Add one triple to the data graph, run any rules triggered by
the new data item, recursively adding any generated triples.
|
void |
performDelete(Triple t)
Removes the triple t (if possible) from the set belonging to this graph.
|
void |
prepare()
Perform any initial processing and caching.
|
void |
printLPProfile()
Print a profile of LP rules used since the last reset.
|
boolean |
processBuiltin(ClauseEntry clause,
Rule rule,
BindingEnvironment env)
Process a call to a builtin predicate
|
void |
rebind()
Cause the inference graph to reconsult the underlying graph to take
into account changes.
|
void |
rebindAll()
Cause the inference graph to reconsult both the underlying graph and
the reasoner ruleset, permits the forward rule set to be dynamically changed.
|
void |
reset()
Flush out all cached results.
|
void |
resetLPProfile(boolean enable)
Reset the LP engine profile.
|
void |
setDatatypeRangeValidation(boolean on)
Switch on/off datatype range validation
|
void |
setDerivationLogging(boolean recordDerivations)
Set to true to enable derivation caching
|
void |
setTabled(Node predicate)
Set a predicate to be tabled/memoized by the LP engine.
|
void |
setTraceOn(boolean state)
Set the state of the trace flag.
|
void |
setUseTGCCache()
Instantiate the optional caches for the subclass/suproperty lattices.
|
ValidityReport |
validate()
Test the consistency of the bound data.
|
constructReifier, getCurrentDeductionsGraph, getDeductionsGraph, getDerivation, getSchemaGraph, graphBaseSize, logDerivation, rebind, setFunctorFiltering, setRuleStore, shouldLogDerivations, shouldTrace, silentAddcloneWithPremises, find, getBulkUpdateHandler, getCapabilities, getGlobalProperty, getPrefixMapping, getRawGraph, getReasoner, getTransactionHandler, getVersion, graphBaseFind, isEmpty, isPrepared, testGlobalPropertyadd, contains, contains, delete, dependsOn, find, find, forTestingOnly_graphBaseFind, getEventManager, getReifier, getStatisticsHandler, isClosed, isIsomorphicWith, notifyAdd, notifyDelete, queryHandler, size, toString, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetVersion, logDerivationsilentAddfind, getDeductionsGraph, getDerivation, getGlobalProperty, getRawGraph, getReasoner, rebind, testGlobalPropertycontains, contains, delete, dependsOn, find, find, getBulkUpdateHandler, getCapabilities, getEventManager, getPrefixMapping, getReifier, getStatisticsHandler, getTransactionHandler, isClosed, isEmpty, isIsomorphicWith, queryHandler, sizepublic static boolean useRETE
public FBRuleInfGraph(Reasoner reasoner, Graph schema)
reasoner - the reasoner which created this inf graph instanceschema - the (optional) schema graph to be includedpublic FBRuleInfGraph(Reasoner reasoner, List<Rule> rules, Graph schema)
reasoner - the reasoner which created this inf graph instancerules - the rules to processschema - the (optional) schema graph to be includedpublic FBRuleInfGraph(Reasoner reasoner, List<Rule> rules, Graph schema, ReificationStyle style)
public FBRuleInfGraph(Reasoner reasoner, List<Rule> rules, Graph schema, Graph data)
reasoner - the reasoner which created this inf graph instancerules - the rules to processschema - the (optional) schema graph to be includeddata - the data graph to be processedpublic void setUseTGCCache()
public com.hp.hpl.jena.util.iterator.ExtendedIterator<Triple> findDataMatches(Node subject, Node predicate, Node object)
findDataMatches in interface ForwardRuleInfGraphIfindDataMatches in class BasicForwardRuleInfGraphpublic com.hp.hpl.jena.util.iterator.ExtendedIterator<Triple> findDataMatches(TriplePattern pattern)
findDataMatches in interface BackwardRuleInfGraphIpublic boolean processBuiltin(ClauseEntry clause, Rule rule, BindingEnvironment env)
processBuiltin in interface BackwardRuleInfGraphIclause - the Functor representing the callenv - the BindingEnvironment for this callrule - the rule which is invoking this callpublic void addBRule(Rule brule)
addBRule in interface ForwardRuleInfGraphIaddBRule in class BasicForwardRuleInfGraphpublic void deleteBRule(Rule brule)
deleteBRule in interface ForwardRuleInfGraphIdeleteBRule in class BasicForwardRuleInfGraphpublic List<Rule> getBRules()
public List<Rule> getRules()
public void setTabled(Node predicate)
public void addDeduction(Triple t)
addDeduction in interface ForwardRuleInfGraphIaddDeduction in class BasicForwardRuleInfGraphpublic Node getTemp(Node instance, Node prop, Node pclass)
getTemp in interface BackwardRuleInfGraphIinstance - the base instance node to which the property appliesprop - the property node whose value is being inferredpclass - the (optional, can be null) class for the inferred value.public void addRuleDuringPrepare(Rule rule)
public void addPreprocessingHook(RulePreprocessHook hook)
public void prepare()
prepare in interface InfGraphprepare in class BasicForwardRuleInfGraphpublic void rebind()
rebind in interface InfGraphrebind in class BasicForwardRuleInfGraphpublic void rebindAll()
public void setTraceOn(boolean state)
setTraceOn in class BasicForwardRuleInfGraphpublic void setDerivationLogging(boolean recordDerivations)
setDerivationLogging in interface InfGraphsetDerivationLogging in class BasicForwardRuleInfGraphpublic long getNRulesFired()
getNRulesFired in class BasicForwardRuleInfGraphpublic com.hp.hpl.jena.util.iterator.ExtendedIterator<Triple> findWithContinuation(TriplePattern pattern, Finder continuation)
findWithContinuation in class BasicForwardRuleInfGraphpattern - a TriplePattern to be matched against the datacontinuation - either a Finder or a normal Graph which
will be asked for additional match results if the implementor
may not have completely satisfied the query.public com.hp.hpl.jena.util.iterator.ExtendedIterator<Triple> findFull(TriplePattern pattern)
pattern - a TriplePattern to be matched against the datapublic com.hp.hpl.jena.util.iterator.ExtendedIterator<Triple> graphBaseFind(Node subject, Node property, Node object)
graphBaseFind in class BasicForwardRuleInfGraphpublic com.hp.hpl.jena.util.iterator.ExtendedIterator<Triple> find(TriplePattern pattern)
find in class BasicForwardRuleInfGraphpattern - a TriplePattern to be matched against the datapublic void reset()
reset in interface InfGraphreset in class BaseInfGraphpublic void performAdd(Triple t)
performAdd in interface com.hp.hpl.jena.graph.impl.GraphWithPerformperformAdd in class BasicForwardRuleInfGraphpublic void performDelete(Triple t)
performDelete in interface com.hp.hpl.jena.graph.impl.GraphWithPerformperformDelete in class BasicForwardRuleInfGraphpublic void close()
close in interface Graphclose in class BasicForwardRuleInfGraphpublic ValidityReport validate()
validate in interface InfGraphvalidate in class BaseInfGraphpublic void setDatatypeRangeValidation(boolean on)
public ValidityReport.Report checkLiteral(Node prop, Triple triple)
prop - the property node whose range is under scrutinytriple - the statement whose object value is to be checked.public void hideNode(Node n)
public void resetLPProfile(boolean enable)
enable - it true then profiling will continue with a new empty profile table,
if false profiling will stop all current data lost.public void printLPProfile()
public boolean accept(Object tin)
Licenced under the Apache License, Version 2.0