浏览代码

Delete tombstone.

Stefano Cossu 7 年之前
父节点
当前提交
6cc589f886
共有 2 个文件被更改,包括 10 次插入13 次删除
  1. 10 3
      lakesuperior/model/ldpr.py
  2. 0 10
      lakesuperior/store_layouts/ldp_rs/simple_layout.py

+ 10 - 3
lakesuperior/model/ldpr.py

@@ -454,7 +454,7 @@ class Ldpr(metaclass=ABCMeta):
         for child_uri in children:
         for child_uri in children:
             child_rsrc = Ldpr.inst(
             child_rsrc = Ldpr.inst(
                 Toolbox().uri_to_uuid(child_uri.identifier), self.repr_opts)
                 Toolbox().uri_to_uuid(child_uri.identifier), self.repr_opts)
-            child_rsrc._delete_rsrc(inbound, tstone_pointer=self.uri)
+            child_rsrc._delete_rsrc(inbound, tstone_pointer=self.urn)
 
 
         return ret
         return ret
 
 
@@ -463,8 +463,15 @@ class Ldpr(metaclass=ABCMeta):
     def delete_tombstone(self):
     def delete_tombstone(self):
         '''
         '''
         Delete a tombstone.
         Delete a tombstone.
+
+        N.B. This does not trigger an event.
         '''
         '''
-        return self.rdfly.delete_tombstone(self.urn)
+        remove_trp = {
+            (self.urn, RDF.type, nsc['fcsystem'].Tombstone),
+            (self.urn, nsc['fcrepo'].created, None),
+            (None, nsc['fcsystem'].tombstone, self.urn),
+        }
+        self.rdfly.modify_dataset(remove_trp)
 
 
 
 
     ## PROTECTED METHODS ##
     ## PROTECTED METHODS ##
@@ -504,7 +511,7 @@ class Ldpr(metaclass=ABCMeta):
         Delete a single resource and create a tombstone.
         Delete a single resource and create a tombstone.
 
 
         @param inbound (boolean) Whether to delete the inbound relationships.
         @param inbound (boolean) Whether to delete the inbound relationships.
-        @param tstone_pointer (URIRef) If set to a URI, this creates a pointer
+        @param tstone_pointer (URIRef) If set to a URN, this creates a pointer
         to the tombstone of the resource that used to contain the deleted
         to the tombstone of the resource that used to contain the deleted
         resource. Otherwise the delete resource becomes a tombstone.
         resource. Otherwise the delete resource becomes a tombstone.
         '''
         '''

+ 0 - 10
lakesuperior/store_layouts/ldp_rs/simple_layout.py

@@ -116,13 +116,3 @@ class SimpleLayout(BaseRdfLayout):
             self.ds.remove(t)
             self.ds.remove(t)
         for t in add_trp:
         for t in add_trp:
             self.ds.add(t)
             self.ds.add(t)
-
-
-    def delete_tombstone(self, urn):
-        '''
-        See BaseRdfLayout.leave_tombstone
-        '''
-        self.ds.remove((urn, RDF.type, nsc['fcsystem'].Tombstone))
-        self.ds.remove((urn, nsc['fcrepo'].created, None))
-        self.ds.remove((None, nsc['fcsystem'].tombstone, urn))
-