adiwg-mdtranslator 0.8.6 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.gitmodules +2 -2
  4. data/adiwg-mdtranslator.gemspec +3 -2
  5. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +13 -1
  6. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_additionalDocumentation.rb +36 -0
  7. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_address.rb +0 -0
  8. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_associatedResource.rb +12 -3
  9. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_boundingBox.rb +0 -0
  10. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_browseGraphic.rb +0 -0
  11. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_citation.rb +0 -0
  12. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_contacts.rb +0 -0
  13. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_coordinates.rb +0 -0
  14. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_dataQuality.rb +0 -0
  15. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_dateTime.rb +0 -0
  16. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_descriptiveKeyword.rb +0 -0
  17. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_distributionInfo.rb +0 -0
  18. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_extent.rb +0 -0
  19. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_geoCoordSystem.rb +0 -0
  20. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_geoProperties.rb +0 -0
  21. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_geographicElement.rb +0 -0
  22. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_legalConstraint.rb +0 -0
  23. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_lineString.rb +0 -0
  24. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_lineage.rb +0 -0
  25. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_metadata.rb +5 -4
  26. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_metadataExtension.rb +0 -0
  27. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_metadataInfo.rb +1 -8
  28. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_onlineResource.rb +0 -0
  29. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_phone.rb +0 -0
  30. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_point.rb +0 -0
  31. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_polygon.rb +0 -0
  32. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_processStep.rb +0 -0
  33. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_resolution.rb +0 -0
  34. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_resourceFormat.rb +0 -0
  35. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_resourceIdentifier.rb +0 -0
  36. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_resourceInfo.rb +19 -0
  37. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_resourceMaintenance.rb +0 -0
  38. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_resourceSpecificUsage.rb +0 -0
  39. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_responsibleParty.rb +0 -0
  40. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_securityConstraint.rb +0 -0
  41. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_source.rb +0 -0
  42. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_spatialReference.rb +0 -0
  43. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_taxonClass.rb +0 -0
  44. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_taxonomy.rb +0 -0
  45. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_temporalElement.rb +0 -0
  46. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_timeInstant.rb +0 -0
  47. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_timePeriod.rb +0 -0
  48. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_verticalElement.rb +0 -0
  49. data/lib/adiwg/mdtranslator/readers/adiwgJson/{modules_0.8.0 → modules_0.9.0}/module_voucher.rb +0 -0
  50. data/lib/adiwg/mdtranslator/version.rb +4 -1
  51. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_aggregateInformation.rb +3 -1
  52. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +20 -1
  53. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extent.rb +0 -2
  54. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_metadata.rb +8 -12
  55. data/test/tc_translation.rb +3 -3
  56. metadata +50 -57
  57. data/test/adiwgJson_template.json +0 -977
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33d88910886287dc0c89238e8beba62d7871315f
4
- data.tar.gz: 8c50527b56e4bce5d5b130f1f767ab3e30d18877
3
+ metadata.gz: 010b1cbf2339294147a58e5b78ded88b4df91be5
4
+ data.tar.gz: 8364931e9e108a14613fc714c32062e6c76f068c
5
5
  SHA512:
6
- metadata.gz: 8b4d1d298a11e19eb17e928f1e4b0cae68e28f8792117f6f01a1db7fbcd1e06a7a6c9e8bb6c9366e8102747f6669184a76f170431b9d5d53c32dfb48d060e323
7
- data.tar.gz: f6dbbfe2083d67f9963c61f87cead13a9b6b35ae877c476631ae8cd82f03c6d93d7e6e3cf4e6a1cd0dd246ef8990a3044daabd7c2d2845e61cb0f5fdcf7989d9
6
+ metadata.gz: 31f1fb5def4ba901a6c029f785c6c30d551e9e1e5a66aaaac3b7484d0bfbcfb78f47ee813997fd09d81a2193c7b626102712c2bb9b5b1a97daef9333509ac42a
7
+ data.tar.gz: d941add4d9e083587fd7fb800b2bb828373022ae9920343d59278357fcc91ab0fc0070e5e196036b0c47adad33a06bfe7db24f5a0b59d6c06f2d0924c9c066b1
data/.gitignore CHANGED
@@ -17,6 +17,7 @@ test/tmp
17
17
  test/version_tmp
18
18
  test/adiwgJson_full_test_example.json
