|
1 <?php |
|
2 namespace CorpusParole\Libraries\Mergers; |
|
3 |
|
4 |
|
5 class CocoonCollectionRdfMerger extends CocoonAbstractRdfMerger { |
|
6 |
|
7 protected function getTypeMergeMethodMap() { |
|
8 return [ |
|
9 'http://www.europeana.eu/schemas/edm/Collection' => 'mergeEdmCollection', |
|
10 'http://www.europeana.eu/schemas/edm/Place' => 'mergeDcSpatialBlankNode' |
|
11 ]; |
|
12 } |
|
13 |
|
14 protected function mergeEdmCollection($baseRes, $srcRes, $uri = null) { |
|
15 |
|
16 if(is_null($uri)) { |
|
17 $uri = $baseRes->getUri(); |
|
18 } |
|
19 $targetArray =& $this->mergedArray[$uri]; |
|
20 |
|
21 $this->mergeProperties([ |
|
22 "http://purl.org/dc/terms/spatial" |
|
23 ], [ |
|
24 "http://purl.org/dc/elements/1.1/title", |
|
25 "http://purl.org/dc/terms/available", |
|
26 "http://purl.org/dc/terms/created", |
|
27 "http://purl.org/dc/terms/issued", |
|
28 "http://purl.org/dc/terms/modified" |
|
29 ], $targetArray, $baseRes, $srcRes); |
|
30 |
|
31 } |
|
32 |
|
33 protected function mergeDcSpatialBlankNode($baseRes, $srcRes, $uri=null) { |
|
34 if(is_null($uri)) { |
|
35 $uri = $baseRes->getUri(); |
|
36 } |
|
37 $targetArray =& $this->mergedArray[$uri]; |
|
38 |
|
39 $this->mergeProperties([],[ |
|
40 "http://www.w3.org/2003/01/geo/wgs84_pos#lat", |
|
41 "http://www.w3.org/2003/01/geo/wgs84_pos#long", |
|
42 "http://www.w3.org/2003/01/geo/wgs84_pos#alt", |
|
43 "http://www.w3.org/2002/07/owl#sameAs" |
|
44 ], $targetArray, $baseRes, $srcRes); |
|
45 } |
|
46 |
|
47 } |