adiwg-mdtranslator 2.18.4 → 2.19.0.pre.beta.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +14 -0
  3. data/Gemfile.lock +11 -9
  4. data/adiwg-mdtranslator.gemspec +3 -3
  5. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +27 -11
  6. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dataQuality.rb +149 -0
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb +2 -2
  8. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_conformanceResult.rb +1 -1
  9. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageResult.rb +8 -7
  10. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQuality.rb +4 -4
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQualityReport.rb +8 -16
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_evaluationMethod.rb +1 -1
  13. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_legalConstraint.rb +8 -8
  14. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_qualityMeasure.rb +34 -0
  15. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_qualityResultFile.rb +72 -0
  16. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_rangeElementDescription.rb +2 -2
  17. data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_contact.rb +13 -0
  18. data/lib/adiwg/mdtranslator/version.rb +1 -1
  19. data/lib/adiwg/mdtranslator/writers/fgdc/classes/{class_quality.rb → class_dataQuality.rb} +14 -10
  20. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +3 -3
  21. data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +5 -1
  22. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQuality.rb +39 -18
  23. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQualityReport.rb +385 -0
  24. data/lib/adiwg/mdtranslator/writers/html/sections/html_rangeElementDescription.rb +2 -2
  25. data/lib/adiwg/mdtranslator/writers/html/sections/html_resultFile.rb +60 -0
  26. data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_dataQualityReport.rb +213 -39
  27. data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_qualityResultFile.rb +55 -0
  28. data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_rangeElementDescription.rb +1 -1
  29. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb +1 -1
  30. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageResult.rb +30 -0
  31. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQuality.rb +3 -1
  32. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQualityReport.rb +12 -10
  33. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_descriptiveResult.rb +3 -3
  34. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_funding.rb +2 -2
  35. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_legalConstraint.rb +1 -1
  36. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadata.rb +1 -1
  37. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_qualityMeasure.rb +4 -3
  38. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_qualityResultFile.rb +23 -0
  39. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_standaloneQualityReport.rb +31 -0
  40. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_contact.rb +10 -0
  41. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_additionalDocumentation.rb +1 -1
  42. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_algorithm.rb +1 -1
  43. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_allocation.rb +1 -1
  44. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_associatedResource.rb +2 -2
  45. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_attribute.rb +2 -2
  46. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_attributeGroup.rb +1 -1
  47. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_body.rb +12 -17
  48. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_citation.rb +5 -5
  49. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_classedData.rb +1 -1
  50. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_constraint.rb +5 -5
  51. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_contact.rb +37 -5
  52. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_coverageInfo.rb +3 -3
  53. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataDictionary.rb +5 -5
  54. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataQuality.rb +31 -12
  55. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataQualityReport.rb +385 -0
  56. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_distribution.rb +1 -1
  57. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_distributor.rb +3 -3
  58. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_domain.rb +3 -3
  59. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_domainItem.rb +1 -1
  60. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_entity.rb +5 -5
  61. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_entityAttribute.rb +3 -3
  62. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_extent.rb +3 -3
  63. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_feature.rb +5 -5
  64. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_featureCollection.rb +4 -4
  65. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_featureProperties.rb +1 -1
  66. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_format.rb +1 -1
  67. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_funding.rb +1 -1
  68. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geodeticParameters.rb +2 -2
  69. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geographicElement.rb +4 -4
  70. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geographicExtent.rb +4 -14
  71. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geologicAge.rb +1 -1
  72. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geometryCollection.rb +4 -4
  73. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geometryObject.rb +2 -2
  74. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_georectifiedRepresentation.rb +2 -2
  75. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_georeferenceableRepresentation.rb +3 -3
  76. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_graphic.rb +2 -2
  77. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_gridRepresentation.rb +2 -2
  78. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_identifier.rb +1 -1
  79. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_imageInfo.rb +1 -1
  80. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_keyword.rb +2 -2
  81. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_metadataInfo.rb +9 -9
  82. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_metadataRepository.rb +1 -1
  83. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_processStep.rb +1 -1
  84. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_processing.rb +3 -3
  85. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_rangeElementDescription.rb +2 -2
  86. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_resourceInfo.rb +17 -17
  87. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_responsibility.rb +1 -1
  88. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_resultFile.rb +60 -0
  89. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_scope.rb +12 -12
  90. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_source.rb +2 -2
  91. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_taxonomy.rb +1 -1
  92. metadata +23 -13
  93. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_quality.rb +0 -181
  94. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_bodyScript.js +0 -317
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee12914b52bf9c3e2d2cda21512ad9ec11d1f6130bd2c648af133d8cf34c4bb7
4
- data.tar.gz: fea1b82372e6fa3709e232e3ce51402dd59d77513688757b2c2d04d992f9ebbf
3
+ metadata.gz: f456de4448d18685a212969b02c6195b206d8e461372b317fce02e0066de15d6
4
+ data.tar.gz: 42027d3093840bbd6a3a896000950bef3145d3518d1a41a372e02fc199f25701
5
5
  SHA512:
