Interface RdfTriple

  • All Superinterfaces:
    RdfTerm
    All Known Subinterfaces:
    RdfQuad
    All Known Implementing Classes:
    Quad, Triple

    public interface RdfTriple
    extends RdfTerm
    Represents an immutable RDF triple, consisting of a subject, predicate, and object.

    An RdfTriple models a single statement in an RDF graph. Each triple is composed of:

    • A subject that identifies what the statement is about.
    • A predicate that indicates the relationship or property.
    • An object that provides the value or target of the statement.

    This interface extends RdfTerm and provides methods to access each component of the triple. It also identifies itself as an RDF triple via the isTriple() method.

    Experimental support for RDF-star (RDF 1.2) allows the object of a triple to be another RdfTriple.

    See Also:
    RDF 1.1 Triple
    • Method Detail

      • subject

        RdfResource subject()
        Returns the subject of the triple.

        The subject is either an absolute IRI or a blank node identifier, denoting the resource being described by the statement.

        Returns:
        a RdfResource representing the subject of the triple; never null
      • predicate

        RdfResource predicate()
        Returns the predicate of the triple.

        The predicate is an absolute IRI that specifies the property or relationship between the subject and the object of the triple.

        Returns:
        a RdfResource representing the predicate of the triple; never null
      • object

        RdfTerm object()
        Returns the object of the triple.

        The object can be:

        Returns:
        a RdfTerm representing the object of the triple; never null
      • isTriple

        default boolean isTriple()
        Description copied from interface: RdfTerm
        Indicates whether this term is an RDF triple.

        RDF triples are supported for RDF-star (RDF 1.2) compatibility.

        Specified by:
        isTriple in interface RdfTerm
        Returns:
        true if the term is an RdfTriple; false otherwise.