geonetwork-ui 2.2.0-dev.8cce3b0e → 2.2.0-dev.91cd6a97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/esm2022/libs/api/metadata-converter/src/lib/gn4/atomic-operations.mjs +27 -1
  2. package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +23 -11
  3. package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.mjs +4 -2
  4. package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.mjs +1 -1
  5. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.mjs +14 -0
  6. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/converter.mjs +10 -9
  7. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +33 -8
  8. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +31 -14
  9. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
  10. package/esm2022/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.mjs +3 -3
  11. package/esm2022/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.mjs +3 -3
  12. package/esm2022/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.mjs +3 -3
  13. package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +17 -5
  14. package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +2 -2
  15. package/esm2022/libs/ui/elements/src/lib/thumbnail/thumbnail.component.mjs +3 -3
  16. package/esm2022/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.mjs +3 -3
  17. package/esm2022/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.mjs +3 -3
  18. package/esm2022/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.mjs +3 -3
  19. package/esm2022/libs/util/i18n/src/lib/i18n.constants.mjs +18 -1
  20. package/esm2022/libs/util/shared/src/lib/utils/index.mjs +2 -1
  21. package/esm2022/libs/util/shared/src/lib/utils/temporal-extent-union.mjs +32 -0
  22. package/esm2022/translations/de.json +26 -19
  23. package/esm2022/translations/en.json +26 -19
  24. package/esm2022/translations/es.json +23 -16
  25. package/esm2022/translations/fr.json +27 -20
  26. package/esm2022/translations/it.json +26 -19
  27. package/esm2022/translations/nl.json +24 -17
  28. package/esm2022/translations/pt.json +23 -16
  29. package/fesm2022/geonetwork-ui.mjs +381 -178
  30. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  31. package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts +2 -0
  32. package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts.map +1 -1
  33. package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
  34. package/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.d.ts.map +1 -1
  35. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts +4 -5
  36. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
  37. package/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.d.ts +3 -0
  38. package/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.d.ts.map +1 -0
  39. package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +3 -3
  40. package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
  41. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +1 -1
  42. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
  43. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +16 -2
  44. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
  45. package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts +9 -3
  46. package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts.map +1 -1
  47. package/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.d.ts +1 -1
  48. package/libs/util/i18n/src/lib/i18n.constants.d.ts +17 -0
  49. package/libs/util/i18n/src/lib/i18n.constants.d.ts.map +1 -1
  50. package/libs/util/shared/src/lib/utils/index.d.ts +1 -0
  51. package/libs/util/shared/src/lib/utils/index.d.ts.map +1 -1
  52. package/libs/util/shared/src/lib/utils/temporal-extent-union.d.ts +5 -0
  53. package/libs/util/shared/src/lib/utils/temporal-extent-union.d.ts.map +1 -0
  54. package/package.json +1 -1
  55. package/src/libs/api/metadata-converter/src/lib/fixtures/generic.records.ts +56 -2
  56. package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.ts +51 -6
  57. package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +205 -20
  58. package/src/libs/api/metadata-converter/src/lib/gn4/atomic-operations.ts +29 -0
  59. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +30 -11
  60. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.ts +3 -1
  61. package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +4 -5
  62. package/src/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.ts +16 -0
  63. package/src/libs/api/metadata-converter/src/lib/iso19139/converter.ts +9 -9
  64. package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +58 -20
  65. package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +86 -38
  66. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +20 -3
  67. package/src/libs/common/fixtures/src/lib/elasticsearch/full-response.ts +1 -1
  68. package/src/libs/common/fixtures/src/lib/records.fixtures.ts +44 -8
  69. package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.html +3 -4
  70. package/src/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.html +1 -1
  71. package/src/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html +1 -1
  72. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +114 -23
  73. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.ts +20 -3
  74. package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.ts +1 -1
  75. package/src/libs/ui/elements/src/lib/thumbnail/thumbnail.component.html +2 -2
  76. package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.html +1 -1
  77. package/src/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.html +3 -1
  78. package/src/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.css +3 -0
  79. package/src/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.html +1 -1
  80. package/src/libs/util/i18n/src/lib/i18n.constants.ts +18 -0
  81. package/src/libs/util/shared/src/lib/utils/index.ts +1 -0
  82. package/src/libs/util/shared/src/lib/utils/temporal-extent-union.ts +32 -0
  83. package/tailwind.base.config.js +3 -0
  84. package/tailwind.base.css +2 -2
  85. package/translations/de.json +26 -19
  86. package/translations/en.json +26 -19
  87. package/translations/es.json +23 -16
  88. package/translations/fr.json +27 -20
  89. package/translations/it.json +26 -19
  90. package/translations/nl.json +24 -17
  91. package/translations/pt.json +23 -16
  92. package/translations/sk.json +24 -17
