adiwg-mdtranslator 2.12.0 → 2.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -1
- data/adiwg-mdtranslator.gemspec +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +2 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/fgdc_reader.rb +4 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georectifiedRepresentation.rb +7 -12
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +12 -11
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +15 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +1 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timePeriod.rb +15 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_transferOption.rb +1 -3
- data/lib/adiwg/mdtranslator/version.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +7 -7
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +6 -5
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_address.rb +104 -104
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_aggregateInformation.rb +63 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/{class_attributeGroup.rb → class_attribute.rb} +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_baseUnit.rb +23 -23
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_boundingBox.rb +64 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_browseGraphic.rb +55 -51
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +24 -14
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contact.rb +96 -91
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_conventionalUnit.rb +45 -45
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_coverageDescription.rb +104 -77
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +23 -8
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataQuality.rb +57 -52
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_date.rb +49 -46
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_definitionUnit.rb +20 -20
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_derivedUnit.rb +32 -32
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dimension.rb +56 -50
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distribution.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distributor.rb +77 -74
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_enumerationList.rb +34 -34
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +190 -186
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extent.rb +66 -66
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_feature.rb +50 -45
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureCollection.rb +35 -35
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureProperties.rb +43 -43
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_format.rb +73 -69
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_fraction.rb +37 -33
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicElement.rb +59 -54
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicExtent.rb +58 -58
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometricObjects.rb +49 -46
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometryCollection.rb +68 -63
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georectified.rb +113 -110
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georeferenceable.rb +78 -75
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gmlIdentifier.rb +17 -17
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_grid.rb +55 -52
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gridRepresentation.rb +19 -19
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_hierarchy.rb +47 -47
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_image.rb +132 -132
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineString.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineage.rb +55 -55
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_locale.rb +51 -48
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_maintenance.rb +114 -105
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdBand.rb +111 -111
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdIdentifier.rb +9 -3
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_measure.rb +58 -41
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_medium.rb +104 -104
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miBand.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +51 -16
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiLine.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPoint.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPolygon.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_onlineResource.rb +79 -76
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_orderProcess.rb +67 -67
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_phone.rb +67 -67
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_point.rb +8 -8
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_polygon.rb +89 -89
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_processStep.rb +9 -3
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rangeDimension.rb +59 -54
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_resolution.rb +47 -47
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +111 -105
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rsIdentifier.rb +71 -65
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scope.rb +54 -50
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scopeDescription.rb +45 -42
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb +92 -89
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_series.rb +55 -55
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_source.rb +98 -91
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_spatialRepresentation.rb +42 -42
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicClassification.rb +63 -59
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicSystem.rb +40 -40
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomy.rb +133 -130
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb +49 -49
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timeInstant.rb +60 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timePeriod.rb +110 -108
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_transferOptions.rb +71 -69
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_unitsOfMeasure.rb +243 -243
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_usage.rb +98 -95
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_useConstraints.rb +38 -38
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vectorRepresentation.rb +48 -48
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_verticalExtent.rb +74 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vouchers.rb +56 -53
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +61 -11
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer_messages_eng.yml +109 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/version.rb +3 -2
- data/lib/adiwg/mdtranslator_cli.rb +21 -4
- metadata +6 -5
@@ -2,62 +2,65 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
5
|
+
# Stan Smith 2018-04-10 add error and warning messaging
|
6
|
+
# Stan Smith 2016-12-09 refactored for mdTranslator/mdJson 2.0
|
7
|
+
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
8
|
+
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
9
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
|
10
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
11
|
+
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
11
12
|
# Stan Smith 2013-11-19 original script
|
12
13
|
|
14
|
+
require_relative '../iso19115_2_writer'
|
13
15
|
require_relative 'class_responsibleParty'
|
14
16
|
|
15
17
|
module ADIWG
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
18
|
+
module Mdtranslator
|
19
|
+
module Writers
|
20
|
+
module Iso19115_2
|
21
|
+
|
22
|
+
class MD_Vouchers
|
23
|
+
|
24
|
+
def initialize(xml, hResponseObj)
|
25
|
+
@xml = xml
|
26
|
+
@hResponseObj = hResponseObj
|
27
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
28
|
+
end
|
29
|
+
|
30
|
+
def writeXML(hVoucher)
|
31
|
+
|
32
|
+
# classes used in MD_Vouchers
|
33
|
+
partyClass = CI_ResponsibleParty.new(@xml, @hResponseObj)
|
34
|
+
|
35
|
+
@xml.tag!('gmd:MD_Vouchers') do
|
36
|
+
|
37
|
+
# voucher - specimen (required)
|
38
|
+
s = hVoucher[:specimen]
|
39
|
+
if s.nil?
|
40
|
+
@NameSpace.issueWarning(340, 'gmd:specimen')
|
41
|
+
else
|
42
|
+
@xml.tag!('gmd:specimen') do
|
43
|
+
@xml.tag!('gco:CharacterString', s)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# voucher - repository (required) {MD_ResponsibleParty}
|
48
|
+
hRParty = hVoucher[:repository]
|
49
|
+
if hRParty.empty?
|
50
|
+
@NameSpace.issueWarning(341, 'gmd:specimen')
|
51
|
+
else
|
52
|
+
role = hRParty[:roleName]
|
53
|
+
hParty = hRParty[:parties][0]
|
54
|
+
@xml.tag!('gmd:reposit') do
|
55
|
+
partyClass.writeXML(role, hParty, 'taxonomic voucher repository')
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
end # gmd:MD_Vouchers tag
|
60
|
+
end # writeXML
|
61
|
+
end # MD_Vouchers class
|
62
|
+
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
63
66
|
end
|
@@ -1,15 +1,16 @@
|
|
1
1
|
# Writer - internal data structure to ISO 19115-2:2009
|
2
2
|
|
3
3
|
# History:
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
4
|
+
# Stan Smith 2018-04-09 add error/warning/notice message methods
|
5
|
+
# Stan Smith 2016-11-14 refactor for mdJson/mdTranslator 2.0
|
6
|
+
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
7
|
+
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
8
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
|
9
|
+
# Stan Smith 2015-06-11 change all codelists to use 'class_codelist' method
|
10
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
11
|
+
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
12
|
+
# Stan Smith 2014-06-04 add internal object pre-scan to create extents
|
13
|
+
# ... for geometry supplemental information
|
13
14
|
# Stan Smith 2013-08-10 original script
|
14
15
|
|
15
16
|
require 'builder'
|
@@ -25,16 +26,22 @@ module ADIWG
|
|
25
26
|
|
26
27
|
# make contact available to the instance
|
27
28
|
@contacts = intObj[:contacts]
|
29
|
+
@hResponseObj = hResponseObj
|
30
|
+
|
31
|
+
# load error message array
|
32
|
+
file = File.join(File.dirname(__FILE__), 'iso19115_2_writer_messages_eng') + '.yml'
|
33
|
+
hMessageList = YAML.load_file(file)
|
34
|
+
@aMessagesList = hMessageList['messageList']
|
28
35
|
|
29
36
|
# set the format of the output file based on the writer specified
|
30
37
|
hResponseObj[:writerOutputFormat] = 'xml'
|
31
38
|
hResponseObj[:writerVersion] = ADIWG::Mdtranslator::Writers::Iso19115_2::VERSION
|
32
39
|
|
33
40
|
# create new XML document
|
34
|
-
xml = Builder::XmlMarkup.new(indent: 3)
|
41
|
+
@xml = Builder::XmlMarkup.new(indent: 3)
|
35
42
|
|
36
43
|
# start writing the ISO 19115-2 XML record
|
37
|
-
metadataWriter = MI_Metadata.new(xml, hResponseObj)
|
44
|
+
metadataWriter = MI_Metadata.new(@xml, hResponseObj)
|
38
45
|
metadata = metadataWriter.writeXML(intObj)
|
39
46
|
|
40
47
|
return metadata
|
@@ -53,6 +60,49 @@ module ADIWG
|
|
53
60
|
|
54
61
|
end
|
55
62
|
|
63
|
+
def self.findMessage(messageId)
|
64
|
+
@aMessagesList.each do |hMessage|
|
65
|
+
if hMessage['id'] == messageId
|
66
|
+
return hMessage['message']
|
67
|
+
end
|
68
|
+
end
|
69
|
+
return nil
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.issueError(messageId, context = nil)
|
73
|
+
message = findMessage(messageId)
|
74
|
+
unless message.nil?
|
75
|
+
message += ': CONTEXT is ' + context unless context.nil?
|
76
|
+
@hResponseObj[:writerMessages] << 'ERROR: ISO-19115-2 writer: ' + message
|
77
|
+
@hResponseObj[:writerPass] = false
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.issueWarning(messageId, tag = nil, context = nil)
|
82
|
+
message = findMessage(messageId)
|
83
|
+
unless message.nil?
|
84
|
+
message += ': CONTEXT is ' + context unless context.nil?
|
85
|
+
if @hResponseObj[:writerForceValid]
|
86
|
+
if tag.nil?
|
87
|
+
issueError(messageId, context)
|
88
|
+
else
|
89
|
+
@xml.tag!(tag, {'gco:nilReason' => 'missing'})
|
90
|
+
@hResponseObj[:writerMessages] << 'WARNING: ISO-19115-2 writer: ' + message
|
91
|
+
end
|
92
|
+
else
|
93
|
+
@hResponseObj[:writerMessages] << 'WARNING: ISO-19115-2 writer: ' + message
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
def self.issueNotice(messageId, context = nil)
|
99
|
+
message = findMessage(messageId)
|
100
|
+
unless message.nil?
|
101
|
+
message += ': CONTEXT is ' + context unless context.nil?
|
102
|
+
@hResponseObj[:writerMessages] << 'NOTICE: ISO-19115-2 writer: ' + message
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
56
106
|
end
|
57
107
|
end
|
58
108
|
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# Writer - messages for ISO 19115-2:2003
|
2
|
+
|
3
|
+
# History:
|
4
|
+
# Stan Smith 2018-04-09 original script
|
5
|
+
|
6
|
+
messageList:
|
7
|
+
- {id: 1, message: "associated resource association type is missing"}
|
8
|
+
|
9
|
+
- {id: 10, message: "bounding box west longitude is missing"}
|
10
|
+
- {id: 11, message: "bounding box east longitude is missing"}
|
11
|
+
- {id: 12, message: "bounding box south latitude is missing"}
|
12
|
+
- {id: 13, message: "bounding box north latitude is missing"}
|
13
|
+
|
14
|
+
- {id: 20, message: "browse graphic file name is missing"}
|
15
|
+
|
16
|
+
- {id: 30, message: "citation title is missing"}
|
17
|
+
- {id: 31, message: "citation dates are missing"}
|
18
|
+
|
19
|
+
- {id: 40, message: "coverage attribute description is missing"}
|
20
|
+
- {id: 41, message: "coverage content type is missing"}
|
21
|
+
|
22
|
+
- {id: 50, message: "resource citation is missing"}
|
23
|
+
- {id: 51, message: "resource abstract is missing"}
|
24
|
+
- {id: 52, message: "resource point of contact is missing"}
|
25
|
+
|
26
|
+
- {id: 60, message: "data quality scope is missing"}
|
27
|
+
|
28
|
+
- {id: 70, message: "date is missing"}
|
29
|
+
- {id: 71, message: "date type is missing"}
|
30
|
+
|
31
|
+
- {id: 80, message: "dimension type is missing"}
|
32
|
+
- {id: 81, message: "dimension size is missing"}
|
33
|
+
|
34
|
+
- {id: 90, message: "distributor contact is missing"}
|
35
|
+
|
36
|
+
- {id: 100, message: "extension extended element name is missing"}
|
37
|
+
- {id: 101, message: "extension extended element definition is missing"}
|
38
|
+
- {id: 102, message: "extension extended element entity type is missing"}
|
39
|
+
- {id: 103, message: "extension extended element parent entity is missing"}
|
40
|
+
- {id: 104, message: "extension extended element rule is missing"}
|
41
|
+
- {id: 105, message: "extension extended element source is missing"}
|
42
|
+
|
43
|
+
- {id: 110, message: "GeoJSON geometry object type is not recognized"}
|
44
|
+
|
45
|
+
- {id: 120, message: "format name is missing"}
|
46
|
+
- {id: 121, message: "format version is missing"}
|
47
|
+
|
48
|
+
- {id: 130, message: "spatial resolution representative fraction denominator is missing"}
|
49
|
+
|
50
|
+
- {id: 140, message: "GeoJSON geometry is not supported by feature"}
|
51
|
+
|
52
|
+
- {id: 150, message: "vector object type is missing"}
|
53
|
+
|
54
|
+
- {id: 160, message: "GeoJSON geometry is not supported by geometry collection"}
|
55
|
+
|
56
|
+
- {id: 170, message: "georectified corner points are missing"}
|
57
|
+
- {id: 171, message: "georectified point in pixel is missing"}
|
58
|
+
|
59
|
+
- {id: 180, message: "georeferenced parameter is missing"}
|
60
|
+
|
61
|
+
- {id: 190, message: "grid representation number of dimensions is missing"}
|
62
|
+
- {id: 191, message: "grid representation dimensions are missing"}
|
63
|
+
- {id: 192, message: "grid representation cell geometry is missing"}
|
64
|
+
|
65
|
+
- {id: 200, message: "keyword section keywords are missing"}
|
66
|
+
|
67
|
+
- {id: 210, message: "locale language code is missing"}
|
68
|
+
- {id: 211, message: "locale character encoding is missing"}
|
69
|
+
|
70
|
+
- {id: 220, message: "maintenance update frequency is missing"}
|
71
|
+
|
72
|
+
- {id: 230, message: "identifier code is missing"}
|
73
|
+
|
74
|
+
- {id: 240, message: "metadata contacts are missing"}
|
75
|
+
- {id: 241, message: "data identification section (resourceInfo) missing"}
|
76
|
+
|
77
|
+
- {id: 250, message: "online resource URL is missing"}
|
78
|
+
|
79
|
+
- {id: 260, message: "process step description is missing"}
|
80
|
+
|
81
|
+
- {id: 270, message: "responsible party role is missing"}
|
82
|
+
|
83
|
+
- {id: 280, message: "scope level (code) is missing"}
|
84
|
+
|
85
|
+
- {id: 290, message: "security constraint classification is missing"}
|
86
|
+
|
87
|
+
- {id: 300, message: "taxonomic level is missing"}
|
88
|
+
- {id: 301, message: "taxonomic name is missing"}
|
89
|
+
|
90
|
+
- {id: 310, message: "taxonomic classification system is missing"}
|
91
|
+
- {id: 311, message: "taxonomic identification reference is missing"}
|
92
|
+
- {id: 312, message: "taxonomic observer is missing"}
|
93
|
+
- {id: 313, message: "taxonomic procedures are missing"}
|
94
|
+
- {id: 314, message: "taxonomic classification is missing"}
|
95
|
+
|
96
|
+
- {id: 320, message: "resource specific usage is missing"}
|
97
|
+
- {id: 321, message: "resource specific usage contact is missing"}
|
98
|
+
|
99
|
+
- {id: 330, message: "vertical extent minimum is missing"}
|
100
|
+
- {id: 331, message: "vertical extent maximum is missing"}
|
101
|
+
- {id: 332, message: "vertical extent coordinate reference system is missing"}
|
102
|
+
|
103
|
+
- {id: 340, message: "taxonomic voucher specimen is missing"}
|
104
|
+
- {id: 341, message: "taxonomic voucher repository is missing"}
|
105
|
+
|
106
|
+
- {id: 350, message: "attribute sequence identifier is missing"}
|
107
|
+
- {id: 351, message: "attribute sequence identifier type is missing"}
|
108
|
+
|
109
|
+
- {id: 360, message: "measure type is invalid; must be one of [distance, length, angle, measure, scale]"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# iso19115-2 version history
|
2
|
-
#
|
2
|
+
# 2.2.0 2018-04-09 add error and warning messaging
|
3
|
+
# 2.1.0 2017-11-13 added support for spatial reference, geologic time, others
|
3
4
|
|
4
5
|
module ADIWG
|
5
6
|
module Mdtranslator
|
@@ -7,7 +8,7 @@ module ADIWG
|
|
7
8
|
module Iso19115_2
|
8
9
|
|
9
10
|
# current version of html writer
|
10
|
-
VERSION = '2.
|
11
|
+
VERSION = '2.2.0'
|
11
12
|
|
12
13
|
end
|
13
14
|
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# ADIwg mdTranslator - Thor CLI for mdtranslator
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-05-04 add support for reader execution messages
|
5
6
|
# Stan Smith 2018-04-07 add 'fgdc' option to reader and writer enum list
|
6
7
|
# Stan Smith 2018-02-26 add 'forceValid' parameter
|
7
8
|
# Stan Smith 2017-04-21 removed inline CSS option
|
@@ -71,6 +72,7 @@ and to choose the level of validation for mdJson input files.
|
|
71
72
|
# puts 'writer: ' + options[:writer]
|
72
73
|
# puts 'validation level: ' + options[:validate]
|
73
74
|
# puts 'showAllTags: ' + options[:showAllTags].to_s
|
75
|
+
# puts 'forceValid: ' + options[:forceValid].to_s
|
74
76
|
# puts 'message format: ' + options[:messages]
|
75
77
|
# puts 'return object: ' + options[:returnObject].to_s
|
76
78
|
# puts 'css link: ' + options[:cssLink]
|
@@ -87,7 +89,7 @@ and to choose the level of validation for mdJson input files.
|
|
87
89
|
cssLink: options[:cssLink])
|
88
90
|
|
89
91
|
# determine return content and type of return ...
|
90
|
-
if mdReturn[:readerStructurePass] && mdReturn[:readerValidationPass]
|
92
|
+
if mdReturn[:readerStructurePass] && mdReturn[:readerValidationPass] && mdReturn[:readerExecutionPass]
|
91
93
|
|
92
94
|
# no problem was found with the input file
|
93
95
|
if options[:writer].nil?
|
@@ -124,7 +126,7 @@ and to choose the level of validation for mdJson input files.
|
|
124
126
|
# build a string with messages issues from parser and validator
|
125
127
|
s = ''
|
126
128
|
s += "Failed\n"
|
127
|
-
s += "Writer failed to generate output or issued
|
129
|
+
s += "Writer failed to generate output or issued ERROR OR WARNING messages \n"
|
128
130
|
s += "See following messages for further information\n"
|
129
131
|
|
130
132
|
# post structure messages
|
@@ -153,10 +155,10 @@ and to choose the level of validation for mdJson input files.
|
|
153
155
|
$stdout.write mdReturn.to_json
|
154
156
|
return
|
155
157
|
else
|
156
|
-
# build a string with messages issues from parser
|
158
|
+
# build a string with messages issues from parser, validator, or reader
|
157
159
|
s = ''
|
158
160
|
s += "Failed\n"
|
159
|
-
s += "Input failed to pass either file structure validation or content
|
161
|
+
s += "Input failed to pass either file structure, validation, or content requirements\n"
|
160
162
|
s += "See following messages for further information\n"
|
161
163
|
|
162
164
|
# post structure messages
|
@@ -187,6 +189,21 @@ and to choose the level of validation for mdJson input files.
|
|
187
189
|
end
|
188
190
|
end
|
189
191
|
|
192
|
+
# post reader execution messages
|
193
|
+
unless mdReturn[:readerExecutionPass].nil?
|
194
|
+
if mdReturn[:readerExecutionPass]
|
195
|
+
s += "Success - Reader execution successful\n"
|
196
|
+
else
|
197
|
+
s += "Fail - Reader execution failed - see following message(s):\n"
|
198
|
+
i = 0
|
199
|
+
mdReturn[:readerExecutionMessages].each do |message|
|
200
|
+
i += 1
|
201
|
+
s += "\nMessage: #{i}\n"
|
202
|
+
s += message.to_s + "\n"
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
190
207
|
$stdout.write s
|
191
208
|
return
|
192
209
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adiwg-mdtranslator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stan Smith
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-05-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -129,14 +129,14 @@ dependencies:
|
|
129
129
|
requirements:
|
130
130
|
- - ">="
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: 2.4.
|
132
|
+
version: 2.4.9
|
133
133
|
type: :runtime
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
137
|
- - ">="
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: 2.4.
|
139
|
+
version: 2.4.9
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
141
|
name: adiwg-mdcodes
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
@@ -625,7 +625,7 @@ files:
|
|
625
625
|
- lib/adiwg/mdtranslator/writers/iso19110/version.rb
|
626
626
|
- lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_address.rb
|
627
627
|
- lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_aggregateInformation.rb
|
628
|
-
- lib/adiwg/mdtranslator/writers/iso19115_2/classes/
|
628
|
+
- lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_attribute.rb
|
629
629
|
- lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_baseUnit.rb
|
630
630
|
- lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_boundingBox.rb
|
631
631
|
- lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_browseGraphic.rb
|
@@ -712,6 +712,7 @@ files:
|
|
712
712
|
- lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_verticalExtent.rb
|
713
713
|
- lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vouchers.rb
|
714
714
|
- lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb
|
715
|
+
- lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer_messages_eng.yml
|
715
716
|
- lib/adiwg/mdtranslator/writers/iso19115_2/readme.md
|
716
717
|
- lib/adiwg/mdtranslator/writers/iso19115_2/version.rb
|
717
718
|
- lib/adiwg/mdtranslator/writers/mdJson/mdJson_writer.rb
|