Class OrderedQuadDataset

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(RdfQuad nquad)
      Adds RdfQuad to the RDF graph.
      boolean contains​(RdfQuad quad)
      Checks if the set contains the specified RdfQuad.
      RdfGraph defaultGraph()
      Returns the default graph of the dataset.
      java.util.Set<RdfResource> graphNames()
      Returns the set of graph names for all named graphs in the dataset.
      java.util.Iterator<RdfQuad> iterator()  
      java.util.Optional<RdfGraph> namedGraph​(RdfResource graphName)
      Returns the named graph corresponding to the provided graph name.
      boolean remove​(RdfQuad quad)
      Removes RdfQuad from the RDF graph.
      java.util.stream.Stream<RdfQuad> stream()
      Returns a Stream of the RDF quads in this set.
      • Methods inherited from class java.util.LinkedHashSet

        spliterator
      • Methods inherited from class java.util.HashSet

        clear, clone, contains, isEmpty, remove, size
      • Methods inherited from class java.util.AbstractSet

        equals, hashCode, removeAll
      • Methods inherited from class java.util.AbstractCollection

        addAll, containsAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Set

        addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray
    • Constructor Detail

      • OrderedQuadDataset

        public OrderedQuadDataset()
    • Method Detail

      • defaultGraph

        public RdfGraph defaultGraph()
        Description copied from interface: RdfDataset
        Returns the default graph of the dataset.

        The default graph is the unnamed graph in the dataset. It contains RDF triples that are not part of any named graph.

        Specified by:
        defaultGraph in interface RdfDataset
        Returns:
        the RdfGraph representing the default graph; never null
      • add

        public boolean add​(RdfQuad nquad)
        Description copied from interface: RdfQuadSet
        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.

        Specified by:
        add in interface java.util.Collection<RdfQuad>
        Specified by:
        add in interface RdfQuadSet
        Specified by:
        add in interface java.util.Set<RdfQuad>
        Overrides:
        add in class java.util.HashSet<RdfQuad>
        Parameters:
        nquad - the RdfQuad to add
        Returns:
        true if the quad was successfully added (implementation dependent)
      • graphNames

        public java.util.Set<RdfResource> graphNames()
        Description copied from interface: RdfDataset
        Returns the set of graph names for all named graphs in the dataset.

        Each name is represented as a RdfResource, which can be an IRI or a blank node identifier.

        Specified by:
        graphNames in interface RdfDataset
        Returns:
        an immutable Set of RdfResource graph names; empty if no named graphs are present.
      • namedGraph

        public java.util.Optional<RdfGraph> namedGraph​(RdfResource graphName)
        Description copied from interface: RdfDataset
        Returns the named graph corresponding to the provided graph name.

        If the dataset does not contain a named graph with the specified name, an empty Optional is returned.

        Specified by:
        namedGraph in interface RdfDataset
        Parameters:
        graphName - the RdfResource identifying the named graph
        Returns:
        an Optional containing the RdfGraph if present; otherwise, Optional.empty()
      • contains

        public boolean contains​(RdfQuad quad)
        Description copied from interface: RdfQuadSet
        Checks if the set contains the specified RdfQuad.
        Specified by:
        contains in interface RdfQuadSet
        Parameters:
        quad - the RdfQuad to check
        Returns:
        true if the set contains the specified quad, false otherwise
      • stream

        public java.util.stream.Stream<RdfQuad> stream()
        Description copied from interface: RdfQuadSet
        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.

        Specified by:
        stream in interface java.util.Collection<RdfQuad>
        Specified by:
        stream in interface RdfQuadSet
        Returns:
        a stream of RdfQuad objects in the set
      • iterator

        public java.util.Iterator<RdfQuad> iterator()
        Specified by:
        iterator in interface java.util.Collection<RdfQuad>
        Specified by:
        iterator in interface java.lang.Iterable<RdfQuad>
        Specified by:
        iterator in interface java.util.Set<RdfQuad>
        Overrides:
        iterator in class java.util.HashSet<RdfQuad>
      • remove

        public boolean remove​(RdfQuad quad)
        Description copied from interface: RdfQuadSet
        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.

        Specified by:
        remove in interface RdfQuadSet
        Parameters:
        quad - the RdfQuad to remove
        Returns:
        true if the quad was successfully removed (implementation dependent)