adiwg-mdtranslator 2.13.0 → 2.13.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +26 -14
  3. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +1 -0
  4. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dateTime.rb +56 -41
  5. data/lib/adiwg/mdtranslator/readers/fgdc/version.rb +3 -1
  6. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +1 -0
  7. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader_messages_eng.yml +377 -0
  8. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_additionalDocumentation.rb +6 -8
  9. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_address.rb +6 -6
  10. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_allocation.rb +6 -7
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_associatedResource.rb +7 -11
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_attribute.rb +12 -13
  13. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_attributeGroup.rb +10 -6
  14. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_bearingDistanceResolution.rb +11 -21
  15. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_boundingBox.rb +18 -38
  16. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_citation.rb +10 -8
  17. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_constraint.rb +22 -28
  18. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contact.rb +17 -18
  19. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contactPostprocess.rb +5 -3
  20. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coordinateResolution.rb +9 -15
  21. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageDescription.rb +6 -8
  22. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataDictionary.rb +8 -13
  23. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_date.rb +8 -12
  24. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dateTime.rb +6 -6
  25. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dimension.rb +7 -11
  26. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_distribution.rb +6 -5
  27. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_distributor.rb +17 -8
  28. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domain.rb +12 -12
  29. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domainItem.rb +9 -13
  30. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_duration.rb +6 -6
  31. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entity.rb +14 -12
  32. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +20 -19
  33. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityForeignKey.rb +8 -15
  34. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityIndex.rb +7 -10
  35. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_extent.rb +12 -10
  36. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_featureCollection.rb +8 -13
  37. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_format.rb +10 -7
  38. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_funding.rb +8 -6
  39. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geoJson.rb +8 -3
  40. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geodetic.rb +11 -8
  41. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geographicExtent.rb +12 -10
  42. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geographicResolution.rb +10 -13
  43. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geologicAge.rb +11 -10
  44. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryCollection.rb +8 -12
  45. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryFeature.rb +8 -12
  46. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryObject.rb +7 -12
  47. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryProperties.rb +4 -2
  48. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georectifiedRepresentation.rb +13 -20
  49. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georeferenceableRepresentation.rb +12 -14
  50. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_gmlIdentifier.rb +8 -8
  51. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_graphic.rb +6 -6
  52. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_gridRepresentation.rb +12 -13
  53. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_identifier.rb +10 -7
  54. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_imageDescription.rb +9 -3
  55. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_keyword.rb +8 -6
  56. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_keywordObject.rb +6 -5
  57. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_legalConstraint.rb +6 -6
  58. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_lineage.rb +10 -10
  59. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_locale.rb +7 -9
  60. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_maintenance.rb +12 -10
  61. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_mdJson.rb +59 -17
  62. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_measure.rb +9 -16
  63. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_medium.rb +10 -5
  64. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadata.rb +6 -9
  65. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadataInfo.rb +16 -16
  66. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadataRepository.rb +8 -6
  67. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_obliqueLinePoint.rb +7 -12
  68. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_onlineResource.rb +6 -6
  69. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_orderProcess.rb +5 -3
  70. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_party.rb +25 -28
  71. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_phone.rb +7 -7
  72. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_processStep.rb +15 -12
  73. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +11 -10
  74. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_referenceSystemParameters.rb +12 -11
  75. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_releasability.rb +10 -8
  76. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +29 -40
  77. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb +6 -6
  78. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceUsage.rb +5 -5
  79. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_responsibleParty.rb +12 -11
  80. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb +6 -9
  81. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_scope.rb +11 -8
  82. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_scopeDescription.rb +6 -7
  83. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_securityConstraint.rb +6 -6
  84. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb +5 -3
  85. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +15 -13
  86. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialReference.rb +10 -9
  87. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialRepresentation.rb +14 -11
  88. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialResolution.rb +14 -10
  89. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicClassification.rb +8 -15
  90. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicSystem.rb +5 -5
  91. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +7 -11
  92. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_temporalExtent.rb +12 -9
  93. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timeInstant.rb +12 -9
  94. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timeInterval.rb +9 -13
  95. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timePeriod.rb +22 -26
  96. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_transferOption.rb +13 -9
  97. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_valueRange.rb +7 -9
  98. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_vectorObject.rb +6 -6
  99. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_vectorRepresentation.rb +12 -10
  100. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalDatum.rb +10 -8
  101. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalExtent.rb +12 -13
  102. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_voucher.rb +10 -10
  103. data/lib/adiwg/mdtranslator/version.rb +8 -3
  104. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialOrganization.rb +78 -84
  105. data/lib/adiwg/mdtranslator/writers/html/sections/html_responsibility.rb +3 -3
  106. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +23 -14
  107. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer_messages_eng.yml +2 -1
  108. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +10 -2
  109. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_date.rb +1 -0
  110. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb +1 -1
  111. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_geographicExtent.rb +1 -1
  112. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_mdJson.rb +5 -5
  113. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_medium.rb +1 -1
  114. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_party.rb +1 -5
  115. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_repository.rb +4 -2
  116. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_verticalDatumParameters.rb +1 -0
  117. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_citation.rb +11 -11
  118. metadata +4 -3
@@ -34,16 +34,16 @@ module ADIWG
34
34
  # mdJson - metadata (required)
35
35
  json.metadata Metadata.build(intObj[:metadata])
36
36
 
37
- # mdJson - dataDictionaries []
38
- unless intObj[:dataDictionaries].empty?
39
- json.dataDictionary intObj[:dataDictionaries].map { |obj| Dictionary.build(obj).attributes! }
40
- end
41
-
42
37
  # mdJson - metadataRepositories []
