adiwg-mdtranslator 2.0.0rc11 → 2.0.0rc13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +0 -1
  3. data/Rakefile +1 -0
  4. data/adiwg-mdtranslator.gemspec +2 -0
  5. data/lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb +32 -18
  6. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +96 -96
  7. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +35 -35
  8. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_mdJson.rb +102 -105
  9. data/lib/adiwg/mdtranslator/readers/mdReaders.rb +49 -49
  10. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_additionalDocumentation.rb +0 -0
  11. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_boundingBox.rb +0 -0
  12. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_browseGraphic.rb +0 -0
  13. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_citation.rb +0 -0
  14. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_contacts.rb +0 -0
  15. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_dateTime.rb +0 -0
  16. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_distributionInfo.rb +0 -0
  17. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_extent.rb +0 -0
  18. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_geoCoordSystem.rb +0 -0
  19. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_geoProperties.rb +0 -0
  20. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_geographicElement.rb +0 -0
  21. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_metadata.rb +0 -0
  22. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_metadataInfo.rb +0 -0
  23. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_onlineResource.rb +0 -0
  24. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_resourceIdentifier.rb +0 -0
  25. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_resourceInfo.rb +0 -0
  26. data/lib/adiwg/mdtranslator/readers/sbJson/{modules_v0 → modules/Old}/module_responsibleParty.rb +0 -0
  27. data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_body.rb +41 -0
  28. data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_citation.rb +32 -0
  29. data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_id.rb +35 -0
  30. data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_identifier.rb +46 -0
  31. data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_provenance.rb +59 -0
  32. data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_purpose.rb +32 -0
  33. data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_rights.rb +43 -0
  34. data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_sbJson.rb +106 -0
  35. data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_titles.rb +42 -0
  36. data/lib/adiwg/mdtranslator/readers/sbJson/sbJson_reader.rb +56 -198
  37. data/lib/adiwg/mdtranslator/readers/sbJson/version.rb +14 -0
  38. data/lib/adiwg/mdtranslator/version.rb +3 -1
  39. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_codelist.rb +38 -38
  40. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_date.rb +1 -1
  41. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dateTime.rb +1 -1
  42. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_abstract.rb +27 -0
  43. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_citation.rb +6 -6
  44. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_codelists.rb +90 -12
  45. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_contact.rb +12 -4
  46. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_date.rb +4 -4
  47. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_id.rb +16 -17
  48. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_materialRequest.rb +6 -2
  49. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_provenance.rb +2 -18
  50. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_rights.rb +13 -0
  51. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_sbJson.rb +3 -2
  52. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_webLink.rb +23 -2
  53. metadata +59 -22
  54. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_sbJson.rb +0 -52
  55. data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/version.rb +0 -12
@@ -22,15 +22,24 @@ module ADIWG
22
22
  # gather all responsibility objects in intObj
23
23
  aResponsibility = @Namespace.nested_objs_by_element(intObj, 'roleName')
24
24
 
25
+ # set an additional 'Material Request Contact' for each distributor contact
26
+ aMRContacts = @Namespace.nested_objs_by_element(intObj[:metadata][:distributorInfo], 'roleName')
27
+ aMRContactsDup = Marshal::load(Marshal.dump(aMRContacts))
28
+ aMRContactsDup.each do |hResponsibility|
29
+ hResponsibility[:roleName] = 'Material Request Contact'
30
+ aResponsibility << hResponsibility
31
+ end
32
+
25
33
  # make a list of unique role/party contacts
26
34
  aContactList = []
27
35
  aResponsibility.each do |hResponsibility|
28
36
  role = hResponsibility[:roleName]
37
+ sbRole = Codelists.codelist_iso_to_sb('iso_sb_role', :isoCode => role)
38
+ sbRole = sbRole.nil? ? role : sbRole
29
39
  hResponsibility[:parties].each do |hParty|
30
- aContactList << { :role => role, :index => hParty[:contactIndex] }
40
+ aContactList << { :role => sbRole, :index => hParty[:contactIndex] }
31
41
  end
32
42
  end
33
-
34
43
  aContactList = aContactList.uniq
35
44
 
36
45
  end
@@ -62,8 +71,7 @@ module ADIWG
62
71
  json.name hContact[:name]
63
72
  json.contactType type
64
73
  json.personalTitle hContact[:positionName] if type == 'person'
65
- sbRole = Codelists.codelist_iso_to_sb('iso_sb_role', :isoCode => role)
66
- json.type sbRole = sbRole.nil? ? role : sbRole
74
+ json.type role
67
75
  json.email hContact[:eMailList][0] unless hContact[:eMailList].empty?
