com.hp.hpl.jena.reasoner.rdfsReasoner1
Class RDFSInfGraph

java.lang.Object
  extended bycom.hp.hpl.jena.graph.impl.GraphBase
      extended bycom.hp.hpl.jena.reasoner.BaseInfGraph
          extended bycom.hp.hpl.jena.reasoner.rdfsReasoner1.RDFSInfGraph
All Implemented Interfaces:
Graph, InfGraph

public class RDFSInfGraph
extends BaseInfGraph

An RDFS reasoner that has been bound to both a TBox and an ABox. It cannot be bound any futher. Once this Bound reasoner has been created all the class, property and associated declarations have been extracted and cached and all queries are answerable directly from the cached results or from query rewrites.

Initially the subClass/subProperty caches are shared with the parent RDFSReasoner so they can be shared across instance data. However, if any update includes any such declarations then the caches have to be cloned and separated.

Version:
$Revision: 1.14 $ on $Date: 2003/06/24 15:47:04 $
Author:
Dave Reynolds

Field Summary
 
Fields inherited from interface com.hp.hpl.jena.graph.Graph
ADD, DELETE, ORDERED, SIZE
 
Constructor Summary
RDFSInfGraph(RDFSReasoner reasoner, Graph data)
          Constructor
 
Method Summary
 void addBRule(BRWRule rule)
          Add a new backchaining rule into the rule set.
 void assertTriple(Triple t)
          Assert a triple into the triple cache.
 ExtendedIterator findNested(TriplePattern pattern, Finder continuation, java.util.HashSet firedRules)
          Variant on find called by backward rules, additional argument used to pass set of instantiated rules to prevent run-away rule firing.
 ExtendedIterator findProperties()
          Variant on find called by special backward rules that need to list all pre-registered properties.
 ExtendedIterator findRawWithContinuation(TriplePattern pattern, Finder continuation)
          Variant on find called by special backward rules that only access the raw data and axioms and bypass further rules
 ExtendedIterator 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.
 boolean getScanProperties()
          Returns the scanProperties flag.
 Graph getSchemaGraph()
          Return the schema graph, if any, bound into this inference graph.
 boolean isProperty(Node prop)
          Variant on find called by special backward rules that need to list check for a specific preregistered property.
 void prepare()
          Perform any initial processing and caching.
 void setScanProperties(boolean scanProperties)
          Sets the scanProperties flag If this is set to true then when a reasoner instance is constructed the whole data graph is scanned to detect all properties and the results are cached.
 java.lang.String toString()
          Printable version of the whole reasoner state.
 ValidityReport validate()
          Test the consistency of the bound data.
 
Methods inherited from class com.hp.hpl.jena.reasoner.BaseInfGraph
add, capabilities, cloneWithPremises, contains, contains, delete, find, find, find, find, getDerivation, getGlobalProperty, getRawGraph, getReasoner, rebind, rebind, reset, setDerivationLogging, size, testGlobalProperty
 
Methods inherited from class com.hp.hpl.jena.graph.impl.GraphBase
close, dependsOn, getBulkUpdateHandler, getCapabilities, getEventManager, getPrefixMapping, getReifier, getTransactionHandler, isIsomorphicWith, notifyAdd, notifyDelete, performAdd, performDelete, queryHandler, withReification
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.jena.graph.Graph
close, dependsOn, getBulkUpdateHandler, getCapabilities, getEventManager, getPrefixMapping, getReifier, getTransactionHandler, isIsomorphicWith, queryHandler
 

Constructor Detail

RDFSInfGraph

public RDFSInfGraph(RDFSReasoner reasoner,
                    Graph data)
Constructor

Parameters:
data - the raw data graph being bound to the reasoner
reasoner - the RDFSReasoner which spawned this InfGraph
Method Detail

getScanProperties

public boolean getScanProperties()
Returns the scanProperties flag.

If this is set to true then when a reasoner instance is constructed the whole data graph is scanned to detect all properties and the results are cached. This is expensive but without this some cases of rdf:_n properties will not be handled.

This method is just here for development purposes and will be replaced by the configuration machinery

Returns:
boolean

setScanProperties

public void setScanProperties(boolean scanProperties)
Sets the scanProperties flag

If this is set to true then when a reasoner instance is constructed the whole data graph is scanned to detect all properties and the results are cached. This is expensive but without this some cases of rdf:_n properties will not be handled.

This method is just here for development purposes and will be replaced by the configuration machinery

Parameters:
scanProperties - The scanProperties to set

getSchemaGraph

public Graph getSchemaGraph()
Return the schema graph, if any, bound into this inference graph.

Specified by:
getSchemaGraph in class BaseInfGraph

prepare

public void prepare()
Perform any initial processing and caching. This call is optional. Most engines either have negligable set up work or will perform an implicit "prepare" if necessary. The call is provided for those occasions where substantial preparation work is possible (e.g. running a forward chaining rule system) and where an application might wish greater control over when this prepration is done.

Specified by:
prepare in interface InfGraph
Overrides:
prepare in class BaseInfGraph

findWithContinuation

public ExtendedIterator 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. It will attempt to answer the pattern but if its answers are not known to be complete then it will also pass the request on to the nested Finder to append more results.

Specified by:
findWithContinuation in class BaseInfGraph
Parameters:
pattern - a TriplePattern to be matched against the data
continuation - 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.

findNested

public ExtendedIterator findNested(TriplePattern pattern,
                                   Finder continuation,
                                   java.util.HashSet firedRules)
Variant on find called by backward rules, additional argument used to pass set of instantiated rules to prevent run-away rule firing.


findRawWithContinuation

public ExtendedIterator findRawWithContinuation(TriplePattern pattern,
                                                Finder continuation)
Variant on find called by special backward rules that only access the raw data and axioms and bypass further rules


findProperties

public ExtendedIterator findProperties()
Variant on find called by special backward rules that need to list all pre-registered properties. The iterator returns Nodes not triples.


isProperty

public boolean isProperty(Node prop)
Variant on find called by special backward rules that need to list check for a specific preregistered property.


validate

public ValidityReport validate()
Test the consistency of the bound data. This normally tests the validity of the bound instance data against the bound schema data.

Specified by:
validate in interface InfGraph
Overrides:
validate in class BaseInfGraph
Returns:
a ValidityReport structure

assertTriple

public void assertTriple(Triple t)
Assert a triple into the triple cache. Called by FRules when they fire


addBRule

public void addBRule(BRWRule rule)
Add a new backchaining rule into the rule set. Called by FRules when they fire


toString

public java.lang.String toString()
Printable version of the whole reasoner state. Used during debugging



Copyright © 2001-2003 Hewlett-Packard. All Rights Reserved.