|
29 | 29 | # Server name for oai request header
|
30 | 30 | # config.server_name = 'my_server@name.com'
|
31 | 31 |
|
32 |
| - # Field_mapping for establishing a parent-child relationship (FROM parent TO child) |
33 |
| - # This can be a Collection to Work, or Work to Work relationship |
34 |
| - # This value IS NOT used for OAI, so setting the OAI Entries here will have no effect |
35 |
| - # The mapping is supplied per Entry, provide the full class name as a string, eg. 'Bulkrax::CsvEntry' |
36 |
| - # Example: |
37 |
| - # { |
38 |
| - # 'Bulkrax::RdfEntry' => 'http://opaquenamespace.org/ns/contents', |
39 |
| - # 'Bulkrax::CsvEntry' => 'children' |
40 |
| - # } |
41 |
| - # By default no parent-child relationships are added |
42 |
| - # config.parent_child_field_mapping = { } |
43 |
| - |
44 |
| - # Field_mapping for establishing a collection relationship (FROM work TO collection) |
45 |
| - # This value IS NOT used for OAI, so setting the OAI parser here will have no effect |
46 |
| - # The mapping is supplied per Entry, provide the full class name as a string, eg. 'Bulkrax::CsvEntry' |
47 |
| - # The default value for CSV is collection |
48 |
| - # Add/replace parsers, for example: |
49 |
| - # config.collection_field_mapping['Bulkrax::RdfEntry'] = 'http://opaquenamespace.org/ns/set' |
50 |
| - |
51 | 32 | config.fill_in_blank_source_identifiers = ->(obj, index) { "#{Site.instance.account.name}-#{obj.importerexporter.id}-#{index}" }
|
52 | 33 |
|
53 |
| - # Field mappings |
54 |
| - parser_mappings = { |
55 |
| - 'abstract' => { from: ['abstract'], split: '\|', generated: true }, |
56 |
| - 'accessibility_feature' => { from: ['accessibility_feature'], split: '\|' }, |
57 |
| - 'accessibility_hazard' => { from: ['accessibility_hazard'], split: '\|' }, |
58 |
| - 'accessibility_summary' => { from: ['accessibility_summary'] }, |
59 |
| - 'additional_information' => { from: ['additional_information'], split: '\|', generated: true }, |
60 |
| - 'admin_note' => { from: ['admin_note'] }, |
61 |
| - 'admin_set_id' => { from: ['admin_set_id'], generated: true }, |
62 |
| - 'alternate_version' => { from: ['alternate_version'], split: '\|' }, |
63 |
| - 'alternative_title' => { from: ['alternative_title'], split: '\|', generated: true }, |
64 |
| - 'arkivo_checksum' => { from: ['arkivo_checksum'], split: '\|', generated: true }, |
65 |
| - 'audience' => { from: ['audience'], split: '\|' }, |
66 |
| - 'based_near' => { from: ['location'], split: '\|' }, |
67 |
| - 'bibliographic_citation' => { from: ['bibliographic_citation'], split: '\|', generated: true }, |
68 |
| - 'bulkrax_identifier' => { from: ['source_identifier'], source_identifier: true, generated: true, search_field: 'bulkrax_identifier_tesim' }, |
69 |
| - 'children' => { from: ['children'], split: /\s*[;|]\s*/, related_children_field_mapping: true }, |
70 |
| - 'chronology_note' => { from: ['chronology_note'], split: '\|' }, |
71 |
| - 'committee_member' => { from: ['committee_member'], split: '\|' }, |
72 |
| - 'contributing_library' => { from: ['contributing_library'], split: '\|' }, |
73 |
| - 'contributor' => { from: ['contributor'], split: '\|' }, |
74 |
| - 'creator' => { from: ['author', 'creator'], split: '\|' }, |
75 |
| - 'date_created' => { from: ['date', 'date_created'], split: '\|' }, |
76 |
| - 'date_uploaded' => { from: ['date_uploaded'], generated: true }, |
77 |
| - 'date' => { from: ['date'], split: '\|' }, |
78 |
| - 'degree_discipline' => { from: ['discipline'], split: '\|' }, |
79 |
| - 'degree_grantor' => { from: ['grantor'], split: '\|' }, |
80 |
| - 'degree_level' => { from: ['level'], split: '\|' }, |
81 |
| - 'degree_name' => { from: ['degree'], split: '\|' }, |
82 |
| - 'depositor' => { from: ['depositor'], split: '\|', generated: true }, |
83 |
| - 'description' => { from: ['description'], split: '\|' }, |
84 |
| - 'discipline' => { from: ['discipline'], split: '\|' }, |
85 |
| - 'education_level' => { from: ['education_level'], split: '\|' }, |
86 |
| - 'embargo_id' => { from: ['embargo_id'], generated: true }, |
87 |
| - 'file' => { from: ['item'], split: '\|' }, |
88 |
| - 'identifier' => { from: ['identifier'], split: '\|' }, |
89 |
| - 'import_url' => { from: ['import_url'], split: '\|', generated: true }, |
90 |
| - 'keyword' => { from: ['keyword'], split: '\|' }, |
91 |
| - 'label' => { from: ['label'], generated: true }, |
92 |
| - 'language' => { from: ['language'], split: '\|' }, |
93 |
| - 'learning_resource_type' => { from: ['learning_resource_type'], split: '\|' }, |
94 |
| - 'lease_id' => { from: ['lease_id'], generated: true }, |
95 |
| - 'library_catalog_identifier' => { from: ['library_catalog_identifier'], split: '\|' }, |
96 |
| - 'license' => { from: ['license'], split: '\|' }, |
97 |
| - 'newer_version' => { from: ['newer_version'], split: '\|' }, |
98 |
| - 'oer_size' => { from: ['oer_size'], split: '\|' }, |
99 |
| - 'on_behalf_of' => { from: ['on_behalf_of'], generated: true }, |
100 |
| - 'owner' => { from: ['owner'], generated: true }, |
101 |
| - 'parents' => { from: ['parents'], split: /\s*[;|]\s*/, related_parents_field_mapping: true }, |
102 |
| - 'previous_version' => { from: ['previous_version'], split: '\|' }, |
103 |
| - 'proxy_depositor' => { from: ['proxy_depositor'], generated: true }, |
104 |
| - 'publisher' => { from: ['publisher'], split: '\|' }, |
105 |
| - 'related_item' => { from: ['related_item'], split: '\|' }, |
106 |
| - 'related_url' => { from: ['related_url', 'relation'], split: '\|' }, |
107 |
| - 'relative_path' => { from: ['relative_path'], split: '\|', generated: true }, |
108 |
| - 'rendering_ids' => { from: ['rendering_ids'], split: '\|', generated: true }, |
109 |
| - 'representative_id' => { from: ['representative_id'], generated: true }, |
110 |
| - 'resource_type' => { from: ['type'], split: '\|' }, |
111 |
| - 'rights_holder' => { from: ['rights_holder'], split: '\|' }, |
112 |
| - 'rights_notes' => { from: ['rights_notes'], split: '\|', generated: true }, |
113 |
| - 'rights_statement' => { from: ['rights', 'rights_statement'], split: '\|', generated: true }, |
114 |
| - 'source' => { from: ['source'], split: '\|', generated: true }, |
115 |
| - 'state' => { from: ['state'], generated: true }, |
116 |
| - 'subject' => { from: ['subject'], split: '\|' }, |
117 |
| - 'table_of_contents' => { from: ['table_of_contents'], split: '\|' }, |
118 |
| - 'title' => { from: ['title'], split: '\|' }, |
119 |
| - 'video_embed' => { from: ['video_embed'] } |
120 |
| - } |
121 |
| - |
122 |
| - # currently Bulkrax does not support headers with spaces |
123 |
| - # here we add the key but with the underscore turned into a space to accommodate |
124 |
| - parser_mappings.each do |key, value| |
125 |
| - value[:from] += ([key.tr('_', ' ')] + value[:from].map { |f| f.tr('_', ' ') }) |
126 |
| - value[:from].uniq! |
127 |
| - end |
128 |
| - |
129 |
| - config.field_mappings['Bulkrax::BagitParser'] = parser_mappings |
130 |
| - config.field_mappings['Bulkrax::CsvParser'] = parser_mappings |
131 |
| - |
132 |
| - # Add to, or change existing mappings as follows |
133 |
| - # e.g. to exclude date |
134 |
| - # config.field_mappings["Bulkrax::OaiDcParser"]["date"] = { from: ["date"], excluded: true } |
135 |
| - |
136 |
| - # To duplicate a set of mappings from one parser to another |
137 |
| - # config.field_mappings["Bulkrax::OaiOmekaParser"] = {} |
138 |
| - # config.field_mappings["Bulkrax::OaiDcParser"].each {|key,value| config.field_mappings["Bulkrax::OaiOmekaParser"][key] = value } |
139 |
| - |
140 | 34 | # Properties that should not be used in imports/exports. They are reserved for use by Hyrax.
|
141 | 35 | # config.reserved_properties += ['my_field']
|
142 | 36 | end
|
|
0 commit comments