6
- metadata.gz: ec33267110576817cb630c1e89b93ff42819221fcbf04be01f60619c156ab4b3e118f039900aec28be75defa4291c5a5d6bdf77eb1542395e864e68d2c5fda85
7
- data.tar.gz: 594b0a6433071bd297f907886e3ef07a7bc5568cbb055dd1cb173f629412f3c2cf3beaa836842b4dd07dea777423fe94b514b4181a66342961e73395dc69e7b6
6
+ metadata.gz: d7af3c590f3c28b7f49e6192000ee20c289ce0718e644029c04b0b21d8258422dcb3e1d28183ba945bd3dafcf8cd191a3cc33f086a4e4f06b888b21096fd9159
7
+ data.tar.gz: 482f497b01253e0a7376023afafa051b821ed9dec53346a4e5237ae8b40dbfab0d5a9944333b948af56490c4e2e3ed0ae35d39d2485e378a0d6c833e2fd3bade
@@ -0,0 +1,14 @@
1
+ name: Tests
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v4
10
+ - uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
11
+ with:
12
+ ruby-version: "3.1" # Not needed with a .ruby-version file
13
+ - run: bundle install
14
+ - run: bundle exec rake
data/Gemfile.lock CHANGED
@@ -1,16 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- adiwg-mdtranslator (2.18.4)
5
- adiwg-mdcodes (= 2.8.4)
6
- adiwg-mdjson_schemas (= 2.8.1)
4
+ adiwg-mdtranslator (2.19.0.pre.beta.7)
5
+ adiwg-mdcodes (= 2.9.2)
6
+ adiwg-mdjson_schemas (= 2.9.1)
7
7
  builder (~> 3.2)
8
8
  coderay (~> 1.1)
9
9
  jbuilder (~> 2.5)
10
10
  json (~> 2.0)
11
11
  json-schema (~> 2.7)
12
12
  kramdown (>= 1.13, < 3.0)
13
- nokogiri (~> 1.7)
13
+ nokogiri (~> 1.15)
14
14
  thor (~> 0.19)
15
15
  uuidtools (~> 2.1)
16
16
 
@@ -30,9 +30,9 @@ GEM
30
30
  tzinfo (~> 1.1)
31
31
  addressable (2.8.5)
32
32
  public_suffix (>= 2.0.2, < 6.0)
33
- adiwg-mdcodes (2.8.4)
33
+ adiwg-mdcodes (2.9.2)
34
34
  json (~> 2.0)
35
- adiwg-mdjson_schemas (2.8.1)
35
+ adiwg-mdjson_schemas (2.9.1)
36
36
  builder (3.2.4)
37
37
  coderay (1.1.3)
38
38
  concurrent-ruby (1.2.2)
@@ -51,11 +51,13 @@ GEM
51
51
  loofah (2.21.1)
52
52
  crass (~> 1.0.2)
53
53
  nokogiri (>= 1.5.9)
54
- mini_portile2 (2.4.0)
55
54
  minitest (5.20.0)