19
19
  test/adiwgJson_min_test_example.json
20
+ test/adiwgJson_template_data.json
20
21
  test/dev.rb
21
22
  tmp
22
23
  *.bundle
@@ -1,3 +1,3 @@
1
- [submodule "test/schemas/v0_8"]
2
- path = test/schemas/v0_8
1
+ [submodule "test/schemas/v0_9"]
2
+ path = test/schemas/v0_9
3
3
  url = https://github.com/adiwg/adiwg-json-schemas.git
@@ -1,6 +1,7 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
4
5
  require 'adiwg/mdtranslator/version'
5
6
 
6
7
  Gem::Specification.new do |spec|
@@ -26,6 +27,6 @@ Gem::Specification.new do |spec|
26
27
  spec.add_runtime_dependency "builder", "~>3.2"
27
28
  spec.add_runtime_dependency "thor", "~>0.19"
28
29
  spec.add_runtime_dependency "uuidtools", "~>2.1"
29
- spec.add_runtime_dependency "json-schema", "~>2.2"
30
- spec.add_runtime_dependency "adiwg-json_schemas", "~>0.8"
30
+ spec.add_runtime_dependency "json-schema", "~>2.4"
31
+ spec.add_runtime_dependency "adiwg-json_schemas", "~>0.9"
31
32
  end
@@ -42,6 +42,9 @@
42
42
  # Stan Smith 2014-05-28 modified resourceId & responsibleParty for schema 0.5.0
43
43
  # Stan Smith 2014-08-15 modified citation, onlineResource, resourceId for 0.6.0
44
44
  # Stan Smith 2014-09-03 added spatialReferenceSystems for name, EPSG, and WKT for 0.6.0
45
+ # Stan Smith 2014-11-06 added resourceType to resourceInfo for 0.9.0
46
+ # Stan Smith 2014-11-06 removed metadataScope from metadataInfo for 0.9.0
47
+ # Stan Smith 2014-11-06 added newAdditionalDocumentation
45
48
 
46
49
  class InternalMetadata
47
50
 
