server/src/app/Libraries/Mappers/CocoonContentRdfMapper.php
changeset 108 be2d3b30b2e0
parent 21 01e7e6a17317
child 115 34ffc04cef62
--- a/server/src/app/Libraries/Mappers/CocoonContentRdfMapper.php	Fri Jan 22 17:43:25 2016 +0100
+++ b/server/src/app/Libraries/Mappers/CocoonContentRdfMapper.php	Tue Jan 19 19:16:23 2016 +0100
@@ -81,6 +81,15 @@
         $providedCHOResource->add('http://purl.org/dc/terms/references', $value);
     }
 
+    protected function propertyCollectionMap($providedCHOResource, $prop, $value) {
+        // if this is a collection, we use the edm:isGatheredInto property
+        if(CocoonUtils::isResourceCollection($value)) {
+            $providedCHOResource->add('http://www.europeana.eu/schemas/edm/isGatheredInto', $value);
+        } else {
+            $providedCHOResource->add($prop, $value);
+        }
+    }
+
     /**
      * Build the provided CHO.
      */
@@ -109,7 +118,7 @@
             ['http://purl.org/dc/elements/1.1/language', null],
             ['http://purl.org/dc/terms/accessRights', 'propertyTrimMap'],
             ['http://purl.org/dc/terms/extent', null],
-            ['http://purl.org/dc/terms/isPartOf', null],
+            ['http://purl.org/dc/terms/isPartOf', 'propertyCollectionMap'],
             ['http://purl.org/dc/terms/abstract', null],
             ['http://purl.org/dc/elements/1.1/source', null],
             ['http://purl.org/dc/terms/medium', null],