56
- nokogiri (1.10.10)
57
- mini_portile2 (~> 2.4.0)
55
+ nokogiri (1.15.5-arm64-darwin)
56
+ racc (~> 1.4)
57
+ nokogiri (1.15.5-x86_64-linux)
58
+ racc (~> 1.4)
58
59
  public_suffix (4.0.7)
60
+ racc (1.7.3)
59
61
  rails-dom-testing (2.1.1)
60
62
  activesupport (>= 5.0.0)
61
63
  minitest
@@ -34,11 +34,11 @@ Gem::Specification.new do |spec|
34
34
  spec.add_runtime_dependency "thor", "~> 0.19"
35
35
  spec.add_runtime_dependency "uuidtools", "~> 2.1"
36
36
  spec.add_runtime_dependency "json-schema", "~> 2.7"
37
- spec.add_runtime_dependency "adiwg-mdjson_schemas", "2.8.1"
38
- spec.add_runtime_dependency "adiwg-mdcodes", "2.8.4"
37
+ spec.add_runtime_dependency "adiwg-mdjson_schemas", "2.9.1"
38
+ spec.add_runtime_dependency "adiwg-mdcodes", "2.9.2"
39
39
  spec.add_runtime_dependency "jbuilder", "~> 2.5"
40
40
  spec.add_runtime_dependency "kramdown", ">= 1.13", "< 3.0"
41
41
  spec.add_runtime_dependency "coderay", "~> 1.1"
42
- spec.add_runtime_dependency "nokogiri", "~> 1.7"
42
+ spec.add_runtime_dependency "nokogiri", "~> 1.15"
43
43
 
44
44
  end
@@ -513,6 +513,14 @@ class InternalMetadata
513
513
  }
514
514
  end
515
515
 
516
+ def newRangeElementDescription
517
+ {
518
+ name: nil,
519
+ definition: nil,
520
+ rangeElement: []
521
+ }
522
+ end
523
+
516
524
  def newImageDescription
517
525
  {
518
526
  illuminationElevationAngle: nil,
@@ -650,13 +658,22 @@ class InternalMetadata
650
658
  }
651
659
  end
652
660
 
661
+ def newQualityResultFile
662
+ {
663
+ fileName: nil,
664
+ fileType: nil,
665
+ fileDescription: nil,
666
+ fileFormat: {}
667
+ }
668
+ end
669
+
653
670
  def newCoverageResult
654
671
  {
655
672
  dateTime: nil,
656
673
  scope: {},
657
- spatialRepresentationType: {},
674
+ spatialRepresentationType: nil,
658
675
  spatialRepresentation: {},
659
- resultContent: [],
676
+ resultContentDescription: {},
660
677
  resourceFormat: {},
661
678
  resultFile: {}
662
679
  }
@@ -705,23 +722,22 @@ class InternalMetadata
705
722
 
706
723
  def newDataQualityReport
707
724
  {
708
- # standaloneQualityReportDetails: nil,
709
- conformanceResult: [],
710
- coverageResult: [],
711
- # derivedElementReport: [],
712
- descriptiveResult: [],
713
- evaluationMethod: {},
725
+ type: nil,
726
+ standaloneQualityReportDetails: nil,
714
727
  qualityMeasure: {},
728
+ evaluationMethod: {},
715
729
  quantitativeResult: [],
716
- # relatedElementReport: []
730
+ descriptiveResult: [],
731
+ conformanceResult: [],
732
+ coverageResult: [],
733
+ derivedElementReport: []
717
734
  }
718
735
  end
719
736
 
720
737
  def newStandaloneReport
721
738
  {
722
- reportReference: {},
723
739
  abstract: nil,
724
- elementReports: []
740
+ reportReference: {},
725
741
  }
726
742
  end
727
743
 
