Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.hp.hpl.jena.reasoner.rulesys
Class LPBackwardRuleReasoner

    java.lang.Object
      com.hp.hpl.jena.reasoner.rulesys.LPBackwardRuleReasoner

All Implemented Interfaces:
  Reasoner

    public class LPBackwardRuleReasoner

extends java.lang.Object
implements Reasoner

Reasoner implementation which augments or transforms an RDF graph according to a set of rules. The rules are processed using a tabled LP backchaining interpreter which is implemented by the relvant InfGraph class.

Version:
  $Revision: 1.11 $ on $Date: 2008/01/02 12:07:47 $
Author:
  Dave Reynolds

Constructor Summary
`LPBackwardRuleReasoner(java.util.List rules)` Constructor.
`LPBackwardRuleReasoner(java.util.List rules, ReasonerFactory factory)` Constructor

Method Summary
`void` | `addDescription(Model configSpec, Resource base)` Add a configuration description for this reasoner into a partial configuration specification model.
`InfGraph` | `bind(Graph data)` Attach the reasoner to a set of RDF data to process.
`Reasoner` | `bindSchema(Graph tbox)` Precompute the implications of a schema graph.
`Reasoner` | `bindSchema(Model tbox)` Precompute the implications of a schema Model.
`Capabilities` | `getGraphCapabilities()` Return the Jena Graph Capabilties that the inference graphs generated by this reasoner are expected to conform to.
`Model` | `getReasonerCapabilities()` Return a description of the capabilities of this reasoner encoded in RDF.
`java.util.List` | `getRules()` Return the this of Rules used by this reasoner
`void` | `setDerivationLogging(boolean logOn)` Switch on/off drivation logging.
`void` | `setParameter(Property parameter, java.lang.Object value)` Set a configuration paramter for the reasoner.
`void` | `setTraceOn(boolean state)` Set the state of the trace flag.
`boolean` | `supportsProperty(Property property)` Determine whether the given property is recognized and treated specially by this reasoner.
`void` | `tablePredicate(Node predicate)` Register an RDF predicate as one whose presence in a goal should force the goal to be tabled.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### LPBackwardRuleReasoner

    public LPBackwardRuleReasoner(java.util.List rules)

  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

### LPBackwardRuleReasoner

    public LPBackwardRuleReasoner(java.util.List rules,
                                  ReasonerFactory factory)

  Constructor

  Parameters:
    `rules` - a list of Rule instances which defines the ruleset to process
    `factory` - the parent reasoner factory which is consulted to answer capability questions

Method Detail

### getReasonerCapabilities

    public Model getReasonerCapabilities()

  Return a description of the capabilities of this reasoner encoded in RDF. These capabilities may be static or may depend on configuration information supplied at construction time. May be null if there are no useful capabilities registered.

  Specified by:
    `getReasonerCapabilities` in interface `Reasoner`

### addDescription

    public void addDescription(Model configSpec,
                               Resource base)

  Add a configuration description for this reasoner into a partial configuration specification model.

  Specified by:
    `addDescription` in interface `Reasoner`
  Parameters:
    `configSpec` - a Model into which the configuration information should be placed
    `base` - the Resource to which the configuration parameters should be added.

### tablePredicate

    public void tablePredicate(Node predicate)

  Register an RDF predicate as one whose presence in a goal should force the goal to be tabled.

### supportsProperty

    public boolean supportsProperty(Property property)

  Determine whether the given property is recognized and treated specially by this reasoner. This is a convenience packaging of a special case of getCapabilities.

  Specified by:
    `supportsProperty` in interface `Reasoner`
  Parameters:
    `property` - the property which we want to ask the reasoner about, given as a Node since this is part of the SPI rather than API
  Returns:
    true if the given property is handled specially by the reasoner.

### bindSchema

    public Reasoner bindSchema(Graph tbox)
                        throws ReasonerException

  Precompute the implications of a schema graph. The statements in the graph will be combined with the data when the final InfGraph is created.

  Specified by:
    `bindSchema` in interface `Reasoner`
  Parameters:
    `tbox` - the ontology axioms or rule set encoded in RDF
  Returns:
    a reasoner instace which can be used to process a data graph
  Throws:
    `ReasonerException` - if the reasoner cannot be bound to a rule set in this way, for example if the underlying engine can only accept a single rule set in this way and one rule set has already been bound in of if the ruleset is illformed.

### bindSchema

    public Reasoner bindSchema(Model tbox)
                        throws ReasonerException

  Precompute the implications of a schema Model. The statements in the graph will be combined with the data when the final InfGraph is created.

  Specified by:
    `bindSchema` in interface `Reasoner`
  Parameters:
    `tbox` - the ontology axioms or rule set encoded in RDF
  Returns:
    a reasoner instace which can be used to process a data graph
  Throws:
    `ReasonerException` - if the reasoner cannot be bound to a rule set in this way, for example if the underlying engine can only accept a single rule set in this way and one rule set has already been bound in of if the ruleset is illformed.

### bind

    public InfGraph bind(Graph data)
                  throws ReasonerException

  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.

  Specified by:
    `bind` in interface `Reasoner`
  Parameters:
    `data` - the RDF data to be processed, some reasoners may restrict the range of RDF which is legal here (e.g. syntactic restrictions in OWL).
  Returns:
    an inference graph through which the data+reasoner can be queried.
  Throws:
    `ReasonerException` - if the data is ill-formed according to the constraints imposed by this reasoner.

### getRules

    public java.util.List getRules()

  Return the this of Rules used by this reasoner

  Returns:
    a List of Rule objects

### setDerivationLogging

    public void setDerivationLogging(boolean logOn)

  Switch on/off drivation logging. If set to true then the InfGraph created from the bind operation will start life with recording of derivations switched on. This is currently only of relevance to rule-based reasoners.

  Default - false.

  Specified by:
    `setDerivationLogging` in interface `Reasoner`

### setTraceOn

    public void setTraceOn(boolean state)

  Set the state of the trace flag. If set to true then rule firings are logged out to the Log at "INFO" level.

### setParameter

    public void setParameter(Property parameter,
                             java.lang.Object value)

  Set a configuration paramter for the reasoner. In the case of the this reasoner there are no configuration parameters and this method is simply here to meet the interfaces specification

  Specified by:
    `setParameter` in interface `Reasoner`
  Parameters:
    `parameter` - the property identifying the parameter to be changed
    `value` - the new value for the parameter, typically this is a wrapped java object like Boolean or Integer.

### getGraphCapabilities

    public Capabilities getGraphCapabilities()

  Return the Jena Graph Capabilties that the inference graphs generated by this reasoner are expected to conform to.

  Specified by:
    `getGraphCapabilities` in interface `Reasoner`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP