Do not map language info for text. This should correct bug #0025932
authorymh <ymh.work@gmail.com>
Thu, 09 Feb 2017 17:22:58 +0100
changeset 505 9175ea22f1b1
parent 504 4ab820b387da
child 506 8a5bb4b48b85
Do not map language info for text. This should correct bug #0025932
server/src/app/Libraries/Mappers/CocoonContentRdfMapper.php
server/src/app/Libraries/Mappers/CocoonTextRdfMapper.php
--- a/server/src/app/Libraries/Mappers/CocoonContentRdfMapper.php	Thu Feb 09 15:05:36 2017 +0100
+++ b/server/src/app/Libraries/Mappers/CocoonContentRdfMapper.php	Thu Feb 09 17:22:58 2017 +0100
@@ -81,6 +81,11 @@
         $providedCHOResource->add('http://purl.org/dc/terms/references', $value);
     }
 
+    protected function propertyLanguageMap($targetRes, $prop, $value) {
+        $targetRes->add($prop, $value);
+    }
+
+
     /**
      * Build the provided CHO.
      */
@@ -115,12 +120,11 @@
         $this->applyPropertiesToRes($res, $providedCHOResource, [
             ['http://purl.org/dc/terms/tableOfContents', null],
             ['http://purl.org/dc/elements/1.1/description', null],
-            ['http://purl.org/dc/elements/1.1/language', null],
+            ['http://purl.org/dc/elements/1.1/language', 'propertyLanguageMap'],
             ['http://purl.org/dc/elements/1.1/publisher', null],
             ['http://purl.org/dc/elements/1.1/type', 'propertyTypeMap'],
             ['http://purl.org/dc/elements/1.1/subject', null],
             ['http://purl.org/dc/elements/1.1/title', null],
-            ['http://purl.org/dc/elements/1.1/language', null],
             ['http://purl.org/dc/terms/extent', null],
             ['http://purl.org/dc/terms/isPartOf', 'propertyCollectionMap'],
             ['http://purl.org/dc/terms/abstract', null],
--- a/server/src/app/Libraries/Mappers/CocoonTextRdfMapper.php	Thu Feb 09 15:05:36 2017 +0100
+++ b/server/src/app/Libraries/Mappers/CocoonTextRdfMapper.php	Thu Feb 09 17:22:58 2017 +0100
@@ -156,6 +156,10 @@
     protected function addProvidedCHODateProperties($targetRes, $res, $outputGraph) {
     }
 
+    // In the case of text, the language info are not added to the providedCHR resource.
+    protected function propertyLanguageMap($targetRes, $prop, $value) {
+    }
+
     protected function mapWebResources($res, $outputGraph) {
         $resId = CocoonUtils::getIdFromUri($this->getResourceBaseId($res));
         $resUri = CocoonUtils::getCorpusUriFromId($resId);