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 classA Field is a selector from Triples; it allows selectors to be passed around as if they were functions. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic TripleCreate triple, Nulls are not permnitted.static TriplecreateMatch(Node s, Node p, Node o) Create triple, Nulls are converted toNode.ANY.booleanAnswer true ifois a Triple with the same subject, predicate, and object as this triple.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.UsegetPredicate().Deprecated, for removal: This API element is subject to removal in a future version.UsegetSubject().final Nodefinal Nodefinal NodeinthashCode()The hash-code of a triple is the hash-codes of its components munged together: see hashCode(S, P, O).static intReturn 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.booleanbooleanbooleanDoes this triple, match the other triple, allowing for wildcards.booleanAnswer true iff this triple has subject s, predicate p, and object o.toString()return a human-readable string "subject @predicate object" describing the triple
-
Field Details
-
ANY
A Triple that hasNode.ANYin all fields.
-
-
Method Details
-
create
Create triple, Nulls are not permnitted. -
createMatch
Create triple, Nulls are converted toNode.ANY. -
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
Deprecated, for removal: This API element is subject to removal in a future version.UsegetSubject().Return subject or null, not Node.ANY -
getMatchPredicate
Deprecated, for removal: This API element is subject to removal in a future version.UsegetPredicate().Return predicate or null, not Node.ANY. -
getMatchObject
Deprecated, for removal: This API element is subject to removal in a future version.UsegetObject().Return object or null, not Node.ANY. -
isConcrete
public boolean isConcrete() -
equals
Answer true ifois 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. The relationship is "same term". Usematches(Node, Node, Node)for wildcards. -
matches
Does this triple, match the other triple, allowing for wildcards. The wildcard node isNode.ANYand it matches any node, including a wildcard. Both this triple and the argument triple may contain wildcards, that is "matches" is symmetric:this.matches(that) == that.matches(this). -
matches
-
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.
-
getObject().