libis-metadata 0.2.0 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23ff1ec087acd8448cd8230000f6d5b3aa5f7acf
4
- data.tar.gz: a908b2af8489af83de9284e529abdfd4e7b68f08
3
+ metadata.gz: 1e48f5767aded27b26118a8ed5a3776be26b652b
4
+ data.tar.gz: a99d01528eb1f807d77fea684a3408ed84272ba7
5
5
  SHA512:
6
- metadata.gz: aa677a22babb3b23d1066901db39d6b0d0a40832bdc6d8a28aa14cd0ff21e616ca4ad4c67adf990c7a5a4dcb00068b9c3345e072fce28e42eb7335db57ed8ace
7
- data.tar.gz: 3223dace5cc94e68359694f2dfaf50640b55af25a156b083bc0ca793abb403285b5fd77df4eee8553d241207be624504a22562da42bcd71204567c153ee2b553
6
+ metadata.gz: 99d7581a6f2ce0b56a9d3770a101be95df84b49acc847b705a6ba185dd3bd86718bc8d7287cd7c4ea3ae56139394bb6ab726a15775a4d46abf67e931dc80c10c
7
+ data.tar.gz: c87b535efb289d6187b644b814ecf2ca4b091a9c9a5cd8a2d70bd65744b33fec26a7448f8ca975801f7e2ae346d4c69161b4116e802cb1de88b50e5eec9e0981
data/README.md CHANGED
@@ -1,15 +1,18 @@
1
- # Metadata
1
+ [![Gem Version](https://badge.fury.io/rb/libis-metadata.svg)](http://badge.fury.io/rb/libis-metadata)
2
+ [![Build Status](https://travis-ci.org/Kris-LIBIS/LIBIS_Metadata.svg?branch=master)](https://travis-ci.org/Kris-LIBIS/LIBIS_Metadata)
3
+ [![Coverage Status](https://img.shields.io/coveralls/Kris-LIBIS/LIBIS_Metadata.svg)](https://coveralls.io/r/Kris-LIBIS/LIBIS_Metadata)
4
+ [![Dependency Status](https://gemnasium.com/Kris-LIBIS/LIBIS_Metadata.svg)](https://gemnasium.com/Kris-LIBIS/LIBIS_Metadata)
2
5
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/metadata`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+ # Libis::Metadata
4
7
 
5
- TODO: Delete this and the text above, and describe your gem
8
+ This gem contains classes and tools related to metadata. It depends on the libis-tools and libis-services gems.
6
9
 
7
10
  ## Installation
8
11
 
9
12
  Add this line to your application's Gemfile:
10
13
 
11
14
  ```ruby
12
- gem 'libis-metadata'
15
+ gem 'libis-metadata'
13
16
  ```
14
17
 
15
18
  And then execute:
@@ -22,18 +25,54 @@ Or install it yourself as:
22
25
 
23
26
  ## Usage
24
27
 
25
- TODO: Write usage instructions here
28
+ In order to make available all the code the gem supplies a single file can be included:
26
29
 
27
- ## Development
30
+ ```ruby
31
+ require 'libis-metadata'
32
+ ```
33
+
34
+ or:
35
+
36
+ ```ruby
37
+ require 'libis/metadata'
38
+ ```
28
39
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
40
+ Alternatively, if you only want to use a single class or module, partial files are available. See the examples in the
41
+ sections below for their names.
30
42
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
43
+ ## Content
32
44
 
33
- ## Contributing
45
+ This gem provides some modules and classes that assist in working with metadata. There are classes that allow to
46
+ create and/or read metadata for MARC(21), Dublin Core and SharePoint. These classes all live in the
47
+ Libis::Metadata namespace. Additionally there are parsers and converters in the Libis::Metadata::Parser namespace
48
+
49
+ ### MARC
34
50
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/metadata.
51
+ The classes {::Libis::Metadata::MarcRecord} and it's child class {::Libis::Metadata::Marc21Record} are
52
+ mainly built for reading MARC(21) records. Most of the class logic is in the base class
53
+ {::Libis::Metadata::MarcRecord MarcRecord}, which is incomplete and should be considered an abstract class.
36
54
 
37
- ## License
55
+ {::Libis::Metadata::Marc21Record Marc21Record} on the other hand only contains the logic to parse the XML data
56
+ into the internal structure. A {::Libis::Metadata::MarcRecord MarcRecord} is created by supplying it an XML node
57
+ (from Nokogiri or {::Libis::Tools::XmlDocument}) that contains child nodes with the MARC data of a single record.
58
+
59
+ The code will strip namespaces from the input in order to greatly simplify working with the XML.
60
+
61
+ ### Dublin Core
62
+
63
+ The {Libis::Metadata::DublinCoreRecord} class is an extension of the {Libis::Tools::XmlDocument} class with specific
64
+ enhancements to support both dc: and dc_terms: namespaces. Creating a new object from scratch will automatically include
65
+ the proper xmlns references and a dc:record root element. When adding nodes without namespace prefix, the class will
66
+ add the proper namespace for you, prefering dc: over dc_terms in case of ambiguity.
67
+
68
+ ### Mappers
69
+
70
+
71
+
72
+ ## Contributing
38
73
 
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
74
+ 1. Fork it ( https://github.com/Kris-LIBIS/LIBIS_Metadata/fork )
75
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
76
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
77
+ 4. Push to the branch (`git push origin my-new-feature`)
78
+ 5. Create a new Pull Request
@@ -122,7 +122,6 @@ module Libis
122
122
  opts.merge!(col_sep: "\t", extension: :csv) if File.extname(file) == '.tsv'
123
123
  Libis::Tools::Spreadsheet.foreach("#{file}#{sheet ? '|' + sheet : ''}", opts) do |row|
124
124
  next if row[:term].nil? || row[:term] == 'Term'
125
- ap row
126
125
  download_one(service: md, term: row[:term], pid: row[:pid], filename: row[:filename])
127
126
  end
128
127
  end
@@ -5,13 +5,14 @@ require 'awesome_print'
5
5
  require 'libis/services/alma/sru_service'
6
6
  require 'libis/services/scope/search'
7
7
 
8
- require 'libis/tools/metadata/marc21_record'
9
- require 'libis/tools/metadata/dublin_core_record'
10
8
  require 'libis/tools/xml_document'
11
9
  require 'libis/tools/extend/string'
12
10
 
13
- require 'libis/tools/metadata/mappers/kuleuven'
14
- require 'libis/tools/metadata/mappers/scope'
11
+ require 'libis/metadata/marc21_record'
12
+ require 'libis/metadata/dublin_core_record'
13
+
14
+ require 'libis/metadata/mappers/kuleuven'
15
+ require 'libis/metadata/mappers/scope'
15
16
 
16
17
  module Libis
17
18
  module Metadata
@@ -31,10 +32,10 @@ module Libis
31
32
  case metadata
32
33
  when 'alma'
33
34
  @service ||= Libis::Services::Alma::SruService.new
34
- @mapper_class = Libis::Tools::Metadata::Mappers::Kuleuven
35
+ @mapper_class = Libis::Metadata::Mappers::Kuleuven
35
36
  when 'scope'
36
37
  @service = ::Libis::Services::Scope::Search.new
37
- @mapper_class = Libis::Tools::Metadata::Mappers::Scope
38
+ @mapper_class = Libis::Metadata::Mappers::Scope
38
39
  @service.connect(config[:password], config[:password], config[:database])
39
40
  else
40
41
  raise RuntimeError, "Service '#{service}' unknown"
@@ -56,18 +57,18 @@ module Libis
56
57
  filename
57
58
  end
58
59
 
59
- # @return [Libis::Tools::Metadata::DublinCoreRecord]
60
+ # @return [Libis::Metadata::DublinCoreRecord]
60
61
  def search(term)
61
62
  record = case service
62
63
  when ::Libis::Services::Alma::SruService
63
64
  result = service.search(config[:field], URI::encode("\"#{term}\""), config[:library])
64
65
  raise RuntimeError "Multiple records found for #{config[:field]}=#{term}" if result.size > 1
65
- result.empty? ? nil : ::Libis::Tools::Metadata::Marc21Record.new(result.first.root)
66
+ result.empty? ? nil : ::Libis::Metadata::Marc21Record.new(result.first.root)
66
67
 
67
68
  when ::Libis::Services::Scope::Search
68
69
  service.query(term, type: config[:field])
69
70
  service.next_record do |doc|
70
- ::Libis::Tools::Metadata::DublinCoreRecord.new(doc.to_xml)
71
+ ::Libis::Metadata::DublinCoreRecord.new(doc.to_xml)
71
72
  end
72
73
 
73
74
  else
@@ -1,76 +1,74 @@
1
1
  # encoding: utf-8
2
2
 
3
- require 'libis/tools/metadata/mappers/kuleuven'
3
+ require 'libis/metadata/mappers/kuleuven'
4
4
 
5
5
  module Libis
6
- module Tools
7
- module Metadata
8
- module Mappers
6
+ module Metadata
7
+ module Mappers
9
8
 
10
- # noinspection RubyResolve
9
+ # noinspection RubyResolve
11
10
 
12
- # Mixin for {::Libis::Tools::Metadata::MarcRecord} to enable conversion into
13
- # {Libis::Tools::Metadata::DublinCoreRecord}. This module implements the conversion mapping for Flandrica by
14
- # extending the version for {::Libis::Tools::Metadata::Mappers::Kuleuven KU Leuven} and overwriting what's
15
- # different. This means any change to the KU Leuven mapping may have effect on this mapping as well.
16
- module Flandrica
17
- extend Libis::Tools::Metadata::Mappers::Kuleuven
11
+ # Mixin for {::Libis::Metadata::MarcRecord} to enable conversion into
12
+ # {Libis::Metadata::DublinCoreRecord}. This module implements the conversion mapping for Flandrica by
13
+ # extending the version for {::Libis::Metadata::Mappers::Kuleuven KU Leuven} and overwriting what's
14
+ # different. This means any change to the KU Leuven mapping may have effect on this mapping as well.
15
+ module Flandrica
16
+ extend Libis::Metadata::Mappers::Kuleuven
18
17
 
19
- protected
18
+ protected
20
19
 
21
- def marc2dc_identifier(xml)
22
- Libis::Tools::Metadata::Mappers::Kuleuven.marc2dc_identifier(xml)
23
- marc2dc_identifier_040(xml)
24
- end
25
-
26
- def marc2dc_identifier_001(xml)
27
- # "urn:ControlNumber:" [MARC 001]
28
- tag('001').each { |t|
29
- xml['dc'].identifier element(t.datas, prefix: '')
30
- }
31
- end
20
+ def marc2dc_identifier(xml)
21
+ Libis::Metadata::Mappers::Kuleuven.marc2dc_identifier(xml)
22
+ marc2dc_identifier_040(xml)
23
+ end
32
24
 
33
- def marc2dc_identifier_040(xml)
34
- # [MARC 040 $a]
35
- tag('040', 'a').each { |t|
36
- xml['dc'].identifier('xsi:type' => 'dcterms:URI').text t._a
37
- }
38
- end
25
+ def marc2dc_identifier_001(xml)
26
+ # "urn:ControlNumber:" [MARC 001]
27
+ tag('001').each {|t|
28
+ xml['dc'].identifier element(t.datas, prefix: '')
29
+ }
30
+ end
39
31
 
40
- def marc2dc_alternative_240_a(xml)
41
- # [MARC 240 #_ $a] ", " [MARC 240 #_ $f] ", " [MARC 240 #_ $g] ", "
42
- tag('240#_', 'a f g').each { |t|
43
- xml['dcterms'].alternative element(t._afg, join: ', ', postfix: ', ')
44
- }
45
- end
32
+ def marc2dc_identifier_040(xml)
33
+ # [MARC 040 $a]
34
+ tag('040', 'a').each {|t|
35
+ xml['dc'].identifier('xsi:type' => 'dcterms:URI').text t._a
36
+ }
37
+ end
46
38
 
47
- def marc2dc_alternative_240_l(xml)
48
- # [MARC 240 #_ $l] ", " [MARC 240 #_ $m] ", " [MARC 240 #_ $n] ", " [MARC 240 #_ $o] ", " [MARC 240 #_ $p] ", " [MARC 240 #_ $r] ", " [MARC 240 #_ $s]
49
- tag('240#_', 'l m n o p r s').each { |t|
50
- xml['dcterms'].alternative element(t._lmnoprs, join: ', ')
51
- }
52
- end
39
+ def marc2dc_alternative_240_a(xml)
40
+ # [MARC 240 #_ $a] ", " [MARC 240 #_ $f] ", " [MARC 240 #_ $g] ", "
41
+ tag('240#_', 'a f g').each {|t|
42
+ xml['dcterms'].alternative element(t._afg, join: ', ', postfix: ', ')
43
+ }
44
+ end
53
45
 
54
- def marc2dc_source_856(xml)
55
- marc2dc_source_856__1(xml)
56
- marc2dc_source_856__2(xml)
57
- marc2dc_source_856___(xml)
58
- end
46
+ def marc2dc_alternative_240_l(xml)
47
+ # [MARC 240 #_ $l] ", " [MARC 240 #_ $m] ", " [MARC 240 #_ $n] ", " [MARC 240 #_ $o] ", " [MARC 240 #_ $p] ", " [MARC 240 #_ $r] ", " [MARC 240 #_ $s]
48
+ tag('240#_', 'l m n o p r s').each {|t|
49
+ xml['dcterms'].alternative element(t._lmnoprs, join: ', ')
50
+ }
51
+ end
59
52
 
60
- def marc2dc_source_856___(xml)
61
- # [MARC 856 ## $a]
62
- tag('856', 'a').each { |t|
63
- xml['dc'].source('xsi:type' => 'dcterms:URI').text element(t._a)
64
- }
65
- end
53
+ def marc2dc_source_856(xml)
54
+ marc2dc_source_856__1(xml)
55
+ marc2dc_source_856__2(xml)
56
+ marc2dc_source_856___(xml)
57
+ end
66
58
 
67
- def check_name(_,_)
68
- true
69
- end
59
+ def marc2dc_source_856___(xml)
60
+ # [MARC 856 ## $a]
61
+ tag('856', 'a').each {|t|
62
+ xml['dc'].source('xsi:type' => 'dcterms:URI').text element(t._a)
63
+ }
64
+ end
70
65
 
66
+ def check_name(_, _)
67
+ true
71
68
  end
72
69
 
73
70
  end
71
+
74
72
  end
75
73
  end
76
- end
74
+ end
@@ -1,1929 +1,1927 @@
1
1
  # encoding: utf-8
2
2
 
3
- require 'libis/tools/metadata/marc_record'
4
- require 'libis/tools/metadata/dublin_core_record'
3
+ require 'libis/metadata/marc_record'
4
+ require 'libis/metadata/dublin_core_record'
5
5
  require 'libis/tools/assert'
6
6
 
7
7
  module Libis
8
- module Tools
9
- module Metadata
10
- module Mappers
11
- # noinspection RubyResolve
12
-
13
- # Mixin for {::Libis::Tools::Metadata::MarcRecord} to enable conversion into
14
- # {Libis::Tools::Metadata::DublinCoreRecord}. This module implements the conversion mapping for KU Leuven.
15
- module Kuleuven
16
-
17
- # Main conversion method.
18
- # @param [String] label optional extra identified to add to the DC record.
19
- # @return [::Libis::Tools::Metadata::DublinCoreRecord]
20
- def to_dc(label = nil)
21
- assert(self.is_a? Libis::Tools::Metadata::MarcRecord)
22
-
23
- doc = Libis::Tools::Metadata::DublinCoreRecord.new do |xml|
24
- marc2dc_identifier(xml, label)
25
- marc2dc_title(xml)
26
- marc2dc_ispartof(xml)
27
- marc2dc_alternative(xml)
28
- marc2dc_creator(xml)
29
- marc2dc_subject(xml)
30
- marc2dc_temporal(xml)
31
- marc2dc_description(xml)
32
- marc2dc_isversionof(xml)
33
- marc2dc_abstract(xml)
34
- marc2dc_tableofcontents(xml)
35
- marc2dc_available(xml)
36
- marc2dc_haspart(xml)
37
- marc2dc_contributor(xml)
38
- marc2dc_provenance(xml)
39
- marc2dc_publisher(xml)
40
- marc2dc_date(xml)
41
- marc2dc_type(xml)
42
- marc2dc_spatial(xml)
43
- marc2dc_extent(xml)
44
- marc2dc_accrualperiodicity(xml)
45
- marc2dc_format(xml)
46
- marc2dc_medium(xml)
47
- marc2dc_relation(xml)
48
- marc2dc_replaces(xml)
49
- marc2dc_hasversion(xml)
50
- marc2dc_source(xml)
51
- marc2dc_language(xml)
52
- marc2dc_rightsholder(xml)
53
- marc2dc_references(xml)
54
- marc2dc_isreferencedby(xml)
55
- marc2dc_coverage(xml)
8
+ module Metadata
9
+ module Mappers
10
+ # noinspection RubyResolve
11
+
12
+ # Mixin for {::Libis::Metadata::MarcRecord} to enable conversion into
13
+ # {Libis::Metadata::DublinCoreRecord}. This module implements the conversion mapping for KU Leuven.
14
+ module Kuleuven
15
+
16
+ # Main conversion method.
17
+ # @param [String] label optional extra identified to add to the DC record.
18
+ # @return [::Libis::Metadata::DublinCoreRecord]
19
+ def to_dc(label = nil)
20
+ assert(self.is_a? Libis::Metadata::MarcRecord)
21
+
22
+ doc = Libis::Metadata::DublinCoreRecord.new do |xml|
23
+ marc2dc_identifier(xml, label)
24
+ marc2dc_title(xml)
25
+ marc2dc_ispartof(xml)
26
+ marc2dc_alternative(xml)
27
+ marc2dc_creator(xml)
28
+ marc2dc_subject(xml)
29
+ marc2dc_temporal(xml)
30
+ marc2dc_description(xml)
31
+ marc2dc_isversionof(xml)
32
+ marc2dc_abstract(xml)
33
+ marc2dc_tableofcontents(xml)
34
+ marc2dc_available(xml)
35
+ marc2dc_haspart(xml)
36
+ marc2dc_contributor(xml)
37
+ marc2dc_provenance(xml)
38
+ marc2dc_publisher(xml)
39
+ marc2dc_date(xml)
40
+ marc2dc_type(xml)
41
+ marc2dc_spatial(xml)
42
+ marc2dc_extent(xml)
43
+ marc2dc_accrualperiodicity(xml)
44
+ marc2dc_format(xml)
45
+ marc2dc_medium(xml)
46
+ marc2dc_relation(xml)
47
+ marc2dc_replaces(xml)
48
+ marc2dc_hasversion(xml)
49
+ marc2dc_source(xml)
50
+ marc2dc_language(xml)
51
+ marc2dc_rightsholder(xml)
52
+ marc2dc_references(xml)
53
+ marc2dc_isreferencedby(xml)
54
+ marc2dc_coverage(xml)
55
+
56
+ end
57
+
58
+ # deduplicate the XML
59
+ found = Set.new
60
+ doc.root.children.each {|node| node.unlink unless found.add?(node.to_xml)}
61
+
62
+ doc
56
63
 
57
- end
58
-
59
- # deduplicate the XML
60
- found = Set.new
61
- doc.root.children.each { |node| node.unlink unless found.add?(node.to_xml) }
62
-
63
- doc
64
-
65
- end
66
-
67
- protected
68
-
69
- def marc2dc_identifier(xml, label = nil)
70
- # DC:IDENTIFIER
71
- marc2dc_identifier_label(label, xml)
72
- marc2dc_identifier_001(xml)
73
- marc2dc_identifier_035(xml)
74
- marc2dc_identifier_024_8(xml)
75
- marc2dc_identifier_028_4(xml)
76
- marc2dc_identifier_028_5(xml)
77
- marc2dc_identifier_029(xml)
78
- marc2dc_identifier_700(xml)
79
- marc2dc_identifier_710(xml)
80
- marc2dc_identifier_752(xml)
81
- marc2dc_identifier_020(xml)
82
- marc2dc_identifier_020_9(xml)
83
- marc2dc_identifier_022(xml)
84
- marc2dc_identifier_024_2(xml)
85
- marc2dc_identifier_024_3(xml)
86
- marc2dc_identifier_690(xml)
87
- marc2dc_identifier_856(xml)
88
- end
89
-
90
- def marc2dc_identifier_label(label, xml)
91
- # noinspection RubyResolve
92
- xml['dc'].identifier label if label
93
- end
64
+ end
94
65
 
95
- def marc2dc_identifier_001(xml)
96
- # "urn:ControlNumber:" [MARC 001]
97
- all_tags('001') { |t|
98
- xml['dc'].identifier element(t.datas, prefix: 'urn:ControlNumber:')
99
- }
100
- end
66
+ protected
67
+
68
+ def marc2dc_identifier(xml, label = nil)
69
+ # DC:IDENTIFIER
70
+ marc2dc_identifier_label(label, xml)
71
+ marc2dc_identifier_001(xml)
72
+ marc2dc_identifier_035(xml)
73
+ marc2dc_identifier_024_8(xml)
74
+ marc2dc_identifier_028_4(xml)
75
+ marc2dc_identifier_028_5(xml)
76
+ marc2dc_identifier_029(xml)
77
+ marc2dc_identifier_700(xml)
78
+ marc2dc_identifier_710(xml)
79
+ marc2dc_identifier_752(xml)
80
+ marc2dc_identifier_020(xml)
81
+ marc2dc_identifier_020_9(xml)
82
+ marc2dc_identifier_022(xml)
83
+ marc2dc_identifier_024_2(xml)
84
+ marc2dc_identifier_024_3(xml)
85
+ marc2dc_identifier_690(xml)
86
+ marc2dc_identifier_856(xml)
87
+ end
101
88
 
102
- def marc2dc_identifier_035(xml)
103
- # [MARC 035__ $a]
104
- each_field('035__', 'a') { |f| xml['dc'].identifier f }
105
- end
89
+ def marc2dc_identifier_label(label, xml)
90
+ # noinspection RubyResolve
91
+ xml['dc'].identifier label if label
92
+ end
106
93
 
107
- def marc2dc_identifier_024_8(xml)
108
- # [MARC 24 8_ $a]
109
- each_field('0248_', 'a') { |f| xml['dc'].identifier f }
110
- end
94
+ def marc2dc_identifier_001(xml)
95
+ # "urn:ControlNumber:" [MARC 001]
96
+ all_tags('001') {|t|
97
+ xml['dc'].identifier element(t.datas, prefix: 'urn:ControlNumber:')
98
+ }
99
+ end
111
100
 
112
- def marc2dc_identifier_028_4(xml)
113
- # [MARC 28 40 $b]": "[MARC 28 40 $a]
114
- all_tags('02840') { |t|
115
- xml['dc'].identifier element(t._ba, join: ': ')
116
- }
117
- end
101
+ def marc2dc_identifier_035(xml)
102
+ # [MARC 035__ $a]
103
+ each_field('035__', 'a') {|f| xml['dc'].identifier f}
104
+ end
118
105
 
119
- def marc2dc_identifier_028_5(xml)
120
- # [MARC 28 50 $b]": "[MARC 28 50 $a]
121
- all_tags('02850') { |t|
122
- xml['dc'].identifier element(t._ba, join: ': ')
123
- }
124
- end
106
+ def marc2dc_identifier_024_8(xml)
107
+ # [MARC 24 8_ $a]
108
+ each_field('0248_', 'a') {|f| xml['dc'].identifier f}
109
+ end
125
110
 
126
- def marc2dc_identifier_029(xml)
127
- # "Siglum: " [MARC 029 __ $a]
128
- # each_field('029__', 'a') { |f| xml['dc'].identifier element(f, prefix: 'Siglum: ') }
129
- # ALMA: 029 __ a => 028 00 a
130
- each_field('02800', 'a') { |f| xml['dc'].identifier element(f, prefix: 'Siglum: ') }
131
- end
111
+ def marc2dc_identifier_028_4(xml)
112
+ # [MARC 28 40 $b]": "[MARC 28 40 $a]
113
+ all_tags('02840') {|t|
114
+ xml['dc'].identifier element(t._ba, join: ': ')
115
+ }
116
+ end
132
117
 
133
- def marc2dc_identifier_700(xml)
134
- # [MARC 700 #_ $0]
135
- each_field('700#_', '0') { |f| xml['dc'].identifier f }
136
- end
118
+ def marc2dc_identifier_028_5(xml)
119
+ # [MARC 28 50 $b]": "[MARC 28 50 $a]
120
+ all_tags('02850') {|t|
121
+ xml['dc'].identifier element(t._ba, join: ': ')
122
+ }
123
+ end
137
124
 
138
- def marc2dc_identifier_710(xml)
139
- # [MARC 710 #_ $0]
140
- each_field('710#_', '0') { |f| xml['dc'].identifier f }
141
- end
125
+ def marc2dc_identifier_029(xml)
126
+ # "Siglum: " [MARC 029 __ $a]
127
+ # each_field('029__', 'a') { |f| xml['dc'].identifier element(f, prefix: 'Siglum: ') }
128
+ # ALMA: 029 __ a => 028 00 a
129
+ each_field('02800', 'a') {|f| xml['dc'].identifier element(f, prefix: 'Siglum: ')}
130
+ end
142
131
 
143
- def marc2dc_identifier_752(xml)
144
- # [MARC 752 __ $0]
145
- each_field('752__', '0') { |f| xml['dc'].identifier f }
146
- end
132
+ def marc2dc_identifier_700(xml)
133
+ # [MARC 700 #_ $0]
134
+ each_field('700#_', '0') {|f| xml['dc'].identifier f}
135
+ end
147
136
 
148
- def marc2dc_identifier_020(xml)
149
- # "urn:ISBN:"[MARC 020 __ $a]
150
- each_field('020__', 'a') { |f|
151
- xml['dc'].identifier(element(f, prefix: 'urn:ISBN:'), 'xsi:type' => 'dcterms:URI')
152
- }
153
- end
137
+ def marc2dc_identifier_710(xml)
138
+ # [MARC 710 #_ $0]
139
+ each_field('710#_', '0') {|f| xml['dc'].identifier f}
140
+ end
154
141
 
155
- def marc2dc_identifier_020_9(xml)
156
- # "urn:ISBN:"[MARC 020 9_ $a]
157
- each_field('0209_', 'a') { |f|
158
- xml['dc'].identifier(element(f, prefix: 'urn:ISBN:'), 'xsi:type' => 'dcterms:URI')
159
- }
160
- end
142
+ def marc2dc_identifier_752(xml)
143
+ # [MARC 752 __ $0]
144
+ each_field('752__', '0') {|f| xml['dc'].identifier f}
145
+ end
161
146
 
162
- def marc2dc_identifier_022(xml)
163
- # "urn:ISSN:"[MARC 022 __ $a]
164
- each_field('022__', 'a') { |f|
165
- xml['dc'].identifier(element(f, prefix: 'urn:ISSN:'), 'xsi:type' => 'dcterms:URI')
166
- }
167
- end
147
+ def marc2dc_identifier_020(xml)
148
+ # "urn:ISBN:"[MARC 020 __ $a]
149
+ each_field('020__', 'a') {|f|
150
+ xml['dc'].identifier(element(f, prefix: 'urn:ISBN:'), 'xsi:type' => 'dcterms:URI')
151
+ }
152
+ end
168
153
 
169
- def marc2dc_identifier_024_2(xml)
170
- # "urn:ISMN:"[MARC 024 2_ $a]
171
- each_field('0242_', 'a') { |f|
172
- xml['dc'].identifier(element(f, prefix: 'urn:ISMN:'), 'xsi:type' => 'dcterms:URI')
173
- }
174
- end
154
+ def marc2dc_identifier_020_9(xml)
155
+ # "urn:ISBN:"[MARC 020 9_ $a]
156
+ each_field('0209_', 'a') {|f|
157
+ xml['dc'].identifier(element(f, prefix: 'urn:ISBN:'), 'xsi:type' => 'dcterms:URI')
158
+ }
159
+ end
175
160
 
176
- def marc2dc_identifier_024_3(xml)
177
- # "urn:EAN:"[MARC 024 3_ $a]
178
- each_field('0243_', 'a') { |f|
179
- xml['dc'].identifier(element(f, prefix: 'urn:EAN:'), 'xsi:type' => 'dcterms:URI')
180
- }
181
- end
161
+ def marc2dc_identifier_022(xml)
162
+ # "urn:ISSN:"[MARC 022 __ $a]
163
+ each_field('022__', 'a') {|f|
164
+ xml['dc'].identifier(element(f, prefix: 'urn:ISSN:'), 'xsi:type' => 'dcterms:URI')
165
+ }
166
+ end
182
167
 
183
- def marc2dc_identifier_690(xml)
184
- # [MARC 690 02 $0]
185
- # all_tags('69002', '0a') { |t|
186
- # if t._0 =~ /^\(ODIS-(PS|ORG)\)(\d)+$/
187
- # xml['dc'].identifier('xsi:type' => 'dcterms:URI').text odis_link($1, $2, CGI::escape(t._a))
188
- # else
189
- # xml['dc'].identifier t._a
190
- # end
191
- # }
192
- # ALMA: 690 02 ax0 => 650 _7 ax6 $2 == 'KADOC'
193
- # all_tags('650_7', '6a') { |t|
194
- # next unless t._2 == 'KADOC'
195
- # if t._6 =~ /^\(ODIS-(PS|ORG)\)(\d+)$/
196
- # xml['dc'].identifier(odis_link($1, $2, CGI::escape(t._a)), 'xsi:type' => 'dcterms:URI')
197
- # # else
198
- # # xml['dc'].identifier t._a
199
- # end
200
- # }
201
- # Verhuisd naar subject op vraag van KADOC (Luc Schokkaert)
202
- end
168
+ def marc2dc_identifier_024_2(xml)
169
+ # "urn:ISMN:"[MARC 024 2_ $a]
170
+ each_field('0242_', 'a') {|f|
171
+ xml['dc'].identifier(element(f, prefix: 'urn:ISMN:'), 'xsi:type' => 'dcterms:URI')
172
+ }
173
+ end
203
174
 
204
- def marc2dc_identifier_856(xml)
205
- # [MARC 856 _2 $u]
206
- all_tags('856_2', 'uy') { |t|
207
- xml['dc'].identifier(element(t._u, CGI::escape(t._y), join: '#'), 'xsi:type' => 'dcterms:URI')
208
- }
209
- end
175
+ def marc2dc_identifier_024_3(xml)
176
+ # "urn:EAN:"[MARC 024 3_ $a]
177
+ each_field('0243_', 'a') {|f|
178
+ xml['dc'].identifier(element(f, prefix: 'urn:EAN:'), 'xsi:type' => 'dcterms:URI')
179
+ }
180
+ end
210
181
 
211
- def marc2dc_title(xml)
212
- # DC:TITLE
213
- marc2dc_title_245(xml)
214
- marc2dc_title_246(xml)
215
- end
182
+ def marc2dc_identifier_690(xml)
183
+ # [MARC 690 02 $0]
184
+ # all_tags('69002', '0a') { |t|
185
+ # if t._0 =~ /^\(ODIS-(PS|ORG)\)(\d)+$/
186
+ # xml['dc'].identifier('xsi:type' => 'dcterms:URI').text odis_link($1, $2, CGI::escape(t._a))
187
+ # else
188
+ # xml['dc'].identifier t._a
189
+ # end
190
+ # }
191
+ # ALMA: 690 02 ax0 => 650 _7 ax6 $2 == 'KADOC'
192
+ # all_tags('650_7', '6a') { |t|
193
+ # next unless t._2 == 'KADOC'
194
+ # if t._6 =~ /^\(ODIS-(PS|ORG)\)(\d+)$/
195
+ # xml['dc'].identifier(odis_link($1, $2, CGI::escape(t._a)), 'xsi:type' => 'dcterms:URI')
196
+ # # else
197
+ # # xml['dc'].identifier t._a
198
+ # end
199
+ # }
200
+ # Verhuisd naar subject op vraag van KADOC (Luc Schokkaert)
201
+ end
216
202
 
217
- def marc2dc_title_245(xml)
218
- marc2dc_title_245_0(xml)
219
- marc2dc_title_245_1(xml)
220
- end
203
+ def marc2dc_identifier_856(xml)
204
+ # [MARC 856 _2 $u]
205
+ all_tags('856_2', 'uy') {|t|
206
+ xml['dc'].identifier(element(t._u, CGI::escape(t._y), join: '#'), 'xsi:type' => 'dcterms:URI')
207
+ }
208
+ end
221
209
 
222
- def marc2dc_title_245_0(xml)
223
- # [MARC 245 0# $a] " " [MARC 245 0# $b] " [" [MARC 245 0# $h] "]"
224
- # all_tags('2450#', 'a b h') { |t|
225
- # xml['dc'].title list_s(t._ab, opt_s(t._h))
226
- # }
227
- # ALMA: 245 ## Zh => 245 ## 6 [$h skipped, ': ' before $ skipped]
228
- all_tags('2450#', 'a b') { |t|
229
- xml['dc'].title element(t._ab, join: ' : ')
230
- }
231
- end
210
+ def marc2dc_title(xml)
211
+ # DC:TITLE
212
+ marc2dc_title_245(xml)
213
+ marc2dc_title_246(xml)
214
+ end
232
215
 
233
- def marc2dc_title_245_1(xml)
234
- # [MARC 245 1# $a] " " [MARC 245 1# $b] " [" [MARC 245 1# $h] "]"
235
- # all_tags('2451#', 'a b h') { |t|
236
- # xml['dc'].title element(t._ab, opt_s(t._h), join: ' ')
237
- # }
238
- # ALMA: 245 ## Zh => 245 ## 6 [$h skipped, ': ' before $ skipped]
239
- all_tags('2451#', 'a b') { |t|
240
- xml['dc'].title element(t._ab, join: ' : ')
241
- }
242
- end
216
+ def marc2dc_title_245(xml)
217
+ marc2dc_title_245_0(xml)
218
+ marc2dc_title_245_1(xml)
219
+ end
243
220
 
244
- def marc2dc_title_246(xml)
245
- # [MARC 246 11 $a] " : " [MARC 246 11 $b]
246
- all_tags('24611', 'a b') { |t|
247
- xml['dc'].title element(t._ab, join: ' : ')
248
- }
249
- end
221
+ def marc2dc_title_245_0(xml)
222
+ # [MARC 245 0# $a] " " [MARC 245 0# $b] " [" [MARC 245 0# $h] "]"
223
+ # all_tags('2450#', 'a b h') { |t|
224
+ # xml['dc'].title list_s(t._ab, opt_s(t._h))
225
+ # }
226
+ # ALMA: 245 ## Zh => 245 ## 6 [$h skipped, ': ' before $ skipped]
227
+ all_tags('2450#', 'a b') {|t|
228
+ xml['dc'].title element(t._ab, join: ' : ')
229
+ }
230
+ end
250
231
 
251
- def marc2dc_ispartof(xml)
252
- # DCTERMS:ISPARTOF
253
- marc2dc_ispartof_243(xml)
254
- marc2dc_ispartof_440(xml)
255
- marc2dc_ispartof_lkr(xml)
256
- marc2dc_ispartof_773(xml)
257
- end
232
+ def marc2dc_title_245_1(xml)
233
+ # [MARC 245 1# $a] " " [MARC 245 1# $b] " [" [MARC 245 1# $h] "]"
234
+ # all_tags('2451#', 'a b h') { |t|
235
+ # xml['dc'].title element(t._ab, opt_s(t._h), join: ' ')
236
+ # }
237
+ # ALMA: 245 ## Zh => 245 ## 6 [$h skipped, ': ' before $ skipped]
238
+ all_tags('2451#', 'a b') {|t|
239
+ xml['dc'].title element(t._ab, join: ' : ')
240
+ }
241
+ end
258
242
 
259
- def marc2dc_ispartof_243(xml)
260
- # [MARC 243 1# $a]
261
- # each_field('2431#', 'a') { |f| xml['dcterms'].isPartOf f }
262
- # ALMA: 243 ## a => 830 ## a
263
- each_field('8301#', 'a') { |f| xml['dcterms'].isPartOf f }
264
- end
243
+ def marc2dc_title_246(xml)
244
+ # [MARC 246 11 $a] " : " [MARC 246 11 $b]
245
+ all_tags('24611', 'a b') {|t|
246
+ xml['dc'].title element(t._ab, join: ' : ')
247
+ }
248
+ end
265
249
 
266
- def marc2dc_ispartof_440(xml)
267
- # [MARC 440 _# $a] " : " [MARC 440 _# $b] " , " [MARC 440 _# $v]
268
- # all_tags('440_#', 'a b v') { |t|
269
- # xml['dcterms'].isPartOf element({parts: t._ab, join: ' : '}, t._v, join: ' , ')
270
- # }
271
- # ALMA: 440 _# ab => 490 1_ a [$b replaced with ' : ']
272
- all_tags('4901_', 'a v') { |t|
273
- xml['dcterms'].isPartOf element(t._a, t._v, join: ' , ')
274
- }
275
- end
250
+ def marc2dc_ispartof(xml)
251
+ # DCTERMS:ISPARTOF
252
+ marc2dc_ispartof_243(xml)
253
+ marc2dc_ispartof_440(xml)
254
+ marc2dc_ispartof_lkr(xml)
255
+ marc2dc_ispartof_773(xml)
256
+ end
276
257
 
277
- def marc2dc_ispartof_lkr(xml)
278
- # [MARC LKR $n]
279
- each_field('LKR', 'n') { |f| xml['dcterms'].isPartOf f }
280
- end
258
+ def marc2dc_ispartof_243(xml)
259
+ # [MARC 243 1# $a]
260
+ # each_field('2431#', 'a') { |f| xml['dcterms'].isPartOf f }
261
+ # ALMA: 243 ## a => 830 ## a
262
+ each_field('8301#', 'a') {|f| xml['dcterms'].isPartOf f}
263
+ end
281
264
 
282
- def marc2dc_ispartof_773(xml)
283
- # [MARC 773 0_ $a] " (" [MARC 773 0_ $g*]")"
284
- all_tags('7730_', 'a') { |t|
285
- xml['dcterms'].isPartOf element(t._a, opt_r(repeat(t.a_g)), join: ' ')
286
- }
287
- end
265
+ def marc2dc_ispartof_440(xml)
266
+ # [MARC 440 _# $a] " : " [MARC 440 _# $b] " , " [MARC 440 _# $v]
267
+ # all_tags('440_#', 'a b v') { |t|
268
+ # xml['dcterms'].isPartOf element({parts: t._ab, join: ' : '}, t._v, join: ' , ')
269
+ # }
270
+ # ALMA: 440 _# ab => 490 1_ a [$b replaced with ' : ']
271
+ all_tags('4901_', 'a v') {|t|
272
+ xml['dcterms'].isPartOf element(t._a, t._v, join: ' , ')
273
+ }
274
+ end
288
275
 
289
- def marc2dc_alternative(xml)
290
- # DCTERMS:ALTERNATIVE
291
- marc2dc_alternative_130(xml)
292
- marc2dc_alternative_240(xml)
293
- marc2dc_alternative_242(xml)
294
- marc2dc_alternative_246(xml)
295
- marc2dc_alternative_210(xml)
296
- end
276
+ def marc2dc_ispartof_lkr(xml)
277
+ # [MARC LKR $n]
278
+ each_field('LKR', 'n') {|f| xml['dcterms'].isPartOf f}
279
+ end
297
280
 
298
- def marc2dc_alternative_130(xml)
299
- marc2dc_alternative_130_a(xml)
300
- marc2dc_alternative_130_l(xml)
301
- end
281
+ def marc2dc_ispartof_773(xml)
282
+ # [MARC 773 0_ $a] " (" [MARC 773 0_ $g*]")"
283
+ all_tags('7730_', 'a') {|t|
284
+ xml['dcterms'].isPartOf element(t._a, opt_r(repeat(t.a_g)), join: ' ')
285
+ }
286
+ end
302
287
 
303
- def marc2dc_alternative_130_a(xml)
304
- # [MARC 130 #_ $a] ", " [MARC 130 #_ $f] ", " [MARC 130 #_ $g] ", "
305
- all_tags('130#_', 'a f g') { |t|
306
- xml['dcterms'].alternative element(t._afg, join: ', ', postfix: ', ')
307
- }
308
- end
288
+ def marc2dc_alternative(xml)
289
+ # DCTERMS:ALTERNATIVE
290
+ marc2dc_alternative_130(xml)
291
+ marc2dc_alternative_240(xml)
292
+ marc2dc_alternative_242(xml)
293
+ marc2dc_alternative_246(xml)
294
+ marc2dc_alternative_210(xml)
295
+ end
309
296
 
310
- def marc2dc_alternative_130_l(xml)
311
- # [MARC 130 #_ $l] ", " [MARC 130 #_ $m] ", " [MARC 130 #_ $n] ", " [MARC 130 #_ $o] ", " [MARC 130 #_ $p] ", " [MARC 130 #_ $r] ", " [MARC 130 #_ $s]
312
- all_tags('130#_', 'l m n o p r s') { |t|
313
- xml['dcterms'].alternative element(t._lmnoprs, join: ', ')
314
- }
315
- end
297
+ def marc2dc_alternative_130(xml)
298
+ marc2dc_alternative_130_a(xml)
299
+ marc2dc_alternative_130_l(xml)
300
+ end
316
301
 
317
- def marc2dc_alternative_240(xml)
318
- marc2dc_alternative_240_a(xml)
319
- marc2dc_alternative_240_l(xml)
320
- end
302
+ def marc2dc_alternative_130_a(xml)
303
+ # [MARC 130 #_ $a] ", " [MARC 130 #_ $f] ", " [MARC 130 #_ $g] ", "
304
+ all_tags('130#_', 'a f g') {|t|
305
+ xml['dcterms'].alternative element(t._afg, join: ', ', postfix: ', ')
306
+ }
307
+ end
321
308
 
322
- def marc2dc_alternative_240_a(xml)
323
- # [MARC 240 1# $a] ", " [MARC 240 1# $f] ", " [MARC 240 1# $g] ", "
324
- all_tags('2401#', 'a f g') { |t|
325
- xml['dcterms'].alternative element(t._afg, join: ', ', postfix: ', ')
326
- }
327
- end
309
+ def marc2dc_alternative_130_l(xml)
310
+ # [MARC 130 #_ $l] ", " [MARC 130 #_ $m] ", " [MARC 130 #_ $n] ", " [MARC 130 #_ $o] ", " [MARC 130 #_ $p] ", " [MARC 130 #_ $r] ", " [MARC 130 #_ $s]
311
+ all_tags('130#_', 'l m n o p r s') {|t|
312
+ xml['dcterms'].alternative element(t._lmnoprs, join: ', ')
313
+ }
314
+ end
328
315
 
329
- def marc2dc_alternative_240_l(xml)
330
- # [MARC 240 1# $l] ", " [MARC 240 1# $m] ", " [MARC 240 1# $n] ", " [MARC 240 1# $o] ", " [MARC 240 1# $p] ", " [MARC 240 1# $r] ", " [MARC 240 1# $s]
331
- all_tags('2401#', 'l m n o p r s') { |t|
332
- xml['dcterms'].alternative element(t._lmnoprs, join: ', ')
333
- }
334
- end
316
+ def marc2dc_alternative_240(xml)
317
+ marc2dc_alternative_240_a(xml)
318
+ marc2dc_alternative_240_l(xml)
319
+ end
335
320
 
336
- def marc2dc_alternative_242(xml)
337
- # [MARC 242 1# $a] ". " [MARC 242 1# $b]
338
- all_tags('2421#', 'a b') { |t|
339
- xml['dcterms'].alternative element(t._ab, join: '. ')
340
- }
341
- end
321
+ def marc2dc_alternative_240_a(xml)
322
+ # [MARC 240 1# $a] ", " [MARC 240 1# $f] ", " [MARC 240 1# $g] ", "
323
+ all_tags('2401#', 'a f g') {|t|
324
+ xml['dcterms'].alternative element(t._afg, join: ', ', postfix: ', ')
325
+ }
326
+ end
342
327
 
343
- def marc2dc_alternative_246(xml)
344
- marc2dc_alternative_246_13(xml)
345
- marc2dc_alternative_246_19(xml)
346
- end
328
+ def marc2dc_alternative_240_l(xml)
329
+ # [MARC 240 1# $l] ", " [MARC 240 1# $m] ", " [MARC 240 1# $n] ", " [MARC 240 1# $o] ", " [MARC 240 1# $p] ", " [MARC 240 1# $r] ", " [MARC 240 1# $s]
330
+ all_tags('2401#', 'l m n o p r s') {|t|
331
+ xml['dcterms'].alternative element(t._lmnoprs, join: ', ')
332
+ }
333
+ end
347
334
 
348
- def marc2dc_alternative_246_13(xml)
349
- # [MARC 246 13 $a] ". " [MARC 246 13 $b]
350
- all_tags('24613', 'a b') { |t|
351
- xml['dcterms'].alternative element(t._ab, join: '. ')
352
- }
353
- end
335
+ def marc2dc_alternative_242(xml)
336
+ # [MARC 242 1# $a] ". " [MARC 242 1# $b]
337
+ all_tags('2421#', 'a b') {|t|
338
+ xml['dcterms'].alternative element(t._ab, join: '. ')
339
+ }
340
+ end
354
341
 
355
- def marc2dc_alternative_246_19(xml)
356
- # [MARC 246 19 $a] ". " [MARC 246 19 $b]
357
- # all_tags('24619', 'a b') { |t|
358
- # xml['dcterms'].alternative element(t._ab, join: '. ')
359
- # }
360
- # ALMA: 246 19 => 246 33
361
- all_tags('24633', 'a b') { |t|
362
- xml['dcterms'].alternative element(t._ab, join: '. ')
363
- }
364
- end
342
+ def marc2dc_alternative_246(xml)
343
+ marc2dc_alternative_246_13(xml)
344
+ marc2dc_alternative_246_19(xml)
345
+ end
365
346
 
366
- def marc2dc_alternative_210(xml)
367
- # [MARC 210 10 $a]
368
- each_field('21010', 'a') { |f| xml['dcterms'].alternative f }
369
- end
347
+ def marc2dc_alternative_246_13(xml)
348
+ # [MARC 246 13 $a] ". " [MARC 246 13 $b]
349
+ all_tags('24613', 'a b') {|t|
350
+ xml['dcterms'].alternative element(t._ab, join: '. ')
351
+ }
352
+ end
370
353
 
371
- def marc2dc_creator(xml)
372
- # DC:CREATOR
373
- marc2dc_creator_100(xml)
374
- marc2dc_creator_700(xml)
375
- marc2dc_creator_710(xml)
376
- marc2dc_creator_711(xml)
377
- end
354
+ def marc2dc_alternative_246_19(xml)
355
+ # [MARC 246 19 $a] ". " [MARC 246 19 $b]
356
+ # all_tags('24619', 'a b') { |t|
357
+ # xml['dcterms'].alternative element(t._ab, join: '. ')
358
+ # }
359
+ # ALMA: 246 19 => 246 33
360
+ all_tags('24633', 'a b') {|t|
361
+ xml['dcterms'].alternative element(t._ab, join: '. ')
362
+ }
363
+ end
378
364
 
379
- def marc2dc_creator_100(xml)
380
- marc2dc_creator_100_0(xml)
381
- marc2dc_creator_100_1(xml)
382
- end
365
+ def marc2dc_alternative_210(xml)
366
+ # [MARC 210 10 $a]
367
+ each_field('21010', 'a') {|f| xml['dcterms'].alternative f}
368
+ end
383
369
 
384
- def marc2dc_creator_100_0(xml)
385
- # [MARC 100 0_ $a] " " [MARC 100 0_ $b] " ("[MARC 100 0_ $c] ") " "("[MARC 100 0_ $d]") ("[MARC 100 0_ $g] "), " [MARC 100 0_ $4]" (" [MARC 100 0_ $9]")"
386
- all_tags('1000_', '4') { |t|
387
- next unless check_name(t, :creator)
388
- xml['dc'].creator element(list_s(t._ab, opt_r(t._c), opt_r(t._d), opt_r(t._g)),
389
- list_s(full_name(t), opt_r(t._9)),
390
- join: ', ')
391
- }
392
- end
370
+ def marc2dc_creator(xml)
371
+ # DC:CREATOR
372
+ marc2dc_creator_100(xml)
373
+ marc2dc_creator_700(xml)
374
+ marc2dc_creator_710(xml)
375
+ marc2dc_creator_711(xml)
376
+ end
393
377
 
394
- def marc2dc_creator_100_1(xml)
395
- # [MARC 100 1_ $a] " " [MARC 100 1_ $b] " ("[MARC 100 1_ $c] ") " "("[MARC 100 1_ $d]") ("[MARC 100 1_ $g]"), " [MARC 100 1_ $4]" ("[MARC 100 1_ $e]") (" [MARC 100 1_ $9]")"
396
- # all_tags('1001_', 'a b c d g e 9') { |t|
397
- # next unless check_name(t, :creator)
398
- # xml['dc'].creator element(list_s(t._ab, opt_r(t._c), opt_r(t._d), opt_r(t._g)),
399
- # list_s(full_name(t), opt_r(t._e), opt_r(t._9)),
400
- # join: ', ')
401
- # }
402
-
403
- # ALMA: 100 #_ 9 => 100 #_ 3
404
- all_tags('1001_', 'a b c d g e 3') { |t|
405
- next unless check_name(t, :creator)
406
- xml['dc'].creator element(list_s(t._ab, opt_r(t._c), opt_r(t._d), opt_r(t._g)),
407
- list_s(full_name(t), opt_r(t._e), opt_r(t._3)),
408
- join: ', ')
409
- }
410
- end
378
+ def marc2dc_creator_100(xml)
379
+ marc2dc_creator_100_0(xml)
380
+ marc2dc_creator_100_1(xml)
381
+ end
411
382
 
412
- def marc2dc_creator_700(xml)
413
- marc2dc_creator_700_0(xml)
414
- marc2dc_creator_700_1(xml)
415
- end
383
+ def marc2dc_creator_100_0(xml)
384
+ # [MARC 100 0_ $a] " " [MARC 100 0_ $b] " ("[MARC 100 0_ $c] ") " "("[MARC 100 0_ $d]") ("[MARC 100 0_ $g] "), " [MARC 100 0_ $4]" (" [MARC 100 0_ $9]")"
385
+ all_tags('1000_', '4') {|t|
386
+ next unless check_name(t, :creator)
387
+ xml['dc'].creator element(list_s(t._ab, opt_r(t._c), opt_r(t._d), opt_r(t._g)),
388
+ list_s(full_name(t), opt_r(t._9)),
389
+ join: ', ')
390
+ }
391
+ end
416
392
 
417
- def marc2dc_creator_700_0(xml)
418
- # [MARC 700 0_ $a] ", " [MARC 700 0_ $b] ", " [MARC 700 0_ $c] ", " [MARC 700 0_ $d] ", " [MARC 700 0_ $g] " (" [MARC 700 0_ $4] "), " [MARC 700 0_ $e]
419
- all_tags('7000_', 'g c d e') { |t|
420
- next unless check_name(t, :creator)
421
- xml['dc'].creator element(t._abcd,
422
- list_s(t._g, opt_r(full_name(t))),
423
- t._e,
424
- join: ', ')
425
- }
426
- end
393
+ def marc2dc_creator_100_1(xml)
394
+ # [MARC 100 1_ $a] " " [MARC 100 1_ $b] " ("[MARC 100 1_ $c] ") " "("[MARC 100 1_ $d]") ("[MARC 100 1_ $g]"), " [MARC 100 1_ $4]" ("[MARC 100 1_ $e]") (" [MARC 100 1_ $9]")"
395
+ # all_tags('1001_', 'a b c d g e 9') { |t|
396
+ # next unless check_name(t, :creator)
397
+ # xml['dc'].creator element(list_s(t._ab, opt_r(t._c), opt_r(t._d), opt_r(t._g)),
398
+ # list_s(full_name(t), opt_r(t._e), opt_r(t._9)),
399
+ # join: ', ')
400
+ # }
401
+
402
+ # ALMA: 100 #_ 9 => 100 #_ 3
403
+ all_tags('1001_', 'a b c d g e 3') {|t|
404
+ next unless check_name(t, :creator)
405
+ xml['dc'].creator element(list_s(t._ab, opt_r(t._c), opt_r(t._d), opt_r(t._g)),
406
+ list_s(full_name(t), opt_r(t._e), opt_r(t._3)),
407
+ join: ', ')
408
+ }
409
+ end
427
410
 
428
- def marc2dc_creator_700_1(xml)
429
- # [MARC 700 1_ $a] ", " [MARC 700 1_ $b] ", " [MARC 700 1_ $c] ", " [MARC 700 1_ $d] ", " [MARC 700 1_ $g] " ( " [MARC 700 1_ $4] "), " [MARC 700 1_ $e]
430
- all_tags('7001_', 'a b c d g e') { |t|
431
- next unless check_name(t, :creator)
432
- xml['dc'].creator element(t._abcd,
433
- list_s(t._g, opt_r(full_name(t))),
434
- t._e,
435
- join: ', ')
436
- }
437
- end
411
+ def marc2dc_creator_700(xml)
412
+ marc2dc_creator_700_0(xml)
413
+ marc2dc_creator_700_1(xml)
414
+ end
438
415
 
439
- def marc2dc_creator_710(xml)
440
- marc2dc_creator_710_29(xml)
441
- marc2dc_creator_710_2_(xml)
442
- end
416
+ def marc2dc_creator_700_0(xml)
417
+ # [MARC 700 0_ $a] ", " [MARC 700 0_ $b] ", " [MARC 700 0_ $c] ", " [MARC 700 0_ $d] ", " [MARC 700 0_ $g] " (" [MARC 700 0_ $4] "), " [MARC 700 0_ $e]
418
+ all_tags('7000_', 'g c d e') {|t|
419
+ next unless check_name(t, :creator)
420
+ xml['dc'].creator element(t._abcd,
421
+ list_s(t._g, opt_r(full_name(t))),
422
+ t._e,
423
+ join: ', ')
424
+ }
425
+ end
443
426
 
444
- def marc2dc_creator_710_29(xml)
445
- # [MARC 710 29 $a] "," [MARC 710 29 $g]" (" [MARC 710 29 $4] "), " [MARC 710 29 $e]
446
- all_tags('71029', 'a g e') { |t|
447
- next unless check_name(t, :creator)
448
- xml['dc'].creator element(t._a,
449
- list_s(t._g, opt_r(full_name(t))),
450
- t._e,
451
- join: ', ')
452
- }
453
- end
427
+ def marc2dc_creator_700_1(xml)
428
+ # [MARC 700 1_ $a] ", " [MARC 700 1_ $b] ", " [MARC 700 1_ $c] ", " [MARC 700 1_ $d] ", " [MARC 700 1_ $g] " ( " [MARC 700 1_ $4] "), " [MARC 700 1_ $e]
429
+ all_tags('7001_', 'a b c d g e') {|t|
430
+ next unless check_name(t, :creator)
431
+ xml['dc'].creator element(t._abcd,
432
+ list_s(t._g, opt_r(full_name(t))),
433
+ t._e,
434
+ join: ', ')
435
+ }
436
+ end
454
437
 
455
- def marc2dc_creator_710_2_(xml)
456
- # [MARC 710 2_ $a] " (" [MARC 710 2_ $g] "), " [MARC 710 2_ $4] " (" [MARC 710 2_ $9*] ") ("[MARC 710 2_ $e]")"
457
- all_tags('7102_', 'a g e') { |t|
458
- next unless check_name(t, :creator)
459
- xml['dc'].creator element(list_s(t._a, opt_r(t._g)),
460
- list_s(full_name(t), opt_r(repeat(t.a_9)), opt_r(t._e)),
461
- join: ', ')
462
- }
463
- end
438
+ def marc2dc_creator_710(xml)
439
+ marc2dc_creator_710_29(xml)
440
+ marc2dc_creator_710_2_(xml)
441
+ end
464
442
 
465
- def marc2dc_creator_711(xml)
466
- # [MARC 711 2_ $a] ", "[MARC 711 2_ $n] ", " [MARC 711 2_ $c] ", " [MARC 711 2_ $d] " (" [MARC 711 2_ $g] ")"
467
- all_tags('7112_', 'a n c d g') { |t|
468
- next unless check_name(t, :creator)
469
- xml['dc'].creator element(t._ancd, join: ', ', postfix: opt_r(t._g, prefix: ' '))
470
- }
471
- end
443
+ def marc2dc_creator_710_29(xml)
444
+ # [MARC 710 29 $a] "," [MARC 710 29 $g]" (" [MARC 710 29 $4] "), " [MARC 710 29 $e]
445
+ all_tags('71029', 'a g e') {|t|
446
+ next unless check_name(t, :creator)
447
+ xml['dc'].creator element(t._a,
448
+ list_s(t._g, opt_r(full_name(t))),
449
+ t._e,
450
+ join: ', ')
451
+ }
452
+ end
472
453
 
473
- def marc2dc_subject(xml)
474
- # DC:SUBJECT
475
- marc2dc_subject_600(xml)
476
- marc2dc_subject_610(xml)
477
- marc2dc_subject_611(xml)
478
- marc2dc_subject_630(xml)
479
- marc2dc_subject_650_x0(xml)
480
- marc2dc_subject_650_x2(xml)
481
- marc2dc_subject_691(xml)
482
- marc2dc_subject_082(xml)
483
- marc2dc_subject_690(xml)
484
- marc2dc_subject_650__7(xml)
485
- end
454
+ def marc2dc_creator_710_2_(xml)
455
+ # [MARC 710 2_ $a] " (" [MARC 710 2_ $g] "), " [MARC 710 2_ $4] " (" [MARC 710 2_ $9*] ") ("[MARC 710 2_ $e]")"
456
+ all_tags('7102_', 'a g e') {|t|
457
+ next unless check_name(t, :creator)
458
+ xml['dc'].creator element(list_s(t._a, opt_r(t._g)),
459
+ list_s(full_name(t), opt_r(repeat(t.a_9)), opt_r(t._e)),
460
+ join: ', ')
461
+ }
462
+ end
486
463
 
487
- def marc2dc_subject_600(xml)
488
- # [MARC 600 #0 $a] " " [MARC 600 #0 $b] " " [MARC 600 #0 $c] " " [MARC 600 #0 $d] " " [MARC 600 #0 $g]
489
- all_tags('600#0', 'a b c d g') { |t|
490
- xml['dc'].subject(list_s(t._abcdg), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
491
- }
492
- end
464
+ def marc2dc_creator_711(xml)
465
+ # [MARC 711 2_ $a] ", "[MARC 711 2_ $n] ", " [MARC 711 2_ $c] ", " [MARC 711 2_ $d] " (" [MARC 711 2_ $g] ")"
466
+ all_tags('7112_', 'a n c d g') {|t|
467
+ next unless check_name(t, :creator)
468
+ xml['dc'].creator element(t._ancd, join: ', ', postfix: opt_r(t._g, prefix: ' '))
469
+ }
470
+ end
493
471
 
494
- def marc2dc_subject_610(xml)
495
- # [MARC 610 #0 $a] " " [MARC 610 #0 $c] " " [MARC 610 #0 $d] " " [MARC 610 #0 $g]
496
- all_tags('610#0', 'a c d g') { |t|
497
- xml['dc'].subject(list_s(t._acdg), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
498
- }
499
- end
472
+ def marc2dc_subject(xml)
473
+ # DC:SUBJECT
474
+ marc2dc_subject_600(xml)
475
+ marc2dc_subject_610(xml)
476
+ marc2dc_subject_611(xml)
477
+ marc2dc_subject_630(xml)
478
+ marc2dc_subject_650_x0(xml)
479
+ marc2dc_subject_650_x2(xml)
480
+ marc2dc_subject_691(xml)
481
+ marc2dc_subject_082(xml)
482
+ marc2dc_subject_690(xml)
483
+ marc2dc_subject_650__7(xml)
484
+ end
500
485
 
501
- def marc2dc_subject_611(xml)
502
- # [MARC 611 #0 $a] " " [MARC 611 #0 $c] " " [MARC 611 #0 $d] " " [MARC 611 #0 $g] " " [MARC 611 #0 $n]
503
- all_tags('611#0', 'a c d g n') { |t|
504
- xml['dc'].subject(list_s(t._acdgn), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
505
- }
506
- end
486
+ def marc2dc_subject_600(xml)
487
+ # [MARC 600 #0 $a] " " [MARC 600 #0 $b] " " [MARC 600 #0 $c] " " [MARC 600 #0 $d] " " [MARC 600 #0 $g]
488
+ all_tags('600#0', 'a b c d g') {|t|
489
+ xml['dc'].subject(list_s(t._abcdg), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
490
+ }
491
+ end
507
492
 
508
- def marc2dc_subject_630(xml)
509
- # [MARC 630 #0 $a] " " [MARC 630 #0 $f] " " [MARC 630 #0 $g] " " [MARC 630 #0 $l] " " [MARC 630 #0 $m] " " [MARC 630 #0 $n] " " [MARC 630 #0 $o] " " [MARC 630 #0 $p] " " [MARC 630 #0 $r] " " [MARC 630 #0 $s]
510
- all_tags('630#0', 'a f g l m n o p r s') { |t|
511
- xml['dc'].subject(list_s(t._afglmnoprs), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
512
- }
513
- end
493
+ def marc2dc_subject_610(xml)
494
+ # [MARC 610 #0 $a] " " [MARC 610 #0 $c] " " [MARC 610 #0 $d] " " [MARC 610 #0 $g]
495
+ all_tags('610#0', 'a c d g') {|t|
496
+ xml['dc'].subject(list_s(t._acdg), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
497
+ }
498
+ end
514
499
 
515
- def marc2dc_subject_650_x0(xml)
516
- # [MARC 650 #0 $a] " " [MARC 650 #0 $x] " " [MARC 650 #0 $y] " " [MARC 650 #0 $z]
517
- all_tags('650#0', 'a x y z') { |t|
518
- xml['dc'].subject(list_s(t._axyz), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
519
- }
520
- end
500
+ def marc2dc_subject_611(xml)
501
+ # [MARC 611 #0 $a] " " [MARC 611 #0 $c] " " [MARC 611 #0 $d] " " [MARC 611 #0 $g] " " [MARC 611 #0 $n]
502
+ all_tags('611#0', 'a c d g n') {|t|
503
+ xml['dc'].subject(list_s(t._acdgn), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
504
+ }
505
+ end
521
506
 
522
- def marc2dc_subject_650_x2(xml)
523
- # [MARC 650 #2 $a] " " [MARC 650 #2 $x]
524
- all_tags('650#2', 'a x') { |t|
525
- attributes = {'xsi:type' => 'http://purl.org/dc/terms/MESH'}
526
- xml['dc'].subject(list_s(t._ax), attributes)
527
- }
528
- end
507
+ def marc2dc_subject_630(xml)
508
+ # [MARC 630 #0 $a] " " [MARC 630 #0 $f] " " [MARC 630 #0 $g] " " [MARC 630 #0 $l] " " [MARC 630 #0 $m] " " [MARC 630 #0 $n] " " [MARC 630 #0 $o] " " [MARC 630 #0 $p] " " [MARC 630 #0 $r] " " [MARC 630 #0 $s]
509
+ all_tags('630#0', 'a f g l m n o p r s') {|t|
510
+ xml['dc'].subject(list_s(t._afglmnoprs), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
511
+ }
512
+ end
529
513
 
530
- def marc2dc_subject_691(xml)
531
- # [MARC 691 E1 $8] " " [ MARC 691 E1 $a]
532
- # all_tags('691E1', 'a8') { |t|
533
- # attributes = {'xsi:type' => 'http://purl.org/dc/terms/UDC'}
534
- # x = taalcode(t._9)
535
- # attributes['xml:lang'] = x if x
536
- # xml['dc'].subject(attributes).text list_s(t._ax)
537
- # }
538
- # ALMA: 691 E1 8a => 650 _7 ax $2 == 'UDC' $9 skipped
539
- all_tags('650_7', 'a x') { |t|
540
- next unless t._2 == 'UDC'
541
- attributes = {'xsi:type' => 'http://purl.org/dc/terms/UDC'}
542
- xml['dc'].subject(list_s(t._ax), attributes)
543
- }
544
- end
514
+ def marc2dc_subject_650_x0(xml)
515
+ # [MARC 650 #0 $a] " " [MARC 650 #0 $x] " " [MARC 650 #0 $y] " " [MARC 650 #0 $z]
516
+ all_tags('650#0', 'a x y z') {|t|
517
+ xml['dc'].subject(list_s(t._axyz), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
518
+ }
519
+ end
545
520
 
546
- def marc2dc_subject_082(xml)
547
- # [MARC 082 14 $a] " " [MARC 082 14 $x]
548
- # all_tags('08214', 'a x') { |t|
549
- # xml['dc'].subject('xsi:type' => 'http://purl.org/dc/terms/DDC', 'xml:lang' => 'en').text list_s(t._ax)
550
- # }
551
- # ALMA: 082 14 ax2 => 650 _7 ax4 $2 = 'DDC abridged'
552
- all_tags('650_7', 'a x') { |t|
553
- next unless t._2 == 'DDC abridged'
554
- xml['dc'].subject(list_s(t._ax), 'xsi:type' => 'http://purl.org/dc/terms/DDC', 'xml:lang' => 'en')
555
- }
556
- end
521
+ def marc2dc_subject_650_x2(xml)
522
+ # [MARC 650 #2 $a] " " [MARC 650 #2 $x]
523
+ all_tags('650#2', 'a x') {|t|
524
+ attributes = {'xsi:type' => 'http://purl.org/dc/terms/MESH'}
525
+ xml['dc'].subject(list_s(t._ax), attributes)
526
+ }
527
+ end
557
528
 
558
- def marc2dc_subject_690(_xml)
559
- # [MARC 690 [xx]$a]
560
- # Set dedups the fields
561
- # Set.new(each_field('690##', 'a')) { |f| xml['dc'].subject f }
562
- # ALMA: 690 ## => 650 _7
563
- # Set.new(all_fields('650_7', 'a')).each { |f| xml['dc'].subject f }
564
- # rule disbled gives duplicates and needs to be redefined by KUL cataloguing staff
565
- end
529
+ def marc2dc_subject_691(xml)
530
+ # [MARC 691 E1 $8] " " [ MARC 691 E1 $a]
531
+ # all_tags('691E1', 'a8') { |t|
532
+ # attributes = {'xsi:type' => 'http://purl.org/dc/terms/UDC'}
533
+ # x = taalcode(t._9)
534
+ # attributes['xml:lang'] = x if x
535
+ # xml['dc'].subject(attributes).text list_s(t._ax)
536
+ # }
537
+ # ALMA: 691 E1 8a => 650 _7 ax $2 == 'UDC' $9 skipped
538
+ all_tags('650_7', 'a x') {|t|
539
+ next unless t._2 == 'UDC'
540
+ attributes = {'xsi:type' => 'http://purl.org/dc/terms/UDC'}
541
+ xml['dc'].subject(list_s(t._ax), attributes)
542
+ }
543
+ end
566
544
 
567
- def marc2dc_subject_650__7(xml)
568
- all_tags('650_7', '26a') { |t|
569
- next unless t._2 == 'KADOC'
570
- if t._6 =~ /^\(ODIS-(PS|ORG)\)(\d+)$/
571
- xml['dc'].subject(odis_link($1, $2, CGI::escape(t._a)), 'xsi:type' => 'dcterms:URI')
572
- elsif t._6 =~ /^\(ODIS-(TW)\)(\d)+$/
573
- xml['dc'].subject list_s(t._a, element(t._6, prefix: '[', postfix: ']'))
574
- end
575
- }
576
- end
545
+ def marc2dc_subject_082(xml)
546
+ # [MARC 082 14 $a] " " [MARC 082 14 $x]
547
+ # all_tags('08214', 'a x') { |t|
548
+ # xml['dc'].subject('xsi:type' => 'http://purl.org/dc/terms/DDC', 'xml:lang' => 'en').text list_s(t._ax)
549
+ # }
550
+ # ALMA: 082 14 ax2 => 650 _7 ax4 $2 = 'DDC abridged'
551
+ all_tags('650_7', 'a x') {|t|
552
+ next unless t._2 == 'DDC abridged'
553
+ xml['dc'].subject(list_s(t._ax), 'xsi:type' => 'http://purl.org/dc/terms/DDC', 'xml:lang' => 'en')
554
+ }
555
+ end
577
556
 
578
- def marc2dc_temporal(xml)
579
- # DC:TEMPORAL
580
- marc2dc_temporal_648(xml)
581
- marc2dc_temporal_362(xml)
582
- marc2dc_temporal_752(xml)
583
- end
557
+ def marc2dc_subject_690(_xml)
558
+ # [MARC 690 [xx]$a]
559
+ # Set dedups the fields
560
+ # Set.new(each_field('690##', 'a')) { |f| xml['dc'].subject f }
561
+ # ALMA: 690 ## => 650 _7
562
+ # Set.new(all_fields('650_7', 'a')).each { |f| xml['dc'].subject f }
563
+ # rule disbled gives duplicates and needs to be redefined by KUL cataloguing staff
564
+ end
584
565
 
585
- def marc2dc_temporal_648(xml)
586
- # [MARC 648 #0 $a] " " [MARC 648 #0 $x] " " [MARC 648 #0 $y] " " [MARC 648 #0 $z]
587
- all_tags('648#0', 'a x y z') { |t|
588
- xml['dc'].temporal(list_s(t._axyz), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
589
- }
590
- end
566
+ def marc2dc_subject_650__7(xml)
567
+ all_tags('650_7', '26a') {|t|
568
+ next unless t._2 == 'KADOC'
569
+ if t._6 =~ /^\(ODIS-(PS|ORG)\)(\d+)$/
570
+ xml['dc'].subject(odis_link($1, $2, CGI::escape(t._a)), 'xsi:type' => 'dcterms:URI')
571
+ elsif t._6 =~ /^\(ODIS-(TW)\)(\d)+$/
572
+ xml['dc'].subject list_s(t._a, element(t._6, prefix: '[', postfix: ']'))
573
+ end
574
+ }
575
+ end
591
576
 
592
- def marc2dc_temporal_362(xml)
593
- # [MARC 362 __ $a]
594
- # each_field('362__', 'a') { |f| xml['dc'].temporal f }
595
- # ALMA: 362 __ a => 362 0_ a
596
- each_field('3620_', 'a') { |f| xml['dc'].temporal f }
597
- end
577
+ def marc2dc_temporal(xml)
578
+ # DC:TEMPORAL
579
+ marc2dc_temporal_648(xml)
580
+ marc2dc_temporal_362(xml)
581
+ marc2dc_temporal_752(xml)
582
+ end
598
583
 
599
- def marc2dc_temporal_752(xml)
600
- # [MARC 752 9_ $9]
601
- # each_field('7529_', '9') { |f| xml['dc'].temporal f }
602
- # ALMA: 752 9_ 9 => 953 __ a
603
- each_field('953__', 'a') { |f| xml['dc'].temporal f }
604
-
605
- # [MARC 752 _9 $a] " (" [MARC 752 _9 $9]")"
606
- # all_tags('752_9', 'a 9') { |t|
607
- # xml['dc'].temporal list_s(t._a, opt_r(t._9))
608
- # }
609
- # ALMA: 752 _9 a9 => 953 __ bc
610
- all_tags('953__', 'b c') { |t|
611
- xml['dc'].temporal list_s(t._b, opt_r(t._c))
612
- }
613
- end
584
+ def marc2dc_temporal_648(xml)
585
+ # [MARC 648 #0 $a] " " [MARC 648 #0 $x] " " [MARC 648 #0 $y] " " [MARC 648 #0 $z]
586
+ all_tags('648#0', 'a x y z') {|t|
587
+ xml['dc'].temporal(list_s(t._axyz), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
588
+ }
589
+ end
614
590
 
615
- def marc2dc_description(xml)
616
- # DC:DESCRIPTION
617
-
618
- x = element(
619
- # [MARC 047 __ $a] " (" [MARC 047 __ $9]")"
620
- # all_tags('047__', 'a 9').collect { |t|
621
- # list_s(t._a, opt_r(t._9))
622
- # },
623
- # ALMA: 047 __ a9 => 947 __ ab
624
- all_tags('947__', 'a b').collect { |t|
625
- list_s(t._a, opt_r(t._b))
626
- },
627
- # [MARC 598 __ $a]
628
- # all_fields('598__', 'a'),
629
- # ALMA: 598 __ a => 958 __ a
630
- all_fields('958__', 'a'),
631
- # [MARC 597 __ $a]
632
- # all_fields('597__', 'a'),
633
- # ALMA: 597 __ a => 957 __ a
634
- all_fields('957__', 'a'),
635
- # [MARC 500 __ $a]
636
- all_fields('500__', 'a'),
637
- # [MARC 520 2_ $a]
638
- all_fields('5202_', 'a'),
639
- # "Projectie: " [MARC 093 __ $a]
640
- # all_tags('093__', 'a').collect { |t| element(t._a, prefix: 'Projectie: ') },
641
- # ALMA: 093 ## a => 954 __ a
642
- all_tags('954__', 'a').collect { |t| element(t._a, prefix: 'Projectie: ') },
643
- # "Equidistance " [MARC 094 __ $a*]
644
- # all_tags('094__', 'a').collect { |t| element(t.a_a, prefix: 'Equidistance ', join: ';') },
645
- # ALMA: 094 ## a => 954 __ b
646
- all_tags('954__', 'b').collect { |t| element(t.a_b, prefix: 'Equidistance ', join: ';') },
647
- # [MARC 502 __ $a] ([MARC 502 __ $9])
648
- # all_tags('502__', 'a 9').collect { |t|
649
- # list_s(t._a, opt_r(t._9))
650
- # },
651
- # ALMA: 502 __ 9 => 502 __ g
652
- all_tags('502__', 'a g').collect { |t|
653
- list_s(t._a, opt_r(t._g))
654
- },
655
- # [MARC 529 __ $a] ", " [MARC 529 __ $b] " (" [MARC 529 __ $c] ")"
656
- # all_tags('529__', 'a b 9').collect { |t|
657
- # element(t._ab,
658
- # join: ', ',
659
- # postfix: opt_r(t._9))
660
- # },
661
- # ALMA: 529 __ ab9 => 957 __ abc
662
- all_tags('957__', 'a b c').collect { |t|
663
- element(t._ab,
664
- join: ', ',
665
- postfix: opt_r(t._c))
666
- },
667
- # [MARC 534 9_ $a]
668
- # all_fields('5349_', 'a'),
669
- # ALMA: 534 9_ a => 534 __ t
670
- all_fields('534__', 't'),
671
- # [MARC 534 _9 $a] "(oorspronkelijke uitgever)"
672
- # all_fields('534_9', 'a').collect { |f| element(f, postfix: '(oorspronkelijke uitgever)') },
673
- # ALMA: 534 _9 a => 534 __ c
674
- all_fields('534__', 'c').collect { |f| element(f, postfix: '(oorspronkelijke uitgever)') },
675
- # [MARC 545 __ $a]
676
- all_fields('545__', 'a'),
677
- # [MARC 562 __ $a]
678
- # all_fields('562__', 'a'),
679
- # ALMA: 562 __ a => 963 __ a
680
- all_fields('963__', 'a'),
681
- # [MARC 563 __ $a] " " [MARC 563 __ $9] " (" [MARC 563 __ $u] ")"
682
- # all_tags('563__', 'a 9 u').collect { |t|
683
- # list_s(t._a9, opt_r(t._u))
684
- # },
685
- # ALMA: 563 __ a9u => 563 __ a3u
686
- all_tags('563__', 'a 3 u').collect { |t|
687
- list_s(t._a3, opt_r(t._u))
688
- },
689
- # [MARC 586 __ $a]
690
- all_fields('586__', 'a'),
691
- # [MARC 711 2_ $a] ", " [MARC 711 2_ $n] ", " [MARC 711 2_ $c] ", " [MARC 711 2_ $d] " (" [MARC 711 2_ $g]")"
692
- all_tags('7112_', 'a n c d g').collect { |t|
693
- element(t._ancd,
694
- join: ', ',
695
- postfix: opt_r(t._g))
696
- },
697
- # [MARC 585 __ $a]
698
- all_fields('585__', 'a'),
699
- join: "\n"
700
- )
701
- xml['dc'].description x unless x.empty?
702
- end
591
+ def marc2dc_temporal_362(xml)
592
+ # [MARC 362 __ $a]
593
+ # each_field('362__', 'a') { |f| xml['dc'].temporal f }
594
+ # ALMA: 362 __ a => 362 0_ a
595
+ each_field('3620_', 'a') {|f| xml['dc'].temporal f}
596
+ end
703
597
 
704
- def marc2dc_isversionof(xml)
705
- # DCTERMS:ISVERSIONOF
598
+ def marc2dc_temporal_752(xml)
599
+ # [MARC 752 9_ $9]
600
+ # each_field('7529_', '9') { |f| xml['dc'].temporal f }
601
+ # ALMA: 752 9_ 9 => 953 __ a
602
+ each_field('953__', 'a') {|f| xml['dc'].temporal f}
603
+
604
+ # [MARC 752 _9 $a] " (" [MARC 752 _9 $9]")"
605
+ # all_tags('752_9', 'a 9') { |t|
606
+ # xml['dc'].temporal list_s(t._a, opt_r(t._9))
607
+ # }
608
+ # ALMA: 752 _9 a9 => 953 __ bc
609
+ all_tags('953__', 'b c') {|t|
610
+ xml['dc'].temporal list_s(t._b, opt_r(t._c))
611
+ }
612
+ end
706
613
 
707
- # [MARC 250 __ $a] " (" [MARC 250 __ $b] ")"
708
- all_tags('250__', 'a b') { |t|
709
- xml['dcterms'].isVersionOf list_s(t._a, opt_r(t._b))
710
- }
711
- end
614
+ def marc2dc_description(xml)
615
+ # DC:DESCRIPTION
616
+
617
+ x = element(
618
+ # [MARC 047 __ $a] " (" [MARC 047 __ $9]")"
619
+ # all_tags('047__', 'a 9').collect { |t|
620
+ # list_s(t._a, opt_r(t._9))
621
+ # },
622
+ # ALMA: 047 __ a9 => 947 __ ab
623
+ all_tags('947__', 'a b').collect {|t|
624
+ list_s(t._a, opt_r(t._b))
625
+ },
626
+ # [MARC 598 __ $a]
627
+ # all_fields('598__', 'a'),
628
+ # ALMA: 598 __ a => 958 __ a
629
+ all_fields('958__', 'a'),
630
+ # [MARC 597 __ $a]
631
+ # all_fields('597__', 'a'),
632
+ # ALMA: 597 __ a => 957 __ a
633
+ all_fields('957__', 'a'),
634
+ # [MARC 500 __ $a]
635
+ all_fields('500__', 'a'),
636
+ # [MARC 520 2_ $a]
637
+ all_fields('5202_', 'a'),
638
+ # "Projectie: " [MARC 093 __ $a]
639
+ # all_tags('093__', 'a').collect { |t| element(t._a, prefix: 'Projectie: ') },
640
+ # ALMA: 093 ## a => 954 __ a
641
+ all_tags('954__', 'a').collect {|t| element(t._a, prefix: 'Projectie: ')},
642
+ # "Equidistance " [MARC 094 __ $a*]
643
+ # all_tags('094__', 'a').collect { |t| element(t.a_a, prefix: 'Equidistance ', join: ';') },
644
+ # ALMA: 094 ## a => 954 __ b
645
+ all_tags('954__', 'b').collect {|t| element(t.a_b, prefix: 'Equidistance ', join: ';')},
646
+ # [MARC 502 __ $a] ([MARC 502 __ $9])
647
+ # all_tags('502__', 'a 9').collect { |t|
648
+ # list_s(t._a, opt_r(t._9))
649
+ # },
650
+ # ALMA: 502 __ 9 => 502 __ g
651
+ all_tags('502__', 'a g').collect {|t|
652
+ list_s(t._a, opt_r(t._g))
653
+ },
654
+ # [MARC 529 __ $a] ", " [MARC 529 __ $b] " (" [MARC 529 __ $c] ")"
655
+ # all_tags('529__', 'a b 9').collect { |t|
656
+ # element(t._ab,
657
+ # join: ', ',
658
+ # postfix: opt_r(t._9))
659
+ # },
660
+ # ALMA: 529 __ ab9 => 957 __ abc
661
+ all_tags('957__', 'a b c').collect {|t|
662
+ element(t._ab,
663
+ join: ', ',
664
+ postfix: opt_r(t._c))
665
+ },
666
+ # [MARC 534 9_ $a]
667
+ # all_fields('5349_', 'a'),
668
+ # ALMA: 534 9_ a => 534 __ t
669
+ all_fields('534__', 't'),
670
+ # [MARC 534 _9 $a] "(oorspronkelijke uitgever)"
671
+ # all_fields('534_9', 'a').collect { |f| element(f, postfix: '(oorspronkelijke uitgever)') },
672
+ # ALMA: 534 _9 a => 534 __ c
673
+ all_fields('534__', 'c').collect {|f| element(f, postfix: '(oorspronkelijke uitgever)')},
674
+ # [MARC 545 __ $a]
675
+ all_fields('545__', 'a'),
676
+ # [MARC 562 __ $a]
677
+ # all_fields('562__', 'a'),
678
+ # ALMA: 562 __ a => 963 __ a
679
+ all_fields('963__', 'a'),
680
+ # [MARC 563 __ $a] " " [MARC 563 __ $9] " (" [MARC 563 __ $u] ")"
681
+ # all_tags('563__', 'a 9 u').collect { |t|
682
+ # list_s(t._a9, opt_r(t._u))
683
+ # },
684
+ # ALMA: 563 __ a9u => 563 __ a3u
685
+ all_tags('563__', 'a 3 u').collect {|t|
686
+ list_s(t._a3, opt_r(t._u))
687
+ },
688
+ # [MARC 586 __ $a]
689
+ all_fields('586__', 'a'),
690
+ # [MARC 711 2_ $a] ", " [MARC 711 2_ $n] ", " [MARC 711 2_ $c] ", " [MARC 711 2_ $d] " (" [MARC 711 2_ $g]")"
691
+ all_tags('7112_', 'a n c d g').collect {|t|
692
+ element(t._ancd,
693
+ join: ', ',
694
+ postfix: opt_r(t._g))
695
+ },
696
+ # [MARC 585 __ $a]
697
+ all_fields('585__', 'a'),
698
+ join: "\n"
699
+ )
700
+ xml['dc'].description x unless x.empty?
701
+ end
712
702
 
713
- def marc2dc_abstract(xml)
714
- # DC:ABSTRACT
715
- marc2dc_abstract_520_3__a(xml)
716
- marc2dc_abstract_520_39_a(xml)
717
- marc2dc_abstract_520_3__u(xml)
718
- marc2dc_abstract_520_39_u(xml)
719
- end
703
+ def marc2dc_isversionof(xml)
704
+ # DCTERMS:ISVERSIONOF
720
705
 
721
- def marc2dc_abstract_520_3__a(xml)
722
- # [MARC 520 3_ $a]
723
- each_field('5203_', 'a') { |f| xml['dc'].abstract f }
724
- end
706
+ # [MARC 250 __ $a] " (" [MARC 250 __ $b] ")"
707
+ all_tags('250__', 'a b') {|t|
708
+ xml['dcterms'].isVersionOf list_s(t._a, opt_r(t._b))
709
+ }
710
+ end
725
711
 
726
- def marc2dc_abstract_520_39_a(xml)
727
- # [MARC 520 39 $t] ": " [MARC 520 39 $a]
728
- all_tags('52039', 'a t') { |t|
729
- attributes = {}
730
- attributes['xml:lang'] = taalcode(t._9) if t.subfield_array('9').size == 1
731
- xml['dc'].abstract(element(t._ta, join: ': '), attributes)
732
- }
733
- end
712
+ def marc2dc_abstract(xml)
713
+ # DC:ABSTRACT
714
+ marc2dc_abstract_520_3__a(xml)
715
+ marc2dc_abstract_520_39_a(xml)
716
+ marc2dc_abstract_520_3__u(xml)
717
+ marc2dc_abstract_520_39_u(xml)
718
+ end
734
719
 
735
- def marc2dc_abstract_520_3__u(xml)
736
- # [MARC 520 3_ $u]
737
- each_field('5203_', 'u') { |f| xml['dc'].abstract(element(f), 'xsi:type' => 'dcterms:URI') }
738
- end
720
+ def marc2dc_abstract_520_3__a(xml)
721
+ # [MARC 520 3_ $a]
722
+ each_field('5203_', 'a') {|f| xml['dc'].abstract f}
723
+ end
739
724
 
740
- def marc2dc_abstract_520_39_u(xml)
741
- # [MARC 520 39 $u]
742
- each_field('52039', 'u') { |f| xml['dc'].abstract(element(f), 'xsi:type' => 'dcterms:URI') }
743
- end
725
+ def marc2dc_abstract_520_39_a(xml)
726
+ # [MARC 520 39 $t] ": " [MARC 520 39 $a]
727
+ all_tags('52039', 'a t') {|t|
728
+ attributes = {}
729
+ attributes['xml:lang'] = taalcode(t._9) if t.subfield_array('9').size == 1
730
+ xml['dc'].abstract(element(t._ta, join: ': '), attributes)
731
+ }
732
+ end
744
733
 
745
- def marc2dc_tableofcontents(xml)
746
- # DCTERMS:TABLEOFCONTENTS
747
- marc2dc_tableofcontents_505_0_(xml)
748
- marc2dc_tableofcontents_505_09(xml)
749
- marc2dc_tableofcontents_505_2_(xml)
750
- end
734
+ def marc2dc_abstract_520_3__u(xml)
735
+ # [MARC 520 3_ $u]
736
+ each_field('5203_', 'u') {|f| xml['dc'].abstract(element(f), 'xsi:type' => 'dcterms:URI')}
737
+ end
751
738
 
752
- def marc2dc_tableofcontents_505_0_(xml)
753
- # [MARC 505 0_ $a] " "[MARC 505 0_ $t]" / " [MARC 505 0_ $r*] " ("[MARC 505 0_ $9*]")"
754
- # all_tags('5050_', 'a t r 9') { |t|
755
- # xml['dcterms'].tableOfContents list_s(t._at,
756
- # repeat(t.a_r, prefix: '/ '),
757
- # opt_r(repeat(t.a_9)))
758
- # }
759
- # ALMA: 505 ## 9 => 505 ## g
760
- all_tags('5050_', 'a t r g') { |t|
761
- xml['dcterms'].tableOfContents list_s(t._at,
762
- repeat(t.a_r, prefix: '/ '),
763
- opt_r(repeat(t.a_g)))
764
- }
765
- end
739
+ def marc2dc_abstract_520_39_u(xml)
740
+ # [MARC 520 39 $u]
741
+ each_field('52039', 'u') {|f| xml['dc'].abstract(element(f), 'xsi:type' => 'dcterms:URI')}
742
+ end
766
743
 
767
- def marc2dc_tableofcontents_505_09(xml)
768
- # [MARC 505 09 $a*] "\n" [MARC 505 09 $9*] "\n" [MARC 505 09 $u*]
769
- # all_tags('50509', 'a u 9') { |t|
770
- # xml['dcterms'].tableOfContents element(repeat(t.a_a),
771
- # repeat(t.a_9),
772
- # repeat(t.a_u),
773
- # join: "\n")
774
- # }
775
- # ALMA: 505 ## 9 => 505 ## g
776
- all_tags('50509', 'a u g') { |t|
777
- xml['dcterms'].tableOfContents element(repeat(t.a_a),
778
- repeat(t.a_g),
779
- repeat(t.a_u),
780
- join: "\n")
781
- }
782
- end
744
+ def marc2dc_tableofcontents(xml)
745
+ # DCTERMS:TABLEOFCONTENTS
746
+ marc2dc_tableofcontents_505_0_(xml)
747
+ marc2dc_tableofcontents_505_09(xml)
748
+ marc2dc_tableofcontents_505_2_(xml)
749
+ end
783
750
 
784
- def marc2dc_tableofcontents_505_2_(xml)
785
- # [MARC 505 2_ $a] " "[MARC 505 2_ $t]" / " [MARC 505 2_ $r*] " ("[MARC 505 2_ $9*]")"
786
- # all_tags('5052_', 'a t r 9') { |t|
787
- # xml['dcterms'].tableOfContents list_s(t._at,
788
- # repeat(t.a_r, prefix: '/ '),
789
- # opt_r(repeat(t.a_9)))
790
- # }
791
- # ALMA: 505 ## 9 => 505 ## g
792
- all_tags('5052_', 'a t r g') { |t|
793
- xml['dcterms'].tableOfContents list_s(t._at,
794
- repeat(t.a_r, prefix: '/ '),
795
- opt_r(repeat(t.a_g)))
796
- }
797
- end
751
+ def marc2dc_tableofcontents_505_0_(xml)
752
+ # [MARC 505 0_ $a] " "[MARC 505 0_ $t]" / " [MARC 505 0_ $r*] " ("[MARC 505 0_ $9*]")"
753
+ # all_tags('5050_', 'a t r 9') { |t|
754
+ # xml['dcterms'].tableOfContents list_s(t._at,
755
+ # repeat(t.a_r, prefix: '/ '),
756
+ # opt_r(repeat(t.a_9)))
757
+ # }
758
+ # ALMA: 505 ## 9 => 505 ## g
759
+ all_tags('5050_', 'a t r g') {|t|
760
+ xml['dcterms'].tableOfContents list_s(t._at,
761
+ repeat(t.a_r, prefix: '/ '),
762
+ opt_r(repeat(t.a_g)))
763
+ }
764
+ end
798
765
 
799
- def marc2dc_available(xml)
800
- # DCTERMS:AVAILABLE
766
+ def marc2dc_tableofcontents_505_09(xml)
767
+ # [MARC 505 09 $a*] "\n" [MARC 505 09 $9*] "\n" [MARC 505 09 $u*]
768
+ # all_tags('50509', 'a u 9') { |t|
769
+ # xml['dcterms'].tableOfContents element(repeat(t.a_a),
770
+ # repeat(t.a_9),
771
+ # repeat(t.a_u),
772
+ # join: "\n")
773
+ # }
774
+ # ALMA: 505 ## 9 => 505 ## g
775
+ all_tags('50509', 'a u g') {|t|
776
+ xml['dcterms'].tableOfContents element(repeat(t.a_a),
777
+ repeat(t.a_g),
778
+ repeat(t.a_u),
779
+ join: "\n")
780
+ }
781
+ end
801
782
 
802
- # [MARC 591 ## $9] ":" [MARC 591 ## $a] " (" [MARC 591 ## $b] ")"
803
- # all_tags('591##', 'a b 9') { |t|
804
- # xml['dcterms'].available element(t._9a, join: ':', postfix: opt_r(t._b, prefix: ' '))
805
- # }
806
- # ALMA: 591 __ ab9 => 866 __ axz
807
- all_tags('866##', 'a x z') { |t|
808
- xml['dcterms'].available element(t._za, join: ':', postfix: opt_r(t._x, prefix: ' '))
809
- }
810
- end
783
+ def marc2dc_tableofcontents_505_2_(xml)
784
+ # [MARC 505 2_ $a] " "[MARC 505 2_ $t]" / " [MARC 505 2_ $r*] " ("[MARC 505 2_ $9*]")"
785
+ # all_tags('5052_', 'a t r 9') { |t|
786
+ # xml['dcterms'].tableOfContents list_s(t._at,
787
+ # repeat(t.a_r, prefix: '/ '),
788
+ # opt_r(repeat(t.a_9)))
789
+ # }
790
+ # ALMA: 505 ## 9 => 505 ## g
791
+ all_tags('5052_', 'a t r g') {|t|
792
+ xml['dcterms'].tableOfContents list_s(t._at,
793
+ repeat(t.a_r, prefix: '/ '),
794
+ opt_r(repeat(t.a_g)))
795
+ }
796
+ end
811
797
 
812
- def marc2dc_haspart(xml)
813
- # DCTERMS:HASPART
798
+ def marc2dc_available(xml)
799
+ # DCTERMS:AVAILABLE
814
800
 
815
- # [MARC LKR $m]
816
- each_field('LKR', 'm') { |f| xml['dcterms'].hasPart f }
817
- end
801
+ # [MARC 591 ## $9] ":" [MARC 591 ## $a] " (" [MARC 591 ## $b] ")"
802
+ # all_tags('591##', 'a b 9') { |t|
803
+ # xml['dcterms'].available element(t._9a, join: ':', postfix: opt_r(t._b, prefix: ' '))
804
+ # }
805
+ # ALMA: 591 __ ab9 => 866 __ axz
806
+ all_tags('866##', 'a x z') {|t|
807
+ xml['dcterms'].available element(t._za, join: ':', postfix: opt_r(t._x, prefix: ' '))
808
+ }
809
+ end
818
810
 
819
- def marc2dc_contributor(xml)
820
- # DC:CONTRIBUTOR
821
- marc2dc_contributor_100_0(xml)
822
- marc2dc_contributor_100_1(xml)
823
- marc2dc_contributor_700(xml)
824
- marc2dc_contributor_710_29(xml)
825
- marc2dc_contributor_710_2_(xml)
826
- marc2dc_contributor_711(xml)
827
- end
811
+ def marc2dc_haspart(xml)
812
+ # DCTERMS:HASPART
828
813
 
829
- def marc2dc_contributor_100_0(xml)
830
- # [MARC 100 0_ $a] " " [MARC 100 0_ $b] " ("[MARC 100 0_ $c] ") (" [MARC 100 0_ $d]") ("[MARC 100 0_ $g]"), " [MARC 100 0_ $4]" (" [MARC 100 0_ $9]")"
831
- all_tags('1000_', 'a b c d g 9') { |t|
832
- next unless check_name(t, :contributor)
833
- xml['dc'].contributor element(list_s(t._ab,
834
- opt_r(t._c),
835
- opt_r(t._d),
836
- opt_r(t._g)),
837
- list_s(full_name(t),
838
- opt_r(t._9)),
839
- join: ', ')
840
- }
841
- end
814
+ # [MARC LKR $m]
815
+ each_field('LKR', 'm') {|f| xml['dcterms'].hasPart f}
816
+ end
842
817
 
843
- def marc2dc_contributor_100_1(xml)
844
- # [MARC 100 1_ $a] " " [MARC 100 1_ $b] " ("[MARC 100 1_ $c] ") " "("[MARC 100 1_ $d]") ("[MARC 100 1_ $g]"), " [MARC 100 1_ $4]" ("[MARC 100 1_ $e]") (" [MARC 100 1_ $9]")"
845
- all_tags('1001_', 'a b c d g e 9') { |t|
846
- next unless check_name(t, :contributor)
847
- xml['dc'].contributor element(list_s(t._ab,
848
- opt_r(t._c),
849
- opt_r(t._d),
850
- opt_r(t._g)),
851
- list_s(full_name(t),
852
- opt_r(t._e),
853
- opt_r(t._9)),
854
- join: ', ')
855
- }
856
- end
818
+ def marc2dc_contributor(xml)
819
+ # DC:CONTRIBUTOR
820
+ marc2dc_contributor_100_0(xml)
821
+ marc2dc_contributor_100_1(xml)
822
+ marc2dc_contributor_700(xml)
823
+ marc2dc_contributor_710_29(xml)
824
+ marc2dc_contributor_710_2_(xml)
825
+ marc2dc_contributor_711(xml)
826
+ end
857
827
 
858
- def marc2dc_contributor_700(xml)
859
- # [MARC 700 0_ $a] ", " [MARC 700 0_ $b] ", " [MARC 700 0_ $c] ", " [MARC 700 0_ $d] ", " [MARC 700 0_ $g] " ( " [MARC 700 0_ $4] "), " [MARC 700 0_ $e]
860
- # [MARC 700 1_ $a] ", " [MARC 700 1_ $b] ", " [MARC 700 1_ $c] ", " [MARC 700 1_ $d] ", " [MARC 700 1_ $g] " ( " [MARC 700 1_ $4] "), " [MARC 700 1_ $e]
861
- (all_tags('7000_', 'a b c d g e') + all_tags('7001_', 'a b c d g e')).each { |t|
862
- next unless check_name(t, :contributor)
863
- xml['dc'].contributor element(t._abcd,
864
- list_s(t._g,
865
- opt_r(full_name(t), fix: '( |)')),
866
- t._e,
867
- join: ', ')
868
- }
869
- end
828
+ def marc2dc_contributor_100_0(xml)
829
+ # [MARC 100 0_ $a] " " [MARC 100 0_ $b] " ("[MARC 100 0_ $c] ") (" [MARC 100 0_ $d]") ("[MARC 100 0_ $g]"), " [MARC 100 0_ $4]" (" [MARC 100 0_ $9]")"
830
+ all_tags('1000_', 'a b c d g 9') {|t|
831
+ next unless check_name(t, :contributor)
832
+ xml['dc'].contributor element(list_s(t._ab,
833
+ opt_r(t._c),
834
+ opt_r(t._d),
835
+ opt_r(t._g)),
836
+ list_s(full_name(t),
837
+ opt_r(t._9)),
838
+ join: ', ')
839
+ }
840
+ end
870
841
 
871
- def marc2dc_contributor_710_29(xml)
872
- # [MARC 710 29 $a] "," [MARC 710 29 $g]" (" [MARC 710 29 $4] "), " [MARC 710 29 $e]
873
- all_tags('71029', 'a g e') { |t|
874
- next unless check_name(t, :contributor)
875
- xml['dc'].contributor element(t._a,
876
- list_s(t._g,
877
- opt_r(full_name(t))),
878
- t._e,
879
- join: ', ')
880
- }
881
- end
842
+ def marc2dc_contributor_100_1(xml)
843
+ # [MARC 100 1_ $a] " " [MARC 100 1_ $b] " ("[MARC 100 1_ $c] ") " "("[MARC 100 1_ $d]") ("[MARC 100 1_ $g]"), " [MARC 100 1_ $4]" ("[MARC 100 1_ $e]") (" [MARC 100 1_ $9]")"
844
+ all_tags('1001_', 'a b c d g e 9') {|t|
845
+ next unless check_name(t, :contributor)
846
+ xml['dc'].contributor element(list_s(t._ab,
847
+ opt_r(t._c),
848
+ opt_r(t._d),
849
+ opt_r(t._g)),
850
+ list_s(full_name(t),
851
+ opt_r(t._e),
852
+ opt_r(t._9)),
853
+ join: ', ')
854
+ }
855
+ end
882
856
 
883
- def marc2dc_contributor_710_2_(xml)
884
- # [MARC 710 2_ $a] " (" [MARC 710 2_ $g] "), " [MARC 710 2_ $4] " (" [MARC 710 2_ $9] ") ("[MARC 710 2_ $e]")"
885
- all_tags('7102_', 'a g 9 e') { |t|
886
- next unless check_name(t, :contributor)
887
- xml['dc'].contributor element(list_s(t._a,
888
- opt_r(t._g)),
889
- list_s(full_name(t),
890
- opt_r(t._9),
891
- opt_r(t._e)),
892
- join: ', ')
893
- }
894
- end
857
+ def marc2dc_contributor_700(xml)
858
+ # [MARC 700 0_ $a] ", " [MARC 700 0_ $b] ", " [MARC 700 0_ $c] ", " [MARC 700 0_ $d] ", " [MARC 700 0_ $g] " ( " [MARC 700 0_ $4] "), " [MARC 700 0_ $e]
859
+ # [MARC 700 1_ $a] ", " [MARC 700 1_ $b] ", " [MARC 700 1_ $c] ", " [MARC 700 1_ $d] ", " [MARC 700 1_ $g] " ( " [MARC 700 1_ $4] "), " [MARC 700 1_ $e]
860
+ (all_tags('7000_', 'a b c d g e') + all_tags('7001_', 'a b c d g e')).each {|t|
861
+ next unless check_name(t, :contributor)
862
+ xml['dc'].contributor element(t._abcd,
863
+ list_s(t._g,
864
+ opt_r(full_name(t), fix: '( |)')),
865
+ t._e,
866
+ join: ', ')
867
+ }
868
+ end
895
869
 
896
- def marc2dc_contributor_711(xml)
897
- # [MARC 711 2_ $a] ", "[MARC 711 2_ $n] ", " [MARC 711 2_ $c] ", " [MARC 711 2_ $d] " (" [MARC 711 2_ $g] ")"
898
- all_tags('7112_', 'a n c d g') { |t|
899
- next unless check_name(t, :contributor)
900
- xml['dc'].contributor element(t._anc,
901
- list_s(t._d,
902
- opt_r(t._g)),
903
- join: ', ')
904
- }
905
- end
870
+ def marc2dc_contributor_710_29(xml)
871
+ # [MARC 710 29 $a] "," [MARC 710 29 $g]" (" [MARC 710 29 $4] "), " [MARC 710 29 $e]
872
+ all_tags('71029', 'a g e') {|t|
873
+ next unless check_name(t, :contributor)
874
+ xml['dc'].contributor element(t._a,
875
+ list_s(t._g,
876
+ opt_r(full_name(t))),
877
+ t._e,
878
+ join: ', ')
879
+ }
880
+ end
906
881
 
907
- def marc2dc_provenance(xml)
908
- # DCTERMS:PROVENANCE
909
- marc2dc_provenance_852(xml)
910
- marc2dc_provenance_651(xml)
911
- end
882
+ def marc2dc_contributor_710_2_(xml)
883
+ # [MARC 710 2_ $a] " (" [MARC 710 2_ $g] "), " [MARC 710 2_ $4] " (" [MARC 710 2_ $9] ") ("[MARC 710 2_ $e]")"
884
+ all_tags('7102_', 'a g 9 e') {|t|
885
+ next unless check_name(t, :contributor)
886
+ xml['dc'].contributor element(list_s(t._a,
887
+ opt_r(t._g)),
888
+ list_s(full_name(t),
889
+ opt_r(t._9),
890
+ opt_r(t._e)),
891
+ join: ', ')
892
+ }
893
+ end
912
894
 
913
- def marc2dc_provenance_852(xml)
914
- # [MARC 852 __ $b] " " [MARC 852 __ $c]
915
- all_tags('852__', 'b c') { |t|
916
- xml['dcterms'].provenance list_s(t._b == t._c ? t._b : t._bc)
917
- }
918
- end
895
+ def marc2dc_contributor_711(xml)
896
+ # [MARC 711 2_ $a] ", "[MARC 711 2_ $n] ", " [MARC 711 2_ $c] ", " [MARC 711 2_ $d] " (" [MARC 711 2_ $g] ")"
897
+ all_tags('7112_', 'a n c d g') {|t|
898
+ next unless check_name(t, :contributor)
899
+ xml['dc'].contributor element(t._anc,
900
+ list_s(t._d,
901
+ opt_r(t._g)),
902
+ join: ', ')
903
+ }
904
+ end
919
905
 
920
- def marc2dc_provenance_651(xml)
921
- # [MARC 561 ## $a] " " [MARC 561 ## $b] " " [MARC 561 ## $9]
922
- all_tags('561##', 'a b 9') { |t|
923
- xml['dcterms'].provenance list_s(t._ab9)
924
- }
925
- end
906
+ def marc2dc_provenance(xml)
907
+ # DCTERMS:PROVENANCE
908
+ marc2dc_provenance_852(xml)
909
+ marc2dc_provenance_651(xml)
910
+ end
926
911
 
927
- def marc2dc_publisher(xml)
928
- # DC:PUBLISHER
929
- marc2dc_publisher_260___(xml)
930
- marc2dc_publisher_260__9(xml)
931
- marc2dc_publisher_700(xml)
932
- marc2dc_publisher_710(xml)
933
- end
912
+ def marc2dc_provenance_852(xml)
913
+ # [MARC 852 __ $b] " " [MARC 852 __ $c]
914
+ all_tags('852__', 'b c') {|t|
915
+ xml['dcterms'].provenance list_s(t._b == t._c ? t._b : t._bc)
916
+ }
917
+ end
934
918
 
935
- def marc2dc_publisher_260___(xml)
936
- # [MARC 260 __ $e] " " [MARC 260 __ $f] " " [MARC 260 __ $c] " " [MARC 260 __ $9] " uitgave: " [MARC 260 __ $g]
937
- # all_tags('260__', 'e f c 9 g') { |t|
938
- # xml['dc'].publisher list_s(t._efc9,
939
- # element(t._g, prefix: 'uitgave: '))
940
- # }
941
- # ALMA: 260 _# 9 => 260 __ 3
942
- all_tags('260__', 'e f c 3 g') { |t|
943
- xml['dc'].publisher list_s(t._efc3,
944
- element(t._g, prefix: 'uitgave: '))
945
- }
946
- end
919
+ def marc2dc_provenance_651(xml)
920
+ # [MARC 561 ## $a] " " [MARC 561 ## $b] " " [MARC 561 ## $9]
921
+ all_tags('561##', 'a b 9') {|t|
922
+ xml['dcterms'].provenance list_s(t._ab9)
923
+ }
924
+ end
947
925
 
948
- def marc2dc_publisher_260__9(xml)
949
- # [MARC 260 _9 $c] " " [MARC 260 _9 $9*] " (druk: ) " [MARC 260 _9 $g]
950
- # all_tags('260_9', 'c 9 g') { |t|
951
- # xml['dc'].publisher list_s(t._c,
952
- # repeat(t.a_9),
953
- # element(t._g, prefix: 'druk: '))
954
- # }
955
- # ALMA: 260 _# 9 => 260 __ 3
956
- all_tags('260_9', 'c 3 g') { |t|
957
- xml['dc'].publisher list_s(t._c,
958
- repeat(t.a_3),
959
- element(t._g, prefix: 'druk: '))
960
- }
961
- end
926
+ def marc2dc_publisher(xml)
927
+ # DC:PUBLISHER
928
+ marc2dc_publisher_260___(xml)
929
+ marc2dc_publisher_260__9(xml)
930
+ marc2dc_publisher_700(xml)
931
+ marc2dc_publisher_710(xml)
932
+ end
962
933
 
963
- def marc2dc_publisher_700(xml)
964
- # [MARC 700 0_ $a] ", " [MARC 700 0_ $b] ", " [MARC 700 0_ $c] ", " [MARC 700 0_ $d] ", " [MARC 700 0_ $g] " ( " [MARC 700 0_ $4] "), " [MARC 700 0_ $e] "(uitgever)"
965
- all_tags('7000_', 'a b c d e g 4') { |t|
966
- next unless name_type(t) == :publisher
967
- xml['dc'].publisher element(t._abcd,
968
- list_s(t._g,
969
- opt_r(full_name(t), fix: '( |)')),
970
- t._e,
971
- join: ', ',
972
- postfix: '(uitgever)')
973
- }
974
- end
934
+ def marc2dc_publisher_260___(xml)
935
+ # [MARC 260 __ $e] " " [MARC 260 __ $f] " " [MARC 260 __ $c] " " [MARC 260 __ $9] " uitgave: " [MARC 260 __ $g]
936
+ # all_tags('260__', 'e f c 9 g') { |t|
937
+ # xml['dc'].publisher list_s(t._efc9,
938
+ # element(t._g, prefix: 'uitgave: '))
939
+ # }
940
+ # ALMA: 260 _# 9 => 260 __ 3
941
+ all_tags('260__', 'e f c 3 g') {|t|
942
+ xml['dc'].publisher list_s(t._efc3,
943
+ element(t._g, prefix: 'uitgave: '))
944
+ }
945
+ end
975
946
 
976
- def marc2dc_publisher_710(xml)
977
- # [MARC 710 29 $a] " (" [MARC 710 29 $c] "), " [MARC 710 29 $9] "," [710 29 $g] "(drukker)"
978
- all_tags('71029', 'a c g 9 4') { |t|
979
- xml['dc'].publisher element(list_s(t._a,
980
- opt_r(t._c)),
981
- t._9g,
982
- join: ', ',
983
- postfix: '(drukker)')
984
- }
985
- end
947
+ def marc2dc_publisher_260__9(xml)
948
+ # [MARC 260 _9 $c] " " [MARC 260 _9 $9*] " (druk: ) " [MARC 260 _9 $g]
949
+ # all_tags('260_9', 'c 9 g') { |t|
950
+ # xml['dc'].publisher list_s(t._c,
951
+ # repeat(t.a_9),
952
+ # element(t._g, prefix: 'druk: '))
953
+ # }
954
+ # ALMA: 260 _# 9 => 260 __ 3
955
+ all_tags('260_9', 'c 3 g') {|t|
956
+ xml['dc'].publisher list_s(t._c,
957
+ repeat(t.a_3),
958
+ element(t._g, prefix: 'druk: '))
959
+ }
960
+ end
986
961
 
987
- def marc2dc_date(xml)
988
- # DC:DATE
989
- marc2dc_date_008(xml)
990
- marc2dc_date_130(xml)
991
- marc2dc_date_240(xml)
992
- end
962
+ def marc2dc_publisher_700(xml)
963
+ # [MARC 700 0_ $a] ", " [MARC 700 0_ $b] ", " [MARC 700 0_ $c] ", " [MARC 700 0_ $d] ", " [MARC 700 0_ $g] " ( " [MARC 700 0_ $4] "), " [MARC 700 0_ $e] "(uitgever)"
964
+ all_tags('7000_', 'a b c d e g 4') {|t|
965
+ next unless name_type(t) == :publisher
966
+ xml['dc'].publisher element(t._abcd,
967
+ list_s(t._g,
968
+ opt_r(full_name(t), fix: '( |)')),
969
+ t._e,
970
+ join: ', ',
971
+ postfix: '(uitgever)')
972
+ }
973
+ end
993
974
 
994
- def marc2dc_date_008(xml)
995
- # [MARC 008 (07-10)] " - " [MARC 008 (11-14)]
996
- all_tags('008') { |t|
997
- a = t.datas[7..10].dup
998
- b = t.datas[11..14].dup
999
- # return if both parts contained 'uuuu'
1000
- next if a.gsub!(/^uuuu$/, 'xxxx') && b.gsub!(/^uuuu$/, 'xxxx')
1001
- xml['dc'].date element(a, b, join: ' - ')
1002
- }
1003
- end
975
+ def marc2dc_publisher_710(xml)
976
+ # [MARC 710 29 $a] " (" [MARC 710 29 $c] "), " [MARC 710 29 $9] "," [710 29 $g] "(drukker)"
977
+ all_tags('71029', 'a c g 9 4') {|t|
978
+ xml['dc'].publisher element(list_s(t._a,
979
+ opt_r(t._c)),
980
+ t._9g,
981
+ join: ', ',
982
+ postfix: '(drukker)')
983
+ }
984
+ end
1004
985
 
1005
- def marc2dc_date_130(xml)
1006
- # "Datering origineel werk: " [MARC 130 #_ $f]
1007
- all_tags('130#_', 'f') { |t|
1008
- xml['dc'].date element(t._f, prefix: 'Datering origineel werk: ')
1009
- }
1010
- end
986
+ def marc2dc_date(xml)
987
+ # DC:DATE
988
+ marc2dc_date_008(xml)
989
+ marc2dc_date_130(xml)
990
+ marc2dc_date_240(xml)
991
+ end
1011
992
 
1012
- def marc2dc_date_240(xml)
1013
- # "Datering compositie: " [MARC 240 1# $f]
1014
- all_tags('2401#', 'f') { |t|
1015
- xml['dc'].date element(t._f, prefix: 'Datering compositie: ')
1016
- }
1017
- end
993
+ def marc2dc_date_008(xml)
994
+ # [MARC 008 (07-10)] " - " [MARC 008 (11-14)]
995
+ all_tags('008') {|t|
996
+ a = t.datas[7..10].dup
997
+ b = t.datas[11..14].dup
998
+ # return if both parts contained 'uuuu'
999
+ next if a.gsub!(/^uuuu$/, 'xxxx') && b.gsub!(/^uuuu$/, 'xxxx')
1000
+ xml['dc'].date element(a, b, join: ' - ')
1001
+ }
1002
+ end
1018
1003
 
1019
- def marc2dc_type(xml)
1020
- # DC:TYPE
1021
- marc2dc_type_655_x9_a(xml)
1022
- marc2dc_type_655_9x_a(xml)
1023
- marc2dc_type_655__4_z(xml)
1024
- marc2dc_type_fmt(xml)
1025
- marc2dc_type_655_94_z(xml)
1026
- marc2dc_type_655_9__a(xml)
1027
- marc2dc_type_088_9__a(xml)
1028
- marc2dc_type_088____z(xml)
1029
- marc2dc_type_088____a(xml)
1030
- marc2dc_type_655__4_a(xml)
1031
- marc2dc_type_655_94_a(xml)
1032
- marc2dc_type_088____x(xml)
1033
- marc2dc_type_655__4_x(xml)
1034
- marc2dc_type_655_94_x(xml)
1035
- marc2dc_type_088____y(xml)
1036
- marc2dc_type_655__4_y(xml)
1037
- marc2dc_type_655_94_y(xml)
1038
- marc2dc_type_655__2(xml)
1039
- end
1004
+ def marc2dc_date_130(xml)
1005
+ # "Datering origineel werk: " [MARC 130 #_ $f]
1006
+ all_tags('130#_', 'f') {|t|
1007
+ xml['dc'].date element(t._f, prefix: 'Datering origineel werk: ')
1008
+ }
1009
+ end
1040
1010
 
1041
- def marc2dc_type_655_x9_a(xml)
1042
- # [MARC 655 #9 $a]
1043
- # each_field('655#9', 'a') { |f| xml['dc'].type f }
1044
- # ALMA: 655 _9 a => 955 __ a
1045
- each_field('955__', 'a') { |f| xml['dc'].type f }
1046
- end
1011
+ def marc2dc_date_240(xml)
1012
+ # "Datering compositie: " [MARC 240 1# $f]
1013
+ all_tags('2401#', 'f') {|t|
1014
+ xml['dc'].date element(t._f, prefix: 'Datering compositie: ')
1015
+ }
1016
+ end
1047
1017
 
1048
- def marc2dc_type_655_9x_a(_xml)
1049
- # [MARC 655 9# $a]
1050
- # each_field('6559#', 'a') { |f| xml['dc'].type f }
1051
- # ALMA: 655 9_ a => 955 __ b
1052
- # Zie marc2dc_type_655_9__a
1053
- end
1018
+ def marc2dc_type(xml)
1019
+ # DC:TYPE
1020
+ marc2dc_type_655_x9_a(xml)
1021
+ marc2dc_type_655_9x_a(xml)
1022
+ marc2dc_type_655__4_z(xml)
1023
+ marc2dc_type_fmt(xml)
1024
+ marc2dc_type_655_94_z(xml)
1025
+ marc2dc_type_655_9__a(xml)
1026
+ marc2dc_type_088_9__a(xml)
1027
+ marc2dc_type_088____z(xml)
1028
+ marc2dc_type_088____a(xml)
1029
+ marc2dc_type_655__4_a(xml)
1030
+ marc2dc_type_655_94_a(xml)
1031
+ marc2dc_type_088____x(xml)
1032
+ marc2dc_type_655__4_x(xml)
1033
+ marc2dc_type_655_94_x(xml)
1034
+ marc2dc_type_088____y(xml)
1035
+ marc2dc_type_655__4_y(xml)
1036
+ marc2dc_type_655_94_y(xml)
1037
+ marc2dc_type_655__2(xml)
1038
+ end
1054
1039
 
1055
- def marc2dc_type_655__4_z(_xml)
1056
- # [MARC 655 _4 $z]
1057
- # each_field('655_4', 'z') { |f| xml['dc'].type f }
1058
- # ALMA: 655 _4 axyz => 653 _6 a [$xyz skipped]
1059
- end
1040
+ def marc2dc_type_655_x9_a(xml)
1041
+ # [MARC 655 #9 $a]
1042
+ # each_field('655#9', 'a') { |f| xml['dc'].type f }
1043
+ # ALMA: 655 _9 a => 955 __ a
1044
+ each_field('955__', 'a') {|f| xml['dc'].type f}
1045
+ end
1060
1046
 
1061
- def marc2dc_type_fmt(xml)
1062
- # [MARC FMT]
1063
- all_tags('FMT') { |t| xml['dc'].type fmt(t.datas) }
1064
- end
1047
+ def marc2dc_type_655_9x_a(_xml)
1048
+ # [MARC 655 9# $a]
1049
+ # each_field('6559#', 'a') { |f| xml['dc'].type f }
1050
+ # ALMA: 655 9_ a => 955 __ b
1051
+ # Zie marc2dc_type_655_9__a
1052
+ end
1065
1053
 
1066
- def marc2dc_type_655_94_z(_xml)
1067
- # [MARC 655 94 $z]
1068
- # each_field('65594', 'z') { |f| xml['dc'].type f }
1069
- # ALMA: 655 94 axyz => 653 _6 a [$xyz skipped]
1070
- end
1054
+ def marc2dc_type_655__4_z(_xml)
1055
+ # [MARC 655 _4 $z]
1056
+ # each_field('655_4', 'z') { |f| xml['dc'].type f }
1057
+ # ALMA: 655 _4 axyz => 653 _6 a [$xyz skipped]
1058
+ end
1071
1059
 
1072
- def marc2dc_type_655_9__a(xml)
1073
- # [MARC 655 9_ $a]
1074
- # each_field('6559_', 'a') { |f| xml['dc'].type f }
1075
- # ALMA: 655 9_ a => 955 __ b
1076
- each_field('955__', 'b') { |f| xml['dc'].type f }
1077
- end
1060
+ def marc2dc_type_fmt(xml)
1061
+ # [MARC FMT]
1062
+ all_tags('FMT') {|t| xml['dc'].type fmt(t.datas)}
1063
+ end
1078
1064
 
1079
- def marc2dc_type_088_9__a(xml)
1080
- # [MARC 088 9_ $a]
1081
- # each_field('0889_', 'a') { |f| xml['dc'].type f } if each_field('088__', 'axy').empty?
1082
- # ALMA: 088 9_ a9 => 340 __ d3
1083
- # ALMA: 088 __ axyz9 => 340 __ a3 [$xyz skipped]
1084
- each_field('340__', 'd') { |f| xml['dc'].type f } if all_fields('340__', 'a').empty?
1085
- end
1065
+ def marc2dc_type_655_94_z(_xml)
1066
+ # [MARC 655 94 $z]
1067
+ # each_field('65594', 'z') { |f| xml['dc'].type f }
1068
+ # ALMA: 655 94 axyz => 653 _6 a [$xyz skipped]
1069
+ end
1086
1070
 
1087
- def marc2dc_type_088____z(_xml)
1088
- # [MARC 088 __ $z]
1089
- # each_field('088__', 'z') { |f| xml['dc'].type f }
1090
- # ALMA: 088 __ axyz9 => 340 __ a3 [$xyz skipped]
1091
- end
1071
+ def marc2dc_type_655_9__a(xml)
1072
+ # [MARC 655 9_ $a]
1073
+ # each_field('6559_', 'a') { |f| xml['dc'].type f }
1074
+ # ALMA: 655 9_ a => 955 __ b
1075
+ each_field('955__', 'b') {|f| xml['dc'].type f}
1076
+ end
1092
1077
 
1093
- def marc2dc_type_088____a(xml)
1094
- # [MARC 088 __ $a]
1095
- # each_field('088__', 'a') { |f| xml['dc'].type('xml:lang' => 'en').text f }
1096
- # ALMA: 088 __ axyz9 => 340 __ a3 [$xyz skipped]
1097
- each_field('340__', 'a') { |f| xml['dc'].type(f, 'xml:lang' => 'en') }
1098
- end
1078
+ def marc2dc_type_088_9__a(xml)
1079
+ # [MARC 088 9_ $a]
1080
+ # each_field('0889_', 'a') { |f| xml['dc'].type f } if each_field('088__', 'axy').empty?
1081
+ # ALMA: 088 9_ a9 => 340 __ d3
1082
+ # ALMA: 088 __ axyz9 => 340 __ a3 [$xyz skipped]
1083
+ each_field('340__', 'd') {|f| xml['dc'].type f} if all_fields('340__', 'a').empty?
1084
+ end
1099
1085
 
1100
- def marc2dc_type_655__4_a(xml)
1101
- # [MARC 655 _4 $a]
1102
- # each_field('655_4', 'a') { |f| xml['dc'].type('xml:lang' => 'en').text f }
1103
- # ALMA: 655 _4 axyz => 653 _6 a [$xyz skipped]
1104
- each_field('653_6', 'a') { |f| xml['dc'].type(f, 'xml:lang' => 'en') }
1105
- end
1086
+ def marc2dc_type_088____z(_xml)
1087
+ # [MARC 088 __ $z]
1088
+ # each_field('088__', 'z') { |f| xml['dc'].type f }
1089
+ # ALMA: 088 __ axyz9 => 340 __ a3 [$xyz skipped]
1090
+ end
1106
1091
 
1107
- def marc2dc_type_655_94_a(_xml)
1108
- # [MARC 655 94 $a]
1109
- # each_field('65594', 'a') { |f| xml['dc'].type('xml:lang' => 'en').text f }
1110
- # ALMA: 655 94 axyz => 635 _6 a [$xyz skipped]
1111
- # Case covered by marc2dc_type_655__4_a
1112
- end
1092
+ def marc2dc_type_088____a(xml)
1093
+ # [MARC 088 __ $a]
1094
+ # each_field('088__', 'a') { |f| xml['dc'].type('xml:lang' => 'en').text f }
1095
+ # ALMA: 088 __ axyz9 => 340 __ a3 [$xyz skipped]
1096
+ each_field('340__', 'a') {|f| xml['dc'].type(f, 'xml:lang' => 'en')}
1097
+ end
1113
1098
 
1114
- def marc2dc_type_088____x(_xml)
1115
- # [MARC 088 __ $x]
1116
- # each_field('088__', 'x') { |f| xml['dc'].type('xml:lang' => 'nl').text f }
1117
- # ALMA: 088 __ axyz9 => 340 __ a3 [$xyz skipped]
1118
- end
1099
+ def marc2dc_type_655__4_a(xml)
1100
+ # [MARC 655 _4 $a]
1101
+ # each_field('655_4', 'a') { |f| xml['dc'].type('xml:lang' => 'en').text f }
1102
+ # ALMA: 655 _4 axyz => 653 _6 a [$xyz skipped]
1103
+ each_field('653_6', 'a') {|f| xml['dc'].type(f, 'xml:lang' => 'en')}
1104
+ end
1119
1105
 
1120
- def marc2dc_type_655__4_x(_xml)
1121
- # [MARC 655 _4 $x]
1122
- # each_field('655_4', 'x') { |f| xml['dc'].type('xml:lang' => 'nl').text f }
1123
- # ALMA: 655 _4 axyz => 653 _6 a [$xyz skipped]
1124
- end
1106
+ def marc2dc_type_655_94_a(_xml)
1107
+ # [MARC 655 94 $a]
1108
+ # each_field('65594', 'a') { |f| xml['dc'].type('xml:lang' => 'en').text f }
1109
+ # ALMA: 655 94 axyz => 635 _6 a [$xyz skipped]
1110
+ # Case covered by marc2dc_type_655__4_a
1111
+ end
1125
1112
 
1126
- def marc2dc_type_655_94_x(_xml)
1127
- # [MARC 655 94 $x]
1128
- # each_field('65594', 'x') { |f| xml['dc'].type('xml:lang' => 'nl').text f }
1129
- # ALMA: 655 94 axyz => 653 _6 a [$xyz skipped]
1130
- end
1113
+ def marc2dc_type_088____x(_xml)
1114
+ # [MARC 088 __ $x]
1115
+ # each_field('088__', 'x') { |f| xml['dc'].type('xml:lang' => 'nl').text f }
1116
+ # ALMA: 088 __ axyz9 => 340 __ a3 [$xyz skipped]
1117
+ end
1131
1118
 
1132
- def marc2dc_type_088____y(_xml)
1133
- # [MARC 088 __ $y]
1134
- # each_field('088__', 'y') { |f| xml['dc'].type('xml:lang' => 'fr').text f }
1135
- # ALMA: 088 __ axyz9 => 340 __ a3 [$xyz skipped]
1136
- end
1119
+ def marc2dc_type_655__4_x(_xml)
1120
+ # [MARC 655 _4 $x]
1121
+ # each_field('655_4', 'x') { |f| xml['dc'].type('xml:lang' => 'nl').text f }
1122
+ # ALMA: 655 _4 axyz => 653 _6 a [$xyz skipped]
1123
+ end
1137
1124
 
1138
- def marc2dc_type_655__4_y(_xml)
1139
- # [MARC 655 _4 $y]
1140
- # each_field('655_4', 'y') { |f| xml['dc'].type('xml:lang' => 'fr').text f }
1141
- # ALMA: 655 _4 axyz => 653 _6 a [$xyz skipped]
1142
- end
1125
+ def marc2dc_type_655_94_x(_xml)
1126
+ # [MARC 655 94 $x]
1127
+ # each_field('65594', 'x') { |f| xml['dc'].type('xml:lang' => 'nl').text f }
1128
+ # ALMA: 655 94 axyz => 653 _6 a [$xyz skipped]
1129
+ end
1143
1130
 
1144
- def marc2dc_type_655_94_y(_xml)
1145
- # [MARC 655 94 $y]
1146
- # each_field('65594', 'y') { |f| xml['dc'].type('xml:lang' => 'fr').text f }
1147
- # ALMA: 655 94 axyz => 653 _6 a [$xyz skipped]
1148
- end
1131
+ def marc2dc_type_088____y(_xml)
1132
+ # [MARC 088 __ $y]
1133
+ # each_field('088__', 'y') { |f| xml['dc'].type('xml:lang' => 'fr').text f }
1134
+ # ALMA: 088 __ axyz9 => 340 __ a3 [$xyz skipped]
1135
+ end
1149
1136
 
1150
- def marc2dc_type_655__2(xml)
1151
- # [MARC 655 #2 $a] " " [MARC 655 #2 $x*] " " [MARC 655 #2 $9]
1152
- all_tags('655#2', 'a x 9') { |t|
1153
- xml['dc'].type(list_s(t._a, repeat(t.a_x), t._9), 'xsi:type' => 'http://purl.org/dc/terms/MESH')
1154
- }
1155
- end
1137
+ def marc2dc_type_655__4_y(_xml)
1138
+ # [MARC 655 _4 $y]
1139
+ # each_field('655_4', 'y') { |f| xml['dc'].type('xml:lang' => 'fr').text f }
1140
+ # ALMA: 655 _4 axyz => 653 _6 a [$xyz skipped]
1141
+ end
1156
1142
 
1157
- def marc2dc_spatial(xml)
1158
- # DCTERMS:SPATIAL
1159
- marc2dc_spatial_752(xml)
1160
- marc2dc_spatial_034_1(xml)
1161
- marc2dc_spatial_034_3(xml)
1162
- marc2dc_spatial_034_9(xml)
1163
- marc2dc_spatial_507(xml)
1164
- marc2dc_spatial_651__0(xml)
1165
- marc2dc_spatial_651__2(xml)
1166
- end
1143
+ def marc2dc_type_655_94_y(_xml)
1144
+ # [MARC 655 94 $y]
1145
+ # each_field('65594', 'y') { |f| xml['dc'].type('xml:lang' => 'fr').text f }
1146
+ # ALMA: 655 94 axyz => 653 _6 a [$xyz skipped]
1147
+ end
1167
1148
 
1168
- def marc2dc_spatial_752(xml)
1169
- # [MARC 752 __ $a] " " [MARC 752 __ $c] " " [MARC 752 __ $d] " (" [MARC 752 __ $9] ")"
1170
- # all_tags('752__', 'a c d 9') { |t|
1171
- # xml['dcterms'].spatial list_s(t._acd,
1172
- # opt_r(t._9))
1173
- # }
1174
- # ALMA: 752 __ acd9 => 952 acde
1175
- all_tags('952__', 'a c d e') { |t|
1176
- xml['dcterms'].spatial list_s(t._acd,
1177
- opt_r(t._e))
1178
- }
1179
- end
1149
+ def marc2dc_type_655__2(xml)
1150
+ # [MARC 655 #2 $a] " " [MARC 655 #2 $x*] " " [MARC 655 #2 $9]
1151
+ all_tags('655#2', 'a x 9') {|t|
1152
+ xml['dc'].type(list_s(t._a, repeat(t.a_x), t._9), 'xsi:type' => 'http://purl.org/dc/terms/MESH')
1153
+ }
1154
+ end
1180
1155
 
1181
- def marc2dc_spatial_034_1(xml)
1182
- # "Schaal: " [MARC 034 1_ $a]
1183
- each_field('0341_', 'a') { |f|
1184
- xml['dcterms'].spatial element(f, prefix: 'Schaal: ')
1185
- }
1186
- end
1156
+ def marc2dc_spatial(xml)
1157
+ # DCTERMS:SPATIAL
1158
+ marc2dc_spatial_752(xml)
1159
+ marc2dc_spatial_034_1(xml)
1160
+ marc2dc_spatial_034_3(xml)
1161
+ marc2dc_spatial_034_9(xml)
1162
+ marc2dc_spatial_507(xml)
1163
+ marc2dc_spatial_651__0(xml)
1164
+ marc2dc_spatial_651__2(xml)
1165
+ end
1187
1166
 
1188
- def marc2dc_spatial_034_3(xml)
1189
- # "Schaal: " [MARC 034 3_ $a*]
1190
- all_tags('0343_', 'a') { |t|
1191
- xml['dcterms'].spatial repeat(t.a_a, prefix: 'Schaal: ')
1192
- }
1193
- end
1167
+ def marc2dc_spatial_752(xml)
1168
+ # [MARC 752 __ $a] " " [MARC 752 __ $c] " " [MARC 752 __ $d] " (" [MARC 752 __ $9] ")"
1169
+ # all_tags('752__', 'a c d 9') { |t|
1170
+ # xml['dcterms'].spatial list_s(t._acd,
1171
+ # opt_r(t._9))
1172
+ # }
1173
+ # ALMA: 752 __ acd9 => 952 acde
1174
+ all_tags('952__', 'a c d e') {|t|
1175
+ xml['dcterms'].spatial list_s(t._acd,
1176
+ opt_r(t._e))
1177
+ }
1178
+ end
1194
1179
 
1195
- def marc2dc_spatial_034_9(xml)
1196
- # [MARC 034 91 $d] " " [MARC 034 91 $e] " " [MARC 034 91 $f] " " [MARC 034 91 $g]
1197
- all_tags('03491', 'd e f g') { |t| xml['dcterms'].spatial list_s(t._defg) }
1198
- end
1180
+ def marc2dc_spatial_034_1(xml)
1181
+ # "Schaal: " [MARC 034 1_ $a]
1182
+ each_field('0341_', 'a') {|f|
1183
+ xml['dcterms'].spatial element(f, prefix: 'Schaal: ')
1184
+ }
1185
+ end
1199
1186
 
1200
- def marc2dc_spatial_507(xml)
1201
- # [MARC 507 __ $a]
1202
- each_field('507__', 'a') { |f| xml['dcterms'].spatial f }
1203
- end
1187
+ def marc2dc_spatial_034_3(xml)
1188
+ # "Schaal: " [MARC 034 3_ $a*]
1189
+ all_tags('0343_', 'a') {|t|
1190
+ xml['dcterms'].spatial repeat(t.a_a, prefix: 'Schaal: ')
1191
+ }
1192
+ end
1204
1193
 
1205
- def marc2dc_spatial_651__0(xml)
1206
- # [MARC 651 #0 $a] " " [MARC 651 #0 $x*] " " [MARC 651 #0 $y] " " [MARC 651 #0 $z]
1207
- all_tags('651#0', 'a x y z') { |t|
1208
- xml['dcterms'].spatial(list_s(t._a, repeat(t.a_x), t._yz), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
1209
- }
1210
- end
1194
+ def marc2dc_spatial_034_9(xml)
1195
+ # [MARC 034 91 $d] " " [MARC 034 91 $e] " " [MARC 034 91 $f] " " [MARC 034 91 $g]
1196
+ all_tags('03491', 'd e f g') {|t| xml['dcterms'].spatial list_s(t._defg)}
1197
+ end
1211
1198
 
1212
- def marc2dc_spatial_651__2(xml)
1213
- # [MARC 651 #2 $a] " " [MARC 651 #2 $x*]
1214
- all_tags('651#2', 'a x') { |t|
1215
- xml['dcterms'].spatial(list_s(t._a, repeat(t.a_x)), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
1216
- }
1217
- end
1199
+ def marc2dc_spatial_507(xml)
1200
+ # [MARC 507 __ $a]
1201
+ each_field('507__', 'a') {|f| xml['dcterms'].spatial f}
1202
+ end
1218
1203
 
1219
- def marc2dc_extent(xml)
1220
- # DCTERMS:EXTENT
1221
- marc2dc_extent_300__(xml)
1222
- marc2dc_extent_300_9(xml)
1223
- marc2dc_extent_306(xml)
1224
- marc2dc_extent_309(xml)
1225
- marc2dc_extent_339(xml)
1226
- end
1204
+ def marc2dc_spatial_651__0(xml)
1205
+ # [MARC 651 #0 $a] " " [MARC 651 #0 $x*] " " [MARC 651 #0 $y] " " [MARC 651 #0 $z]
1206
+ all_tags('651#0', 'a x y z') {|t|
1207
+ xml['dcterms'].spatial(list_s(t._a, repeat(t.a_x), t._yz), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
1208
+ }
1209
+ end
1227
1210
 
1228
- def marc2dc_extent_300__(xml)
1229
- # [MARC 300 __ $a*] " " [MARC 300 __ $b] " " [MARC 300__ $c*] " " [MARC 300 __ $e] " (" [MARC 300 __ $9] ")"
1230
- # all_tags('300__', 'a b c e 9') { |t|
1231
- # xml['dcterms'].extent list_s(repeat(t.a_a),
1232
- # t._b,
1233
- # repeat(t.a_c),
1234
- # t._e,
1235
- # opt_r(t._9))
1236
- # }
1237
- # ALMA: 300 __ 9 => 300 __ g
1238
- all_tags('300__', 'a b c e g') { |t|
1239
- xml['dcterms'].extent list_s(repeat(t.a_a),
1240
- t._b,
1241
- repeat(t.a_c),
1242
- t._e,
1243
- opt_r(t._g))
1244
- }
1245
- end
1211
+ def marc2dc_spatial_651__2(xml)
1212
+ # [MARC 651 #2 $a] " " [MARC 651 #2 $x*]
1213
+ all_tags('651#2', 'a x') {|t|
1214
+ xml['dcterms'].spatial(list_s(t._a, repeat(t.a_x)), 'xsi:type' => 'http://purl.org/dc/terms/LCSH')
1215
+ }
1216
+ end
1246
1217
 
1247
- def marc2dc_extent_300_9(xml)
1248
- # [MARC 300 9_ $a] " " [MARC 300 9_ $b] " " [MARC 300 9_ $c*] " " [MARC 300 9_ $e] " (" [MARC 300 9_ $9]")"
1249
- # all_tags('3009_', 'a b c e 9') { |t|
1250
- # xml['dcterms'].extent list_s(t._ab,
1251
- # repeat(t.a_c),
1252
- # t._e,
1253
- # opt_r(t._9))
1254
- # }
1255
- # ALMA: 300 9_ ac => 300 9_ ac
1256
- # ALMA: 300 9_ b9 => 340 __ oc
1257
- # This change is not compatible with DC converter (only 1 tag per DC element). 2 DC elements generated instead.
1258
- all_tags('3009_', 'a c') { |t|
1259
- xml['dcterms'].extent list_s(t._a, repeat(t.a_c))
1260
- }
1261
- all_tags('340__', 'o c') { |t|
1262
- xml['dcterms'].extent list_s(t._o, opt_r(t._c))
1263
- }
1264
- end
1218
+ def marc2dc_extent(xml)
1219
+ # DCTERMS:EXTENT
1220
+ marc2dc_extent_300__(xml)
1221
+ marc2dc_extent_300_9(xml)
1222
+ marc2dc_extent_306(xml)
1223
+ marc2dc_extent_309(xml)
1224
+ marc2dc_extent_339(xml)
1225
+ end
1265
1226
 
1266
- def marc2dc_extent_306(xml)
1267
- # [MARC 306 __ $a*]
1268
- all_tags('306__', 'a') { |t| xml['dcterms'].extent repeat(t.a_a.collect { |y| y.scan(/(\d\d)(\d\d)(\d\d)/).join(':') }) }
1269
- end
1227
+ def marc2dc_extent_300__(xml)
1228
+ # [MARC 300 __ $a*] " " [MARC 300 __ $b] " " [MARC 300__ $c*] " " [MARC 300 __ $e] " (" [MARC 300 __ $9] ")"
1229
+ # all_tags('300__', 'a b c e 9') { |t|
1230
+ # xml['dcterms'].extent list_s(repeat(t.a_a),
1231
+ # t._b,
1232
+ # repeat(t.a_c),
1233
+ # t._e,
1234
+ # opt_r(t._9))
1235
+ # }
1236
+ # ALMA: 300 __ 9 => 300 __ g
1237
+ all_tags('300__', 'a b c e g') {|t|
1238
+ xml['dcterms'].extent list_s(repeat(t.a_a),
1239
+ t._b,
1240
+ repeat(t.a_c),
1241
+ t._e,
1242
+ opt_r(t._g))
1243
+ }
1244
+ end
1270
1245
 
1271
- def marc2dc_extent_309(_xml)
1272
- # [MARC 309 __ $a]
1273
- # each_field('309__', 'a') { |f| xml['dcterms'].extent f }
1274
- # ALMA: 309 __ a => 306 __ a
1275
- # covered by marc2dc_extent_306
1276
- end
1246
+ def marc2dc_extent_300_9(xml)
1247
+ # [MARC 300 9_ $a] " " [MARC 300 9_ $b] " " [MARC 300 9_ $c*] " " [MARC 300 9_ $e] " (" [MARC 300 9_ $9]")"
1248
+ # all_tags('3009_', 'a b c e 9') { |t|
1249
+ # xml['dcterms'].extent list_s(t._ab,
1250
+ # repeat(t.a_c),
1251
+ # t._e,
1252
+ # opt_r(t._9))
1253
+ # }
1254
+ # ALMA: 300 9_ ac => 300 9_ ac
1255
+ # ALMA: 300 9_ b9 => 340 __ oc
1256
+ # This change is not compatible with DC converter (only 1 tag per DC element). 2 DC elements generated instead.
1257
+ all_tags('3009_', 'a c') {|t|
1258
+ xml['dcterms'].extent list_s(t._a, repeat(t.a_c))
1259
+ }
1260
+ all_tags('340__', 'o c') {|t|
1261
+ xml['dcterms'].extent list_s(t._o, opt_r(t._c))
1262
+ }
1263
+ end
1277
1264
 
1278
- def marc2dc_extent_339(xml)
1279
- # [MARC 339 __ $a*]
1280
- # all_tags('339__', 'a') { |t| xml['dcterms'].extent repeat(t.a_a) }
1281
- # ALMA: 339 __ a => 340 __ d
1282
- all_tags('340__', 'd') { |t| xml['dcterms'].extent repeat(t.a_d) }
1283
- end
1265
+ def marc2dc_extent_306(xml)
1266
+ # [MARC 306 __ $a*]
1267
+ all_tags('306__', 'a') {|t| xml['dcterms'].extent repeat(t.a_a.collect {|y| y.scan(/(\d\d)(\d\d)(\d\d)/).join(':')})}
1268
+ end
1284
1269
 
1285
- def marc2dc_accrualperiodicity(xml)
1286
- # DCTERMS:ACCRUALPERIODICITY
1270
+ def marc2dc_extent_309(_xml)
1271
+ # [MARC 309 __ $a]
1272
+ # each_field('309__', 'a') { |f| xml['dcterms'].extent f }
1273
+ # ALMA: 309 __ a => 306 __ a
1274
+ # covered by marc2dc_extent_306
1275
+ end
1287
1276
 
1288
- # [MARC 310 __ $a] " (" [MARC 310 __ $b] ")"
1289
- all_tags('310__', 'a b') { |t|
1290
- xml['dcterms'].accrualPeriodicity list_s(t._a,
1291
- opt_r(t._b))
1292
- }
1293
- end
1277
+ def marc2dc_extent_339(xml)
1278
+ # [MARC 339 __ $a*]
1279
+ # all_tags('339__', 'a') { |t| xml['dcterms'].extent repeat(t.a_a) }
1280
+ # ALMA: 339 __ a => 340 __ d
1281
+ all_tags('340__', 'd') {|t| xml['dcterms'].extent repeat(t.a_d)}
1282
+ end
1294
1283
 
1295
- def marc2dc_format(xml)
1296
- # DC:FORMAT
1284
+ def marc2dc_accrualperiodicity(xml)
1285
+ # DCTERMS:ACCRUALPERIODICITY
1297
1286
 
1298
- # [MARC 340 __ $a*]
1299
- all_tags('340__', 'a') { |t|
1300
- xml['dc'].format repeat(t.a_a)
1301
- }
1302
- end
1287
+ # [MARC 310 __ $a] " (" [MARC 310 __ $b] ")"
1288
+ all_tags('310__', 'a b') {|t|
1289
+ xml['dcterms'].accrualPeriodicity list_s(t._a,
1290
+ opt_r(t._b))
1291
+ }
1292
+ end
1303
1293
 
1304
- def marc2dc_medium(xml)
1305
- # DCTERMS:MEDIUM
1306
- marc2dc_medium_319__(xml)
1307
- marc2dc_medium_319_9(xml)
1308
- marc2dc_medium_399(xml)
1309
- end
1294
+ def marc2dc_format(xml)
1295
+ # DC:FORMAT
1310
1296
 
1311
- def marc2dc_medium_319__(xml)
1312
- # [MARC 319 __ $a]
1313
- # each_field('319__', 'a') { |f| xml['dcterms'].medium f }
1314
- # ALMA: 319 __ a => 340 __ e
1315
- each_field('340__', 'e') { |f| xml['dcterms'].medium f }
1316
- end
1297
+ # [MARC 340 __ $a*]
1298
+ all_tags('340__', 'a') {|t|
1299
+ xml['dc'].format repeat(t.a_a)
1300
+ }
1301
+ end
1317
1302
 
1318
- def marc2dc_medium_319_9(_xml)
1319
- # [MARC 319 9_ $a] " (" [MARC 319 9_ $9] ")"
1320
- # all_tags('3199_', 'a 9') { |t|
1321
- # xml['dcterms'].medium list_s(t._a,
1322
- # opt_r(t._9))
1323
- # }
1324
- # ALMA: 319 9_ a => 340 __ e
1325
- # covered by marc2dc_medium_319__
1326
- end
1303
+ def marc2dc_medium(xml)
1304
+ # DCTERMS:MEDIUM
1305
+ marc2dc_medium_319__(xml)
1306
+ marc2dc_medium_319_9(xml)
1307
+ marc2dc_medium_399(xml)
1308
+ end
1327
1309
 
1328
- def marc2dc_medium_399(xml)
1329
- # [MARC 399 __ $a] " " [MARC 399 __ $b] " (" [MARC 399 __ $9] ")"
1330
- # all_tags('399__', 'a b 9') { |t|
1331
- # xml['dcterms'].medium list_s(t._ab,
1332
- # opt_r(t._9))
1333
- # }
1334
- # ALMA: 399 __ ab9 => 950 __ abc
1335
- all_tags('950__', 'a b c') { |t|
1336
- xml['dcterms'].medium list_s(t._ab,
1337
- opt_r(t._c))
1338
- }
1339
- end
1310
+ def marc2dc_medium_319__(xml)
1311
+ # [MARC 319 __ $a]
1312
+ # each_field('319__', 'a') { |f| xml['dcterms'].medium f }
1313
+ # ALMA: 319 __ a => 340 __ e
1314
+ each_field('340__', 'e') {|f| xml['dcterms'].medium f}
1315
+ end
1340
1316
 
1341
- def marc2dc_relation(xml)
1342
- # DC:RELATION
1317
+ def marc2dc_medium_319_9(_xml)
1318
+ # [MARC 319 9_ $a] " (" [MARC 319 9_ $9] ")"
1319
+ # all_tags('3199_', 'a 9') { |t|
1320
+ # xml['dcterms'].medium list_s(t._a,
1321
+ # opt_r(t._9))
1322
+ # }
1323
+ # ALMA: 319 9_ a => 340 __ e
1324
+ # covered by marc2dc_medium_319__
1325
+ end
1343
1326
 
1344
- # [MARC 580 __ $a]
1345
- each_field('580__', 'a') { |e| xml['dc'].relation e }
1346
- end
1327
+ def marc2dc_medium_399(xml)
1328
+ # [MARC 399 __ $a] " " [MARC 399 __ $b] " (" [MARC 399 __ $9] ")"
1329
+ # all_tags('399__', 'a b 9') { |t|
1330
+ # xml['dcterms'].medium list_s(t._ab,
1331
+ # opt_r(t._9))
1332
+ # }
1333
+ # ALMA: 399 __ ab9 => 950 __ abc
1334
+ all_tags('950__', 'a b c') {|t|
1335
+ xml['dcterms'].medium list_s(t._ab,
1336
+ opt_r(t._c))
1337
+ }
1338
+ end
1347
1339
 
1348
- def marc2dc_replaces(xml)
1349
- # DCTERMS:REPLACES
1340
+ def marc2dc_relation(xml)
1341
+ # DC:RELATION
1350
1342
 
1351
- # [MARC 247 1# $a] " : " [MARC 247 1# $b] " (" [MARC 247 1# $9] ")"
1352
- # all_tags('2471#', 'a b 9') { |t|
1353
- # xml['dcterms'].replaces list_s(element(t._a, t._b, join: ' : '), opt_r(t._9))
1354
- # }
1355
- # ALMA: 247 10 9Z => 247 10 g6
1356
- all_tags('2471#', 'a b g') { |t|
1357
- xml['dcterms'].replaces list_s(element(t._a, t._b, join: ' : '), opt_r(t._g))
1358
- }
1359
- end
1343
+ # [MARC 580 __ $a]
1344
+ each_field('580__', 'a') {|e| xml['dc'].relation e}
1345
+ end
1360
1346
 
1361
- def marc2dc_hasversion(xml)
1362
- # DCTERMS:HASVERSION
1347
+ def marc2dc_replaces(xml)
1348
+ # DCTERMS:REPLACES
1363
1349
 
1364
- # [MARC 534 __ $a]
1365
- # each_field('534__', 'a') { |f| xml['dcterms'].hasVersion f }
1366
- # ALMA: 534 __ a => 534 __ b
1367
- each_field('534__', 'b') { |f| xml['dcterms'].hasVersion f }
1368
- end
1350
+ # [MARC 247 1# $a] " : " [MARC 247 1# $b] " (" [MARC 247 1# $9] ")"
1351
+ # all_tags('2471#', 'a b 9') { |t|
1352
+ # xml['dcterms'].replaces list_s(element(t._a, t._b, join: ' : '), opt_r(t._9))
1353
+ # }
1354
+ # ALMA: 247 10 9Z => 247 10 g6
1355
+ all_tags('2471#', 'a b g') {|t|
1356
+ xml['dcterms'].replaces list_s(element(t._a, t._b, join: ' : '), opt_r(t._g))
1357
+ }
1358
+ end
1369
1359
 
1370
- def marc2dc_source(xml)
1371
- # DC:SOURCE
1372
- marc2dc_source_852___(xml)
1373
- marc2dc_source_856(xml)
1374
- end
1360
+ def marc2dc_hasversion(xml)
1361
+ # DCTERMS:HASVERSION
1375
1362
 
1376
- def marc2dc_source_852___(xml)
1377
- # [MARC 852 __ $b] " " [MARC 852 __ $c] " " [MARC 852 __ $k] " " [MARC 852 __ $h] " " [MARC 852 __ $9] " " [MARC 852 __ $l] " " [MARC 852 __ $m]
1378
- # all_tags('852__', 'b c k h 9 l m') { |t|
1379
- # xml['dc'].source list_s(t._bckh9lm)
1380
- # }
1381
- # ALMA: 852 __ 9 => 852 __ i
1382
- all_tags('852__', 'b c k h i l m') { |t|
1383
- xml['dc'].source list_s(t._bckhilm)
1384
- }
1385
- end
1363
+ # [MARC 534 __ $a]
1364
+ # each_field('534__', 'a') { |f| xml['dcterms'].hasVersion f }
1365
+ # ALMA: 534 __ a => 534 __ b
1366
+ each_field('534__', 'b') {|f| xml['dcterms'].hasVersion f}
1367
+ end
1386
1368
 
1387
- def marc2dc_source_856(xml)
1388
- marc2dc_source_856__1(xml)
1389
- marc2dc_source_856__2(xml)
1390
- marc2dc_source_856_4(xml)
1391
- end
1369
+ def marc2dc_source(xml)
1370
+ # DC:SOURCE
1371
+ marc2dc_source_852___(xml)
1372
+ marc2dc_source_856(xml)
1373
+ end
1392
1374
 
1393
- def marc2dc_source_856__1(xml)
1394
- # [MARC 856 _1 $u]
1395
- all_tags('856_1', 'uy') { |t|
1396
- xml['dc'].source(element(t._u,
1397
- repeat(t.a_y.collect { |y| CGI::escape(y) }),
1398
- join: '#'),
1399
- 'xsi:type' => 'dcterms:URI')
1400
- }
1401
- end
1375
+ def marc2dc_source_852___(xml)
1376
+ # [MARC 852 __ $b] " " [MARC 852 __ $c] " " [MARC 852 __ $k] " " [MARC 852 __ $h] " " [MARC 852 __ $9] " " [MARC 852 __ $l] " " [MARC 852 __ $m]
1377
+ # all_tags('852__', 'b c k h 9 l m') { |t|
1378
+ # xml['dc'].source list_s(t._bckh9lm)
1379
+ # }
1380
+ # ALMA: 852 __ 9 => 852 __ i
1381
+ all_tags('852__', 'b c k h i l m') {|t|
1382
+ xml['dc'].source list_s(t._bckhilm)
1383
+ }
1384
+ end
1402
1385
 
1403
- def marc2dc_source_856__2(xml)
1404
- # [MARC 856 _2 $u]
1405
- all_tags('856_2', 'uy') { |t|
1406
- xml['dc'].source(element(t._u,
1407
- repeat(t.a_y.collect { |y| CGI::escape(y) }),
1408
- join: '#'),
1409
- 'xsi:type' => 'dcterms:URI')
1410
- }
1411
- end
1386
+ def marc2dc_source_856(xml)
1387
+ marc2dc_source_856__1(xml)
1388
+ marc2dc_source_856__2(xml)
1389
+ marc2dc_source_856_4(xml)
1390
+ end
1412
1391
 
1413
- def marc2dc_source_856_4(xml)
1414
- # [MARC 856 40 $u]
1415
- all_tags('85640', 'u') { |t|
1416
- xml['dc'].source(element(t._u), 'xsi:type' => 'dcterms:URI')
1417
- }
1418
- end
1392
+ def marc2dc_source_856__1(xml)
1393
+ # [MARC 856 _1 $u]
1394
+ all_tags('856_1', 'uy') {|t|
1395
+ xml['dc'].source(element(t._u,
1396
+ repeat(t.a_y.collect {|y| CGI::escape(y)}),
1397
+ join: '#'),
1398
+ 'xsi:type' => 'dcterms:URI')
1399
+ }
1400
+ end
1419
1401
 
1420
- def marc2dc_language(xml)
1421
- # DC:LANGUAGE
1422
- marc2dc_language_041_9(xml)
1423
- marc2dc_language_008(xml)
1424
- marc2dc_language_130(xml)
1425
- marc2dc_language_240(xml)
1426
- marc2dc_language_546(xml)
1427
- end
1402
+ def marc2dc_source_856__2(xml)
1403
+ # [MARC 856 _2 $u]
1404
+ all_tags('856_2', 'uy') {|t|
1405
+ xml['dc'].source(element(t._u,
1406
+ repeat(t.a_y.collect {|y| CGI::escape(y)}),
1407
+ join: '#'),
1408
+ 'xsi:type' => 'dcterms:URI')
1409
+ }
1410
+ end
1428
1411
 
1429
- def marc2dc_language_041_9(xml)
1430
- marc2dc_language_041_9_(xml)
1431
- marc2dc_language_041__9(xml)
1432
- end
1412
+ def marc2dc_source_856_4(xml)
1413
+ # [MARC 856 40 $u]
1414
+ all_tags('85640', 'u') {|t|
1415
+ xml['dc'].source(element(t._u), 'xsi:type' => 'dcterms:URI')
1416
+ }
1417
+ end
1433
1418
 
1434
- def marc2dc_language_041_9_(xml)
1435
- marc2dc_language_041_9___a(xml)
1436
- marc2dc_language_041_9__d(xml)
1437
- marc2dc_language_041_9__e(xml)
1438
- marc2dc_language_041_9__f(xml)
1439
- marc2dc_language_041_9__h(xml)
1440
- marc2dc_language_014_9__9(xml)
1441
- end
1419
+ def marc2dc_language(xml)
1420
+ # DC:LANGUAGE
1421
+ marc2dc_language_041_9(xml)
1422
+ marc2dc_language_008(xml)
1423
+ marc2dc_language_130(xml)
1424
+ marc2dc_language_240(xml)
1425
+ marc2dc_language_546(xml)
1426
+ end
1442
1427
 
1443
- def marc2dc_language_041_9___a(xml)
1444
- # [MARC 041 9_ $a*]
1445
- all_tags('0419_', 'a') { |t|
1446
- xml['dc'].language repeat(t.a_a.collect { |y| taalcode(y) })
1447
- }
1448
- end
1428
+ def marc2dc_language_041_9(xml)
1429
+ marc2dc_language_041_9_(xml)
1430
+ marc2dc_language_041__9(xml)
1431
+ end
1449
1432
 
1450
- def marc2dc_language_041_9__d(xml)
1451
- # [MARC 041 9_ $d*]
1452
- all_tags('0419_', 'd') { |t|
1453
- xml['dc'].language repeat(t.a_d.collect { |y| taalcode(y) })
1454
- }
1455
- end
1433
+ def marc2dc_language_041_9_(xml)
1434
+ marc2dc_language_041_9___a(xml)
1435
+ marc2dc_language_041_9__d(xml)
1436
+ marc2dc_language_041_9__e(xml)
1437
+ marc2dc_language_041_9__f(xml)
1438
+ marc2dc_language_041_9__h(xml)
1439
+ marc2dc_language_014_9__9(xml)
1440
+ end
1456
1441
 
1457
- def marc2dc_language_041_9__e(xml)
1458
- # [MARC 041 9_ $e*]
1459
- all_tags('0419_', 'e') { |t|
1460
- xml['dc'].language repeat(t.a_e.collect { |y| taalcode(y) })
1461
- }
1462
- end
1442
+ def marc2dc_language_041_9___a(xml)
1443
+ # [MARC 041 9_ $a*]
1444
+ all_tags('0419_', 'a') {|t|
1445
+ xml['dc'].language repeat(t.a_a.collect {|y| taalcode(y)})
1446
+ }
1447
+ end
1463
1448
 
1464
- def marc2dc_language_041_9__f(xml)
1465
- # [MARC 041 9_ $f*]
1466
- all_tags('0419_', 'f') { |t|
1467
- xml['dc'].language repeat(t.a_f.collect { |y| taalcode(y) })
1468
- }
1469
- end
1449
+ def marc2dc_language_041_9__d(xml)
1450
+ # [MARC 041 9_ $d*]
1451
+ all_tags('0419_', 'd') {|t|
1452
+ xml['dc'].language repeat(t.a_d.collect {|y| taalcode(y)})
1453
+ }
1454
+ end
1470
1455
 
1471
- def marc2dc_language_041_9__h(xml)
1472
- # [MARC 041 9_ $h*]
1473
- all_tags('0419_', 'h') { |t|
1474
- xml['dc'].language repeat(t.a_h.collect { |y| taalcode(y) })
1475
- }
1476
- end
1456
+ def marc2dc_language_041_9__e(xml)
1457
+ # [MARC 041 9_ $e*]
1458
+ all_tags('0419_', 'e') {|t|
1459
+ xml['dc'].language repeat(t.a_e.collect {|y| taalcode(y)})
1460
+ }
1461
+ end
1477
1462
 
1478
- def marc2dc_language_014_9__9(xml)
1479
- # [MARC 041 9_ $9*]
1480
- # all_tags('0419_', '9') { |t|
1481
- # xml['dc'].language repeat(t.a_9.collect { |y| taalcode(y) })
1482
- # }
1483
- # ALMA: 041 9# 9 => 041 __ k
1484
- all_tags('041__', 'k') { |t|
1485
- xml['dc'].language repeat(t.a_k.collect { |y| taalcode(y) })
1486
- }
1487
- end
1463
+ def marc2dc_language_041_9__f(xml)
1464
+ # [MARC 041 9_ $f*]
1465
+ all_tags('0419_', 'f') {|t|
1466
+ xml['dc'].language repeat(t.a_f.collect {|y| taalcode(y)})
1467
+ }
1468
+ end
1488
1469
 
1489
- def marc2dc_language_041__9(xml)
1490
- marc2dc_language_041__9_a(xml)
1491
- marc2dc_language_041__9_h(xml)
1492
- marc2dc_language_041__9_9(xml)
1493
- end
1470
+ def marc2dc_language_041_9__h(xml)
1471
+ # [MARC 041 9_ $h*]
1472
+ all_tags('0419_', 'h') {|t|
1473
+ xml['dc'].language repeat(t.a_h.collect {|y| taalcode(y)})
1474
+ }
1475
+ end
1494
1476
 
1495
- def marc2dc_language_041__9_a(xml)
1496
- # "Gedubde taal: " [MARC 041 _9 $a*]
1497
- all_tags('041_9', 'a') { |t|
1498
- xml['dc'].language repeat(t.a_a.collect { |y| taalcode(y) }, prefix: 'Gedubde taal:')
1499
- }
1500
- end
1477
+ def marc2dc_language_014_9__9(xml)
1478
+ # [MARC 041 9_ $9*]
1479
+ # all_tags('0419_', '9') { |t|
1480
+ # xml['dc'].language repeat(t.a_9.collect { |y| taalcode(y) })
1481
+ # }
1482
+ # ALMA: 041 9# 9 => 041 __ k
1483
+ all_tags('041__', 'k') {|t|
1484
+ xml['dc'].language repeat(t.a_k.collect {|y| taalcode(y)})
1485
+ }
1486
+ end
1501
1487
 
1502
- def marc2dc_language_041__9_h(xml)
1503
- # [MARC 041 _9 $h*]
1504
- all_tags('041_9', 'h') { |t|
1505
- xml['dc'].language repeat(t.a_h.collect { |y| taalcode(y) })
1506
- }
1507
- end
1488
+ def marc2dc_language_041__9(xml)
1489
+ marc2dc_language_041__9_a(xml)
1490
+ marc2dc_language_041__9_h(xml)
1491
+ marc2dc_language_041__9_9(xml)
1492
+ end
1508
1493
 
1509
- def marc2dc_language_041__9_9(xml)
1510
- # "Ondertitels: " [MARC 041 _9 $9*]
1511
- # all_tags('041_9', '9') { |t|
1512
- # xml['dc'].language element(t.a_9.collect { |y| taalcode(y) }, prefix: 'Ondertitels:')
1513
- # }
1514
- # ALMA: 041 #9 9 => 041 __ j
1515
- all_tags('041__', 'j') { |t|
1516
- xml['dc'].language element(t.a_j.collect { |y| taalcode(y) }, prefix: 'Ondertitels:')
1517
- }
1518
- end
1494
+ def marc2dc_language_041__9_a(xml)
1495
+ # "Gedubde taal: " [MARC 041 _9 $a*]
1496
+ all_tags('041_9', 'a') {|t|
1497
+ xml['dc'].language repeat(t.a_a.collect {|y| taalcode(y)}, prefix: 'Gedubde taal:')
1498
+ }
1499
+ end
1519
1500
 
1520
- def marc2dc_language_008(xml)
1521
- # [MARC 008 (35-37)]
1522
- all_tags('008') { |t|
1523
- xml['dc'].language taalcode(t.datas[35..37])
1524
- } if all_tags('041').empty?
1525
- end
1501
+ def marc2dc_language_041__9_h(xml)
1502
+ # [MARC 041 _9 $h*]
1503
+ all_tags('041_9', 'h') {|t|
1504
+ xml['dc'].language repeat(t.a_h.collect {|y| taalcode(y)})
1505
+ }
1506
+ end
1526
1507
 
1527
- def marc2dc_language_130(xml)
1528
- # [MARC 130 #_ $l]
1529
- each_field('130#_', 'l') { |f| xml['dc'].language f }
1530
- end
1508
+ def marc2dc_language_041__9_9(xml)
1509
+ # "Ondertitels: " [MARC 041 _9 $9*]
1510
+ # all_tags('041_9', '9') { |t|
1511
+ # xml['dc'].language element(t.a_9.collect { |y| taalcode(y) }, prefix: 'Ondertitels:')
1512
+ # }
1513
+ # ALMA: 041 #9 9 => 041 __ j
1514
+ all_tags('041__', 'j') {|t|
1515
+ xml['dc'].language element(t.a_j.collect {|y| taalcode(y)}, prefix: 'Ondertitels:')
1516
+ }
1517
+ end
1531
1518
 
1532
- def marc2dc_language_240(xml)
1533
- # [MARC 240 #_ $l]
1534
- each_field('240#_', 'l') { |f| xml['dc'].language f }
1535
- end
1519
+ def marc2dc_language_008(xml)
1520
+ # [MARC 008 (35-37)]
1521
+ all_tags('008') {|t|
1522
+ xml['dc'].language taalcode(t.datas[35..37])
1523
+ } if all_tags('041').empty?
1524
+ end
1536
1525
 
1537
- def marc2dc_language_546(xml)
1538
- # [MARC 546 __ $a]
1539
- each_field('546__', 'a') { |f| xml['dc'].language f }
1526
+ def marc2dc_language_130(xml)
1527
+ # [MARC 130 #_ $l]
1528
+ each_field('130#_', 'l') {|f| xml['dc'].language f}
1529
+ end
1540
1530
 
1541
- # [MARC 546 9_ $a]
1542
- # ALMA: 546 9_ a => 546 __ a
1543
- # each_field('5469_', 'a') { |f| xml['dc'].language f }
1531
+ def marc2dc_language_240(xml)
1532
+ # [MARC 240 #_ $l]
1533
+ each_field('240#_', 'l') {|f| xml['dc'].language f}
1534
+ end
1544
1535
 
1545
- # [MARC 546 _9 $a]
1546
- # ALMA: 546 _9 a => 546 __ a
1547
- # each_field('546_9', 'a') { |f| xml['dc'].language f }
1548
- end
1536
+ def marc2dc_language_546(xml)
1537
+ # [MARC 546 __ $a]
1538
+ each_field('546__', 'a') {|f| xml['dc'].language f}
1549
1539
 
1550
- def marc2dc_rightsholder(xml)
1551
- # DCTERMS:RIGHTSHOLDER
1552
- marc2dc_rightsholder_700(xml)
1553
- marc2dc_rightsholder_710(xml)
1554
- end
1540
+ # [MARC 546 9_ $a]
1541
+ # ALMA: 546 9_ a => 546 __ a
1542
+ # each_field('5469_', 'a') { |f| xml['dc'].language f }
1555
1543
 
1556
- def marc2dc_rightsholder_700(xml)
1557
- # [MARC 700 0_ $a] ", " [MARC 700 0_ $b] ", " [MARC 700 0_ $c] ", " [MARC 700 0_ $d] ", " [MARC 700 0_ $g] ", " [MARC 700 0_ $e] (als $4 cph)
1558
- all_tags('7000_', '4') { |t|
1559
- next unless check_name(t, :rightsholder)
1560
- xml['dcterms'].rightsholder element(t._abcdge, join: ', ')
1561
- }
1562
- end
1544
+ # [MARC 546 _9 $a]
1545
+ # ALMA: 546 _9 a => 546 __ a
1546
+ # each_field('546_9', 'a') { |f| xml['dc'].language f }
1547
+ end
1563
1548
 
1564
- def marc2dc_rightsholder_710(xml)
1565
- # [MARC 710 2_ $a] " (" [MARC 710 2_ $g] "), (" [MARC 710 2_ $9] ") ("[MARC 710 2_ $e]")" (als $4 cph)
1566
- all_tags('7102_', '4') { |t|
1567
- next unless check_name(t, :rightsholder)
1568
- xml['dcterms'].rightsholder element(list_s(t._a,
1569
- opt_r(t._g)),
1570
- list_s(opt_r(t._9),
1571
- opt_r(t._e)),
1572
- join: ', ')
1573
- }
1574
- end
1549
+ def marc2dc_rightsholder(xml)
1550
+ # DCTERMS:RIGHTSHOLDER
1551
+ marc2dc_rightsholder_700(xml)
1552
+ marc2dc_rightsholder_710(xml)
1553
+ end
1575
1554
 
1576
- def marc2dc_references(xml)
1577
- # DCTERMS:REFERENCES
1555
+ def marc2dc_rightsholder_700(xml)
1556
+ # [MARC 700 0_ $a] ", " [MARC 700 0_ $b] ", " [MARC 700 0_ $c] ", " [MARC 700 0_ $d] ", " [MARC 700 0_ $g] ", " [MARC 700 0_ $e] (als $4 cph)
1557
+ all_tags('7000_', '4') {|t|
1558
+ next unless check_name(t, :rightsholder)
1559
+ xml['dcterms'].rightsholder element(t._abcdge, join: ', ')
1560
+ }
1561
+ end
1578
1562
 
1579
- # [MARC 581 __ $a]
1580
- each_field('581__', 'a') { |f| xml['dcterms'].references f }
1581
- end
1563
+ def marc2dc_rightsholder_710(xml)
1564
+ # [MARC 710 2_ $a] " (" [MARC 710 2_ $g] "), (" [MARC 710 2_ $9] ") ("[MARC 710 2_ $e]")" (als $4 cph)
1565
+ all_tags('7102_', '4') {|t|
1566
+ next unless check_name(t, :rightsholder)
1567
+ xml['dcterms'].rightsholder element(list_s(t._a,
1568
+ opt_r(t._g)),
1569
+ list_s(opt_r(t._9),
1570
+ opt_r(t._e)),
1571
+ join: ', ')
1572
+ }
1573
+ end
1582
1574
 
1583
- def marc2dc_isreferencedby(xml)
1584
- # DCTERMS:ISREFERENCEDBY
1585
- marc2dc_isreferencedby_510_0(xml)
1586
- marc2dc_isreferencedby_510_3(xml)
1587
- marc2dc_isreferencedby_510_4(xml)
1588
- end
1575
+ def marc2dc_references(xml)
1576
+ # DCTERMS:REFERENCES
1589
1577
 
1590
- def marc2dc_isreferencedby_510_0(xml)
1591
- # [MARC 510 0_ $a] ", " [MARC 510 0_ $c]
1592
- all_tags('5100_', 'a c') { |t|
1593
- xml['dcterms'].isReferencedBy element(t._ac, join: ', ')
1594
- }
1595
- end
1578
+ # [MARC 581 __ $a]
1579
+ each_field('581__', 'a') {|f| xml['dcterms'].references f}
1580
+ end
1596
1581
 
1597
- def marc2dc_isreferencedby_510_3(xml)
1598
- # [MARC 510 3_ $a] ", " [MARC 510 3_ $c]
1599
- all_tags('5103_', 'a c') { |t|
1600
- xml['dcterms'].isReferencedBy element(t._ac, join: ', ')
1601
- }
1602
- end
1582
+ def marc2dc_isreferencedby(xml)
1583
+ # DCTERMS:ISREFERENCEDBY
1584
+ marc2dc_isreferencedby_510_0(xml)
1585
+ marc2dc_isreferencedby_510_3(xml)
1586
+ marc2dc_isreferencedby_510_4(xml)
1587
+ end
1603
1588
 
1604
- def marc2dc_isreferencedby_510_4(xml)
1605
- # [MARC 510 4_ $a] ", " [MARC 510 4_ $c]
1606
- all_tags('5104_', 'a c') { |t|
1607
- xml['dcterms'].isReferencedBy element(t._ac, join: ', ')
1608
- }
1609
- end
1589
+ def marc2dc_isreferencedby_510_0(xml)
1590
+ # [MARC 510 0_ $a] ", " [MARC 510 0_ $c]
1591
+ all_tags('5100_', 'a c') {|t|
1592
+ xml['dcterms'].isReferencedBy element(t._ac, join: ', ')
1593
+ }
1594
+ end
1610
1595
 
1611
- def marc2dc_coverage(xml)
1612
- # KADOC: ODIS-GEO zoals ODIS-PS
1613
- all_tags('650_7', '26a') { |t|
1614
- next unless t._2 == 'KADOC' and t._6 =~ /^\(ODIS-(GEO)\)(\d)+$/
1615
- xml['dc'].coverage list_s(t._a, element(t._6, prefix: '[', postfix: ']'))
1616
- }
1617
- end
1596
+ def marc2dc_isreferencedby_510_3(xml)
1597
+ # [MARC 510 3_ $a] ", " [MARC 510 3_ $c]
1598
+ all_tags('5103_', 'a c') {|t|
1599
+ xml['dcterms'].isReferencedBy element(t._ac, join: ', ')
1600
+ }
1601
+ end
1618
1602
 
1619
- protected
1603
+ def marc2dc_isreferencedby_510_4(xml)
1604
+ # [MARC 510 4_ $a] ", " [MARC 510 4_ $c]
1605
+ all_tags('5104_', 'a c') {|t|
1606
+ xml['dcterms'].isReferencedBy element(t._ac, join: ', ')
1607
+ }
1608
+ end
1620
1609
 
1621
- def check_name(data, b)
1622
- name_type(data) == b
1623
- end
1610
+ def marc2dc_coverage(xml)
1611
+ # KADOC: ODIS-GEO zoals ODIS-PS
1612
+ all_tags('650_7', '26a') {|t|
1613
+ next unless t._2 == 'KADOC' and t._6 =~ /^\(ODIS-(GEO)\)(\d)+$/
1614
+ xml['dc'].coverage list_s(t._a, element(t._6, prefix: '[', postfix: ']'))
1615
+ }
1616
+ end
1624
1617
 
1625
- def name_type(data)
1626
- #noinspection RubyResolve
1627
- code = data._4.to_sym rescue nil
1628
- if DOLLAR4TABLE[data.tag].has_key? code
1629
- return DOLLAR4TABLE[data.tag][code][1]
1630
- end
1631
- :contributor
1632
- end
1618
+ protected
1633
1619
 
1634
- def full_name(data)
1635
- #noinspection RubyResolve
1636
- code = data._4.to_sym rescue nil
1637
- return '' unless DOLLAR4TABLE[data.tag].has_key? code
1638
- DOLLAR4TABLE[data.tag][code][0]
1639
- end
1620
+ def check_name(data, b)
1621
+ name_type(data) == b
1622
+ end
1640
1623
 
1641
- def taalcode(code)
1642
- TAALCODES[code.to_sym]
1624
+ def name_type(data)
1625
+ #noinspection RubyResolve
1626
+ code = data._4.to_sym rescue nil
1627
+ if DOLLAR4TABLE[data.tag].has_key? code
1628
+ return DOLLAR4TABLE[data.tag][code][1]
1643
1629
  end
1630
+ :contributor
1631
+ end
1644
1632
 
1645
- def bibnaam(code)
1646
- BIBCODES[code] || ''
1647
- end
1633
+ def full_name(data)
1634
+ #noinspection RubyResolve
1635
+ code = data._4.to_sym rescue nil
1636
+ return '' unless DOLLAR4TABLE[data.tag].has_key? code
1637
+ DOLLAR4TABLE[data.tag][code][0]
1638
+ end
1648
1639
 
1649
- def fmt(code)
1650
- FMT[code.to_sym] || ''
1651
- end
1640
+ def taalcode(code)
1641
+ TAALCODES[code.to_sym]
1642
+ end
1652
1643
 
1653
- def lookup(table, key, constraints = {})
1654
- table.select { |value| constraints.map { |k, v| value[k] == v }.all? }.map { |v| v[key] }
1655
- end
1644
+ def bibnaam(code)
1645
+ BIBCODES[code] || ''
1646
+ end
1656
1647
 
1657
- #noinspection RubyStringKeysInHashInspection
1658
- DOLLAR4TABLE = {
1659
- '700' => {
1660
- apb: ['approbation, approbatie, approbation', :contributor],
1661
- apr: ['preface', nil],
1662
- arc: ['architect', :contributor],
1663
- arr: ['arranger', :contributor],
1664
- art: ['artist', :creator],
1665
- aui: ['author of introduction', :contributor],
1666
- aut: ['author', :creator],
1667
- bbl: ['bibliography', :contributor],
1668
- bdd: ['binder', :contributor],
1669
- bsl: ['bookseller', :contributor],
1670
- ccp: ['concept', :contributor],
1671
- chr: ['choreographer', :contributor],
1672
- clb: ['collaborator', :contributor],
1673
- cmm: ['commentator (rare books only)', :contributor],
1674
- cmp: ['composer', :contributor],
1675
- cnd: ['conductor', :contributor],
1676
- cns: ['censor, censeur', :contributor],
1677
- cod: ['co-ordination', :contributor],
1678
- cof: ['collection from', :contributor],
1679
- coi: ['compiler index', :contributor],
1680
- com: ['compiler', :contributor],
1681
- con: ['consultant', :contributor],
1682
- cov: ['cover designer', :contributor],
1683
- cph: ['copyright holder', :rightsholder],
1684
- cre: ['creator', :creator],
1685
- csp: ['project manager', :contributor],
1686
- ctb: ['contributor', :contributor],
1687
- ctg: ['cartographer', :creator],
1688
- cur: ['curator', :contributor],
1689
- dfr: ['defender (rare books only)', :contributor],
1690
- dgg: ['degree grantor', :contributor],
1691
- dir: ['director', :creator],
1692
- dnc: ['dancer', :contributor],
1693
- dpc: ['depicted', :contributor],
1694
- dsr: ['designer', :contributor],
1695
- dte: ['dedicatee', :contributor],
1696
- dub: ['dubious author', :creator],
1697
- eda: ['editor assistant', :contributor],
1698
- edc: ['editor in chief', :creator],
1699
- ede: ['final editing', :creator],
1700
- edt: ['editor', :creator],
1701
- egr: ['engraver', :contributor],
1702
- eim: ['editor of image', :contributor],
1703
- eow: ['editor original work', :contributor],
1704
- etc: ['etcher', :contributor],
1705
- etr: ['etcher', :contributor],
1706
- eul: ['eulogist, drempeldichter, panégyriste', :contributor],
1707
- hnr: ['honoree', :contributor],
1708
- ihd: ['expert trainee post (inhoudsdeskundige stageplaats)', :contributor],
1709
- ill: ['illustrator', :contributor],
1710
- ilu: ['illuminator', :contributor],
1711
- itr: ['instrumentalist', :contributor],
1712
- ive: ['interviewee', :contributor],
1713
- ivr: ['interviewer', :contributor],
1714
- lbt: ['librettist', :contributor],
1715
- ltg: ['lithographer', :contributor],
1716
- lyr: ['lyricist', :contributor],
1717
- mus: ['musician', :contributor],
1718
- nrt: ['narrator, reader', :contributor],
1719
- ogz: ['started by', :creator],
1720
- oqz: ['continued by', :creator],
1721
- orc: ['orchestrator', :contributor],
1722
- orm: ['organizer of meeting', :contributor],
1723
- oth: ['other', :contributor],
1724
- pat: ['patron, opdrachtgever, maître d\'oeuvre', :contributor],
1725
- pht: ['photographer', :creator],
1726
- prf: ['performer', :contributor],
1727
- pro: ['producer', :contributor],
1728
- prt: ['printer', :publisher],
1729
- pub: ['publication about', :subject],
1730
- rbr: ['rubricator', :contributor],
1731
- rea: ['realization', :contributor],
1732
- reb: ['revised by', :contributor],
1733
- rev: ['reviewer', :contributor],
1734
- rpt: ['reporter', :contributor],
1735
- rpy: ['responsible party', :contributor],
1736
- sad: ['scientific advice', :contributor],
1737
- sce: ['scenarist', :contributor],
1738
- sco: ['scientific co-operator', :contributor],
1739
- scr: ['scribe', :contributor],
1740
- sng: ['singer', :contributor],
1741
- spn: ['sponsor', :contributor],
1742
- tec: ['technical direction', :contributor],
1743
- thc: ['thesis co-advisor(s)', :contributor],
1744
- thj: ['member of the jury', :contributor],
1745
- ths: ['thesis advisor', :contributor],
1746
- trc: ['transcriber', :contributor],
1747
- trl: ['translator', :contributor],
1748
- udr: ['under direction of', :contributor],
1749
- voc: ['vocalist', :contributor],
1750
- },
1751
- '710' => {
1752
- adq: ['readapted by', :contributor],
1753
- add: ['addressee, bestemmeling', :contributor],
1754
- aow: ['author original work, auteur oorspronkelijk werk, auteur ouvrage original', :contributor],
1755
- apr: ['preface', :/],
1756
- arc: ['architect', :contributor],
1757
- art: ['artist', :creator],
1758
- aut: ['author', :creator],
1759
- bbl: ['bibliography', :contributor],
1760
- bdd: ['binder', :contributor],
1761
- bsl: ['bookseller', :contributor],
1762
- ccp: ['Conceptor', :contributor],
1763
- clb: ['collaborator', :contributor],
1764
- cod: ['co-ordination', :contributor],
1765
- cof: ['collection from', :contributor],
1766
- coi: ['compiler index', :contributor],
1767
- com: ['compiler', :contributor],
1768
- con: ['consultant', :contributor],
1769
- cov: ['cover designer', :contributor],
1770
- cph: ['copyright holder', :rightsholder],
1771
- cre: ['creator', :creator],
1772
- csp: ['project manager', :contributor],
1773
- ctb: ['contributor', :contributor],
1774
- ctg: ['cartographer', :contributor],
1775
- cur: ['curator', :contributor],
1776
- dgg: ['degree grantor', :contributor],
1777
- dnc: ['dancer', :contributor],
1778
- dsr: ['designer', :contributor],
1779
- dte: ['dedicatee', :contributor],
1780
- eda: ['editor assistant', :contributor],
1781
- edc: ['editor in chief', :creator],
1782
- ede: ['final editing', :creator],
1783
- edt: ['editor', :creator],
1784
- egr: ['engraver', :contributor],
1785
- eim: ['editor of image', :contributor],
1786
- eow: ['editor original work', :contributor],
1787
- etc: ['etcher', :contributor],
1788
- eul: ['eulogist, drempeldichter, panégyriste', :contributor],
1789
- hnr: ['honoree', :contributor],
1790
- itr: ['instrumentalist', :contributor],
1791
- ltg: ['lithographer', :contributor],
1792
- mus: ['musician', :contributor],
1793
- ogz: ['started by', :creator],
1794
- oqz: ['continued by', :creator],
1795
- ori: ['org. institute (rare books/mss only)', :contributor],
1796
- orm: ['organizer of meeting', :contributor],
1797
- oth: ['other', :contributor],
1798
- pat: ['patron', :contributor],
1799
- pht: ['photographer', :creator],
1800
- prf: ['performer', :contributor],
1801
- pro: ['producer', :contributor],
1802
- prt: ['printer', :publisher],
1803
- pub: ['publication about', :subject],
1804
- rea: ['realization', :contributor],
1805
- rpt: ['reporter', :contributor],
1806
- rpy: ['responsible party', :contributor],
1807
- sad: ['scientific advice', :contributor],
1808
- sco: ['scientific co-operator', :contributor],
1809
- scp: ['scriptorium', :contributor],
1810
- sng: ['singer', :contributor],
1811
- spn: ['sponsor', :contributor],
1812
- tec: ['technical direction', :contributor],
1813
- trc: ['transcriber', :contributor],
1814
- trl: ['translator', :contributor],
1815
- udr: ['under direction of', :contributor],
1816
- voc: ['vocalist', :contributor],
1817
- },
1818
- '711' => {
1819
- oth: ['other', :contributor],
1820
- },
1821
- '100' => {
1822
- arr: ['arranger', :contributor],
1823
- aut: ['author', :creator],
1824
- cmp: ['composer', :contributor],
1825
- com: ['compiler', :contributor],
1826
- cre: ['creator', :creator],
1827
- ctg: ['cartographer', :creator],
1828
- ill: ['illustrator', :contributor],
1829
- ivr: ['interviewer', :contributor],
1830
- lbt: ['librettist', :contributor],
1831
- lyr: ['lyricist', :contributor],
1832
- pht: ['photographer', :creator],
1833
- }
1834
- }
1835
-
1836
- TAALCODES = {
1837
- afr: 'af',
1838
- ara: 'ar',
1839
- chi: 'zh',
1840
- cze: 'cs',
1841
- dan: 'da',
1842
- dum: 'dum',
1843
- dut: 'nl',
1844
- est: 'et',
1845
- eng: 'en',
1846
- fin: 'fi',
1847
- fre: 'fr',
1848
- frm: 'frm',
1849
- ger: 'de',
1850
- grc: 'grc',
1851
- gre: 'el',
1852
- hun: 'hu',
1853
- fry: 'fy',
1854
- ita: 'it',
1855
- jpn: 'ja',
1856
- lat: 'la',
1857
- lav: 'lv',
1858
- liv: 'lt',
1859
- ltz: 'lb',
1860
- mlt: 'mt',
1861
- nor: 'no',
1862
- pol: 'pl',
1863
- por: 'pt',
1864
- rus: 'ru',
1865
- slo: 'sk',
1866
- slv: 'sl',
1867
- spa: 'es',
1868
- swe: 'sv',
1869
- tur: 'tr',
1870
- ukr: 'uk',
1871
- syc: '',
1872
- syr: '',
1873
- heb: '',
1874
- cop: '',
1875
- }
1876
-
1877
- #noinspection RubyStringKeysInHashInspection
1878
- BIBCODES = {
1879
- '01' => 'K.U.Leuven',
1880
- '02' => 'KADOC',
1881
- '03' => 'BB(Boerenbond)/KBC',
1882
- '04' => 'HUB',
1883
- '05' => 'ACV',
1884
- '06' => 'LIBAR',
1885
- '07' => 'SHARE',
1886
- '10' => 'BPB',
1887
- '11' => 'VLP',
1888
- '12' => 'TIFA',
1889
- '13' => 'LESSIUS',
1890
- '14' => 'SERV',
1891
- '15' => 'ACBE',
1892
- '16' => 'SLUCB',
1893
- '17' => 'SLUCG',
1894
- '18' => 'HUB',
1895
- '19' => 'KHBO',
1896
- '20' => 'FINBI',
1897
- '21' => 'BIOET',
1898
- '22' => 'LUKAS',
1899
- '23' => 'KHM',
1900
- '24' => 'Fonds',
1901
- '25' => 'RBINS',
1902
- '26' => 'RMCA',
1903
- '27' => 'NBB',
1904
- '28' => 'Pasteurinstituut',
1905
- '29' => 'Vesalius',
1906
- '30' => 'Lemmensinstituut',
1907
- '31' => 'KHLIM',
1908
- '32' => 'KATHO',
1909
- '33' => 'KAHO',
1910
- '34' => 'HUB',
1911
- }
1912
-
1913
- FMT = {
1914
- BK: 'Books',
1915
- SE: 'Continuing Resources',
1916
- MU: 'Music',
1917
- MP: 'Maps',
1918
- VM: 'Visual Materials',
1919
- AM: 'Audio Materials',
1920
- CF: 'Computer Files',
1921
- MX: 'Mixed Materials',
1922
- }
1648
+ def fmt(code)
1649
+ FMT[code.to_sym] || ''
1650
+ end
1923
1651
 
1652
+ def lookup(table, key, constraints = {})
1653
+ table.select {|value| constraints.map {|k, v| value[k] == v}.all?}.map {|v| v[key]}
1924
1654
  end
1925
1655
 
1656
+ #noinspection RubyStringKeysInHashInspection
1657
+ DOLLAR4TABLE = {
1658
+ '700' => {
1659
+ apb: ['approbation, approbatie, approbation', :contributor],
1660
+ apr: ['preface', nil],
1661
+ arc: ['architect', :contributor],
1662
+ arr: ['arranger', :contributor],
1663
+ art: ['artist', :creator],
1664
+ aui: ['author of introduction', :contributor],
1665
+ aut: ['author', :creator],
1666
+ bbl: ['bibliography', :contributor],
1667
+ bdd: ['binder', :contributor],
1668
+ bsl: ['bookseller', :contributor],
1669
+ ccp: ['concept', :contributor],
1670
+ chr: ['choreographer', :contributor],
1671
+ clb: ['collaborator', :contributor],
1672
+ cmm: ['commentator (rare books only)', :contributor],
1673
+ cmp: ['composer', :contributor],
1674
+ cnd: ['conductor', :contributor],
1675
+ cns: ['censor, censeur', :contributor],
1676
+ cod: ['co-ordination', :contributor],
1677
+ cof: ['collection from', :contributor],
1678
+ coi: ['compiler index', :contributor],
1679
+ com: ['compiler', :contributor],
1680
+ con: ['consultant', :contributor],
1681
+ cov: ['cover designer', :contributor],
1682
+ cph: ['copyright holder', :rightsholder],
1683
+ cre: ['creator', :creator],
1684
+ csp: ['project manager', :contributor],
1685
+ ctb: ['contributor', :contributor],
1686
+ ctg: ['cartographer', :creator],
1687
+ cur: ['curator', :contributor],
1688
+ dfr: ['defender (rare books only)', :contributor],
1689
+ dgg: ['degree grantor', :contributor],
1690
+ dir: ['director', :creator],
1691
+ dnc: ['dancer', :contributor],
1692
+ dpc: ['depicted', :contributor],
1693
+ dsr: ['designer', :contributor],
1694
+ dte: ['dedicatee', :contributor],
1695
+ dub: ['dubious author', :creator],
1696
+ eda: ['editor assistant', :contributor],
1697
+ edc: ['editor in chief', :creator],
1698
+ ede: ['final editing', :creator],
1699
+ edt: ['editor', :creator],
1700
+ egr: ['engraver', :contributor],
1701
+ eim: ['editor of image', :contributor],
1702
+ eow: ['editor original work', :contributor],
1703
+ etc: ['etcher', :contributor],
1704
+ etr: ['etcher', :contributor],
1705
+ eul: ['eulogist, drempeldichter, panégyriste', :contributor],
1706
+ hnr: ['honoree', :contributor],
1707
+ ihd: ['expert trainee post (inhoudsdeskundige stageplaats)', :contributor],
1708
+ ill: ['illustrator', :contributor],
1709
+ ilu: ['illuminator', :contributor],
1710
+ itr: ['instrumentalist', :contributor],
1711
+ ive: ['interviewee', :contributor],
1712
+ ivr: ['interviewer', :contributor],
1713
+ lbt: ['librettist', :contributor],
1714
+ ltg: ['lithographer', :contributor],
1715
+ lyr: ['lyricist', :contributor],
1716
+ mus: ['musician', :contributor],
1717
+ nrt: ['narrator, reader', :contributor],
1718
+ ogz: ['started by', :creator],
1719
+ oqz: ['continued by', :creator],
1720
+ orc: ['orchestrator', :contributor],
1721
+ orm: ['organizer of meeting', :contributor],
1722
+ oth: ['other', :contributor],
1723
+ pat: ['patron, opdrachtgever, maître d\'oeuvre', :contributor],
1724
+ pht: ['photographer', :creator],
1725
+ prf: ['performer', :contributor],
1726
+ pro: ['producer', :contributor],
1727
+ prt: ['printer', :publisher],
1728
+ pub: ['publication about', :subject],
1729
+ rbr: ['rubricator', :contributor],
1730
+ rea: ['realization', :contributor],
1731
+ reb: ['revised by', :contributor],
1732
+ rev: ['reviewer', :contributor],
1733
+ rpt: ['reporter', :contributor],
1734
+ rpy: ['responsible party', :contributor],
1735
+ sad: ['scientific advice', :contributor],
1736
+ sce: ['scenarist', :contributor],
1737
+ sco: ['scientific co-operator', :contributor],
1738
+ scr: ['scribe', :contributor],
1739
+ sng: ['singer', :contributor],
1740
+ spn: ['sponsor', :contributor],
1741
+ tec: ['technical direction', :contributor],
1742
+ thc: ['thesis co-advisor(s)', :contributor],
1743
+ thj: ['member of the jury', :contributor],
1744
+ ths: ['thesis advisor', :contributor],
1745
+ trc: ['transcriber', :contributor],
1746
+ trl: ['translator', :contributor],
1747
+ udr: ['under direction of', :contributor],
1748
+ voc: ['vocalist', :contributor],
1749
+ },
1750
+ '710' => {
1751
+ adq: ['readapted by', :contributor],
1752
+ add: ['addressee, bestemmeling', :contributor],
1753
+ aow: ['author original work, auteur oorspronkelijk werk, auteur ouvrage original', :contributor],
1754
+ apr: ['preface', :/],
1755
+ arc: ['architect', :contributor],
1756
+ art: ['artist', :creator],
1757
+ aut: ['author', :creator],
1758
+ bbl: ['bibliography', :contributor],
1759
+ bdd: ['binder', :contributor],
1760
+ bsl: ['bookseller', :contributor],
1761
+ ccp: ['Conceptor', :contributor],
1762
+ clb: ['collaborator', :contributor],
1763
+ cod: ['co-ordination', :contributor],
1764
+ cof: ['collection from', :contributor],
1765
+ coi: ['compiler index', :contributor],
1766
+ com: ['compiler', :contributor],
1767
+ con: ['consultant', :contributor],
1768
+ cov: ['cover designer', :contributor],
1769
+ cph: ['copyright holder', :rightsholder],
1770
+ cre: ['creator', :creator],
1771
+ csp: ['project manager', :contributor],
1772
+ ctb: ['contributor', :contributor],
1773
+ ctg: ['cartographer', :contributor],
1774
+ cur: ['curator', :contributor],
1775
+ dgg: ['degree grantor', :contributor],
1776
+ dnc: ['dancer', :contributor],
1777
+ dsr: ['designer', :contributor],
1778
+ dte: ['dedicatee', :contributor],
1779
+ eda: ['editor assistant', :contributor],
1780
+ edc: ['editor in chief', :creator],
1781
+ ede: ['final editing', :creator],
1782
+ edt: ['editor', :creator],
1783
+ egr: ['engraver', :contributor],
1784
+ eim: ['editor of image', :contributor],
1785
+ eow: ['editor original work', :contributor],
1786
+ etc: ['etcher', :contributor],
1787
+ eul: ['eulogist, drempeldichter, panégyriste', :contributor],
1788
+ hnr: ['honoree', :contributor],
1789
+ itr: ['instrumentalist', :contributor],
1790
+ ltg: ['lithographer', :contributor],
1791
+ mus: ['musician', :contributor],
1792
+ ogz: ['started by', :creator],
1793
+ oqz: ['continued by', :creator],
1794
+ ori: ['org. institute (rare books/mss only)', :contributor],
1795
+ orm: ['organizer of meeting', :contributor],
1796
+ oth: ['other', :contributor],
1797
+ pat: ['patron', :contributor],
1798
+ pht: ['photographer', :creator],
1799
+ prf: ['performer', :contributor],
1800
+ pro: ['producer', :contributor],
1801
+ prt: ['printer', :publisher],
1802
+ pub: ['publication about', :subject],
1803
+ rea: ['realization', :contributor],
1804
+ rpt: ['reporter', :contributor],
1805
+ rpy: ['responsible party', :contributor],
1806
+ sad: ['scientific advice', :contributor],
1807
+ sco: ['scientific co-operator', :contributor],
1808
+ scp: ['scriptorium', :contributor],
1809
+ sng: ['singer', :contributor],
1810
+ spn: ['sponsor', :contributor],
1811
+ tec: ['technical direction', :contributor],
1812
+ trc: ['transcriber', :contributor],
1813
+ trl: ['translator', :contributor],
1814
+ udr: ['under direction of', :contributor],
1815
+ voc: ['vocalist', :contributor],
1816
+ },
1817
+ '711' => {
1818
+ oth: ['other', :contributor],
1819
+ },
1820
+ '100' => {
1821
+ arr: ['arranger', :contributor],
1822
+ aut: ['author', :creator],
1823
+ cmp: ['composer', :contributor],
1824
+ com: ['compiler', :contributor],
1825
+ cre: ['creator', :creator],
1826
+ ctg: ['cartographer', :creator],
1827
+ ill: ['illustrator', :contributor],
1828
+ ivr: ['interviewer', :contributor],
1829
+ lbt: ['librettist', :contributor],
1830
+ lyr: ['lyricist', :contributor],
1831
+ pht: ['photographer', :creator],
1832
+ }
1833
+ }
1834
+
1835
+ TAALCODES = {
1836
+ afr: 'af',
1837
+ ara: 'ar',
1838
+ chi: 'zh',
1839
+ cze: 'cs',
1840
+ dan: 'da',
1841
+ dum: 'dum',
1842
+ dut: 'nl',
1843
+ est: 'et',
1844
+ eng: 'en',
1845
+ fin: 'fi',
1846
+ fre: 'fr',
1847
+ frm: 'frm',
1848
+ ger: 'de',
1849
+ grc: 'grc',
1850
+ gre: 'el',
1851
+ hun: 'hu',
1852
+ fry: 'fy',
1853
+ ita: 'it',
1854
+ jpn: 'ja',
1855
+ lat: 'la',
1856
+ lav: 'lv',
1857
+ liv: 'lt',
1858
+ ltz: 'lb',
1859
+ mlt: 'mt',
1860
+ nor: 'no',
1861
+ pol: 'pl',
1862
+ por: 'pt',
1863
+ rus: 'ru',
1864
+ slo: 'sk',
1865
+ slv: 'sl',
1866
+ spa: 'es',
1867
+ swe: 'sv',
1868
+ tur: 'tr',
1869
+ ukr: 'uk',
1870
+ syc: '',
1871
+ syr: '',
1872
+ heb: '',
1873
+ cop: '',
1874
+ }
1875
+
1876
+ #noinspection RubyStringKeysInHashInspection
1877
+ BIBCODES = {
1878
+ '01' => 'K.U.Leuven',
1879
+ '02' => 'KADOC',
1880
+ '03' => 'BB(Boerenbond)/KBC',
1881
+ '04' => 'HUB',
1882
+ '05' => 'ACV',
1883
+ '06' => 'LIBAR',
1884
+ '07' => 'SHARE',
1885
+ '10' => 'BPB',
1886
+ '11' => 'VLP',
1887
+ '12' => 'TIFA',
1888
+ '13' => 'LESSIUS',
1889
+ '14' => 'SERV',
1890
+ '15' => 'ACBE',
1891
+ '16' => 'SLUCB',
1892
+ '17' => 'SLUCG',
1893
+ '18' => 'HUB',
1894
+ '19' => 'KHBO',
1895
+ '20' => 'FINBI',
1896
+ '21' => 'BIOET',
1897
+ '22' => 'LUKAS',
1898
+ '23' => 'KHM',
1899
+ '24' => 'Fonds',
1900
+ '25' => 'RBINS',
1901
+ '26' => 'RMCA',
1902
+ '27' => 'NBB',
1903
+ '28' => 'Pasteurinstituut',
1904
+ '29' => 'Vesalius',
1905
+ '30' => 'Lemmensinstituut',
1906
+ '31' => 'KHLIM',
1907
+ '32' => 'KATHO',
1908
+ '33' => 'KAHO',
1909
+ '34' => 'HUB',
1910
+ }
1911
+
1912
+ FMT = {
1913
+ BK: 'Books',
1914
+ SE: 'Continuing Resources',
1915
+ MU: 'Music',
1916
+ MP: 'Maps',
1917
+ VM: 'Visual Materials',
1918
+ AM: 'Audio Materials',
1919
+ CF: 'Computer Files',
1920
+ MX: 'Mixed Materials',
1921
+ }
1922
+
1926
1923
  end
1924
+
1927
1925
  end
1928
1926
  end
1929
- end
1927
+ end