Interface RdfQuadSet

  • All Known Implementing Classes:
    OrderedQuadDataset, OrderedQuadSet, QuadDataset, QuadSet

    public interface RdfQuadSet
    Represents a collection of RDF Quad statements.

    An RdfQuadSet is a set of RdfQuad objects, which are immutable N-Quad statements consisting of a subject, predicate, object, and an optional graph name. This interface provides methods for querying the presence of quads and streaming them.

    Implementations of this interface may optionally support adding or removing quads.

    • Method Detail

      • contains

        boolean contains​(RdfQuad quad)
        Checks if the set contains the specified RdfQuad.
        Parameters:
        quad - the RdfQuad to check
        Returns:
        true if the set contains the specified quad, false otherwise
      • stream

        java.util.stream.Stream<RdfQuad> stream()
        Returns a Stream of the RDF quads in this set.

        The stream can be used for operations such as filtering or mapping over the quads.

        Returns:
        a stream of RdfQuad objects in the set
      • add

        default boolean add​(RdfQuad quad)
        Adds RdfQuad to the RDF graph.

        This operation is unsupported by default and will throw an UnsupportedOperationException. Implementations that support modification of the set should override this method.

        Parameters:
        quad - the RdfQuad to add
        Returns:
        true if the quad was successfully added (implementation dependent)
        Throws:
        java.lang.UnsupportedOperationException - if modification of the set is not supported
      • remove

        default boolean remove​(RdfQuad quad)
        Removes RdfQuad from the RDF graph.

        This operation is unsupported by default and will throw an UnsupportedOperationException. Implementations that support removal of quads should override this method.

        Parameters:
        quad - the RdfQuad to remove
        Returns:
        true if the quad was successfully removed (implementation dependent)
        Throws:
        java.lang.UnsupportedOperationException - if removal of the quad is not supported