dor-services 4.4.13 → 4.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,67 @@
1
+ # Copied from common-accessioning config/environments
2
+
3
+ cert_dir = File.join(File.dirname(__FILE__), ".", "certs")
4
+
5
+ Dor::Config.configure do
6
+ fedora do
7
+ url 'https://sul-dor-dev.stanford.edu/fedora'
8
+ end
9
+
10
+ ssl do
11
+ cert_file File.join(cert_dir,"robots-dor-dev.crt")
12
+ key_file File.join(cert_dir,"robots-dor-dev.key")
13
+ key_pass ''
14
+ end
15
+
16
+ suri do
17
+ mint_ids true
18
+ id_namespace 'druid'
19
+ url 'https://lyberservices-dev.stanford.edu'
20
+ user 'labware'
21
+ pass 'lyberteam'
22
+ end
23
+
24
+ metadata do
25
+ exist.url 'http://viewer:l3l%40nd@lyberapps-dev.stanford.edu/exist/rest/'
26
+ catalog.url 'http://lyberservices-prod.stanford.edu/catalog/mods'
27
+ end
28
+
29
+ stacks do
30
+ document_cache_storage_root '/home/lyberadmin/document_cache'
31
+ document_cache_host 'purl-dev.stanford.edu'
32
+ document_cache_user 'lyberadmin'
33
+ local_workspace_root '/dor/workspace'
34
+ storage_root '/stacks'
35
+ host 'stacks-dev.stanford.edu'
36
+ user 'lyberadmin'
37
+ local_stacks_root '/stacks'
38
+ local_document_cache_root '/purl/document_cache'
39
+ end
40
+
41
+ gsearch.url 'https://dor-dev.stanford.edu/solr/gsearch'
42
+ solrizer.url 'https://dor-dev.stanford.edu/solr'
43
+ workflow.url 'https://lyberservices-dev.stanford.edu/workflow/'
44
+ dor_services.url 'https://dorAdmin:dorAdmin@sul-lyberservices-dev.stanford.edu/dor/v1'
45
+
46
+ cleanup do
47
+ local_workspace_root '/dor/workspace'
48
+ local_export_home '/dor/export'
49
+ end
50
+
51
+ sdr do
52
+ local_workspace_root '/dor/workspace'
53
+ local_export_home '/dor/export'
54
+ datastreams do
55
+ contentMetadata 'required'
56
+ descMetadata 'required'
57
+ identityMetadata 'required'
58
+ provenanceMetadata 'required'
59
+ relationshipMetadata 'required'
60
+ rightsMetadata 'optional'
61
+ sourceMetadata 'optional'
62
+ end
63
+ end
64
+
65
+ accessioning_robot_sleep_time 30
66
+
67
+ end
data/lib/dor-services.rb CHANGED
@@ -90,6 +90,7 @@ module Dor
90
90
  autoload :DescMetadataDS, 'dor/datastreams/desc_metadata_ds'
91
91
  autoload :EmbargoMetadataDS, 'dor/datastreams/embargo_metadata_ds'
92
92
  autoload :EventsDS, 'dor/datastreams/events_ds'
93
+ autoload :GeoMetadataDS, 'dor/datastreams/geo_metadata_ds'
93
94
  autoload :IdentityMetadataDS, 'dor/datastreams/identity_metadata_ds'
94
95
  autoload :RoleMetadataDS, 'dor/datastreams/role_metadata_ds'
95
96
  autoload :WorkflowDefinitionDs, 'dor/datastreams/workflow_definition_ds'
@@ -115,6 +116,7 @@ module Dor
115
116
  autoload :Contentable, 'dor/models/contentable'
116
117
  autoload :Editable, 'dor/models/editable'
117
118
  autoload :Discoverable, 'dor/models/discoverable'
119
+ autoload :Geoable, 'dor/models/geoable'
118
120
 
119
121
 
120
122
  # ActiveFedora Classes
@@ -320,8 +320,8 @@ module Dor
320
320
  end
321
321
  end
322
322
  #Set the content type to and the resource types for all resources
323
- #@param type [String] the new content type, ex book
324
- #@param resource_type [String] the new type for all resources, ex book
323
+ #@param new_type [String] the new content type, ex book
324
+ #@param new_resource_type [String] the new type for all resources, ex book
325
325
  def set_content_type old_type, old_resource_type, new_type, new_resource_type
326
326
  xml=self.ng_xml
327
327
  xml.search('/contentMetadata[@type=\''+old_type+'\']').each do |node|
