Package org.eclipse.rdf4j.model
Interface Triple
-
- All Superinterfaces:
Resource,Serializable,Value
- All Known Implementing Classes:
AbstractTriple,MemTriple,SimpleTriple
@Experimental public interface Triple extends Resource
An RDF-star embedded triple. Embedded triples have a subject, predicate and object. UnlikeStatement, a triple never has an associated context.Additional utility functionality for working with
Tripleobjects is available in theStatementsandValuesutility classes.- Author:
- Pavel Mihaylov
- See Also:
- RDF-star and SPARQL-star Draft Community Group Report
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleanequals(Object other)Compares this triple to another object.ValuegetObject()Gets the object of this triple.IRIgetPredicate()Gets the predicate of this triple.ResourcegetSubject()Gets the subject of this triple.inthashCode()Computes the hash code of this triple.default booleanisTriple()Check if the object is an instance of the given type.-
Methods inherited from interface org.eclipse.rdf4j.model.Resource
isResource
-
Methods inherited from interface org.eclipse.rdf4j.model.Value
isBNode, isIRI, isLiteral, stringValue
-
-
-
-
Method Detail
-
isTriple
default boolean isTriple()
Description copied from interface:ValueCheck if the object is an instance of the given type. Typically 2x than using instanceof.For implementers: This default implementation is overridden in the repsective sub-interface.
-
getSubject
Resource getSubject()
Gets the subject of this triple.- Returns:
- The triple's subject.
-
getPredicate
IRI getPredicate()
Gets the predicate of this triple.- Returns:
- The triple's predicate.
-
getObject
Value getObject()
Gets the object of this triple.- Returns:
- The triple's object.
-
equals
boolean equals(Object other)
Compares this triple to another object.- Overrides:
equalsin classObject- Parameters:
other- the object to compare this triple to- Returns:
trueif theotherobject is an instance ofTripleand if their subjects, predicates and objects are equal;falseotherwise
-
hashCode
int hashCode()
Computes the hash code of this triple.- Overrides:
hashCodein classObject- Returns:
- a hash code for this triple computed as
Objects.hash(getSubject(),getPredicate(),getObject())
-
-