adiwg-mdtranslator 0.9.0 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -6
  3. data/adiwg-mdtranslator.gemspec +2 -2
  4. data/bin/mdtranslator +10 -10
  5. data/lib/adiwg/mdtranslator.rb +54 -12
  6. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +87 -7
  7. data/lib/adiwg/mdtranslator/readers/{adiwgJson/adiwgJson_reader.rb → mdJson/mdJson_reader.rb} +13 -4
  8. data/lib/adiwg/mdtranslator/readers/{adiwgJson/adiwgJson_validator.rb → mdJson/mdJson_validator.rb} +18 -10
  9. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_additionalDocumentation.rb +2 -2
  10. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_address.rb +1 -1
  11. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_associatedResource.rb +3 -3
  12. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_boundingBox.rb +1 -1
  13. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_browseGraphic.rb +1 -1
  14. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_citation.rb +5 -5
  15. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_contacts.rb +7 -7
  16. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_coordinates.rb +1 -1
  17. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dataDictionary.rb +53 -0
  18. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_dataQuality.rb +2 -2
  19. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_dateTime.rb +1 -1
  20. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_descriptiveKeyword.rb +2 -2
  21. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dictionaryInfo.rb +52 -0
  22. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_distributionInfo.rb +4 -4
  23. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domain.rb +62 -0
  24. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domainItem.rb +42 -0
  25. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entity.rb +92 -0
  26. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityAttribute.rb +91 -0
  27. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityForeignKey.rb +43 -0
  28. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityIndex.rb +42 -0
  29. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_extent.rb +4 -4
  30. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_geoCoordSystem.rb +1 -1
  31. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_geoProperties.rb +4 -4
  32. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_geographicElement.rb +12 -12
  33. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_legalConstraint.rb +1 -1
  34. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_lineString.rb +2 -2
  35. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_lineage.rb +3 -3
  36. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_metadata.rb +6 -6
  37. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_metadataExtension.rb +2 -2
  38. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_metadataInfo.rb +8 -8
  39. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_onlineResource.rb +1 -1
  40. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_phone.rb +1 -1
  41. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_point.rb +2 -2
  42. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_polygon.rb +2 -2
  43. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_processStep.rb +4 -4
  44. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resolution.rb +1 -1
  45. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceFormat.rb +1 -1
  46. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceIdentifier.rb +2 -2
  47. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceInfo.rb +16 -16
  48. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceMaintenance.rb +2 -2
  49. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceSpecificUsage.rb +2 -2
  50. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_responsibleParty.rb +2 -2
  51. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_securityConstraint.rb +1 -1
  52. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_source.rb +3 -3
  53. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_spatialReference.rb +1 -1
  54. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_taxonClass.rb +1 -1
  55. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_taxonomy.rb +5 -5
  56. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_temporalElement.rb +4 -4
  57. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_timeInstant.rb +3 -3
  58. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_timePeriod.rb +4 -4
  59. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_verticalElement.rb +1 -1
  60. data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_voucher.rb +2 -2
  61. data/lib/adiwg/mdtranslator/readers/mdJson/readme.md +19 -0
  62. data/lib/adiwg/mdtranslator/version.rb +5 -1
  63. data/lib/adiwg/mdtranslator/writers/iso/classes/class_FCfeatureCatalogue.rb +171 -0
  64. data/lib/adiwg/mdtranslator/writers/{iso19115_2/classes/class_metadata.rb → iso/classes/class_MImetadata.rb} +3 -3
  65. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_address.rb +0 -0
  66. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_aggregateInformation.rb +0 -0
  67. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_boundingPolygon.rb +0 -0
  68. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_browseGraphic.rb +0 -0
  69. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_citation.rb +3 -3
  70. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_contact.rb +1 -1
  71. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_dataIdentification.rb +0 -0
  72. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_dataQuality.rb +0 -0
  73. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_date.rb +0 -0
  74. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_digitalTransferOptions.rb +0 -0
  75. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_distribution.rb +0 -0
  76. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_distributor.rb +0 -0
  77. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_extent.rb +0 -0
  78. data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureAttribute.rb +114 -0
  79. data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureConstraint.rb +55 -0
  80. data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureType.rb +120 -0
  81. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_format.rb +0 -0
  82. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_genericMetaData.rb +0 -0
  83. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_geographicBoundingBox.rb +0 -0
  84. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_geographicDescription.rb +0 -0
  85. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_geographicElement.rb +0 -0
  86. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_identifier.rb +0 -0
  87. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_keyword.rb +0 -0
  88. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_legalConstraints.rb +0 -0
  89. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_lineString.rb +1 -1
  90. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_lineage.rb +0 -0
  91. data/lib/adiwg/mdtranslator/writers/iso/classes/class_listedValue.rb +68 -0
  92. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_maintenanceInformation.rb +0 -0
  93. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_medium.rb +0 -0
  94. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_metadataExtension.rb +0 -0
  95. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_multiGeometry.rb +3 -3
  96. data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiplicity.rb +44 -0
  97. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_onlineResource.rb +0 -0
  98. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_point.rb +1 -1
  99. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_polygon.rb +2 -2
  100. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_processStep.rb +1 -1
  101. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_referenceIdentifier.rb +0 -0
  102. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_referenceSystem.rb +0 -0
  103. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_resolution.rb +0 -0
  104. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_responsibleParty.rb +1 -1
  105. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_securityConstraints.rb +0 -0
  106. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_source.rb +0 -0
  107. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_standardOrderProcess.rb +0 -0
  108. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_taxonClassification.rb +0 -0
  109. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_taxonSystem.rb +0 -0
  110. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_telephone.rb +0 -0
  111. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_temporalExtent.rb +0 -0
  112. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_timeInstant.rb +1 -1
  113. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_timePeriod.rb +1 -1
  114. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_usage.rb +0 -0
  115. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_useConstraints.rb +0 -0
  116. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_verticalExtent.rb +0 -0
  117. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_vouchers.rb +0 -0
  118. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_associationType.rb +0 -0
  119. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_characterSet.rb +0 -0
  120. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_classification.rb +0 -0
  121. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_datatype.rb +0 -0
  122. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_dateType.rb +0 -0
  123. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_initiativeType.rb +0 -0
  124. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_keywordType.rb +0 -0
  125. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_maintenanceFrequency.rb +0 -0
  126. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_mediumFormat.rb +0 -0
  127. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_mediumName.rb +0 -0
  128. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_obligation.rb +0 -0
  129. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_onlineFunction.rb +0 -0
  130. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_presentationForm.rb +0 -0
  131. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_progress.rb +0 -0
  132. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_restriction.rb +0 -0
  133. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_role.rb +0 -0
  134. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_scope.rb +0 -0
  135. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_spatialRepresentationType.rb +0 -0
  136. data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_topicCategory.rb +0 -0
  137. data/lib/adiwg/mdtranslator/writers/iso/units/class_baseUnit.rb +27 -0
  138. data/lib/adiwg/mdtranslator/writers/iso/units/class_conventionalUnit.rb +53 -0
  139. data/lib/adiwg/mdtranslator/writers/iso/units/class_definitionUnit.rb +24 -0
  140. data/lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb +31 -0
  141. data/lib/adiwg/mdtranslator/writers/iso/units/class_unitsOfMeasure.rb +224 -0
  142. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +28 -0
  143. data/lib/adiwg/mdtranslator/writers/iso19110/readme.md +13 -0
  144. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +1 -1
  145. data/lib/adiwg/mdtranslator/writers/iso19115_2/readme.md +6 -9
  146. data/test/tc_translation.rb +35 -18
  147. metadata +166 -146
  148. data/lib/adiwg/mdtranslator/readers/adiwgJson/readme.md +0 -19
  149. data/mdtranslator.rb +0 -187