68
76
  json.hours Hours.build(hContact[:hoursOfService]) unless hContact[:hoursOfService].empty?
69
77
  json.instructions hContact[:contactInstructions]
@@ -26,11 +26,11 @@ module ADIWG
26
26
  # if iso date codes does not map to scienceBase use type = 'Info'
27
27
  if dateType.nil?
28
28
  sbDate[:type] = 'Info'
29
- sbDate[:dateString] = AdiwgDateTimeFun.stringFromDateObject(hDate)
29
+ sbDate[:dateString] = AdiwgDateTimeFun.stringDateTimeFromDateObject(hDate)
30
30
  sbDate[:label] = hDate[:dateType]
31
31
  else
32
32
  sbDate[:type] = dateType
33
- sbDate[:dateString] = AdiwgDateTimeFun.stringFromDateObject(hDate)
33
+ sbDate[:dateString] = AdiwgDateTimeFun.stringDateTimeFromDateObject(hDate)
34
34
  sbDate[:label] = hDate[:description] unless hDate[:description].nil?
35
35
  end
36
36
 
@@ -43,14 +43,14 @@ module ADIWG
43
43
  unless hResource[:timePeriod][:startDateTime].empty?
44
44
  sbDate = {}
45
45
  sbDate[:type] = 'Start'
46
- sbDate[:dateString] = AdiwgDateTimeFun.stringFromDateObject(hResource[:timePeriod][:startDateTime])
46
+ sbDate[:dateString] = AdiwgDateTimeFun.stringDateTimeFromDateObject(hResource[:timePeriod][:startDateTime])
47
47
  sbDate[:label] = hResource[:timePeriod][:description] unless hResource[:timePeriod][:description].nil?
48
48
  aDates << sbDate
49
49
  end
50
50
  unless hResource[:timePeriod][:endDateTime].empty?
51
51
  sbDate = {}
52
52
  sbDate[:type] = 'End'
53
- sbDate[:dateString] = AdiwgDateTimeFun.stringFromDateObject(hResource[:timePeriod][:endDateTime])
53
+ sbDate[:dateString] = AdiwgDateTimeFun.stringDateTimeFromDateObject(hResource[:timePeriod][:endDateTime])
54
54
  sbDate[:label] = hResource[:timePeriod][:description] unless hResource[:timePeriod][:description].nil?
55
55
  aDates << sbDate
56
56
  end
@@ -14,35 +14,34 @@ module ADIWG
14
14
  module Id
15
15
 
16
16
  # use metadataInfo identifier
17
- # else use citation identifier [0]
18
- # else use generated UUID
17
+ # else use citation identifier
18
+ # valid identifier must have namespace = 'gov.sciencebase.catalog'
19
19
  def self.build(intObj)
20
20
 
21
21
  metadataInfo = intObj[:metadata][:metadataInfo]
22
22
  resourceInfo = intObj[:metadata][:resourceInfo]
23
- hIdentifier = metadataInfo[:metadataIdentifier]
23
+ hMetadataId = metadataInfo[:metadataIdentifier]
24
24
  hCitation = resourceInfo[:citation]
25
25
 
26
- id = nil
27
- metadataId = nil
28
- citationId = nil
29
- unless hIdentifier.empty?
30
- metadataId = hIdentifier[:identifier]
26
+ unless hMetadataId.empty?
27
+ if hMetadataId[:namespace] == 'gov.sciencebase.catalog'
28
+ unless hMetadataId[:identifier].nil?
29
+ return hMetadataId[:identifier]
30
+ end
31
+ end
31
32
  end
32
33
 
33
34
  unless hCitation.empty?
34
- unless hCitation[:identifiers].empty?
35
- citationId = hCitation[:identifiers][0][:identifier]
35
+ hCitation[:identifiers].each do |hIdentifier|
36
+ if hIdentifier[:namespace] == 'gov.sciencebase.catalog'
37
+ unless hIdentifier[:identifier].nil?
38
+ return hIdentifier[:identifier]
39
+ end
40
+ end
36
41
  end
37
42
  end
38
43
 
39
- if !metadataId.nil?
40
- id = metadataId
41
- elsif !citationId.nil?
42
- id = citationId
43
- else
44
- id = UUIDTools::UUID.random_create.to_s
45
- end
44
+ return nil
46
45
 
47
46
  end
48
47
 
@@ -3,6 +3,8 @@
3
3
  # History:
4
4
  # Stan Smith 2017-05-25 original script
