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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c53862414e84e7d0b81437fcb696fce2a6ecbc3b
|
4
|
+
data.tar.gz: 5a749d352492b147252d482d0dd71d16c4180e52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e571c2edbd822f32dea0cd2387517bd6a1746ae253b9581e3fb059b6cac9ab2e5cecc6be96a1bb1fdefb31b109a51815f03f5c08baf931b139a41a190194055d
|
7
|
+
data.tar.gz: a59a0aedd8178f11d1d8fe7cd006f5d60ea48d494844b041efcbfd2ce2a2a80d8d6d669b465e056bba27c62ac99f55fd1a398feff54c894972b05cf115ba5474
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,21 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [v2.
|
3
|
+
## [v2.13.0](https://github.com/adiwg/mdTranslator/tree/v2.13.0)
|
4
4
|
|
5
|
+
[Full Changelog](https://github.com/adiwg/mdTranslator/compare/v2.12.0...v2.13.0)
|
6
|
+
|
7
|
+
**Closed issues:**
|
8
|
+
|
9
|
+
- Replace local XSD reference in XML expected result files [\#194](https://github.com/adiwg/mdTranslator/issues/194)
|
10
|
+
|
11
|
+
**Merged pull requests:**
|
12
|
+
|
13
|
+
- Refactor ISO 19115-2 writer to use mdJson writer helpers [\#195](https://github.com/adiwg/mdTranslator/pull/195) ([stansmith907](https://github.com/stansmith907))
|
14
|
+
|
15
|
+
## [v2.12.0](https://github.com/adiwg/mdTranslator/tree/v2.12.0) (2018-04-16)
|
16
|
+
[Full Changelog](https://github.com/adiwg/mdTranslator/compare/v2.12.0.pre...v2.12.0)
|
17
|
+
|
18
|
+
## [v2.12.0.pre](https://github.com/adiwg/mdTranslator/tree/v2.12.0.pre) (2018-04-12)
|
5
19
|
[Full Changelog](https://github.com/adiwg/mdTranslator/compare/v2.10.0...v2.12.0.pre)
|
6
20
|
|
7
21
|
**Implemented enhancements:**
|
data/adiwg-mdtranslator.gemspec
CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_runtime_dependency "thor", "~> 0.19"
|
34
34
|
spec.add_runtime_dependency "uuidtools", "~> 2.1"
|
35
35
|
spec.add_runtime_dependency "json-schema", "~> 2.7"
|
36
|
-
spec.add_runtime_dependency "adiwg-mdjson_schemas", ">= 2.4.
|
36
|
+
spec.add_runtime_dependency "adiwg-mdjson_schemas", ">= 2.4.9"
|
37
37
|
spec.add_runtime_dependency "adiwg-mdcodes", "~> 2.6.3"
|
38
38
|
spec.add_runtime_dependency "jbuilder", "~> 2.5"
|
39
39
|
spec.add_runtime_dependency "kramdown", "~> 1.13"
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# fgdc reader
|
2
2
|
|
3
3
|
# History:
|
4
|
+
# Stan Smith 2018-05-04 add reader version to response object
|
4
5
|
# Stan Smith 2017-08-10 original script
|
5
6
|
|
6
7
|
require 'nokogiri'
|
@@ -14,6 +15,9 @@ module ADIWG
|
|
14
15
|
|
15
16
|
def self.readFile(file, hResponseObj)
|
16
17
|
|
18
|
+
# add FGDC reader version
|
19
|
+
hResponseObj[:readerVersionUsed] = ADIWG::Mdtranslator::Readers::Fgdc::VERSION
|
20
|
+
|
17
21
|
# receive XML file
|
18
22
|
if file.nil? || file == ''
|
19
23
|
hResponseObj[:readerStructureMessages] << 'XML file is missing'
|
@@ -107,7 +107,7 @@ module ADIWG
|
|
107
107
|
if hAttribute['allowMany'] === false
|
108
108
|
intAttribute[:mustBeUnique] = hAttribute['allowMany']
|
109
109
|
responseObj[:readerExecutionMessages] <<
|
110
|
-
'
|
110
|
+
'NOTICE: mdJson reader: data dictionary entity attribute "allowMany" is deprecated, use "mustBeUnique"'
|
111
111
|
return nil
|
112
112
|
end
|
113
113
|
end
|
@@ -72,22 +72,17 @@ module ADIWG
|
|
72
72
|
return nil
|
73
73
|
end
|
74
74
|
|
75
|
-
# georectified representation - center points
|
75
|
+
# georectified representation - center points
|
76
76
|
if hGeoRec.has_key?('centerPoint')
|
77
77
|
unless hGeoRec['centerPoint'].empty?
|
78
78
|
intGeoRec[:centerPoint] = hGeoRec['centerPoint']
|
79
79
|
end
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
unless intGeoRec[:centerPoint].length == 2
|
87
|
-
responseObj[:readerExecutionMessages] <<
|
88
|
-
'ERROR: mdJson reader: georectified spatial representation center point must be single 2D coordinate'
|
89
|
-
responseObj[:readerExecutionPass] = false
|
90
|
-
return nil
|
80
|
+
unless intGeoRec[:centerPoint].length == 2
|
81
|
+
responseObj[:readerExecutionMessages] <<
|
82
|
+
'ERROR: mdJson reader: georectified spatial representation center point must be single 2D coordinate'
|
83
|
+
responseObj[:readerExecutionPass] = false
|
84
|
+
return nil
|
85
|
+
end
|
91
86
|
end
|
92
87
|
|
93
88
|
# georectified representation - point in pixel (required)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Stan Smith 2018-04-06 change taxonomy to an array
|
6
6
|
# Stan Smith 2018-02-19 refactored error and warning messaging
|
7
7
|
# Stan Smith 2017-05-16 deprecated topic category
|
8
|
-
#
|
8
|
+
# ... topic category is now handled as keyword list
|
9
9
|
# Stan Smith 2016-11-01 original script
|
10
10
|
|
11
11
|
require 'adiwg/mdtranslator/internal/internal_metadata_obj'
|
@@ -105,19 +105,11 @@ module ADIWG
|
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
|
-
# resource information - credits []
|
109
|
-
if hResInfo.has_key?('credit')
|
110
|
-
hResInfo['credit'].each do |item|
|
111
|
-
unless item == ''
|
112
|
-
intResInfo[:credits] << item
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
108
|
# resource information - resource time period {timePeriod}
|
118
109
|
if hResInfo.has_key?('timePeriod')
|
119
110
|
hObject = hResInfo['timePeriod']
|
120
111
|
unless hObject.empty?
|
112
|
+
hObject[:description] = 'resource time period' if hObject[:description].nil?
|
121
113
|
hReturn = TimePeriod.unpack(hObject, responseObj)
|
122
114
|
unless hReturn.nil?
|
123
115
|
intResInfo[:timePeriod] = hReturn
|
@@ -125,6 +117,15 @@ module ADIWG
|
|
125
117
|
end
|
126
118
|
end
|
127
119
|
|
120
|
+
# resource information - credits []
|
121
|
+
if hResInfo.has_key?('credit')
|
122
|
+
hResInfo['credit'].each do |item|
|
123
|
+
unless item == ''
|
124
|
+
intResInfo[:credits] << item
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
128
129
|
# resource information - status [] (required)
|
129
130
|
if hResInfo.has_key?('status')
|
130
131
|
hResInfo['status'].each do |item|
|
@@ -153,7 +154,7 @@ module ADIWG
|
|
153
154
|
end
|
154
155
|
hReturn = Keyword.unpack(hKeyword, responseObj)
|
155
156
|
unless hReturn.nil?
|
156
|
-
intResInfo[:keywords] << hReturn
|
157
|
+
intResInfo[:keywords] << hReturn
|
157
158
|
end
|
158
159
|
responseObj[:readerExecutionMessages] <<
|
159
160
|
'NOTICE: mdJson reader: TopicCategory is deprecated, items were moved to keywords "isoTopicCategory"'
|
@@ -35,6 +35,8 @@ module ADIWG
|
|
35
35
|
intMetadataClass = InternalMetadata.new
|
36
36
|
intSource = intMetadataClass.newDataSource
|
37
37
|
|
38
|
+
haveRequired = false
|
39
|
+
|
38
40
|
# source - source ID
|
39
41
|
if hSource.has_key?('sourceId')
|
40
42
|
unless hSource['sourceId'] == ''
|
@@ -42,14 +44,12 @@ module ADIWG
|
|
42
44
|
end
|
43
45
|
end
|
44
46
|
|
45
|
-
# source - description (required)
|
47
|
+
# source - description (required if)
|
46
48
|
if hSource.has_key?('description')
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
responseObj[:readerExecutionPass] = false
|
52
|
-
return nil
|
49
|
+
unless hSource['description'] == ''
|
50
|
+
intSource[:description] = hSource['description']
|
51
|
+
haveRequired = true
|
52
|
+
end
|
53
53
|
end
|
54
54
|
|
55
55
|
# source - source citation
|
@@ -114,10 +114,18 @@ module ADIWG
|
|
114
114
|
hReturn = Scope.unpack(hObject, responseObj)
|
115
115
|
unless hReturn.nil?
|
116
116
|
intSource[:scope] = hReturn
|
117
|
+
haveRequired = true
|
117
118
|
end
|
118
119
|
end
|
119
120
|
end
|
120
121
|
|
122
|
+
unless haveRequired
|
123
|
+
responseObj[:readerExecutionMessages] <<
|
124
|
+
'ERROR: mdJson reader: source requires a description or scope'
|
125
|
+
responseObj[:readerExecutionPass] = false
|
126
|
+
return nil
|
127
|
+
end
|
128
|
+
|
121
129
|
return intSource
|
122
130
|
|
123
131
|
end
|
@@ -53,7 +53,7 @@ module ADIWG
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
# taxonomy - identification reference
|
56
|
+
# taxonomy - identification reference [{identifier}]
|
57
57
|
if hTaxonomy.has_key?('identificationReference')
|
58
58
|
aItems = hTaxonomy['identificationReference']
|
59
59
|
aItems.each do |hItem|
|
@@ -65,11 +65,6 @@ module ADIWG
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
68
|
-
if intTaxonomy[:idReferences].empty?
|
69
|
-
responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: taxonomy identification reference object is missing'
|
70
|
-
responseObj[:readerExecutionPass] = false
|
71
|
-
return nil
|
72
|
-
end
|
73
68
|
|
74
69
|
# taxonomy - observer [responsibleParty]
|
75
70
|
if hTaxonomy.has_key?('observer')
|
@@ -113,12 +113,13 @@ module ADIWG
|
|
113
113
|
# error messages
|
114
114
|
unless haveTime
|
115
115
|
responseObj[:readerExecutionMessages] <<
|
116
|
-
'ERROR: mdJson reader: time period must have a
|
116
|
+
'ERROR: mdJson reader: time period must have a start and/or end dateTime, or geologic age'
|
117
117
|
responseObj[:readerExecutionPass] = false
|
118
118
|
return nil
|
119
119
|
end
|
120
120
|
|
121
121
|
# time period - time interval
|
122
|
+
# time interval must have a start and/or end time
|
122
123
|
if hTimePeriod.has_key?('timeInterval')
|
123
124
|
unless hTimePeriod['timeInterval'].empty?
|
124
125
|
hReturn = TimeInterval.unpack(hTimePeriod['timeInterval'], responseObj)
|
@@ -126,9 +127,16 @@ module ADIWG
|
|
126
127
|
intTimePer[:timeInterval] = hReturn
|
127
128
|
end
|
128
129
|
end
|
130
|
+
if intTimePer[:startDateTime].empty? && intTimePer[:endDateTime].empty?
|
131
|
+
responseObj[:readerExecutionMessages] <<
|
132
|
+
'ERROR: mdJson reader: time interval must be accompanied by a start and/or end dateTime'
|
133
|
+
responseObj[:readerExecutionPass] = false
|
134
|
+
return nil
|
135
|
+
end
|
129
136
|
end
|
130
137
|
|
131
138
|
# time period - time duration
|
139
|
+
# duration must have a start and/or end time
|
132
140
|
if hTimePeriod.has_key?('duration')
|
133
141
|
unless hTimePeriod['duration'].empty?
|
134
142
|
hReturn = Duration.unpack(hTimePeriod['duration'], responseObj)
|
@@ -136,6 +144,12 @@ module ADIWG
|
|
136
144
|
intTimePer[:duration] = hReturn
|
137
145
|
end
|
138
146
|
end
|
147
|
+
if intTimePer[:startDateTime].empty? && intTimePer[:endDateTime].empty?
|
148
|
+
responseObj[:readerExecutionMessages] <<
|
149
|
+
'ERROR: mdJson reader: duration must be accompanied by a start and/or end dateTime'
|
150
|
+
responseObj[:readerExecutionPass] = false
|
151
|
+
return nil
|
152
|
+
end
|
139
153
|
end
|
140
154
|
|
141
155
|
return intTimePer
|
@@ -90,9 +90,7 @@ module ADIWG
|
|
90
90
|
# error messages
|
91
91
|
unless haveOption
|
92
92
|
responseObj[:readerExecutionMessages] <<
|
93
|
-
'
|
94
|
-
responseObj[:readerExecutionPass] = false
|
95
|
-
return nil
|
93
|
+
'WARNING: mdJson reader: transfer option did not provide an online or offline option'
|
96
94
|
end
|
97
95
|
|
98
96
|
return intTransOpt
|
@@ -1,6 +1,10 @@
|
|
1
1
|
# adiwg mdTranslator
|
2
2
|
|
3
3
|
# version 2 history
|
4
|
+
# 2.13.0 2018-05-08 add contact name in addition to ID in outContext messaging
|
5
|
+
# 2.13.0 2018-05-30 changed local schema reference in ISO writer tests to remote
|
6
|
+
# 2.13.0 2018-05-03 refactor ISO19115-2 test mdJson to use mdJson generation helpers
|
7
|
+
# 2.13.0 2018-04-09 refactored messaging for ISO19115-2
|
4
8
|
# 2.12.0 2018-04-07 add 'fgdc' option to reader and writer enum list
|
5
9
|
# 2.12.0 2018-04-06 rename taxonomicRank to taxonomicLevel
|
6
10
|
# 2.12.0 2018-04-06 rename latinName to taxonomicNamel
|
@@ -78,7 +82,7 @@
|
|
78
82
|
module ADIWG
|
79
83
|
module Mdtranslator
|
80
84
|
# current mdtranslator version
|
81
|
-
VERSION = "2.
|
85
|
+
VERSION = "2.13.0"
|
82
86
|
end
|
83
87
|
end
|
84
88
|
|
@@ -172,7 +172,7 @@ module ADIWG
|
|
172
172
|
if hResource[:associationType] == 'largerWorkCitation'
|
173
173
|
unless hResource[:resourceCitation].empty?
|
174
174
|
@xml.tag!('lworkcit') do
|
175
|
-
citationClass.writeXML(hResource[:resourceCitation], [])
|
175
|
+
citationClass.writeXML(hResource[:resourceCitation], [], inContext + ' larger work citation')
|
176
176
|
haveLarger = true
|
177
177
|
end
|
178
178
|
break
|
@@ -28,8 +28,10 @@ module ADIWG
|
|
28
28
|
addressClass = Address.new(@xml, @hResponseObj)
|
29
29
|
phoneClass = Phone.new(@xml, @hResponseObj)
|
30
30
|
|
31
|
-
#
|
32
|
-
outContext = '
|
31
|
+
# outContext
|
32
|
+
outContext = 'contact'
|
33
|
+
outContext += ' ' + hContact[:name] unless hContact[:name].nil?
|
34
|
+
outContext += ' (' + hContact[:contactId] + ')' unless hContact[:contactId].nil?
|
33
35
|
|
34
36
|
# set contact type and names
|
35
37
|
contactType = nil
|
@@ -196,7 +196,7 @@ module ADIWG
|
|
196
196
|
if hAssocRes[:associationType] == 'crossReference'
|
197
197
|
haveXRef = true
|
198
198
|
@xml.tag!('crossref') do
|
199
|
-
citationClass.writeXML(hAssocRes[:resourceCitation], [])
|
199
|
+
citationClass.writeXML(hAssocRes[:resourceCitation], [], 'identification section cross reference')
|
200
200
|
end
|
201
201
|
end
|
202
202
|
end
|
@@ -43,7 +43,7 @@ module ADIWG
|
|
43
43
|
# <- resourceLineage.source.sourceCitation
|
44
44
|
unless hSource[:sourceCitation].empty?
|
45
45
|
@xml.tag!('srccite') do
|
46
|
-
citationClass.writeXML(hSource[:sourceCitation], [])
|
46
|
+
citationClass.writeXML(hSource[:sourceCitation], [], 'lineage source')
|
47
47
|
end
|
48
48
|
end
|
49
49
|
if hSource[:sourceCitation].empty?
|
@@ -23,11 +23,11 @@ module ADIWG
|
|
23
23
|
def writeXML(aKeywords)
|
24
24
|
|
25
25
|
# taxonomy bio (keywtax) - taxonomic keywords (required)
|
26
|
-
|
26
|
+
haveTaxKeyword = false
|
27
27
|
aKeywords.each do |hKeySet|
|
28
28
|
type = hKeySet[:keywordType]
|
29
29
|
if type == 'taxon'
|
30
|
-
|
30
|
+
haveTaxKeyword = true
|
31
31
|
@xml.tag!('keywtax') do
|
32
32
|
aKeywords = hKeySet[:keywords]
|
33
33
|
thesaurus = hKeySet[:thesaurus]
|
@@ -49,8 +49,8 @@ module ADIWG
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
52
|
-
unless
|
53
|
-
@NameSpace.
|
52
|
+
unless haveTaxKeyword
|
53
|
+
@NameSpace.issueWarning(422)
|
54
54
|
end
|
55
55
|
|
56
56
|
end # writeXML
|
@@ -35,7 +35,7 @@ module ADIWG
|
|
35
35
|
# taxonomic system (classcit) - system citation (required) {citation}
|
36
36
|
unless hSystem[:citation].empty?
|
37
37
|
@xml.tag!('classcit') do
|
38
|
-
citationClass.writeXML(hSystem[:citation], [])
|
38
|
+
citationClass.writeXML(hSystem[:citation], [], 'taxonomic classification system')
|
39
39
|
end
|
40
40
|
end
|
41
41
|
if hSystem[:citation].empty?
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-05-03 add variable for changing XSD location
|
5
6
|
# Stan Smith 2018-04-03 refactored error and warning messaging
|
6
7
|
# Stan Smith 2017-01-20 refactored for mdJson/mdTranslator 2.0
|
7
8
|
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
@@ -50,6 +51,11 @@ module ADIWG
|
|
50
51
|
@xml.comment!('ADIwg is not responsible for the content of this metadata record')
|
51
52
|
@xml.comment!('This metadata record was generated by mdTranslator ' + version + ' at ' + Time.now.to_s)
|
52
53
|
|
54
|
+
# schema locations
|
55
|
+
# set to 'remoteSchema' before publishing
|
56
|
+
localSchema = 'C:\Users\StanSmith\Projects\ISO\19115\NOAA\schema\gfc\gfc.xsd'
|
57
|
+
remoteSchema = 'ftp://ftp.ncddc.noaa.gov/pub/Metadata/Online_ISO_Training/Intro_to_ISO/schemas/ISObio/gfc/gfc.xsd'
|
58
|
+
|
53
59
|
# FC_FeatureCatalogue
|
54
60
|
@xml.tag!('gfc:FC_FeatureCatalogue',
|
55
61
|
{'xmlns:gmi' => 'http://www.isotc211.org/2005/gmi',
|
@@ -63,13 +69,7 @@ module ADIWG
|
|
63
69
|
'xmlns:gfc' => 'http://www.isotc211.org/2005/gfc',
|
64
70
|
'xmlns:xlink' => 'http://www.w3.org/1999/xlink',
|
65
71
|
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
66
|
-
'xsi:schemaLocation' =>
|
67
|
-
|
68
|
-
# local schema for development
|
69
|
-
# 'xsi:schemaLocation' => 'http://www.isotc211.org/2005/gfc C:\Users\StanSmith\Projects\ISO\19115\NOAA\schema\gfc\gfc.xsd'}) do
|
70
|
-
|
71
|
-
# remote schema for publication
|
72
|
-
# 'xsi:schemaLocation' => 'http://www.isotc211.org/2005/gfc ftp://ftp.ncddc.noaa.gov/pub/Metadata/Online_ISO_Training/Intro_to_ISO/schemas/ISObio/gfc/gfc.xsd'}) do
|
72
|
+
'xsi:schemaLocation' => "http://www.isotc211.org/2005/gfc #{remoteSchema}"}) do
|
73
73
|
|
74
74
|
# feature catalogue - name, version, version date are
|
75
75
|
# are taken from citation
|