Package org.apache.jena.graph
Class Triple
java.lang.Object
org.apache.jena.graph.Triple
- All Implemented Interfaces:
Serializable
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.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A Field is a selector from Triples; it allows selectors to be passed around as if they were functions, hooray. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Triple
static Triple
createMatch
(Node s, Node p, Node o) boolean
Answer true ifo
is a Triple with the same subject, predicate, and object as this triple.Return object or null, not Node.ANYReturn predicate or null, not Node.ANYReturn subject or null, not Node.ANYfinal Node
final Node
final Node
int
hashCode()
The hash-code of a triple is the hash-codes of its components munged together: see hashCode(S, P, O).static int
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
boolean
boolean
Does this triple, used as a pattern match, the other triple (usually a ground triple)boolean
boolean
boolean
Answer true iff this triple has subject s, predicate p, and object o.boolean
toString()
return a human-readable string "subject @predicate object" describing the triple
-
Field Details
-
ANY
A Triple that is wildcarded in all fields.
-
-
Constructor Details
-
Triple
-
-
Method Details
-
toString
return a human-readable string "subject @predicate object" describing the triple -
getSubject
- Returns:
- the subject of the triple
-
getPredicate
- Returns:
- the predicate of the triple
-
getObject
- Returns:
- the object of the triple
-
getMatchSubject
Return subject or null, not Node.ANY -
getMatchPredicate
Return predicate or null, not Node.ANY -
getMatchObject
Return object or null, not Node.ANY -
isConcrete
public boolean isConcrete() -
equals
Answer true ifo
is a Triple with the same subject, predicate, and object as this triple. -
sameAs
Answer true iff this triple has subject s, predicate p, and object o. -
matches
Does this triple, used as a pattern match, the other triple (usually a ground triple) -
matches
-
subjectMatches
-
predicateMatches
-
objectMatches
-
hashCode
public int hashCode()The hash-code of a triple is the hash-codes of its components munged together: see hashCode(S, P, O). -
hashCode
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. -
create
-
createMatch
-