@@ -0,0 +1,149 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc data quality
3
+
4
+ # History:
5
+ # Stan Smith 2017-08-15 original script
6
+
7
+ require 'nokogiri'
8
+ require 'adiwg/mdtranslator/internal/internal_metadata_obj'
9
+ require_relative 'module_lineage'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Readers
14
+ module Fgdc
15
+
16
+ module DataQuality
17
+
18
+ def self.unpack(xDataQual, hMetadata, hDataQuality, hResponseObj)
19
+ intMetadataClass = InternalMetadata.new
20
+
21
+ hDataQuality[:scope] = intMetadataClass.newScope
22
+ hDataQuality[:scope][:scopeCode] = 'tabularDataset'
23
+
24
+ hDataQuality[:systemIdentifier] = {
25
+ uid: UUIDTools::UUID.random_create.to_s,
26
+ label: "CSDGM Data Quality"
27
+ }
28
+
29
+ # data quality 2.1 (attracc) - attribute accuracy
30
+ xAccuracy = xDataQual.xpath('./attracc')
31
+ accuracyReport = xAccuracy.xpath('./attraccr').text
32
+ report = intMetadataClass.newDataQualityReport
33
+ report[:type] = 'NonQuantitativeAttributeAccuracy'
34
+ descriptiveResult = intMetadataClass.newDescriptiveResult
35
+ descriptiveResult[:statement] = accuracyReport
36
+ report[:descriptiveResult] << descriptiveResult
37
+ hDataQuality[:report] << report
38
+
39
+ # data quality 2.1 (qattracc) - Quantitative Attribute Accuracy Assessment
40
+ xQuantitativeAccuracy = xDataQual.xpath('./qattracc')
41
+ unless xQuantitativeAccuracy.xpath('./attraccv').empty?
42
+ value = xQuantitativeAccuracy.xpath('./attraccv').text
43
+ report = intMetadataClass.newDataQualityReport
44
+ report[:type] = 'QuantitativeAttributeAccuracy'
45
+ quantitativeResult = intMetadataClass.newQuantitativeResult
46
+ quantitativeResult[:values] << value
47
+ report[:quantitativeResult] << quantitativeResult
48
+ hDataQuality[:report] << report
49
+ end
50
+
51
+ # data quality 2.2 (logic) - logical consistency (required) (not implemented)
52
+ xLogic = xDataQual.xpath('./logic')
53
+ if xLogic.empty?
54
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: data quality logical consistency section is missing'
55
+ else
56
+ logic = xLogic.text
57
+ report = intMetadataClass.newDataQualityReport
58
+ report[:type] = 'ConceptualConsistency'
59
+ report[:qualityMeasure] = intMetadataClass.newQualityMeasure
60
+ report[:qualityMeasure][:description] = logic
61
+ hDataQuality[:report] << report
62
+ end
63
+
64
+ # data quality 2.3 (complete) - completion report (required)
65
+ xComplete = xDataQual.xpath('./complete')
66
+ if xComplete.empty?
67
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: data quality completion report section is missing'
68
+ else
69
+ complete = xComplete.text
70
+ report = intMetadataClass.newDataQualityReport
71
+ report[:type] = 'CompletenessOmission'
72
+ descriptiveResult = intMetadataClass.newDescriptiveResult
73
+ descriptiveResult[:statement] = complete
74
+ report[:descriptiveResult] << descriptiveResult
75
+ hDataQuality[:report] << report
76
+ end
77
+
78
+ # data quality 2.4 (position) - positional accuracy
79
+ xPositionalAccuracy = xDataQual.xpath('./posacc')
80
+ unless xPositionalAccuracy.empty?
81
+ # horizontal positional accuracy
82
+ xHorizontal = xPositionalAccuracy.xpath('./horizpa')
83
+ unless xHorizontal.empty?
84
+ report = intMetadataClass.newDataQualityReport
85
+ report[:type] = 'AbsoluteExternalPositionalAccuracy'
86
+ unless xHorizontal.xpath('qhorizpa/horizpae').empty?
87
+ report[:qualityMeasure] = intMetadataClass.newQualityMeasure
88
+ report[:qualityMeasure][:description] = xHorizontal.xpath('qhorizpa/horizpae').text
89
+ name = 'Horizontal Positional Accuracy Report'
90
+ report[:qualityMeasure][:nameOfMeasure] << name
91
+ end
92
+ unless xHorizontal.xpath('horizpar').empty?
93
+ report[:evaluationMethod] = intMetadataClass.newEvaluationMethod
94
+ report[:evaluationMethod][:methodDescription] = xHorizontal.xpath('horizpar').text
95
+ end
96
+ unless xHorizontal.xpath('qhorizpa/horizpav').empty?
97
+ quantitativeResult = intMetadataClass.newQuantitativeResult
98
+ value = xHorizontal.xpath('qhorizpa/horizpav').text
99
+ quantitativeResult[:values] << value
100
+ report[:quantitativeResult] << quantitativeResult
101
+ end
102
+ hDataQuality[:report] << report
103
+ end
104
+ # vertical positional accuracy
105
+ xVertical = xPositionalAccuracy.xpath('./vertacc')
106
+ unless xVertical.empty?
107
+ report = intMetadataClass.newDataQualityReport
108
+ report[:type] = 'AbsoluteExternalPositionalAccuracy'
109
+ unless xVertical.xpath('qvertpa/vertacce').empty?
110
+ report[:qualityMeasure] = intMetadataClass.newQualityMeasure
111
+ report[:qualityMeasure][:description] = xVertical.xpath('qvertpa/vertacce').text
112
+ name = 'Vertical Positional Accuracy Report'
113
+ report[:qualityMeasure][:nameOfMeasure] << name
114
+ end
115
+ unless xVertical.xpath('vertaccr').empty?
116
+ report[:evaluationMethod] = intMetadataClass.newEvaluationMethod
117
+ report[:evaluationMethod][:methodDescription] = xVertical.xpath('vertaccr').text
118
+ end
119
+ unless xVertical.xpath('qvertpa/vertaccv').empty?
120
+ quantitativeResult = intMetadataClass.newQuantitativeResult
121
+ value = xVertical.xpath('qvertpa/vertaccv').text
122
+ quantitativeResult[:values] << value
123
+ report[:quantitativeResult] << quantitativeResult
124
+ end
125
+ hDataQuality[:report] << report
126
+ end
127
+ end
128
+
129
+ # data quality 2.5 (lineage) - lineage (required)
130
+ xLineage = xDataQual.xpath('./lineage')
131
+ unless xLineage.empty?
132
+ hLineage = Lineage.unpack(xLineage, hResponseObj)
133
+ unless hLineage.nil?
134
+ hMetadata[:lineageInfo] << hLineage
135
+ end
136
+ end
137
+ if xLineage.nil?
138
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: data quality lineage section is missing'
139
+ end
140
+
141
+ return hDataQuality
142
+ end
143
+
144
+ end
145
+
146
+ end
147
+ end
148
+ end
149
+ end
@@ -10,7 +10,7 @@ require 'uuidtools'
10
10
  require 'adiwg/mdtranslator/internal/internal_metadata_obj'
