adiwg-mdtranslator 2.0.0rc8 → 2.0.0rc9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/adiwg/mdtranslator/internal/module_coordinates.rb +26 -1
- data/lib/adiwg/mdtranslator/version.rb +4 -1
- data/lib/adiwg/mdtranslator/writers/html/readme.md +4 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +53 -42
- data/lib/adiwg/mdtranslator/writers/sbJson/readme.md +8 -1
- data/lib/adiwg/mdtranslator/writers/sbJson/sbJson_writer.rb +30 -1
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_browseCategory.rb +39 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_budget.rb +63 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_citation.rb +10 -3
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_codelists.rb +170 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_contact.rb +119 -40
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_date.rb +40 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_facet.rb +47 -24
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_hours.rb +35 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_materialRequest.rb +59 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_parentId.rb +37 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_project.rb +47 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_provenance.rb +4 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_publication.rb +54 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_sbJson.rb +25 -27
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_spatial.rb +49 -41
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_tag.rb +82 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_webLink.rb +66 -0
- metadata +14 -4
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_base.rb +0 -19
@@ -1,45 +1,124 @@
|
|
1
|
+
# sbJson 1.0 writer
|
2
|
+
|
3
|
+
# History:
|
4
|
+
# Stan Smith 2017-05-25 refactored for mdJson/mdTranslator 2.0
|
5
|
+
# Josh Bradley original script
|
6
|
+
|
1
7
|
require 'jbuilder'
|
8
|
+
require_relative 'sbJson_codelists'
|
9
|
+
require_relative 'sbJson_hours'
|
2
10
|
|
3
11
|
module ADIWG
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
12
|
+
module Mdtranslator
|
13
|
+
module Writers
|
14
|
+
module SbJson
|
15
|
+
|
16
|
+
module Contact
|
17
|
+
|
18
|
+
@Namespace = ADIWG::Mdtranslator::Writers::SbJson
|
19
|
+
|
20
|
+
def self.get_contact_list(intObj)
|
21
|
+
|
22
|
+
# gather all responsibility objects in intObj
|
23
|
+
aResponsibility = @Namespace.nested_objs_by_element(intObj, 'roleName')
|
24
|
+
|
25
|
+
# make a list of unique role/party contacts
|
26
|
+
aContactList = []
|
27
|
+
aResponsibility.each do |hResponsibility|
|
28
|
+
role = hResponsibility[:roleName]
|
29
|
+
hResponsibility[:parties].each do |hParty|
|
30
|
+
aContactList << { :role => role, :index => hParty[:contactIndex] }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
aContactList = aContactList.uniq
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.build(hParty)
|
39
|
+
|
40
|
+
Jbuilder.new do |json|
|
41
|
+
|
42
|
+
role = hParty[:role]
|
43
|
+
hContact = @Namespace.get_contact_by_index(hParty[:index])
|
44
|
+
|
45
|
+
unless hContact.empty?
|
46
|
+
|
47
|
+
type = hContact[:isOrganization] ? 'organization' : 'person'
|
48
|
+
|
49
|
+
orgName = nil
|
50
|
+
unless hContact[:memberOfOrgs].empty?
|
51
|
+
orgContact = @Namespace.get_contact_by_id(hContact[:memberOfOrgs][0])
|
52
|
+
orgName = orgContact[:name]
|
53
|
+
end
|
54
|
+
logoUrl = nil
|
55
|
+
unless hContact[:logos].empty?
|
56
|
+
logo0 = hContact[:logos][0]
|
57
|
+
unless logo0[:graphicURI].empty?
|
58
|
+
logoUrl = logo0[:graphicURI][0][:olResURI]
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
json.name hContact[:name]
|
63
|
+
json.contactType type
|
64
|
+
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
|
67
|
+
json.email hContact[:eMailList][0] unless hContact[:eMailList].empty?
|
68
|
+
json.hours Hours.build(hContact[:hoursOfService]) unless hContact[:hoursOfService].empty?
|
69
|
+
json.instructions hContact[:contactInstructions]
|
70
|
+
json.tty hContact[:phones].collect {|ph| ph[:phoneNumber] if
|
71
|
+
ph[:phoneServiceTypes].include?('tty')}.reject(&:nil?).first
|
72
|
+
json.organization {json.displayText orgName} unless orgName.nil?
|
73
|
+
json.logoUrl logoUrl unless logoUrl.nil?
|
74
|
+
|
75
|
+
if !hContact[:addresses].empty? || !hContact[:phones].empty?
|
76
|
+
json.primaryLocation do
|
77
|
+
unless hContact[:phones].empty?
|
78
|
+
json.officePhone hContact[:phones].collect {|ph| ph[:phoneNumber] if
|
79
|
+
ph[:phoneServiceTypes].include?('voice')}.reject(&:nil?).first
|
80
|
+
json.faxPhone hContact[:phones].collect {|ph| ph[:phoneNumber] if
|
81
|
+
ph[:phoneServiceTypes].include?('fax')}.reject(&:nil?).first
|
82
|
+
end
|
83
|
+
unless hContact[:addresses].empty?
|
84
|
+
aAddress = hContact[:addresses]
|
85
|
+
json.description aAddress[0][:description]
|
86
|
+
aAddress.each do |hAddress|
|
87
|
+
if hAddress[:addressTypes].include?('physical')
|
88
|
+
json.streetAddress do
|
89
|
+
unless hAddress[:deliveryPoints].empty?
|
90
|
+
json.line1 hAddress[:deliveryPoints][0]
|
91
|
+
json.line2 hAddress[:deliveryPoints][1]
|
92
|
+
end
|
93
|
+
json.city hAddress[:city]
|
94
|
+
json.state hAddress[:adminArea]
|
95
|
+
json.zip hAddress[:postalCode]
|
96
|
+
json.country hAddress[:country]
|
97
|
+
end
|
98
|
+
end
|
99
|
+
if hAddress[:addressTypes].include?('mailing')
|
100
|
+
json.mailAddress do
|
101
|
+
unless hAddress[:deliveryPoints].empty?
|
102
|
+
json.line1 hAddress[:deliveryPoints][0]
|
103
|
+
json.line2 hAddress[:deliveryPoints][1]
|
104
|
+
end
|
105
|
+
json.city hAddress[:city]
|
106
|
+
json.state hAddress[:adminArea]
|
107
|
+
json.zip hAddress[:postalCode]
|
108
|
+
json.country hAddress[:country]
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
end # build
|
119
|
+
end # Module Contacts
|
120
|
+
|
121
|
+
end
|
42
122
|
end
|
43
|
-
|
44
|
-
end
|
123
|
+
end
|
45
124
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# sbJson 1.0 writer date
|
2
|
+
|
3
|
+
# History:
|
4
|
+
# Stan Smith 2017-06-01 original script
|
5
|
+
|
6
|
+
require_relative 'sbJson_codelists'
|
7
|
+
|
8
|
+
module ADIWG
|
9
|
+
module Mdtranslator
|
10
|
+
module Writers
|
11
|
+
module SbJson
|
12
|
+
|
13
|
+
module Date
|
14
|
+
|
15
|
+
def self.build(hCitation)
|
16
|
+
|
17
|
+
aDates = []
|
18
|
+
|
19
|
+
hCitation[:dates].each do |hDate|
|
20
|
+
sbDate = {}
|
21
|
+
sbDate[:type] = Codelists.codelist_iso_to_sb('iso_sb_date', :isoCode => hDate[:dateType])
|
22
|
+
sbDate[:dateString] = AdiwgDateTimeFun.stringFromDateObject(hDate)
|
23
|
+
sbDate[:label] = hDate[:description] unless hDate[:description].nil?
|
24
|
+
aDates << sbDate unless sbDate[:type].nil?
|
25
|
+
end
|
26
|
+
|
27
|
+
if aDates.empty?
|
28
|
+
return nil
|
29
|
+
end
|
30
|
+
|
31
|
+
aDates
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -1,30 +1,53 @@
|
|
1
|
+
# sbJson 1.0 writer facet
|
2
|
+
|
3
|
+
# History:
|
4
|
+
# Stan Smith 2017-06-02 refactored for mdTranslator 2.0
|
5
|
+
# Josh Bradley original script
|
6
|
+
|
7
|
+
require_relative 'sbJson_budget'
|
8
|
+
require_relative 'sbJson_project'
|
9
|
+
require_relative 'sbJson_publication'
|
10
|
+
|
1
11
|
module ADIWG
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
12
|
+
module Mdtranslator
|
13
|
+
module Writers
|
14
|
+
module SbJson
|
15
|
+
|
16
|
+
module Facet
|
17
|
+
|
18
|
+
def self.build(hMetadata)
|
19
|
+
|
20
|
+
aFacets = []
|
21
|
+
|
22
|
+
# budget facet
|
23
|
+
unless hMetadata[:funding].empty?
|
24
|
+
hBudgetFacet = Budget.build(hMetadata[:funding])
|
25
|
+
aFacets << hBudgetFacet unless hBudgetFacet.empty?
|
26
|
+
end
|
27
|
+
|
28
|
+
# project facet
|
29
|
+
unless hMetadata[:resourceInfo].empty?
|
30
|
+
hProjectFacet = Project.build(hMetadata[:resourceInfo])
|
31
|
+
aFacets << hProjectFacet unless hProjectFacet.empty?
|
32
|
+
end
|
33
|
+
|
34
|
+
# publication facet (citation)
|
35
|
+
unless hMetadata[:resourceInfo].empty?
|
36
|
+
hPublicationFacet = Publication.build(hMetadata[:resourceInfo])
|
37
|
+
aFacets << hPublicationFacet unless hPublicationFacet.empty?
|
38
|
+
end
|
39
|
+
|
40
|
+
if aFacets.empty?
|
41
|
+
return nil
|
42
|
+
end
|
43
|
+
|
44
|
+
aFacets
|
45
|
+
|
46
|
+
end
|
21
47
|
|
22
48
|
end
|
23
49
|
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
50
|
+
end
|
27
51
|
end
|
28
|
-
|
29
|
-
end
|
52
|
+
end
|
30
53
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# sbJson 1.0 writer
|
2
|
+
|
3
|
+
# History:
|
4
|
+
# Stan Smith 2017-05-26 original script
|
5
|
+
|
6
|
+
module ADIWG
|
7
|
+
module Mdtranslator
|
8
|
+
module Writers
|
9
|
+
module SbJson
|
10
|
+
|
11
|
+
module Hours
|
12
|
+
|
13
|
+
def self.build(aHours)
|
14
|
+
|
15
|
+
hours = ''
|
16
|
+
|
17
|
+
aHours.each do |hour|
|
18
|
+
hours += hour + '; '
|
19
|
+
end
|
20
|
+
|
21
|
+
# clean off last semicolon
|
22
|
+
if hours.length > 2
|
23
|
+
hours = hours[0...-2]
|
24
|
+
end
|
25
|
+
|
26
|
+
hours
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# sbJson 1.0 writer
|
2
|
+
|
3
|
+
# History:
|
4
|
+
# Stan Smith 2017-05-25 original script
|
5
|
+
|
6
|
+
module ADIWG
|
7
|
+
module Mdtranslator
|
8
|
+
module Writers
|
9
|
+
module SbJson
|
10
|
+
|
11
|
+
module MaterialRequest
|
12
|
+
|
13
|
+
def self.build(aDistribution)
|
14
|
+
|
15
|
+
materialRequest = ''
|
16
|
+
|
17
|
+
aDistribution.each do |hDistribution|
|
18
|
+
aDistributor = hDistribution[:distributor]
|
19
|
+
aDistributor.each do |hDistributor|
|
20
|
+
instructions = nil
|
21
|
+
unless hDistributor[:orderProcess].empty?
|
22
|
+
instructions = hDistributor[:orderProcess][0][:orderingInstructions]
|
23
|
+
end
|
24
|
+
unless hDistributor[:contact].empty?
|
25
|
+
role = hDistributor[:contact][:roleName]
|
26
|
+
aParties = hDistributor[:contact][:parties]
|
27
|
+
aParties.each do |hParty|
|
28
|
+
contactIndex = hParty[:contactIndex]
|
29
|
+
unless contactIndex.nil?
|
30
|
+
hContact = ADIWG::Mdtranslator::Writers::SbJson.get_contact_by_index(contactIndex)
|
31
|
+
unless hContact.empty?
|
32
|
+
name = hContact[:name]
|
33
|
+
if instructions.nil?
|
34
|
+
materialRequest += name + '(' + role + '); '
|
35
|
+
else
|
36
|
+
materialRequest += name + '(' + role + ' - ' + instructions + '); '
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# clean off last semicolon
|
46
|
+
if materialRequest.length > 0
|
47
|
+
materialRequest = materialRequest[0...-2]
|
48
|
+
end
|
49
|
+
|
50
|
+
materialRequest
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# sbJson 1.0 writer
|
2
|
+
|
3
|
+
# History:
|
4
|
+
# Stan Smith 2017-05-25 original script
|
5
|
+
|
6
|
+
module ADIWG
|
7
|
+
module Mdtranslator
|
8
|
+
module Writers
|
9
|
+
module SbJson
|
10
|
+
|
11
|
+
module ParentId
|
12
|
+
|
13
|
+
def self.build(hCitation)
|
14
|
+
|
15
|
+
parentId = ''
|
16
|
+
|
17
|
+
hCitation[:identifiers].each_with_index do |hIdentifier, index|
|
18
|
+
if index == 0
|
19
|
+
parentId = hIdentifier[:identifier]
|
20
|
+
end
|
21
|
+
unless hIdentifier[:namespace].nil?
|
22
|
+
if hIdentifier[:namespace] == 'gov.sciencebase.catalog'
|
23
|
+
parentId = hIdentifier[:identifier]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
parentId
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# sbJson 1.0 writer project
|
2
|
+
|
3
|
+
# History:
|
4
|
+
# Stan Smith 2017-06-02 original script
|
5
|
+
|
6
|
+
require_relative 'sbJson_codelists'
|
7
|
+
|
8
|
+
module ADIWG
|
9
|
+
module Mdtranslator
|
10
|
+
module Writers
|
11
|
+
module SbJson
|
12
|
+
|
13
|
+
module Project
|
14
|
+
|
15
|
+
def self.build(hResource)
|
16
|
+
|
17
|
+
hProject = {}
|
18
|
+
|
19
|
+
hResource[:resourceTypes].each do |hResourceType|
|
20
|
+
if hResourceType[:type] == 'project'
|
21
|
+
hProject[:className] = 'gov.sciencebase.catalog.item.facet.ProjectFacet'
|
22
|
+
unless hResource[:status].empty?
|
23
|
+
status = hResource[:status][0]
|
24
|
+
sbStatus = Codelists.codelist_iso_to_sb('iso_sb_progress', :isoCode => status)
|
25
|
+
hProject[:projectStatus] = sbStatus
|
26
|
+
end
|
27
|
+
unless hResource[:shortAbstract].nil?
|
28
|
+
hProject[:parts] = [
|
29
|
+
{
|
30
|
+
type: 'Short Project Description',
|
31
|
+
value: hResource[:shortAbstract]
|
32
|
+
}
|
33
|
+
]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
hProject
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# sbJson 1.0 writer publication
|
2
|
+
|
3
|
+
# History:
|
4
|
+
# Stan Smith 2017-06-03 original script
|
5
|
+
|
6
|
+
require 'jbuilder'
|
7
|
+
require_relative 'sbJson_codelists'
|
8
|
+
|
9
|
+
module ADIWG
|
10
|
+
module Mdtranslator
|
11
|
+
module Writers
|
12
|
+
module SbJson
|
13
|
+
|
14
|
+
module Publication
|
15
|
+
|
16
|
+
def self.build(hResource)
|
17
|
+
|
18
|
+
hPublication = {}
|
19
|
+
|
20
|
+
# citations for publications
|
21
|
+
hResource[:resourceTypes].each do |hType|
|
22
|
+
type = hType[:type]
|
23
|
+
if type == 'sciencePaper' || type == 'publication'
|
24
|
+
hCitation = hResource[:citation]
|
25
|
+
hPublication[:className] = 'gov.sciencebase.catalog.item.facet.CitationFacet'
|
26
|
+
hPublication[:citationType] = type
|
27
|
+
unless hCitation.empty?
|
28
|
+
unless hCitation[:otherDetails].empty?
|
29
|
+
note = hCitation[:otherDetails][0]
|
30
|
+
hPublication[:note] = note
|
31
|
+
end
|
32
|
+
unless hCitation[:series].empty?
|
33
|
+
series = hCitation[:series]
|
34
|
+
hPublication[:journal] = series[:seriesName] unless series[:seriesName].nil?
|
35
|
+
hPublication[:edition] = series[:seriesIssue] unless series[:seriesIssue].nil?
|
36
|
+
end
|
37
|
+
end
|
38
|
+
unless hResource[:defaultResourceLocale].empty?
|
39
|
+
language = hResource[:defaultResourceLocale][:languageCode]
|
40
|
+
hPublication[:language] = language unless language.nil?
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
hPublication
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -10,6 +10,15 @@ require_relative 'sbJson_citation'
|
|
10
10
|
require_relative 'sbJson_identifier'
|
11
11
|
require_relative 'sbJson_rights'
|
12
12
|
require_relative 'sbJson_provenance'
|
13
|
+
require_relative 'sbJson_materialRequest'
|
14
|
+
require_relative 'sbJson_parentId'
|
15
|
+
require_relative 'sbJson_contact'
|
16
|
+
require_relative 'sbJson_webLink'
|
17
|
+
require_relative 'sbJson_browseCategory'
|
18
|
+
require_relative 'sbJson_tag'
|
19
|
+
require_relative 'sbJson_date'
|
20
|
+
require_relative 'sbJson_spatial'
|
21
|
+
require_relative 'sbJson_facet'
|
13
22
|
|
14
23
|
module ADIWG
|
15
24
|
module Mdtranslator
|
@@ -20,44 +29,33 @@ module ADIWG
|
|
20
29
|
|
21
30
|
metadataInfo = intObj[:metadata][:metadataInfo]
|
22
31
|
resourceInfo = intObj[:metadata][:resourceInfo]
|
32
|
+
distributorInfo = intObj[:metadata][:distributorInfo]
|
23
33
|
hCitation = resourceInfo[:citation]
|
24
34
|
|
25
35
|
@Namespace = ADIWG::Mdtranslator::Writers::SbJson
|
26
36
|
|
27
37
|
Jbuilder.new do |json|
|
28
38
|
|
29
|
-
# id
|
30
39
|
json.id Id.build(intObj)
|
31
|
-
|
32
|
-
|
33
|
-
unless hCitation.empty?
|
34
|
-
json.title hCitation[:title]
|
35
|
-
json.alternateTitles hCitation[:alternateTitles] unless hCitation[:alternateTitles].empty?
|
36
|
-
end
|
37
|
-
|
38
|
-
# body / summary
|
40
|
+
json.title hCitation[:title] unless hCitation.empty?
|
41
|
+
json.alternateTitles hCitation[:alternateTitles] unless hCitation[:alternateTitles].empty?
|
39
42
|
json.body resourceInfo[:abstract]
|
40
43
|
json.summary resourceInfo[:shortAbstract]
|
41
|
-
|
42
|
-
|
43
|
-
unless hCitation.empty?
|
44
|
-
json.citation Citation.build(hCitation)
|
45
|
-
json.identifiers @Namespace.json_map(hCitation[:identifiers], Identifier)
|
46
|
-
end
|
47
|
-
|
48
|
-
# purpose
|
44
|
+
json.citation Citation.build(hCitation) unless hCitation.empty?
|
45
|
+
json.identifiers @Namespace.json_map(hCitation[:identifiers], Identifier) unless hCitation.empty?
|
49
46
|
json.purpose resourceInfo[:purpose]
|
50
|
-
|
51
|
-
# rights
|
52
|
-
unless resourceInfo[:constraints].empty?
|
53
|
-
json.rights Rights.build(resourceInfo[:constraints])
|
54
|
-
end
|
55
|
-
|
56
|
-
# provenance
|
47
|
+
json.rights Rights.build(resourceInfo[:constraints]) unless resourceInfo[:constraints].empty?
|
57
48
|
json.provenance Provenance.build(metadataInfo)
|
58
|
-
|
59
|
-
|
60
|
-
|
49
|
+
json.materialRequestInstructions MaterialRequest.build(distributorInfo) unless distributorInfo.empty?
|
50
|
+
json.parentId ParentId.build(metadataInfo[:parentMetadata]) unless metadataInfo[:parentMetadata].empty?
|
51
|
+
aContactList = Contact.get_contact_list(intObj)
|
52
|
+
json.contacts @Namespace.json_map(aContactList, Contact) unless aContactList.empty?
|
53
|
+
json.webLinks WebLink.build(intObj[:metadata])
|
54
|
+
json.browseCategories BrowseCategory.build(resourceInfo[:resourceTypes])
|
55
|
+
json.tags Tag.build(resourceInfo)
|
56
|
+
json.dates Date.build(hCitation) unless hCitation.empty?
|
57
|
+
json.spatial Spatial.build(resourceInfo[:extents]) unless resourceInfo[:extents].empty?
|
58
|
+
json.facets Facet.build(intObj[:metadata])
|
61
59
|
|
62
60
|
end
|
63
61
|
|