Class GraphChanges

java.lang.Object
org.apache.jena.sparql.graph.GraphWrapper
org.apache.jena.rdfpatch.system.GraphChanges
All Implemented Interfaces:
org.apache.jena.graph.Graph
Direct Known Subclasses:
GraphRealChanges

public class GraphChanges extends org.apache.jena.sparql.graph.GraphWrapper
Connect a Graph with RDFChanges. All operations on the Graph that cause changes have the change sent to the RDFChanges.

Use GraphRealChanges to get a graph that logs only changes that have a real effect - that makes the changes log reversible (play delete for each add) to undo a sequence of changes.

The graph name is settable; it is arbitrary, or null, and not deduced from the graph.

If the graph is a graph from a dataset and the same graph name is to be used, then instead of this class, get a graph from DatasetGraphChanges.

See Also:
  • Field Summary

    Fields inherited from interface org.apache.jena.graph.Graph

    emptyGraph
  • Constructor Summary

    Constructors
    Constructor
    Description
    GraphChanges(org.apache.jena.graph.Graph graph, org.apache.jena.graph.Node graphName, RDFChanges changes)
    Send changes to a graph to a RDFChanges with the specified graph name.
    GraphChanges(org.apache.jena.graph.Graph graph, RDFChanges changes)
    Send changes to a graph to a RDFChanges with null for the graph name.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(org.apache.jena.graph.Triple t)
     
    void
     
    void
    delete(org.apache.jena.graph.Triple t)
     
    org.apache.jena.shared.PrefixMapping
     
    org.apache.jena.graph.TransactionHandler
     
    void
    remove(org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
     

    Methods inherited from class org.apache.jena.sparql.graph.GraphWrapper

    close, contains, contains, dependsOn, find, find, get, getCapabilities, getEventManager, isClosed, isEmpty, isIsomorphicWith, size

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.apache.jena.graph.Graph

    add, delete, find, sizeLong, stream, stream
  • Constructor Details

    • GraphChanges

      public GraphChanges(org.apache.jena.graph.Graph graph, RDFChanges changes)
      Send changes to a graph to a RDFChanges with null for the graph name.
    • GraphChanges

      public GraphChanges(org.apache.jena.graph.Graph graph, org.apache.jena.graph.Node graphName, RDFChanges changes)
      Send changes to a graph to a RDFChanges with the specified graph name. The graph name may be null for "no name".
  • Method Details

    • add

      public void add(org.apache.jena.graph.Triple t)
      Specified by:
      add in interface org.apache.jena.graph.Graph
      Overrides:
      add in class org.apache.jena.sparql.graph.GraphWrapper
    • delete

      public void delete(org.apache.jena.graph.Triple t)
      Specified by:
      delete in interface org.apache.jena.graph.Graph
      Overrides:
      delete in class org.apache.jena.sparql.graph.GraphWrapper
    • clear

      public void clear()
      Specified by:
      clear in interface org.apache.jena.graph.Graph
      Overrides:
      clear in class org.apache.jena.sparql.graph.GraphWrapper
    • getPrefixMapping

      public org.apache.jena.shared.PrefixMapping getPrefixMapping()
      Specified by:
      getPrefixMapping in interface org.apache.jena.graph.Graph
      Overrides:
      getPrefixMapping in class org.apache.jena.sparql.graph.GraphWrapper
    • remove

      public void remove(org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
      Specified by:
      remove in interface org.apache.jena.graph.Graph
      Overrides:
      remove in class org.apache.jena.sparql.graph.GraphWrapper
    • getTransactionHandler

      public org.apache.jena.graph.TransactionHandler getTransactionHandler()
      Specified by:
      getTransactionHandler in interface org.apache.jena.graph.Graph
      Overrides:
      getTransactionHandler in class org.apache.jena.sparql.graph.GraphWrapper