java.lang.Object
org.apache.jena.sparql.core.DatasetGraphWrapper
org.apache.jena.rdfpatch.system.DatasetGraphChanges
- All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable,org.apache.jena.atlas.lib.Sync,DatasetGraph,Transactional
Connect a
DatasetGraph with RDFChanges. All operations on the
DatasetGraph that cause changes have the change sent to the
RDFChanges.
Optionally, a sync handler can be given that is called on sync() or begin.
This class is stateless so updating the wrapped dataset is possible via the sync handler.
Synchronization can also be performed externally on the wrapped dataset.
Use DatasetGraphRealChanges to get a dataset 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.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.sparql.core.Transactional
Transactional.Promote -
Constructor Summary
ConstructorsConstructorDescriptionDatasetGraphChanges(DatasetGraph dsg, RDFChanges monitor) Create aDatasetGraphChangeswhich does not have any sync handlersDatasetGraphChanges(DatasetGraph dsg, RDFChanges changesMonitor, Runnable syncHandler, Consumer<ReadWrite> txnSyncHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()voidvoidvoidvoidbegin()voidvoidvoidcommit()voidvoidvoidbooleanpromote()booleanpromote(Transactional.Promote type) voidremoveGraph(Node graphName) voidsync()Methods inherited from class org.apache.jena.sparql.core.DatasetGraphWrapper
clear, close, contains, contains, containsGraph, end, find, find, find, findNG, getBase, getBaseForQuery, getContext, getLock, getUnionGraph, getWrapped, isEmpty, isInTransaction, listGraphNodes, prefixes, setDefaultGraph, size, supportsTransactionAbort, supportsTransactions, toString, transactionMode, transactionType, unwrapMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.jena.sparql.core.DatasetGraph
addAll, stream, streamMethods inherited from interface org.apache.jena.sparql.core.Transactional
calc, calculate, calculateRead, calculateWrite, exec, execute, executeRead, executeWrite
-
Constructor Details
-
DatasetGraphChanges
Create aDatasetGraphChangeswhich does not have any sync handlers -
DatasetGraphChanges
public DatasetGraphChanges(DatasetGraph dsg, RDFChanges changesMonitor, Runnable syncHandler, Consumer<ReadWrite> txnSyncHandler)
-
-
Method Details
-
getMonitor
-
sync
public void sync()- Specified by:
syncin interfaceorg.apache.jena.atlas.lib.Sync- Overrides:
syncin classDatasetGraphWrapper
-
add
- Specified by:
addin interfaceDatasetGraph- Overrides:
addin classDatasetGraphWrapper
-
delete
- Specified by:
deletein interfaceDatasetGraph- Overrides:
deletein classDatasetGraphWrapper
-
add
- Specified by:
addin interfaceDatasetGraph- Overrides:
addin classDatasetGraphWrapper
-
delete
- Specified by:
deletein interfaceDatasetGraph- Overrides:
deletein classDatasetGraphWrapper
-
getDefaultGraph
- Specified by:
getDefaultGraphin interfaceDatasetGraph- Overrides:
getDefaultGraphin classDatasetGraphWrapper
-
getGraph
- Specified by:
getGraphin interfaceDatasetGraph- Overrides:
getGraphin classDatasetGraphWrapper
-
addGraph
- Specified by:
addGraphin interfaceDatasetGraph- Overrides:
addGraphin classDatasetGraphWrapper
-
removeGraph
- Specified by:
removeGraphin interfaceDatasetGraph- Overrides:
removeGraphin classDatasetGraphWrapper
-
deleteAny
- Specified by:
deleteAnyin interfaceDatasetGraph- Overrides:
deleteAnyin classDatasetGraphWrapper
-
begin
public void begin()- Specified by:
beginin interfaceTransactional- Overrides:
beginin classDatasetGraphWrapper
-
begin
- Specified by:
beginin interfaceTransactional- Overrides:
beginin classDatasetGraphWrapper
-
begin
- Specified by:
beginin interfaceTransactional- Overrides:
beginin classDatasetGraphWrapper
-
promote
public boolean promote()- Specified by:
promotein interfaceTransactional- Overrides:
promotein classDatasetGraphWrapper
-
promote
- Specified by:
promotein interfaceTransactional- Overrides:
promotein classDatasetGraphWrapper
-
commit
public void commit()- Specified by:
commitin interfaceTransactional- Overrides:
commitin classDatasetGraphWrapper
-
abort
public void abort()- Specified by:
abortin interfaceTransactional- Overrides:
abortin classDatasetGraphWrapper
-