geo_combine 0.0.5 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,5 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
1
  <!--
3
- iso2geoBl.xsl - Transformation from ISO 19139 XML into GeoBlacklight solr
2
+ iso2geoBl.xsl - Transformation from ISO 19139 XML into GeoBlacklight solr json
4
3
 
5
4
  -->
6
5
  <xsl:stylesheet
@@ -11,16 +10,10 @@
11
10
  xmlns:gml="http://www.opengis.net/gml"
12
11
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
13
12
  version="1.0" exclude-result-prefixes="gml gmd gco gmi xsl">
14
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
13
+ <xsl:output method="text" version="1.0" omit-xml-declaration="yes" indent="no" media-type="application/json"/>
15
14
  <xsl:strip-space elements="*"/>
16
- <xsl:param name="geometryType"/>
17
- <xsl:param name="purl"/>
18
15
  <xsl:param name="zipName" select="'data.zip'"/>
19
-
20
-
21
16
 
22
-
23
-
24
17
  <xsl:template match="/">
25
18
  <!-- institution -->
26
19
  <xsl:variable name="institution">
@@ -102,25 +95,12 @@
102
95
  </xsl:otherwise>
103
96
  </xsl:choose>
104
97
  </xsl:variable>
105
- <add>
106
- <doc>
107
- <field name="uuid">
108
- <xsl:value-of select="$uuid"/>
109
- </field>
110
-
111
- <field name="dc_identifier_s">
112
- <xsl:value-of select="$uuid"/>
113
- </field>
114
-
115
- <field name="dc_title_s">
116
- <xsl:value-of select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title"/>
117
- </field>
118
-
119
- <field name="dc_description_s">
120
- <xsl:value-of select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract"/>
121
- </field>
122
-
123
- <field name="dc_rights_s">
98
+ <xsl:text>{</xsl:text>
99
+ <xsl:text>"uuid": "</xsl:text><xsl:value-of select="$uuid"/><xsl:text>",</xsl:text>
100
+ <xsl:text>"dc_identifier_s": "</xsl:text><xsl:value-of select="$uuid"/><xsl:text>",</xsl:text>
101
+ <xsl:text>"dc_title_s": "</xsl:text><xsl:value-of select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title"/><xsl:text>",</xsl:text>
102
+ <xsl:text>"dc_description_s": "</xsl:text><xsl:value-of select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract"/><xsl:text>",</xsl:text>
103
+ <xsl:text>"dc_rights_s": "</xsl:text>
124
104
  <xsl:choose>
125
105
  <xsl:when test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:accessConstraints/gmd:MD_RestrictionCode[@codeListValue='restricted']">
126
106
  <xsl:text>Restricted</xsl:text>
@@ -150,272 +130,192 @@
150
130
  <xsl:otherwise>
151
131
  <xsl:text>Public</xsl:text>
152
132
  </xsl:otherwise>
153
- </xsl:choose>
154
- </field>
155
-
156
- <field name="dct_provenance_s">
157
- <xsl:value-of select="$institution"/>
158
- </field>
159
-
160
- <field name="dct_references_s">
161
- <xsl:text>{</xsl:text>
162
- <xsl:text>"http://schema.org/url":"</xsl:text>
163
- <xsl:value-of select="$uuid"/>
164
- <xsl:text>",</xsl:text>
165
- <!--<xsl:text>"http://schema.org/thumbnailUrl":"</xsl:text>
166
- <xsl:value-of select="$stacks_root"/>
167
- <xsl:text>/file/druid:</xsl:text>
168
- <xsl:value-of select="$identifier"/>
169
- <xsl:text>/preview.jpg",</xsl:text>
170
- <xsl:text>"http://schema.org/DownloadAction":"</xsl:text>
171
- <xsl:value-of select="$stacks_root"/>
172
- <xsl:text>/file/druid:</xsl:text>
173
- <xsl:value-of select="$identifier"/>
174
- <xsl:text>/data.zip",</xsl:text>
175
- <xsl:text>"http://www.loc.gov/mods/v3":"</xsl:text>
176
- <xsl:text>http://earthworks.stanford.edu/opengeometadata/layers/edu.stanford.purl/</xsl:text>
177
- <xsl:value-of select="$identifier"/>
178
- <xsl:text>/mods",</xsl:text>
179
- <xsl:text>"http://www.isotc211.org/schemas/2005/gmd/":"</xsl:text>
180
- <xsl:text>http://earthworks.stanford.edu/opengeometadata/layers/edu.stanford.purl/</xsl:text>
181
- <xsl:value-of select="$identifier"/>
182
- <xsl:text>/iso19139",</xsl:text>
183
- <xsl:text>"http://www.opengis.net/def/serviceType/ogc/wms":"</xsl:text>
184
- <xsl:value-of select="$geoserver_root"/>
185
- <xsl:text>/wms",</xsl:text>
186
- <xsl:text>"http://www.opengis.net/def/serviceType/ogc/wfs":"</xsl:text>
187
- <xsl:value-of select="$geoserver_root"/>
188
- <xsl:text>/wfs",</xsl:text>
189
- <xsl:text>"http://www.opengis.net/def/serviceType/ogc/wcs":"</xsl:text>
190
- <xsl:value-of select="$geoserver_root"/>
191
- <xsl:text>/wcs"</xsl:text> -->
192
- <xsl:text>}</xsl:text>
193
- </field>
194
-
195
- <field name="layer_id_s">
196
- <xsl:choose>
197
- <xsl:when test="$institution = 'Stanford'">
198
- <xsl:text>druid:</xsl:text>
199
- <xsl:value-of select="$identifier"/>
200
- </xsl:when>
201
- <xsl:otherwise>
202
- <xsl:text>urn:</xsl:text>
203
- <xsl:value-of select="$identifier"/>
204
- </xsl:otherwise>
205
- </xsl:choose>
206
- </field>
207
-
208
- <field name="layer_slug_s">
209
- <xsl:value-of select="$institution"/>
210
- <xsl:text>-</xsl:text>
211
- <xsl:value-of select="$identifier"/>
212
- </field>
213
-
214
- <field name="layer_geom_type_s">
215
- <xsl:value-of select="$geometryType"/>
216
- </field>
217
-
133
+ </xsl:choose><xsl:text>",</xsl:text>
134
+ <xsl:text>"dct_provenance_s": "</xsl:text><xsl:value-of select="$institution"/>",
135
+
136
+ <xsl:text>"layer_id_s": "</xsl:text>
137
+ <xsl:choose>
138
+ <xsl:when test="$institution = 'Stanford'">
139
+ <xsl:text>druid:</xsl:text>
140
+ <xsl:value-of select="$identifier"/>
141
+ </xsl:when>
142
+ <xsl:otherwise>
143
+ <xsl:text>urn:</xsl:text>
144
+ <xsl:value-of select="$identifier"/>
145
+ </xsl:otherwise>
146
+ </xsl:choose>
147
+ <xsl:text>",</xsl:text>
148
+ <xsl:text>"layer_slug_s": "</xsl:text>
149
+ <xsl:value-of select="$institution"/>
150
+ <xsl:text>-</xsl:text>
151
+ <xsl:value-of select="$identifier"/>
152
+ <xsl:text>",</xsl:text>
218
153
  <xsl:choose>
219
154
  <xsl:when test="contains(gmd:MD_Metadata/gmd:dateStamp, 'T')">
220
- <field name="layer_modified_dt">
155
+ <xsl:text>"layer_modified_dt": "</xsl:text>
221
156
  <xsl:value-of select="substring-before(gmd:MD_Metadata/gmd:dateStamp, 'T')"/>
222
- </field>
157
+ <xsl:text>",</xsl:text>
223
158
  </xsl:when>
224
159
  <xsl:when test="gmd:MD_Metadata/gmd:dateStamp">
225
- <field name="layer_modified_dt">
160
+ <xsl:text>"layer_modified_dt": "</xsl:text>
226
161
  <xsl:value-of select="gmd:MD_Metadata/gmd:dateStamp"/>
227
- </field>
162
+ <xsl:text>",</xsl:text>
228
163
  </xsl:when>
229
164
  </xsl:choose>
230
165
 
231
- <xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty">
232
- <xsl:choose>
233
- <xsl:when test="gmd:role/gmd:CI_RoleCode[@codeListValue='originator']">
234
- <xsl:for-each select="gmd:organisationName">
235
- <field name="dc_creator_sm">
236
- <xsl:value-of select="."/>
237
- </field>
238
- </xsl:for-each>
239
- <xsl:for-each select="gmd:individualName">
240
- <field name="dc_creator_sm">
241
- <xsl:value-of select="."/>
242
- </field>
243
- </xsl:for-each>
244
- </xsl:when>
245
-
246
- <xsl:when test="gmd:role/gmd:CI_RoleCode[@codeListValue='publisher']">
247
- <xsl:for-each select="gmd:organisationName">
248
- <field name="dc_publisher_sm">
249
- <xsl:value-of select="."/>
250
- </field>
251
- </xsl:for-each>
252
- <xsl:for-each select="gmd:individualName">
253
- <field name="dc_creator_sm">
254
- <xsl:value-of select="."/>
255
- </field>
256
- </xsl:for-each>
257
- </xsl:when>
258
- </xsl:choose>
259
- </xsl:for-each>
166
+
167
+ <xsl:if 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']">
168
+ <xsl:text>"dc_creator_sm": [</xsl:text>
169
+
170
+ <xsl:for-each 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']">
171
+ <xsl:if test="ancestor-or-self::*/gmd:organisationName">
172
+ <xsl:text>"</xsl:text>
173
+ <xsl:value-of select="ancestor-or-self::*/gmd:organisationName"/>
174
+ <xsl:text>"</xsl:text>
175
+ <xsl:if test="position() != last()">
176
+ <xsl:text>,</xsl:text>
177
+ </xsl:if>
178
+ </xsl:if>
260
179
 
261
- <field name="dc_format_s">
262
- <xsl:value-of select="$format"/>
263
- </field>
180
+ <xsl:if test="ancestor-or-self::*/gmd:individualName">
181
+ <xsl:text>"</xsl:text>
182
+ <xsl:value-of select="ancestor-or-self::*/gmd:individualName"/>
183
+ <xsl:text>"</xsl:text>
184
+ <xsl:if test="position() != last()">
185
+ <xsl:text>,</xsl:text>
186
+ </xsl:if>
187
+ </xsl:if>
188
+ </xsl:for-each>
189
+ <xsl:text>],</xsl:text>
190
+ </xsl:if>
191
+ <xsl:if 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']">
192
+ <xsl:text>"dc_publisher_sm": [</xsl:text>
193
+
194
+ <xsl:for-each 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']">
195
+ <xsl:if test="ancestor-or-self::*/gmd:organisationName">
196
+ <xsl:text>"</xsl:text>
197
+ <xsl:value-of select="ancestor-or-self::*/gmd:organisationName"/>
198
+ <xsl:text>"</xsl:text>
199
+ <xsl:if test="position() != last()">
200
+ <xsl:text>,</xsl:text>
201
+ </xsl:if>
202
+ </xsl:if>
203
+
204
+ <xsl:if test="ancestor-or-self::*/gmd:individualName">
205
+ <xsl:text>"</xsl:text>
206
+ <xsl:value-of select="ancestor-or-self::*/gmd:individualName"/>
207
+ <xsl:text>"</xsl:text>
208
+ <xsl:if test="position() != last()">
209
+ <xsl:text>,</xsl:text>
210
+ </xsl:if>
211
+ </xsl:if>
212
+ </xsl:for-each>
213
+ <xsl:text>],</xsl:text>
214
+ </xsl:if>
215
+
216
+ <xsl:text>"dc_format_s": "</xsl:text><xsl:value-of select="$format"/><xsl:text>",</xsl:text>
264
217
 
265
218
  <!-- TODO: add inputs for other languages -->
266
- <field name="dc_language_s">
219
+ <!-- <field name="dc_language_s">
267
220
  <xsl:if test="contains(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:language | gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:language/gmd:LanguageCode, 'eng')">
268
221
  <xsl:text>English</xsl:text>
269
222
  </xsl:if>
270
- </field>
223
+ </field> -->
271
224
 
272
225
  <!-- from DCMI type vocabulary -->
273
226
  <xsl:choose>
274
227
  <xsl:when test="contains(gmd:MD_Metadata/gmd:hierarchyLevelName/gco:CharacterString, 'dataset')">
275
- <field name="dc_type_s">
276
- <xsl:text>Dataset</xsl:text>
277
- </field>
228
+ <xsl:text>"dc_type_s": "Dataset",</xsl:text>
278
229
  </xsl:when>
279
230
 
280
231
  <xsl:when test="contains(gmd:MD_Metadata/gmd:hierarchyLevelName/gco:CharacterString, 'service')">
281
- <field name="dc_type_s">
282
- <xsl:text>Service</xsl:text>
283
- </field>
232
+ <xsl:text>"dc_type_s": "Service",</xsl:text>
284
233
  </xsl:when>
285
234
  </xsl:choose>
286
235
 
287
- <!-- translate ISO topic categories -->
288
- <xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory/gmd:MD_TopicCategoryCode">
289
- <field name="dc_subject_sm">
290
- <xsl:choose>
291
- <xsl:when test="contains(.,'farming')">
292
- <xsl:text>Farming</xsl:text>
293
- </xsl:when>
294
- <xsl:when test="contains(.,'biota')">
295
- <xsl:text>Biology and Ecology</xsl:text>
296
- </xsl:when>
297
- <xsl:when test="contains(.,'climatologyMeteorologyAtmosphere')">
298
- <xsl:text>Climatology, Meteorology and Atmosphere</xsl:text>
299
- </xsl:when>
300
- <xsl:when test="contains(.,'boundaries')">
301
- <xsl:text>Boundaries</xsl:text>
302
- </xsl:when>
303
- <xsl:when test="contains(.,'elevation')">
304
- <xsl:text>Elevation</xsl:text>
305
- </xsl:when>
306
- <xsl:when test="contains(.,'environment')">
307
- <xsl:text>Environment</xsl:text>
308
- </xsl:when>
309
- <xsl:when test="contains(.,'geoscientificInformation')">
310
- <xsl:text>Geoscientific Information</xsl:text>
311
- </xsl:when>
312
- <xsl:when test="contains(.,'health')">
313
- <xsl:text>Health</xsl:text>
314
- </xsl:when>
315
- <xsl:when test="contains(.,'imageryBaseMapsEarthCover')">
316
- <xsl:text>Imagery and Base Maps</xsl:text>
317
- </xsl:when>
318
- <xsl:when test="contains(.,'intelligenceMilitary')">
319
- <xsl:text>Military</xsl:text>
320
- </xsl:when>
321
- <xsl:when test="contains(.,'inlandWaters')">
322
- <xsl:text>Inland Waters</xsl:text>
323
- </xsl:when>
324
- <xsl:when test="contains(.,'location')">
325
- <xsl:text>Location</xsl:text>
326
- </xsl:when>
327
- <xsl:when test="contains(.,'oceans')">
328
- <xsl:text>Oceans</xsl:text>
329
- </xsl:when>
330
- <xsl:when test="contains(.,'planningCadastre')">
331
- <xsl:text>Planning and Cadastral</xsl:text>
332
- </xsl:when>
333
- <xsl:when test="contains(.,'structure')">
334
- <xsl:text>Structure</xsl:text>
335
- </xsl:when>
336
- <xsl:when test="contains(.,'transportation')">
337
- <xsl:text>Transportation</xsl:text>
338
- </xsl:when>
339
- <xsl:when test="contains(.,'utilitiesCommunication')">
340
- <xsl:text>Utilities and Communication</xsl:text>
341
- </xsl:when>
342
- <xsl:when test="contains(.,'society')">
343
- <xsl:text>Society</xsl:text>
344
- </xsl:when>
345
- <xsl:when test="contains(.,'economy')">
346
- <xsl:text>Economy</xsl:text>
347
- </xsl:when>
348
- <xsl:otherwise>
349
- <xsl:value-of select="."/>
350
- </xsl:otherwise>
351
- </xsl:choose>
352
- </field>
353
- </xsl:for-each>
354
-
355
- <xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords">
356
- <xsl:choose>
357
- <xsl:when test="gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='theme']">
358
- <xsl:for-each select="gmd:keyword">
359
- <field name="dc_subject_sm">
360
- <xsl:value-of select="."/>
361
- </field>
362
- </xsl:for-each>
363
- </xsl:when>
364
-
365
- <xsl:when test="gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='place']">
366
- <xsl:for-each select="gmd:keyword">
367
- <field name="dc_spatial_sm">
368
- <xsl:value-of select="."/>
369
- </field>
370
- </xsl:for-each>
371
- </xsl:when>
372
- </xsl:choose>
236
+ <xsl:if test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory/gmd:MD_TopicCategoryCode">
237
+ <xsl:text>"dc_subject_sm": [</xsl:text>
238
+ <xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory/gmd:MD_TopicCategoryCode">
239
+ <xsl:text>"</xsl:text>
240
+ <xsl:value-of select="."/>
241
+ <xsl:text>"</xsl:text>
242
+ <xsl:text>,</xsl:text>
243
+ </xsl:for-each>
244
+
245
+ <xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords">
246
+ <xsl:if test="gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='theme']">
247
+ <xsl:for-each select="gmd:keyword">
248
+ <xsl:text>"</xsl:text>
249
+ <xsl:value-of select="."/>
250
+ <xsl:text>"</xsl:text>
251
+ <xsl:if test="position() != last()">
252
+ <xsl:text>,</xsl:text>
253
+ </xsl:if>
254
+ </xsl:for-each>
255
+ </xsl:if>
256
+ </xsl:for-each>
257
+ <xsl:text>],</xsl:text>
258
+ </xsl:if>
259
+
260
+ <xsl:if test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='place']">
261
+ <xsl:text>"dc_spatial_sm": [</xsl:text>
262
+ <xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='place']">
263
+ <xsl:for-each select="ancestor-or-self::*/gmd:keyword">
264
+ <xsl:text>"</xsl:text>
265
+ <xsl:value-of select="."/>
266
+ <xsl:text>"</xsl:text>
267
+ <xsl:if test="position() != last()">
268
+ <xsl:text>,</xsl:text>
269
+ </xsl:if>
373
270
  </xsl:for-each>
