Interface DatasetGraph

All Superinterfaces:
org.apache.jena.atlas.lib.Closeable, Transactional
All Known Subinterfaces:
DatasetGraphBuffering, DatasetGraphWrapperView
All Known Implementing Classes:
BufferingDatasetGraph, DatasetGraphBase, DatasetGraphBaseFind, DatasetGraphCollection, DatasetGraphFilteredView, DatasetGraphInMemory, DatasetGraphMap, DatasetGraphMapLink, DatasetGraphNull, DatasetGraphOne, DatasetGraphQuads, DatasetGraphRDFS, DatasetGraphReadOnly, DatasetGraphSink, DatasetGraphTriplesQuads, DatasetGraphWrapper, DatasetGraphZero, DifferenceDatasetGraph, DyadicDatasetGraph, DynamicDatasets.DynamicDatasetGraph, IntersectionDatasetGraph, UnionDatasetGraph

public interface DatasetGraph extends Transactional, org.apache.jena.atlas.lib.Closeable
DatasetGraph: The graph representation of an RDF Dataset. See Dataset for the Model level of an RDF dataset.

Whether a dataset contains a graph if there are no triples is not defined; see the specific implementation.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.jena.sparql.core.Transactional

    Transactional.Promote
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
    Add a quad
    void
    add(Quad quad)
    Add a quad
    default void
    Add the src DatasetGraph to this one.
    void
    addGraph(org.apache.jena.graph.Node graphName, org.apache.jena.graph.Graph graph)
    Add the given graph to the dataset.
    void
    Remove everything - remove all named graphs, clear the default graph
    void
    Close the dataset
    boolean
    contains(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
    Test whether the dataset (including default graph) contains a quad - may include wildcards, Node.ANY or null
    boolean
    contains(Quad quad)
    Test whether the dataset contains a quad (including default graph)- may include wildcards, Node.ANY or null
    boolean
    containsGraph(org.apache.jena.graph.Node graphNode)
    Does the DatasetGraph contain a specific named graph? Whether a dataset contains a graph if there are no triples is not defined - see the specific implementation.
    void
    delete(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
    Delete a quad
    void
    delete(Quad quad)
    Delete a quad
    void
    deleteAny(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
    Delete any quads matching the pattern
    default Iterator<Quad>
    Iterate over all quads in the dataset graph
    find(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
    Find matching quads in the dataset (including default graph) - may include wildcards, Node.ANY or null
    find(Quad quad)
    Find matching quads in the dataset - may include wildcards, Node.ANY or null
    findNG(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
    Find matching quads in the dataset in named graphs only - may include wildcards, Node.ANY or null
    Get the context associated with this object - may be null
    org.apache.jena.graph.Graph
    Get the default graph as a Jena Graph
    org.apache.jena.graph.Graph
    getGraph(org.apache.jena.graph.Node graphNode)
    Get the graph named by graphNode : returns null when there is no such graph.
    org.apache.jena.shared.Lock
    Return a lock for the dataset to help with concurrency control
    org.apache.jena.graph.Graph
    Return a Graph that is the union of all named graphs in this dataset.
    boolean
    Test whether the dataset is empty
    Iterator<org.apache.jena.graph.Node>
    Iterate over all names of named graphs
    Prefixes for this DatasetGraph
    void
    removeGraph(org.apache.jena.graph.Node graphName)
    Remove all data associated with the named graph.
    long
    Get the size (number of named graphs) - may be -1 for unknown
    default Stream<Quad>
    Returns a Stream of Quads in this dataset.
    default Stream<Quad>
    stream(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
    Returns a Stream of Quads matching a pattern.
    default boolean
    Declare whether Transactional.abort() is supported.
    boolean
    A DatasetGraph supports transactions if it provides Transactional.begin()/ Transactional.commit()/Transactional.end().
  • Method Details

    • getDefaultGraph

      org.apache.jena.graph.Graph getDefaultGraph()
      Get the default graph as a Jena Graph
    • getGraph

      org.apache.jena.graph.Graph getGraph(org.apache.jena.graph.Node graphNode)
      Get the graph named by graphNode : returns null when there is no such graph. NB Whether a dataset contains a graph if there are no triples is not defined - see the specific implementation. Some datasets are "open" - they have all graphs even if no triples.
    • getUnionGraph

      org.apache.jena.graph.Graph getUnionGraph()
      Return a Graph that is the union of all named graphs in this dataset. This union graph is read-only (its prefix mapping in the current JVM may be changed but that may not persist).
    • containsGraph

      boolean containsGraph(org.apache.jena.graph.Node graphNode)
      Does the DatasetGraph contain a specific named graph? Whether a dataset contains a graph if there are no triples is not defined - see the specific implementation. Some datasets are "open" - they have all graphs even if no triples and this returns true always.
      Parameters:
      graphNode -
      Returns:
      boolean
    • addGraph

      void addGraph(org.apache.jena.graph.Node graphName, org.apache.jena.graph.Graph graph)
      Add the given graph to the dataset. Replaces any existing data for the named graph; to add data, get the graph and add triples to it, or add quads to the dataset. Do not assume that the same Java object is returned by getGraph(org.apache.jena.graph.Node)
    • removeGraph

      void removeGraph(org.apache.jena.graph.Node graphName)
      Remove all data associated with the named graph. This will include prefixes associated with the graph.
    • listGraphNodes

      Iterator<org.apache.jena.graph.Node> listGraphNodes()
      Iterate over all names of named graphs
    • add

      void add(Quad quad)
      Add a quad
    • delete

      void delete(Quad quad)
      Delete a quad
    • add

      void add(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
      Add a quad
    • addAll

      default void addAll(DatasetGraph src)
      Add the src DatasetGraph to this one.
    • delete

      void delete(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
      Delete a quad
    • deleteAny

      void deleteAny(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
      Delete any quads matching the pattern
    • find

      default Iterator<Quad> find()
      Iterate over all quads in the dataset graph
    • find

      Iterator<Quad> find(Quad quad)
      Find matching quads in the dataset - may include wildcards, Node.ANY or null
      See Also:
      • Graph.find(Triple)
    • find

      Iterator<Quad> find(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
      Find matching quads in the dataset (including default graph) - may include wildcards, Node.ANY or null
      See Also:
      • Graph.find(Node,Node,Node)
    • findNG

      Iterator<Quad> findNG(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
      Find matching quads in the dataset in named graphs only - may include wildcards, Node.ANY or null
      See Also:
      • Graph.find(Node,Node,Node)
    • stream

      default Stream<Quad> stream(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
      Returns a Stream of Quads matching a pattern.
      Returns:
      a stream of quads in this dataset matching the pattern.
    • stream

      default Stream<Quad> stream()
      Returns a Stream of Quads in this dataset.
      Returns:
      a stream of quads in this dataset.
    • contains

      boolean contains(org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
      Test whether the dataset (including default graph) contains a quad - may include wildcards, Node.ANY or null
    • contains

      boolean contains(Quad quad)
      Test whether the dataset contains a quad (including default graph)- may include wildcards, Node.ANY or null
    • clear

      void clear()
      Remove everything - remove all named graphs, clear the default graph
    • isEmpty

      boolean isEmpty()
      Test whether the dataset is empty
    • getLock

      org.apache.jena.shared.Lock getLock()
      Return a lock for the dataset to help with concurrency control
      See Also:
      • Lock
    • getContext

      Context getContext()
      Get the context associated with this object - may be null
    • size

      long size()
      Get the size (number of named graphs) - may be -1 for unknown
    • close

      void close()
      Close the dataset
      Specified by:
      close in interface org.apache.jena.atlas.lib.Closeable
    • prefixes

      PrefixMap prefixes()
      Prefixes for this DatasetGraph
    • supportsTransactions

      boolean supportsTransactions()
      A DatasetGraph supports transactions if it provides Transactional.begin()/ Transactional.commit()/Transactional.end(). The core storage DatasetGraphs provide fully serialized transactions. A DatasetGraph that provides functionality across independent systems can not provide such strong guarantees. For example, it may use MRSW locking and some isolation control. Specifically, it would not necessarily provide Transactional.abort().

      See supportsTransactionAbort() for Transactional.abort(). In addition, check details of a specific implementation.

    • supportsTransactionAbort

      default boolean supportsTransactionAbort()
      Declare whether Transactional.abort() is supported. This goes along with clearing up after exceptions inside application transaction code.