adiwg-mdtranslator 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +23 -0
  3. data/.travis.yml +7 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +24 -0
  6. data/README.md +31 -0
  7. data/Rakefile +13 -0
  8. data/adiwg-mdtranslator.gemspec +31 -0
  9. data/bin/mdtranslator +164 -0
  10. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +499 -0
  11. data/lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb +98 -0
  12. data/lib/adiwg/mdtranslator/readers/adiwgJson/adiwgJson_reader.rb +80 -0
  13. data/lib/adiwg/mdtranslator/readers/adiwgJson/adiwgJson_validator.rb +115 -0
  14. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_address.rb +71 -0
  15. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_associatedResource.rb +57 -0
  16. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_boundingBox.rb +51 -0
  17. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_browseGraphic.rb +52 -0
  18. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_citation.rb +104 -0
  19. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_contacts.rb +121 -0
  20. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_coordinates.rb +52 -0
  21. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_dataQuality.rb +40 -0
  22. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_dateTime.rb +27 -0
  23. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_descriptiveKeyword.rb +49 -0
  24. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_distributionInfo.rb +150 -0
  25. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_extent.rb +62 -0
  26. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_geoCoordSystem.rb +46 -0
  27. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_geoProperties.rb +89 -0
  28. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_geographicElement.rb +168 -0
  29. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_legalConstraint.rb +45 -0
  30. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_lineString.rb +25 -0
  31. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_lineage.rb +50 -0
  32. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_metadata.rb +76 -0
  33. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_metadataExtension.rb +40 -0
  34. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_metadataInfo.rb +119 -0
  35. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_onlineResource.rb +62 -0
  36. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_phone.rb +59 -0
  37. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_point.rb +25 -0
  38. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_polygon.rb +55 -0
  39. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_processStep.rb +64 -0
  40. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_resolution.rb +42 -0
  41. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_resourceFormat.rb +35 -0
  42. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_resourceIdentifier.rb +49 -0
  43. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_resourceInfo.rb +298 -0
  44. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_resourceMaintenance.rb +50 -0
  45. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_resourceSpecificUsage.rb +50 -0
  46. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_responsibleParty.rb +37 -0
  47. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_securityConstraint.rb +52 -0
  48. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_source.rb +48 -0
  49. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_spatialReference.rb +48 -0
  50. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_taxonClass.rb +43 -0
  51. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_taxonomy.rb +83 -0
  52. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_temporalElement.rb +71 -0
  53. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_timeInstant.rb +45 -0
  54. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_timePeriod.rb +53 -0
  55. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_verticalElement.rb +53 -0
  56. data/lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_voucher.rb +38 -0
  57. data/lib/adiwg/mdtranslator/validator.rb +43 -0
  58. data/lib/adiwg/mdtranslator/version.rb +7 -0
  59. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_address.rb +91 -0
  60. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_aggregateInformation.rb +68 -0
  61. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_boundingPolygon.rb +75 -0
  62. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_browseGraphic.rb +51 -0
  63. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +157 -0
  64. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contact.rb +85 -0
  65. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +338 -0
  66. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataQuality.rb +55 -0
  67. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_date.rb +60 -0
  68. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_digitalTransferOptions.rb +51 -0
  69. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distribution.rb +36 -0
  70. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distributor.rb +80 -0
  71. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extent.rb +94 -0
  72. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_format.rb +40 -0
  73. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_genericMetaData.rb +65 -0
  74. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicBoundingBox.rb +74 -0
  75. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicDescription.rb +29 -0
  76. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicElement.rb +36 -0
  77. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_identifier.rb +51 -0
  78. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +63 -0
  79. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_legalConstraints.rb +63 -0
  80. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineString.rb +74 -0
  81. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineage.rb +63 -0
  82. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_maintenanceInformation.rb +64 -0
  83. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_medium.rb +59 -0
  84. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_metadata.rb +277 -0
  85. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_metadataExtension.rb +156 -0
  86. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiGeometry.rb +140 -0
  87. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_onlineResource.rb +78 -0
  88. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_point.rb +74 -0
  89. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_polygon.rb +94 -0
  90. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_processStep.rb +81 -0
  91. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceIdentifier.rb +42 -0
  92. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +29 -0
  93. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_resolution.rb +46 -0
  94. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +90 -0
  95. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb +68 -0
  96. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_source.rb +59 -0
  97. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_standardOrderProcess.rb +74 -0
  98. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonClassification.rb +65 -0
  99. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonSystem.rb +100 -0
  100. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_telephone.rb +77 -0
  101. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb +58 -0
  102. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timeInstant.rb +47 -0
  103. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timePeriod.rb +54 -0
  104. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_usage.rb +59 -0
  105. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_useConstraints.rb +30 -0
  106. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_verticalExtent.rb +59 -0
  107. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vouchers.rb +48 -0
  108. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_associationType.rb +35 -0
  109. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_characterSet.rb +58 -0
  110. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_classification.rb +35 -0
  111. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_datatype.rb +45 -0
  112. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_dateType.rb +29 -0
  113. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_initiativeType.rb +35 -0
  114. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_keywordType.rb +33 -0
  115. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_maintenanceFrequency.rb +42 -0
  116. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_mediumFormat.rb +32 -0
  117. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_mediumName.rb +44 -0
  118. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_obligation.rb +32 -0
  119. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_onlineFunction.rb +31 -0
  120. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_presentationForm.rb +44 -0
  121. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_progress.rb +33 -0
  122. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_restriction.rb +38 -0
  123. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_role.rb +37 -0
  124. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_scope.rb +46 -0
  125. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_spatialRepresentationType.rb +36 -0
  126. data/lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_topicCategory.rb +50 -0
  127. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +131 -0
  128. data/lib/adiwg/mdtranslator.rb +97 -0
  129. data/lib/adiwg-mdtranslator.rb +1 -0
  130. data/mdtranslator.rb +178 -0
  131. data/test/adiwgJson_full_test_example.json +1717 -0
  132. data/test/adiwgJson_template.json +977 -0
  133. data/test/dev.rb +32 -0
  134. data/test/tc_translation.rb +31 -0
  135. metadata +317 -0
