| java.lang.Object com.hp.hpl.jena.reasoner.rdfsReasoner1.BRWRule
All known Subclasses: com.hp.hpl.jena.reasoner.rdfsReasoner1.PropertyBRWRule, com.hp.hpl.jena.reasoner.rdfsReasoner1.ResourceBRWRule,
BRWRule | public class BRWRule (Code) | | Datastructure to hold a trivial backward rewrite rule.
The rules take the form "pattern <- pattern" where the pattern
is is a triple pattern with variables. The head pattern uses the
variables s/p/o to refer to the subject/predicate/object parts of the
body pattern. Similarly, the body pattern uses s/p/o to refer to
the corresponding parts of the query being processed.
author: Dave Reynolds version: $Revision: 1.13 $ on $Date: 2008/01/02 12:06:44 $ |
completeFor | public boolean completeFor(TriplePattern query)(Code) | | Return true if this rule is a a complete solution to the given
query and the router need look no further
|
equals | public boolean equals(Object o)(Code) | | Equality override
|
execute | public ExtendedIterator execute(TriplePattern query, InfGraph infGraph, Finder data, HashSet firedRules)(Code) | | Use the rule to implement the given query. This will
instantiate the rule against the query, run the new query
against the whole reasoner+rawdata again and then rewrite the
results from that query according the rule.
Parameters: query - the query being processed Parameters: infGraph - the parent infGraph that invoked us, will be called recursively Parameters: data - the raw data graph which gets passed back to the reasoner as part of the recursive invocation Parameters: firedRules - set of rules which have already been fired and should now be blocked a ExtendedIterator which aggregates the matches and rewrites themaccording to the rule |
hashCode | public int hashCode()(Code) | | hash function override
|
instantiate | protected static Node instantiate(Node elt, Triple value)(Code) | | instantiate a rule body element against a query ground value
|
makeRule | public static BRWRule makeRule(String rulespec)(Code) | | Factory method that builds a rule instance by parsing
a simple string representation of the form:
?s prop foo <- ?a ns:prop _
Variables are either _ or ?x, uri's are either simple strings (no spaces)
or qnames. The prefix in qnames are restricted to rdf and rdfs.
Minimal error checking.
|
parseNode | public static Node parseNode(String token)(Code) | | Assistant method to makeRule than parses a token as a node.
|
toString | public String toString()(Code) | | Printable string form
|
|
|