Interface TripleTerm

All Superinterfaces:
Serializable, Value
All Known Implementing Classes:
AbstractTripleTerm, LmdbTripleTerm, MemTripleTerm, NativeTripleTerm, SimpleTripleTerm

@Experimental public interface TripleTerm extends Value
An embedded triple. Embedded triples have a subject, predicate and object. Unlike Statement, a triple never has an associated context.

Additional utility functionality for working with TripleTerm objects is available in the Statements and Values utility classes.

Author:
Pavel Mihaylov
  • Method Details

    • isTripleTerm

      default boolean isTripleTerm()
      Description copied from interface: Value
      Check 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.

      Specified by:
      isTripleTerm in interface Value
      Returns:
      true if instance of TripleTerm
    • getType

      default Value.Type getType()
      Specified by:
      getType in interface Value
    • 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:
      equals in class Object
      Parameters:
      other - the object to compare this triple to
      Returns:
      true if the other object is an instance of TripleTerm and if their subjects, predicates and objects are equal; false otherwise
    • hashCode

      int hashCode()
      Computes the hash code of this triple.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code for this triple computed as Objects.hash( getSubject(), getPredicate(), getObject())