43
38
  unless intObj[:metadataRepositories].empty?
44
39
  json.metadataRepository intObj[:metadataRepositories].map { |obj| Repository.build(obj).attributes! }
45
40
  end
46
41
 
42
+ # mdJson - dataDictionaries []
43
+ unless intObj[:dataDictionaries].empty?
44
+ json.dataDictionary intObj[:dataDictionaries].map { |obj| Dictionary.build(obj).attributes! }
45
+ end
46
+
47
47
  end
48
48
 
49
49
  end # build
@@ -1,7 +1,7 @@
1
1
  # mdJson 2.0 writer - medium
2
2
 
3
3
  # History:
4
- # Stan Smith 2017-03-20 original script
4
+ # Stan Smith 2017-03-20 original script
5
5
 
6
6
  require 'jbuilder'
7
7
  require_relative 'mdJson_citation'
@@ -16,11 +16,7 @@ module ADIWG
16
16
 
17
17
  Jbuilder.new do |json|
18
18
  json.contactId hParty[:contactId]
19
- aOrgs = []
20
- hParty[:organizationMembers].each do |hOrg|
21
- aOrgs << hOrg[:contactId]
22
- end
23
- json.organizationMembers aOrgs unless aOrgs.empty?
19
+ json.organizationMembers hParty[:organizationMembers] unless hParty[:organizationMembers].empty?
24
20
  end
25
21
 
26
22
  end # build
@@ -1,10 +1,11 @@
1
1
  # mdJson 2.0 writer - metadataRepository
2
2
 
3
3
  # History:
4
- # Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0
5
- # Josh Bradley original script
4
+ # Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0
5
+ # Josh Bradley original script
6
6
 
7
7
  require 'jbuilder'
8
+ require_relative 'mdJson_citation'
8
9
 
9
10
  module ADIWG
10
11
  module Mdtranslator
@@ -18,6 +19,7 @@ module ADIWG
18
19
  Jbuilder.new do |json|
19
20
  json.repository hRepository[:repository]
20
21
  json.metadataStandard hRepository[:metadataStandard]
22
+ json.citation Citation.build(hRepository[:citation]) unless hRepository[:citation].empty?
21
23
  end
22
24
 
23
25
  end # build
@@ -17,6 +17,7 @@ module ADIWG
17
17
 
18
18
  Jbuilder.new do |json|
19
19
  json.datumIdentifier Identifier.build(hDatum[:datumIdentifier]) unless hDatum[:datumIdentifier].empty?
20
+ json.datumName hDatum[:datumName]
20
21
  json.encodingMethod hDatum[:encodingMethod]
21
22
  json.isDepthSystem hDatum[:isDepthSystem]
22
23
  json.verticalResolution hDatum[:verticalResolution]
@@ -23,29 +23,29 @@ module ADIWG
23
23
  citation = ''
24
24
 
25
25
  # names
26
- aIndexes = []
26
+ aParties = []
27
27
  hCitation[:responsibleParties].each do |hResponsibility|
28
28
  role = hResponsibility[:roleName]
29
29
  hResponsibility[:parties].each do |hParty|
30
30
  party = {}
31
31
  party[:role] = role
32
- party[:index] = hParty[:contactIndex]
33
- aIndexes << party
34
- hParty[:organizationMembers].each do |hMember|
32
+ party[:contactId] = hParty[:contactId]
33
+ aParties << party
34
+ hParty[:organizationMembers].each do |memberId|
35
35
  party = {}
36
36
  party[:role] = role
37
- party[:index] = hMember[:contactIndex]
38
- aIndexes << party
37
+ party[:contactId] = memberId
38
+ aParties << party
39
39
  end
40
40
  end
41
41
  end
42
- aIndexes.uniq!
43
- aIndexes.each do |hIndex|
44
- hContact = ADIWG::Mdtranslator::Writers::SbJson.get_contact_by_index(hIndex[:index])
42
+ aParties.uniq!
43
+ aParties.each do |hParty|
44
+ hContact = ADIWG::Mdtranslator::Writers::SbJson.get_contact_by_id(hParty[:contactId])
45
45
  unless hContact.empty?
46
46
  unless hContact[:name].nil?
47
- sbRole = Codelists.codelist_adiwg2sb('role_adiwg2sb', hIndex[:role])
48
- sbRole = sbRole.nil? ? hIndex[:role] : sbRole
47
+ sbRole = Codelists.codelist_adiwg2sb('role_adiwg2sb', hParty[:role])
48
+ sbRole = sbRole.nil? ? hParty[:role] : sbRole
49
49
  citation += hContact[:name] + '(' + sbRole + '), '
50
50
  end
51
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adiwg-mdtranslator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.13.0
4
+ version: 2.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stan Smith
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-05-11 00:00:00.000000000 Z
12
+ date: 2018-07-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -317,6 +317,7 @@ files:
317
317
  - lib/adiwg/mdtranslator/readers/fgdc/readme.md
318
318
  - lib/adiwg/mdtranslator/readers/fgdc/version.rb
319
319
  - lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb
320
+ - lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader_messages_eng.yml
320
321
  - lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb
321
322
  - lib/adiwg/mdtranslator/readers/mdJson/modules/module_additionalDocumentation.rb
322
323
  - lib/adiwg/mdtranslator/readers/mdJson/modules/module_address.rb
@@ -854,7 +855,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
854
855
  version: '0'
855
856
  requirements: []
856
857
  rubyforge_project:
857
- rubygems_version: 2.6.8
858
+ rubygems_version: 2.5.2
858
859
  signing_key:
859
860
  specification_version: 4
860
861
  summary: The mdtranslator (metadata translator) is a tool for translating metadata