374
-
375
- <xsl:choose>
271
+ </xsl:for-each>
272
+ <xsl:text>],</xsl:text>
273
+ </xsl:if>
274
+
275
+ <xsl:choose>
376
276
  <xsl:when test="contains(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date/gco:DateTime, 'T')">
377
- <field name="dct_issued_s">
277
+ <xsl:text>"dct_issued_s": "</xsl:text>
378
278
  <xsl:value-of select="substring-before(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date/gco:DateTime,'T')"/>
379
- </field>
279
+ <xsl:text>",</xsl:text>
380
280
  </xsl:when>
381
281
 
382
282
  <xsl:when test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date/gco:DateTime">
383
- <field name="dct_issued_s">
283
+ <xsl:text>"dct_issued_s": "</xsl:text>
384
284
  <xsl:value-of select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date/gco:DateTime"/>
385
- </field>
285
+ <xsl:text>",</xsl:text>
386
286
  </xsl:when>
387
287
 
388
288
  <xsl:when test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date/gco:Date">
389
- <field name="dct_issued_s">
289
+ <xsl:text>"dct_issued_s": "</xsl:text>
390
290
  <xsl:value-of select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date/gco:Date"/>
391
- </field>
291
+ <xsl:text>",</xsl:text>
392
292
  </xsl:when>
