diff options
| author | Pierre-Antoine Champin <pchampin@liris.cnrs.fr> | 2015-11-02 15:45:31 +0100 |
|---|---|---|
| committer | Pierre-Antoine Champin <pchampin@liris.cnrs.fr> | 2015-11-30 09:07:10 +0100 |
| commit | 8fb454ce2a0d91e450cddcc97295d514ad4bd18e (patch) | |
| tree | 1fb18fe31e1830bb6ece8fb9907aaff9e3547981 | |
| parent | 47b9a8c00e13a818c745002cc9c8650a98b4c52c (diff) | |
| download | rdflib-8fb454ce2a0d91e450cddcc97295d514ad4bd18e.tar.gz | |
ignore operations with no effect
| -rw-r--r-- | rdflib/plugins/stores/auditable.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/rdflib/plugins/stores/auditable.py b/rdflib/plugins/stores/auditable.py index 59807597..8e9d5a59 100644 --- a/rdflib/plugins/stores/auditable.py +++ b/rdflib/plugins/stores/auditable.py @@ -55,6 +55,8 @@ class AuditableStore(Store): with lock: context = context.__class__(self.store, context.identifier) if context is not None else None ctxId = context.identifier if context is not None else None + if list(self.store.triples(triple, context)): + return # triple already in store, do nothing self.reverseOps.append((s, p, o, ctxId, 'remove')) try: self.reverseOps.remove((s, p, o, ctxId, 'add')) @@ -84,6 +86,8 @@ class AuditableStore(Store): except ValueError: self.reverseOps.append((s, p, o, ctx.identifier, 'add')) else: + if not list(self.triples((subject, predicate, object_), context)): + return # triple not present in store, do nothing try: self.reverseOps.remove((subject, predicate, object_, ctxId, 'remove')) except ValueError: |