@@ -27,31 +27,192 @@ export const GEOCAT_CH_DATASET_RECORD: DatasetRecord = {
27
27
  ],
28
28
  contactsForResource: [],
29
29
  recordCreated: new Date('2022-02-22T19:40:06'),
30
+ recordPublished: new Date('2022-02-22T19:40:06'),
30
31
  recordUpdated: new Date('2022-02-22T19:40:06'),
31
32
  datasetCreated: new Date('1999-01-01T00:00:00'),
32
33
  datasetUpdated: new Date('2009-01-01'),
33
34
  title: 'Alpenkonvention',
34
35
  abstract: `Perimeter der Alpenkonvention in der Schweiz. Die Alpenkonvention ist ein völkerrechtlicher Vertrag zwischen den acht Alpenländern Deutschland, Frankreich, Italien, Liechtenstein, Monaco, Österreich, Schweiz, Slowenien sowie der Europäischen Union. Das Ziel des Übereinkommens ist der Schutz der Alpen durch eine sektorübergreifende, ganzheitliche und nachhaltige Politik.`,
35
36
  overviews: [],
36
- themes: [
37
- 'Aufbewahrungs- und Archivierungsplanung AAP - Bund',
38
- 'Geobasisdaten',
39
- 'e-geo.ch',
40
- 'opendata.swiss',
41
- 'Nachhaltige Entwicklung',
42
- 'Raumplanung',
43
- 'Bergschutz',
44
- 'Bodenschutz',
45
- 'Umweltpolitik',
46
- 'Umweltpolitik',
47
- 'Verkehr',
48
- 'Verkehr',
49
- 'Verkehr',
50
- 'Umweltüberwachung',
51
- 'Verwaltungseinheiten',
52
- 'BGDI Bundesgeodaten-Infrastruktur',
37
+ topics: ['planningCadastre', 'planningCadastre_Planning'],
38
+ keywords: [
39
+ {
40
+ thesaurus: {
41
+ name: 'geocat.ch',
42
+ id: 'geonetwork.thesaurus.local.theme.geocat.ch',
43
+ url: new URL(
44
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
45
+ ),
46
+ },
47
+ type: 'theme',
48
+ label: 'Aufbewahrungs- und Archivierungsplanung AAP - Bund',
49
+ },
50
+ {
51
+ thesaurus: {
52
+ name: 'geocat.ch',
53
+ id: 'geonetwork.thesaurus.local.theme.geocat.ch',
54
+ url: new URL(
55
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
56
+ ),
57
+ },
58
+ type: 'theme',
59
+ label: 'Geobasisdaten',
60
+ },
61
+ {
62
+ thesaurus: {
63
+ name: 'geocat.ch',
64
+ id: 'geonetwork.thesaurus.local.theme.geocat.ch',
65
+ url: new URL(
66
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
67
+ ),
68
+ },
69
+ type: 'theme',
70
+ label: 'e-geo.ch',
71
+ },
72
+ {
73
+ label: 'opendata.swiss',
74
+ thesaurus: {
75
+ id: 'geonetwork.thesaurus.local.theme.geocat.ch',
76
+ name: 'geocat.ch',
77
+ url: new URL(
78
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
79
+ ),
80
+ },
81
+ type: 'theme',
82
+ },
83
+ {
84
+ label: 'Nachhaltige Entwicklung',
85
+ thesaurus: {
86
+ id: 'geonetwork.thesaurus.external.theme.gemet',
87
+ name: 'GEMET',
88
+ url: new URL(
89
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
90
+ ),
91
+ },
92
+ type: 'theme',
93
+ },
94
+ {
95
+ label: 'Raumplanung',
96
+ thesaurus: {
97
+ id: 'geonetwork.thesaurus.external.theme.gemet',
98
+ name: 'GEMET',
99
+ url: new URL(
100
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
101
+ ),
102
+ },
103
+ type: 'theme',
104
+ },
105
+ {
106
+ label: 'Bergschutz',
107
+ thesaurus: {
108
+ id: 'geonetwork.thesaurus.external.theme.gemet',
109
+ name: 'GEMET',
110
+ url: new URL(
111
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
112
+ ),
113
+ },
114
+ type: 'theme',
115
+ },
116
+ {
117
+ label: 'Bodenschutz',
118
+ thesaurus: {
119
+ id: 'geonetwork.thesaurus.external.theme.gemet',
120
+ name: 'GEMET',
121
+ url: new URL(
122
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
123
+ ),
124
+ },
125
+ type: 'theme',
126
+ },
127
+ {
128
+ label: 'Umweltpolitik',
129
+ thesaurus: {
130
+ id: 'geonetwork.thesaurus.external.theme.gemet',
131
+ name: 'GEMET',
132
+ url: new URL(
133
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
134
+ ),
135
+ },
136
+ type: 'theme',
137
+ },
138
+ {
139
+ label: 'Umweltpolitik',
140
+ thesaurus: {
141
+ id: 'geonetwork.thesaurus.external.theme.gemet',
142
+ name: 'GEMET',
143
+ url: new URL(
144
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
145
+ ),
146
+ },
147
+ type: 'theme',
148
+ },
149
+ {
150
+ label: 'Verkehr',
151
+ thesaurus: {
152
+ id: 'geonetwork.thesaurus.external.theme.gemet',
153
+ name: 'GEMET',
154
+ url: new URL(
155
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
156
+ ),
157
+ },
158
+ type: 'theme',
159
+ },
160
+ {
161
+ label: 'Verkehr',
162
+ thesaurus: {
163
+ id: 'geonetwork.thesaurus.external.theme.gemet',
164
+ name: 'GEMET',
165
+ url: new URL(
166
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
167
+ ),
168
+ },
169
+ type: 'theme',
170
+ },
171
+ {
172
+ label: 'Verkehr',
173
+ thesaurus: {
174
+ id: 'geonetwork.thesaurus.external.theme.gemet',
175
+ name: 'GEMET',
176
+ url: new URL(
177
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
178
+ ),
179
+ },
180
+ type: 'theme',
181
+ },
182
+ {
183
+ label: 'Umweltüberwachung',
184
+ thesaurus: {
185
+ id: 'geonetwork.thesaurus.external.theme.inspire-theme',
186
+ name: 'GEMET - INSPIRE themes, version 1.0',
187
+ url: new URL(
188
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
189
+ ),
190
+ },
191
+ type: 'theme',
192
+ },
193
+ {
194
+ label: 'Verwaltungseinheiten',
195
+ thesaurus: {
196
+ id: 'geonetwork.thesaurus.external.theme.inspire-theme',
197
+ name: 'GEMET - INSPIRE themes, version 1.0',
198
+ url: new URL(
199
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
200
+ ),
201
+ },
202
+ type: 'theme',
203
+ },
204
+ {
205
+ label: 'BGDI Bundesgeodaten-Infrastruktur',
206
+ thesaurus: {
207
+ id: 'geonetwork.thesaurus.local.theme.geocat.ch',
208
+ name: 'geocat.ch',
209
+ url: new URL(
210
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
211
+ ),
212
+ },
213
+ type: 'theme',
214
+ },
53
215
  ],
54
- keywords: [],
55
216
  spatialRepresentation: 'vector',
56
217
  distributions: [
57
218
  {
@@ -199,6 +360,7 @@ export const GEOCAT_CH_SERVICE_RECORD: ServiceRecord = {
199
360
  },
200
361
  ],
201
362
  recordCreated: new Date('2022-03-07T01:15:51+01:00'),
363
+ recordPublished: new Date('2022-03-07T01:15:51+01:00'),
202
364
  recordUpdated: new Date('2022-03-07T01:15:51+01:00'),
203
365
  title: 'Verkehrsregelungsanlagen (WMS)',
204
366
  abstract: `Diese Karte beinhaltet die Verkehrsregelungsanlagen des Kantons St.Gallen.`,
@@ -210,8 +372,31 @@ export const GEOCAT_CH_SERVICE_RECORD: ServiceRecord = {
210
372
  description: 'Vorschaubild',
211
373
  },
212
374
  ],
213
- themes: [],
214
- keywords: ['Verkehr', 'opendata.swiss'],
375
+ topics: [],
376
+ keywords: [
377
+ {
378
+ label: 'Verkehr',
379
+ thesaurus: {
380
+ id: 'geonetwork.thesaurus.external.theme.gemet',
381
+ name: 'GEMET',
382
+ url: new URL(
383
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
384
+ ),
385
+ },
386
+ type: 'other',
387
+ },
388
+ {
389
+ label: 'opendata.swiss',
390
+ thesaurus: {
391
+ id: 'geonetwork.thesaurus.local.theme.geocat.ch',
392
+ name: 'geocat.ch',
393
+ url: new URL(
394
+ 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/local.theme.geocat.ch'
395
+ ),
396
+ },
397
+ type: 'other',
398
+ },
399
+ ],
215
400
  onlineResources: [
216
401
  {
217
402
  type: 'link',
@@ -3,6 +3,8 @@ import {
3
3
  Organization,
4
4
  } from '../../../../../../libs/common/domain/src/lib/model/record'
5
5
  import { getRoleFromRoleCode } from '../iso19139/codelists/role.mapper'
6
+ import { Thesaurus } from './types'
7
+ import { getKeywordTypeFromKeywordTypeCode } from '../iso19139/codelists/keyword.mapper'
6
8
 
7
9
  export type SourceWithUnknownProps = { [key: string]: unknown }
8
10
 
@@ -98,3 +100,30 @@ export const mapContact = (
98
100
  ...(phone && { phone }),
99
101
  }
100
102
  }
103
+
104
+ export const mapKeywords = (thesauri: Thesaurus[], language: string) => {
105
+ const keywords = []
106
+ for (const thesaurusId in thesauri) {
107
+ const rawThesaurus = thesauri[thesaurusId]
108
+ let thesaurus = null
109
+ if (rawThesaurus.id) {
110
+ const thesaurusSource: SourceWithUnknownProps = { ...rawThesaurus }
111
+ const url = getAsUrl(selectField(thesaurusSource, 'link'))
112
+ const name = selectField(thesaurusSource, 'title')
113
+ thesaurus = {
114
+ id: rawThesaurus.id,
115
+ ...(name && { name }),
116
+ ...(url && { url }),
117
+ }
118
+ }
119
+ for (const keyword of rawThesaurus.keywords) {
120
+ keywords.push({
121
+ label: selectTranslatedValue<string>(keyword, language),
122
+ type: getKeywordTypeFromKeywordTypeCode(rawThesaurus.theme),
123
+ ...(thesaurus && { thesaurus }),
124
+ })
125
+ }
126
+ }
127
+
128
+ return keywords
129
+ }
@@ -4,6 +4,7 @@ import {
4
4
  getAsUrl,
5
5
  getFirstValue,
6
6
  mapContact,
7
+ mapKeywords,
7
8
  selectFallback,
8
9
  selectFallbackFields,
9
10
  selectField,
@@ -27,7 +28,8 @@ import {
27
28
  OnlineLinkResource,
28
29
  } from '../../../../../../libs/common/domain/src/lib/model/record'
29
30
  import { matchProtocol } from '../common/distribution.mapper'
30
- import { LangService } from '../../../../../../libs/util/i18n/src'
31
+ import { Thesaurus } from './types'
32
+ import { LANG_3_TO_2_MAPPER, LangService } from '../../../../../../libs/util/i18n/src'
31
33
 
32
34
  type ESResponseSource = SourceWithUnknownProps
33
35
 
@@ -92,8 +94,8 @@ export class Gn4FieldMapper {
92
94
  },
93
95
  cl_topic: (output, source) => ({
94
96
  ...output,
95
- themes: [
96
- ...(output.themes || []),
97
+ topics: [
98
+ ...(output.topics || []),
97
99
  ...getAsArray(
98
100
  selectField<SourceWithUnknownProps[]>(source, 'cl_topic')
99
101
  ).map((topic) => selectTranslatedValue<string>(topic, this.lang3)),
@@ -130,6 +132,22 @@ export class Gn4FieldMapper {
130
132
  ...output,
131
133
  recordUpdated: toDate(selectField<string>(source, 'changeDate')),
132
134
  }),
135
+ publicationDateForResource: (output, source) => ({
136
+ ...output,
137
+ recordPublished: toDate(
138
+ selectField<string>(source, 'publicationDateForResource')
139
+ ),
140
+ }),
141
+ resourceLanguage: (output, source) => {
142
+ const langList = getAsArray(
143
+ selectField<string>(source, 'resourceLanguage')
144
+ )
145
+ const languages = langList.map((lang) => LANG_3_TO_2_MAPPER[lang])
146
+ return {
147
+ ...output,
148
+ languages,
149
+ }
150
+ },
133
151
  link: (output, source) => {
134
152
  const rawLinks = getAsArray(
135
153
  selectField<SourceWithUnknownProps[]>(source, 'link')
@@ -171,16 +189,17 @@ export class Gn4FieldMapper {
171
189
  output
172
190
  )
173
191
  },
174
- tag: (output, source) => ({
192
+ allKeywords: (output, source) => ({
175
193
  ...output,
176
- keywords: getAsArray(
177
- selectField<SourceWithUnknownProps[]>(source, 'tag')
178
- ).map((tag) => selectTranslatedValue<string>(tag, this.lang3)),
194
+ keywords: mapKeywords(
195
+ selectField<Thesaurus[]>(source, 'allKeywords'),
196
+ this.lang3
197
+ ),
179
198
  }),
180
199
  inspireTheme: (output, source) => ({
181
200
  ...output,
182
- themes: [
183
- ...(output.themes || []),
201
+ topics: [
202
+ ...(output.topics || []),
184
203
  ...getAsArray(selectField(source, 'inspireTheme_syn')),
185
204
  ],
186
205
  }),
@@ -289,9 +308,9 @@ export class Gn4FieldMapper {
289
308
  ],
290
309
  }
291
310
  },
292
- resourceTemporalDateRange: (output, source) => {
311
+ resourceTemporalExtentDateRange: (output, source) => {
293
312
  const ranges = getAsArray(
294
- selectField(source, 'resourceTemporalDateRange')
313
+ selectField(source, 'resourceTemporalExtentDateRange')
295
314
  )
296
315
  return {
297
316
  ...output,
@@ -24,6 +24,7 @@ export class Gn4MetadataMapper extends MetadataBaseMapper<Gn4Record> {
24
24
  status: null,
25
25
  lineage: null,
26
26
  recordUpdated: null,
27
+ recordPublished: null,
27
28
  ownerOrganization: null,
28
29
  licenses: [],
29
30
  legalConstraints: [],
@@ -32,10 +33,11 @@ export class Gn4MetadataMapper extends MetadataBaseMapper<Gn4Record> {
32
33
  contacts: [],
33
34
  contactsForResource: [],
34
35
  keywords: [],
35
- themes: [],
36
+ topics: [],
36
37
  spatialExtents: [],
37
38
  temporalExtents: [],
38
39
  overviews: [],
40
+ languages: [],
39
41
  }
40
42
  const record: CatalogRecord = Object.keys(_source).reduce(
41
43
  (prev, fieldName) =>
@@ -56,15 +56,13 @@ interface SpecificationConformance {
56
56
  pass: BooleanString
57
57
  }
58
58
 
59
- type Keyword = MultilingualField
60
- type Keywords = Keyword[]
61
59
  type ThesaurusName = string
62
- interface Thesaurus {
60
+ export interface Thesaurus {
63
61
  id?: string
64
62
  title?: string
65
63
  theme?: string
66
64
  link?: string
67
- keywords: Keywords
65
+ keywords: MultilingualField[]
68
66
  }
69
67
 
70
68
  export interface Link {
@@ -152,6 +150,7 @@ export type MetadataObject = Partial<{
152
150
  pointOfContactOrg: string
153
151
  pointOfContactOrgForResource: string
154
152
  popularity: number
153
+ publicationDateForResource: string
155
154
  rating: string
156
155
  record: string
157
156
  recordGroup: string
@@ -175,7 +174,7 @@ export type MetadataObject = Partial<{
175
174
  specificationConformance: MaybeArray<SpecificationConformance>
176
175
  standardNameObject: MultilingualField
177
176
  standardVersionObject: MultilingualField
178
- tag: Keywords
177
+ tag: MultilingualField[]
179
178
  tagNumber: string
180
179
  userSavedCount: string
181
180
  userinfo: string
@@ -0,0 +1,16 @@
1
+ import { KeywordType } from '../../../../../../../libs/common/domain/src/lib/model/record'
2
+
3
+ export function getKeywordTypeFromKeywordTypeCode(
4
+ typeCode: string
5
+ ): KeywordType {
6
+ if (!typeCode) return 'other'
7
+ switch (typeCode) {
8
+ case 'theme':
9
+ case 'place':
10
+ case 'temporal':
11
+ case 'other':
12
+ return typeCode
13
+ default:
14
+ return 'other'
15
+ }
16
+ }
@@ -29,7 +29,7 @@ import {
29
29
  writeSecurityConstraints,
30
30
  writeSpatialRepresentation,
31
31
  writeStatus,
32
- writeThemes,
32
+ writeTopics,
33
33
  writeTitle,
34
34
  writeUniqueIdentifier,
35
35
  writeUpdateFrequency,
@@ -51,12 +51,12 @@ import {
51
51
  readOverviews,
52
52
  readOwnerOrganization,
53
53
  readRecordUpdated,
54
+ readRecordPublished,
54
55
  readSecurityConstraints,
55
56
  readSpatialExtents,
56
57
  readSpatialRepresentation,
57
58
  readStatus,
58
59
  readTemporalExtents,
59
- readThemes,
60
60
  readTitle,
61
61
  readUniqueIdentifier,
62
62
  readUpdateFrequency,
@@ -75,17 +75,15 @@ export function toModel(xml: string): CatalogRecord {
75
75
  const contacts = readContacts(rootEl)
76
76
  const recordUpdated = readRecordUpdated(rootEl)
77
77
  const recordCreated = recordUpdated
78
+ const recordPublished = readRecordPublished(rootEl)
78
79
  const keywords = readKeywords(rootEl)
79
- const themes = readThemes(rootEl)
80
+ const topics = readIsoTopics(rootEl)
80
81
  const legalConstraints = readLegalConstraints(rootEl)
81
82
  const otherConstraints = readOtherConstraints(rootEl)
82
83
  const securityConstraints = readSecurityConstraints(rootEl)
83
84
  const licenses = readLicenses(rootEl)
84
85
  const overviews = readOverviews(rootEl)
85
86
 
86
- // not used yet
87
- const isoTopics = readIsoTopics(rootEl)
88
-
89
87
  if (kind === 'dataset') {
90
88
  const status = readStatus(rootEl)
91
89
  const datasetCreated = readDatasetCreated(rootEl)
@@ -102,6 +100,7 @@ export function toModel(xml: string): CatalogRecord {
102
100
  kind,
103
101
  recordCreated,
104
102
  recordUpdated,
103
+ recordPublished,
105
104
  status,
106
105
  title,
107
106
  abstract,
@@ -109,7 +108,7 @@ export function toModel(xml: string): CatalogRecord {
109
108
  contacts,
110
109
  contactsForResource: [], // FIXME: is that really useful??
111
110
  keywords,
112
- themes,
111
+ topics,
113
112
  licenses,
114
113
  legalConstraints,
115
114
  securityConstraints,
@@ -131,12 +130,13 @@ export function toModel(xml: string): CatalogRecord {
131
130
  kind,
132
131
  recordCreated,
133
132
  recordUpdated,
133
+ recordPublished,
134
134
  title,
135
135
  abstract,
136
136
  ownerOrganization,
137
137
  contacts,
138
138
  keywords,
139
- themes,
139
+ topics,
140
140
  licenses,
141
141
  legalConstraints,
142
142
  securityConstraints,
@@ -168,7 +168,7 @@ export function toXml(record: CatalogRecord, originalXml?: string): string {
168
168
  writeAbstract(record, rootEl)
169
169
  fieldChanged('contacts') && writeContacts(record, rootEl)
170
170
  fieldChanged('keywords') && writeKeywords(record, rootEl)
171
- fieldChanged('themes') && writeThemes(record, rootEl)
171
+ fieldChanged('topics') && writeTopics(record, rootEl)
172
172
  fieldChanged('legalConstraints') && writeLegalConstraints(record, rootEl)
173
173
  fieldChanged('securityConstraints') &&
174
174
  writeSecurityConstraints(record, rootEl)
@@ -5,6 +5,8 @@ import {
5
5
  DatasetTemporalExtent,
6
6
  GraphicOverview,
7
7
  Individual,
8
+ Keyword,
9
+ KeywordThesaurus,
8
10
  Organization,
9
11
  RecordKind,
10
12
  RecordStatus,
@@ -39,6 +41,7 @@ import {
39
41
  } from '../function-utils'
40
42
  import { getRoleFromRoleCode } from './codelists/role.mapper'
41
43
  import { matchMimeType, matchProtocol } from '../common/distribution.mapper'
44
+ import { getKeywordTypeFromKeywordTypeCode } from './codelists/keyword.mapper'
42
45
 
43
46
  function extractCharacterString(): ChainableFunction<XmlElement, string> {
44
47
  return pipe(
@@ -447,7 +450,7 @@ function findIdentification() {
447
450
  }
448
451
  }
449
452
 
450
- function extractCitationDate(type: 'creation' | 'revision') {
453
+ function extractCitationDate(type: 'creation' | 'revision' | 'publication') {
451
454
  return pipe(
452
455
  findIdentification(),
453
456
  findNestedElements('gmd:citation', 'gmd:CI_Citation', 'gmd:date'),
@@ -514,6 +517,10 @@ export function readRecordUpdated(rootEl: XmlElement): Date {
514
517
  return pipe(findChildElement('gmd:dateStamp'), extractDateTime())(rootEl)
515
518
  }
516
519
 
520
+ export function readRecordPublished(rootEl: XmlElement): Date {
521
+ return pipe(findChildElement('gmd:dateStamp'), extractDateTime())(rootEl)
522
+ }
523
+
517
524
  export function readTitle(rootEl: XmlElement): string {
518
525
  return pipe(
519
526
  findIdentification(),
@@ -552,29 +559,60 @@ export function readContacts(rootEl: XmlElement): Individual[] {
552
559
  )(rootEl)
553
560
  }
554
561
 
555
- function readKeywordsOfType(isTheme: boolean) {
556
- return pipe(
557
- findIdentification(),
558
- findNestedElements('gmd:descriptiveKeywords', 'gmd:MD_Keywords'),
559
- filterArray(
560
- pipe(
561
- findChildrenElement('gmd:MD_KeywordTypeCode'),
562
- mapArray(readAttribute('codeListValue')),
563
- map((values) => isTheme === values.indexOf('theme') > -1)
564
- )
565
- ),
566
- mapArray(findChildrenElement('gmd:keyword')),
567
- flattenArray(),
568
- mapArray(extractCharacterString())
562
+ // from gmd:thesaurusName
563
+ function readThesaurus(rootEl: XmlElement): KeywordThesaurus {
564
+ if (!rootEl) return null
565
+
566
+ const findIdentifier = findNestedElement(
567
+ 'gmd:CI_Citation',
568
+ 'gmd:identifier',
569
+ 'gmd:MD_Identifier',
570
+ 'gmd:code'
569
571
  )
572
+ const id = pipe(findIdentifier, extractCharacterString())(rootEl)
573
+ const url = pipe(findIdentifier, extractUrl())(rootEl)
574
+ const name = pipe(
575
+ findNestedElement('gmd:CI_Citation', 'gmd:title'),
576
+ extractCharacterString()
577
+ )(rootEl)
578
+ return {
579
+ id,
580
+ ...(name && { name }),
581
+ ...(url && { url }),
582
+ }
570
583
  }
571
584
 
572
- export function readKeywords(rootEl: XmlElement): string[] {
573
- return readKeywordsOfType(false)(rootEl)
585
+ // from gmd:MD_Keywords
586
+ function readKeywordGroup(rootEl: XmlElement): Keyword[] {
587
+ const type = pipe(
588
+ findChildrenElement('gmd:MD_KeywordTypeCode'),
589
+ mapArray(readAttribute('codeListValue')),
590
+ map((values) => getKeywordTypeFromKeywordTypeCode(values[0]))
591
+ )(rootEl)
592
+ const thesaurus = pipe(
593
+ findNestedElement('gmd:thesaurusName'),
594
+ readThesaurus
595
+ )(rootEl)
596
+ return pipe(
597
+ findChildrenElement('gmd:keyword'),
598
+ mapArray((el) => {
599
+ const label = extractCharacterString()(el)
600
+ return {
601
+ ...(thesaurus ? { thesaurus } : {}),
602
+ label,
603
+ type,
604
+ } as Keyword
605
+ })
606
+ )(rootEl)
574
607
  }
575
608
 
576
- export function readThemes(rootEl: XmlElement): string[] {
577
- return readKeywordsOfType(true)(rootEl)
609
+ export function readKeywords(rootEl: XmlElement): Keyword[] {
610
+ return pipe(
611
+ findIdentification(),
612
+ findNestedElements('gmd:descriptiveKeywords', 'gmd:MD_Keywords'),
613
+ mapArray(readKeywordGroup),
614
+ flattenArray()
615
+ )(rootEl)
578
616
  }
579
617
 
580
618
  export function readStatus(rootEl: XmlElement): RecordStatus {
@@ -627,7 +665,7 @@ export function readLicenses(rootEl: XmlElement): Constraint[] {
627
665
  export function readIsoTopics(rootEl: XmlElement): string[] {
628
666
  return pipe(
629
667
  findIdentification(),
630
- findChildrenElement('gmd:MD_TopicCategoryCode', false),
668
+ findChildrenElement('gmd:MD_TopicCategoryCode', true),
631
669
  mapArray(readText())
632
670
  )(rootEl)
633
671
  }