@@ -0,0 +1,59 @@
1
+ # ISO <<Class>> EX_VerticalExtent
2
+ # writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2013-11-15 original script
6
+
7
+ class EX_VerticalExtent
8
+
9
+ def initialize(xml)
10
+ @xml = xml
11
+ end
12
+
13
+ def writeXML(hVertEle)
14
+
15
+ @xml.tag!('gmd:EX_VerticalExtent') do
16
+
17
+ # vertical extent - minimum value - required
18
+ s = hVertEle[:minValue]
19
+ if s.nil?
20
+ @xml.tag!('gmd:minimumValue', {'gco:nilReason' => 'missing'})
21
+ else
22
+ @xml.tag!('gmd:minimumValue') do
23
+ @xml.tag!('gco:Real', s)
24
+ end
25
+ end
26
+
27
+ # vertical extent - maximum value - required
28
+ s = hVertEle[:maxValue]
29
+ if s.nil?
30
+ @xml.tag!('gmd:maximumValue', {'gco:nilReason' => 'missing'})
31
+ else
32
+ @xml.tag!('gmd:maximumValue') do
33
+ @xml.tag!('gco:Real', s)
34
+ end
35
+ end
36
+
37
+ # vertical extent - vertical crs - attributes only - required
38
+ attributes = {}
39
+ s = hVertEle[:crsURI]
40
+ unless s.nil?
41
+ attributes['xlink:href'] = s
42
+ end
43
+ s = hVertEle[:crsTitle]
44
+ unless s.nil?
45
+ attributes['xlink:title'] = s
46
+ end
47
+
48
+ if attributes.empty?
49
+ attributes['gco:nilReason'] = 'missing'
50
+ end
51
+
52
+ @xml.tag!('gmd:verticalCRS',attributes)
53
+
54
+
55
+ end
56
+
57
+ end
58
+
59
+ end
@@ -0,0 +1,48 @@
1
+ # ISO <<Class>> MD_Vouchers
2
+ # writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2013-11-19 original script
6
+ # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
7
+
8
+ require 'class_responsibleParty'
9
+
10
+ class MD_Vouchers
11
+
12
+ def initialize(xml)
13
+ @xml = xml
14
+ end
15
+
16
+ def writeXML(hVoucher)
17
+
18
+ # classes used in MD_Vouchers
19
+ rPartyClass = CI_ResponsibleParty.new(@xml)
20
+
21
+ @xml.tag!('gmd:MD_Vouchers') do
22
+
23
+ # voucher - specimen - required
24
+ s = hVoucher[:specimen]
25
+ if s.nil?
26
+ @xml.tag!('gmd:specimen',{'gco:nilReason'=>'missing'})
27
+ else
28
+ @xml.tag!('gmd:specimen') do
29
+ @xml.tag!('gco:CharacterString',s)
30
+ end
31
+ end
32
+
33
+ # voucher - repository - required - MD_ResponsibleParty
34
+ hContacts = hVoucher[:repository]
35
+ if hContacts.empty?
36
+ @xml.tag!('gmd:reposit',{'gco:nilReason'=>'missing'})
37
+ else
38
+ @xml.tag!('gmd:reposit') do
39
+ rPartyClass.writeXML(hContacts)
40
+ end
41
+
42
+ end
43
+
44
+ end
45
+
46
+ end
47
+
48
+ end
@@ -0,0 +1,35 @@
1
+ # ISO <<CodeLists>> gmd:MD_ClassificationCode
2
+
3
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
4
+ # History:
5
+ # Stan Smith 2013-10-21 original script
6
+
7
+ class DS_AssociationTypeCode
8
+ def initialize(xml)
9
+ @xml = xml
10
+ end
11
+
12
+ def writeXML(codeName)
13
+ case(codeName)
14
+ when 'crossReference' then codeID = '001'
15
+ when 'largerWorkCitation' then codeID = '002'
16
+ when 'partOfSeamlessDatabase' then codeID = '003'
17
+ when 'source' then codeID = '004'
18
+ when 'stereoMate' then codeID = '005'
19
+ else
20
+ codeName = 'INVALID ASSOCIATION TYPE CODE'
21
+ codeID = '999'
22
+ end
23
+
24
+ # write xml
25
+ @xml.tag!('gmd:DS_AssociationTypeCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DS_AssociationTypeCode',
26
+ :codeListValue=>"#{codeName}",
27
+ :codeSpace=>"#{codeID}"})
28
+ end
29
+
30
+ end
31
+
32
+
33
+
34
+
35
+
@@ -0,0 +1,58 @@
1
+ # ISO <<CodeLists>> gmd:MD_CharacterSetCode
2
+
3
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
4
+ # History:
5
+ # Stan Smith 2013-08-09 original script
6
+
7
+ class MD_CharacterSetCode
8
+ def initialize(xml)
9
+ @xml = xml
10
+ end
11
+
12
+ def writeXML(codeName)
13
+ case(codeName)
14
+ when 'ucs2' then codeID = '001'
15
+ when 'ucs4' then codeID = '002'
16
+ when 'utf7' then codeID = '003'
17
+ when 'utf8' then codeID = '004'
18
+ when 'utf16' then codeID = '005'
19
+ when '8859part1' then codeID = '006'
20
+ when '8859part2' then codeID = '007'
21
+ when '8859part3' then codeID = '008'
22
+ when '8895part4' then codeID = '009'
23
+ when '8859part5' then codeID = '010'
24
+ when '8859part6' then codeID = '011'
25
+ when '8859part7' then codeID = '012'
26
+ when '8859part8' then codeID = '013'
27
+ when '8859part9' then codeID = '014'
28
+ when '8859part10' then codeID = '015'
29
+ when '8859part11' then codeID = '016'
30
+ when '8859part13' then codeID = '018'
31
+ when '8859part14' then codeID = '019'
32
+ when '8859part15' then codeID = '020'
33
+ when '8859part16' then codeID = '021'
34
+ when 'jis' then codeID = '022'
35
+ when 'shiftJIS' then codeID = '023'
36
+ when 'eusJP' then codeID = '024'
37
+ when 'usAscii' then codeID = '025'
38
+ when 'ebcdic' then codeID = '026'
39
+ when 'ecuKR' then codeID = '027'
40
+ when 'big5' then codeID = '028'
41
+ when 'GB2312' then codeID = '029'
42
+ else
43
+ codeName = 'INVALID CHARACTER SET'
44
+ codeID = '999'
45
+ end
46
+
47
+ # write xml
48
+ @xml.tag!('gmd:MD_CharacterSetCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode',
49
+ :codeListValue=>"#{codeName}",
50
+ :codeSpace=>"#{codeID}"})
51
+ end
52
+
53
+ end
54
+
55
+
56
+
57
+
58
+
@@ -0,0 +1,35 @@
1
+ # ISO <<CodeLists>> gmd:MD_ClassificationCode
2
+
3
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
4
+ # History:
5
+ # Stan Smith 2013-10-21 original script
6
+
7
+ class MD_ClassificationCode
8
+ def initialize(xml)
9
+ @xml = xml
10
+ end
11
+
12
+ def writeXML(codeName)
13
+ case(codeName)
14
+ when 'unclassified' then codeID = '001'
15
+ when 'restricted' then codeID = '002'
16
+ when 'confidential' then codeID = '003'
17
+ when 'secret' then codeID = '004'
18
+ when 'topSecret' then codeID = '005'
19
+ else
20
+ codeName = 'INVALID CLASSIFICATION CODE'
21
+ codeID = '999'
22
+ end
23
+
24
+ # write xml
25
+ @xml.tag!('gmd:MD_ClassificationCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ClassificationCode',
26
+ :codeListValue=>"#{codeName}",
27
+ :codeSpace=>"#{codeID}"})
28
+ end
29
+
30
+ end
31
+
32
+
33
+
34
+
35
+
@@ -0,0 +1,45 @@
1
+ # ISO <<CodeLists>> gmd:MD_DatatypeCode
2
+
3
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
4
+ # History:
5
+ # Stan Smith 2013-10-21 original script
6
+
7
+ class MD_DatatypeCode
8
+ def initialize(xml)
9
+ @xml = xml
10
+ end
11
+
12
+ def writeXML(codeName)
13
+ case(codeName)
14
+ when 'class' then codeID = '001'
15
+ when 'codelist' then codeID = '002'
16
+ when 'enumeration' then codeID = '003'
17
+ when 'codelistElement' then codeID = '004'
18
+ when 'abstractClass' then codeID = '005'
19
+ when 'aggregatedClass' then codeID = '006'
20
+ when 'specifiedClass' then codeID = '007'
21
+ when 'datatypeClass' then codeID = '008'
22
+ when 'interfaceClass' then codeID = '009'
23
+ when 'unionClass' then codeID = '010'
24
+ when 'metaClass' then codeID = '011'
25
+ when 'typeClass' then codeID = '012'
26
+ when 'characterString' then codeID = '013'
27
+ when 'integer' then codeID = '014'
28
+ when 'association' then codeID = '015'
29
+ else
30
+ codeName = 'INVALID DATATYPE'
31
+ codeID = '999'
32
+ end
33
+
34
+ # write xml
35
+ @xml.tag!('gmd:MD_DatatypeCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_DatatypeCode',
36
+ :codeListValue=>"#{codeName}",
37
+ :codeSpace=>"#{codeID}"})
38
+ end
39
+
40
+ end
41
+
42
+
43
+
44
+
45
+
@@ -0,0 +1,29 @@
1
+ # ISO <<CodeLists>> gmd:CI_DateTypeCode
2
+
3
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
4
+ # History:
5
+ # Stan Smith 2013-08-09 original script
6
+
7
+ class CI_DateTypeCode
8
+
9
+ def initialize(xml)
10
+ @xml = xml
11
+ end
12
+
13
+ def writeXML(codeName)
14
+ case(codeName)
15
+ when 'creation' then codeID = '001'
16
+ when 'publication' then codeID = '002'
17
+ when 'revision' then codeID = '003'
18
+ else
19
+ codeName = 'INVALID DATE TYPE'
20
+ codeID = '999'
21
+ end
22
+
23
+ # write xml
24
+ @xml.tag!('gmd:CI_DateTypeCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode',
25
+ :codeListValue=>"#{codeName}",
26
+ :codeSpace=>"#{codeID}"})
27
+ end
28
+
29
+ end
@@ -0,0 +1,35 @@
1
+ # ISO <<CodeLists>> gmd:DS_InitiativeTypeCode
2
+
3
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
4
+ # History:
5
+ # Stan Smith 2014-05-21 original script
6
+
7
+ class DS_InitiativeTypeCode
8
+ def initialize(xml)
9
+ @xml = xml
10
+ end
11
+
12
+ def writeXML(codeName)
13
+ case(codeName)
14
+ when 'campaign' then codeID = '001'
15
+ when 'collection' then codeID = '002'
16
+ when 'exercise' then codeID = '003'
17
+ when 'experiment' then codeID = '004'
18
+ when 'investigation' then codeID = '005'
19
+ else
20
+ codeName = 'INVALID CLASSIFICATION CODE'
21
+ codeID = '999'
22
+ end
23
+
24
+ # write xml
25
+ @xml.tag!('gmd:DS_InitiativeTypeCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DS_InitiativeTypeCode',
26
+ :codeListValue=>"#{codeName}",
27
+ :codeSpace=>"#{codeID}"})
28
+ end
29
+
30
+ end
31
+
32
+
33
+
34
+
35
+
@@ -0,0 +1,33 @@
1
+ # ISO <<CodeLists>> gmd:MD_KeywordTypeCode
2
+
3
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
4
+ # History:
5
+ # Stan Smith 2013-09-18 original script
6
+
7
+ class MD_KeywordTypeCode
8
+
9
+ def initialize(xml)
10
+ @xml = xml
11
+ end
12
+
13
+ def writeXML(codeName)
14
+ case(codeName)
15
+ when 'discipline' then codeID = '001'
16
+ when 'place' then codeID = '002'
17
+ when 'stratum' then codeID = '003'
18
+ when 'temporal' then codeID = '004'
19
+ when 'theme' then codeID = '005'
20
+ when 'taxon' then codeID = '006'
21
+ when 'instrument' then codeID = 'ADIwg-001'
22
+ else
23
+ codeName = 'INVALID KEYWORD TYPE'
24
+ codeID = '999'
25
+ end
26
+
27
+ # write xml
28
+ @xml.tag!('gmd:MD_KeywordTypeCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_KeywordTypeCode',
29
+ :codeListValue=>"#{codeName}",
30
+ :codeSpace=>"#{codeID}"})
31
+ end
32
+
33
+ end
@@ -0,0 +1,42 @@
1
+ # ISO <<CodeLists>> gmd:MD_MaintenanceFrequencyCode
2
+
3
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
4
+ # History:
5
+ # Stan Smith 2013-10-21 original script
6
+
7
+ class MD_MaintenanceFrequencyCode
8
+ def initialize(xml)
9
+ @xml = xml
10
+ end
11
+
12
+ def writeXML(codeName)
13
+ case(codeName)
14
+ when 'continual' then codeID = '001'
15
+ when 'daily' then codeID = '002'
16
+ when 'weekly' then codeID = '003'
17
+ when 'fortnightly' then codeID = '004'
18
+ when 'monthly' then codeID = '005'
19
+ when 'quarterly' then codeID = '006'
20
+ when 'biannually' then codeID = '007'
21
+ when 'annually' then codeID = '008'
22
+ when 'asNeeded' then codeID = '009'
23
+ when 'irregular' then codeID = '010'
24
+ when 'notPlanned' then codeID = '011'
25
+ when 'unknown' then codeID = '012'
26
+ else
27
+ codeName = 'INVALID MAINTENANCE FREQUENCY'
28
+ codeID = '999'
29
+ end
30
+
31
+ # write xml
32
+ @xml.tag!('gmd:MD_MaintenanceFrequencyCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_MaintenanceFrequencyCode',
33
+ :codeListValue=>"#{codeName}",
34
+ :codeSpace=>"#{codeID}"})
35
+ end
36
+
37
+ end
38
+
39
+
40
+
41
+
42
+
@@ -0,0 +1,32 @@
1
+ # ISO <<CodeLists>> gmd:MD_MediumFormatCode
2
+
3
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
4
+ # History:
5
+ # Stan Smith 2013-09-24 original script
6
+
7
+ class MD_MediumFormatCode
8
+
9
+ def initialize(xml)
10
+ @xml = xml
11
+ end
12
+
13
+ def writeXML(codeName)
14
+ case(codeName)
15
+ when 'cpio' then codeID = '001'
16
+ when 'tar' then codeID = '002'
17
+ when 'highSierra' then codeID = '003'
18
+ when 'iso9660' then codeID = '004'
19
+ when 'iso9660RockRidge' then codeID = '005'
20
+ when 'iso9660AppleHFS' then codeID = '006'
21
+ else
22
+ codeName = 'INVALID MEDIUM FORMAT TYPE'
23
+ codeID = '999'
24
+ end
25
+
26
+ # write xml
27
+ @xml.tag!('gmd:MD_MediumFormatCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_MediumFormatCode',
28
+ :codeListValue=>"#{codeName}",
29
+ :codeSpace=>"#{codeID}"})
30
+ end
31
+
32
+ end
@@ -0,0 +1,44 @@
1
+ # ISO <<CodeLists>> gmd:MD_MediumNameCode
2
+
3
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
4
+ # History:
5
+ # Stan Smith 2013-09-24 original script
6
+
7
+ class MD_MediumNameCode
8
+
9
+ def initialize(xml)
10
+ @xml = xml
11
+ end
12
+
13
+ def writeXML(codeName)
14
+ case(codeName)
15
+ when 'cdRom' then codeID = '001'
16
+ when 'dvd' then codeID = '002'
17
+ when 'dvdRom' then codeID = '003'
18
+ when '3halfInchFloppy' then codeID = '004'
19
+ when '5quarterInchFloppy' then codeID = '005'
20
+ when '7trackTape' then codeID = '006'
21
+ when '9trackTape' then codeID = '007'
22
+ when '3480Cartridge' then codeID = '008'
23
+ when '3490Cartridge' then codeID = '009'
24
+ when '3580Cartridge' then codeID = '010'
25
+ when '4mmCartridgeTape' then codeID = '011'
26
+ when '8mmCartridgeTape' then codeID = '012'
27
+ when '1quarterInchCartridgeTape' then codeID = '013'
28
+ when 'digitalLinearTape' then codeID = '014'
29
+ when 'online' then codeID = '015'
30
+ when 'satellite' then codeID = '016'
31
+ when 'telephoneLink' then codeID = '017'
32
+ when 'hardcopy' then codeID = '018'
33
+ else
34
+ codeName = 'INVALID MEDIUM NAME'
35
+ codeID = '999'
36
+ end
37
+
38
+ # write xml
39
+ @xml.tag!('gmd:MD_MediumNameCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_MediumNameCode',
40
+ :codeListValue=>"#{codeName}",
41
+ :codeSpace=>"#{codeID}"})
42
+ end
43
+
44
+ end
@@ -0,0 +1,32 @@
1
+ # ISO <<CodeLists>> gmd:MD_ObligationCode
2
+ # enumeration
3
+
4
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
5
+
6
+ # History:
7
+ # Stan Smith 2013-10-21 original script
8
+
9
+ class MD_ObligationCode
10
+ def initialize(xml)
11
+ @xml = xml
12
+ end
13
+
14
+ def writeXML(codeName)
15
+ case(codeName)
16
+ when 'mandatory',
17
+ 'optional',
18
+ 'conditional'
19
+ else
20
+ codeName = 'INVALID OBLIGATION'
21
+ end
22
+
23
+ # write xml
24
+ @xml.tag!('gmd:MD_ObligationCode',codeName)
25
+ end
26
+
27
+ end
28
+
29
+
30
+
31
+
32
+
@@ -0,0 +1,31 @@
1
+ # ISO <<CodeLists>> gmd:CI_OnLineFunctionCode
2
+
3
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
4
+ # History:
5
+ # Stan Smith 2013-09-26 original script
6
+
7
+ class CI_OnLineFunctionCode
8
+
9
+ def initialize(xml)
10
+ @xml = xml
11
+ end
12
+
13
+ def writeXML(codeName)
14
+ case(codeName)
15
+ when 'download' then codeID = '001'
16
+ when 'information' then codeID = '002'
17
+ when 'offlineAccess' then codeID = '003'
18
+ when 'order' then codeID = '004'
19
+ when 'search' then codeID = '005'
20
+ else
21
+ codeName = 'INVALID ONLINE FUNCTION CODE'
22
+ codeID = '999'
23
+ end
24
+
25
+ # write xml
26
+ @xml.tag!('gmd:CI_OnLineFunctionCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_OnLineFunctionCode',
27
+ :codeListValue=>"#{codeName}",
28
+ :codeSpace=>"#{codeID}"})
29
+ end
30
+
31
+ end
@@ -0,0 +1,44 @@
1
+ # ISO <<CodeLists>> gmd:CI_PresentationForm
2
+
3
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
4
+ # History:
5
+ # Stan Smith 2013-11-20 original script
6
+
7
+ class CI_PresentationFormCode
8
+ def initialize(xml)
9
+ @xml = xml
10
+ end
11
+
12
+ def writeXML(codeName)
13
+ case(codeName)
14
+ when 'documentDigital' then codeID = '001'
15
+ when 'documentHardcopy' then codeID = '002'
16
+ when 'imageDigital' then codeID = '003'
17
+ when 'imageHardcopy' then codeID = '004'
18
+ when 'mapDigital' then codeID = '005'
19
+ when 'mapHardcopy' then codeID = '006'
20
+ when 'modelDigital' then codeID = '007'
21
+ when 'modelHardcopy' then codeID = '008'
22
+ when 'profileDigital' then codeID = '009'
23
+ when 'profileHardcopy' then codeID = '010'
24
+ when 'tableDigital' then codeID = '011'
25
+ when 'tableHardcopy' then codeID = '012'
26
+ when 'videoDigital' then codeID = '013'
27
+ when 'videoHardcopy' then codeID = '014'
28
+ else
29
+ codeName = 'INVALID PRESENTATION FORM SET'
30
+ codeID = '999'
31
+ end
32
+
33
+ # write xml
34
+ @xml.tag!('gmd:CI_PresentationFormCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode',
35
+ :codeListValue=>"#{codeName}",
36
+ :codeSpace=>"#{codeID}"})
37
+ end
38
+
39
+ end
40
+
41
+
42
+
43
+
44
+
@@ -0,0 +1,33 @@
1
+ # ISO <<CodeLists>> gmd:MD_ProgressCode
2
+
3
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
4
+ # History:
5
+ # Stan Smith 2013-08-26 original script
6
+
7
+ class MD_ProgressCode
8
+ def initialize(xml)
9
+ @xml = xml
10
+ end
11
+
12
+ def writeXML(codeName)
13
+
14
+ case(codeName)
15
+ when 'completed' then codeID = '001'
16
+ when 'historicalArchive' then codeID = '002'
17
+ when 'obsolete' then codeID = '003'
18
+ when 'onGoing' then codeID = '004'
19
+ when 'planned' then codeID = '005'
20
+ when 'required' then codeID = '006'
21
+ when 'underDevelopment' then codeID = '007'
22
+ else
23
+ codeName = 'INVALID ROLE CODE'
24
+ codeID = '999'
25
+ end
26
+
27
+ # write xml
28
+ @xml.tag!('gmd:MD_ProgressCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_ProgressCode',
29
+ :codeListValue=>"#{codeName}",
30
+ :codeSpace=>"#{codeID}"})
31
+ end
32
+
33
+ end
@@ -0,0 +1,38 @@
1
+ # ISO <<CodeLists>> gmd:MD_RestrictionCode
2
+
3
+ # from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
4
+ # History:
5
+ # Stan Smith 2013-10-21 original script
6
+
7
+ class MD_RestrictionCode
8
+ def initialize(xml)
9
+ @xml = xml
10
+ end
11
+
12
+ def writeXML(codeName)
13
+ case(codeName)
14
+ when 'copyright' then codeID = '001'
15
+ when 'patent' then codeID = '002'
16
+ when 'patentPending' then codeID = '003'
17
+ when 'trademark' then codeID = '004'
18
+ when 'license' then codeID = '005'
19
+ when 'intellectualPropertyRights' then codeID = '006'
20
+ when 'restricted' then codeID = '007'
21
+ when 'otherRestrictions' then codeID = '008'
22
+ else
23
+ codeName = 'INVALID RESTRICTION'
24
+ codeID = '999'
25
+ end
26
+
27
+ # write xml
28
+ @xml.tag!('gmd:MD_RestrictionCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_RestrictionCode',
29
+ :codeListValue=>"#{codeName}",
30
+ :codeSpace=>"#{codeID}"})
31
+ end
32
+
33
+ end
34
+
35
+
36
+
37
+
38
+