11
11
  require_relative '../version'
12
12
  require_relative 'module_identification'
13
- require_relative 'module_quality'
13
+ require_relative 'module_dataQuality'
14
14
  require_relative 'module_spatialOrganization'
15
15
  require_relative 'module_spatialReference'
16
16
  require_relative 'module_entityAttribute'
@@ -70,7 +70,7 @@ module ADIWG
70
70
  # metadata (dataqual 2) - data quality
71
71
  xDataQual = xMetadata.xpath('./dataqual')
72
72
  unless xDataQual.empty?
73
- dataQuality = Quality.unpack(xDataQual, hMetadata, hDataQuality, hResponseObj)
73
+ dataQuality = DataQuality.unpack(xDataQual, hMetadata, hDataQuality, hResponseObj)
74
74
  hMetadata[:dataQuality] << dataQuality
75
75
  end
76
76
 
@@ -8,7 +8,7 @@ module ADIWG
8
8
 
9
9
  module ConformanceResult
10
10
 
11
- def self.unpack(hConformanceResult, responseObj, inContext = nil)
11
+ def self.unpack(hConformanceResult, responseObj)
12
12
 
13
13
  intMetadataClass = InternalMetadata.new
14
14
  intConformanceResult = intMetadataClass.newConformanceResult
@@ -1,5 +1,8 @@
1
1
  require_relative 'module_scope'