393
-
394
- <xsl:otherwise>unknown</xsl:otherwise>
293
+
294
+ <!-- <xsl:otherwise>unknown</xsl:otherwise> -->
395
295
  </xsl:choose>
396
296
 
397
297
 
398
298
  <!-- content date: range YYYY-YYYY if dates differ -->
399
299
  <xsl:choose>
400
300
  <xsl:when test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition/text() != ''">
401
- <field name="dct_temporal_sm">
402
- <xsl:value-of select="substring(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition, 1,4)"/>
403
- <xsl:if test="substring(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition, 1,4) != substring(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition,1,4)">
404
- <xsl:text>-</xsl:text>
405
- <xsl:value-of select="substring(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition, 1,4)"/>
406
- </xsl:if>
407
- </field>
301
+ <xsl:text>"dct_temporal_sm": "</xsl:text>
302
+ <xsl:value-of select="substring(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition, 1,4)"/>
303
+ <xsl:if test="substring(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition, 1,4) != substring(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition,1,4)">
304
+ <xsl:text>-</xsl:text>
305
+ <xsl:value-of select="substring(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition, 1,4)"/>
306
+ </xsl:if>
307
+ <xsl:text>",</xsl:text>
408
308
  </xsl:when>
409
309
 
