adiwg-mdtranslator 2.18.4 → 2.19.0.pre.beta.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +14 -0
- data/Gemfile.lock +11 -9
- data/adiwg-mdtranslator.gemspec +3 -3
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +29 -13
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dataQuality.rb +149 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb +10 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_lineage.rb +14 -11
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_methodology.rb +26 -34
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_process.rb +13 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_conformanceResult.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageResult.rb +8 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQuality.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQualityReport.rb +8 -16
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_evaluationMethod.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_legalConstraint.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_qualityMeasure.rb +34 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_qualityResultFile.rb +72 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_rangeElementDescription.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_contact.rb +13 -0
- data/lib/adiwg/mdtranslator/version.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/{class_quality.rb → class_dataQuality.rb} +14 -10
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQuality.rb +39 -18
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQualityReport.rb +385 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_rangeElementDescription.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resultFile.rb +60 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_dataQualityReport.rb +213 -39
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_mdMetadata.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_organization.rb +1 -19
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_qualityResultFile.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_rangeElementDescription.rb +14 -13
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_sampleDimension.rb +6 -6
- data/lib/adiwg/mdtranslator/writers/iso19115_3/iso19115_3_writer.rb +2 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageResult.rb +30 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQuality.rb +3 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQualityReport.rb +12 -10
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_descriptiveResult.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_funding.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_legalConstraint.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadata.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_qualityMeasure.rb +4 -3
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_qualityResultFile.rb +23 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_standaloneQualityReport.rb +31 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_contact.rb +10 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_additionalDocumentation.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_algorithm.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_allocation.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_associatedResource.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_attribute.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_attributeGroup.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_body.rb +15 -31
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_citation.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_classedData.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_constraint.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_contact.rb +37 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_coverageInfo.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataDictionary.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataQuality.rb +31 -12
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataQualityReport.rb +385 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_distribution.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_distributor.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_domain.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_domainItem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_entity.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_entityAttribute.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_extent.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_feature.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_featureCollection.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_featureProperties.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_format.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_funding.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geodeticParameters.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geographicElement.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geographicExtent.rb +4 -14
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geologicAge.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geometryCollection.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geometryObject.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_georectifiedRepresentation.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_georeferenceableRepresentation.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_graphic.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_gridRepresentation.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_identifier.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_imageInfo.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_keyword.rb +14 -16
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_metadataInfo.rb +10 -9
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_metadataRepository.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_processStep.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_processing.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_rangeElementDescription.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_resourceInfo.rb +17 -17
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_responsibility.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_resultFile.rb +60 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_scope.rb +12 -12
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_source.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_taxonomy.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_timePeriod.rb +1 -3
- metadata +23 -13
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_quality.rb +0 -181
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8647fe7165b6765e1454c49ddb93f00de18a4b1e86ff48484ec4cf8f8871921a
|
4
|
+
data.tar.gz: 00740a0d7738dc25014791ea2d3f7380d9d4e7e3dd67eaed1e277065315401da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dc6c0f0ee4a44fe7007ce96d69de2b4b749d3a3baac6f3d0807c0956c57b43fb8c500a482120c24d2ea862903804975e14ae3b2eb0e275e22c8394906f56a0f
|
7
|
+
data.tar.gz: 4c13b5afadda8b771a411e81f9d773ade5cfb80c219f471ecc4e957bb89012fcd5602708208a40172443a353ef05d35b2763119af7af6cb1e9dd60280b427827
|
@@ -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.
|
5
|
-
adiwg-mdcodes (= 2.
|
6
|
-
adiwg-mdjson_schemas (= 2.
|
4
|
+
adiwg-mdtranslator (2.19.0.pre.beta.8)
|
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.
|
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.
|
33
|
+
adiwg-mdcodes (2.9.2)
|
34
34
|
json (~> 2.0)
|
35
|
-
adiwg-mdjson_schemas (2.
|
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.
|
57
|
-
|
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
|
data/adiwg-mdtranslator.gemspec
CHANGED
@@ -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.
|
38
|
-
spec.add_runtime_dependency "adiwg-mdcodes", "2.
|
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.
|
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
|
-
|
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
|
-
|
709
|
-
|
710
|
-
coverageResult: [],
|
711
|
-
# derivedElementReport: [],
|
712
|
-
descriptiveResult: [],
|
713
|
-
evaluationMethod: {},
|
725
|
+
type: nil,
|
726
|
+
standaloneQualityReportDetails: nil,
|
714
727
|
qualityMeasure: {},
|
728
|
+
evaluationMethod: {},
|
715
729
|
quantitativeResult: [],
|
716
|
-
|
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
|
-
|
740
|
+
reportReference: {},
|
725
741
|
}
|
726
742
|
end
|
727
743
|
|
@@ -935,8 +951,8 @@ class InternalMetadata
|
|
935
951
|
statement: nil,
|
936
952
|
resourceScope: {},
|
937
953
|
lineageCitation: [],
|
938
|
-
|
939
|
-
|
954
|
+
processSteps: [],
|
955
|
+
dataSources: []
|
940
956
|
}
|
941
957
|
end
|
942
958
|
|
@@ -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 '
|
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 =
|
73
|
+
dataQuality = DataQuality.unpack(xDataQual, hMetadata, hDataQuality, hResponseObj)
|
74
74
|
hMetadata[:dataQuality] << dataQuality
|
75
75
|
end
|
76
76
|
|
@@ -231,9 +231,11 @@ module ADIWG
|
|
231
231
|
hCitation[:title] = thesaurus
|
232
232
|
hKeyword[:thesaurus] = hCitation
|
233
233
|
end
|
234
|
-
|
235
|
-
|
236
|
-
|
234
|
+
# This code is being disabled intentionally. While the standard does indicate this is required, in practice it is not always present.
|
235
|
+
# Instead of requiring keywords, we will allow them to be optional for bio lineage.
|
236
|
+
# if thesaurus.empty?
|
237
|
+
# hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO method keyword thesaurus is missing'
|
238
|
+
# end
|
237
239
|
|
238
240
|
# theme keyword bio.1.2 (methkey) - lineage method keywords {keywordObject}
|
239
241
|
axKeywords = xKeywords.xpath('./methkey')
|
@@ -247,9 +249,11 @@ module ADIWG
|
|
247
249
|
end
|
248
250
|
end
|
249
251
|
end
|
250
|
-
|
251
|
-
|
252
|
-
|
252
|
+
# This code is being disabled intentionally. While the standard does indicate this is required, in practice it is not always present.
|
253
|
+
# Instead of requiring keywords, we will allow them to be optional for bio lineage.
|
254
|
+
# if axKeywords.empty?
|
255
|
+
# hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO method keyword is missing'
|
256
|
+
# end
|
253
257
|
|
254
258
|
aKeywords << hKeyword
|
255
259
|
|
@@ -30,21 +30,15 @@ module ADIWG
|
|
30
30
|
# lineage bio (method) - methodology [] (required)
|
31
31
|
axMethods = xLineage.xpath('./method')
|
32
32
|
unless axMethods.empty?
|
33
|
-
|
33
|
+
axMethods.each do |xMethod|
|
34
|
+
hProcess = Method.unpack(hLineage, xMethod, hResponseObj)
|
35
|
+
hLineage[:processSteps] << hProcess
|
36
|
+
end
|
34
37
|
end
|
35
38
|
if axMethods.empty?
|
36
39
|
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO lineage methodology section is missing'
|
37
40
|
end
|
38
|
-
|
39
|
-
# lineage 2.5.1 (srcinfo) - source information []
|
40
|
-
axSource = xLineage.xpath('./srcinfo')
|
41
|
-
unless axSource.empty?
|
42
|
-
axSource.each do |xSource|
|
43
|
-
hSource = Source.unpack(xSource, hResponseObj)
|
44
|
-
hLineage[:dataSources] << hSource
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
41
|
+
|
48
42
|
# lineage 2.5.2 (procstep) - process step [] (required)
|
49
43
|
axProcess = xLineage.xpath('./procstep')
|
50
44
|
unless axProcess.empty?
|
@@ -57,6 +51,15 @@ module ADIWG
|
|
57
51
|
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: lineage process step section is missing'
|
58
52
|
end
|
59
53
|
|
54
|
+
# lineage 2.5.1 (srcinfo) - source information []
|
55
|
+
axSource = xLineage.xpath('./srcinfo')
|
56
|
+
unless axSource.empty?
|
57
|
+
axSource.each do |xSource|
|
58
|
+
hSource = Source.unpack(xSource, hResponseObj)
|
59
|
+
hLineage[:dataSources] << hSource
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
60
63
|
return hLineage
|
61
64
|
|
62
65
|
end
|
@@ -16,53 +16,45 @@ module ADIWG
|
|
16
16
|
|
17
17
|
module Method
|
18
18
|
|
19
|
-
def self.unpack(hLineage,
|
19
|
+
def self.unpack(hLineage, xMethod, hResponseObj)
|
20
20
|
|
21
|
-
statement = ''
|
22
21
|
intObj = Fgdc.get_intObj
|
23
22
|
hResourceInfo = intObj[:metadata][:resourceInfo]
|
24
23
|
|
25
|
-
|
24
|
+
intMetadataClass = InternalMetadata.new
|
25
|
+
hProcessStep = intMetadataClass.newProcessStep
|
26
26
|
|
27
|
-
|
27
|
+
# methodology bio (methtype) - method type (not supported)
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
end
|
29
|
+
# methodology bio (methodid) - method identifier [] {keyword}
|
30
|
+
axKeywords = xMethod.xpath('./methodid')
|
31
|
+
unless axKeywords.empty?
|
32
|
+
axKeywords.each do |xKeyword|
|
33
|
+
Keyword.unpack(xKeyword, hResourceInfo, hResponseObj)
|
35
34
|
end
|
35
|
+
end
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
37
|
+
# methodology bio (methdesc) - method description (required)
|
38
|
+
description = xMethod.xpath('./methdesc').text
|
39
|
+
unless description.empty?
|
40
|
+
hProcessStep[:description] = description
|
41
|
+
end
|
42
|
+
if description.empty?
|
43
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO lineage methodology description is missing'
|
44
|
+
end
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
end
|
46
|
+
# methodology bio (methcite) - method citation [] {citation}
|
47
|
+
axCitations = xMethod.xpath('./methcite')
|
48
|
+
unless axCitations.empty?
|
49
|
+
axCitations.each do |xCitation|
|
50
|
+
hReturn = Citation.unpack(xCitation, hResponseObj)
|
51
|
+
unless hReturn.nil?
|
52
|
+
hProcessStep[:references] << hReturn
|
54
53
|
end
|
55
54
|
end
|
56
|
-
|
57
55
|
end
|
58
56
|
|
59
|
-
|
60
|
-
statement.chomp!('; ')
|
61
|
-
hLineage[:statement] = statement
|
62
|
-
end
|
63
|
-
|
64
|
-
return hLineage
|
65
|
-
|
57
|
+
return hProcessStep
|
66
58
|
end
|
67
59
|
end
|
68
60
|
|
@@ -8,6 +8,7 @@ require 'nokogiri'
|
|
8
8
|
require 'adiwg/mdtranslator/internal/internal_metadata_obj'
|
9
9
|
require_relative 'module_dateTime'
|
10
10
|
require_relative 'module_contact'
|
11
|
+
require_relative 'module_citation'
|
11
12
|
|
12
13
|
module ADIWG
|
13
14
|
module Mdtranslator
|
@@ -37,7 +38,7 @@ module ADIWG
|
|
37
38
|
axUsed.each do |xUsed|
|
38
39
|
usedSrc = xUsed.text
|
39
40
|
unless usedSrc.empty?
|
40
|
-
|
41
|
+
hProcess[:stepSources].each do |hSource|
|
41
42
|
unless hSource[:sourceId].nil?
|
42
43
|
if usedSrc == hSource[:sourceId]
|
43
44
|
hProcess[:stepSources] << hSource
|
@@ -92,6 +93,17 @@ module ADIWG
|
|
92
93
|
end
|
93
94
|
end
|
94
95
|
|
96
|
+
# process (references) - references []
|
97
|
+
axReferences = xProcess.xpath('./reference')
|
98
|
+
unless axReferences.empty?
|
99
|
+
axReferences.each do |xReference|
|
100
|
+
hCitation = Citation.unpack(xReference, hResponseObj)
|
101
|
+
unless hCitation.nil?
|
102
|
+
hProcess[:references] << hCitation
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
95
107
|
return hProcess
|
96
108
|
|
97
109
|
end
|
@@ -95,8 +95,8 @@ module ADIWG
|
|
95
95
|
aCurVersion = currentVersion.split('.')
|
96
96
|
aReqVersion = requestedVersion.split('.')
|
97
97
|
approved = false
|
98
|
-
if aReqVersion[0] == aCurVersion[0]
|
99
|
-
if aReqVersion[1] <= aCurVersion[1]
|
98
|
+
if aReqVersion[0].to_i == aCurVersion[0].to_i
|
99
|
+
if aReqVersion[1].to_i <= aCurVersion[1].to_i
|
100
100
|
approved = true
|
101
101
|
end
|
102
102
|
end
|
@@ -8,7 +8,7 @@ module ADIWG
|
|
8
8
|
|
9
9
|
module ConformanceResult
|
10
10
|
|
11
|
-
def self.unpack(hConformanceResult, responseObj
|
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
|
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?('
|
42
|
-
intResult[:
|
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[:
|
42
|
-
intDataQuality[:
|
41
|
+
intDataQuality[:standaloneReport] = {}
|
42
|
+
intDataQuality[:standaloneReport][:abstract] = hObject["abstract"]
|
43
43
|
|
44
|
-
unless hObject["
|
45
|
-
intDataQuality[:
|
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
|