| java.lang.Object com.hp.hpl.jena.reasoner.TriplePattern
All known Subclasses: com.hp.hpl.jena.reasoner.rulesys.impl.MutableTriplePattern,
TriplePattern | public class TriplePattern implements ClauseEntry(Code) | | Datastructure which defines a triple pattern as used in simple
rules and in find interfaces.
Wildcards are recorded by using Node_RuleVariable entries rather than
nulls because they can be named. If a null is specified that is
converted to a variable of name "". Note that whilst some engines might simply
require Node_Variables the forward engine requires variables represented using
the more specialized subclass - Node_RuleVariable.
It would make more sense to have TriplePattern subclass Triple
but that is final for some strange reason.
author: Dave Reynolds version: $Revision: 1.28 $ on $Date: 2008/01/02 12:07:00 $ |
Constructor Summary | |
public | TriplePattern(Node subject, Node predicate, Node object) Constructor - builds a pattern from three nodes,
use Node_RuleVariables as variables, use a variable
with an empty name as a wildcard, can also use null
as a wildcard. | public | TriplePattern(TripleMatch match) Constructor - builds a pattern from a standard triple match. | public | TriplePattern(Triple match) Constructor - builds a dgenerate pattern from a simple triple. |
object | protected Node object(Code) | | The object element of the pattern
|
predicate | protected Node predicate(Code) | | The predicate element of the pattern
|
subject | protected Node subject(Code) | | The subject element of the pattern
|
TriplePattern | public TriplePattern(Node subject, Node predicate, Node object)(Code) | | Constructor - builds a pattern from three nodes,
use Node_RuleVariables as variables, use a variable
with an empty name as a wildcard, can also use null
as a wildcard.
|
TriplePattern | public TriplePattern(TripleMatch match)(Code) | | Constructor - builds a pattern from a standard triple match.
Node that any filter part of the triple match will not be
represented within the pattern and will need to be checked
for separately.
|
TriplePattern | public TriplePattern(Triple match)(Code) | | Constructor - builds a dgenerate pattern from a simple triple.
This would be much easier if we merged Triples and TriplePatterns!
|
asTriple | public Triple asTriple()(Code) | | Return the triple pattern as a triple
|
asTripleMatch | public TripleMatch asTripleMatch()(Code) | | Return the triple pattern as a triple match
|
compatibleWith | public boolean compatibleWith(TriplePattern pattern)(Code) | | Compare two patterns for compatibility - i.e. potentially unifiable.
Two patterns are "compatible" in the sense we mean here
if all their ground terms match. A variable in either pattern
can match a ground term or a variable in the other. We are not,
currently, checking for multiple occurances of the same variable.
Functor-valued object literals are treated as a special case which
are only checked for name/arity matching.
|
equals | public boolean equals(Object o)(Code) | | Equality override - used so that TriplePattern variants (same to within variable renaming) test as equals
|
getObject | public Node getObject()(Code) | | Returns the object.
Node |
getPredicate | public Node getPredicate()(Code) | | Returns the predicate.
Node |
getSubject | public Node getSubject()(Code) | | Returns the subject.
Node |
hashCode | public int hashCode()(Code) | | hash function override
|
isGround | public boolean isGround()(Code) | | Test if the pattern is ground, contains no variables.
|
isLegal | public boolean isLegal()(Code) | | Check a pattern to see if it is legal, used to exclude backchaining goals that
could never be satisfied. A legal pattern cannot have literals in the subject or
predicate positions and is not allowed nested functors in the object.
|
sameAs | public boolean sameAs(Object o)(Code) | | Compare triple patterns, taking into account variable indices.
The equality function ignores differences between variables.
|
simplePrintString | public static String simplePrintString(Triple t)(Code) | | Simplified printable name for a triple
|
simplePrintString | public static String simplePrintString(Node n)(Code) | | Simplified printable name for a node
|
subsumes | public boolean subsumes(TriplePattern arg)(Code) | | Compare two patterns and return true if arg is a more
specific (more grounded) version of this one.
Does not handle functors.
|
variantOf | public boolean variantOf(TriplePattern pattern)(Code) | | Test if a pattern is just a variant of this pattern. I.e. it is the same
up to variable renaming. This takes into account multiple occurances
of the same variable.
|
|
|