Class GraphDataset

    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      GraphDataset()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      RdfGraph defaultGraph()
      Returns the default graph of the dataset.
      GraphDataset defaultGraph​(RdfGraph graph)
      Replaces the default graph in the dataset with the specified graph.
      java.util.Set<RdfResource> graphNames()
      Returns the set of graph names for all named graphs in the dataset.
      java.util.Optional<RdfGraph> namedGraph​(RdfResource graphName)
      Returns the named graph corresponding to the provided graph name.
      GraphDataset namedGraph​(RdfResource graphName, RdfGraph graph)
      Adds or replaces a named graph in the dataset.
      • Methods inherited from class java.util.HashMap

        clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

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

        equals, hashCode
    • Constructor Detail

      • GraphDataset

        public GraphDataset()
    • 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
      • defaultGraph

        public GraphDataset defaultGraph​(RdfGraph graph)
        Description copied from interface: RdfDataset
        Replaces the default graph in the dataset with the specified graph.

        By default, this operation is unsupported and throws an UnsupportedOperationException. Implementations that support modification of the dataset should override this method.

        Specified by:
        defaultGraph in interface RdfDataset
        Parameters:
        graph - the RdfGraph to be set as the new default graph
        Returns:
        the updated RdfDataset instance
      • 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()
      • namedGraph

        public GraphDataset namedGraph​(RdfResource graphName,
                                       RdfGraph graph)
        Description copied from interface: RdfDataset
        Adds or replaces a named graph in the dataset.

        Associates the specified RdfGraph with the given RdfResource graph name. If a graph with the same name already exists, it will be replaced.

        By default, this operation is unsupported and throws an UnsupportedOperationException. Implementations that support modification of the dataset should override this method.

        Specified by:
        namedGraph in interface RdfDataset
        Parameters:
        graphName - the RdfResource identifying the named graph
        graph - the RdfGraph to associate with the specified name
        Returns:
        the updated RdfDataset instance