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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(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.voidAdd a prefix.voiddelete(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 voiddeletePrefix(org.apache.jena.graph.Node gn, String prefix) Delete a prefix.voidHeader field.final voidtxnAbort()Indicator that a transaction abortsfinal voidtxnBegin()Indicator that a transaction begins, or becomes a write transaction.final voidIndicator 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:RDFChangesHeader field. Headers are metadata about the changes being made.- Specified by:
headerin interfaceRDFChanges- Overrides:
headerin 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:RDFChangesNotification 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:
addin interfaceRDFChanges- Overrides:
addin 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:RDFChangesNotification 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:
deletein interfaceRDFChanges- Overrides:
deletein classRDFChangesWrapper
-
addPrefix
Description copied from interface:RDFChangesAdd 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:
addPrefixin interfaceRDFChanges- Overrides:
addPrefixin classRDFChangesWrapper
-
deletePrefix
Description copied from interface:RDFChangesDelete 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:
deletePrefixin interfaceRDFChanges- Overrides:
deletePrefixin classRDFChangesWrapper
-
txnBegin
public final void txnBegin()Description copied from interface:RDFChangesIndicator that a transaction begins, or becomes a write transaction.- Specified by:
txnBeginin interfaceRDFChanges- Overrides:
txnBeginin classRDFChangesWrapper
-
txnCommit
public final void txnCommit()Description copied from interface:RDFChangesIndicator that a transaction commits. If this throws an exception, the transaction will be aborted locally and not commit after all.- Specified by:
txnCommitin interfaceRDFChanges- Overrides:
txnCommitin classRDFChangesWrapper
-
txnAbort
public final void txnAbort()Description copied from interface:RDFChangesIndicator that a transaction aborts- Specified by:
txnAbortin interfaceRDFChanges- Overrides:
txnAbortin classRDFChangesWrapper
-