2
2
  require_relative 'module_spatialRepresentation'
3
+ require_relative 'module_qualityResultFile'
4
+ require_relative 'module_format'
5
+ require_relative 'module_coverageDescription'
3
6
 
4
7
  module ADIWG
5
8
  module Mdtranslator
@@ -7,7 +10,7 @@ module ADIWG
7
10
  module MdJson
8
11
 
9
12
  module CoverageResult
10
- def self.unpack(hResult, responseObj, inContext)
13
+ def self.unpack(hResult, responseObj)
11
14
 
12
15
  intMetadataClass = InternalMetadata.new
13
16
  intResult = intMetadataClass.newCoverageResult
@@ -25,7 +28,6 @@ module ADIWG
25
28
 
26
29
 
27
30
  # spatialRepresentationType
28
- # https://github.com/ISO-TC211/XML/blob/master/standards.iso.org/iso/19115/resources/Codelists/gml/MD_SpatialRepresentationTypeCode.xml
29
31
  if hResult.has_key?('spatialRepresentationType')
30
32
  intResult[:spatialRepresentationType] = hResult['spatialRepresentationType']
31
33
  end
@@ -38,21 +40,20 @@ module ADIWG
38
40
 
39
41
 
40
42
  # resultContent
41
- if hResult.has_key?('resultContent')
42
- intResult[:resultContent] = hResult['resultContent']
43
+ if hResult.has_key?('resultContentDescription')
44
+ intResult[:resultContentDescription] = CoverageDescription.unpack(hResult['resultContentDescription'], responseObj)
43
45
  end
44
46
 
45
47
 
46
48
  # resourceFormat
47
49
  if hResult.has_key?('resourceFormat')
48
- intResult[:resourceFormat] = hResult['resourceFormat']
50
+ intResult[:resourceFormat] = Format.unpack(hResult['resourceFormat'], responseObj)
49
51
  end
50
52
 
51
53
 
52
54
  # resultFile
53
- resultFile
54
55
  if hResult.has_key?('resultFile')
55
- intResult[:resultFile] = hResult['resultFile']
56
+ intResult[:resultFile] = QualiltyResultFile.unpack(hResult['resultFile'], responseObj)
56
57
  end
57
58
 
58
59
  return intResult
@@ -38,11 +38,11 @@ module ADIWG
38
38
  if hDataQuality.has_key?('standaloneQualityReport')
39
39
  hObject = hDataQuality['standaloneQualityReport']
40
40
  unless hObject.empty?
41
- intDataQuality[:standaloneQualityReport] = {}
42
- intDataQuality[:standaloneQualityReport][:abstract] = hObject["abstract"]
41
+ intDataQuality[:standaloneReport] = {}
42
+ intDataQuality[:standaloneReport][:abstract] = hObject["abstract"]
43
43
 
44
- unless hObject["reportRefereence"].nil? || hObject["reportReference"].empty?
45
- intDataQuality[:standaloneQualityReport][:reportReference] = Citation.unpack(hObject["reportReference"], responseObj, inContext)
44
+ unless hObject["reportReference"].nil? || hObject["reportReference"].empty?
45
+ intDataQuality[:standaloneReport][:reportReference] = Citation.unpack(hObject["reportReference"], responseObj, inContext)
46
46
  end
47
47
  end
48
48
  end
@@ -4,6 +4,7 @@ require_relative 'module_coverageResult'
4
4
  require_relative 'module_descriptiveResult'
5
5
  require_relative 'module_quantitativeResult'
6
6
  require_relative 'module_evaluationMethod'
7
+ require_relative 'module_qualityMeasure'
7
8
 
8
9
  module ADIWG
9
10
  module Mdtranslator
@@ -28,6 +29,10 @@ module ADIWG
28
29
 
