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
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_lineage.rb', line 25
def self.unpack(hLineage, responseObj)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hLineage.empty?
@MessagePath.issueWarning(500, responseObj)
return nil
end
intMetadataClass = InternalMetadata.new
intLineage = intMetadataClass.newLineage
outContext = 'resource lineage'
haveLineage = false
if hLineage.has_key?('statement')
unless hLineage['statement'] == ''
intLineage[:statement] = hLineage['statement']
haveLineage = true
end
end
if hLineage.has_key?('scope')
hObject = hLineage['scope']
unless hObject.empty?
hReturn = Scope.unpack(hObject, responseObj, outContext)
unless hReturn.nil?
intLineage[:resourceScope] = hReturn
end
end
end
if hLineage.has_key?('citation')
aCitation = hLineage['citation']
aCitation.each do |item|
hCitation = Citation.unpack(item, responseObj, outContext)
unless hCitation.nil?
intLineage[:lineageCitation] << hCitation
end
end
end
if hLineage.has_key?('source')
aSource = hLineage['source']
aSource.each do |item|
hSource = Source.unpack(item, responseObj, outContext)
unless hSource.nil?
intLineage[:dataSources] << hSource
haveLineage = true
end
end
end
if hLineage.has_key?('processStep')
aSteps = hLineage['processStep']
aSteps.each do |item|
hSteps = ProcessStep.unpack(item, responseObj, outContext)
unless hSteps.nil?
intLineage[:processSteps] << hSteps
haveLineage = true
end
end
end
unless haveLineage
@MessagePath.issueError(501, responseObj)
end
return intLineage
end
|