adiwg-mdtranslator 1.3.0 → 1.4.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/.jsbeautifyrc +8 -0
  3. data/Rakefile +1 -3
  4. data/adiwg-mdtranslator.gemspec +2 -0
  5. data/bin/mdtranslator +2 -2
  6. data/lib/adiwg/mdtranslator.rb +2 -0
  7. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +6 -3
  8. data/lib/adiwg/mdtranslator/internal/module_geoFormat.rb +183 -190
  9. data/lib/adiwg/mdtranslator/internal/module_lineString.rb +18 -0
  10. data/lib/adiwg/mdtranslator/internal/module_point.rb +18 -0
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_contacts.rb +3 -1
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geographicElement.rb +18 -10
  13. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb +52 -0
  14. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_boundingBox.rb +54 -0
  15. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_browseGraphic.rb +66 -0
  16. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_citation.rb +125 -0
  17. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_contacts.rb +144 -0
  18. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_dateTime.rb +31 -0
  19. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_distributionInfo.rb +64 -0
  20. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_extent.rb +61 -0
  21. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geoCoordSystem.rb +50 -0
  22. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geoProperties.rb +91 -0
  23. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geographicElement.rb +161 -0
  24. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_metadata.rb +70 -0
  25. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_metadataInfo.rb +131 -0
  26. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_onlineResource.rb +71 -0
  27. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_resourceIdentifier.rb +73 -0
  28. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_resourceInfo.rb +437 -0
  29. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_responsibleParty.rb +53 -0
  30. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_sbJson.rb +52 -0
  31. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/version.rb +12 -0
  32. data/lib/adiwg/mdtranslator/readers/sbJson/readme.md +12 -0
  33. data/lib/adiwg/mdtranslator/readers/sbJson/sbJson_reader.rb +205 -0
  34. data/lib/adiwg/mdtranslator/readers/sbJson/sbJson_validator.rb +44 -0
  35. data/lib/adiwg/mdtranslator/version.rb +1 -2
  36. data/lib/adiwg/mdtranslator/writers/html/sections/html_browseGraphic.rb +2 -1
  37. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiGeometry.rb +5 -5
  38. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +1 -1
  39. data/lib/adiwg/mdtranslator/writers/mdJson/mdJson_writer.rb +42 -0
  40. data/lib/adiwg/mdtranslator/writers/mdJson/readme.md +19 -0
  41. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_additionalDoc.rb +19 -0
  42. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_address.rb +22 -0
  43. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_associatedResource.rb +22 -0
  44. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_attribute.rb +27 -0
  45. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_base.rb +19 -0
  46. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_citation.rb +33 -0
  47. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_constraint.rb +28 -0
  48. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb +31 -0
  49. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageInfo.rb +30 -0
  50. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageItem.rb +44 -0
  51. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQuality.rb +32 -0
  52. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dateTime.rb +18 -0
  53. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb +33 -0
  54. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_distributionInfo.rb +31 -0
  55. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_domain.rb +25 -0
  56. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb +37 -0
  57. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_extent.rb +26 -0
  58. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_format.rb +19 -0
  59. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_geographicElement.rb +81 -0
  60. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_graphicOverview.rb +20 -0
  61. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_gridInfo.rb +27 -0
  62. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_imageInfo.rb +28 -0
  63. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_keyword.rb +20 -0
  64. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_locale.rb +19 -0
  65. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadata.rb +30 -0
  66. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadataInfo.rb +36 -0
  67. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_onlineResource.rb +21 -0
  68. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_phone.rb +19 -0
  69. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_processStep.rb +25 -0
  70. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceIdentifier.rb +23 -0
  71. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceInfo.rb +69 -0
  72. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceMaintenance.rb +23 -0
  73. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_responsibleParty.rb +18 -0
  74. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialreference.rb +19 -0
  75. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxon.rb +19 -0
  76. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxonomy.rb +32 -0
  77. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_temporalElement.rb +38 -0
  78. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb +20 -0
  79. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_transferOption.rb +33 -0
  80. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_usage.rb +23 -0
  81. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_verticalElement.rb +20 -0
  82. data/lib/adiwg/mdtranslator/writers/mdJson/version.rb +13 -0
  83. data/lib/adiwg/mdtranslator/writers/sbJson/readme.md +12 -0
  84. data/lib/adiwg/mdtranslator/writers/sbJson/sbJson_writer.rb +126 -0
  85. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_base.rb +19 -0
  86. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_contact.rb +42 -0
  87. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_identifier.rb +22 -0
  88. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_spatial.rb +49 -0
  89. data/lib/adiwg/mdtranslator/writers/sbJson/version.rb +13 -0
  90. data/test/readers/mdJson/v1/tc_reader_mdjson_translation.rb +83 -0
  91. data/test/readers/sbJson/v0/tc_reader_sbjson_translation.rb +79 -0
  92. data/test/readers/sbJson/v0/test.json +431 -0
  93. data/test/readers/sbJson/v0/test1.json +383 -0
  94. data/test/writers/mdJson/v1/tc_writer_mdJson.rb +60 -0
  95. data/test/writers/sbJson/v0/tc_writer_sbJson.rb +60 -0
  96. metadata +121 -7
  97. data/test/readers/mdJson/v1/tc_translation_19115_2.rb +0 -67