@@ -6,7 +6,7 @@
6
6
 
7
7
  require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
8
8
 
9
- module Adiwg_AdditionalDocumentation
9
+ module Md_AdditionalDocumentation
10
10
 
11
11
  def self.unpack(hAddDoc)
12
12
 
@@ -26,7 +26,7 @@ module Adiwg_AdditionalDocumentation
26
26
  if hAddDoc.has_key?('citation')
27
27
  hCitation = hAddDoc['citation']
28
28
  unless hCitation.empty?
29
- intAddDoc[:citation] = Adiwg_Citation.unpack(hCitation)
29
+ intAddDoc[:citation] = Md_Citation.unpack(hCitation)
30
30
  end
31
31
  end
32
32
 
@@ -4,7 +4,7 @@
4
4
  # History:
5
5
  # Stan Smith 2013-10-21 original script
6
6
 
7
- module Adiwg_Address
7
+ module Md_Address
8
8
 
9
9
  def self.unpack(hConAddress)
10
10
 
@@ -12,7 +12,7 @@
12
12
 
13
13
  require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
14
14
 
15
- module Adiwg_AssociatedResource
15
+ module Md_AssociatedResource
16
16
 
17
17
  def self.unpack(hAssocRes)
18
18
 
@@ -48,7 +48,7 @@ module Adiwg_AssociatedResource
48
48
  if hAssocRes.has_key?('resourceCitation')
