geonetwork-ui 2.2.0-dev.4db0b597 → 2.2.0-dev.5042be2c
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.
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/atomic-operations.mjs +27 -1
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +49 -58
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.mjs +5 -4
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.mjs +1 -1
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.mjs +14 -0
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/converter.mjs +20 -17
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +52 -23
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +52 -32
- package/esm2022/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.mjs +10 -3
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.mjs +14 -5
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +33 -8
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
- package/esm2022/libs/feature/map/src/lib/map-context/map-context.service.mjs +9 -1
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.mjs +41 -26
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +11 -9
- package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +35 -22
- package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +3 -4
- package/esm2022/libs/ui/elements/src/lib/record-api-form/record-api-form.component.mjs +8 -5
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +4 -4
- package/esm2022/libs/ui/inputs/src/lib/button/button.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/text-area/text-area.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +6 -6
- package/esm2022/translations/de.json +3 -2
- package/esm2022/translations/en.json +5 -4
- package/esm2022/translations/es.json +3 -2
- package/esm2022/translations/fr.json +5 -4
- package/esm2022/translations/it.json +5 -4
- package/esm2022/translations/nl.json +3 -2
- package/esm2022/translations/pt.json +3 -2
- package/fesm2022/geonetwork-ui.mjs +402 -235
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts +2 -0
- package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts +0 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts +3 -5
- package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.d.ts +3 -0
- package/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/iso19139/converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +6 -6
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +4 -3
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +9 -2
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +18 -12
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.d.ts +1 -0
- package/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
- package/libs/feature/map/src/lib/map-context/map-context.service.d.ts +1 -0
- package/libs/feature/map/src/lib/map-context/map-context.service.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.d.ts +21 -8
- package/libs/feature/search/src/lib/utils/service/fields.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.d.ts +1 -1
- package/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts +10 -6
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +3 -1
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts +13 -13
- package/libs/ui/inputs/src/lib/button/button.component.d.ts +1 -1
- package/libs/ui/inputs/src/lib/button/button.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/text-area/text-area.component.d.ts +1 -1
- package/libs/ui/inputs/src/lib/text-area/text-area.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +40 -40
- package/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.d.ts +1 -1
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/generic.records.ts +61 -8
- package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.ts +55 -9
- package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +225 -24
- package/src/libs/api/metadata-converter/src/lib/gn4/atomic-operations.ts +29 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +80 -73
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.ts +4 -3
- package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +3 -5
- package/src/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.ts +16 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/converter.ts +24 -21
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +115 -62
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +169 -95
- package/src/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.ts +22 -2
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.ts +15 -4
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +47 -8
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +21 -14
- package/src/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.ts +1 -0
- package/src/libs/common/domain/src/lib/platform.service.interface.ts +1 -4
- package/src/libs/common/fixtures/src/lib/gn4/groups.fixtures.ts +1 -1
- package/src/libs/common/fixtures/src/lib/records.fixtures.ts +50 -10
- package/src/libs/feature/map/src/lib/map-context/map-context.service.ts +10 -0
- package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +21 -16
- package/src/libs/feature/search/src/lib/utils/service/fields.ts +43 -34
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.css +5 -0
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.html +39 -0
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.ts +58 -0
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.css +2 -2
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.ts +1 -0
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +50 -23
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.ts +37 -15
- package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.ts +2 -3
- package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.html +4 -4
- package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.ts +11 -3
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +1 -1
- package/src/libs/ui/inputs/src/lib/button/button.component.ts +1 -0
- package/src/libs/ui/inputs/src/lib/text-area/text-area.component.ts +1 -0
- package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +2 -2
- package/translations/de.json +3 -2
- package/translations/en.json +5 -4
- package/translations/es.json +3 -2
- package/translations/fr.json +5 -4
- package/translations/it.json +5 -4
- package/translations/nl.json +3 -2
- package/translations/pt.json +3 -2
- package/translations/sk.json +3 -2
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
} from '../xml-utils'
|
|
13
13
|
import {
|
|
14
14
|
writeAbstract,
|
|
15
|
-
writeAccessConstraints,
|
|
16
15
|
writeContacts,
|
|
17
16
|
writeDatasetCreated,
|
|
18
17
|
writeDatasetUpdated,
|
|
@@ -20,22 +19,23 @@ import {
|
|
|
20
19
|
writeGraphicOverviews,
|
|
21
20
|
writeKeywords,
|
|
22
21
|
writeKind,
|
|
22
|
+
writeLegalConstraints,
|
|
23
23
|
writeLicenses,
|
|
24
24
|
writeLineage,
|
|
25
25
|
writeOnlineResources,
|
|
26
|
+
writeOtherConstraints,
|
|
26
27
|
writeOwnerOrganization,
|
|
27
28
|
writeRecordUpdated,
|
|
29
|
+
writeSecurityConstraints,
|
|
28
30
|
writeSpatialRepresentation,
|
|
29
31
|
writeStatus,
|
|
30
|
-
|
|
32
|
+
writeTopics,
|
|
31
33
|
writeTitle,
|
|
32
34
|
writeUniqueIdentifier,
|
|
33
35
|
writeUpdateFrequency,
|
|
34
|
-
writeUseLimitations,
|
|
35
36
|
} from './write-parts'
|
|
36
37
|
import {
|
|
37
38
|
readAbstract,
|
|
38
|
-
readAccessConstraints,
|
|
39
39
|
readContacts,
|
|
40
40
|
readDatasetCreated,
|
|
41
41
|
readDatasetUpdated,
|
|
@@ -43,21 +43,22 @@ import {
|
|
|
43
43
|
readIsoTopics,
|
|
44
44
|
readKeywords,
|
|
45
45
|
readKind,
|
|
46
|
+
readLegalConstraints,
|
|
46
47
|
readLicenses,
|
|
47
48
|
readLineage,
|
|
48
49
|
readOnlineResources,
|
|
50
|
+
readOtherConstraints,
|
|
49
51
|
readOverviews,
|
|
50
52
|
readOwnerOrganization,
|
|
51
53
|
readRecordUpdated,
|
|
54
|
+
readSecurityConstraints,
|
|
52
55
|
readSpatialExtents,
|
|
53
56
|
readSpatialRepresentation,
|
|
54
57
|
readStatus,
|
|
55
58
|
readTemporalExtents,
|
|
56
|
-
readThemes,
|
|
57
59
|
readTitle,
|
|
58
60
|
readUniqueIdentifier,
|
|
59
61
|
readUpdateFrequency,
|
|
60
|
-
readUseLimitations,
|
|
61
62
|
} from './read-parts'
|
|
62
63
|
import { isEqual } from '../convert-utils'
|
|
63
64
|
|
|
@@ -74,15 +75,13 @@ export function toModel(xml: string): CatalogRecord {
|
|
|
74
75
|
const recordUpdated = readRecordUpdated(rootEl)
|
|
75
76
|
const recordCreated = recordUpdated
|
|
76
77
|
const keywords = readKeywords(rootEl)
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
const
|
|
78
|
+
const topics = readIsoTopics(rootEl)
|
|
79
|
+
const legalConstraints = readLegalConstraints(rootEl)
|
|
80
|
+
const otherConstraints = readOtherConstraints(rootEl)
|
|
81
|
+
const securityConstraints = readSecurityConstraints(rootEl)
|
|
80
82
|
const licenses = readLicenses(rootEl)
|
|
81
83
|
const overviews = readOverviews(rootEl)
|
|
82
84
|
|
|
83
|
-
// not used yet
|
|
84
|
-
const isoTopics = readIsoTopics(rootEl)
|
|
85
|
-
|
|
86
85
|
if (kind === 'dataset') {
|
|
87
86
|
const status = readStatus(rootEl)
|
|
88
87
|
const datasetCreated = readDatasetCreated(rootEl)
|
|
@@ -106,10 +105,11 @@ export function toModel(xml: string): CatalogRecord {
|
|
|
106
105
|
contacts,
|
|
107
106
|
contactsForResource: [], // FIXME: is that really useful??
|
|
108
107
|
keywords,
|
|
109
|
-
|
|
110
|
-
accessConstraints,
|
|
111
|
-
useLimitations,
|
|
108
|
+
topics,
|
|
112
109
|
licenses,
|
|
110
|
+
legalConstraints,
|
|
111
|
+
securityConstraints,
|
|
112
|
+
otherConstraints,
|
|
113
113
|
...(datasetCreated && { datasetCreated }),
|
|
114
114
|
...(datasetUpdated && { datasetUpdated }),
|
|
115
115
|
lineage,
|
|
@@ -132,10 +132,11 @@ export function toModel(xml: string): CatalogRecord {
|
|
|
132
132
|
ownerOrganization,
|
|
133
133
|
contacts,
|
|
134
134
|
keywords,
|
|
135
|
-
|
|
136
|
-
accessConstraints,
|
|
137
|
-
useLimitations,
|
|
135
|
+
topics,
|
|
138
136
|
licenses,
|
|
137
|
+
legalConstraints,
|
|
138
|
+
securityConstraints,
|
|
139
|
+
otherConstraints,
|
|
139
140
|
overviews,
|
|
140
141
|
onlineResources,
|
|
141
142
|
} as ServiceRecord
|
|
@@ -163,10 +164,12 @@ export function toXml(record: CatalogRecord, originalXml?: string): string {
|
|
|
163
164
|
writeAbstract(record, rootEl)
|
|
164
165
|
fieldChanged('contacts') && writeContacts(record, rootEl)
|
|
165
166
|
fieldChanged('keywords') && writeKeywords(record, rootEl)
|
|
166
|
-
fieldChanged('
|
|
167
|
-
fieldChanged('
|
|
167
|
+
fieldChanged('topics') && writeTopics(record, rootEl)
|
|
168
|
+
fieldChanged('legalConstraints') && writeLegalConstraints(record, rootEl)
|
|
169
|
+
fieldChanged('securityConstraints') &&
|
|
170
|
+
writeSecurityConstraints(record, rootEl)
|
|
168
171
|
fieldChanged('licenses') && writeLicenses(record, rootEl)
|
|
169
|
-
fieldChanged('
|
|
172
|
+
fieldChanged('otherConstraints') && writeOtherConstraints(record, rootEl)
|
|
170
173
|
|
|
171
174
|
if (record.kind === 'dataset') {
|
|
172
175
|
writeStatus(record, rootEl)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
AccessConstraintType,
|
|
2
|
+
Constraint,
|
|
4
3
|
DatasetDistribution,
|
|
5
4
|
DatasetSpatialExtent,
|
|
6
5
|
DatasetTemporalExtent,
|
|
7
6
|
GraphicOverview,
|
|
8
7
|
Individual,
|
|
9
|
-
|
|
8
|
+
Keyword,
|
|
9
|
+
KeywordThesaurus,
|
|
10
10
|
Organization,
|
|
11
11
|
RecordKind,
|
|
12
12
|
RecordStatus,
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
} from '../function-utils'
|
|
42
42
|
import { getRoleFromRoleCode } from './codelists/role.mapper'
|
|
43
43
|
import { matchMimeType, matchProtocol } from '../common/distribution.mapper'
|
|
44
|
+
import { getKeywordTypeFromKeywordTypeCode } from './codelists/keyword.mapper'
|
|
44
45
|
|
|
45
46
|
function extractCharacterString(): ChainableFunction<XmlElement, string> {
|
|
46
47
|
return pipe(
|
|
@@ -183,59 +184,69 @@ function extractStatus(): ChainableFunction<XmlElement, RecordStatus> {
|
|
|
183
184
|
}
|
|
184
185
|
|
|
185
186
|
// from gmd:resourceConstraints
|
|
186
|
-
function
|
|
187
|
+
function extractLegalConstraints(): ChainableFunction<
|
|
187
188
|
XmlElement,
|
|
188
|
-
Array<
|
|
189
|
+
Array<Constraint>
|
|
189
190
|
> {
|
|
190
|
-
|
|
191
|
+
return pipe(
|
|
191
192
|
findChildrenElement('gmd:MD_LegalConstraints', false),
|
|
192
193
|
filterArray(
|
|
193
194
|
pipe(
|
|
194
195
|
findChildrenElement('gmd:MD_RestrictionCode'),
|
|
195
196
|
mapArray(readAttribute('codeListValue')),
|
|
196
|
-
map(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
map((values) => values.indexOf('license') === -1)
|
|
198
|
+
)
|
|
199
|
+
),
|
|
200
|
+
mapArray(
|
|
201
|
+
combine(
|
|
202
|
+
findChildrenElement('gmd:otherConstraints'),
|
|
203
|
+
findChildrenElement('gmd:useLimitation')
|
|
201
204
|
)
|
|
202
205
|
),
|
|
203
|
-
mapArray(findChildrenElement('gmd:otherConstraints')),
|
|
204
206
|
flattenArray(),
|
|
205
|
-
|
|
206
|
-
mapArray((
|
|
207
|
+
flattenArray(),
|
|
208
|
+
mapArray(combine(extractCharacterString(), extractUrl())),
|
|
209
|
+
mapArray(([text, url]) => ({
|
|
210
|
+
...(url && { url }),
|
|
207
211
|
text,
|
|
208
|
-
type: 'other' as AccessConstraintType,
|
|
209
212
|
}))
|
|
210
213
|
)
|
|
211
|
-
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// from gmd:resourceConstraints
|
|
217
|
+
function extractSecurityConstraints(): ChainableFunction<
|
|
218
|
+
XmlElement,
|
|
219
|
+
Array<Constraint>
|
|
220
|
+
> {
|
|
221
|
+
return pipe(
|
|
212
222
|
findNestedElements('gmd:MD_SecurityConstraints', 'gmd:useLimitation'),
|
|
213
|
-
|
|
214
|
-
mapArray((
|
|
223
|
+
flattenArray(),
|
|
224
|
+
mapArray(combine(extractCharacterString(), extractUrl())),
|
|
225
|
+
mapArray(([text, url]) => ({
|
|
226
|
+
...(url && { url }),
|
|
215
227
|
text,
|
|
216
|
-
type: 'security' as AccessConstraintType,
|
|
217
228
|
}))
|
|
218
229
|
)
|
|
219
|
-
return pipe(
|
|
220
|
-
combine(getOtherConstraints, getSecurityConstraints),
|
|
221
|
-
flattenArray()
|
|
222
|
-
)
|
|
223
230
|
}
|
|
224
231
|
|
|
225
232
|
// from gmd:resourceConstraints
|
|
226
|
-
function
|
|
233
|
+
function extractOtherConstraints(): ChainableFunction<
|
|
234
|
+
XmlElement,
|
|
235
|
+
Array<Constraint>
|
|
236
|
+
> {
|
|
227
237
|
return pipe(
|
|
228
|
-
|
|
229
|
-
findNestedElements('gmd:MD_Constraints', 'gmd:useLimitation'),
|
|
230
|
-
findNestedElements('gmd:MD_LegalConstraints', 'gmd:useLimitation')
|
|
231
|
-
),
|
|
238
|
+
findNestedElements('gmd:MD_Constraints', 'gmd:useLimitation'),
|
|
232
239
|
flattenArray(),
|
|
233
|
-
mapArray(extractCharacterString())
|
|
240
|
+
mapArray(combine(extractCharacterString(), extractUrl())),
|
|
241
|
+
mapArray(([text, url]) => ({
|
|
242
|
+
...(url && { url }),
|
|
243
|
+
text,
|
|
244
|
+
}))
|
|
234
245
|
)
|
|
235
246
|
}
|
|
236
247
|
|
|
237
248
|
// from gmd:resourceConstraints
|
|
238
|
-
function extractLicenses(): ChainableFunction<XmlElement, Array<
|
|
249
|
+
function extractLicenses(): ChainableFunction<XmlElement, Array<Constraint>> {
|
|
239
250
|
return pipe(
|
|
240
251
|
findChildrenElement('gmd:MD_LegalConstraints', false),
|
|
241
252
|
filterArray(
|
|
@@ -246,15 +257,18 @@ function extractLicenses(): ChainableFunction<XmlElement, Array<License>> {
|
|
|
246
257
|
)
|
|
247
258
|
),
|
|
248
259
|
mapArray(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
map(([text, url]) => ({
|
|
253
|
-
...(url && { url }),
|
|
254
|
-
text,
|
|
255
|
-
}))
|
|
260
|
+
combine(
|
|
261
|
+
findChildrenElement('gmd:otherConstraints'),
|
|
262
|
+
findChildrenElement('gmd:useLimitation')
|
|
256
263
|
)
|
|
257
|
-
)
|
|
264
|
+
),
|
|
265
|
+
flattenArray(),
|
|
266
|
+
flattenArray(),
|
|
267
|
+
mapArray(combine(extractCharacterString(), extractUrl())),
|
|
268
|
+
mapArray(([text, url]) => ({
|
|
269
|
+
...(url && { url }),
|
|
270
|
+
text,
|
|
271
|
+
}))
|
|
258
272
|
)
|
|
259
273
|
}
|
|
260
274
|
|
|
@@ -541,29 +555,60 @@ export function readContacts(rootEl: XmlElement): Individual[] {
|
|
|
541
555
|
)(rootEl)
|
|
542
556
|
}
|
|
543
557
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
)
|
|
554
|
-
),
|
|
555
|
-
mapArray(findChildrenElement('gmd:keyword')),
|
|
556
|
-
flattenArray(),
|
|
557
|
-
mapArray(extractCharacterString())
|
|
558
|
+
// from gmd:thesaurusName
|
|
559
|
+
function readThesaurus(rootEl: XmlElement): KeywordThesaurus {
|
|
560
|
+
if (!rootEl) return null
|
|
561
|
+
|
|
562
|
+
const findIdentifier = findNestedElement(
|
|
563
|
+
'gmd:CI_Citation',
|
|
564
|
+
'gmd:identifier',
|
|
565
|
+
'gmd:MD_Identifier',
|
|
566
|
+
'gmd:code'
|
|
558
567
|
)
|
|
568
|
+
const id = pipe(findIdentifier, extractCharacterString())(rootEl)
|
|
569
|
+
const url = pipe(findIdentifier, extractUrl())(rootEl)
|
|
570
|
+
const name = pipe(
|
|
571
|
+
findNestedElement('gmd:CI_Citation', 'gmd:title'),
|
|
572
|
+
extractCharacterString()
|
|
573
|
+
)(rootEl)
|
|
574
|
+
return {
|
|
575
|
+
id,
|
|
576
|
+
...(name && { name }),
|
|
577
|
+
...(url && { url }),
|
|
578
|
+
}
|
|
559
579
|
}
|
|
560
580
|
|
|
561
|
-
|
|
562
|
-
|
|
581
|
+
// from gmd:MD_Keywords
|
|
582
|
+
function readKeywordGroup(rootEl: XmlElement): Keyword[] {
|
|
583
|
+
const type = pipe(
|
|
584
|
+
findChildrenElement('gmd:MD_KeywordTypeCode'),
|
|
585
|
+
mapArray(readAttribute('codeListValue')),
|
|
586
|
+
map((values) => getKeywordTypeFromKeywordTypeCode(values[0]))
|
|
587
|
+
)(rootEl)
|
|
588
|
+
const thesaurus = pipe(
|
|
589
|
+
findNestedElement('gmd:thesaurusName'),
|
|
590
|
+
readThesaurus
|
|
591
|
+
)(rootEl)
|
|
592
|
+
return pipe(
|
|
593
|
+
findChildrenElement('gmd:keyword'),
|
|
594
|
+
mapArray((el) => {
|
|
595
|
+
const label = extractCharacterString()(el)
|
|
596
|
+
return {
|
|
597
|
+
...(thesaurus ? { thesaurus } : {}),
|
|
598
|
+
label,
|
|
599
|
+
type,
|
|
600
|
+
} as Keyword
|
|
601
|
+
})
|
|
602
|
+
)(rootEl)
|
|
563
603
|
}
|
|
564
604
|
|
|
565
|
-
export function
|
|
566
|
-
return
|
|
605
|
+
export function readKeywords(rootEl: XmlElement): Keyword[] {
|
|
606
|
+
return pipe(
|
|
607
|
+
findIdentification(),
|
|
608
|
+
findNestedElements('gmd:descriptiveKeywords', 'gmd:MD_Keywords'),
|
|
609
|
+
mapArray(readKeywordGroup),
|
|
610
|
+
flattenArray()
|
|
611
|
+
)(rootEl)
|
|
567
612
|
}
|
|
568
613
|
|
|
569
614
|
export function readStatus(rootEl: XmlElement): RecordStatus {
|
|
@@ -579,24 +624,32 @@ const getConstraints = pipe(
|
|
|
579
624
|
findChildrenElement('gmd:resourceConstraints', false)
|
|
580
625
|
)
|
|
581
626
|
|
|
582
|
-
export function
|
|
627
|
+
export function readLegalConstraints(rootEl: XmlElement): Constraint[] {
|
|
583
628
|
return pipe(
|
|
584
629
|
getConstraints,
|
|
585
|
-
mapArray(
|
|
630
|
+
mapArray(extractLegalConstraints()),
|
|
586
631
|
flattenArray(),
|
|
587
632
|
flattenArray()
|
|
588
633
|
)(rootEl)
|
|
589
634
|
}
|
|
590
635
|
|
|
591
|
-
export function
|
|
636
|
+
export function readSecurityConstraints(rootEl: XmlElement): Constraint[] {
|
|
637
|
+
return pipe(
|
|
638
|
+
getConstraints,
|
|
639
|
+
mapArray(extractSecurityConstraints()),
|
|
640
|
+
flattenArray()
|
|
641
|
+
)(rootEl)
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
export function readOtherConstraints(rootEl: XmlElement): Constraint[] {
|
|
592
645
|
return pipe(
|
|
593
646
|
getConstraints,
|
|
594
|
-
mapArray(
|
|
647
|
+
mapArray(extractOtherConstraints()),
|
|
595
648
|
flattenArray()
|
|
596
649
|
)(rootEl)
|
|
597
650
|
}
|
|
598
651
|
|
|
599
|
-
export function readLicenses(rootEl: XmlElement):
|
|
652
|
+
export function readLicenses(rootEl: XmlElement): Constraint[] {
|
|
600
653
|
return pipe(
|
|
601
654
|
getConstraints,
|
|
602
655
|
mapArray(extractLicenses()),
|
|
@@ -608,7 +661,7 @@ export function readLicenses(rootEl: XmlElement): License[] {
|
|
|
608
661
|
export function readIsoTopics(rootEl: XmlElement): string[] {
|
|
609
662
|
return pipe(
|
|
610
663
|
findIdentification(),
|
|
611
|
-
findChildrenElement('gmd:MD_TopicCategoryCode',
|
|
664
|
+
findChildrenElement('gmd:MD_TopicCategoryCode', true),
|
|
612
665
|
mapArray(readText())
|
|
613
666
|
)(rootEl)
|
|
614
667
|
}
|