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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
# File 'lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_metadataInfo.rb', line 20
def self.unpack(hMetadata)
intMetadataClass = InternalMetadata.new
intMetadataInfo = intMetadataClass.newMetadataInfo
hMetadataInfo = hMetadata['metadataInfo']
if hMetadataInfo.has_key?('metadataIdentifier')
hMetadataId = hMetadataInfo['metadataIdentifier']
unless hMetadataId.empty?
intMetadataInfo[:metadataId] = Adiwg_ResourceIdentifier.unpack(hMetadataId)
end
end
if hMetadataInfo.has_key?('parentMetadata')
hParent = hMetadataInfo['parentMetadata']
unless hParent.empty?
intMetadataInfo[:parentMetadata] = Adiwg_Citation.unpack(hParent)
end
end
if hMetadataInfo.has_key?('metadataContact')
aCust = hMetadataInfo['metadataContact']
unless aCust.empty?
aCust.each do |rParty|
intMetadataInfo[:metadataCustodians] << Adiwg_ResponsibleParty.unpack(rParty)
end
end
end
if hMetadataInfo.has_key?('metadataCreationDate')
s = hMetadataInfo['metadataCreationDate']
if s != ''
hDateTime = Adiwg_DateTime.unpack(s)
hDateTime[:dateType] = 'publication'
intMetadataInfo[:metadataCreateDate] = hDateTime
end
end
if hMetadataInfo.has_key?('metadataLastUpdate')
s = hMetadataInfo['metadataLastUpdate']
if s != ''
hDateTime = Adiwg_DateTime.unpack(s)
hDateTime[:dateType] = 'revision'
intMetadataInfo[:metadataUpdateDate] = hDateTime
end
end
if hMetadataInfo.has_key?('metadataUri')
s = hMetadataInfo['metadataUri']
if s != ''
intMetadataInfo[:metadataURI] = s
end
end
if hMetadataInfo.has_key?('metadataStatus')
s = hMetadataInfo['metadataStatus']
if s != ''
intMetadataInfo[:metadataStatus] = s
end
end
if hMetadataInfo.has_key?('metadataMaintenance')
hMetaMaint = hMetadataInfo['metadataMaintenance']
unless hMetaMaint.empty?
intMetadataInfo[:maintInfo] = Adiwg_ResourceMaintenance.unpack(hMetaMaint)
end
end
if hMetadata.has_key?('resourceInfo')
resourceInfo = hMetadata['resourceInfo']
if resourceInfo.has_key?('taxonomy')
hTaxonomy = resourceInfo['taxonomy']
unless hTaxonomy.empty?
intMetadataInfo[:extensions] << Adiwg_MetadataExtension.addExtensionISObio
end
end
end
return intMetadataInfo
end
|