78 |
78 |
79 protected function propertyTrimMap($providedCHOResource, $prop, $value) { |
79 protected function propertyTrimMap($providedCHOResource, $prop, $value) { |
80 $providedCHOResource->add($prop, trim($value)); |
80 $providedCHOResource->add($prop, trim($value)); |
81 } |
81 } |
82 |
82 |
|
83 protected function propertyCollectionMap($providedCHOResource, $prop, $value) { |
|
84 // if this is a collection, we use the edm:isGatheredInto property |
|
85 if(CocoonUtils::isResourceCollection($value)) { |
|
86 $resId = CocoonUtils::getIdFromUri($value->getUri()); |
|
87 $resUri = CocoonUtils::getCorpusUriFromId($resId); |
|
88 $providedCHOResource->addResource('http://www.europeana.eu/schemas/edm/isGatheredInto', $resUri); |
|
89 } elseif (strpos($value->getUri(), config('corpusparole.cocoon_doc_id_base_uri')) === 0 ) { |
|
90 $resId = CocoonUtils::getIdFromUri($value->getUri()); |
|
91 $resUri = CocoonUtils::getCorpusUriFromId($resId); |
|
92 $providedCHOResource->add($prop, $resUri); |
|
93 } else { |
|
94 $providedCHOResource->add($prop, $value); |
|
95 } |
|
96 } |
|
97 |
|
98 |
83 protected function addSpatialProperties($destRes, $res, $outputGraph) { |
99 protected function addSpatialProperties($destRes, $res, $outputGraph) { |
84 $spatials = $res->all($this->inputGraph->resource('http://purl.org/dc/terms/spatial')); |
100 $spatials = $res->all($this->inputGraph->resource('http://purl.org/dc/terms/spatial')); |
85 $lats = $res->all($this->inputGraph->resource('http://www.w3.org/2003/01/geo/wgs84_pos#lat')); |
101 $lats = $res->all($this->inputGraph->resource('http://www.w3.org/2003/01/geo/wgs84_pos#lat')); |
86 $longs = $res->all($this->inputGraph->resource('http://www.w3.org/2003/01/geo/wgs84_pos#long')); |
102 $longs = $res->all($this->inputGraph->resource('http://www.w3.org/2003/01/geo/wgs84_pos#long')); |
87 $alts = $res->all($this->inputGraph->resource('http://www.w3.org/2003/01/geo/wgs84_pos#alt')); |
103 $alts = $res->all($this->inputGraph->resource('http://www.w3.org/2003/01/geo/wgs84_pos#alt')); |