29
30
  intReport[:type] = hReport["type"]
30
31
 
32
+ if hReport.has_key?('standaloneQualityReportDetails')
33
+ intReport[:standaloneQualityReportDetails] = hReport['standaloneQualityReportDetails']
34
+ end
35
+
31
36
  if hReport.has_key?('conformanceResult')
32
37
  hReport['conformanceResult'].each do |item|
33
38
  hReturn = ConformanceResult.unpack(item, responseObj)
@@ -68,23 +73,10 @@ module ADIWG
68
73
  end
69
74
 
70
75
  if hReport.has_key?('qualityMeasure')
71
- qualityMeasure = hReport['qualityMeasure']
72
- identifier = qualityMeasure['identifier']
73
-
74
- intReport[:qualityMeasure] = {}
75
-
76
- if identifier
77
- intReport[:qualityMeasure][:identifier] = {
78
- identifier: identifier['identifier'],
79
- namespace: identifier['namespace'],
80
- version: identifier['version'],
81
- description: identifier['description']
82
- }
83
- end
76
+ hReturn = QualityMeasure.unpack(hReport['qualityMeasure'], responseObj)
84
77
 
85
- if qualityMeasure
86
- intReport[:qualityMeasure][:name] = qualityMeasure['name']
87
- intReport[:qualityMeasure][:description] = qualityMeasure['description']
78
+ unless hReturn.nil?
79
+ intReport[:qualityMeasure] = hReturn
88
80
  end
89
81
  end
90
82
 
@@ -6,7 +6,7 @@ module ADIWG
6
6
  module MdJson
7
7
 
8
8
  module EvaluationMethod
9
- def self.unpack(hMethod, responseObj, inContext = nil)
9
+ def self.unpack(hMethod, responseObj)
10
10
 
11
11
  intMetadataClass = InternalMetadata.new
12
12
  intMethod = intMetadataClass.newEvaluationMethod
@@ -34,21 +34,21 @@ module ADIWG
34
34
 
35
35
  haveLegal = false
36
36
 
37
- # legal constraint - use constraint []
38
- if hLegalCon.has_key?('useConstraint')
39
- hLegalCon['useConstraint'].each do |item|
37
+ # legal constraint - access constraint []
38
+ if hLegalCon.has_key?('accessConstraint')
39
+ hLegalCon['accessConstraint'].each do |item|
40
40
  unless item == ''
41
- intLegalCon[:useCodes] << item
41
+ intLegalCon[:accessCodes] << item
42
42
  haveLegal = true
43
43
  end
44
44
  end
45
45
  end
46
46
 
47
- # legal constraint - access constraint []
48
- if hLegalCon.has_key?('accessConstraint')
49
- hLegalCon['accessConstraint'].each do |item|
47
+ # legal constraint - use constraint []
48
+ if hLegalCon.has_key?('useConstraint')
49
+ hLegalCon['useConstraint'].each do |item|
50
50
  unless item == ''
51
- intLegalCon[:accessCodes] << item
51
+ intLegalCon[:useCodes] << item
52
52
  haveLegal = true
53
53
  end
54
54
  end
