geo_combine 0.9.2 → 0.10.0

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.
@@ -0,0 +1,738 @@
1
+ <!--
2
+ iso2aardvark.xsl - Transformation from ISO 19139 XML into Aardvark json
3
+ Some fields will require customization at the organizational level (e.g: dct_references_s, schema_provider_s)
4
+
5
+ -->
6
+
7
+ <xsl:stylesheet xmlns="http://www.loc.gov/mods/v3" xmlns:gco="http://www.isotc211.org/2005/gco"
8
+ xmlns:gmi="http://www.isotc211.org/2005/gmi" xmlns:gmd="http://www.isotc211.org/2005/gmd"
9
+ xmlns:gml="http://www.opengis.net/gml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"
11
+ xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="gml gmd gco gmi xsl">
12
+ <xsl:output method="text" encoding="UTF-8" version="1.0" omit-xml-declaration="yes" indent="yes"
13
+ media-type="application/json"/>
14
+ <xsl:strip-space elements="*"/>
15
+
16
+
17
+
18
+ <xsl:template match="/">
19
+
20
+ <xsl:variable name="upperCorner">
21
+ <xsl:value-of
22
+ select="number(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:eastBoundLongitude/gco:Decimal)"/>
23
+ <xsl:text> </xsl:text>
24
+ <xsl:value-of
25
+ select="number(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:northBoundLatitude/gco:Decimal)"
26
+ />
27
+ </xsl:variable>
28
+
29
+ <xsl:variable name="lowerCorner">
30
+ <xsl:value-of
31
+ select="number(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:westBoundLongitude/gco:Decimal)"/>
32
+ <xsl:text> </xsl:text>
33
+ <xsl:value-of
34
+ select="number(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:southBoundLatitude/gco:Decimal)"/>
35
+ </xsl:variable>
36
+
37
+ <xsl:variable name="druid">
38
+ <xsl:value-of select=" substring-after(gmd:MD_Metadata/gmd:fileIdentifier/gco:CharacterString,'purl:')"/>
39
+ </xsl:variable>
40
+ <xsl:variable name="uuid">
41
+ <xsl:value-of select="gmd:MD_Metadata/gmd:fileIdentifier/gco:CharacterString"/>
42
+ </xsl:variable>
43
+ <xsl:variable name="temporalBegin">
44
+ <xsl:choose>
45
+ <xsl:when
46
+ test="matches(/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition, 'T')">
47
+ <xsl:value-of
48
+ select="substring-before(/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition, 'T')"
49
+ />
50
+ </xsl:when>
51
+ <xsl:when
52
+ test="matches(/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition, '^\d{4}-[\d]{2}-[\d]{2}$')">
53
+ <xsl:value-of
54
+ select="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition"
55
+ />
56
+ </xsl:when>
57
+ </xsl:choose>
58
+ </xsl:variable>
59
+ <xsl:variable name="beginDate">
60
+ <xsl:choose>
61
+ <xsl:when
62
+ test=" matches(/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition, 'T')">
63
+ <xsl:value-of
64
+ select="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition"
65
+ />
66
+ </xsl:when>
67
+ <xsl:when
68
+ test="matches(/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition, '^\d{4}-\d{2}-\d{2}$')">
69
+ <xsl:value-of
70
+ select="dateTime(/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition, xs:time('00:00:00'))"
71
+ />
72
+ </xsl:when>
73
+ </xsl:choose>
74
+ </xsl:variable>
75
+ <xsl:variable name="endDate">
76
+ <xsl:choose>
77
+ <xsl:when
78
+ test="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition != ''">
79
+ <xsl:value-of
80
+ select="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition"
81
+ />
82
+ </xsl:when>
83
+ <xsl:when
84
+ test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition/@indeterminatePosition">
85
+ <xsl:text>?</xsl:text>
86
+ </xsl:when>
87
+ </xsl:choose>
88
+ </xsl:variable>
89
+ <xsl:variable name="temporalInstance">
90
+ <xsl:choose>
91
+ <xsl:when
92
+ test="count(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimeInstant/gml:timePosition) = 1">
93
+ <xsl:choose>
94
+ <xsl:when
95
+ test="matches(/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimeInstant/gml:timePosition, 'T')">
96
+ <xsl:value-of
97
+ select="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimeInstant/gml:timePosition"
98
+ />
99
+ </xsl:when>
100
+ <xsl:when
101
+ test="matches(/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimeInstant/gml:timePosition, '^\d{4}-\d{2}-\d{2}$')">
102
+ <xsl:value-of
103
+ select="dateTime(/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimeInstant/gml:timePosition, xs:time('00:00:00'))"
104
+ />
105
+ </xsl:when>
106
+ </xsl:choose>
107
+ </xsl:when>
108
+ </xsl:choose>
109
+ </xsl:variable>
110
+ <xsl:variable name="titleDate">
111
+ <xsl:value-of
112
+ select="substring(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString, string-length(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString) - 3)"
113
+ />
114
+ </xsl:variable>
115
+ <xsl:variable name="dateIssued">
116
+ <xsl:value-of
117
+ select="year-from-date(xs:date(/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date[gmd:dateType/gmd:CI_DateTypeCode[text() = 'publication']]/gmd:date/gco:Date))"
118
+ />
119
+ </xsl:variable>
120
+
121
+ <xsl:variable name="identifier">
122
+ <xsl:choose>
123
+ <!-- for Stanford URIs -->
124
+ <xsl:when test="contains($uuid, 'purl')">
125
+ <xsl:value-of select="substring($uuid, string-length($uuid) - 10)"/>
126
+ </xsl:when>
127
+ <!-- all others -->
128
+ <xsl:otherwise>
129
+ <xsl:value-of select="$uuid"/>
130
+ </xsl:otherwise>
131
+ </xsl:choose>
132
+ </xsl:variable>
133
+ <!-- 01. Title. Required. Not repeatable -->
134
+ <xsl:text>{"dct_title_s": "</xsl:text>
135
+ <xsl:value-of
136
+ select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title"/>
137
+ <xsl:text>",</xsl:text>
138
+ <!-- 02. Alternative Title. Optional. Repeatable. -->
139
+ <xsl:if test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:alternateTitle">
140
+ <xsl:text>"dct_alternative_sm": [</xsl:text>
141
+ <xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:alternateTitle/gco:CharacterString">
142
+ <xsl:text>"</xsl:text>
143
+ <xsl:value-of select="."/>
144
+ <xsl:text>"</xsl:text>
145
+ <xsl:if test="position() != last()">
146
+ <xsl:text>,</xsl:text>
147
+ </xsl:if>
148
+ </xsl:for-each>
149
+ <xsl:text>]</xsl:text>
150
+ <xsl:text>,</xsl:text>
151
+ </xsl:if>
152
+ <!-- 03. Description. Recommended. Repeatable -->
153
+ <xsl:if test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract">
154
+ <xsl:text>"dct_description_sm": [</xsl:text>
155
+ <xsl:for-each
156
+ select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract/gco:CharacterString">
157
+ <xsl:text>"</xsl:text>
158
+ <xsl:value-of select="."/>
159
+ <xsl:text>"</xsl:text>
160
+ </xsl:for-each>
161
+ <xsl:text>],</xsl:text>
162
+ </xsl:if>
163
+
164
+ <!-- 04. Language. Optional. Repeatable -->
165
+ <xsl:if
166
+ test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:language[not(@gco:nilReason = 'missing')]">
167
+ <xsl:text>"dct_language_sm": [</xsl:text>
168
+ <xsl:for-each
169
+ select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:language">
170
+ <xsl:text>"</xsl:text>
171
+ <xsl:value-of select="gmd:LanguageCode"/>
172
+ <xsl:text>"</xsl:text>
173
+ <xsl:if test="position() != last()">
174
+ <xsl:text>,</xsl:text>
175
+ </xsl:if>
176
+ </xsl:for-each>
177
+ <xsl:text>],</xsl:text>
178
+ </xsl:if>
179
+ <!-- 05. Creator. Recommended. Repeatable -->
180
+ <xsl:if
181
+ test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue = 'originator']">
182
+ <xsl:text>"dct_creator_sm": [</xsl:text>
183
+
184
+ <xsl:for-each
185
+ select="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty[gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode/@codeListValue = 'originator' and not(gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString | gmd:individualName/gco:CharacterString = preceding-sibling::gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString | gmd:individualName/gco:CharacterString)]">
186
+ <xsl:choose>
187
+ <xsl:when
188
+ test="gmd:CI_ResponsibleParty/gmd:individualName/gco:CharacterString and gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString">
189
+ <xsl:text>"</xsl:text>
190
+ <xsl:value-of select="gmd:CI_ResponsibleParty/gmd:individualName/gco:CharacterString"/>
191
+ <xsl:text> (</xsl:text>
192
+ <xsl:if test="gmd:CI_ResponsibleParty/gmd:positionName">
193
+ <xsl:value-of select="gmd:CI_ResponsibleParty/gmd:positionName/gco:CharacterString"/>
194
+ </xsl:if>
195
+ <xsl:text>, </xsl:text>
196
+ <xsl:value-of select="gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString"/>
197
+ <xsl:text>)"</xsl:text>
198
+ </xsl:when>
199
+ <xsl:when test="gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString">
200
+ <xsl:text>"</xsl:text>
201
+ <xsl:value-of select="gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString"/>
202
+ <xsl:text>"</xsl:text>
203
+ </xsl:when>
204
+ <xsl:when test="gmd:CI_ResponsibleParty/gmd:individualName/gco:CharacterString">
205
+ <xsl:text>"</xsl:text>
206
+ <xsl:value-of select="gmd:CI_ResponsibleParty/gmd:individualName/gco:CharacterString"/>
207
+ <xsl:text>"</xsl:text>
208
+ </xsl:when>
209
+ </xsl:choose>
210
+ <xsl:if test="position() != last()">
211
+ <xsl:text>,</xsl:text>
212
+ </xsl:if>
213
+ </xsl:for-each>
214
+ <xsl:text>],</xsl:text>
215
+ </xsl:if>
216
+ <!-- 06. Publisher. Recommended. Repeatable -->
217
+ <xsl:if
218
+ test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue = 'publisher']">
219
+ <xsl:text>"dct_publisher_sm": [</xsl:text>
220
+ <xsl:for-each
221
+ select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue = 'publisher']">
222
+ <xsl:if test="ancestor-or-self::*/gmd:organisationName">
223
+ <xsl:text>"</xsl:text>
224
+ <xsl:value-of select="ancestor-or-self::*/gmd:organisationName"/>
225
+ <xsl:text>"</xsl:text>
226
+ <xsl:if test="position() != last()">
227
+ <xsl:text>,</xsl:text>
228
+ </xsl:if>
229
+ </xsl:if>
230
+ <xsl:if test="ancestor-or-self::*/gmd:individualName">
231
+ <xsl:text>"</xsl:text>
232
+ <xsl:value-of select="ancestor-or-self::*/gmd:individualName"/>
233
+ <xsl:text>"</xsl:text>
234
+ <xsl:if test="position() != last()">
235
+ <xsl:text>,</xsl:text>
236
+ </xsl:if>
237
+ </xsl:if>
238
+ </xsl:for-each>
239
+ <xsl:text>],</xsl:text>
240
+ </xsl:if>
241
+ <!-- 07. Provider. Recommended. Not Repeatable. -->
242
+
243
+ <xsl:text>"schema_provider_s": "</xsl:text>
244
+ <xsl:value-of select="gmd:MD_Metadata/gmd:distributionInfo/gmd:MD_Distribution/gmd:distributor/gmd:MD_Distributor/gmd:distributorContact/gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString"/>
245
+ <xsl:text>",</xsl:text>
246
+
247
+ <!-- 08. Resource Class. Required. Repeatable up to 5 times. -->
248
+ <xsl:text>"gbl_resourceClass_sm": ["Datasets"],</xsl:text>
249
+
250
+ <!-- 09. Resource Type. Recommended -->
251
+
252
+ <xsl:if test="//gmd:MD_GeometricObjectTypeCode[@codeListValue][contains(.,'point') or (.,'curve') or (.,'surface')] or //gmd:distributionInfo/gmd:MD_Distribution/gmd:distributionFormat/gmd:MD_Format/gmd:name/gco:CharacterString/text()[contains(.,'Raster')]">
253
+ <xsl:text>"gbl_resourceType_sm": ["</xsl:text>
254
+ </xsl:if>
255
+ <xsl:choose>
256
+ <xsl:when
257
+ test="gmd:MD_Metadata/gmd:spatialRepresentationInfo/gmd:MD_VectorSpatialRepresentation/gmd:geometricObjects/gmd:MD_GeometricObjects/gmd:geometricObjectType/gmd:MD_GeometricObjectTypeCode[@codeListValue = 'surface']">
258
+ <xsl:text>Polygon data</xsl:text>
259
+ <xsl:text>"],</xsl:text>
260
+ </xsl:when>
261
+
262
+ <xsl:when
263
+ test="gmd:MD_Metadata/gmd:spatialRepresentationInfo/gmd:MD_VectorSpatialRepresentation/gmd:geometricObjects/gmd:MD_GeometricObjects/gmd:geometricObjectType/gmd:MD_GeometricObjectTypeCode[@codeListValue = 'composite']">
264
+ <xsl:text>Polygon data</xsl:text>
265
+ <xsl:text>"],</xsl:text>
266
+ </xsl:when>
267
+
268
+ <xsl:when
269
+ test="gmd:MD_Metadata/gmd:spatialRepresentationInfo/gmd:MD_VectorSpatialRepresentation/gmd:geometricObjects/gmd:MD_GeometricObjects/gmd:geometricObjectType/gmd:MD_GeometricObjectTypeCode[@codeListValue = 'curve']">
270
+ <xsl:text>Line data</xsl:text>
271
+ </xsl:when>
272
+
273
+ <xsl:when
274
+ test="gmd:MD_Metadata/gmd:spatialRepresentationInfo/gmd:MD_VectorSpatialRepresentation/gmd:geometricObjects/gmd:MD_GeometricObjects/gmd:geometricObjectType/gmd:MD_GeometricObjectTypeCode[@codeListValue = 'point']">
275
+ <xsl:text>Point data</xsl:text>
276
+ <xsl:text>"],</xsl:text>
277
+ </xsl:when>
278
+ <xsl:when test="gmd:MD_Metadata/gmd:distributionInfo/gmd:MD_Distribution/gmd:distributionFormat/gmd:MD_Format/gmd:name/gco:CharacterString/text()[contains(.,'Raster')]">
279
+ <xsl:text>Vector data</xsl:text>
280
+ <xsl:text>"],</xsl:text>
281
+ </xsl:when>
282
+ <xsl:when test="gmd:MD_Metadata/gmd:distributionInfo/gmd:MD_Distribution/gmd:distributionFormat/gmd:MD_Format/gmd:name/gco:CharacterString/text()[contains(.,'Raster')]">
283
+ <xsl:text>Raster data</xsl:text>
284
+ <xsl:text>"],</xsl:text>
285
+ </xsl:when>
286
+ </xsl:choose>
287
+
288
+ <!-- 10. Subject. Optional. Repeatable -->
289
+
290
+ <xsl:if
291
+ test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode[@codeListValue = 'theme']">
292
+ <xsl:text>"dct_subject_sm": [</xsl:text>
293
+ <xsl:for-each
294
+ select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords[gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode[@codeListValue = 'theme']]">
295
+ <xsl:for-each select="gmd:MD_Keywords/gmd:keyword">
296
+ <xsl:text>"</xsl:text>
297
+ <xsl:value-of select="gco:CharacterString"/>
298
+ <xsl:text>"</xsl:text>
299
+ <xsl:if test="position() != last()">
300
+ <xsl:text>,</xsl:text>
301
+ </xsl:if>
302
+ </xsl:for-each>
303
+ <xsl:if test="position() != last()">
304
+ <xsl:text>,</xsl:text>
305
+ </xsl:if>
306
+ </xsl:for-each>
307
+ <xsl:text>],</xsl:text>
308
+ </xsl:if>
309
+ <!-- 11. Theme. Optional. Repeatable -->
310
+ <xsl:if test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory/gmd:MD_TopicCategoryCode">
311
+ <xsl:text>"dcat_theme_sm": [</xsl:text>
312
+ <xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory/gmd:MD_TopicCategoryCode">
313
+
314
+
315
+ <xsl:if test="contains(.,'farming')">
316
+ <xsl:text>"Agriculture"</xsl:text>
317
+ </xsl:if>
318
+ <xsl:if test="contains(.,'biota')">
319
+ <xsl:text>"Biology"</xsl:text>
320
+ </xsl:if>
321
+ <xsl:if test="contains(.,'boundaries')">
322
+ <xsl:text>"Boundaries"</xsl:text>
323
+ </xsl:if>
324
+ <xsl:if test="contains(.,'climatologyMeteorologyAtmosphere')">
325
+ <xsl:text>"Climate"</xsl:text>
326
+ </xsl:if>
327
+ <xsl:if test="contains(.,'economy')">
328
+ <xsl:text>"Economy"</xsl:text>
329
+ </xsl:if>
330
+ <xsl:if test="contains(.,'elevation')">
331
+ <xsl:text>"Elevation"</xsl:text>
332
+ </xsl:if>
333
+ <xsl:if test="contains(.,'environment')">
334
+ <xsl:text>"Environment"</xsl:text>
335
+ </xsl:if>
336
+ <xsl:if test="contains(.,'geoscientificInformation')">
337
+ <xsl:text>"Geology"</xsl:text>
338
+ </xsl:if>
339
+ <xsl:if test="contains(.,'health')">
340
+ <xsl:text>"Health"</xsl:text>
341
+ </xsl:if>
342
+ <xsl:if test="contains(.,'imageryBaseMapsEarthCover')">
343
+
344
+ <xsl:choose>
345
+ <xsl:when test="//gmd:keyword/gco:CharacterString[contains(.,'Land cover')]">
346
+ <xsl:text>"Land cover"</xsl:text>
347
+ </xsl:when>
348
+ <xsl:when test="//gmd:keyword/gco:CharacterString[contains(.,'photo')]">
349
+ <xsl:text>"Imagery"</xsl:text>
350
+ </xsl:when>
351
+ <xsl:otherwise>
352
+ <xsl:text>"Imagery"</xsl:text>
353
+ </xsl:otherwise>
354
+ </xsl:choose>
355
+ </xsl:if>
356
+
357
+ <xsl:if test="contains(.,'inlandWaters')">
358
+ <xsl:text>"Inland waters"</xsl:text>
359
+
360
+ </xsl:if>
361
+ <xsl:if test="contains(.,'location')">
362
+ <xsl:text>"Location"</xsl:text>
363
+ </xsl:if>
364
+ <xsl:if test="contains(.,'intelligenceMilitary')">
365
+ <xsl:text>"Military"</xsl:text>
366
+ </xsl:if>
367
+ <xsl:if test="contains(.,'oceans')">
368
+ <xsl:text>"Oceans"</xsl:text>
369
+ </xsl:if>
370
+ <xsl:if test="contains(.,'planningCadastre')">
371
+ <xsl:text>"Property"</xsl:text>
372
+ </xsl:if>
373
+ <xsl:if test="contains(.,'society')">
374
+ <xsl:text>"Society"</xsl:text>
375
+ </xsl:if>
376
+ <xsl:if test="contains(.,'structure')">
377
+ <xsl:text>"Structure"</xsl:text>
378
+ </xsl:if>
379
+ <xsl:if test="contains(.,'transportation')">
380
+ <xsl:text>"Transportation"</xsl:text>
381
+ </xsl:if>
382
+ <xsl:if test="contains(.,'utilitiesCommunication')">
383
+ <xsl:text>"Utilities"</xsl:text>
384
+ </xsl:if>
385
+ <xsl:if test="position() != last()">
386
+ <xsl:text>,</xsl:text>
387
+ </xsl:if>
388
+ </xsl:for-each>
389
+ </xsl:if>
390
+
391
+
392
+ <xsl:text>],</xsl:text>
393
+
394
+ <!-- 12. Keyword. Optional. Repeatable -->
395
+
396
+ <!-- 13. Temporal Coverage. Recommended. Repeatable -->
397
+ <xsl:choose>
398
+ <xsl:when test="$beginDate != '' and $endDate != ''">
399
+ <xsl:text>"dct_temporal_sm": ["</xsl:text>
400
+ <xsl:value-of select="format-dateTime($beginDate, '[Y0001]-[M01]-[D01]')"/>
401
+ <xsl:text> to </xsl:text>
402
+ <xsl:choose>
403
+ <xsl:when test="$endDate = '?'">
404
+ <xsl:value-of select="$endDate"/>
405
+ </xsl:when>
406
+ <xsl:when test="month-from-dateTime($endDate) = 1 and day-from-dateTime($endDate) = 1">
407
+ <xsl:value-of select="year-from-dateTime($endDate)"/>
408
+ </xsl:when>
409
+ <xsl:otherwise>
410
+ <xsl:value-of select="format-dateTime($endDate, '[Y0001]-[M01]-[D01]')"/>
411
+ </xsl:otherwise>
412
+ </xsl:choose>
413
+ <xsl:text>"],</xsl:text>
414
+ </xsl:when>
415
+ <xsl:when test="$temporalInstance != ''">
416
+ <xsl:text>"dct_temporal_sm": ["</xsl:text>
417
+ <xsl:choose>
418
+ <xsl:when
419
+ test="month-from-dateTime($temporalInstance) = 1 and day-from-dateTime($temporalInstance) = 1">
420
+ <xsl:value-of select="year-from-dateTime($temporalInstance)"/>
421
+ </xsl:when>
422
+ <xsl:otherwise>
423
+ <xsl:value-of select="format-dateTime($temporalInstance, '[Y0001]-[M01]-[D01]')"/>
424
+ </xsl:otherwise>
425
+ </xsl:choose>
426
+ <xsl:text>"],</xsl:text>
427
+ </xsl:when>
428
+ <xsl:when test="not(empty($titleDate))">
429
+ <xsl:text>"dct_temporal_sm": ["</xsl:text>
430
+ <xsl:value-of select="$titleDate"/>
431
+ <xsl:text>"],</xsl:text>
432
+ </xsl:when>
433
+ <xsl:when
434
+ test="count(/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification//gmd:temporalElement//gml:timePosition) &gt; 1">
435
+ <xsl:text>"dct_temporal_sm": ["</xsl:text>
436
+ <xsl:for-each
437
+ select="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification//gmd:temporalElement//gml:timePosition">
438
+ <xsl:choose>
439
+ <xsl:when test="month-from-dateTime(.) = 1 and day-from-dateTime(.) = 1">
440
+ <xsl:value-of select="year-from-dateTime(.)"/>
441
+ </xsl:when>
442
+ <xsl:otherwise>
443
+ <xsl:value-of select="format-dateTime(., '[Y0001]-[M01]-[D01]')"/>
444
+ </xsl:otherwise>
445
+ </xsl:choose>
446
+ <xsl:choose>
447
+ <xsl:when test="position() != last() - 1 and position() != last()">
448
+ <xsl:text>, </xsl:text>
449
+ </xsl:when>
450
+ <xsl:when test="position() = last() - 1">
451
+ <xsl:text> and </xsl:text>
452
+ </xsl:when>
453
+ </xsl:choose>
454
+ </xsl:for-each>
455
+ <xsl:text>"],</xsl:text>
456
+ </xsl:when>
457
+ </xsl:choose>
458
+ <!-- 14. Date Issued. Optional. Not Repeatable -->
459
+ <xsl:if test="$dateIssued != ''">
460
+ <xsl:text>"dct_issued_s": "</xsl:text>
461
+ <xsl:value-of select="$dateIssued"/>
462
+ <xsl:text>",</xsl:text>
463
+ </xsl:if>
464
+ <!-- 15. Index Year. Recommended. Repeatable -->
465
+ <xsl:choose>
466
+ <xsl:when test="$beginDate != '' and $endDate != ''">
467
+ <xsl:text>"gbl_indexYear_im": [</xsl:text>
468
+ <xsl:choose>
469
+ <xsl:when test="$endDate = '?'">
470
+ <xsl:value-of select="year-from-dateTime($beginDate)"/>
471
+ <xsl:text>],</xsl:text>
472
+ </xsl:when>
473
+ <xsl:otherwise>
474
+ <xsl:for-each select="year-from-dateTime($beginDate) to year-from-dateTime($endDate)">
475
+ <xsl:value-of select="position() - 1 + year-from-dateTime($beginDate)"/>
476
+ <xsl:if test="position() != last()">
477
+ <xsl:text>,</xsl:text>
478
+ </xsl:if>
479
+ </xsl:for-each>
480
+ <xsl:text>],</xsl:text>
481
+ </xsl:otherwise>
482
+ </xsl:choose>
483
+ </xsl:when>
484
+ <xsl:when
485
+ test="count(/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent) &gt; 1">
486
+ <xsl:text>"gbl_indexYear_im": [</xsl:text>
487
+ <xsl:for-each
488
+ select="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification//gmd:temporalElement//gml:timePosition">
489
+ <xsl:value-of select="year-from-dateTime(.)"/>
490
+ <xsl:if test="position() != last()">
491
+ <xsl:text>,</xsl:text>
492
+ </xsl:if>
493
+ </xsl:for-each>
494
+ <xsl:text>],</xsl:text>
495
+ </xsl:when>
496
+ <xsl:when test="$temporalInstance != ''">
497
+ <xsl:text>"gbl_indexYear_im": [</xsl:text>
498
+ <xsl:value-of select="year-from-dateTime($temporalInstance)"/>
499
+ <xsl:text>],</xsl:text>
500
+ </xsl:when>
501
+ <xsl:when test="$titleDate != ''">
502
+ <xsl:text>"gbl_indexYear_im": [</xsl:text>
503
+ <xsl:value-of select="$titleDate"/>
504
+ <xsl:text>],</xsl:text>
505
+ </xsl:when>
506
+ <xsl:when test="$dateIssued != ''">
507
+ <xsl:text>"gbl_indexYear_im": [</xsl:text>
508
+ <xsl:value-of select="year-from-dateTime($dateIssued)"/>
509
+ <xsl:text>],</xsl:text>
510
+ </xsl:when>
511
+ </xsl:choose>
512
+ <!-- 16. Date Range. Optional. Repeatable -->
513
+ <xsl:choose>
514
+ <xsl:when test="$beginDate != '' and $endDate != '' and $endDate != '?'">
515
+ <xsl:text>"gbl_dateRange_drsim" : "[</xsl:text>
516
+ <xsl:value-of select="year-from-dateTime($beginDate)"/>
517
+ <xsl:text> TO </xsl:text>
518
+ <xsl:value-of select="year-from-dateTime($endDate)"/>
519
+ <xsl:text>]",</xsl:text>
520
+ </xsl:when>
521
+ <xsl:when
522
+ test="count(/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent) &gt; 1">
523
+ <xsl:text>"gbl_dateRange_drsim" : "[</xsl:text>
524
+ <xsl:for-each
525
+ select="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification//gmd:temporalElement//gml:timePosition">
526
+ <xsl:choose>
527
+ <xsl:when test="position() = 1">
528
+ <xsl:value-of select="year-from-dateTime(.)"/>
529
+ <xsl:text> TO </xsl:text>
530
+ </xsl:when>
531
+ <xsl:when test="position() = last()">
532
+ <xsl:value-of select="year-from-dateTime(.)"/>
533
+ <xsl:text>]",</xsl:text>
534
+ </xsl:when>
535
+ </xsl:choose>
536
+ </xsl:for-each>
537
+ </xsl:when>
538
+ </xsl:choose>
539
+ <!-- 17. Spatial Coverage. Recommended. Repeatable -->
540
+ <xsl:if
541
+ test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode[@codeListValue = 'place']">
542
+ <xsl:text>"dct_spatial_sm": [</xsl:text>
543
+ <xsl:for-each
544
+ select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords[gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode[@codeListValue = 'place']]">
545
+ <xsl:for-each select="gmd:MD_Keywords/gmd:keyword">
546
+ <xsl:text>"</xsl:text>
547
+ <xsl:value-of select="gco:CharacterString"/>
548
+ <xsl:text>"</xsl:text>
549
+ <xsl:if test="position() != last()">
550
+ <xsl:text>,</xsl:text>
551
+ </xsl:if>
552
+ </xsl:for-each>
553
+ <xsl:if test="position() != last()">
554
+ <xsl:text>,</xsl:text>
555
+ </xsl:if>
556
+ </xsl:for-each>
557
+ <xsl:text>],</xsl:text>
558
+ </xsl:if>
559
+ <!-- 18. Geometry. Recommended. Not Repeatable -->
560
+ <xsl:choose>
561
+ <xsl:when
562
+ test="count(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox) = 1">
563
+ <xsl:text>"locn_geometry": "ENVELOPE(</xsl:text>
564
+ <xsl:value-of
565
+ select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:eastBoundLongitude/gco:Decimal"/>
566
+ <xsl:text>, </xsl:text>
567
+ <xsl:value-of
568
+ select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:westBoundLongitude/gco:Decimal"/>
569
+ <xsl:text>, </xsl:text>
570
+ <xsl:value-of
571
+ select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:northBoundLatitude/gco:Decimal"/>
572
+ <xsl:text>, </xsl:text>
573
+ <xsl:value-of
574
+ select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:southBoundLatitude/gco:Decimal"/>
575
+ <xsl:text>)",</xsl:text>
576
+ </xsl:when>
577
+ <xsl:when
578
+ test="count(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox) &gt; 1">
579
+ <xsl:text>"locn_geometry": "MULTIPOLYGON(</xsl:text>
580
+ <xsl:for-each
581
+ select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox">
582
+ <xsl:variable name="e" select="gmd:eastBoundLongitude/gco:Decimal"/>
583
+ <xsl:variable name="w" select="gmd:westBoundLongitude/gco:Decimal"/>
584
+ <xsl:variable name="n" select="gmd:northBoundLatitude/gco:Decimal"/>
585
+ <xsl:variable name="s" select="gmd:southBoundLatitude/gco:Decimal"/>
586
+ <xsl:text>((</xsl:text>
587
+ <xsl:value-of select="$w"/>
588
+ <xsl:text> </xsl:text>
589
+ <xsl:value-of select="$n"/>
590
+ <xsl:text>, </xsl:text>
591
+ <xsl:value-of select="$e"/>
592
+ <xsl:text> </xsl:text>
593
+ <xsl:value-of select="$n"/>
594
+ <xsl:text>, </xsl:text>
595
+ <xsl:value-of select="$e"/>
596
+ <xsl:text> </xsl:text>
597
+ <xsl:value-of select="$s"/>
598
+ <xsl:text>, </xsl:text>
599
+ <xsl:value-of select="$w"/>
600
+ <xsl:text> </xsl:text>
601
+ <xsl:value-of select="$s"/>
602
+ <xsl:text>))</xsl:text>
603
+ <xsl:if test="position() != last()">
604
+ <xsl:text>,</xsl:text>
605
+ </xsl:if>
606
+ </xsl:for-each>
607
+ <xsl:text>)",</xsl:text>
608
+ </xsl:when>
609
+ </xsl:choose>
610
+
611
+ <!-- 19. Bounding Box. Recommended. Not Repeatable -->
612
+ <xsl:if
613
+ test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox">
614
+ <xsl:text>"dcat_bbox": "ENVELOPE(</xsl:text>
615
+ <xsl:value-of
616
+ select="min(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:westBoundLongitude/gco:Decimal)"/>
617
+ <xsl:text>, </xsl:text>
618
+ <xsl:value-of
619
+ select="max(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:eastBoundLongitude/gco:Decimal)"/>
620
+ <xsl:text>, </xsl:text>
621
+ <xsl:value-of
622
+ select="max(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:northBoundLatitude/gco:Decimal)"/>
623
+ <xsl:text>, </xsl:text>
624
+ <xsl:value-of
625
+ select="min(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:southBoundLatitude/gco:Decimal)"/>
626
+ <xsl:text>)",</xsl:text>
627
+ </xsl:if>
628
+ <!-- 20. Centroid. Optional. Not Repeatable -->
629
+ <!-- 21. Relation. Optional. Repeatable -->
630
+ <!-- 22. Member Of. Optional. Repeatable -->
631
+
632
+ <xsl:if test="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo/gmd:MD_AggregateInformation/associationType/DS_AssociationTypeCode = 'largerWorkCitation'">
633
+ <xsl:text>"pcdm_memberOf_sm": [</xsl:text>
634
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo/gmd:MD_AggregateInformation/gmd:aggregateDataSetName/gmd:CI_Citation/gmd:title/gco:CharacterString">
635
+ <xsl:text>"</xsl:text>
636
+ <xsl:value-of select="."/>
637
+ <xsl:text>"</xsl:text>
638
+ <xsl:if test="position() != last()">
639
+ <xsl:text>,</xsl:text>
640
+ </xsl:if>
641
+ </xsl:for-each>
642
+ <xsl:text>]</xsl:text>
643
+ <xsl:text>,</xsl:text>
644
+ </xsl:if>
645
+
646
+
647
+ <!-- 23. Is Part Of. Optional. Repeatable -->
648
+ <!-- 24. Source. Optional. Repeatable -->
649
+ <!-- 25. Is Version Of. Optional. Repeatable -->
650
+ <!-- 26. Replaces. Optional. Repeatable -->
651
+ <!-- 27. Is Replaced By. Optional. Repeatable -->
652
+ <!-- 28. Rights. Recommended. Not Repeatable. -->
653
+ <xsl:if
654
+ test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:otherConstraints/gco:CharacterString">
655
+ <xsl:text>"dct_rights_sm": ["</xsl:text>
656
+ <xsl:value-of select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:otherConstraints/gco:CharacterString"/>
657
+ <xsl:text>"],</xsl:text>
658
+ </xsl:if>
659
+ <!-- 29. Rights Holder. Optional. Repeatable -->
660
+ <!-- 30. License. Optional. Repeatable -->
661
+ <!-- 31. Access Rights. Required. Not Repeatable -->
662
+ <xsl:text>"dct_accessRights_s": </xsl:text>
663
+ <xsl:choose>
664
+ <xsl:when
665
+ test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:accessConstraints/gmd:MD_RestrictionCode[@codeListValue = 'restricted']">
666
+ <xsl:text>"Restricted",</xsl:text>
667
+ </xsl:when>
668
+ <xsl:otherwise>
669
+ <xsl:text>"Public",</xsl:text>
670
+ </xsl:otherwise>
671
+ </xsl:choose>
672
+ <!-- 32. Format. Conditional. Not Repeatable. -->
673
+ <xsl:text>"dct_format_s": "</xsl:text>
674
+ <xsl:choose>
675
+ <xsl:when test="gmd:MD_Metadata/gmd:distributionInfo/gmd:MD_Distribution/gmd:distributionFormat/gmd:MD_Format/gmd:name/gco:CharacterString='dBASE Table'">
676
+ <xsl:text>Tabular Data</xsl:text>
677
+ </xsl:when>
678
+ <xsl:otherwise>
679
+ <xsl:value-of select="gmd:MD_Metadata/gmd:distributionInfo/gmd:MD_Distribution/gmd:distributionFormat/gmd:MD_Format/gmd:name/gco:CharacterString"/>
680
+ </xsl:otherwise>
681
+ </xsl:choose>
682
+ <xsl:text>",</xsl:text>
683
+ <!-- 33. File Size. Optional. Not Repeatable. -->
684
+ <!-- 34. WxS Identifier. Conditional. Not Repeatable. -->
685
+ <xsl:text>"gbl_wxsIdentifier_s": "druid:</xsl:text>
686
+ <xsl:value-of select="$identifier"/>
687
+ <xsl:text>",</xsl:text>
688
+ <!-- 35. References. Recommended. Not Repetable.This one is hard to map - may need to be done on an institutional basis.-->
689
+
690
+ <!-- 36. ID. Required. Not repeatable -->
691
+ <xsl:text>"id": "</xsl:text>
692
+ <xsl:value-of select="$druid"/>
693
+ <xsl:text>",</xsl:text>
694
+ <!-- 37. Identifier. Recommended. Repeatable.-->
695
+ <xsl:if test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code/gco:CharacterString">
696
+ <xsl:text>"dct_identifier_sm": ["</xsl:text>
697
+ <xsl:value-of select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code/gco:CharacterString"/>
698
+ <xsl:text>"],</xsl:text>
699
+ </xsl:if>
700
+ <!-- 38. Modified. Required. Not Repeatable. This is when the METADATA is modified, not the resource. -->
701
+ <xsl:text>"gbl_mdModified_dt": "</xsl:text>
702
+ <xsl:value-of
703
+ select="adjust-dateTime-to-timezone(current-dateTime(), xs:dayTimeDuration('PT0H'))"/>
704
+ <xsl:text>",</xsl:text>
705
+ <!-- 39. Metadata Version. Required. Not Repeatable -->
706
+ <xsl:text>"gbl_mdVersion_s": "Aardvark",</xsl:text>
707
+
708
+ <!-- 41. Georeferenced. Optional. Not Repeatable. ]].-->
709
+
710
+ <!-- collection -->
711
+ <xsl:choose>
712
+ <xsl:when test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo/gmd:MD_AggregateInformation/gmd:associationType/gmd:DS_AssociationTypeCode[@codeListValue='largerWorkCitation']">
713
+ <xsl:text>"pcdm_memberOf_sm" : [</xsl:text>
714
+ <xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo/gmd:MD_AggregateInformation/gmd:associationType/gmd:DS_AssociationTypeCode[@codeListValue='largerWorkCitation']">
715
+ <xsl:text>"</xsl:text>
716
+ <xsl:value-of select="ancestor-or-self::*/gmd:aggregateDataSetName/gmd:CI_Citation/gmd:title/gco:CharacterString"/>
717
+ <xsl:text>"</xsl:text>
718
+ </xsl:for-each>
719
+ <xsl:text>],</xsl:text>
720
+ </xsl:when>
721
+ <xsl:when test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:collectiveTitle">
722
+ <xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:collectiveTitle">
723
+ <xsl:text>"pcdm_memberOf_sm" : [</xsl:text>
724
+ <xsl:text>"</xsl:text>
725
+ <xsl:value-of select="."/>
726
+ <xsl:text>"</xsl:text>
727
+ </xsl:for-each>
728
+ <xsl:text>],</xsl:text>
729
+ </xsl:when>
730
+ </xsl:choose>
731
+
732
+ <!-- 40. Suppressed. Optional. Not Repeatable -->
733
+ <xsl:text>"gbl_suppressed_b": false}</xsl:text>
734
+
735
+ </xsl:template>
736
+
737
+
738
+ </xsl:stylesheet>