|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hp.hpl.jena.graph.Triple
public class Triple
Triples are the basis for RDF statements; they have a subject, predicate, and object field (all nodes) and express the notion that the relationship named by the predicate holds between the subject and the object.
Nested Class Summary | |
---|---|
static class |
Triple.Field
A Field is a selector from Triples; it allows selectors to be passed around as if they were functions, hooray. |
Field Summary | |
---|---|
static Triple |
ANY
A Triple that is wildcarded in all fields. |
static com.hp.hpl.jena.util.iterator.Map1<Triple,Node> |
getObject
|
static com.hp.hpl.jena.util.iterator.Map1<Triple,Node> |
getPredicate
|
static com.hp.hpl.jena.util.iterator.Map1<Triple,Node> |
getSubject
|
static com.hp.hpl.jena.util.iterator.ExtendedIterator<Triple> |
None
A triple-iterator with no elements. |
Constructor Summary | |
---|---|
Triple(Node s,
Node p,
Node o)
|
Method Summary | |
---|---|
Triple |
asTriple()
Answer a Triple capturing this match. |
static Triple |
create(Node s,
Node p,
Node o)
Factory method for creating triples, allows caching opportunities. |
static Triple |
createMatch(Node s,
Node p,
Node o)
|
boolean |
equals(Object o)
Answer true if o is a Triple with the same subject, predicate,
and object as this triple. |
Node |
getMatchObject()
If it is known that all triples selected by this match will have a common object, return that node, otherwise return null |
Node |
getMatchPredicate()
If it is known that all triples selected by this match will have a common predicate, return that node, otherwise return null |
Node |
getMatchSubject()
If it is known that all triples selected by this filter will have a common subject, return that node, otherwise return null |
Node |
getObject()
|
Node |
getPredicate()
|
Node |
getSubject()
|
int |
hashCode()
The hash-code of a triple is the hash-codes of its components munged together: see hashCode(S, P, O). |
static int |
hashCode(Node s,
Node p,
Node o)
Return the munged hashCodes of the specified nodes, an exclusive-or of the slightly-shifted component hashcodes; this means (almost) all of the bits count, and the order matters, so (S @P O) has a different hash from (O @P S), etc. |
boolean |
isConcrete()
|
boolean |
matches(Node s,
Node p,
Node o)
|
boolean |
matches(Triple other)
|
boolean |
objectMatches(Node o)
|
boolean |
predicateMatches(Node p)
|
boolean |
sameAs(Node s,
Node p,
Node o)
Answer true iff this triple has subject s, predicate p, and object o. |
boolean |
subjectMatches(Node s)
|
String |
toString()
return a human-readable string "subject @predicate object" describing the triple |
String |
toString(PrefixMapping pm)
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final com.hp.hpl.jena.util.iterator.ExtendedIterator<Triple> None
public static final com.hp.hpl.jena.util.iterator.Map1<Triple,Node> getSubject
public static final com.hp.hpl.jena.util.iterator.Map1<Triple,Node> getPredicate
public static final com.hp.hpl.jena.util.iterator.Map1<Triple,Node> getObject
public static final Triple ANY
Constructor Detail |
---|
public Triple(Node s, Node p, Node o)
Method Detail |
---|
public String toString()
toString
in class Object
public String toString(PrefixMapping pm)
public final Node getSubject()
public final Node getPredicate()
public final Node getObject()
public Node getMatchSubject()
TripleMatch
getMatchSubject
in interface TripleMatch
public Node getMatchPredicate()
TripleMatch
getMatchPredicate
in interface TripleMatch
public Node getMatchObject()
TripleMatch
getMatchObject
in interface TripleMatch
public Triple asTriple()
TripleMatch
asTriple
in interface TripleMatch
public boolean isConcrete()
public boolean equals(Object o)
o
is a Triple with the same subject, predicate,
and object as this triple.
equals
in class Object
public boolean sameAs(Node s, Node p, Node o)
public boolean matches(Triple other)
public boolean matches(Node s, Node p, Node o)
public boolean subjectMatches(Node s)
public boolean predicateMatches(Node p)
public boolean objectMatches(Node o)
public int hashCode()
hashCode
in class Object
public static int hashCode(Node s, Node p, Node o)
public static Triple create(Node s, Node p, Node o)
public static Triple createMatch(Node s, Node p, Node o)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |