adiwg-mdtranslator 2.6.1 → 2.7.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 +8 -1
- data/adiwg-mdtranslator.gemspec +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +3 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_attribute.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb +7 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb +35 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_lineage.rb +10 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_methodology.rb +69 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_process.rb +6 -10
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_quality.rb +3 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_range.rb +3 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_raster.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_source.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialOrganization.rb +6 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonSystem.rb +6 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonomy.rb +6 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +101 -94
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicSystem.rb +2 -2
- data/lib/adiwg/mdtranslator/version.rb +4 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_browse.rb +54 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +35 -15
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_constraint.rb +53 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_description.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +39 -3
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +148 -89
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb +6 -6
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_lineage.rb +91 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +94 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_methodKeywords.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +119 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_publisher.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_quality.rb +64 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_security.rb +69 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_series.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +124 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialDomain.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialOrganization.rb +177 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_status.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomy.rb +70 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyClassification.rb +65 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +154 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_timePeriod.rb +22 -16
- data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer.rb +19 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/readme.md +2 -2
- data/lib/adiwg/mdtranslator/writers/html/html_writer.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_entityAttribute.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_source.rb +7 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entityAttribute.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_source.rb +1 -0
- metadata +19 -4
@@ -51,14 +51,17 @@ module ADIWG
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
# taxonomy bio.2.2 (idref) - taxonomic identification reference [] {
|
55
|
-
# -> resourceInfo.taxonomy.idReferences.
|
54
|
+
# taxonomy bio.2.2 (idref) - taxonomic identification reference [] {identifier}
|
55
|
+
# -> resourceInfo.taxonomy.idReferences.authority
|
56
56
|
axTaxRef = xSystem.xpath('./idref')
|
57
57
|
unless axTaxRef.empty?
|
58
58
|
axTaxRef.each do |xTaxRef|
|
59
59
|
hCitation = Citation.unpack(xTaxRef, hResponseObj)
|
60
60
|
unless hCitation.nil?
|
61
|
-
|
61
|
+
hIdentifier = intMetadataClass.newIdentifier
|
62
|
+
hIdentifier[:identifier] = 'none'
|
63
|
+
hIdentifier[:citation] = hCitation
|
64
|
+
hTaxonomy[:idReferences] << hIdentifier
|
62
65
|
end
|
63
66
|
end
|
64
67
|
end
|
@@ -23,11 +23,13 @@ module ADIWG
|
|
23
23
|
intMetadataClass = InternalMetadata.new
|
24
24
|
hTaxonomy = intMetadataClass.newTaxonomy
|
25
25
|
|
26
|
-
# taxonomy bio.1 (keywtax) - taxonomic keywords {keyword}
|
26
|
+
# taxonomy bio.1 (keywtax) - taxonomic keywords [] {keyword}
|
27
27
|
# -> resourceInfo.keywords
|
28
|
-
|
29
|
-
unless
|
30
|
-
|
28
|
+
axKeywords = xTaxonomy.xpath('./keywtax')
|
29
|
+
unless axKeywords.empty?
|
30
|
+
axKeywords.each do |xKeyword|
|
31
|
+
Keyword.unpack(xKeyword, hResourceInfo, hResponseObj)
|
32
|
+
end
|
31
33
|
end
|
32
34
|
|
33
35
|
# taxonomy bio.2 (taxonsys) - taxonomic system
|
@@ -164,26 +164,26 @@ module ADIWG
|
|
164
164
|
end
|
165
165
|
|
166
166
|
# attribute - domain range of values [] {valueRange}
|
167
|
-
if hAttribute.has_key?('
|
168
|
-
aValueRange = hAttribute['
|
167
|
+
if hAttribute.has_key?('valueRange')
|
168
|
+
aValueRange = hAttribute['valueRange']
|
169
169
|
aValueRange.each do |hRange|
|
170
170
|
unless hRange.empty?
|
171
171
|
hReturn = ValueRange.unpack(hRange, responseObj)
|
172
172
|
unless hReturn.nil?
|
173
|
-
intAttribute[:
|
173
|
+
intAttribute[:valueRange] << hReturn
|
174
174
|
end
|
175
175
|
end
|
176
176
|
end
|
177
177
|
end
|
178
178
|
|
179
179
|
# attribute - time period of values [] {timePeriod}
|
180
|
-
if hAttribute.has_key?('
|
181
|
-
aTimePeriods = hAttribute['
|
180
|
+
if hAttribute.has_key?('timePeriod')
|
181
|
+
aTimePeriods = hAttribute['timePeriod']
|
182
182
|
aTimePeriods.each do |hTimePeriod|
|
183
183
|
unless hTimePeriod.empty?
|
184
184
|
hReturn = TimePeriod.unpack(hTimePeriod, responseObj)
|
185
185
|
unless hReturn.nil?
|
186
|
-
intAttribute[:
|
186
|
+
intAttribute[:timePeriod] << hReturn
|
187
187
|
end
|
188
188
|
end
|
189
189
|
end
|
@@ -342,14 +342,14 @@ module ADIWG
|
|
342
342
|
|
343
343
|
# resource information - environment description
|
344
344
|
if hResInfo.has_key?('environmentDescription')
|
345
|
-
|
345
|
+
unless hResInfo['environmentDescription'] == ''
|
346
346
|
intResInfo[:environmentDescription] = hResInfo['environmentDescription']
|
347
347
|
end
|
348
348
|
end
|
349
349
|
|
350
350
|
# resource information - supplemental information
|
351
351
|
if hResInfo.has_key?('supplementalInfo')
|
352
|
-
|
352
|
+
unless hResInfo['supplementalInfo'] == ''
|
353
353
|
intResInfo[:supplementalInfo] = hResInfo['supplementalInfo']
|
354
354
|
end
|
355
355
|
end
|
@@ -16,108 +16,115 @@ require_relative 'module_scope'
|
|
16
16
|
require_relative 'module_spatialResolution'
|
17
17
|
|
18
18
|
module ADIWG
|
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
|
-
|
19
|
+
module Mdtranslator
|
20
|
+
module Readers
|
21
|
+
module MdJson
|
22
|
+
|
23
|
+
module Source
|
24
|
+
|
25
|
+
def self.unpack(hSource, responseObj)
|
26
|
+
|
27
|
+
# return nil object if input is empty
|
28
|
+
if hSource.empty?
|
29
|
+
responseObj[:readerExecutionMessages] << 'Source object is empty'
|
30
|
+
responseObj[:readerExecutionPass] = false
|
31
|
+
return nil
|
32
|
+
end
|
33
|
+
|
34
|
+
# instance classes needed in script
|
35
|
+
intMetadataClass = InternalMetadata.new
|
36
|
+
intSource = intMetadataClass.newDataSource
|
37
|
+
|
38
|
+
# source - source ID
|
39
|
+
if hSource.has_key?('sourceId')
|
40
|
+
unless hSource['sourceId'] == ''
|
41
|
+
intSource[:sourceId] = hSource['sourceId']
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# source - description (required)
|
46
|
+
if hSource.has_key?('description')
|
47
|
+
intSource[:description] = hSource['description']
|
48
|
+
end
|
49
|
+
if intSource[:description].nil? || intSource[:description] == ''
|
50
|
+
responseObj[:readerExecutionMessages] << 'Source description is missing'
|
51
|
+
responseObj[:readerExecutionPass] = false
|
52
|
+
return nil
|
53
|
+
end
|
54
|
+
|
55
|
+
# source - source citation
|
56
|
+
if hSource.has_key?('sourceCitation')
|
57
|
+
hObject = hSource['sourceCitation']
|
58
|
+
unless hObject.empty?
|
59
|
+
hReturn = Citation.unpack(hObject, responseObj)
|
60
|
+
unless hReturn.nil?
|
61
|
+
intSource[:sourceCitation] = hReturn
|
57
62
|
end
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# source - source metadata []
|
67
|
+
if hSource.has_key?('metadataCitation')
|
68
|
+
aCitation = hSource['metadataCitation']
|
69
|
+
aCitation.each do |item|
|
70
|
+
hCitation = Citation.unpack(item, responseObj)
|
71
|
+
unless hCitation.nil?
|
72
|
+
intSource[:metadataCitation] << hCitation
|
68
73
|
end
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# source - spatial resolution
|
78
|
+
if hSource.has_key?('spatialResolution')
|
79
|
+
hObject = hSource['spatialResolution']
|
80
|
+
unless hObject.empty?
|
81
|
+
hReturn = SpatialResolution.unpack(hObject, responseObj)
|
82
|
+
unless hReturn.nil?
|
83
|
+
intSource[:spatialResolution] = hReturn
|
79
84
|
end
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
# source - reference system
|
89
|
+
if hSource.has_key?('referenceSystem')
|
90
|
+
hObject = hSource['referenceSystem']
|
91
|
+
unless hObject.empty?
|
92
|
+
hReturn = SpatialReferenceSystem.unpack(hObject, responseObj)
|
93
|
+
unless hReturn.nil?
|
94
|
+
intSource[:referenceSystem] = hReturn
|
90
95
|
end
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# source - source steps []
|
100
|
+
if hSource.has_key?('sourceProcessStep')
|
101
|
+
aSteps = hSource['sourceProcessStep']
|
102
|
+
aSteps.each do |item|
|
103
|
+
hStep = ProcessStep.unpack(item, responseObj)
|
104
|
+
unless hStep.nil?
|
105
|
+
intSource[:sourceSteps] << hStep
|
101
106
|
end
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
# source - scope {scope}
|
111
|
+
if hSource.has_key?('scope')
|
112
|
+
hObject = hSource['scope']
|
113
|
+
unless hObject.empty?
|
114
|
+
hReturn = Scope.unpack(hObject, responseObj)
|
115
|
+
unless hReturn.nil?
|
116
|
+
intSource[:scope] = hReturn
|
112
117
|
end
|
118
|
+
end
|
119
|
+
end
|
113
120
|
|
114
|
-
|
121
|
+
return intSource
|
115
122
|
|
116
|
-
|
117
|
-
|
118
|
-
end
|
123
|
+
end
|
119
124
|
|
120
125
|
end
|
121
|
-
|
122
|
-
|
126
|
+
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
123
130
|
end
|
@@ -18,7 +18,7 @@ module ADIWG
|
|
18
18
|
|
19
19
|
# return nil object if input is empty
|
20
20
|
if hSystem.empty?
|
21
|
-
responseObj[:readerExecutionMessages] << '
|
21
|
+
responseObj[:readerExecutionMessages] << 'Taxonomic System object is empty'
|
22
22
|
responseObj[:readerExecutionPass] = false
|
23
23
|
return nil
|
24
24
|
end
|
@@ -36,7 +36,7 @@ module ADIWG
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
if intSystem[:citation].empty?
|
39
|
-
responseObj[:readerExecutionMessages] << '
|
39
|
+
responseObj[:readerExecutionMessages] << 'Taxonomic System object is missing citation'
|
40
40
|
responseObj[:readerExecutionPass] = false
|
41
41
|
return nil
|
42
42
|
end
|
@@ -1,6 +1,9 @@
|
|
1
1
|
# adiwg mdTranslator
|
2
2
|
|
3
3
|
# version 2 history
|
4
|
+
# 2.7.0 2017-12-26 add fgdc writer identification info section
|
5
|
+
# 2.7.0 2017-12-26 add fgdc writer data quality info section
|
6
|
+
# 2.7.0 2017-12-26 add fgdc writer spatial domain info section
|
4
7
|
# 2.6.1 2017-11-30 add agreement number to sbJson budget facet
|
5
8
|
# 2.6.1 2017-11-30 add metadataOnlineResources and citation onlineResources to sbJson
|
6
9
|
# 2.6.1 2017-11-30 remove duplicate citation identifiers from sbJson
|
@@ -52,7 +55,7 @@
|
|
52
55
|
module ADIWG
|
53
56
|
module Mdtranslator
|
54
57
|
# current mdtranslator version
|
55
|
-
VERSION = "2.
|
58
|
+
VERSION = "2.7.0"
|
56
59
|
end
|
57
60
|
end
|
58
61
|
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# FGDC <<Class>> Browse
|
2
|
+
# FGDC CSDGM writer output in XML
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2017-12-12 original script
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module Fgdc
|
11
|
+
|
12
|
+
class Browse
|
13
|
+
|
14
|
+
def initialize(xml, hResponseObj)
|
15
|
+
@xml = xml
|
16
|
+
@hResponseObj = hResponseObj
|
17
|
+
end
|
18
|
+
|
19
|
+
def writeXML(hGraphic)
|
20
|
+
|
21
|
+
# browse 1.10.1 (browsen) - browse name (required)
|
22
|
+
unless hGraphic[:graphicName].nil?
|
23
|
+
@xml.tag!('browsen', hGraphic[:graphicName])
|
24
|
+
end
|
25
|
+
if hGraphic[:graphicName].nil?
|
26
|
+
@hResponseObj[:writerPass] = false
|
27
|
+
@hResponseObj[:writerMessages] << 'Browse Graphic is missing name'
|
28
|
+
end
|
29
|
+
|
30
|
+
# browse 1.10.2 (browsed) - browse description (required)
|
31
|
+
unless hGraphic[:graphicDescription].nil?
|
32
|
+
@xml.tag!('browsed', hGraphic[:graphicDescription])
|
33
|
+
end
|
34
|
+
if hGraphic[:graphicDescription].nil?
|
35
|
+
@hResponseObj[:writerPass] = false
|
36
|
+
@hResponseObj[:writerMessages] << 'Browse Graphic is missing description'
|
37
|
+
end
|
38
|
+
|
39
|
+
# browse 1.10.3 (browset) - browse type (required)
|
40
|
+
unless hGraphic[:graphicType].nil?
|
41
|
+
@xml.tag!('browset', hGraphic[:graphicType])
|
42
|
+
end
|
43
|
+
if hGraphic[:graphicType].nil?
|
44
|
+
@hResponseObj[:writerPass] = false
|
45
|
+
@hResponseObj[:writerMessages] << 'Browse Graphic is missing file type'
|
46
|
+
end
|
47
|
+
|
48
|
+
end # writeXML
|
49
|
+
end # Browse
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -5,6 +5,7 @@
|
|
5
5
|
# Stan Smith 2017-11-17 original script
|
6
6
|
|
7
7
|
require 'adiwg/mdtranslator/internal/module_dateTimeFun'
|
8
|
+
require_relative '../fgdc_writer'
|
8
9
|
require_relative 'class_series'
|
9
10
|
require_relative 'class_publisher'
|
10
11
|
require_relative 'class_citation'
|
@@ -21,19 +22,6 @@ module ADIWG
|
|
21
22
|
@hResponseObj = hResponseObj
|
22
23
|
end
|
23
24
|
|
24
|
-
def find_responsibility(hCitation, roleName)
|
25
|
-
aParties = []
|
26
|
-
hCitation[:responsibleParties].each do |hRParty|
|
27
|
-
if hRParty[:roleName] == roleName
|
28
|
-
hRParty[:parties].each do |hParty|
|
29
|
-
aParties << hParty[:contactId]
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
aParties = aParties.uniq
|
34
|
-
return aParties
|
35
|
-
end
|
36
|
-
|
37
25
|
def writeXML(hCitation, aAssocResource)
|
38
26
|
|
39
27
|
seriesClass = Series.new(@xml, @hResponseObj)
|
@@ -45,7 +33,8 @@ module ADIWG
|
|
45
33
|
# citation 8.1 (origin) - originator [] (required)
|
46
34
|
# <- hCitation[:responsibleParties] role = 'originator'
|
47
35
|
haveOriginator = false
|
48
|
-
|
36
|
+
aRParties = hCitation[:responsibleParties]
|
37
|
+
aOriginators = ADIWG::Mdtranslator::Writers::Fgdc.find_responsibility(aRParties, 'originator')
|
49
38
|
aOriginators.each do |contactId|
|
50
39
|
hContact = ADIWG::Mdtranslator::Writers::Fgdc.get_contact(contactId)
|
51
40
|
unless hContact.empty?
|
@@ -65,6 +54,7 @@ module ADIWG
|
|
65
54
|
# citation 8.3 (pubtime) - publication time
|
66
55
|
# <- hCitation[:dates] dateType = 'publication'
|
67
56
|
havePubDate = false
|
57
|
+
havePubTime = false
|
68
58
|
hCitation[:dates].each do |hDate|
|
69
59
|
unless hDate.empty?
|
70
60
|
unless hDate[:dateType].nil?
|
@@ -77,6 +67,7 @@ module ADIWG
|
|
77
67
|
end
|
78
68
|
unless pubTime == 'ERROR'
|
79
69
|
@xml.tag!('pubtime', pubTime)
|
70
|
+
havePubTime = true
|
80
71
|
end
|
81
72
|
break
|
82
73
|
end
|
@@ -87,6 +78,9 @@ module ADIWG
|
|
87
78
|
@hResponseObj[:writerPass] = false
|
88
79
|
@hResponseObj[:writerMessages] << 'Citation is missing publication date'
|
89
80
|
end
|
81
|
+
if !havePubTime && @hResponseObj[:writerShowTags]
|
82
|
+
@xml.tag!('pubtime')
|
83
|
+
end
|
90
84
|
|
91
85
|
# citation 8.4 (title) - title (required)
|
92
86
|
# <- hCitation[:title]
|
@@ -103,6 +97,9 @@ module ADIWG
|
|
103
97
|
unless hCitation[:edition].nil?
|
104
98
|
@xml.tag!('edition', hCitation[:edition])
|
105
99
|
end
|
100
|
+
if hCitation[:edition].nil? && @hResponseObj[:writerShowTags]
|
101
|
+
@xml.tag!('edition')
|
102
|
+
end
|
106
103
|
|
107
104
|
# citation 8.6 (geoform) - geospatial data presentation form
|
108
105
|
# <- hCitation[:presentationForm] [] - take first
|
@@ -112,6 +109,9 @@ module ADIWG
|
|
112
109
|
break
|
113
110
|
end
|
114
111
|
end
|
112
|
+
if hCitation[:presentationForms].empty? && @hResponseObj[:writerShowTags]
|
113
|
+
@xml.tag!('geoform')
|
114
|
+
end
|
115
115
|
|
116
116
|
# citation 8.7 (serinfo) - series information
|
117
117
|
# <- hCitation[:series]
|
@@ -120,25 +120,37 @@ module ADIWG
|
|
120
120
|
seriesClass.writeXML(hCitation[:series])
|
121
121
|
end
|
122
122
|
end
|
123
|
+
if hCitation[:series].empty? && @hResponseObj[:writerShowTags]
|
124
|
+
@xml.tag!('serinfo')
|
125
|
+
end
|
123
126
|
|
124
127
|
# citation 8.8 (pubinfo) - publication information
|
125
128
|
# <- hCitation[:responsibleParties] role = 'publisher'
|
126
129
|
# only take first publisher
|
127
|
-
|
130
|
+
havePublisher = false
|
131
|
+
aRParties = hCitation[:responsibleParties]
|
132
|
+
aPublisher = ADIWG::Mdtranslator::Writers::Fgdc.find_responsibility(aRParties, 'publisher')
|
128
133
|
unless aPublisher.empty?
|
129
134
|
hContact = ADIWG::Mdtranslator::Writers::Fgdc.get_contact(aPublisher[0])
|
130
135
|
unless hContact.empty?
|
131
136
|
@xml.tag!('pubinfo') do
|
132
137
|
pubClass.writeXML(hContact)
|
138
|
+
havePublisher = true
|
133
139
|
end
|
134
140
|
end
|
135
141
|
end
|
142
|
+
if !havePublisher && @hResponseObj[:writerShowTags]
|
143
|
+
@xml.tag!('pubinfo')
|
144
|
+
end
|
136
145
|
|
137
146
|
# citation 8.9 (othercit) - other citation details
|
138
147
|
# <- hCitation[:otherDetails][0] - take first
|
139
148
|
unless hCitation[:otherDetails].empty?
|
140
149
|
@xml.tag!('othercit', hCitation[:otherDetails][0])
|
141
150
|
end
|
151
|
+
if hCitation[:otherDetails].empty? && @hResponseObj[:writerShowTags]
|
152
|
+
@xml.tag!('othercit')
|
153
|
+
end
|
142
154
|
|
143
155
|
# citation 8.10 (onlink) - online linkage []
|
144
156
|
# <- hCitation[:onlineResources][:uri]
|
@@ -147,20 +159,28 @@ module ADIWG
|
|
147
159
|
@xml.tag!('onlink', hOnline[:olResURI])
|
148
160
|
end
|
149
161
|
end
|
162
|
+
if hCitation[:onlineResources].empty? && @hResponseObj[:writerShowTags]
|
163
|
+
@xml.tag!('onlink')
|
164
|
+
end
|
150
165
|
|
151
166
|
# citation 8.11 (lworkcit) - larger work citation
|
152
167
|
# <- associatedResource[] - associationType = 'largerWorkCitation' take first
|
153
168
|
# <- associatedResource[:resourceCitation]
|
169
|
+
haveLarger = false
|
154
170
|
aAssocResource.each do |hResource|
|
155
171
|
if hResource[:associationType] == 'largerWorkCitation'
|
156
172
|
unless hResource[:resourceCitation].empty?
|
157
173
|
@xml.tag!('lworkcit') do
|
158
174
|
citationClass.writeXML(hResource[:resourceCitation], [])
|
175
|
+
haveLarger = true
|
159
176
|
end
|
160
177
|
break
|
161
178
|
end
|
162
179
|
end
|
163
180
|
end
|
181
|
+
if !haveLarger && @hResponseObj[:writerShowTags]
|
182
|
+
@xml.tag!('lworkcit')
|
183
|
+
end
|
164
184
|
|
165
185
|
end # citeinfo tag
|
166
186
|
end # writeXML
|