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
63
64
65
66
|
# File 'lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonomy.rb', line 20
def self.unpack(xTaxonomy, hResourceInfo, hResponseObj)
intMetadataClass = InternalMetadata.new
hTaxonomy = intMetadataClass.newTaxonomy
axKeywords = xTaxonomy.xpath('./keywtax')
unless axKeywords.empty?
axKeywords.each do |xKeyword|
Keyword.unpack(xKeyword, hResourceInfo, hResponseObj)
end
end
if axKeywords.empty?
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy keywords are missing'
end
xSystem = xTaxonomy.xpath('./taxonsys')
unless xSystem.empty?
TaxonSystem.unpack(xSystem, hTaxonomy, hResponseObj)
end
general = xTaxonomy.xpath('./taxongen').text
unless general.empty?
hTaxonomy[:generalScope] = general
end
xTaxClass = xTaxonomy.xpath('./taxoncl')
unless xTaxClass.empty?
hTaxonClass = TaxonClass.unpack(xTaxClass, hResponseObj)
unless hTaxonClass.nil?
hTaxonomy[:taxonClasses] << hTaxonClass
end
end
if xTaxClass.empty?
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy classification is missing'
end
return hTaxonomy
end
|