server/src/app/Libraries/RdfModel/RdfModelResource.php
changeset 28 b0b56e0f8c7f
parent 4 f55970e41793
child 277 bd4bc1db4f40
--- a/server/src/app/Libraries/RdfModel/RdfModelResource.php	Fri Jan 15 15:27:56 2016 +0100
+++ b/server/src/app/Libraries/RdfModel/RdfModelResource.php	Fri Jan 15 15:35:00 2016 +0100
@@ -34,9 +34,22 @@
         return $this->uri;
     }
 
+    public function getCurrentDelta() {
+        return $this->getCurrentDelta;
+    }
+
     public function startDelta() {
         $this->currentDelta = new RdfModelDelta($this->getGraph()->getUri());
         array_push($this->deltaList, $this->currentDelta);
+        return $this->currentDelta;
+    }
+
+    protected function setSimpleProperty($baseNode, $property, $oldValue, $newValue) {
+        $delta = $this->startDelta();
+        $baseNode->delete($property, $oldValue);
+        $delta->getDeletedGraph()->add($baseNode, $property, $oldValue);
+        $baseNode->add($property, $newValue);
+        $delta->getAddedGraph()->add($baseNode, $property, $newValue);
     }