@@ -0,0 +1,383 @@
1
+ {
2
+ "link": {
3
+ "rel": "self",
4
+ "url": "https://www.sciencebase.gov/catalog/item/54c9859ee4b0bbe8f557ec12"
5
+ },
6
+ "relatedItems": {
7
+ "link": {
8
+ "url": "https://www.sciencebase.gov/catalog/itemLinks?itemId=54c9859ee4b0bbe8f557ec12",
9
+ "rel": "related"
10
+ }
11
+ },
12
+ "id": "54c9859ee4b0bbe8f557ec12",
13
+ "title": "Extensive mapping of Bering Sea and Gulf of Alaska coastal change by Landsat time series analysis, 1972–2013",
14
+ "subTitle": "WALCC Coastal Change Assessment Landsat-derived data products",
15
+ "summary": "Changes to the coastline and to coastal features, such as spits, barrier islands, estuaries, tidal guts and lagoons were mapped for over 22,000 km of coastline along the Bering Sea and Gulf of Alaska coasts in western Alaska. Changes to rivers and lakes near the coast were also captured. The analysis was based on time-series analysis of Landsat imagery, 1972–2013. An annual time-series of suitable Landsat imagery was compiled and analyzed for changes in near-infrared reflectance to identify areas that transitioned from land to water, or vice-versa, over the study period. The timing of changes was also identified. Thousands of coastal changes over the 42-year study period exceeded the 60-m pixel resolution of the Multispectral Scanner [...]",
16
+ "body": "Changes to the coastline and to coastal features, such as spits, barrier islands, estuaries, tidal guts and lagoons were mapped for over 22,000 km of coastline along the Bering Sea and Gulf of Alaska coasts in western Alaska. Changes to rivers and lakes near the coast were also captured. The analysis was based on time-series analysis of Landsat imagery, 1972–2013. An annual time-series of suitable Landsat imagery was compiled and analyzed for changes in near-infrared reflectance to identify areas that transitioned from land to water, or vice-versa, over the study period. The timing of changes was also identified. Thousands of coastal changes over the 42-year study period exceeded the 60-m pixel resolution of the Multispectral Scanner (MSS) data, including coastal erosion and aggradation, estuarine and delta channel dynamics, coastal lake drainage and expansion, and migrations of coastal spits. An accuracy assessment determined that change patches &gt;5 ha were well mapped for the 1972–2013 time-series though coastal aggradation is somewhat overmapped in tidal flats. Coastal erosion was mapped for approximately 100 square km and coastal aggradation was mapped for approximately 113 square km, with coastal erosion and aggradation overall close to balanced. Many local hotspots of directional change (substantial and sustained coastal erosion or aggradation) were identified. The maps of coastal change produced in this effort could be used for local and regional analyses of vulnerability and coastal processes, and for identification of vulnerable natural and cultural resources. The results are summarized in these rasters by transition type (land to water transition, or water to land transition), coastal physiography class, and year.&nbsp; \n<br /> \n<br /> Results of the 1972–2013 change analysis are provided on an interactive map below. The online map data can also be accessed via other methods using links provided under the &quot;ArcGIS REST Service&quot; link below. To download the GIS data with the results of the analysis, and the Landsat composites compiled to support the analysis, follow the download links to the right.",
17
+ "purpose": "Changes to the coastline and to coastal features, such as spits, barrier islands, estuaries, tidal guts and lagoons were mapped for over 22,000 km of coastline along the Bering Sea and Gulf of Alaska coasts in western Alaska. Changes to rivers and lakes near the coast were also captured.",
18
+ "provenance": {
19
+ "dataSource": "Input directly",
20
+ "dateCreated": "2015-01-29T00:58:06Z",
21
+ "lastUpdated": "2015-06-22T17:08:46Z"
22
+ },
23
+ "hasChildren": true,
24
+ "parentId": "51438283e4b073a963ff6696",
25
+ "contacts": [{
26
+ "name": "ABR, Inc.—Environmental Research & Services",
27
+ "type": "Point of Contact",
28
+ "contactType": "person",
29
+ "email": "mmacander@abrinc.com",
30
+ "jobTitle": "Senior Scientist",
31
+ "organization": {},
32
+ "primaryLocation": {
33
+ "officePhone": "907-455-6777",
34
+ "streetAddress": {
35
+ "line1": "2842 Goldstream Rd",
36
+ "city": "Fairbanks",
37
+ "state": "AK",
38
+ "zip": "99709",
39
+ "country": "US"
40
+ },
41
+ "mailAddress": {}
42
+ }
43
+ }, {
44
+ "name": "ABR, Inc.—Environmental Research & Services",
45
+ "type": "Metadata Contact",
46
+ "contactType": "person",
47
+ "email": "mmacander@abrinc.com",
48
+ "jobTitle": "Senior Scientist",
49
+ "organization": {},
50
+ "primaryLocation": {
51
+ "officePhone": "907-455-6777",
52
+ "streetAddress": {
53
+ "line1": "2842 Goldstream Rd",
54
+ "city": "Fairbanks",
55
+ "state": "AK",
56
+ "zip": "99709",
57
+ "country": "US"
58
+ },
59
+ "mailAddress": {}
60
+ }
61
+ }, {
62
+ "name": "Matthew Macander, ABR, Inc.—Environmental Research & Services, Senior Scientist",
63
+ "type": "Originator",
64
+ "contactType": "person",
65
+ "organization": {},
66
+ "primaryLocation": {
67
+ "streetAddress": {},
68
+ "mailAddress": {}
69
+ }
70
+ }],
71
+ "webLinks": [{
72
+ "uri": "https://westernalaskalcc.org/projects/SitePages/WA2013_24.aspx",
73
+ "title": "Extensive Mappping of Coastal Change Project Page, WALCC\t",
74
+ "hidden": false
75
+ }, {
76
+ "uri": "http://www.abrinc.com/",
77
+ "title": "ABR, Inc. web page",
78
+ "hidden": false
79
+ }, {
80
+ "type": "pdf",
81
+ "typeLabel": "PDF Download",
82
+ "uri": "https://westernalaskalcc.org/projects/Lists/Project%20Products/Attachments/69/Extensive_Mapping_of_Coastal_Change_WALCC_1972-2013_Final_Report_web.pdf",
83
+ "title": "FINAL REPORT",
84
+ "hidden": false
85
+ }],
86
+ "browseCategories": ["Project", "Map", "Web Site", "Publication", "Data"],
87
+ "browseTypes": ["ArcGIS Service Definition", "Downloadable", "Map Service", "ArcGIS REST Map Service"],
88
+ "systemTypes": ["Folder", "Downloadable", "Mappable"],
89
+ "tags": [{
90
+ "type": "Label",
91
+ "scheme": "ISO 19115 Topic Categories",
92
+ "name": "imageryBaseMapsEarthCover"
93
+ }, {
94
+ "type": "Label",
95
+ "scheme": "None",
96
+ "name": "Alaska"
97
+ }, {
98
+ "type": "Label",
99
+ "scheme": "None",
100
+ "name": "Coast"
101
+ }, {
102
+ "type": "Label",
103
+ "scheme": "None",
104
+ "name": "Landsat"
105
+ }, {
106
+ "type": "Congressional Districts - 113th Session",
107
+ "scheme": "https://www.sciencebase.gov/vocab/category/Places/CongressionalDistricts/113thSession",
108
+ "name": "AK-00"
109
+ }, {
110
+ "type": "LCC Deliverable",
111
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/Deliverable",
112
+ "name": "Datasets/Database"
113
+ }, {
114
+ "type": "LCC Deliverable",
115
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/Deliverable",
116
+ "name": "Map"
117
+ }, {
118
+ "type": "LCC Deliverable",
119
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/Deliverable",
120
+ "name": "Report"
121
+ }, {
122
+ "type": "LCC Deliverable",
123
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/Deliverable",
124
+ "name": "Presentation"
125
+ }, {
126
+ "type": "LCC End User Type",
127
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/EnduserType",
128
+ "name": "Academics & scientific researchers"
129
+ }, {
130
+ "type": "LCC End User Type",
131
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/EnduserType",
132
+ "name": "Conservation NGOs"
133
+ }, {
134
+ "type": "LCC End User Type",
135
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/EnduserType",
136
+ "name": "Federal resource managers"
137
+ }, {
138
+ "type": "LCC End User Type",
139
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/EnduserType",
140
+ "name": "Interested public"
141
+ }, {
142
+ "type": "LCC End User Type",
143
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/EnduserType",
144
+ "name": "K-12 students & teachers"
145
+ }, {
146
+ "type": "LCC End User Type",
147
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/EnduserType",
148
+ "name": "Private land owners"
149
+ }, {
150
+ "type": "LCC End User Type",
151
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/EnduserType",
152
+ "name": "Regional & county planners"
153
+ }, {
154
+ "type": "LCC End User Type",
155
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/EnduserType",
156
+ "name": "Policy makers & regulators"
157
+ }, {
158
+ "type": "LCC End User Type",
159
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/EnduserType",
160
+ "name": "Tribes"
161
+ }, {
162
+ "type": "LCC Project Category",
163
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/ProjectCategory",
164
+ "name": "Vulnerability Assessment"
165
+ }, {
166
+ "type": "LCC Project Category",
167
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/ProjectCategory",
168
+ "name": "Decision Support"
169
+ }, {
170
+ "type": "LCC Project Category",
171
+ "scheme": "https://www.sciencebase.gov/vocab/category/LCC/ProjectCategory",
172
+ "name": "Data Management and Integration"
173
+ }, {
174
+ "type": "Community",
175
+ "scheme": "https://www.sciencebase.gov/vocab/category/NCCWSC/Project/OrganizationType",
176
+ "name": "LCC"
177
+ }, {
178
+ "type": "Organization",
179
+ "scheme": "https://www.sciencebase.gov/vocab/category/NCCWSC/Project/OrganizationName",
180
+ "name": "Western Alaska Landscape Conservation Cooperative"
181
+ }],
182
+ "dates": [{
183
+ "type": "Publication",
184
+ "dateString": "2015-01-28",
185
+ "label": "Publication Date"
186
+ }, {
187
+ "type": "Start",
188
+ "dateString": "1972-01-01",
189
+ "label": ""
190
+ }, {
191
+ "type": "End",
192
+ "dateString": "2012-12-31",
193
+ "label": ""
194
+ }],
195
+ "spatial": {
196
+ "boundingBox": {
197
+ "minX": -171.305496,
198
+ "maxX": -150.877746,
199
+ "minY": 53.862561,
200
+ "maxY": 67.373126
201
+ }
202
+ },
203
+ "facets": [{
204
+ "filePathUsed": "__disk__51/f3/6c/51f36ce788cc69bd4d706cbdc923be03d2e80bb5",
205
+ "boundingBox": {
206
+ "minY": 53.8625609466412,
207
+ "minX": -171.712481763164,
208
+ "maxY": 67.3731263300081,
209
+ "maxX": -150.349627768067
210
+ },
211
+ "processingState": "success",
212
+ "servicePath": "54c9859ee4b0bbe8f557ec12",
213
+ "processingMessage": "",
214
+ "name": "Western_Alaska_Coastal_Change_Results.sd",
215
+ "files": [{
216
+ "name": "Western_Alaska_Coastal_Change_Results.sd",
217
+ "title": "",
218
+ "contentType": "x-gis/x-arcgis-service-def",
219
+ "contentEncoding": null,
220
+ "pathOnDisk": "__disk__51/f3/6c/51f36ce788cc69bd4d706cbdc923be03d2e80bb5",
221
+ "processed": false,
222
+ "processToken": null,
223
+ "imageWidth": null,
224
+ "imageHeight": null,
225
+ "size": 275563812,
226
+ "dateUploaded": "2015-02-05T00:31:35Z",
227
+ "originalMetadata": true,
228
+ "useForPreview": false,
229
+ "s3Object": null,
230
+ "url": "https://www.sciencebase.gov/catalog/file/get/54c9859ee4b0bbe8f557ec12?f=__disk__51%2Ff3%2F6c%2F51f36ce788cc69bd4d706cbdc923be03d2e80bb5"
231
+ }, {
232
+ "name": "thumbnail.png",
233
+ "title": null,
234
+ "contentType": "image/png",
235
+ "contentEncoding": null,
236
+ "pathOnDisk": "__disk__4a/4e/d2/4a4ed2fd833dd6f6f01a9236a4af9f070367a87e",
237
+ "processed": null,
238
+ "processToken": null,
239
+ "imageWidth": 200,
240
+ "imageHeight": 133,
241
+ "size": 7725,
242
+ "dateUploaded": "2015-02-05T00:32:11Z",
243
+ "originalMetadata": null,
244
+ "useForPreview": null,
245
+ "s3Object": null,
246
+ "url": "https://www.sciencebase.gov/catalog/file/get/54c9859ee4b0bbe8f557ec12?f=__disk__4a%2F4e%2Fd2%2F4a4ed2fd833dd6f6f01a9236a4af9f070367a87e"
247
+ }],
248
+ "serviceId": "54c9859ee4b0bbe8f557ec12",
249
+ "className": "gov.sciencebase.catalog.item.facet.ServiceDefinitionFacet"
250
+ }, {
251
+ "projectProducts": [],
252
+ "parts": [],
253
+ "className": "gov.sciencebase.catalog.item.facet.ProjectFacet"
254
+ }],
255
+ "files": [{
256
+ "name": "transition_results_60m_fgdc_metadata.xml",
257
+ "title": "",
258
+ "contentType": "application/fgdc+xml",
259
+ "contentEncoding": null,
260
+ "pathOnDisk": "__disk__14/12/b5/1412b5a30e75870bbf6ce9780ff0f54fc66f5c4a",
261
+ "processed": false,
262
+ "processToken": null,
263
+ "imageWidth": null,
264
+ "imageHeight": null,
265
+ "size": 7837,
266
+ "dateUploaded": "2015-02-04T22:48:01Z",
267
+ "originalMetadata": true,
268
+ "useForPreview": false,
269
+ "s3Object": null,
270
+ "url": "https://www.sciencebase.gov/catalog/file/get/54c9859ee4b0bbe8f557ec12?f=__disk__14%2F12%2Fb5%2F1412b5a30e75870bbf6ce9780ff0f54fc66f5c4a"
271
+ }],
272
+ "distributionLinks": [{
273
+ "uri": "https://www.sciencebase.gov/arcgis/rest/services/Catalog/54c9859ee4b0bbe8f557ec12/MapServer",
274
+ "title": "ArcGIS REST Service",
275
+ "type": "serviceLink",
276
+ "typeLabel": "Service Link",
277
+ "rel": "alternate",
278
+ "name": "",
279
+ "files": ""
280
+ }, {
281
+ "uri": "https://www.sciencebase.gov/catalogMaps/mapping/ows/54c9859ee4b0bbe8f557ec12?mode=download&request=kml&service=wms&layers=childrenBoundingBox,children",
282
+ "title": "KML Service",
283
+ "type": "kml",
284
+ "typeLabel": "KML Download",
285
+ "rel": "alternate",
286
+ "name": "",
287
+ "files": ""
288
+ }, {
289
+ "uri": "https://www.sciencebase.gov/catalogMaps/mapping/ows/54c9859ee4b0bbe8f557ec12?service=wms&request=getcapabilities&version=1.3.0",
290
+ "title": "ScienceBase WMS Service",
291
+ "type": "serviceCapabilitiesUrl",
292
+ "typeLabel": "OGC Service Capabilities URL",
293
+ "rel": "alternate",
294
+ "name": "",
295
+ "files": ""
296
+ }, {
297
+ "uri": "https://www.sciencebase.gov/catalog/items?parentId=54c9859ee4b0bbe8f557ec12&format=json",
298
+ "title": "ScienceBase Collection JSON",
299
+ "type": "repo",
300
+ "typeLabel": "ScienceBase Repository",
301
+ "rel": "alternate",
302
+ "name": "",
303
+ "files": ""
304
+ }, {
305
+ "uri": "https://www.sciencebase.gov/catalog/items?parentId=54c9859ee4b0bbe8f557ec12&format=atom",
306
+ "title": "ScienceBase Collection ATOM",
307
+ "type": "repo",
308
+ "typeLabel": "ScienceBase Repository",
309
+ "rel": "alternate",
310
+ "name": "",
311
+ "files": ""
312
+ }, {
313
+ "uri": "https://www.sciencebase.gov/catalog/items?parentId=54c9859ee4b0bbe8f557ec12&format=csv",
314
+ "title": "ScienceBase Collection CSV",
315
+ "type": "repo",
316
+ "typeLabel": "ScienceBase Repository",
317
+ "rel": "alternate",
318
+ "name": "",
319
+ "files": ""
320
+ }, {
321
+ "uri": "https://www.sciencebase.gov/catalog/oai-pmh?verb=ListRecords&metadataPrefix=fgdc-orig&set=54c9859ee4b0bbe8f557ec12",
322
+ "title": "ScienceBase OAI PMH Service",
323
+ "type": "oai-pmh",
324
+ "typeLabel": "OAI-PMH",
325
+ "rel": "alternate",
326
+ "name": "",
327
+ "files": ""
328
+ }, {
329
+ "uri": "https://www.sciencebase.gov/catalog/item/54c9859ee4b0bbe8f557ec12/csw?service=CSW&version=2.0.2&request=GetRecords",
330
+ "title": "ScienceBase CSW Service",
331
+ "type": "csw",
332
+ "typeLabel": "",
333
+ "rel": "alternate",
334
+ "name": "",
335
+ "files": ""
336
+ }, {
337
+ "uri": "https://www.sciencebase.gov/catalog/file/get/54c9859ee4b0bbe8f557ec12",
338
+ "title": "Download Attached Files",
339
+ "type": "downloadLink",
340
+ "typeLabel": "Download Link",
341
+ "rel": "alternate",
342
+ "name": "Extensivemappin.zip",
343
+ "files": [{
344
+ "name": "Western_Alaska_Coastal_Change_Results.sd",
345
+ "title": "",
346
+ "contentType": "x-gis/x-arcgis-service-def"
347
+ }, {
348
+ "name": "thumbnail.png",
349
+ "title": null,
350
+ "contentType": "image/png"
351
+ }, {
352
+ "name": "transition_results_60m_fgdc_metadata.xml",
353
+ "title": "",
354
+ "contentType": "application/fgdc+xml"
355
+ }]
356
+ }],
357
+ "previewImage": {
358
+ "from": "mapPreview",
359
+ "original": {
360
+ "uri": "https://www.sciencebase.gov/catalog/file/get/54c9859ee4b0bbe8f557ec12?f=__disk__db%2F23%2F5a%2Fdb235a470cb706ced4b542ac072de247f12b17f9",
361
+ "viewUri": "https://www.sciencebase.gov/catalog/file/get/54c9859ee4b0bbe8f557ec12?f=__disk__db%2F23%2F5a%2Fdb235a470cb706ced4b542ac072de247f12b17f9&width=735&height=445",
362
+ "viewUrl": "https://www.sciencebase.gov/catalog/file/get/54c9859ee4b0bbe8f557ec12?f=__disk__db%2F23%2F5a%2Fdb235a470cb706ced4b542ac072de247f12b17f9&width=735&height=445",
363
+ "width": 735,
364
+ "height": 445,
365
+ "size": 419362
366
+ },
367
+ "thumbnail": {
368
+ "uri": "https://www.sciencebase.gov/catalog/file/get/54c9859ee4b0bbe8f557ec12?f=__disk__db%2F23%2F5a%2Fdb235a470cb706ced4b542ac072de247f12b17f9&width=150&height=91",
369
+ "width": 150,
370
+ "height": 91
371
+ },
372
+ "small": {
373
+ "uri": "https://www.sciencebase.gov/catalog/file/get/54c9859ee4b0bbe8f557ec12?f=__disk__db%2F23%2F5a%2Fdb235a470cb706ced4b542ac072de247f12b17f9&width=350&height=212",
374
+ "width": 350,
375
+ "height": 212
376
+ },
377
+ "medium": {
378
+ "uri": "https://www.sciencebase.gov/catalog/file/get/54c9859ee4b0bbe8f557ec12?f=__disk__db%2F23%2F5a%2Fdb235a470cb706ced4b542ac072de247f12b17f9&width=580&height=351",
379
+ "width": 580,
380
+ "height": 351
381
+ }
382
+ }
383
+ }
@@ -0,0 +1,60 @@
1
+ require 'minitest/autorun'
2
+ require 'json'
3
+ #require 'adiwg-mdtranslator'
4
+ require 'adiwg/mdtranslator/internal/internal_metadata_obj'
5
+ require 'adiwg/mdtranslator/readers/mdJson/mdJson_reader'
6
+ require 'adiwg/mdtranslator/writers/mdJson/mdJson_writer'
7
+
8
+ class Test_Write_mdJSONv1 < MiniTest::Test
9
+ @@reader = 'mdJson'
10
+ @@writer = 'mdJson'
11
+
12
+ def test_full_success
13
+ # get json file for tests from examples folder
14
+ file = File.join(File.dirname(__FILE__), '../../../', 'schemas/v1_0/examples', 'full_example.json')
15
+ file = File.open(file, 'r')
16
+ jsonObj = file.read
17
+ file.close
18
+
19
+ # call opening module in mdTranslator
20
+ metadata = ADIWG::Mdtranslator.translate(
21
+ file: jsonObj, reader: @@reader, validate: 'normal',
22
+ writer: @@writer, showAllTags: false)
23
+
24
+ version = JSON.parse(jsonObj)['version']['version'].split('.')
25
+
26
+
27
+ assert_equal('json', metadata[:readerFormat], 'Check reader name')
28
+ assert metadata[:readerStructurePass], metadata[:readerStructureMessages].join(',')
29
+ assert_equal(@@reader, metadata[:readerRequested])
30
+
31
+ # major version
32
+ assert_equal(version[0], metadata[:readerVersionUsed].split('.')[0])
33
+
34
+ assert metadata[:readerValidationPass], "reader validation failed: \n" + metadata[:readerValidationMessages].join(',')
35
+ assert_equal(@@writer, metadata[:writerName])
36
+ assert metadata[:writerPass], "writer validation failed: \n" + metadata[:writerMessages].join(',')
37
+ refute_nil metadata[:writerOutput]
38
+ end
39
+
40
+ def test_minimum_succes
41
+ # get json file for tests from examples folder
42
+ file = File.join(File.dirname(__FILE__), '../../../', 'schemas/v1_0/examples', 'minimum_example.json')
43
+ file = File.open(file, 'r')
44
+ jsonObj = file.read
45
+ file.close
46
+
47
+ # call opening module in mdTranslator
48
+ metadata = ADIWG::Mdtranslator.translate(
49
+ file: jsonObj, reader: @@reader, validate: 'normal',
50
+ writer: @@writer, showAllTags: true)
51
+
52
+ assert_equal('json', metadata[:readerFormat], 'Check reader name')
53
+ assert metadata[:readerStructurePass], metadata[:readerStructureMessages].join(',')
54
+ assert_equal(@@reader, metadata[:readerRequested])
55
+ assert metadata[:readerValidationPass], "reader validation failed: \n" + metadata[:readerValidationMessages].join(',')
56
+ assert_equal(@@writer, metadata[:writerName])
57
+ assert metadata[:writerPass], "writer validation failed: \n" + metadata[:writerMessages].join(',')
58
+ refute_nil metadata[:writerOutput]
59
+ end
60
+ end
@@ -0,0 +1,60 @@
1
+ require 'minitest/autorun'
2
+ require 'json'
3
+ #require 'adiwg-mdtranslator'
4
+ require 'adiwg/mdtranslator/internal/internal_metadata_obj'
5
+ require 'adiwg/mdtranslator/readers/mdJson/mdJson_reader'
6
+ require 'adiwg/mdtranslator/writers/sbJson/sbJson_writer'
7
+
8
+ class Test_Write_sbJSONv0 < MiniTest::Test
9
+ @@reader = 'mdJson'
10
+ @@writer = 'sbJson'
11
+
12
+ def test_full_success
13
+ # get json file for tests from examples folder
14
+ file = File.join(File.dirname(__FILE__), '../../../', 'schemas/v1_0/examples', 'full_example.json')
15
+ file = File.open(file, 'r')
16
+ jsonObj = file.read
17
+ file.close
18
+
19
+ # call opening module in mdTranslator
20
+ metadata = ADIWG::Mdtranslator.translate(
21
+ file: jsonObj, reader: @@reader, validate: 'normal',
22
+ writer: @@writer, showAllTags: false)
23
+
24
+ version = JSON.parse(jsonObj)['version']['version'].split('.')
25
+
26
+
27
+ assert_equal('json', metadata[:readerFormat], 'Check reader name')
28
+ assert metadata[:readerStructurePass], metadata[:readerStructureMessages].join(',')
29
+ assert_equal(@@reader, metadata[:readerRequested])
30
+
31
+ # major version
32
+ assert_equal(version[0], metadata[:readerVersionUsed].split('.')[0])
33
+
34
+ assert metadata[:readerValidationPass], "reader validation failed: \n" + metadata[:readerValidationMessages].join(',')
35
+ assert_equal(@@writer, metadata[:writerName])
36
+ assert metadata[:writerPass], "writer validation failed: \n" + metadata[:writerMessages].join(',')
37
+ refute_nil metadata[:writerOutput]
38
+ end
39
+
40
+ def test_minimum_succes
41
+ # get json file for tests from examples folder
42
+ file = File.join(File.dirname(__FILE__), '../../../', 'schemas/v1_0/examples', 'minimum_example.json')
43
+ file = File.open(file, 'r')
44
+ jsonObj = file.read
45
+ file.close
46
+
47
+ # call opening module in mdTranslator
48
+ metadata = ADIWG::Mdtranslator.translate(
49
+ file: jsonObj, reader: @@reader, validate: 'normal',
50
+ writer: @@writer, showAllTags: true)
51
+
52
+ assert_equal('json', metadata[:readerFormat], 'Check reader name')
53
+ assert metadata[:readerStructurePass], metadata[:readerStructureMessages].join(',')
54
+ assert_equal(@@reader, metadata[:readerRequested])
55
+ assert metadata[:readerValidationPass], "reader validation failed: \n" + metadata[:readerValidationMessages].join(',')
56
+ assert_equal(@@writer, metadata[:writerName])
57
+ assert metadata[:writerPass], "writer validation failed: \n" + metadata[:writerMessages].join(',')
58
+ refute_nil metadata[:writerOutput]
59
+ end
60
+ end