410
310
  <xsl:when test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimeInstant">
411
- <field name="dct_temporal_sm">
412
- <xsl:value-of select="substring(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimeInstant, 1,4)"/>
413
- </field>
311
+ <xsl:text>"dct_temporal_sm": "</xsl:text>
312
+ <xsl:value-of select="substring(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimeInstant, 1,4)"/>
313
+ <xsl:text>",</xsl:text>
414
314
  </xsl:when>
415
315
  </xsl:choose>
416
316
 
417
317
  <!-- collection -->
418
- <xsl:choose>
318
+ <!-- <xsl:choose>
419
319
  <xsl:when test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo/gmd:MD_AggregateInformation/gmd:associationType/gmd:DS_AssociationTypeCode[@codeListValue='largerWorkCitation']">
420
320
  <xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo/gmd:MD_AggregateInformation/gmd:associationType/gmd:DS_AssociationTypeCode[@codeListValue='largerWorkCitation']">
421
321
  <field name="dct_isPartOf_sm">
@@ -430,16 +330,23 @@
430
330
  </field>
431
331
  </xsl:for-each>
432
332
  </xsl:when>
433
- </xsl:choose>
333
+ </xsl:choose> -->
434
334
 
435
335
  <!-- cross-references -->
436
- <xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo/gmd:MD_AggregateInformation/gmd:associationType/gmd:DS_AssociationTypeCode[@codeListValue='crossReference']">
437
- <field name="dc_relation_sm">
438
- <xsl:value-of select="ancestor-or-self::*/gmd:aggregateDataSetName/gmd:CI_Citation/gmd:title"/>
439
- </field>
440
- </xsl:for-each>
336
+ <xsl:if test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo/gmd:MD_AggregateInformation/gmd:associationType/gmd:DS_AssociationTypeCode[@codeListValue='crossReference']">
337
+ <xsl:text>"dc_relation_sm": [</xsl:text>
338
+ <xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo/gmd:MD_AggregateInformation/gmd:associationType/gmd:DS_AssociationTypeCode[@codeListValue='crossReference']">
339
+ <xsl:text>"</xsl:text>
340
+ <xsl:value-of select="ancestor-or-self::*/gmd:aggregateDataSetName/gmd:CI_Citation/gmd:title"/>
341
+ <xsl:text>"</xsl:text>
342
+ <xsl:if test="position() != last()">
343
+ <xsl:text>,</xsl:text>
344
+ </xsl:if>
345
+ </xsl:for-each>
346
+ </xsl:if>
441
347
 
442
- <field name="georss_polygon_s">
348
+ <!--<field name="georss_polygon_s">-->
349
+ <xsl:text>"georss_polygon_s": "</xsl:text>
443
350
  <xsl:text></xsl:text>
444
351
  <xsl:value-of select="$y1"/>
445
352
  <xsl:text> </xsl:text>
@@ -460,33 +367,19 @@
460
367
  <xsl:value-of select="$y1"/>
461
368
  <xsl:text> </xsl:text>
462
369
  <xsl:value-of select="$x1"/>
463
- </field>
370
+ <xsl:text>",</xsl:text>
464
371
 
465
- <field name="solr_geom">
466
- <xsl:text>ENVELOPE((</xsl:text>
467
- <xsl:value-of select="$x1"/>
468
- <xsl:text> </xsl:text>
469
- <xsl:value-of select="$y1"/>
470
- <xsl:text>, </xsl:text>
471
- <xsl:value-of select="$x2"/>
472
- <xsl:text> </xsl:text>
473
- <xsl:value-of select="$y1"/>
474
- <xsl:text>, </xsl:text>
475
- <xsl:value-of select="$x2"/>
476
- <xsl:text> </xsl:text>
477
- <xsl:value-of select="$y2"/>
478
- <xsl:text>, </xsl:text>
479
- <xsl:value-of select="$x1"/>
480
- <xsl:text> </xsl:text>
481
- <xsl:value-of select="$y2"/>
482
- <xsl:text>, </xsl:text>
483
- <xsl:value-of select="$x1"/>
484
- <xsl:text> </xsl:text>
485
- <xsl:value-of select="$y1"/>
486
- <xsl:text>))</xsl:text>
487
- </field>
372
+ <xsl:text>"solr_geom": "ENVELOPE(</xsl:text>
373
+ <xsl:value-of select="$x1"/>
374
+ <xsl:text>, </xsl:text>
375
+ <xsl:value-of select="$x2"/>
376
+ <xsl:text>, </xsl:text>
377
+ <xsl:value-of select="$y2"/>
378
+ <xsl:text>, </xsl:text>
379
+ <xsl:value-of select="$y1"/>
380
+ <xsl:text>)",</xsl:text>
488
381
 
