server/src/app/Libraries/Mergers/CocoonTextRdfMerger.php
changeset 504 4ab820b387da
parent 114 8af5ed0521a2
child 506 8a5bb4b48b85
equal deleted inserted replaced
503:bd2701bd8142 504:4ab820b387da
   103             "http://purl.org/dc/terms/created",
   103             "http://purl.org/dc/terms/created",
   104             "http://purl.org/dc/terms/issued",
   104             "http://purl.org/dc/terms/issued",
   105             "http://purl.org/dc/terms/modified",
   105             "http://purl.org/dc/terms/modified",
   106         ], $targetArray, $baseRes, $srcRes);
   106         ], $targetArray, $baseRes, $srcRes);
   107 
   107 
       
   108         // Must handle created
       
   109         $isBaseSound = false;
       
   110         foreach ($baseRes->all("dc11:type","resource") as $resType) {
       
   111             $type = $resType->getUri();
       
   112             if($type === 'http://purl.org/dc/dcmitype/Sound') {
       
   113                 $isBaseSound = true;
       
   114                 break;
       
   115             }
       
   116         }
       
   117         if($isBaseSound) {
       
   118             // The base is Sound. In this case for http://purl.org/dc/terms/created,
       
   119             // the sound takes over.
       
   120             // The case to ensure is when there is no created info in the sound. We must make sure it stays that way
       
   121             $srcCreated = $srcRes->get("<http://purl.org/dc/terms/created>");
       
   122             $baseCreated = $baseRes->get("<http://purl.org/dc/terms/created>");
       
   123 
       
   124             if(!is_null($srcCreated) && is_null($baseCreated)) {
       
   125                 // There is no created in sound. Remove created info from targetArray
       
   126                 unset($targetArray['http://purl.org/dc/terms/created']);
       
   127             }
       
   128         }
       
   129 
       
   130 
   108     }
   131     }
   109 }
   132 }