49
49
  hCitation = hAssocRes['resourceCitation']
50
50
  unless hCitation.empty?
51
- intAssocRes[:resourceCitation] = Adiwg_Citation.unpack(hCitation)
51
+ intAssocRes[:resourceCitation] = Md_Citation.unpack(hCitation)
52
52
  end
53
53
  end
54
54
 
@@ -56,7 +56,7 @@ module Adiwg_AssociatedResource
56
56
  if hAssocRes.has_key?('metadataCitation')
57
57
  hCitation = hAssocRes['metadataCitation']
58
58
  unless hCitation.empty?
59
- intAssocRes[:metadataCitation] = Adiwg_Citation.unpack(hCitation)
59
+ intAssocRes[:metadataCitation] = Md_Citation.unpack(hCitation)
60
60
  end
61
61
  end
62
62
 
@@ -5,7 +5,7 @@
5
5
  # Stan Smith 2013-11-07 original script
6
6
  # Stan Smith 2014-04-28 reorganized for json schema 0.3.0
7
7
 
8
- module Adiwg_BoundingBox
8
+ module Md_BoundingBox
9
9
 
10
10
  def self.unpack(aBBox)
11
11
 
@@ -6,7 +6,7 @@
6
6
  # Stan Smith 2013-11-27 modified to process single browse graphic rather than array
7
7
  # Stan Smith 2014-04-28 modified attribute names to match json schema 0.3.0
8
8
 
9
- module Adiwg_BrowseGraphic
9
+ module Md_BrowseGraphic
10
10
 
11
11
  def self.unpack(hBgraphic)
12
12
 
