public class DatasetGraphWithRecord extends DatasetGraphWithLock
DatasetGraph implementation with two key affordances. First, this class keeps a record of operations
conducted against it. This enables the implementation of DatasetGraphTrackActive.abort(), by reversing that record and running it
backwards. Second, this class has "copy-on-add" semantics for addGraph(Node, Graph). This means that the
transactional semantics of a given Graph are discarded on add and replaced with those of this class, so that
transactional semantics are uniform and therefore useful.
This class supports MRSW locking. It can only be used with an underlying DatasetGraph implementation that provides
MRSW or weaker locking. If the provided locking is weaker, then this class will only be able to support that level of
locking. Because there is only one record of operations in use in this class at any time, using this class with an
underlying implementation that supports stronger-than-MRSW semantics will have unpredictable results.| Constructor and Description |
|---|
DatasetGraphWithRecord(DatasetGraph dsg) |
DatasetGraphWithRecord(DatasetGraph dsg,
ReversibleOperationRecord<QuadOperation<?,?>> record) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Node g,
Node s,
Node p,
Node o)
Add a quad
|
void |
add(Quad quad)
Add a quad
|
void |
addGraph(Node graphName,
Graph graph)
Add the given graph to the dataset.
|
void |
clear()
Remove everything - remove all named graphs, clear the default graph
|
void |
close()
Close the dataset
|
void |
delete(Node g,
Node s,
Node p,
Node o)
Delete a quad
|
void |
delete(Quad quad)
Delete a quad
|
void |
deleteAny(Node g,
Node s,
Node p,
Node o)
Delete any quads matching the pattern
|
void |
removeGraph(Node graphName)
Remove all data associated with the named graph
|
getContext, isInTransaction, sync, toStringabort, begin, commit, contains, contains, containsGraph, end, find, find, find, findNG, getDefaultGraph, getGraph, getLock, isEmpty, listGraphNodes, setDefaultGraph, sizepublic DatasetGraphWithRecord(DatasetGraph dsg)
dsg - the DatasetGraph that will back this onepublic DatasetGraphWithRecord(DatasetGraph dsg, ReversibleOperationRecord<QuadOperation<?,?>> record)
dsg - the DatasetGraph that will back this onerecord - the operation record to use with this DatasetGraphpublic void add(Quad quad)
DatasetGraphadd in interface DatasetGraphadd in class DatasetGraphTrackActivepublic void delete(Quad quad)
DatasetGraphdelete in interface DatasetGraphdelete in class DatasetGraphTrackActivepublic void addGraph(Node graphName, Graph graph)
DatasetGraphDatasetGraph.getGraph(org.apache.jena.graph.Node)addGraph in interface DatasetGraphaddGraph in class DatasetGraphTrackActivepublic void removeGraph(Node graphName)
DatasetGraphremoveGraph in interface DatasetGraphremoveGraph in class DatasetGraphTrackActivepublic void add(Node g, Node s, Node p, Node o)
DatasetGraphadd in interface DatasetGraphadd in class DatasetGraphTrackActivepublic void delete(Node g, Node s, Node p, Node o)
DatasetGraphdelete in interface DatasetGraphdelete in class DatasetGraphTrackActivepublic void deleteAny(Node g, Node s, Node p, Node o)
DatasetGraphdeleteAny in interface DatasetGraphdeleteAny in class DatasetGraphTrackActivepublic void clear()
DatasetGraphclear in interface DatasetGraphclear in class DatasetGraphTrackActivepublic void close()
DatasetGraphclose in interface org.apache.jena.atlas.lib.Closeableclose in interface DatasetGraphclose in class DatasetGraphTrackActiveLicenced under the Apache License, Version 2.0