5
5
 
6
+ require_relative 'sbJson_codelists'
7
+
6
8
  module ADIWG
7
9
  module Mdtranslator
8
10
  module Writers
@@ -23,6 +25,8 @@ module ADIWG
23
25
  end
24
26
  unless hDistributor[:contact].empty?
25
27
  role = hDistributor[:contact][:roleName]
28
+ sbRole = Codelists.codelist_iso_to_sb('iso_sb_role', :isoCode => role)
29
+ sbRole = sbRole.nil? ? role : sbRole
26
30
  aParties = hDistributor[:contact][:parties]
27
31
  aParties.each do |hParty|
28
32
  contactIndex = hParty[:contactIndex]
@@ -31,9 +35,9 @@ module ADIWG
31
35
  unless hContact.empty?
32
36
  name = hContact[:name]
33
37
  if instructions.nil?
34
- materialRequest += name + '(' + role + '); '
38
+ materialRequest += name + '(' + sbRole + '); '
35
39
  else
36
- materialRequest += name + '(' + role + ' - ' + instructions + '); '
40
+ materialRequest += name + '(' + sbRole + ' - ' + instructions + '); '
37
41
  end
38
42
  end
39
43
  end
@@ -10,26 +10,10 @@ module ADIWG
10
10
 
11
11
  module Provenance
12
12
 
13
- def self.build(hMetadataInfo)
14
-
15
- aContacts = hMetadataInfo[:metadataContacts]
16
- aDates = hMetadataInfo[:metadataDates]
13
+ def self.build
17
14
 
18
15
  hProvenance = {}
19
- hProvenance[:dataSource] = 'generated using ADIwg mdTranslator ' + ADIWG::Mdtranslator::VERSION
20
-
21
- aDates.each do |hDate|
22
- if hDate[:dateType] == 'creation'
23
- hProvenance[:dateCreated] = AdiwgDateTimeFun.stringFromDateObject(hDate)
24
- end
25
- if hDate[:dateType] == 'lastUpdate'
26
- hProvenance[:lastUpdated] = AdiwgDateTimeFun.stringFromDateObject(hDate)
27
- end
28
- end
29
-
30
- if hProvenance.empty?
31
- return nil
32
- end
16
+ hProvenance[:annotation] = 'generated using ADIwg mdTranslator ' + ADIWG::Mdtranslator::VERSION
33
17
 
34
18
  hProvenance
35
19
 
@@ -3,6 +3,8 @@
3
3
  # History:
4
4
  # Stan Smith 2017-05-22 original script
5
5
 
6
+ require_relative 'sbJson_codelists'
7
+
6
8
  module ADIWG
7
9
  module Mdtranslator
8
10
  module Writers
@@ -17,9 +19,20 @@ module ADIWG
17
19
  aConstraints.each do |hConstraint|
18
20
  if hConstraint[:type] = 'legal'
19
21
  unless hConstraint[:legalConstraint].empty?
22
+
23
+ # map legal constraint usage restriction codes
24
+ hConstraint[:legalConstraint][:useCodes].each do |code|
25
+ codeDef = Codelists.get_code_definition('iso_restriction', code)
26
+ unless codeDef.nil?
27
+ rights += code + ' - ' + codeDef + '; '
28
+ end
29
+ end
30
+
31
+ # map other legal constraints
20
32
  hConstraint[:legalConstraint][:otherCons].each do |con|
21
33
  rights += con + '; '
22
34
  end
35
+
23
36
  end
24
37
  end
25
38
  end
@@ -21,6 +21,7 @@ require_relative 'sbJson_spatial'
21
21
  require_relative 'sbJson_facet'
22
22
  require_relative 'sbJson_metadataRepository'
23
23
  require_relative 'sbJson_geographicExtent'
24
+ require_relative 'sbJson_abstract'
24
25
 
25
26
  module ADIWG
26
27
  module Mdtranslator
@@ -41,13 +42,13 @@ module ADIWG
41
42
  json.id Id.build(intObj)
42
43
  json.title hCitation[:title] unless hCitation.empty?
43
44
  json.alternateTitles hCitation[:alternateTitles] unless hCitation[:alternateTitles].empty?
44
- json.body resourceInfo[:abstract]
45
+ json.body Abstract.build(resourceInfo[:abstract])
45
46
  json.summary resourceInfo[:shortAbstract]
46
47
  json.citation Citation.build(hCitation) unless hCitation.empty?
47
48
  json.identifiers @Namespace.json_map(hCitation[:identifiers], Identifier) unless hCitation.empty?