@@ -12,7 +12,7 @@ require ADIWG::Mdtranslator.reader_module('module_responsibleParty', $response[:
12
12
  require ADIWG::Mdtranslator.reader_module('module_onlineResource', $response[:readerVersionUsed])
13
13
  require ADIWG::Mdtranslator.reader_module('module_resourceIdentifier', $response[:readerVersionUsed])
14
14
 
15
- module Adiwg_Citation
15
+ module Md_Citation
16
16
 
17
17
  def self.unpack(hCitation)
18
18
 
@@ -36,7 +36,7 @@ module Adiwg_Citation
36
36
  if hCitDate.has_key?('date')
37
37
  s = hCitDate['date']
38
38
  if s != ''
39
- intDateTime = Adiwg_DateTime.unpack(s)
39
+ intDateTime = Md_DateTime.unpack(s)
40
40
  if hCitDate.has_key?('dateType')
41
41
  s = hCitDate['dateType']
42
42
  if s != ''
@@ -63,7 +63,7 @@ module Adiwg_Citation
63
63
  aRParty = hCitation['responsibleParty']
64
64
  unless aRParty.empty?
65
65
  aRParty.each do |hRParty|
66
- intCitation[:citResponsibleParty] << Adiwg_ResponsibleParty.unpack(hRParty)
66
+ intCitation[:citResponsibleParty] << Md_ResponsibleParty.unpack(hRParty)
67
67
  end
68
68
  end
69
69
  end
@@ -83,7 +83,7 @@ module Adiwg_Citation
83
83
  aResIds = hCitation['identifier']
84
84
  aResIds.each do |hIdentifier|
85
85
  unless hIdentifier.empty?
86
- intCitation[:citResourceIDs] << Adiwg_ResourceIdentifier.unpack(hIdentifier)
86
+ intCitation[:citResourceIds] << Md_ResourceIdentifier.unpack(hIdentifier)
87
87
  end
88
88
  end
89
89
  end
@@ -93,7 +93,7 @@ module Adiwg_Citation
93
93
  aOlRes = hCitation['onlineResource']
94
94
  aOlRes.each do |hOlRes|
95
95
  unless hOlRes.empty?
96
- intCitation[:citOlResources] << Adiwg_OnlineResource.unpack(hOlRes)
96
+ intCitation[:citOlResources] << Md_OnlineResource.unpack(hOlRes)
97
97
  end
98
98
  end
99
99
  end
@@ -14,7 +14,7 @@ require ADIWG::Mdtranslator.reader_module('module_address', $response[:readerVer
14
14
  require ADIWG::Mdtranslator.reader_module('module_onlineResource', $response[:readerVersionUsed])
15
15
  require ADIWG::Mdtranslator.reader_module('module_phone', $response[:readerVersionUsed])
16
16
 
17
- module Adiwg_Contact
17
+ module Md_Contact
18
18
 
19
19
  def self.unpack(hContact)
20
20
 
@@ -26,7 +26,7 @@ module Adiwg_Contact
26
26
  if hContact.has_key?('contactId')
27
27
  s = hContact['contactId']
28
28
  if s != ''
29
- intCont[:contactID] = s
29
+ intCont[:contactId] = s
30
30
  end
31
31
  end
32
32
 
@@ -59,7 +59,7 @@ module Adiwg_Contact
59
59
  aOlRes = hContact['onlineResource']
60
60
  aOlRes.each do |hOlRes|
61
61
  unless hOlRes.empty?
62
- intCont[:onlineRes] << Adiwg_OnlineResource.unpack(hOlRes)
62
+ intCont[:onlineRes] << Md_OnlineResource.unpack(hOlRes)
63
63
  end
64
64
  end
65
65
  end
@@ -76,14 +76,14 @@ module Adiwg_Contact
76
76
  if hContact.has_key?('phoneBook')
77
77
  aPhones = hContact['phoneBook']
78
78
  aPhones.each do |hPhone|
79
- intCont[:phones].concat(Adiwg_Phone.unpack(hPhone))
79
+ intCont[:phones].concat(Md_Phone.unpack(hPhone))
80
80
  end
81
81
  end
82
82
 
83
83
  # address
84
84
  if hContact.has_key?('address')
85
85
  conAddress = hContact['address']
86
- intCont[:address] = Adiwg_Address.unpack(conAddress)
86
+ intCont[:address] = Md_Address.unpack(conAddress)
87
87
  end
88
88
 
89
89
  return intCont
@@ -98,13 +98,13 @@ module Adiwg_Contact
98
98
 
99
99
  # contact to support biological extensions
100
100
  intCont = intMetadataClass.newContact
101
- intCont[:contactID] = 'ADIwgBio'
101
+ intCont[:contactId] = 'ADIwgBio'
102
102
  intCont[:orgName] = 'National Biological Information Infrastructure (NBII)'
103
103
  aDefContacts << intCont
104
104
 
105
105
  # contact to support doi (digital object identifier)
106
106
  intCont = intMetadataClass.newContact
107
- intCont[:contactID] = 'ADIwgDOI'
107
+ intCont[:contactId] = 'ADIwgDOI'
108
108
  intCont[:orgName] = 'International DOI Foundation (IDF)'
109
109
 
110
110
  intOlRes = intMetadataClass.newOnlineResource
@@ -6,7 +6,7 @@
6
6
  # Stan Smith 2013-11-13 added getDimension
7
7
  # Stan Smith 2014-05-23 added getLevels
8
8
 
9
- module Adiwg_Coordinates
9
+ module Md_Coordinates
10
10
 
11
11
  # repack coordinate array into single string for ISO
12
12
  def self.unpack(aCoords)
@@ -0,0 +1,53 @@
1
+ # unpack a data dictionary
2
+ # Reader - ADIwg JSON V1 to internal data structure
3
+
4
+ # History:
5
+ # Stan Smith 2014-12-01 original script
6
+
7
+ require ADIWG::Mdtranslator.reader_module('module_dictionaryInfo', $response[:readerVersionUsed])
8
+ require ADIWG::Mdtranslator.reader_module('module_domain', $response[:readerVersionUsed])
9
+ require ADIWG::Mdtranslator.reader_module('module_entity', $response[:readerVersionUsed])
10
+
11
+ module Md_DataDictionary
12
+
13
+ def self.unpack(hDictionary)
14
+
15
+ # instance classes needed in script
16
+ intMetadataClass = InternalMetadata.new
17
+ intDict = intMetadataClass.newDataDictionary
18
+
19
+ unless hDictionary.empty?
20
+
21
+ # data dictionary - dictionary information
22
+ if hDictionary.has_key?('dictionaryInfo')
23
+ hDictInfo = hDictionary['dictionaryInfo']
24
+ intDict[:dictionaryInfo] = Md_DictionaryInfo.unpack(hDictInfo)
25
+ end
26
+
27
+ # data dictionary - domains
28
+ if hDictionary.has_key?('domain')
29
+ aDomains = hDictionary['domain']
30
+ aDomains.each do |hDomain|
31
+ unless hDomain.empty?
32
+ intDict[:domains] << Md_Domain.unpack(hDomain)
33
+ end
34
+ end
35
+ end
36
+
37
+ # data dictionary - entity
38
+ if hDictionary.has_key?('entity')
39
+ aEntities = hDictionary['entity']
40
+ aEntities.each do |hEntity|
41
+ unless hEntity.empty?
42
+ intDict[:entities] << Md_Entity.unpack(hEntity)
43
+ end
44
+ end
45
+ end
46
+
47
+ return intDict
48
+
49
+ end
50
+
51
+ end
52
+
53
+ end
@@ -7,7 +7,7 @@
7
7
 
8
8
  require ADIWG::Mdtranslator.reader_module('module_lineage', $response[:readerVersionUsed])
9
9
 
10
- module Adiwg_DataQuality
10
+ module Md_DataQuality
11
11
 
12
12
  def self.unpack(hDataQual)
13
13
 
@@ -30,7 +30,7 @@ module Adiwg_DataQuality
30
30
  if hDataQual.has_key?('lineage')
31
31
  hLineage = hDataQual['lineage']
32
32
  unless hLineage.empty?
33
- intDataQual[:dataLineage] = Adiwg_Lineage.unpack(hLineage)
33
+ intDataQual[:dataLineage] = Md_Lineage.unpack(hLineage)
34
34
  end
35
35
  end
36
36
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  require 'module_dateTimeFun'
8
8
 
9
- module Adiwg_DateTime
9
+ module Md_DateTime
10
10
 
11
11
  def self.unpack(sDateTime)
12
12
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
12
12
 
13
- module Adiwg_DescriptiveKeyword
13
+ module Md_DescriptiveKeyword
14
14
 
15
15
  def self.unpack(hDesKeyword)
16
16
 
@@ -38,7 +38,7 @@ module Adiwg_DescriptiveKeyword
38
38
  if hDesKeyword.has_key?('thesaurus')
39
39
  hCitation = hDesKeyword['thesaurus']
40
40
  unless hCitation.empty?
41
- intKeyword[:keyTheCitation] = Adiwg_Citation.unpack(hCitation)
41
+ intKeyword[:keyTheCitation] = Md_Citation.unpack(hCitation)
42
42
  end
43
43
 
44
44
  end
@@ -0,0 +1,52 @@
1
+ # unpack data dictionary information section
2
+ # Reader - ADIwg JSON V1 to internal data structure
3
+
4
+ # History:
5
+ # Stan Smith 2013-12-01 original script
6
+
7
+ require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
8
+
9
+ module Md_DictionaryInfo
10
+
11
+ def self.unpack(hDictInfo)
12
+
13
+ # instance classes needed in script
14
+ intMetadataClass = InternalMetadata.new
15
+ intDictInfo = intMetadataClass.newDictionaryInfo
16
+
17
+ # dictionary info - citation
18
+ if hDictInfo.has_key?('citation')
19
+ hCitation = hDictInfo['citation']
20
+ unless hCitation.empty?
21
+ intDictInfo[:dictCitation] = Md_Citation.unpack(hCitation)
22
+ end
23
+ end
24
+
25
+ # dictionary info - description
26
+ if hDictInfo.has_key?('description')
27
+ s = hDictInfo['description']
28
+ if s != ''
29
+ intDictInfo[:dictDescription] = s
30
+ end
31
+ end
32
+
33
+ # dictionary info - resource type
34
+ if hDictInfo.has_key?('resourceType')
35
+ s = hDictInfo['resourceType']
36
+ if s != ''
37
+ intDictInfo[:dictResourceType] = s
38
+ end
39
+ end
40
+
41
+ # dictionary info - language
42
+ if hDictInfo.has_key?('language')
43
+ s = hDictInfo['language']
44
+ if s != ''
45
+ intDictInfo[:dictLanguage] = s
46
+ end
47
+ end
48
+
49
+ return intDictInfo
50
+ end
51
+
52
+ end
@@ -12,7 +12,7 @@ require ADIWG::Mdtranslator.reader_module('module_onlineResource', $response[:re
12
12
  require ADIWG::Mdtranslator.reader_module('module_dateTime', $response[:readerVersionUsed])
13
13
  require ADIWG::Mdtranslator.reader_module('module_responsibleParty', $response[:readerVersionUsed])
14
14
 
15
- module Adiwg_DistributionInfo
15
+ module Md_DistributionInfo
16
16
 
17
17
  def self.unpack(hDistributor)
18
18
 
@@ -24,7 +24,7 @@ module Adiwg_DistributionInfo
24
24
  if hDistributor.has_key?('distributorContact')
25
25
  hContact = hDistributor['distributorContact']
26
26
  unless hContact.empty?
27
- intDistributor[:distContact] = Adiwg_ResponsibleParty.unpack(hContact)
27
+ intDistributor[:distContact] = Md_ResponsibleParty.unpack(hContact)
28
28
  end
29
29
  end
30
30
 
@@ -46,7 +46,7 @@ module Adiwg_DistributionInfo
46
46
  if distOrderProcess.has_key?('plannedAvailabilityDateTime')
47
47
  s = distOrderProcess['plannedAvailabilityDateTime']
48
48
  if s != ''
49
- intDistOrder[:plannedDateTime] = Adiwg_DateTime.unpack(s)
49
+ intDistOrder[:plannedDateTime] = Md_DateTime.unpack(s)
50
50
  end
51
51
  end
52
52
 
@@ -108,7 +108,7 @@ module Adiwg_DistributionInfo
108
108
  if distTransOpt.has_key?('online')
109
109
  aOnlineOption = distTransOpt['online']
110
110
  aOnlineOption.each do |hOlOption|
111
- intTransOpt[:online] << Adiwg_OnlineResource.unpack(hOlOption)
111
+ intTransOpt[:online] << Md_OnlineResource.unpack(hOlOption)
112
112
  end
113
113
  end
114
114
 
@@ -0,0 +1,62 @@
1
+ # unpack a data dictionary domain
2
+ # Reader - ADIwg JSON V1 to internal data structure
3
+
4
+ # History:
5
+ # Stan Smith 2013-12-01 original script
6
+
7
+ require ADIWG::Mdtranslator.reader_module('module_domainItem', $response[:readerVersionUsed])
8
+
9
+ module Md_Domain
10
+
11
+ def self.unpack(hDomain)
12
+
13
+ # instance classes needed in script
14
+ intMetadataClass = InternalMetadata.new
15
+ intDomain = intMetadataClass.newDictionaryDomain
16
+
17
+ # data dictionary domain - id
18
+ if hDomain.has_key?('domainId')
19
+ s = hDomain['domainId']
20
+ if s != ''
21
+ intDomain[:domainId] = s
22
+ end
23
+ end
24
+
25
+ # data dictionary domain - name
26
+ if hDomain.has_key?('commonName')
27
+ s = hDomain['commonName']
28
+ if s != ''
29
+ intDomain[:domainName] = s
30
+ end
31
+ end
32
+
33
+ # data dictionary domain - code
34
+ if hDomain.has_key?('codeName')
35
+ s = hDomain['codeName']
36
+ if s != ''
37
+ intDomain[:domainCode] = s
38
+ end
39
+ end
40
+
41
+ # data dictionary domain - description
42
+ if hDomain.has_key?('description')
43
+ s = hDomain['description']
44
+ if s != ''
45
+ intDomain[:domainDescription] = s
46
+ end
47
+ end
48
+
49
+ # data dictionary domain - members
50
+ if hDomain.has_key?('member')
51
+ aDoItems = hDomain['member']
52
+ aDoItems.each do |hDoItem|
53
+ unless hDoItem.empty?
54
+ intDomain[:domainItems] << Md_DomainItem.unpack(hDoItem)
55
+ end
56
+ end
57
+ end
58
+
59
+ return intDomain
60
+ end
61
+
62
+ end
@@ -0,0 +1,42 @@
1
+ # unpack a data dictionary domain item
2
+ # Reader - ADIwg JSON V1 to internal data structure
3
+
4
+ # History:
5
+ # Stan Smith 2013-12-01 original script
6
+
7
+ module Md_DomainItem
8
+
9
+ def self.unpack(hDoItem)
10
+
11
+ # instance classes needed in script
12
+ intMetadataClass = InternalMetadata.new
13
+ intItem = intMetadataClass.newDomainItem
14
+
15
+ # data dictionary domain item - name
16
+ if hDoItem.has_key?('name')
17
+ s = hDoItem['name']
18
+ if s != ''
19
+ intItem[:itemName] = s
20
+ end
21
+ end
22
+
23
+ # data dictionary domain item - value
24
+ if hDoItem.has_key?('value')
25
+ s = hDoItem['value']
26
+ if s != ''
27
+ intItem[:itemValue] = s
28
+ end
29
+ end
30
+
31
+ # data dictionary domain item - definition
32
+ if hDoItem.has_key?('definition')
33
+ s = hDoItem['definition']
34
+ if s != ''
35
+ intItem[:itemDefinition] = s
36
+ end
37
+ end
38
+
39
+ return intItem
40
+ end
41
+
42
+ end