Module org.apache.jena.rdfpatch
Package org.apache.jena.rdfpatch.system
Class RDFChangesSuppressEmpty
java.lang.Object
org.apache.jena.rdfpatch.changes.RDFChangesWrapper
org.apache.jena.rdfpatch.system.RDFChangesSuppressEmpty
- All Implemented Interfaces:
RDFChanges
Note whether a change has happened and call different operations on txnCommit
A change is a call to one of the dataset-changing operations,
add
, delete
, addPrefix
, deletePrefix
.
Setting headers is not consided a change.
If a change has been made, txnChangeCommit()
is called, otherwise
txnNoChangeCommit()
is called. The implementation of these methods must call
doCommit()
, to accept the change or doAbort()
to cancel it.
A common case is to suppress empty transactions.
To do this, call doAbort()
in txnNoChangeCommit()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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) Notification that a quad or triple is added.void
Add a prefix.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) Notification that a quad or triple is deleted.final void
deletePrefix
(org.apache.jena.graph.Node gn, String prefix) Delete a prefix.void
Header field.final void
txnAbort()
Indicator that a transaction abortsfinal void
txnBegin()
Indicator that a transaction begins, or becomes a write transaction.final void
Indicator that a transaction commits.Methods inherited from class org.apache.jena.rdfpatch.changes.RDFChangesWrapper
finish, segment, start
-
Constructor Details
-
RDFChangesSuppressEmpty
-
-
Method Details
-
header
Description copied from interface:RDFChanges
Header field. Headers are metadata about the changes being made.- Specified by:
header
in interfaceRDFChanges
- Overrides:
header
in classRDFChangesWrapper
-
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:RDFChanges
Notification that a quad or triple is added. A stream of Triples outside a dataset will have null for the graph name. Inside an RDF Dataset, it may be more natural to use "urn:x-arq:DefaultGraph" or "urn:x-arq:DefaultGraphNode" in which case test withQuad.isDefaultGraph(Node)
.It is not defined whether the add happens before or after this notification all.
- Specified by:
add
in interfaceRDFChanges
- Overrides:
add
in classRDFChangesWrapper
-
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:RDFChanges
Notification that a quad or triple is deleted. A stream of Triples outside a dataset will have null for the graph name. Inside an RDF Dataset, it may be more natural to use "urn:x-arq:DefaultGraph" or "urn:x-arq:DefaultGraphNode" in which case test withQuad.isDefaultGraph(Node)
.It is not defined whether the delete happens before or after this notification all.
- Specified by:
delete
in interfaceRDFChanges
- Overrides:
delete
in classRDFChangesWrapper
-
addPrefix
Description copied from interface:RDFChanges
Add a prefix. The graph name follows the same rules asRDFChanges.add(org.apache.jena.graph.Node, org.apache.jena.graph.Node, org.apache.jena.graph.Node, org.apache.jena.graph.Node)
.- Specified by:
addPrefix
in interfaceRDFChanges
- Overrides:
addPrefix
in classRDFChangesWrapper
-
deletePrefix
Description copied from interface:RDFChanges
Delete a prefix. The graph name follows the same rules asRDFChanges.add(org.apache.jena.graph.Node, org.apache.jena.graph.Node, org.apache.jena.graph.Node, org.apache.jena.graph.Node)
.- Specified by:
deletePrefix
in interfaceRDFChanges
- Overrides:
deletePrefix
in classRDFChangesWrapper
-
txnBegin
public final void txnBegin()Description copied from interface:RDFChanges
Indicator that a transaction begins, or becomes a write transaction.- Specified by:
txnBegin
in interfaceRDFChanges
- Overrides:
txnBegin
in classRDFChangesWrapper
-
txnCommit
public final void txnCommit()Description copied from interface:RDFChanges
Indicator that a transaction commits. If this throws an exception, the transaction will be aborted locally and not commit after all.- Specified by:
txnCommit
in interfaceRDFChanges
- Overrides:
txnCommit
in classRDFChangesWrapper
-
txnAbort
public final void txnAbort()Description copied from interface:RDFChanges
Indicator that a transaction aborts- Specified by:
txnAbort
in interfaceRDFChanges
- Overrides:
txnAbort
in classRDFChangesWrapper
-