Class DatasetGraphBase

java.lang.Object
org.apache.jena.sparql.core.DatasetGraphBase
All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable, DatasetGraph, Transactional
Direct Known Subclasses:
DatasetGraphBaseFind, DatasetGraphQuads

public abstract class DatasetGraphBase extends Object implements DatasetGraph

DatasetGraph framework : readonly dataset need only provide find(g,s,p,o), getGraph() and getDefaultGraph() although it may wish to override other operations and do better.

Implementations include:

  • 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
    abstract 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
    static void
    deleteAny(DatasetGraph dsg, org.apache.jena.graph.Node g, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
     
    Iterate over all quads in the dataset graph
    find(Quad quad)
    Find matching quads in the dataset - may include wildcards, Node.ANY or null
    Get the context associated with this object - may be null
    abstract org.apache.jena.graph.Graph
    Get the default graph as a Jena Graph
    abstract 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
    abstract 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
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.jena.sparql.core.DatasetGraph

    addAll, find, findNG, listGraphNodes, prefixes, stream, stream, supportsTransactionAbort, supportsTransactions
  • Method Details

    • containsGraph

      public boolean containsGraph(org.apache.jena.graph.Node graphNode)
      Description copied from interface: DatasetGraph
      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.
      Specified by:
      containsGraph in interface DatasetGraph
      Returns:
      boolean
    • getDefaultGraph

      public abstract org.apache.jena.graph.Graph getDefaultGraph()
      Description copied from interface: DatasetGraph
      Get the default graph as a Jena Graph
      Specified by:
      getDefaultGraph in interface DatasetGraph
    • getUnionGraph

      public org.apache.jena.graph.Graph getUnionGraph()
      Description copied from interface: DatasetGraph
      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).
      Specified by:
      getUnionGraph in interface DatasetGraph
    • getGraph

      public abstract org.apache.jena.graph.Graph getGraph(org.apache.jena.graph.Node graphNode)
      Description copied from interface: DatasetGraph
      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.
      Specified by:
      getGraph in interface DatasetGraph
    • addGraph

      public abstract void addGraph(org.apache.jena.graph.Node graphName, org.apache.jena.graph.Graph graph)
      Description copied from interface: DatasetGraph
      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 DatasetGraph.getGraph(org.apache.jena.graph.Node)
      Specified by:
      addGraph in interface DatasetGraph
    • removeGraph

      public abstract void removeGraph(org.apache.jena.graph.Node graphName)
      Description copied from interface: DatasetGraph
      Remove all data associated with the named graph. This will include prefixes associated with the graph.
      Specified by:
      removeGraph in interface DatasetGraph
    • add

      public void add(Quad quad)
      Description copied from interface: DatasetGraph
      Add a quad
      Specified by:
      add in interface DatasetGraph
    • delete

      public void delete(Quad quad)
      Description copied from interface: DatasetGraph
      Delete a quad
      Specified by:
      delete in interface DatasetGraph
    • add

      public 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)
      Description copied from interface: DatasetGraph
      Add a quad
      Specified by:
      add in interface DatasetGraph
    • delete

      public 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)
      Description copied from interface: DatasetGraph
      Delete a quad
      Specified by:
      delete in interface DatasetGraph
    • deleteAny

      public 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)
      Description copied from interface: DatasetGraph
      Delete any quads matching the pattern
      Specified by:
      deleteAny in interface DatasetGraph
    • deleteAny

      public static void deleteAny(DatasetGraph dsg, 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

      public Iterator<Quad> find()
      Description copied from interface: DatasetGraph
      Iterate over all quads in the dataset graph
      Specified by:
      find in interface DatasetGraph
    • find

      public Iterator<Quad> find(Quad quad)
      Description copied from interface: DatasetGraph
      Find matching quads in the dataset - may include wildcards, Node.ANY or null
      Specified by:
      find in interface DatasetGraph
      See Also:
      • Graph.find(Triple)
    • contains

      public boolean contains(Quad quad)
      Description copied from interface: DatasetGraph
      Test whether the dataset contains a quad (including default graph)- may include wildcards, Node.ANY or null
      Specified by:
      contains in interface DatasetGraph
    • contains

      public 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)
      Description copied from interface: DatasetGraph
      Test whether the dataset (including default graph) contains a quad - may include wildcards, Node.ANY or null
      Specified by:
      contains in interface DatasetGraph
    • clear

      public void clear()
      Description copied from interface: DatasetGraph
      Remove everything - remove all named graphs, clear the default graph
      Specified by:
      clear in interface DatasetGraph
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: DatasetGraph
      Test whether the dataset is empty
      Specified by:
      isEmpty in interface DatasetGraph
    • size

      public long size()
      Description copied from interface: DatasetGraph
      Get the size (number of named graphs) - may be -1 for unknown
      Specified by:
      size in interface DatasetGraph
    • getLock

      public org.apache.jena.shared.Lock getLock()
      Description copied from interface: DatasetGraph
      Return a lock for the dataset to help with concurrency control
      Specified by:
      getLock in interface DatasetGraph
      See Also:
      • Lock
    • getContext

      public Context getContext()
      Description copied from interface: DatasetGraph
      Get the context associated with this object - may be null
      Specified by:
      getContext in interface DatasetGraph
    • close

      public void close()
      Description copied from interface: DatasetGraph
      Close the dataset
      Specified by:
      close in interface org.apache.jena.atlas.lib.Closeable
      Specified by:
      close in interface DatasetGraph
    • toString

      public String toString()
      Overrides:
      toString in class Object