489
- <field name="georss_box_s">
382
+ <xsl:text>"georss_box_s": "</xsl:text>
490
383
  <xsl:value-of select="$y1"/>
491
384
  <xsl:text> </xsl:text>
492
385
  <xsl:value-of select="$x1"/>
@@ -494,46 +387,20 @@
494
387
  <xsl:value-of select="$y2"/>
495
388
  <xsl:text> </xsl:text>
496
389
  <xsl:value-of select="$x2"/>
497
- </field>
498
-
499
-
500
- <field name="solr_bbox">
501
- <xsl:value-of select="$x1"/>
502
- <xsl:text> </xsl:text>
503
- <xsl:value-of select="$y1"/>
504
- <xsl:text> </xsl:text>
505
- <xsl:value-of select="$x2"/>
506
- <xsl:text> </xsl:text>
507
- <xsl:value-of select="$y2"/>
508
- </field>
509
-
510
- <field name="solr_sw_pt">
511
- <xsl:value-of select="$y1"/>
512
- <xsl:text>,</xsl:text>
513
- <xsl:value-of select="$x1"/>
514
- </field>
515
-
516
- <field name="solr_ne_pt">
517
- <xsl:value-of select="$y2"/>
518
- <xsl:text>,</xsl:text>
519
- <xsl:value-of select="$x2"/>
520
- </field>
390
+ <xsl:text>",</xsl:text>
521
391
 
522
392
  <!-- content date: singular, or beginning date of range: YYYY -->
523
393
  <xsl:choose>
524
394
  <xsl:when test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition/text() != ''">
525
- <field name="solr_year_i">
395
+ <xsl:text>"solr_year_i": </xsl:text>
526
396
  <xsl:value-of select="substring(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition, 1,4)"/>
527
- </field>
528
397
  </xsl:when>
529
398
  <xsl:when test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimeInstant">
530
- <field name="solr_year_i">
399
+ <xsl:text>"solr_year_i": </xsl:text>
531
400
  <xsl:value-of select="substring(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimeInstant, 1,4)"/>
532
- </field>
533
401
  </xsl:when>
534
402
  </xsl:choose>
535
- </doc>
536
- </add>
403
+ <xsl:text>}</xsl:text>
537
404
  </xsl:template>
538
405
 
539
406
  </xsl:stylesheet>