@@ -117,7 +120,6 @@ class InternalMetadata
117
120
  intObj = {
118
121
  metadataId: {},
119
122
  parentMetadata: {},
120
- metadataScope: [],
121
123
  metadataCustodians: [],
122
124
  metadataCreateDate: {},
123
125
  metadataUpdateDate: {},
@@ -147,7 +149,9 @@ class InternalMetadata
147
149
 
148
150
  def newResourceInfo
149
151
  intObj = {
152
+ resourceType: nil,
150
153
  citation: {},
154
+ timePeriod: {},
151
155
  abstract: nil,
152
156
  shortAbstract: nil,
153
157
  hasMapLocation?: nil,
@@ -490,10 +494,18 @@ class InternalMetadata
490
494
  def newAssociatedResource
491
495
  intObj = {
492
496
  associationType: nil,
497
+ initiativeType: nil,
493
498
  resourceType: nil,
494
499
  resourceCitation: {},
495
500
  metadataCitation: {}
496
501
  }
497
502
  end
498
503
 
504
+ def newAdditionalDocumentation
505
+ intObj = {
506
+ resourceType: nil,
507
+ citation: {}
508
+ }
509
+ end
510
+
499
511
  end
@@ -0,0 +1,36 @@
1
+ # unpack additional doucmentation
2
+ # Reader - ADIwg JSON V1 to internal data structure
3
+
4
+ # History:
5
+ # Stan Smith 2014-11-06 original script
6
+
7
+ require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
8
+
9
+ module Adiwg_AdditionalDocumentation
10
+
11
+ def self.unpack(hAddDoc)
12
+
13
+ # instance classes needed in script
14
+ intMetadataClass = InternalMetadata.new
15
+ intAddDoc = intMetadataClass.newAssociatedResource
16
+
17
+ # associated resource - resource type
18
+ if hAddDoc.has_key?('resourceType')
19
+ s = hAddDoc['resourceType']
20
+ if s != ''
21
+ intAddDoc[:resourceType] = s
22
+ end
23
+ end
24
+
25
+ # associated resource - resource citation
26
+ if hAddDoc.has_key?('citation')
27
+ hCitation = hAddDoc['citation']
28
+ unless hCitation.empty?
29
+ intAddDoc[:citation] = Adiwg_Citation.unpack(hCitation)
30
+ end
31
+ end
32
+
33
+ return intAddDoc
34
+ end
35
+
36
+ end
@@ -7,9 +7,10 @@
7
7
  # Stan Smith 2014-06-02 added resource metadata citation section
8
8
  # Stan Smith 2014-07-08 resolve require statements using Mdtranslator.reader_module
9
9
  # Stan Smith 2014-08-18 moved resourceIdentifier to citation module schema 0.6.0
10
+ # Stan Smith 2014-11-06 changed resourceType to initiative type for 0.9.0
11
+ # Stan Smith 2014-11-06 added resourceType for 0.9.0
10
12
 
11
13
  require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
12
- require ADIWG::Mdtranslator.reader_module('module_resourceIdentifier', $response[:readerVersionUsed])
13
14
 
14
15
  module Adiwg_AssociatedResource
15
16
 
@@ -19,7 +20,7 @@ module Adiwg_AssociatedResource
19
20
  intMetadataClass = InternalMetadata.new
20
21
  intAssocRes = intMetadataClass.newAssociatedResource
21
22
 
22
- # associated resource - resource type - initiativeTypeCode
23
+ # associated resource - association type
23
24
  if hAssocRes.has_key?('associationType')
24
25
  s = hAssocRes['associationType']
25
26
  if s != ''
@@ -27,7 +28,15 @@ module Adiwg_AssociatedResource
27
28
  end
28
29
  end
29
30
 
30
- # associated resource - association type - associationTypeCode
31
+ # associated resource - initiative type
32
+ if hAssocRes.has_key?('initiativeType')
33
+ s = hAssocRes['initiativeType']
34
+ if s != ''
35
+ intAssocRes[:initiativeType] = s
36
+ end
37
+ end
38
+
39
+ # associated resource - resource type
31
40
  if hAssocRes.has_key?('resourceType')
32
41
  s = hAssocRes['resourceType']
33
42
  if s != ''
@@ -17,6 +17,7 @@ require ADIWG::Mdtranslator.reader_module('module_metadataInfo', $response[:read
17
17
  require ADIWG::Mdtranslator.reader_module('module_resourceInfo', $response[:readerVersionUsed])
18
18
  require ADIWG::Mdtranslator.reader_module('module_distributionInfo', $response[:readerVersionUsed])
19
19
  require ADIWG::Mdtranslator.reader_module('module_associatedResource', $response[:readerVersionUsed])
20
+ require ADIWG::Mdtranslator.reader_module('module_additionalDocumentation', $response[:readerVersionUsed])
20
21
  require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
21
22
 
22
23
  module Adiwg_Metadata
@@ -61,10 +62,10 @@ module Adiwg_Metadata
61
62
 
62
63
  # metadata - additional documents
63
64
  if hMetadata.has_key?('additionalDocumentation')
64
- aCitation = hMetadata['additionalDocumentation']
65
- unless aCitation.empty?
66
- aCitation.each do |hCitation|
67
- intMetadata[:additionalDocuments] << Adiwg_Citation.unpack(hCitation)
65
+ aAddDocs = hMetadata['additionalDocumentation']
66
+ unless aAddDocs.empty?
67
+ aAddDocs.each do |hAddDoc|
68
+ intMetadata[:additionalDocuments] << Adiwg_AdditionalDocumentation.unpack(hAddDoc)
68
69
  end
69
70
  end
70
71
  end
@@ -6,6 +6,7 @@
6
6
  # Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
7
7
  # Stan Smith 2014-09-19 changed metadata identifier type resource identifier json 0.8.0
8
8
  # Stan Smith 2014-09-19 changed parent metadata identifier type citation json 0.8.0
9
+ # Stan Smith 2014-11-06 removed metadataScope, moved to resourceType under resourceInfo json 0.9.0
9
10
 
10
11
  require ADIWG::Mdtranslator.reader_module('module_responsibleParty', $response[:readerVersionUsed])
11
12
  require ADIWG::Mdtranslator.reader_module('module_dateTime', $response[:readerVersionUsed])
@@ -39,14 +40,6 @@ module Adiwg_MetadataInfo
39
40
  end
40
41
  end
41
42
 
42
- # metadata - scope - from codeList
43
- if hMetadataInfo.has_key?('metadataScope')
44
- aMetadataScope = hMetadataInfo['metadataScope']
45
- unless aMetadataScope.empty?
46
- intMetadataInfo[:metadataScope] = aMetadataScope
47
- end
48
- end
49
-
50
43
  # metadata - metadata contacts, custodians
51
44
  if hMetadataInfo.has_key?('metadataContact')
52
45
  aCust = hMetadataInfo['metadataContact']
@@ -13,6 +13,8 @@
13
13
  # Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
14
14
  # Stan Smith 2014-08-18 moved resourceIdentifier to citation module schema 0.6.0
15
15
  # Stan Smith 2014-09-03 added spatial reference system module for 0.7.0
16
+ # Stan Smith 2014-10-29 added support for resource time period
17
+ # Stan Smith 2014-11-06 added resourceType for 0.9.0
16
18
 
17
19
  require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
18
20
  require ADIWG::Mdtranslator.reader_module('module_resourceIdentifier', $response[:readerVersionUsed])
@@ -29,6 +31,7 @@ require ADIWG::Mdtranslator.reader_module('module_resolution', $response[:reader
29
31
  require ADIWG::Mdtranslator.reader_module('module_extent', $response[:readerVersionUsed])
30
32
  require ADIWG::Mdtranslator.reader_module('module_dataQuality', $response[:readerVersionUsed])
31
33
  require ADIWG::Mdtranslator.reader_module('module_spatialReference', $response[:readerVersionUsed])
34
+ require ADIWG::Mdtranslator.reader_module('module_timePeriod', $response[:readerVersionUsed])
32
35
 
33
36
  module Adiwg_ResourceInfo
34
37
 
@@ -38,6 +41,14 @@ module Adiwg_ResourceInfo
38
41
  intMetadataClass = InternalMetadata.new
39
42
  intResInfo = intMetadataClass.newResourceInfo
40
43
 
44
+ # resource information - resource type
45
+ if hResourceInfo.has_key?('resourceType')
46
+ s = hResourceInfo['resourceType']
47
+ if s != ''
48
+ intResInfo[:resourceType] = s
49
+ end
50
+ end
51
+
41
52
  # resource information - citation
42
53
  if hResourceInfo.has_key?('citation')
43
54
  hCitation = hResourceInfo['citation']
@@ -46,6 +57,14 @@ module Adiwg_ResourceInfo
46
57
  end
47
58
  end
48
59
 
60
+ # resource information - resource time period
61
+ if hResourceInfo.has_key?('resourceTimePeriod')
62
+ hResPeriod = hResourceInfo['resourceTimePeriod']
63
+ unless hResPeriod.empty?
64
+ intResInfo[:timePeriod] = Adiwg_TimePeriod.unpack(hResPeriod)
65
+ end
66
+ end
67
+
49
68
  # resource information - point of contact
50
69
  if hResourceInfo.has_key?('pointOfContact')
51
70
  aPOC = hResourceInfo['pointOfContact']
@@ -14,11 +14,14 @@
14
14
  # ... block in the input.
15
15
  # 0.8.5 2014-10-11 added methods to pass content of readme files
16
16
  # 0.8.6 2014-10-15 added cli option to return entire content mdTranslator response
17
+ # 0.8.7 2014-10-29 added support for resource time period
18
+ # 0.9.0 2014-11-06 added resourceType to associatedResource and additionalInformation
19
+ # ... moved resourceType from metadataInfo to resourceInfo in json
17
20
 
18
21
  module ADIWG
19
22
  module Mdtranslator
20
23
  # current mdtranslator version
21
- VERSION = "0.8.6"
24
+ VERSION = "0.9.0"
22
25
  end
23
26
  end
24
27
 
@@ -4,6 +4,8 @@
4
4
  # History:
5
5
  # Stan Smith 2014-05-29 original script
6
6
  # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
7
+ # Stan Smith 2014-11-06 take initiativeType from internal initiativeType
8
+ # ... rather than resourceType for 0.9.0
7
9
 
8
10
  require 'code_associationType'
9
11
  require 'code_initiativeType'
@@ -52,7 +54,7 @@ class MD_AggregateInformation
52
54
  end
53
55
 
54
56
  # aggregate information - initiative type
55
- s = hAssocRes[:resourceType]
57
+ s = hAssocRes[:initiativeType]
56
58
  if !s.nil?
57
59
  @xml.tag!('gmd:initiativeType') do
58
60
  initCode.writeXML(s)
@@ -13,6 +13,7 @@
13
13
  # Stan Smith 2014-05-15 modify to support JSON schema version 0.4.0
14
14
  # Stan Smith 2014-05-21 added aggregate information section
15
15
  # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
16
+ # Stan Smith 2014-10-29 add resource time period as a extent temporal element
16
17
 
17
18
  require 'code_progress'
18
19
  require 'code_topicCategory'
@@ -46,6 +47,7 @@ class MD_DataIdentification
46
47
  topicCode = MD_TopicCategoryCode.new(@xml)
47
48
 
48
49
  # classes used by MD_Metadata
50
+ intMetadataClass = InternalMetadata.new
49
51
  citationClass = CI_Citation.new(@xml)
50
52
  rPartyClass = CI_ResponsibleParty.new(@xml)
51
53
  mInfoClass = MD_MaintenanceInformation.new(@xml)
@@ -310,6 +312,23 @@ class MD_DataIdentification
310
312
  end
311
313
 
312
314
  # data identification - extent
315
+ # if resource time period, represent the time period as
316
+ # a temporal element in the first extent
317
+ needTag = true
318
+ hTimePeriod = hDataId[:timePeriod]
319
+ if !hTimePeriod.empty?
320
+ hTempEle = intMetadataClass.newTemporalElement
321
+ hTempEle[:timePeriod] = hTimePeriod
322
+ hExt = intMetadataClass.newExtent
323
+ hExt[:extDesc] = 'Temporal span of the resource (data or project)'
324
+ hExt[:extTempElements] << hTempEle
325
+ @xml.tag!('gmd:extent') do
326
+ extentClass.writeXML(hExt)
327
+ end
328
+ needTag = false
329
+ end
330
+
331
+ # add the remaining geographic, temporal, and veritcal extents
313
332
  aExtents = hDataId[:extents]
314
333
  if !aExtents.empty?
315
334
  aExtents.each do |hExtent|
@@ -317,7 +336,7 @@ class MD_DataIdentification
317
336
  extentClass.writeXML(hExtent)
318
337
  end
319
338
  end
320
- elsif $showAllTags
339
+ elsif $showAllTags && needTag
321
340
  @xml.tag!('gmd:extent')
322
341
  end
323
342
 
@@ -60,8 +60,6 @@ class EX_Extent
60
60
  geoEleIdClass.writeXML(hGeoElement)
61
61
  end
62
62
  end
63
- elsif $showAllTags
64
- @xml.tag!('gmd:geographicElement')
65
63
  end
66
64
 
67
65
  # extent - temporal element
@@ -21,6 +21,7 @@
21
21
  # ... metadata: {resourceInfo: {citation: {citOlResources[0]: {olResURI:}}}}
22
22
  # Stan Smith 2014-10-10 modified to pass minimum metadata input test
23
23
  # ... test were added to handle a missing metadata > metadataInfo block in the input
24
+ # Stan Smith 2014-11-06 changed hierarchy level to load values from resourceInfo > resourceType
24
25
 
25
26
  require 'code_characterSet'
26
27
  require 'code_scope'
@@ -137,21 +138,16 @@ class MI_Metadata
137
138
  @xml.tag!('gmd:parentIdentifier')
138
139
  end
139
140
 
140
- # metadata information - file hierarchy - defaults to 'dataset'
141
+ # metadata information - hierarchy level - defaults to 'dataset',
142
+ # values taken from resourceInfo > resourceType
141
143
  fileHierarchy = false
142
- if hMetaInfo
143
- if hMetaInfo[:metadataScope]
144
- aHierarchy = hMetaInfo[:metadataScope]
145
- unless aHierarchy.empty?
146
- fileHierarchy = true
147
- aHierarchy.each do |hierarchy|
148
- @xml.tag!('gmd:hierarchyLevel') do
149
- scopeCode.writeXML(hierarchy)
150
- end
151
- end
144
+ s = hResInfo[:resourceType]
145
+ if s != ''
146
+ fileHierarchy = true
147
+ @xml.tag!('gmd:hierarchyLevel') do
148
+ scopeCode.writeXML(s)
152
149
  end
153
150
  end
154
- end
155
151
  if !fileHierarchy
156
152
  @xml.tag!('gmd:hierarchyLevel') do
157
153
  scopeCode.writeXML('dataset')