server/src/app/Models/GeoResource.php
changeset 171 f4f558f04f37
parent 169 8fddc113095e
child 277 bd4bc1db4f40
--- a/server/src/app/Models/GeoResource.php	Mon Jun 06 01:10:25 2016 +0200
+++ b/server/src/app/Models/GeoResource.php	Tue Jun 07 01:09:58 2016 +0200
@@ -14,20 +14,20 @@
         parent::__construct($uri, $graph);
     }
 
-    private $refLoc = false;
+    private $refLocs = null;
     private $notes = null;
 
     public function clearMemoizationCache() {
-        $this->refLoc = false;
+        $this->refLocs = null;
         $this->notes = null;
     }
 
-    public function getRefLoc() {
-        if($this->refLoc === false) {
-            $refLoc = $this->getResource("<http://www.w3.org/2002/07/owl#sameAs>");
-            $this->refLoc = is_null($refLoc)?null:$refLoc->getUri();
+    public function getRefLocs() {
+        if(is_null($this->refLocs)) {
+            $refLocs = $this->allResources("<http://www.w3.org/2002/07/owl#sameAs>");
+            $this->refLocs = array_map(function($refLoc) { return $refLoc->getUri();}, $refLocs);
         }
-        return $this->refLoc;
+        return $this->refLocs;
     }
 
     public function getNotes() {
@@ -43,7 +43,7 @@
             $this->getNotes()
         );
         return [
-            'ref-loc' => $this->getRefLoc(),
+            'ref-locs' => $this->getRefLocs(),
             'notes' => $notes
         ];
     }