| java.lang.Object com.hp.hpl.jena.reasoner.rulesys.FBRuleReasoner com.hp.hpl.jena.reasoner.rulesys.GenericRuleReasoner
All known Subclasses: com.hp.hpl.jena.reasoner.rulesys.OWLMiniReasoner, com.hp.hpl.jena.reasoner.rulesys.RDFSRuleReasoner, com.hp.hpl.jena.reasoner.rulesys.RDFSForwardRuleReasoner, com.hp.hpl.jena.reasoner.rulesys.DAMLMicroReasoner, com.hp.hpl.jena.reasoner.rulesys.OWLMicroReasoner,
GenericRuleReasoner | public class GenericRuleReasoner extends FBRuleReasoner (Code) | | A reasoner interface that is able to invoke any of the useful
rule engine combinations. The rule set can be set after the reasoner
instance is created. The mode can be set to forward, backward or hybrid.
The OWL-specific rule augmentation can be included. Each of these settings
can be controlled using the configuration graph, specific methods calls or
generic setParameter calls.
author: Dave Reynolds version: $Revision: 1.35 $ on $Date: 2008/01/22 16:16:24 $ |
Inner Class :public static class RuleMode | |
Method Summary | |
public void | addPreprocessingHook(RulePreprocessHook hook) Add a new preprocessing hook defining an operation that
should be run when the inference graph is being prepared. | public InfGraph | bind(Graph data) Attach the reasoner to a set of RDF data to process.
The reasoner may already have been bound to specific rules or ontology
axioms (encoded in RDF) through earlier bindRuleset calls.
Parameters: data - the RDF data to be processed, some reasoners may restrictthe range of RDF which is legal here (e.g. | public Reasoner | bindSchema(Graph tbox) Precompute the implications of a schema graph. | protected boolean | doSetParameter(Property parameter, Object value) Internal version of setParameter that does not directly raise an
exception on parameters it does not reconize. | protected boolean | doSetResourceParameter(Property parameter, Resource value) | protected LPRuleStore | getBruleStore() Return the prepared backward only rules. | protected synchronized InfGraph | getPreload() Get the single static precomputed rule closure. | public void | removePreprocessingHook(RulePreprocessHook hook) Remove a preprocessing hook. | public void | setFunctorFiltering(boolean param) Set to true to cause functor-valued literals to be dropped from rule output. | public void | setMode(RuleMode mode) Set the direction of rule inference desired.
If set to a pure mode (FORWARD, BACKWARD) then the rules will be
interpreted as operating in that direction which ever direction
they were written in. | public void | setOWLTranslation(boolean enableOWLTranslation) Set to true to enable translation of selected parts of an OWL schema
to additional rules. | public void | setRules(List rules) Set (or change) the rule set that this reasoner should execute. | public void | setTransitiveClosureCaching(boolean enableTGCCaching) Set to true to enable caching of subclass/subproperty lattices in a
specialized cache rather than using the rule systems. |
BACKWARD | final public static RuleMode BACKWARD(Code) | | Constant - the mode description for pure backward chaining
|
FORWARD | final public static RuleMode FORWARD(Code) | | Constant - the mode description for pure forward chaining
|
FORWARD_RETE | final public static RuleMode FORWARD_RETE(Code) | | Constant - the mode description for pure forward chaining, using RETE engine
|
HYBRID | final public static RuleMode HYBRID(Code) | | Constant - the mode description for mixed forward/backward, this is the default mode
|
bRuleStore | protected LPRuleStore bRuleStore(Code) | | Prepared set of rules used for Backward-only mode
|
cachePreload | final protected static boolean cachePreload(Code) | | Flag, if true we cache the closure of the pure rule set with its axioms
|
enableOWLTranslation | protected boolean enableOWLTranslation(Code) | | Flag, if true then rules will be augmented by OWL translations of the schema
|
enableTGCCaching | protected boolean enableTGCCaching(Code) | | Flag, if true then subClass and subProperty lattices will be optimized using TGCs, only applicable to HYBRID reasoners
|
filterFunctors | public boolean filterFunctors(Code) | | Flag, if true then find results will be filtered to remove functors and illegal RDF
|
mode | protected RuleMode mode(Code) | | the current rule mode
|
preprocessorHooks | protected HashSet preprocessorHooks(Code) | | Optional set of preprocessing hooks to be run in sequence during preparation time, only applicable to HYBRID modes
|
GenericRuleReasoner | public GenericRuleReasoner(List rules)(Code) | | Constructor. This is the raw version that does not reference a ReasonerFactory
and so has no capabilities description.
Parameters: rules - a list of Rule instances which defines the ruleset to process |
GenericRuleReasoner | public GenericRuleReasoner(ReasonerFactory factory, Resource configuration)(Code) | | Constructor
Parameters: factory - the parent reasoner factory which is consulted to answer capability questions Parameters: configuration - RDF node to configure the rule set and mode, can be null |
GenericRuleReasoner | public GenericRuleReasoner(List rules, ReasonerFactory factory)(Code) | | Constructor
Parameters: rules - a list of Rule instances which defines the ruleset to process Parameters: factory - the parent reasoner factory which is consulted to answer capability questions |
GenericRuleReasoner | protected GenericRuleReasoner(List rules, Graph schemaGraph, ReasonerFactory factory, RuleMode mode)(Code) | | Internal constructor, used to generated a partial binding of a schema
to a rule reasoner instance.
|
addPreprocessingHook | public void addPreprocessingHook(RulePreprocessHook hook)(Code) | | Add a new preprocessing hook defining an operation that
should be run when the inference graph is being prepared. This can be
used to generate additional data-dependent rules or translations.
This is only guaranted to be implemented for the HYBRID mode.
|
bind | public InfGraph bind(Graph data) throws ReasonerException(Code) | | Attach the reasoner to a set of RDF data to process.
The reasoner may already have been bound to specific rules or ontology
axioms (encoded in RDF) through earlier bindRuleset calls.
Parameters: data - the RDF data to be processed, some reasoners may restrictthe range of RDF which is legal here (e.g. syntactic restrictions in OWL). an inference graph through which the data+reasoner can be queried. throws: ReasonerException - if the data is ill-formed according to theconstraints imposed by this reasoner. |
bindSchema | public Reasoner bindSchema(Graph tbox) throws ReasonerException(Code) | | Precompute the implications of a schema graph. The statements in the graph
will be combined with the data when the final InfGraph is created.
|
doSetParameter | protected boolean doSetParameter(Property parameter, Object value)(Code) | | Internal version of setParameter that does not directly raise an
exception on parameters it does not reconize.
false if the parameter was not recognized |
getBruleStore | protected LPRuleStore getBruleStore()(Code) | | Return the prepared backward only rules.
|
getPreload | protected synchronized InfGraph getPreload()(Code) | | Get the single static precomputed rule closure.
|
removePreprocessingHook | public void removePreprocessingHook(RulePreprocessHook hook)(Code) | | Remove a preprocessing hook. defining an operation that
|
setFunctorFiltering | public void setFunctorFiltering(boolean param)(Code) | | Set to true to cause functor-valued literals to be dropped from rule output.
Default is true.
|
setMode | public void setMode(RuleMode mode)(Code) | | Set the direction of rule inference desired.
If set to a pure mode (FORWARD, BACKWARD) then the rules will be
interpreted as operating in that direction which ever direction
they were written in. In HYBRID mode then the direction of the rule
itself which control whether it is used in forward or backward mode.
In addition, HYBRID mode allows forward rules to generate addition
backward rules.
|
setOWLTranslation | public void setOWLTranslation(boolean enableOWLTranslation)(Code) | | Set to true to enable translation of selected parts of an OWL schema
to additional rules. At present only intersction statements are handled this way.
The translation is only applicable in HYBRID mode.
|
setRules | public void setRules(List rules)(Code) | | Set (or change) the rule set that this reasoner should execute.
This will not affect inference models already created from this reasoner.
Parameters: rules - a list of Rule objects |
setTransitiveClosureCaching | public void setTransitiveClosureCaching(boolean enableTGCCaching)(Code) | | Set to true to enable caching of subclass/subproperty lattices in a
specialized cache rather than using the rule systems. This has substantially
higher performance but it is done as a separate initialization pass and so
can only work correct with some rule sets. This is only guaranteed to be implemented
for the HYBRID mode.
|
|
|