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.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/README.md +24 -4
- data/bin/geocombine +5 -0
- data/geo_combine.gemspec +4 -0
- data/lib/geo_combine/cli.rb +25 -0
- data/lib/geo_combine/esri_open_data.rb +97 -0
- data/lib/geo_combine/formats.rb +11 -0
- data/lib/geo_combine/formatting.rb +29 -0
- data/lib/geo_combine/geoblacklight.rb +79 -13
- data/lib/geo_combine/geometry_types.rb +11 -0
- data/lib/geo_combine/subjects.rb +29 -0
- data/lib/geo_combine/version.rb +1 -1
- data/lib/geo_combine.rb +21 -3
- data/lib/schema/geoblacklight-schema.json +169 -0
- data/lib/tasks/geo_combine.rake +16 -13
- data/lib/xslt/fgdc2geoBL.xsl +361 -418
- data/lib/xslt/fgdc2html.xsl +1917 -1025
- data/lib/xslt/iso2geoBL.xsl +173 -306
- data/lib/xslt/iso2html.xsl +1059 -1734
- data/spec/features/fgdc2html_spec.rb +42 -0
- data/spec/features/iso2html_spec.rb +50 -0
- data/spec/fixtures/docs/basic_geoblacklight.json +29 -0
- data/spec/fixtures/docs/esri_open_data.json +53 -0
- data/spec/fixtures/docs/full_geoblacklight.json +39 -0
- data/spec/fixtures/json_docs.rb +21 -0
- data/spec/fixtures/xml_docs.rb +0 -44
- data/spec/helpers.rb +4 -0
- data/spec/lib/geo_combine/esri_open_data_spec.rb +96 -0
- data/spec/lib/geo_combine/fgdc_spec.rb +77 -2
- data/spec/lib/geo_combine/formatting_spec.rb +22 -0
- data/spec/lib/geo_combine/geoblacklight_spec.rb +48 -5
- data/spec/lib/geo_combine/iso19139_spec.rb +14 -1
- data/spec/spec_helper.rb +3 -0
- metadata +85 -3
data/lib/xslt/iso2geoBL.xsl
CHANGED
@@ -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="
|
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
|
-
<
|
106
|
-
<
|
107
|
-
|
108
|
-
|
109
|
-
|
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
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
<xsl:
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
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
|
-
<
|
155
|
+
<xsl:text>"layer_modified_dt": "</xsl:text>
|
221
156
|
<xsl:value-of select="substring-before(gmd:MD_Metadata/gmd:dateStamp, 'T')"/>
|
222
|
-
|
157
|
+
<xsl:text>",</xsl:text>
|
223
158
|
</xsl:when>
|
224
159
|
<xsl:when test="gmd:MD_Metadata/gmd:dateStamp">
|
225
|
-
<
|
160
|
+
<xsl:text>"layer_modified_dt": "</xsl:text>
|
226
161
|
<xsl:value-of select="gmd:MD_Metadata/gmd:dateStamp"/>
|
227
|
-
|
162
|
+
<xsl:text>",</xsl:text>
|
228
163
|
</xsl:when>
|
229
164
|
</xsl:choose>
|
230
165
|
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
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
|
-
<
|
262
|
-
<xsl:
|
263
|
-
|
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
|
-
<
|
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
|
-
<
|
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
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
<xsl:
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
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
|
-
|
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
|
-
<
|
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
|
-
|
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
|
-
<
|
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
|
-
|
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
|
-
<
|
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
|
-
|
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
|
-
<
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
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
|
-
<
|
412
|
-
|
413
|
-
|
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:
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
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
|
-
|
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
|
-
|
370
|
+
<xsl:text>",</xsl:text>
|
464
371
|
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
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
|
-
<
|
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
|
-
|
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
|
-
<
|
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
|
-
<
|
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
|
-
</
|
536
|
-
</add>
|
403
|
+
<xsl:text>}</xsl:text>
|
537
404
|
</xsl:template>
|
538
405
|
|
539
406
|
</xsl:stylesheet>
|