geo_combine 0.1.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +6 -1
- data/Gemfile +2 -1
- data/README.md +108 -23
- data/geo_combine.gemspec +4 -2
- data/lib/geo_combine.rb +11 -1
- data/lib/geo_combine/bounding_box.rb +71 -0
- data/lib/geo_combine/ckan_metadata.rb +112 -0
- data/lib/geo_combine/esri_open_data.rb +0 -9
- data/lib/geo_combine/exceptions.rb +8 -0
- data/lib/geo_combine/formatting.rb +6 -1
- data/lib/geo_combine/geo_blacklight_harvester.rb +203 -0
- data/lib/geo_combine/geoblacklight.rb +80 -12
- data/lib/geo_combine/ogp.rb +229 -0
- data/lib/geo_combine/railtie.rb +7 -0
- data/lib/geo_combine/version.rb +1 -1
- data/lib/tasks/geo_combine.rake +54 -20
- data/lib/xslt/fgdc2geoBL.xsl +95 -154
- data/lib/xslt/fgdc2html.xsl +105 -157
- data/lib/xslt/iso2geoBL.xsl +62 -84
- data/lib/xslt/iso2html.xsl +1107 -1070
- data/spec/features/iso2html_spec.rb +7 -1
- data/spec/fixtures/docs/basic_geoblacklight.json +5 -7
- data/spec/fixtures/docs/ckan.json +456 -0
- data/spec/fixtures/docs/full_geoblacklight.json +2 -8
- data/spec/fixtures/docs/geoblacklight_pre_v1.json +37 -0
- data/spec/fixtures/docs/ogp_harvard_line.json +28 -0
- data/spec/fixtures/docs/ogp_harvard_raster.json +28 -0
- data/spec/fixtures/docs/ogp_tufts_vector.json +31 -0
- data/spec/fixtures/json_docs.rb +20 -0
- data/spec/lib/geo_combine/bounding_box_spec.rb +59 -0
- data/spec/lib/geo_combine/ckan_metadata_spec.rb +114 -0
- data/spec/lib/geo_combine/esri_open_data_spec.rb +1 -14
- data/spec/lib/geo_combine/fgdc_spec.rb +11 -14
- data/spec/lib/geo_combine/formatting_spec.rb +6 -0
- data/spec/lib/geo_combine/geo_blacklight_harvester_spec.rb +190 -0
- data/spec/lib/geo_combine/geoblacklight_spec.rb +137 -11
- data/spec/lib/geo_combine/iso19139_spec.rb +5 -2
- data/spec/lib/geo_combine/ogp_spec.rb +163 -0
- data/spec/spec_helper.rb +1 -0
- metadata +63 -14
- data/lib/schema/geoblacklight-schema.json +0 -169
data/lib/xslt/fgdc2html.xsl
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
3
|
-
|
4
|
-
|
3
|
+
<xsl:output method="html" encoding="utf-8" indent="yes" />
|
4
|
+
<!--
|
5
|
+
fgdc2html.xsl - Transformation from CSDGM/FGDC into HTML
|
5
6
|
Created by Kim Durante, Stanford University Libraries
|
6
7
|
|
7
|
-
|
8
|
+
Modified by Keith Jenkins, Cornell University Library, 2018-01-25
|
9
|
+
to render attributes in a more readable form.
|
10
|
+
-->
|
8
11
|
<xsl:template match="/">
|
9
|
-
<xsl:text disable-output-escaping='yes'><!DOCTYPE html
|
12
|
+
<xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text>
|
10
13
|
<html>
|
11
14
|
<head>
|
12
15
|
<title>
|
@@ -64,6 +67,7 @@
|
|
64
67
|
</body>
|
65
68
|
</html>
|
66
69
|
</xsl:template>
|
70
|
+
|
67
71
|
<!-- Identification -->
|
68
72
|
<xsl:template match="idinfo">
|
69
73
|
<div id="fgdc-identification-info">
|
@@ -335,6 +339,7 @@
|
|
335
339
|
</dl>
|
336
340
|
</div>
|
337
341
|
</xsl:template>
|
342
|
+
|
338
343
|
<!-- Data Quality -->
|
339
344
|
<xsl:template match="dataqual">
|
340
345
|
<div id="fgdc-data-quality-info">
|
@@ -524,6 +529,7 @@
|
|
524
529
|
</dl>
|
525
530
|
</div>
|
526
531
|
</xsl:template>
|
532
|
+
|
527
533
|
<!-- Spatial Data Organization -->
|
528
534
|
<xsl:template match="spdoinfo">
|
529
535
|
<div id="fgdc-spatialdataorganization-info">
|
@@ -637,6 +643,7 @@
|
|
637
643
|
</dl>
|
638
644
|
</div>
|
639
645
|
</xsl:template>
|
646
|
+
|
640
647
|
<!-- Spatial Reference -->
|
641
648
|
<xsl:template match="spref">
|
642
649
|
<div id="fgdc-spatialreference-info">
|
@@ -1112,6 +1119,7 @@
|
|
1112
1119
|
</dl>
|
1113
1120
|
</div>
|
1114
1121
|
</xsl:template>
|
1122
|
+
|
1115
1123
|
<!-- Entity and Attribute -->
|
1116
1124
|
<xsl:template match="eainfo">
|
1117
1125
|
<div id="fgdc-entityattribute-info">
|
@@ -1145,7 +1153,7 @@
|
|
1145
1153
|
</dl>
|
1146
1154
|
</dd>
|
1147
1155
|
</xsl:for-each>
|
1148
|
-
<xsl:
|
1156
|
+
<xsl:call-template name='attributes' />
|
1149
1157
|
</xsl:for-each>
|
1150
1158
|
<xsl:for-each select="overview">
|
1151
1159
|
<xsl:for-each select="eaover">
|
@@ -1166,6 +1174,94 @@
|
|
1166
1174
|
</dl>
|
1167
1175
|
</div>
|
1168
1176
|
</xsl:template>
|
1177
|
+
|
1178
|
+
<xsl:template name='attributes'>
|
1179
|
+
<xsl:if test='attr'>
|
1180
|
+
<dt>Attributes</dt>
|
1181
|
+
<dd>
|
1182
|
+
<dl>
|
1183
|
+
<xsl:for-each select="attr">
|
1184
|
+
<dt><xsl:value-of select="attrlabl" /></dt>
|
1185
|
+
<dd>
|
1186
|
+
<xsl:value-of select="attrdef" />
|
1187
|
+
<xsl:apply-templates select="attrdomv" />
|
1188
|
+
<dl>
|
1189
|
+
<xsl:for-each select="begdatea">
|
1190
|
+
<dt>Beginning Date of Attribute Values</dt>
|
1191
|
+
<dd>
|
1192
|
+
<xsl:value-of select="." />
|
1193
|
+
</dd>
|
1194
|
+
</xsl:for-each>
|
1195
|
+
<xsl:for-each select="enddatea">
|
1196
|
+
<dt>Ending Date of Attribute Values</dt>
|
1197
|
+
<dd>
|
1198
|
+
<xsl:value-of select="." />
|
1199
|
+
</dd>
|
1200
|
+
</xsl:for-each>
|
1201
|
+
<xsl:for-each select="attrvai">
|
1202
|
+
<xsl:for-each select="attrva">
|
1203
|
+
<dt>Attribute Value Accuracy</dt>
|
1204
|
+
<dd>
|
1205
|
+
<xsl:value-of select="." />
|
1206
|
+
</dd>
|
1207
|
+
</xsl:for-each>
|
1208
|
+
<xsl:for-each select="attrvae">
|
1209
|
+
<dt>Attribute Value Accuracy Explanation</dt>
|
1210
|
+
<dd>
|
1211
|
+
<xsl:value-of select="." />
|
1212
|
+
</dd>
|
1213
|
+
</xsl:for-each>
|
1214
|
+
</xsl:for-each>
|
1215
|
+
<xsl:for-each select="attrmfrq">
|
1216
|
+
<dt>Attribute Measurement Frequency</dt>
|
1217
|
+
<dd>
|
1218
|
+
<xsl:value-of select="." />
|
1219
|
+
</dd>
|
1220
|
+
</xsl:for-each>
|
1221
|
+
</dl>
|
1222
|
+
</dd>
|
1223
|
+
</xsl:for-each>
|
1224
|
+
</dl>
|
1225
|
+
</dd>
|
1226
|
+
</xsl:if>
|
1227
|
+
</xsl:template>
|
1228
|
+
|
1229
|
+
<xsl:template match="attrdomv[codesetd]">
|
1230
|
+
<xsl:text> (</xsl:text>
|
1231
|
+
<xsl:value-of select="codesetd/codesetn" />
|
1232
|
+
<xsl:apply-templates select="codesetd/codesets/text()" />
|
1233
|
+
<xsl:text>)</xsl:text>
|
1234
|
+
</xsl:template>
|
1235
|
+
|
1236
|
+
<xsl:template match="attrdomv[edom]">
|
1237
|
+
<br />
|
1238
|
+
<button onclick="this.nextElementSibling.style.display = (this.nextElementSibling.style.display==='none') ? '' : 'none';">show/hide coded values</button>
|
1239
|
+
<dl style="display:none">
|
1240
|
+
<xsl:for-each select="edom">
|
1241
|
+
<dt><xsl:value-of select="edomv" /></dt>
|
1242
|
+
<dd><xsl:value-of select="edomvd" /></dd>
|
1243
|
+
</xsl:for-each>
|
1244
|
+
</dl>
|
1245
|
+
</xsl:template>
|
1246
|
+
|
1247
|
+
<xsl:template match="attrdomv[rdom]">
|
1248
|
+
<xsl:text> (</xsl:text>
|
1249
|
+
<xsl:value-of select="rdom/rdommin" />
|
1250
|
+
<xsl:text> to </xsl:text>
|
1251
|
+
<xsl:value-of select="rdom/rdommax" />
|
1252
|
+
<xsl:if test="rdom/attrunit">
|
1253
|
+
<xsl:text> </xsl:text>
|
1254
|
+
<xsl:value-of select="rdom/attrunit" />
|
1255
|
+
</xsl:if>
|
1256
|
+
<xsl:text>)</xsl:text>
|
1257
|
+
</xsl:template>
|
1258
|
+
|
1259
|
+
<xsl:template match="attrdomv[udom]">
|
1260
|
+
<xsl:text> (</xsl:text>
|
1261
|
+
<xsl:value-of select="udom" />
|
1262
|
+
<xsl:text>)</xsl:text>
|
1263
|
+
</xsl:template>
|
1264
|
+
|
1169
1265
|
<!-- Distribution -->
|
1170
1266
|
<xsl:template match="distinfo">
|
1171
1267
|
<div id="fgdc-distribution-info">
|
@@ -1202,6 +1298,7 @@
|
|
1202
1298
|
</dl>
|
1203
1299
|
</div>
|
1204
1300
|
</xsl:template>
|
1301
|
+
|
1205
1302
|
<!-- Metadata -->
|
1206
1303
|
<xsl:template match="metainfo">
|
1207
1304
|
<div id="fgdc-metadata-reference-info">
|
@@ -1265,6 +1362,7 @@
|
|
1265
1362
|
</dl>
|
1266
1363
|
</div>
|
1267
1364
|
</xsl:template>
|
1365
|
+
|
1268
1366
|
<!-- Citation -->
|
1269
1367
|
<xsl:template match="citeinfo">
|
1270
1368
|
<dl>
|
@@ -1362,6 +1460,7 @@
|
|
1362
1460
|
</xsl:for-each>
|
1363
1461
|
</dl>
|
1364
1462
|
</xsl:template>
|
1463
|
+
|
1365
1464
|
<!-- Contact -->
|
1366
1465
|
<xsl:template match="cntinfo">
|
1367
1466
|
<dt>Contact Information</dt>
|
@@ -1478,6 +1577,7 @@
|
|
1478
1577
|
</dl>
|
1479
1578
|
</dd>
|
1480
1579
|
</xsl:template>
|
1580
|
+
|
1481
1581
|
<!-- Time Period Info -->
|
1482
1582
|
<xsl:template match="timeinfo">
|
1483
1583
|
<dt>Time Period Information</dt>
|
@@ -1771,156 +1871,4 @@
|
|
1771
1871
|
<xsl:value-of select="." />
|
1772
1872
|
</dd>
|
1773
1873
|
</xsl:template>
|
1774
|
-
<xsl:template match="attr">
|
1775
|
-
<dt>Attribute</dt>
|
1776
|
-
<dd>
|
1777
|
-
<dl>
|
1778
|
-
<xsl:for-each select="attrlabl">
|
1779
|
-
<dt>Attribute Label</dt>
|
1780
|
-
<dd>
|
1781
|
-
<xsl:value-of select="." />
|
1782
|
-
</dd>
|
1783
|
-
</xsl:for-each>
|
1784
|
-
<xsl:for-each select="attrdef">
|
1785
|
-
<dt>Attribute Definition</dt>
|
1786
|
-
<dd>
|
1787
|
-
<xsl:value-of select="." />
|
1788
|
-
</dd>
|
1789
|
-
</xsl:for-each>
|
1790
|
-
<xsl:for-each select="attrdefs">
|
1791
|
-
<dt>Attribute Definition Source</dt>
|
1792
|
-
<dd>
|
1793
|
-
<xsl:value-of select="." />
|
1794
|
-
</dd>
|
1795
|
-
</xsl:for-each>
|
1796
|
-
<xsl:for-each select="attrdomv">
|
1797
|
-
<dt>Attribute Domain Values</dt>
|
1798
|
-
<dd>
|
1799
|
-
<dl>
|
1800
|
-
<xsl:for-each select="edom">
|
1801
|
-
<dt>Enumerated Domain</dt>
|
1802
|
-
<dd>
|
1803
|
-
<dl>
|
1804
|
-
<xsl:for-each select="edomv">
|
1805
|
-
<dt>Enumerated Domain Value</dt>
|
1806
|
-
<dd>
|
1807
|
-
<xsl:value-of select="." />
|
1808
|
-
</dd>
|
1809
|
-
</xsl:for-each>
|
1810
|
-
<xsl:for-each select="edomvd">
|
1811
|
-
<dt>Enumerated Domain Value Definition</dt>
|
1812
|
-
<dd>
|
1813
|
-
<xsl:value-of select="." />
|
1814
|
-
</dd>
|
1815
|
-
</xsl:for-each>
|
1816
|
-
<xsl:for-each select="edomvds">
|
1817
|
-
<dt>Enumerated Domain Value Definition Source</dt>
|
1818
|
-
<dd>
|
1819
|
-
<xsl:value-of select="." />
|
1820
|
-
</dd>
|
1821
|
-
</xsl:for-each>
|
1822
|
-
<xsl:apply-templates select="attr" />
|
1823
|
-
</dl>
|
1824
|
-
</dd>
|
1825
|
-
</xsl:for-each>
|
1826
|
-
<xsl:for-each select="rdom">
|
1827
|
-
<dt>Range Domain</dt>
|
1828
|
-
<dd>
|
1829
|
-
<dl>
|
1830
|
-
<xsl:for-each select="rdommin">
|
1831
|
-
<dt>Range Domain Minimum</dt>
|
1832
|
-
<dd>
|
1833
|
-
<xsl:value-of select="." />
|
1834
|
-
</dd>
|
1835
|
-
</xsl:for-each>
|
1836
|
-
<xsl:for-each select="rdommax">
|
1837
|
-
<dt>Range Domain Maximum</dt>
|
1838
|
-
<dd>
|
1839
|
-
<xsl:value-of select="." />
|
1840
|
-
</dd>
|
1841
|
-
</xsl:for-each>
|
1842
|
-
<xsl:for-each select="attrunit">
|
1843
|
-
<dt>Attribute Units of Measure</dt>
|
1844
|
-
<dd>
|
1845
|
-
<xsl:value-of select="." />
|
1846
|
-
</dd>
|
1847
|
-
</xsl:for-each>
|
1848
|
-
<xsl:for-each select="attrmres">
|
1849
|
-
<dt>Attribute Measurement Resolution</dt>
|
1850
|
-
<dd>
|
1851
|
-
<xsl:value-of select="." />
|
1852
|
-
</dd>
|
1853
|
-
</xsl:for-each>
|
1854
|
-
<xsl:apply-templates select="attr" />
|
1855
|
-
</dl>
|
1856
|
-
</dd>
|
1857
|
-
</xsl:for-each>
|
1858
|
-
<xsl:for-each select="codesetd">
|
1859
|
-
<dt>Codeset Domain</dt>
|
1860
|
-
<dd>
|
1861
|
-
<dl>
|
1862
|
-
<xsl:for-each select="codesetn">
|
1863
|
-
<dt>Codeset Name</dt>
|
1864
|
-
<dd>
|
1865
|
-
<xsl:value-of select="." />
|
1866
|
-
</dd>
|
1867
|
-
</xsl:for-each>
|
1868
|
-
<xsl:for-each select="codesets">
|
1869
|
-
<dt>Codeset Source</dt>
|
1870
|
-
<dd>
|
1871
|
-
<xsl:value-of select="." />
|
1872
|
-
</dd>
|
1873
|
-
</xsl:for-each>
|
1874
|
-
</dl>
|
1875
|
-
</dd>
|
1876
|
-
</xsl:for-each>
|
1877
|
-
<xsl:for-each select="udom">
|
1878
|
-
<dt>Unrepresentable Domain</dt>
|
1879
|
-
<dd>
|
1880
|
-
<xsl:value-of select="." />
|
1881
|
-
</dd>
|
1882
|
-
</xsl:for-each>
|
1883
|
-
</dl>
|
1884
|
-
</dd>
|
1885
|
-
</xsl:for-each>
|
1886
|
-
<xsl:for-each select="begdatea">
|
1887
|
-
<dt>Beginning Date of Attribute Values</dt>
|
1888
|
-
<dd>
|
1889
|
-
<xsl:value-of select="." />
|
1890
|
-
</dd>
|
1891
|
-
</xsl:for-each>
|
1892
|
-
<xsl:for-each select="enddatea">
|
1893
|
-
<dt>Ending Date of Attribute Values</dt>
|
1894
|
-
<dd>
|
1895
|
-
<xsl:value-of select="." />
|
1896
|
-
</dd>
|
1897
|
-
</xsl:for-each>
|
1898
|
-
<xsl:for-each select="attrvai">
|
1899
|
-
<dt>Attribute Value Accuracy Information</dt>
|
1900
|
-
<dd>
|
1901
|
-
<dl>
|
1902
|
-
<xsl:for-each select="attrva">
|
1903
|
-
<dt>Attribute Value Accuracy</dt>
|
1904
|
-
<dd>
|
1905
|
-
<xsl:value-of select="." />
|
1906
|
-
</dd>
|
1907
|
-
</xsl:for-each>
|
1908
|
-
<xsl:for-each select="attrvae">
|
1909
|
-
<dt>Attribute Value Accuracy Explanation</dt>
|
1910
|
-
<dd>
|
1911
|
-
<xsl:value-of select="." />
|
1912
|
-
</dd>
|
1913
|
-
</xsl:for-each>
|
1914
|
-
</dl>
|
1915
|
-
</dd>
|
1916
|
-
</xsl:for-each>
|
1917
|
-
<xsl:for-each select="attrmfrq">
|
1918
|
-
<dt>Attribute Measurement Frequency</dt>
|
1919
|
-
<dd>
|
1920
|
-
<xsl:value-of select="." />
|
1921
|
-
</dd>
|
1922
|
-
</xsl:for-each>
|
1923
|
-
</dl>
|
1924
|
-
</dd>
|
1925
|
-
</xsl:template>
|
1926
1874
|
</xsl:stylesheet>
|
data/lib/xslt/iso2geoBL.xsl
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
<!--
|
1
|
+
<!--
|
2
2
|
iso2geoBl.xsl - Transformation from ISO 19139 XML into GeoBlacklight solr json
|
3
|
-
|
3
|
+
|
4
4
|
-->
|
5
|
-
<xsl:stylesheet
|
6
|
-
xmlns="http://www.loc.gov/mods/v3"
|
7
|
-
xmlns:gco="http://www.isotc211.org/2005/gco"
|
8
|
-
xmlns:gmi="http://www.isotc211.org/2005/gmi"
|
9
|
-
xmlns:gmd="http://www.isotc211.org/2005/gmd"
|
5
|
+
<xsl:stylesheet
|
6
|
+
xmlns="http://www.loc.gov/mods/v3"
|
7
|
+
xmlns:gco="http://www.isotc211.org/2005/gco"
|
8
|
+
xmlns:gmi="http://www.isotc211.org/2005/gmi"
|
9
|
+
xmlns:gmd="http://www.isotc211.org/2005/gmd"
|
10
10
|
xmlns:gml="http://www.opengis.net/gml"
|
11
|
-
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
11
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
12
12
|
version="1.0" exclude-result-prefixes="gml gmd gco gmi xsl">
|
13
13
|
<xsl:output method="text" version="1.0" omit-xml-declaration="yes" indent="no" media-type="application/json"/>
|
14
14
|
<xsl:strip-space elements="*"/>
|
@@ -19,31 +19,31 @@
|
|
19
19
|
<xsl:variable name="institution">
|
20
20
|
<xsl:for-each select="gmd:MD_Metadata/gmd:contact/gmd:CI_ResponsibleParty">
|
21
21
|
<xsl:choose>
|
22
|
-
|
23
|
-
<!-- Stanford -->
|
22
|
+
|
23
|
+
<!-- Stanford -->
|
24
24
|
<xsl:when test="contains(gmd:organisationName/gco:CharacterString, 'Stanford')">
|
25
25
|
<xsl:text>Stanford</xsl:text>
|
26
26
|
</xsl:when>
|
27
|
-
|
28
|
-
<!-- UVa -->
|
27
|
+
|
28
|
+
<!-- UVa -->
|
29
29
|
<xsl:when test="contains(gmd:organisationName/gco:CharacterString, 'Virginia')">
|
30
30
|
<xsl:text>UVa</xsl:text>
|
31
31
|
</xsl:when>
|
32
32
|
<xsl:when test="contains(gmd:organisationName/gco:CharacterString, 'Scholars')">
|
33
33
|
<xsl:text>UVa</xsl:text>
|
34
34
|
</xsl:when>
|
35
|
-
|
35
|
+
|
36
36
|
</xsl:choose>
|
37
37
|
</xsl:for-each>
|
38
38
|
</xsl:variable>
|
39
|
-
|
39
|
+
|
40
40
|
<!-- bounding box -->
|
41
41
|
<xsl:variable name="upperCorner">
|
42
42
|
<xsl:value-of select="number(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:eastBoundLongitude/gco:Decimal)"/>
|
43
43
|
<xsl:text> </xsl:text>
|
44
44
|
<xsl:value-of select="number(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:northBoundLatitude/gco:Decimal)"/>
|
45
45
|
</xsl:variable>
|
46
|
-
|
46
|
+
|
47
47
|
<xsl:variable name="lowerCorner">
|
48
48
|
<xsl:value-of select="number(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:westBoundLongitude/gco:Decimal)"/>
|
49
49
|
<xsl:text> </xsl:text>
|
@@ -96,7 +96,7 @@
|
|
96
96
|
</xsl:choose>
|
97
97
|
</xsl:variable>
|
98
98
|
<xsl:text>{</xsl:text>
|
99
|
-
<xsl:text>"
|
99
|
+
<xsl:text>"geoblacklight_version": "1.0",</xsl:text>
|
100
100
|
<xsl:text>"dc_identifier_s": "</xsl:text><xsl:value-of select="$uuid"/><xsl:text>",</xsl:text>
|
101
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
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>
|
@@ -132,7 +132,7 @@
|
|
132
132
|
</xsl:otherwise>
|
133
133
|
</xsl:choose><xsl:text>",</xsl:text>
|
134
134
|
<xsl:text>"dct_provenance_s": "</xsl:text><xsl:value-of select="$institution"/>",
|
135
|
-
|
135
|
+
|
136
136
|
<xsl:text>"layer_id_s": "</xsl:text>
|
137
137
|
<xsl:choose>
|
138
138
|
<xsl:when test="$institution = 'Stanford'">
|
@@ -144,6 +144,31 @@
|
|
144
144
|
<xsl:value-of select="$identifier"/>
|
145
145
|
</xsl:otherwise>
|
146
146
|
</xsl:choose>
|
147
|
+
<xsl:text>",</xsl:text>
|
148
|
+
<xsl:text>"layer_geom_type_s": "</xsl:text>
|
149
|
+
<xsl:choose>
|
150
|
+
<xsl:when test="gmd:MD_Metadata/gmd:spatialRepresentationInfo/gmd:MD_VectorSpatialRepresentation/gmd:geometricObjects/gmd:MD_GeometricObjects/gmd:geometricObjectType/gmd:MD_GeometricObjectTypeCode[@codeListValue='surface']">
|
151
|
+
<xsl:text>Polygon</xsl:text>
|
152
|
+
</xsl:when>
|
153
|
+
<xsl:when test="contains(gmd:MD_Metadata/gmd:spatialRepresentationInfo/gmd:MD_VectorSpatialRepresentation/gmd:geometricObjects/gmd:MD_GeometricObjects/gmd:geometricObjectType/gmd:MD_GeometricObjectTypeCode, 'surface')">
|
154
|
+
<xsl:text>Polygon</xsl:text>
|
155
|
+
</xsl:when>
|
156
|
+
<xsl:when test="gmd:MD_Metadata/gmd:spatialRepresentationInfo/gmd:MD_VectorSpatialRepresentation/gmd:geometricObjects/gmd:MD_GeometricObjects/gmd:geometricObjectType/gmd:MD_GeometricObjectTypeCode[@codeListValue='curve']">
|
157
|
+
<xsl:text>Line</xsl:text>
|
158
|
+
</xsl:when>
|
159
|
+
<xsl:when test="contains(gmd:MD_Metadata/gmd:spatialRepresentationInfo/gmd:MD_VectorSpatialRepresentation/gmd:geometricObjects/gmd:MD_GeometricObjects/gmd:geometricObjectType/gmd:MD_GeometricObjectTypeCode, 'curve')">
|
160
|
+
<xsl:text>Line</xsl:text>
|
161
|
+
</xsl:when>
|
162
|
+
<xsl:when test="gmd:MD_Metadata/gmd:spatialRepresentationInfo/gmd:MD_VectorSpatialRepresentation/gmd:geometricObjects/gmd:MD_GeometricObjects/gmd:geometricObjectType/gmd:MD_GeometricObjectTypeCode[@codeListValue='point']">
|
163
|
+
<xsl:text>Point</xsl:text>
|
164
|
+
</xsl:when>
|
165
|
+
<xsl:when test="contains(gmd:MD_Metadata/gmd:spatialRepresentationInfo/gmd:MD_VectorSpatialRepresentation/gmd:geometricObjects/gmd:MD_GeometricObjects/gmd:geometricObjectType/gmd:MD_GeometricObjectTypeCode, 'point')">
|
166
|
+
<xsl:text>Point</xsl:text>
|
167
|
+
</xsl:when>
|
168
|
+
<xsl:when test="contains(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:spatialRepresentationType/gmd:MD_SpatialRepresentationTypeCode, 'grid')">
|
169
|
+
<xsl:text>Raster</xsl:text>
|
170
|
+
</xsl:when>
|
171
|
+
</xsl:choose>
|
147
172
|
<xsl:text>",</xsl:text>
|
148
173
|
<xsl:text>"layer_slug_s": "</xsl:text>
|
149
174
|
<xsl:value-of select="$institution"/>
|
@@ -163,10 +188,10 @@
|
|
163
188
|
</xsl:when>
|
164
189
|
</xsl:choose>
|
165
190
|
|
166
|
-
|
191
|
+
|
167
192
|
<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
193
|
<xsl:text>"dc_creator_sm": [</xsl:text>
|
169
|
-
|
194
|
+
|
170
195
|
<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
196
|
<xsl:if test="ancestor-or-self::*/gmd:organisationName">
|
172
197
|
<xsl:text>"</xsl:text>
|
@@ -176,7 +201,7 @@
|
|
176
201
|
<xsl:text>,</xsl:text>
|
177
202
|
</xsl:if>
|
178
203
|
</xsl:if>
|
179
|
-
|
204
|
+
|
180
205
|
<xsl:if test="ancestor-or-self::*/gmd:individualName">
|
181
206
|
<xsl:text>"</xsl:text>
|
182
207
|
<xsl:value-of select="ancestor-or-self::*/gmd:individualName"/>
|
@@ -190,7 +215,7 @@
|
|
190
215
|
</xsl:if>
|
191
216
|
<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
217
|
<xsl:text>"dc_publisher_sm": [</xsl:text>
|
193
|
-
|
218
|
+
|
194
219
|
<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
220
|
<xsl:if test="ancestor-or-self::*/gmd:organisationName">
|
196
221
|
<xsl:text>"</xsl:text>
|
@@ -200,7 +225,7 @@
|
|
200
225
|
<xsl:text>,</xsl:text>
|
201
226
|
</xsl:if>
|
202
227
|
</xsl:if>
|
203
|
-
|
228
|
+
|
204
229
|
<xsl:if test="ancestor-or-self::*/gmd:individualName">
|
205
230
|
<xsl:text>"</xsl:text>
|
206
231
|
<xsl:value-of select="ancestor-or-self::*/gmd:individualName"/>
|
@@ -214,14 +239,14 @@
|
|
214
239
|
</xsl:if>
|
215
240
|
|
216
241
|
<xsl:text>"dc_format_s": "</xsl:text><xsl:value-of select="$format"/><xsl:text>",</xsl:text>
|
217
|
-
|
242
|
+
|
218
243
|
<!-- TODO: add inputs for other languages -->
|
219
244
|
<!-- <field name="dc_language_s">
|
220
245
|
<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')">
|
221
246
|
<xsl:text>English</xsl:text>
|
222
247
|
</xsl:if>
|
223
248
|
</field> -->
|
224
|
-
|
249
|
+
|
225
250
|
<!-- from DCMI type vocabulary -->
|
226
251
|
<xsl:choose>
|
227
252
|
<xsl:when test="contains(gmd:MD_Metadata/gmd:hierarchyLevelName/gco:CharacterString, 'dataset')">
|
@@ -236,12 +261,12 @@
|
|
236
261
|
<xsl:if test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory/gmd:MD_TopicCategoryCode">
|
237
262
|
<xsl:text>"dc_subject_sm": [</xsl:text>
|
238
263
|
<xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory/gmd:MD_TopicCategoryCode">
|
239
|
-
<xsl:text>"</xsl:text>
|
264
|
+
<xsl:text>"</xsl:text>
|
240
265
|
<xsl:value-of select="."/>
|
241
266
|
<xsl:text>"</xsl:text>
|
242
|
-
<xsl:text>,</xsl:text>
|
267
|
+
<xsl:text>,</xsl:text>
|
243
268
|
</xsl:for-each>
|
244
|
-
|
269
|
+
|
245
270
|
<xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords">
|
246
271
|
<xsl:if test="gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='theme']">
|
247
272
|
<xsl:for-each select="gmd:keyword">
|
@@ -256,7 +281,7 @@
|
|
256
281
|
</xsl:for-each>
|
257
282
|
<xsl:text>],</xsl:text>
|
258
283
|
</xsl:if>
|
259
|
-
|
284
|
+
|
260
285
|
<xsl:if test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='place']">
|
261
286
|
<xsl:text>"dc_spatial_sm": [</xsl:text>
|
262
287
|
<xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='place']">
|
@@ -271,7 +296,7 @@
|
|
271
296
|
</xsl:for-each>
|
272
297
|
<xsl:text>],</xsl:text>
|
273
298
|
</xsl:if>
|
274
|
-
|
299
|
+
|
275
300
|
<xsl:choose>
|
276
301
|
<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')">
|
277
302
|
<xsl:text>"dct_issued_s": "</xsl:text>
|
@@ -290,30 +315,30 @@
|
|
290
315
|
<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"/>
|
291
316
|
<xsl:text>",</xsl:text>
|
292
317
|
</xsl:when>
|
293
|
-
|
318
|
+
|
294
319
|
<!-- <xsl:otherwise>unknown</xsl:otherwise> -->
|
295
320
|
</xsl:choose>
|
296
|
-
|
297
|
-
|
321
|
+
|
322
|
+
|
298
323
|
<!-- content date: range YYYY-YYYY if dates differ -->
|
299
324
|
<xsl:choose>
|
300
325
|
<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() != ''">
|
301
326
|
<xsl:text>"dct_temporal_sm": "</xsl:text>
|
302
327
|
<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)">
|
328
|
+
<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
329
|
<xsl:text>-</xsl:text>
|
305
330
|
<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
331
|
</xsl:if>
|
307
332
|
<xsl:text>",</xsl:text>
|
308
333
|
</xsl:when>
|
309
|
-
|
334
|
+
|
310
335
|
<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">
|
311
336
|
<xsl:text>"dct_temporal_sm": "</xsl:text>
|
312
337
|
<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
338
|
<xsl:text>",</xsl:text>
|
314
339
|
</xsl:when>
|
315
340
|
</xsl:choose>
|
316
|
-
|
341
|
+
|
317
342
|
<!-- collection -->
|
318
343
|
<!-- <xsl:choose>
|
319
344
|
<xsl:when test="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo/gmd:MD_AggregateInformation/gmd:associationType/gmd:DS_AssociationTypeCode[@codeListValue='largerWorkCitation']">
|
@@ -331,44 +356,7 @@
|
|
331
356
|
</xsl:for-each>
|
332
357
|
</xsl:when>
|
333
358
|
</xsl:choose> -->
|
334
|
-
|
335
|
-
<!-- cross-references -->
|
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>
|
347
|
-
|
348
|
-
<!--<field name="georss_polygon_s">-->
|
349
|
-
<xsl:text>"georss_polygon_s": "</xsl:text>
|
350
|
-
<xsl:text></xsl:text>
|
351
|
-
<xsl:value-of select="$y1"/>
|
352
|
-
<xsl:text> </xsl:text>
|
353
|
-
<xsl:value-of select="$x1"/>
|
354
|
-
<xsl:text> </xsl:text>
|
355
|
-
<xsl:value-of select="$y2"/>
|
356
|
-
<xsl:text> </xsl:text>
|
357
|
-
<xsl:value-of select="$x1"/>
|
358
|
-
<xsl:text> </xsl:text>
|
359
|
-
<xsl:value-of select="$y2"/>
|
360
|
-
<xsl:text> </xsl:text>
|
361
|
-
<xsl:value-of select="$x2"/>
|
362
|
-
<xsl:text> </xsl:text>
|
363
|
-
<xsl:value-of select="$y1"/>
|
364
|
-
<xsl:text> </xsl:text>
|
365
|
-
<xsl:value-of select="$x2"/>
|
366
|
-
<xsl:text> </xsl:text>
|
367
|
-
<xsl:value-of select="$y1"/>
|
368
|
-
<xsl:text> </xsl:text>
|
369
|
-
<xsl:value-of select="$x1"/>
|
370
|
-
<xsl:text>",</xsl:text>
|
371
|
-
|
359
|
+
|
372
360
|
<xsl:text>"solr_geom": "ENVELOPE(</xsl:text>
|
373
361
|
<xsl:value-of select="$x1"/>
|
374
362
|
<xsl:text>, </xsl:text>
|
@@ -378,17 +366,7 @@
|
|
378
366
|
<xsl:text>, </xsl:text>
|
379
367
|
<xsl:value-of select="$y1"/>
|
380
368
|
<xsl:text>)",</xsl:text>
|
381
|
-
|
382
|
-
<xsl:text>"georss_box_s": "</xsl:text>
|
383
|
-
<xsl:value-of select="$y1"/>
|
384
|
-
<xsl:text> </xsl:text>
|
385
|
-
<xsl:value-of select="$x1"/>
|
386
|
-
<xsl:text> </xsl:text>
|
387
|
-
<xsl:value-of select="$y2"/>
|
388
|
-
<xsl:text> </xsl:text>
|
389
|
-
<xsl:value-of select="$x2"/>
|
390
|
-
<xsl:text>",</xsl:text>
|
391
|
-
|
369
|
+
|
392
370
|
<!-- content date: singular, or beginning date of range: YYYY -->
|
393
371
|
<xsl:choose>
|
394
372
|
<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() != ''">
|