48
49
  json.purpose resourceInfo[:purpose]
49
50
  json.rights Rights.build(resourceInfo[:constraints]) unless resourceInfo[:constraints].empty?
50
- json.provenance Provenance.build(metadataInfo)
51
+ json.provenance Provenance.build()
51
52
  json.materialRequestInstructions MaterialRequest.build(distributorInfo) unless distributorInfo.empty?
52
53
  json.parentId ParentId.build(metadataInfo[:parentMetadata]) unless metadataInfo[:parentMetadata].empty?
53
54
  aContactList = Contact.get_contact_list(intObj)
@@ -18,8 +18,17 @@ module ADIWG
18
18
  hWebLink = {}
19
19
 
20
20
  function = hResource[:olResFunction]
21
- function = 'download' if function.nil?
22
- hWebLink[:type] = Codelists.codelist_iso_to_sb('iso_sb_onlineFunction', :isoCode => function)
21
+ if function.nil?
22
+ hWebLink[:type] = 'webLink'
23
+ else
24
+ if Codelists.is_sb_code('iso_sb_onlineFunction', function)
25
+ hWebLink[:type] = function
26
+ else
27
+ sbFunction = Codelists.codelist_iso_to_sb('iso_sb_onlineFunction', :isoCode => function)
28
+ hWebLink[:type] = sbFunction.nil? ? 'webLink' : sbFunction
29
+ end
30
+ end
31
+
23
32
  hWebLink[:typeLabel] = hResource[:olResDesc] unless hResource[:olResDesc].nil?
24
33
  hWebLink[:uri] = hResource[:olResURI] unless hResource[:olResURI].nil?
25
34
  hWebLink[:title] = hResource[:olResName] unless hResource[:olResName].nil?
@@ -50,6 +59,18 @@ module ADIWG
50
59
  end
51
60
  end
52
61
 
62
+ # build webLinks from distributor
63
+ hMetadata[:distributorInfo].each do |aDistribution|
64
+ aDistribution[:distributor].each do |aDistributor|
65
+ aDistributor[:transferOptions].each do |aOption|
66
+ aOption[:onlineOptions].each do |hResource|
67
+ hWebLink = buildWebLink(hResource)
68
+ aLinks << hWebLink unless hWebLink.empty?
69
+ end
70
+ end
71
+ end
72
+ end
73
+
53
74
  if aLinks.empty?
54
75
  return nil
55
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adiwg-mdtranslator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0rc11
4
+ version: 2.0.0rc13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stan Smith
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-06-12 00:00:00.000000000 Z
12
+ date: 2017-06-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -165,6 +165,34 @@ dependencies:
165
165
  - - "~>"
166
166
  - !ruby/object:Gem::Version
167
167
  version: '2.5'
168
+ - !ruby/object:Gem::Dependency
169
+ name: kramdown
170
+ requirement: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - "~>"
173
+ - !ruby/object:Gem::Version
174
+ version: '1.13'
175
+ type: :runtime
176
+ prerelease: false
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - "~>"
180
+ - !ruby/object:Gem::Version
181
+ version: '1.13'
182
+ - !ruby/object:Gem::Dependency
183
+ name: coderay
184
+ requirement: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - "~>"
187
+ - !ruby/object:Gem::Version
188
+ version: '1.1'
189
+ type: :runtime
190
+ prerelease: false
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - "~>"
194
+ - !ruby/object:Gem::Version
195
+ version: '1.1'
168
196
  description: The mdtranslator was written by the Alaska Data Integration Working Group
169
197
  (ADIwg) to assist with creating ISO 19139 metadata records. Input to the mdtranslator
170
198
  is JSON conforming to the mdJson-schema. The mdtranslator architecture allows developers
@@ -282,27 +310,35 @@ files:
282
310
  - lib/adiwg/mdtranslator/readers/mdJson/readme.md
283
311
  - lib/adiwg/mdtranslator/readers/mdJson/version.rb
284
312
  - lib/adiwg/mdtranslator/readers/mdReaders.rb