@@ -0,0 +1,34 @@
1
+ require_relative 'module_identifier'
2
+
3
+ module ADIWG
4
+ module Mdtranslator
5
+ module Readers
6
+ module MdJson
7
+
8
+ module QualityMeasure
9
+ def self.unpack(hQualityMeasure, responseObj)
10
+
11
+ intMetadataClass = InternalMetadata.new
12
+ intQualityMeasure = intMetadataClass.newQualityMeasure
13
+
14
+ intQualityMeasure[:description] = hQualityMeasure['description']
15
+
16
+ if hQualityMeasure.has_key?('name')
17
+ intQualityMeasure[:nameOfMeasure] = hQualityMeasure['name']
18
+ end
19
+
20
+ if hQualityMeasure.has_key?('identifier')
21
+ hReturn = Identifier.unpack(hQualityMeasure['identifier'], responseObj)
22
+ unless hReturn.nil?
23
+ intQualityMeasure[:identifier] = hReturn
24
+ end
25
+ end
26
+
27
+ return intQualityMeasure
28
+
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,72 @@
1
+ require_relative 'module_format'
2
+
3
+ module ADIWG
4
+ module Mdtranslator
5
+ module Readers
6
+ module MdJson
7
+
8
+ module QualiltyResultFile
9
+
10
+ def self.unpack(hContent, responseObj)
11
+ @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
12
+
13
+ # return nil object if input is empty
14
+ if hContent.empty?
15
+ @MessagePath.issueWarning(130, responseObj)
16
+ return nil
17
+ end
18
+
19
+ # instance classes needed in script
20
+ intMetadataClass = InternalMetadata.new
21
+ intContent = intMetadataClass.newQualityResultFile
22
+
23
+ # content information - file name (required)
24
+ if hContent.has_key?('fileName')
25
+ unless hContent['fileName'] == ''
26
+ intContent[:fileName] = hContent['fileName']
27
+ end
28
+ end
29
+ if intContent[:fileName].nil?
30
+ @MessagePath.issueError(131, responseObj)
31
+ end
32
+
33
+ # content information - file description (required)
34
+ if hContent.has_key?('fileDescription')
35
+ unless hContent['fileDescription'] == ''
36
+ intContent[:fileDescription] = hContent['fileDescription']
37
+ end
38
+ end
39
+ if intContent[:fileDescription].nil?
40
+ @MessagePath.issueError(132, responseObj)
41
+ end
42
+
43
+ # content information - file type
44
+ if hContent.has_key?('fileType')
45
+ unless hContent['fileType'] == ''
46
+ intContent[:fileType] = hContent['fileType']
47
+ end
48
+ end
49
+ if intContent[:fileType].nil?
50
+ @MessagePath.issueError(131, responseObj)
51
+ end
52
+
53
+ if hContent.has_key?('fileFormat')
54
+ hObject = hContent['fileFormat']
55
+ unless hObject.empty?
56
+ hReturn = Format.unpack(hObject, responseObj)
57
+ unless hReturn.nil?
58
+ intContent[:fileFormat] = hReturn
59
+ end
60
+ end
61
+ end
62
+
63
+ return intContent
64
+
65
+ end
66
+
67
+ end
68
+
69
+ end
70
+ end
71
+ end
72
+ end
@@ -23,8 +23,8 @@ module ADIWG
23
23
  intRangeElementDescription[:definition] = hRangeElementDescription['definition']
24
24
  end
25
25
 
26
- if hRangeElementDescription.has_key?('rangeElements')
27
- intRangeElementDescription[:rangeElements] = hRangeElementDescription['rangeElements']
26
+ if hRangeElementDescription.has_key?('rangeElement')
27
+ intRangeElementDescription[:rangeElement] = hRangeElementDescription['rangeElement']
28
28
  end
29
29
 
30
30
  return intRangeElementDescription
@@ -249,6 +249,19 @@ module ADIWG
249
249
  end
250
250
  end
251
251
 
252
+ # orcId - external contact identifier
253
+ if hSbContact.has_key?('orcId') && hSbContact['contactType'] == 'person'
254
+ hContact[:externalIdentifier] ||= []
255
+ unless hSbContact['orcId'].nil? || hSbContact['orcId'] == ''
256
+ hExternalIdentifier = {
257
+ "identifier": hSbContact['orcId'],
258
+ "namespace": "ORCID",
259
+ "description": "Open Researcher and Contributor Id"
260
+ }
261
+ hContact[:externalIdentifier] << hExternalIdentifier
262
+ end
263
+ end
264
+
252
265
  aContacts << hContact
253
266
  aContacts << hContactOrg unless hContactOrg.empty?
254
267
 
@@ -109,7 +109,7 @@
109
109
  module ADIWG
110
110
  module Mdtranslator
111
111
  # current mdtranslator version
112
- VERSION = "2.18.4"
112
+ VERSION = "2.19.0-beta.7"
113
113
  end
114
114
  end
115
115