@@ -0,0 +1,842 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ geo2mods.xsl - Transformation from ISO 19139 XML into MODS v3
4
+
5
+
6
+ Copyright 2013, The Board of Trustees of the Leland Stanford Junior University
7
+
8
+ Licensed under the Apache License, Version 2.0 (the "License");
9
+ you may not use this file except in compliance with the License.
10
+ You may obtain a copy of the License at
11
+
12
+ http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+ Unless required by applicable law or agreed to in writing, software
15
+ distributed under the License is distributed on an "AS IS" BASIS,
16
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ See the License for the specific language governing permissions and
18
+ limitations under the License.
19
+
20
+
21
+ Created by Kim Durante and Darren Hardy, Stanford University Libraries
22
+
23
+ Requires parameters:
24
+ * geometryType: One of Point, LineString, Polygon, Curve, or Grid (Raster).
25
+ see
26
+ http://www.schemacentral.com/sc/niem21/t-gml32_GeometryPropertyType.html
27
+ * purl - e.g., http://purl.stanford.edu/aa111bb2222
28
+ * zipName - e.g., data.zip
29
+ * format - e.g., MIME type application/x-esri-shapefile
30
+
31
+ TODO:
32
+ * Series statements may need work?
33
+ -->
34
+ <xsl:stylesheet
35
+ xmlns="http://www.loc.gov/mods/v3"
36
+ xmlns:gco="http://www.isotc211.org/2005/gco"
37
+ xmlns:gmi="http://www.isotc211.org/2005/gmi"
38
+ xmlns:gmd="http://www.isotc211.org/2005/gmd"
39
+ xmlns:gml="http://www.opengis.net/gml"
40
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
41
+ version="1.0" exclude-result-prefixes="gml gmd gco gmi xsl">
42
+ <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
43
+ <xsl:strip-space elements="*"/>
44
+ <xsl:param name="format" select="'application/x-esri-shapefile'"/>
45
+ <xsl:param name="geometryType"/>
46
+ <xsl:param name="purl"/>
47
+ <xsl:param name="zipName" select="'data.zip'"/>
48
+ <!-- The coordinates value for MODS v3 is quite vague,
49
+ so we have a variety of formats:
50
+ GMD, WKT, WMS, GML, GeoRSS, MARC034, MARC255 (default)
51
+ -->
52
+ <xsl:param name="geoformat" select="'MARC255'"/>
53
+ <xsl:param name="fileIdentifier" select="''"/>
54
+ <xsl:template match="/">
55
+ <mods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/mods/v3" xmlns:xlink="http://www.w3.org/1999/xlink" version="3.4" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd">
56
+ <xsl:for-each select="/gmi:MI_Metadata|/gmd:MD_Metadata|//gmd:MD_Metadata">
57
+ <xsl:if test="gmd:fileIdentifier/gco:CharacterString/text()">
58
+ <xsl:variable name="fileIdentifier" select="."/>
59
+ </xsl:if>
60
+ <xsl:if test="gmd:dataSetURI/gco:CharacterString/text()">
61
+ <xsl:variable name="purl" select="."/>
62
+ </xsl:if>
63
+ <titleInfo>
64
+ <title>
65
+ <xsl:apply-templates select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title"/>
66
+ </title>
67
+ </titleInfo>
68
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:alternateTitle">
69
+ <titleInfo>
70
+ <title type="alternative">
71
+ <xsl:value-of select="."/>
72
+ </title>
73
+ </titleInfo>
74
+ </xsl:for-each>
75
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:alternateTitle">
76
+ <titleInfo>
77
+ <title displayLabel="Alternative title">
78
+ <xsl:value-of select="."/>
79
+ </title>
80
+ </titleInfo>
81
+ </xsl:for-each>
82
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue='originator']">
83
+ <xsl:choose>
84
+ <xsl:when test="ancestor-or-self::*/gmd:individualName">
85
+ <name type="personal">
86
+ <namePart>
87
+ <xsl:value-of select="ancestor-or-self::*/gmd:individualName"/>
88
+ </namePart>
89
+ <role>
90
+ <!-- personal author -->
91
+ <roleTerm type="text" authority="marcrelator">creator</roleTerm>
92
+ </role>
93
+ </name>
94
+ </xsl:when>
95
+ <xsl:when test="ancestor-or-self::*/gmd:organisationName">
96
+ <name type="corporate">
97
+ <namePart>
98
+ <xsl:value-of select="ancestor-or-self::*/gmd:organisationName"/>
99
+ </namePart>
100
+ <role>
101
+ <!-- corporate author -->
102
+ <roleTerm type="text" authority="marcrelator">creator</roleTerm>
103
+ </role>
104
+ </name>
105
+ </xsl:when>
106
+ </xsl:choose>
107
+ </xsl:for-each>
108
+
109
+ <!-- typeOfResource for SW - see http://www.loc.gov/standards/mods/v3/mods-userguide-elements.html -->
110
+ <typeOfResource>cartographic</typeOfResource>
111
+ <typeOfResource>software, multimedia</typeOfResource>
112
+ <genre>
113
+ <xsl:attribute name="authority">lcgft</xsl:attribute>
114
+ <xsl:attribute name="valueURI">http://id.loc.gov/authorities/genreForms/gf2011026297</xsl:attribute>
115
+ <xsl:text>Geospatial data</xsl:text>
116
+ </genre>
117
+ <genre>
118
+ <xsl:attribute name="authority">rdacontent</xsl:attribute>
119
+ <xsl:attribute name="valueURI">http://rdvocab.info/termList/RDAContentType/1001</xsl:attribute>
120
+ <xsl:text>cartographic dataset</xsl:text>
121
+ </genre>
122
+ <originInfo>
123
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue='publisher']">
124
+ <publisher>
125
+ <xsl:choose>
126
+ <xsl:when test="ancestor-or-self::*/gmd:organisationName">
127
+ <xsl:value-of select="ancestor-or-self::*/gmd:organisationName"/>
128
+ </xsl:when>
129
+ <xsl:when test="ancestor-or-self::*/gmd:individualName">
130
+ <xsl:value-of select="ancestor-or-self::*/gmd:individualName"/>
131
+ </xsl:when>
132
+ </xsl:choose>
133
+ </publisher>
134
+ <xsl:for-each select="ancestor-or-self::*/gmd:contactInfo">
135
+ <place>
136
+ <placeTerm type="text">
137
+ <xsl:value-of select="ancestor-or-self::*/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:city"/>
138
+ <xsl:if test="ancestor-or-self::*/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:city">, </xsl:if>
139
+ <xsl:value-of select="ancestor-or-self::*/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:administrativeArea"/>
140
+ <xsl:if test="ancestor-or-self::*/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:administrativeArea">, </xsl:if>
141
+ <xsl:value-of select="ancestor-or-self::*/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:country"/>
142
+ </placeTerm>
143
+ </place>
144
+ </xsl:for-each>
145
+ </xsl:for-each>
146
+ <dateIssued encoding="w3cdtf" keyDate="yes">
147
+ <!-- strip MM-DD, oupput YYYY -->
148
+ <xsl:choose>
149
+ <xsl:when test="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date">
150
+ <xsl:value-of select="substring(gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date,1,4)"/>
151
+ </xsl:when>
152
+ <xsl:otherwise>unknown</xsl:otherwise>
153
+ </xsl:choose>
154
+ </dateIssued>
155
+
156
+
157
+ <!-- kd: construct dateValid from Temporal_EX field?
158
+ <xsl:if test="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod">
159
+ <dateValid>
160
+ <xsl:attribute name="point">start</xsl:attribute>
161
+
162
+ <xsl:value-of select="substring-before(gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition, 'T')"/>
163
+ </dateValid>
164
+ <dateValid>
165
+ <xsl:attribute name="point">end</xsl:attribute>
166
+ <xsl:value-of select="substring-before(gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition, 'T')"/>
167
+ </dateValid>
168
+ </xsl:if> -->
169
+
170
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords">
171
+ <xsl:if test="gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='temporal']">
172
+ <xsl:for-each select="gmd:keyword">
173
+
174
+ <xsl:choose>
175
+
176
+ <!-- 4 digit year -->
177
+ <xsl:when test="string-length()=4">
178
+ <dateValid>
179
+ <xsl:attribute name="encoding">w3cdtf</xsl:attribute>
180
+ <xsl:value-of select="."/>
181
+ </dateValid>
182
+ </xsl:when>
183
+
184
+ <!-- range of dates in YYYY-YYYY format -->
185
+
186
+ <xsl:when test="contains(./*,'-')">
187
+ <dateValid>
188
+ <xsl:attribute name="encoding">w3cdtf</xsl:attribute>
189
+ <xsl:attribute name="point">start</xsl:attribute>
190
+ <xsl:value-of select="substring-before(*,'-')"/>
191
+ </dateValid>
192
+ <dateValid>
193
+ <xsl:attribute name="encoding">w3cdtf</xsl:attribute>
194
+ <xsl:attribute name="point">end</xsl:attribute>
195
+ <xsl:value-of select="substring-after(*,'-')"/>
196
+ </dateValid>
197
+ </xsl:when>
198
+
199
+ <!-- other -->
200
+
201
+ <xsl:otherwise>
202
+ <dateValid>
203
+ <xsl:value-of select="."/>
204
+ </dateValid>
205
+ </xsl:otherwise>
206
+ </xsl:choose>
207
+ </xsl:for-each>
208
+ </xsl:if>
209
+ </xsl:for-each>
210
+
211
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:edition">
212
+ <edition>
213
+ <xsl:value-of select="."/>
214
+ </edition>
215
+ </xsl:for-each>
216
+ </originInfo>
217
+ <language>
218
+ <languageTerm authority="iso639-2b">
219
+ <xsl:value-of select="gmd:language/gmd:LanguageCode/@codeListValue"/>
220
+ </languageTerm>
221
+ </language>
222
+ <physicalDescription>
223
+ <form>
224
+ <xsl:apply-templates select="gmd:distributionInfo/gmd:MD_Distribution/gmd:distributionFormat/gmd:MD_Format/gmd:name"/>
225
+ </form>
226
+ <xsl:for-each select="gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:transferSize">
227
+ <extent>
228
+ <xsl:value-of select="gco:Real"/>
229
+ <xsl:choose>
230
+ <xsl:when test="ancestor-or-self::*/gmd:MD_DigitalTransferOptions/gmd:unitsOfDistribution">
231
+ <xsl:text> </xsl:text>
232
+ <xsl:value-of select="ancestor-or-self::*/gmd:MD_DigitalTransferOptions/gmd:unitsOfDistribution"/>
233
+ </xsl:when>
234
+ <xsl:otherwise>
235
+ <xsl:text> MB</xsl:text>
236
+ </xsl:otherwise>
237
+ </xsl:choose>
238
+ </extent>
239
+
240
+ <!-- The digitalOrigin is coded here:
241
+ http://www.loc.gov/standards/mods/v3/mods-userguide-elements.html#digitalorigin
242
+ -->
243
+ </xsl:for-each>
244
+ <digitalOrigin>born digital</digitalOrigin>
245
+ </physicalDescription>
246
+ <subject>
247
+ <cartographics>
248
+ <xsl:choose>
249
+ <xsl:when test="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:spatialResolution">
250
+ <scale>
251
+ <xsl:text>1:</xsl:text>
252
+ <xsl:value-of select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:spatialResolution/gmd:MD_Resolution/gmd:equivalentScale/gmd:MD_RepresentativeFraction/gmd:denominator/gco:Integer"/>
253
+ </scale>
254
+ </xsl:when>
255
+ <xsl:otherwise>
256
+ <scale>
257
+ <xsl:text>Scale not given.</xsl:text>
258
+ </scale>
259
+ </xsl:otherwise>
260
+ </xsl:choose>
261
+ <projection>
262
+ <!-- Use '::' since the spec requires a version here (e.g., :7.4:) but it's generally left blank -->
263
+ <xsl:value-of select="gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier/gmd:codeSpace/gco:CharacterString"/>
264
+ <xsl:text>::</xsl:text>
265
+ <xsl:value-of select="gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier/gmd:code/gco:CharacterString"/>
266
+ </projection>
267
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox">
268
+ <coordinates>
269
+ <xsl:choose>
270
+ <xsl:when test="$geoformat = 'GMD'">
271
+ <gmd:EX_GeographicBoundingBox xmlns:gmd="http://www.isotc211.org/2005/gmd">
272
+ <gmd:westBoundLongitude>
273
+ <gco:Decimal>
274
+ <xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/>
275
+ </gco:Decimal>
276
+ </gmd:westBoundLongitude>
277
+ <gmd:eastBoundLongitude>
278
+ <gco:Decimal>
279
+ <xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/>
280
+ </gco:Decimal>
281
+ </gmd:eastBoundLongitude>
282
+ <gmd:southBoundLatitude>
283
+ <gco:Decimal>
284
+ <xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>
285
+ </gco:Decimal>
286
+ </gmd:southBoundLatitude>
287
+ <gmd:northBoundLatitude>
288
+ <gco:Decimal>
289
+ <xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>
290
+ </gco:Decimal>
291
+ </gmd:northBoundLatitude>
292
+ </gmd:EX_GeographicBoundingBox>
293
+ </xsl:when>
294
+ <!-- WKT is x y, x y
295
+
296
+ POLYGON((sw, nw, ne, se, sw))
297
+ -->
298
+ <xsl:when test="$geoformat = 'WKT'">
299
+ <xsl:text>POLYGON((</xsl:text>
300
+ <xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/>
301
+ <xsl:text> </xsl:text>
302
+ <xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>
303
+ <xsl:text>, </xsl:text>
304
+ <xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/>
305
+ <xsl:text> </xsl:text>
306
+ <xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>
307
+ <xsl:text>, </xsl:text>
308
+ <xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/>
309
+ <xsl:text> </xsl:text>
310
+ <xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>
311
+ <xsl:text>, </xsl:text>
312
+ <xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/>
313
+ <xsl:text> </xsl:text>
314
+ <xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>
315
+ <xsl:text>, </xsl:text>
316
+ <xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/>
317
+ <xsl:text> </xsl:text>
318
+ <xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>
319
+ <xsl:text>))</xsl:text>
320
+ </xsl:when>
321
+ <xsl:when test="$geoformat = 'WMS'">
322
+ <!-- WMS
323
+ Uses min/max as attributes
324
+
325
+ Example:
326
+
327
+ <wms:BoundingBox xmlns:wms="http://www.opengis.net/wms"
328
+ CRS="EPSG:4326"
329
+ minx="-97.119945" miny="25.467075"
330
+ maxx="-82.307619" maxy="30.665492"/>
331
+ -->
332
+ <wms:BoundingBox xmlns:wms="http://www.opengis.net/wms">
333
+ <xsl:attribute name="CRS">EPSG:4326</xsl:attribute>
334
+ <xsl:attribute name="minx">
335
+ <xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/>
336
+ </xsl:attribute>
337
+ <xsl:attribute name="miny">
338
+ <xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>
339
+ </xsl:attribute>
340
+ <xsl:attribute name="maxx">
341
+ <xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/>
342
+ </xsl:attribute>
343
+ <xsl:attribute name="maxy">
344
+ <xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>
345
+ </xsl:attribute>
346
+ </wms:BoundingBox>
347
+ </xsl:when>
348
+ <xsl:when test="$geoformat = 'GML'">
349
+ <!-- GML
350
+ Using SW and NE corners in (x, y) coordinates
351
+
352
+ Example:
353
+
354
+ <gml:Envelope xmlns:gml="http://www.opengis.net/gml/3.2" srsName="EPSG:4326">
355
+ <gml:lowerCorner>-97.119945 25.467075</gml:lowerCorner>
356
+ <gml:upperCorner>-82.307619 30.665492</gml:upperCorner>
357
+ </gml:Envelope>
358
+ -->
359
+ <gml:Envelope xmlns:gml="http://www.opengis.net/gml/3.2">
360
+ <xsl:attribute name="srsName">
361
+ <xsl:value-of select="//gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier/gmd:codeSpace/gco:CharacterString"/>
362
+ <xsl:text>:</xsl:text>
363
+ <xsl:value-of select="//gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier/gmd:code/gco:CharacterString"/>
364
+ </xsl:attribute>
365
+ <gml:lowerCorner>
366
+ <xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/>
367
+ <xsl:text> </xsl:text>
368
+ <xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>
369
+ </gml:lowerCorner>
370
+ <gml:upperCorner>
371
+ <xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/>
372
+ <xsl:text> </xsl:text>
373
+ <xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>
374
+ </gml:upperCorner>
375
+ </gml:Envelope>
376
+ </xsl:when>
377
+ <xsl:when test="$geoformat = 'GeoRSS'">
378
+ <!-- GeoRSS:
379
+ Rectangular envelope property element containing two pairs of coordinates
380
+ (lower left envelope corner, upper right envelope corner) representing
381
+ latitude then longitude in the WGS84 coordinate reference system.
382
+
383
+ Example:
384
+
385
+ <georss:box>42.943 -71.032 43.039 -69.856</georss:box>
386
+ -->
387
+ <georss:box xmlns:georss="http://www.georss.org/georss">
388
+ <xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>
389
+ <xsl:text> </xsl:text>
390
+ <xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/>
391
+ <xsl:text> </xsl:text>
392
+ <xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>
393
+ <xsl:text> </xsl:text>
394
+ <xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/>
395
+ </georss:box>
396
+ </xsl:when>
397
+ <xsl:when test="$geoformat = 'MARC034'">
398
+ <!-- MARC 034
399
+ Subfields $d, $e, $f, and $g always appear together. The coordinates
400
+ may be recorded in the form hdddmmss (hemisphere-degrees-minutes-seconds),
401
+ however, other forms are also allowed, such as decimal degrees.
402
+ The subelements are each right justified and unused positions contain zeros.
403
+
404
+ $d - Coordinates - westernmost longitude (NR)
405
+ $e - Coordinates - easternmost longitude (NR)
406
+ $f - Coordinates - northernmost latitude (NR)
407
+ $g - Coordinates - southernmost latitude (NR)
408
+
409
+ Example:
410
+
411
+ $d-097.119945$e-082.307619$f+30.665492$g+25.467075
412
+
413
+ See http://www.w3.org/TR/1999/REC-xslt-19991116#format-number
414
+ -->
415
+ <xsl:text>$d</xsl:text>
416
+ <xsl:value-of select="format-number(gmd:westBoundLongitude/gco:Decimal, '+000.000000;-000.000000')"/>
417
+ <xsl:text>$e</xsl:text>
418
+ <xsl:value-of select="format-number(gmd:eastBoundLongitude/gco:Decimal, '+000.000000;-000.000000')"/>
419
+ <xsl:text>$f</xsl:text>
420
+ <xsl:value-of select="format-number(gmd:northBoundLatitude/gco:Decimal, '+00.000000;-00.000000')"/>
421
+ <xsl:text>$g</xsl:text>
422
+ <xsl:value-of select="format-number(gmd:southBoundLatitude/gco:Decimal, '+00.000000;-00.000000')"/>
423
+ </xsl:when>
424
+ <xsl:otherwise>
425
+ <!-- MARC 255 $c:
426
+ Coordinates are recorded in the order of
427
+ westernmost longitude, easternmost longitude,
428
+ northernmost latitude, and southernmost latitude,
429
+ and separated with double-hyphen and / characters.
430
+
431
+ XXX: Note that this leaves the coordinates in decimal
432
+ degrees whereas 255c suggests deg-min-sec.
433
+
434
+ Example:
435
+
436
+ -97.119945 &#x002D;&#x002D; -82.307619/30.665492 &#x002D;&#x002D; 25.467075
437
+
438
+ See http://www.loc.gov/marc/bibliographic/bd255.html $c
439
+ -->
440
+ <xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/>
441
+ <xsl:text> -- </xsl:text>
442
+ <xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/>
443
+ <xsl:text>/</xsl:text>
444
+ <xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>
445
+ <xsl:text> -- </xsl:text>
446
+ <xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>
447
+ </xsl:otherwise>
448
+ </xsl:choose>
449
+ </coordinates>
450
+ </xsl:for-each>
451
+ </cartographics>
452
+ </subject>
453
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract">
454
+ <abstract displayLabel="Abstract">
455
+ <xsl:attribute name="lang">eng</xsl:attribute>
456
+ <xsl:value-of select="gco:CharacterString"/>
457
+ </abstract>
458
+ </xsl:for-each>
459
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:purpose">
460
+ <abstract displayLabel="Purpose">
461
+ <xsl:attribute name="lang">eng</xsl:attribute>
462
+ <xsl:value-of select="gco:CharacterString"/>
463
+ </abstract>
464
+ </xsl:for-each>
465
+ <!-- Reports, citation, other info, etc. -->
466
+ <xsl:for-each select="gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_ConceptualConsistency/gmd:evaluationMethodDescription">
467
+ <note displayLabel="Conceptual consistency report">
468
+ <xsl:attribute name="lang">eng</xsl:attribute>
469
+ <xsl:value-of select="gco:CharacterString"/>
470
+ </note>
471
+ </xsl:for-each>
472
+ <xsl:for-each select="gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_AbsoluteExternalPositionalAccuracy/gmd:evaluationMethodDescription">
473
+ <note displayLabel="Attribute accuracy report">
474
+ <xsl:attribute name="lang">eng</xsl:attribute>
475
+ <xsl:value-of select="gco:CharacterString"/>
476
+ </note>
477
+ </xsl:for-each>
478
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:credit">
479
+ <note displayLabel="Preferred citation">
480
+ <xsl:attribute name="lang">eng</xsl:attribute>
481
+ <xsl:value-of select="gco:CharacterString"/>
482
+ </note>
483
+ </xsl:for-each>
484
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:supplementalInformation">
485
+ <note displayLabel="Supplemental information">
486
+ <xsl:value-of select="gco:CharacterString"/>
487
+ </note>
488
+ </xsl:for-each>
489
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints/gmd:MD_Constraints">
490
+ <xsl:for-each select="gmd:useLimitation">
491
+ <note displayLabel="Use limitation">
492
+ <xsl:value-of select="gco:CharacterString"/>
493
+ </note>
494
+ </xsl:for-each>
495
+ </xsl:for-each>
496
+ <!-- MODS relatedItem type='host'-->
497
+ <xsl:choose>
498
+ <xsl:when test="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo/gmd:MD_AggregateInformation">
499
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo/gmd:MD_AggregateInformation">
500
+ <xsl:if test="gmd:associationType/gmd:DS_AssociationTypeCode[@codeListValue='largerWorkCitation']">
501
+ <relatedItem>
502
+ <xsl:attribute name="type">host</xsl:attribute>
503
+ <titleInfo>
504
+ <title>
505
+ <xsl:value-of select="gmd:aggregateDataSetName/gmd:CI_Citation/gmd:title"/>
506
+ </title>
507
+ </titleInfo>
508
+ <typeOfResource collection="yes"/>
509
+ <xsl:for-each select="gmd:aggregateDataSetName/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:organisationName">
510
+ <xsl:if test="ancestor-or-self::gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue='originator']">
511
+ <name type="corporate">
512
+ <namePart>
513
+ <xsl:value-of select="."/>
514
+ </namePart>
515
+ </name>
516
+ </xsl:if>
517
+ </xsl:for-each>
518
+ <xsl:for-each select="gmd:aggregateDataSetName/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:personalName">
519
+ <xsl:if test="ancestor-or-self::gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue='originator']">
520
+ <name type="personal">
521
+ <namePart>
522
+ <xsl:value-of select="."/>
523
+ </namePart>
524
+ </name>
525
+ </xsl:if>
526
+ </xsl:for-each>
527
+ <originInfo>
528
+ <xsl:for-each select="gmd:aggregateDataSetName/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:organisationName">
529
+ <xsl:if test="ancestor-or-self::gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue='publisher']">
530
+ <publisher>
531
+ <xsl:value-of select="."/>
532
+ </publisher>
533
+ </xsl:if>
534
+ </xsl:for-each>
535
+ <dateIssued encoding="w3cdtf">
536
+ <!-- strip MM-DD, oupput YYYY -->
537
+ <xsl:choose>
538
+ <xsl:when test="gmd:aggregateDataSetName/gmd:CI_Citation/gmd:date">
539
+ <xsl:value-of select="substring(gmd:aggregateDataSetName/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date,1,4)"/>
540
+ </xsl:when>
541
+ <xsl:otherwise>unknown</xsl:otherwise>
542
+ </xsl:choose>
543
+ </dateIssued>
544
+ <xsl:for-each select="gmd:aggregateDataSetName/gmd:CI_Citation/gmd:edition">
545
+ <edition>
546
+ <xsl:value-of select="."/>
547
+ </edition>
548
+ </xsl:for-each>
549
+ </originInfo>
550
+ <xsl:for-each select="gmd:aggregateDataSetName/gmd:CI_Citation/gmd:series/gmd:CI_Series">
551
+ <relatedItem>
552
+ <xsl:attribute name="type">host</xsl:attribute>
553
+ <titleInfo>
554
+ <title>
555
+ <xsl:value-of select="gmd:name"/>
556
+ </title>
557
+ </titleInfo>
558
+ <originInfo>
559
+ <dateIssued>
560
+ <xsl:value-of select="gmd:issueIdentification"/>
561
+ </dateIssued>
562
+ <issuance>continuing</issuance>
563
+ </originInfo>
564
+ </relatedItem>
565
+ </xsl:for-each>
566
+ </relatedItem>
567
+ </xsl:if>
568
+ </xsl:for-each>
569
+ </xsl:when>
570
+ <xsl:when test="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:series/gmd:CI_Series">
571
+ <relatedItem>
572
+ <xsl:attribute name="type">host</xsl:attribute>
573
+ <titleInfo>
574
+ <title>
575
+ <xsl:value-of select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:series/gmd:CI_Series/gmd:name"/>
576
+ </title>
577
+ </titleInfo>
578
+ <originInfo>
579
+ <dateIssued>
580
+ <xsl:value-of select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:series/gmd:CI_Series/gmd:issueIdentification"/>
581
+ </dateIssued>
582
+ <issuance>continuing</issuance>
583
+ </originInfo>
584
+ </relatedItem>
585
+ </xsl:when>
586
+ </xsl:choose>
587
+ <!-- subjects: topic, geographic, temporal, ISO19115TopicCategory -->
588
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords">
589
+ <xsl:if test="gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='theme']">
590
+ <xsl:for-each select="gmd:keyword">
591
+ <subject>
592
+ <topic>
593
+ <xsl:if test="ancestor-or-self::*/gmd:thesaurusName/gmd:CI_Citation/gmd:title">
594
+ <xsl:attribute name="authority">
595
+ <!-- TODO: Should be case-insenstive compare -->
596
+ <xsl:choose>
597
+ <xsl:when test="ancestor-or-self::*/gmd:thesaurusName/gmd:CI_Citation/gmd:title='Library of Congress Subject Headings (LCSH)'">
598
+ <xsl:text>lcsh</xsl:text>
599
+ </xsl:when>
600
+ <xsl:otherwise>
601
+ <xsl:value-of select="ancestor-or-self::*/gmd:thesaurusName/gmd:CI_Citation/gmd:title"/>
602
+ </xsl:otherwise>
603
+ </xsl:choose>
604
+ </xsl:attribute>
605
+ </xsl:if>
606
+ <xsl:if test="ancestor-or-self::*/gmd:thesaurusName/gmd:CI_Citation/gmd:identifier">
607
+ <xsl:attribute name="authorityURI">
608
+ <xsl:value-of select="ancestor-or-self::*/gmd:thesaurusName/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code"/>
609
+ </xsl:attribute>
610
+ </xsl:if>
611
+ <xsl:attribute name="lang">
612
+ <xsl:value-of select="../../../../../gmd:language/gmd:LanguageCode"/>
613
+ </xsl:attribute>
614
+ <xsl:value-of select="."/>
615
+ </topic>
616
+ </subject>
617
+ </xsl:for-each>
618
+ </xsl:if>
619
+ </xsl:for-each>
620
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords">
621
+ <xsl:if test="gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='place']">
622
+ <xsl:for-each select="gmd:keyword">
623
+ <subject>
624
+ <geographic>
625
+ <!-- adds geonames info through external process -->
626
+ <xsl:attribute name="lang">
627
+ <xsl:value-of select="../../../../../gmd:language/gmd:LanguageCode"/>
628
+ </xsl:attribute>
629
+ <xsl:value-of select="."/>
630
+ </geographic>
631
+ </subject>
632
+ </xsl:for-each>
633
+ </xsl:if>
634
+ </xsl:for-each>
635
+
636
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords">
637
+ <xsl:if test="gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='temporal']">
638
+ <xsl:for-each select="gmd:keyword">
639
+
640
+ <xsl:choose>
641
+
642
+ <!-- 4 digit year -->
643
+ <xsl:when test="string-length()=4">
644
+ <subject>
645
+ <temporal>
646
+ <xsl:attribute name="encoding">w3cdtf</xsl:attribute>
647
+ <xsl:value-of select="."/>
648
+ </temporal>
649
+ </subject>
650
+ </xsl:when>
651
+
652
+ <!-- range of dates in YYYY-YYYY format -->
653
+
654
+ <xsl:when test="contains(./*,'-')">
655
+ <subject>
656
+ <temporal>
657
+ <xsl:attribute name="encoding">w3cdtf</xsl:attribute>
658
+ <xsl:attribute name="point">start</xsl:attribute>
659
+ <xsl:value-of select="substring-before(*,'-')"/>
660
+ </temporal>
661
+ <temporal>
662
+ <xsl:attribute name="encoding">w3cdtf</xsl:attribute>
663
+ <xsl:attribute name="point">end</xsl:attribute>
664
+ <xsl:value-of select="substring-after(*,'-')"/>
665
+ </temporal>
666
+ </subject>
667
+ </xsl:when>
668
+
669
+ <!-- other -->
670
+
671
+ <xsl:otherwise>
672
+ <subject>
673
+ <temporal>
674
+ <xsl:value-of select="."/>
675
+ </temporal>
676
+ </subject>
677
+ </xsl:otherwise>
678
+
679
+ </xsl:choose>
680
+ </xsl:for-each>
681
+ </xsl:if>
682
+ </xsl:for-each>
683
+
684
+
685
+
686
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory/gmd:MD_TopicCategoryCode">
687
+ <subject>
688
+ <topic>
689
+ <xsl:attribute name="authority">ISO19115TopicCategory</xsl:attribute>
690
+
691
+ <!-- kd: do we need authorityURI? -->
692
+ <xsl:attribute name="authorityURI">
693
+ <xsl:text>http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_TopicCategoryCode</xsl:text>
694
+ </xsl:attribute>
695
+ <xsl:choose>
696
+ <xsl:when test="contains(.,'farming')">
697
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
698
+ <xsl:text>Farming</xsl:text>
699
+ </xsl:when>
700
+ <xsl:when test="contains(.,'biota')">
701
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
702
+ <xsl:text>Biology and Ecology</xsl:text>
703
+ </xsl:when>
704
+ <xsl:when test="contains(.,'climatologyMeteorologyAtmosphere')">\
705
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
706
+ <xsl:text>Climatology, Meteorology and Atmosphere</xsl:text>
707
+ </xsl:when>
708
+ <xsl:when test="contains(.,'boundaries')">
709
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
710
+ <xsl:text>Boundaries</xsl:text>
711
+ </xsl:when>
712
+ <xsl:when test="contains(.,'elevation')">
713
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
714
+ <xsl:text>Elevation</xsl:text>
715
+ </xsl:when>
716
+ <xsl:when test="contains(.,'environment')">
717
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
718
+ <xsl:text>Environment</xsl:text>
719
+ </xsl:when>
720
+ <xsl:when test="contains(.,'geoscientificInformation')">
721
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
722
+ <xsl:text>Geoscientific Information</xsl:text>
723
+ </xsl:when>
724
+ <xsl:when test="contains(.,'health')">
725
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
726
+ <xsl:text>Health</xsl:text>
727
+ </xsl:when>
728
+ <xsl:when test="contains(.,'imageryBaseMapsEarthCover')">
729
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
730
+ <xsl:text>Imagery and Base Maps</xsl:text>
731
+ </xsl:when>
732
+ <xsl:when test="contains(.,'intelligenceMilitary')">
733
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
734
+ <xsl:text>Military</xsl:text>
735
+ </xsl:when>
736
+ <xsl:when test="contains(.,'inlandWaters')">
737
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
738
+ <xsl:text>Inland Waters</xsl:text>
739
+ </xsl:when>
740
+ <xsl:when test="contains(.,'location')">
741
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
742
+ <xsl:text>Location</xsl:text>
743
+ </xsl:when>
744
+ <xsl:when test="contains(.,'oceans')">
745
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
746
+ <xsl:text>Oceans</xsl:text>
747
+ </xsl:when>
748
+ <xsl:when test="contains(.,'planningCadastre')">
749
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
750
+ <xsl:text>Planning and Cadastral</xsl:text>
751
+ </xsl:when>
752
+ <xsl:when test="contains(.,'structural')">
753
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
754
+ <xsl:text>Structures</xsl:text>
755
+ </xsl:when>
756
+ <xsl:when test="contains(.,'transportation')">
757
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
758
+ <xsl:text>Transportation</xsl:text>
759
+ </xsl:when>
760
+ <xsl:when test="contains(.,'utilitiesCommunication')">
761
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
762
+ <xsl:text>Utilities and Communication</xsl:text>
763
+ </xsl:when>
764
+ <xsl:when test="contains(.,'society')">
765
+ <xsl:attribute name="valueURI"><xsl:value-of select="."/></xsl:attribute>
766
+ <xsl:text>Society</xsl:text>
767
+ </xsl:when>
768
+ </xsl:choose>
769
+ </topic>
770
+ </subject>
771
+ </xsl:for-each>
772
+ <!-- TODO: Need a metadata practice for GIS Dataset's Online Resource. -->
773
+ <!-- access rights to be mapped from restrictionCode/otherRestrictions/APO -->
774
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:otherConstraints">
775
+ <accessCondition type="useAndReproduction">
776
+ <xsl:value-of select=". "/>
777
+ </accessCondition>
778
+ </xsl:for-each>
779
+
780
+ <!-- Output geo extension to MODS -->
781
+ <xsl:if test="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox">
782
+ <extension displayLabel="geo" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
783
+ <rdf:RDF xmlns:gml="http://www.opengis.net/gml/3.2/" xmlns:dc="http://purl.org/dc/elements/1.1/">
784
+ <rdf:Description>
785
+ <xsl:attribute name="rdf:about">
786
+ <xsl:value-of select="$purl"/>
787
+ </xsl:attribute>
788
+ <!-- Output MIME type -->
789
+ <dc:format>
790
+ <xsl:value-of select="$format"/>
791
+ </dc:format>
792
+ <!-- Output Dataset# point, linestring, polygon, raster, etc. -->
793
+ <dc:type>
794
+ <xsl:text>Dataset#</xsl:text>
795
+ <xsl:value-of select="$geometryType"/>
796
+ </dc:type>
797
+ <!-- Output bounding box -->
798
+ <gml:boundedBy>
799
+ <gml:Envelope>
800
+ <xsl:attribute name="gml:srsName">
801
+ <xsl:value-of select="gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier/gmd:codeSpace/gco:CharacterString"/>
802
+ <xsl:text>:</xsl:text>
803
+ <xsl:value-of select="gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier/gmd:code/gco:CharacterString"/>
804
+ </xsl:attribute>
805
+ <gml:lowerCorner>
806
+ <xsl:value-of select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:westBoundLongitude/gco:Decimal"/>
807
+ <xsl:text> </xsl:text>
808
+ <xsl:value-of select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:southBoundLatitude/gco:Decimal"/>
809
+ </gml:lowerCorner>
810
+ <gml:upperCorner>
811
+ <xsl:value-of select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:eastBoundLongitude/gco:Decimal"/>
812
+ <xsl:text> </xsl:text>
813
+ <xsl:value-of select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:northBoundLatitude/gco:Decimal"/>
814
+ </gml:upperCorner>
815
+ </gml:Envelope>
816
+ </gml:boundedBy>
817
+ <!-- Output linked data to GeoNames: An external process will clean these up -->
818
+ <xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords">
819
+ <xsl:if test="gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='place']">
820
+ <xsl:for-each select="gmd:keyword">
821
+ <dc:coverage>
822
+ <xsl:attribute name="rdf:resource">
823
+ <xsl:value-of select="../../@xlink:href"/>
824
+ </xsl:attribute>
825
+ <xsl:attribute name="dc:language">
826
+ <xsl:value-of select="../../../../../gmd:language/gmd:LanguageCode"/>
827
+ </xsl:attribute>
828
+ <xsl:attribute name="dc:title">
829
+ <xsl:value-of select="."/>
830
+ </xsl:attribute>
831
+ </dc:coverage>
832
+ </xsl:for-each>
833
+ </xsl:if>
834
+ </xsl:for-each>
835
+ </rdf:Description>
836
+ </rdf:RDF>
837
+ </extension>
838
+ </xsl:if>
839
+ </xsl:for-each>
840
+ </mods>
841
+ </xsl:template>
842
+ </xsl:stylesheet>