285
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb
286
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_boundingBox.rb
287
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_browseGraphic.rb
288
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_citation.rb
289
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_contacts.rb
290
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_dateTime.rb
291
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_distributionInfo.rb
292
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_extent.rb
293
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geoCoordSystem.rb
294
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geoProperties.rb
295
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geographicElement.rb
296
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_metadata.rb
297
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_metadataInfo.rb
298
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_onlineResource.rb
299
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_resourceIdentifier.rb
300
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_resourceInfo.rb
301
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_responsibleParty.rb
302
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_sbJson.rb
303
- - lib/adiwg/mdtranslator/readers/sbJson/modules_v0/version.rb
313
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_additionalDocumentation.rb
314
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_boundingBox.rb
315
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_browseGraphic.rb
316
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_citation.rb
317
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_contacts.rb
318
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_dateTime.rb
319
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_distributionInfo.rb
320
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_extent.rb
321
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_geoCoordSystem.rb
322
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_geoProperties.rb
323
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_geographicElement.rb
324
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_metadata.rb
325
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_metadataInfo.rb
326
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_onlineResource.rb
327
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_resourceIdentifier.rb
328
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_resourceInfo.rb
329
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/Old/module_responsibleParty.rb
330
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/module_body.rb
331
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/module_citation.rb
332
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/module_id.rb
333
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/module_identifier.rb
334
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/module_provenance.rb
335
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/module_purpose.rb
336
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/module_rights.rb
337
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/module_sbJson.rb
338
+ - lib/adiwg/mdtranslator/readers/sbJson/modules/module_titles.rb
304
339
  - lib/adiwg/mdtranslator/readers/sbJson/readme.md
305
340
  - lib/adiwg/mdtranslator/readers/sbJson/sbJson_reader.rb
341
+ - lib/adiwg/mdtranslator/readers/sbJson/version.rb
306
342
  - lib/adiwg/mdtranslator/version.rb
307
343
  - lib/adiwg/mdtranslator/writers/html/html_writer.rb
308
344
  - lib/adiwg/mdtranslator/writers/html/readme.md
@@ -580,6 +616,7 @@ files:
580
616
  - lib/adiwg/mdtranslator/writers/mdWriters.rb
581
617
  - lib/adiwg/mdtranslator/writers/sbJson/readme.md
582
618
  - lib/adiwg/mdtranslator/writers/sbJson/sbJson_writer.rb
619
+ - lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_abstract.rb
583
620
  - lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_browseCategory.rb
584
621
  - lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_budget.rb
585
622
  - lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_citation.rb
@@ -624,7 +661,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
624
661
  version: 1.3.1
625
662
  requirements: []
626
663
  rubyforge_project:
627
- rubygems_version: 2.6.8
664
+ rubygems_version: 2.5.2
628
665
  signing_key:
629
666
  specification_version: 4
630
667
  summary: The mdtranslator (metadata translator) is a tool for translating metadata
@@ -1,52 +0,0 @@
1
- require ADIWG::Mdtranslator::Readers::SbJson.readerModule('module_contacts')
2
- require ADIWG::Mdtranslator::Readers::SbJson.readerModule('module_metadata')
3
- #require ADIWG::Mdtranslator::Readers::SbJson.readerModule('module_dataDictionary')
4
-
5
- module ADIWG
6
- module Mdtranslator
7
- module Readers
8
- module SbJson
9
-
10
- def self.unpack(intObj, hSbJson, responseObj)
11
-
12
- # get json schema name and version
13
- hVersion = hSbJson['version']
14
- intObj[:schema][:name] = hVersion['name']
15
- intObj[:schema][:version] = hVersion['version']
16
-
17
- # contact array
18
- # load the array of contacts from the json input
19
- if hSbJson.has_key?('contacts')
20
- aContacts = hSbJson['contacts']
21
- aContacts.each do |hContact|
22
- unless hContact.empty?
23
- intObj[:contacts] << Contact.unpack(hContact, responseObj)
24
- end
25
- end
26
- end
27
- # add default contacts
28
- intObj[:contacts].concat(Contact.setDefaultContacts)
29
-
30
- # metadata section
31
- # load metadata from the hash object
32
- intObj[:metadata] = Metadata.unpack(hSbJson, responseObj, intObj)
33
-
34
- # # data dictionary section
35
- # if hSbJson.has_key?('dataDictionary')
36
- # aDictionary = hSbJson['dataDictionary']
37
- # aDictionary.each do |hDictionary|
38
- # unless hDictionary.empty?
39
- # intObj[:dataDictionary] << DataDictionary.unpack(hDictionary, responseObj)
40
- # end
41
- # end
42
- # end
43
-
44
- # return ADIwg internal container
45
- return intObj
46
-
47
- end
48
-
49
- end
50
- end
51
- end
52
- end
@@ -1,12 +0,0 @@
1
- module ADIWG
2
- module Mdtranslator
3
- module Readers
4
- module SbJson
5
-
6
- # current version of sbJson reader
7
- VERSION = '0.0.0'
8
-
9
- end
10
- end
11
- end
12
- end