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 +4 -4
- data/README.md +51 -12
- data/lib/libis/metadata/cli/cli_downloader.rb +0 -1
- data/lib/libis/metadata/downloader.rb +10 -9
- data/lib/libis/metadata/mappers/flandrica.rb +54 -56
- data/lib/libis/metadata/mappers/kuleuven.rb +1724 -1726
- data/lib/libis/metadata/mappers/scope.rb +25 -27
- data/lib/libis/metadata/var_field.rb +211 -213
- data/lib/libis/metadata/version.rb +1 -1
- data/metadata.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e48f5767aded27b26118a8ed5a3776be26b652b
|
4
|
+
data.tar.gz: a99d01528eb1f807d77fea684a3408ed84272ba7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99d7581a6f2ce0b56a9d3770a101be95df84b49acc847b705a6ba185dd3bd86718bc8d7287cd7c4ea3ae56139394bb6ab726a15775a4d46abf67e931dc80c10c
|
7
|
+
data.tar.gz: c87b535efb289d6187b644b814ecf2ca4b091a9c9a5cd8a2d70bd65744b33fec26a7448f8ca975801f7e2ae346d4c69161b4116e802cb1de88b50e5eec9e0981
|
data/README.md
CHANGED
@@ -1,15 +1,18 @@
|
|
1
|
-
|
1
|
+
[](http://badge.fury.io/rb/libis-metadata)
|
2
|
+
[](https://travis-ci.org/Kris-LIBIS/LIBIS_Metadata)
|
3
|
+
[](https://coveralls.io/r/Kris-LIBIS/LIBIS_Metadata)
|
4
|
+
[](https://gemnasium.com/Kris-LIBIS/LIBIS_Metadata)
|
2
5
|
|
3
|
-
|
6
|
+
# Libis::Metadata
|
4
7
|
|
5
|
-
|
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
|
-
|
28
|
+
In order to make available all the code the gem supplies a single file can be included:
|
26
29
|
|
27
|
-
|
30
|
+
```ruby
|
31
|
+
require 'libis-metadata'
|
32
|
+
```
|
33
|
+
|
34
|
+
or:
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
require 'libis/metadata'
|
38
|
+
```
|
28
39
|
|
29
|
-
|
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
|
-
|
43
|
+
## Content
|
32
44
|
|
33
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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/
|
14
|
-
require 'libis/
|
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::
|
35
|
+
@mapper_class = Libis::Metadata::Mappers::Kuleuven
|
35
36
|
when 'scope'
|
36
37
|
@service = ::Libis::Services::Scope::Search.new
|
37
|
-
@mapper_class = Libis::
|
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::
|
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::
|
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::
|
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/
|
3
|
+
require 'libis/metadata/mappers/kuleuven'
|
4
4
|
|
5
5
|
module Libis
|
6
|
-
module
|
7
|
-
module
|
8
|
-
module Mappers
|
6
|
+
module Metadata
|
7
|
+
module Mappers
|
9
8
|
|
10
|
-
|
9
|
+
# noinspection RubyResolve
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
-
|
18
|
+
protected
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
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
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
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
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
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
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
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
|
-
|
68
|
-
|
69
|
-
|
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/
|
4
|
-
require 'libis/
|
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
|
9
|
-
module
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
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
|
-
|
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
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
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
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
89
|
+
def marc2dc_identifier_label(label, xml)
|
90
|
+
# noinspection RubyResolve
|
91
|
+
xml['dc'].identifier label if label
|
92
|
+
end
|
106
93
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
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
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
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
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
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
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
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
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
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
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
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
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
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
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
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
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
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
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
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
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
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
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
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
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
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
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
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
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
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
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
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
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
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
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
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
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
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
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
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
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
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
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
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
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
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
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
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
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
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
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
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
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
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
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
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
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
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
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
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
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
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
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
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
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
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
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
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
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
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
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
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
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
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
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
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
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
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
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
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
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
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
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
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
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
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
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
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
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
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
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
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
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
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
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
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
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
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
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
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
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
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
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
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
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
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
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
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
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
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
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
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
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
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
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
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
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
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
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
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
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
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
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
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
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
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
|
-
|
705
|
-
|
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
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
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
|
-
|
714
|
-
|
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
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
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
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
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
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
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
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
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
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
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
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
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
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
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
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
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
|
-
|
800
|
-
|
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
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
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
|
-
|
813
|
-
|
798
|
+
def marc2dc_available(xml)
|
799
|
+
# DCTERMS:AVAILABLE
|
814
800
|
|
815
|
-
|
816
|
-
|
817
|
-
|
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
|
-
|
820
|
-
|
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
|
-
|
830
|
-
|
831
|
-
|
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
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
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
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
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
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
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
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
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
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
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
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
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
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
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
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
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
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
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
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
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
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
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
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
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
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
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
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
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
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
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
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
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
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
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
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
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
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
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
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
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
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
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
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
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
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
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
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
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
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
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
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
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
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
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
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
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
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
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
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
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
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
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
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
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
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
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
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
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
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
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
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
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
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
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
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
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
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
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
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
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
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
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
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
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
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
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
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
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
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
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
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
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
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
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
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
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
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
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
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
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
|
-
|
1286
|
-
|
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
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
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
|
-
|
1296
|
-
|
1284
|
+
def marc2dc_accrualperiodicity(xml)
|
1285
|
+
# DCTERMS:ACCRUALPERIODICITY
|
1297
1286
|
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
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
|
-
|
1305
|
-
|
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
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
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
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
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
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
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
|
-
|
1342
|
-
|
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
|
-
|
1345
|
-
|
1346
|
-
|
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
|
-
|
1349
|
-
|
1340
|
+
def marc2dc_relation(xml)
|
1341
|
+
# DC:RELATION
|
1350
1342
|
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
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
|
-
|
1362
|
-
|
1347
|
+
def marc2dc_replaces(xml)
|
1348
|
+
# DCTERMS:REPLACES
|
1363
1349
|
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
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
|
-
|
1371
|
-
|
1372
|
-
marc2dc_source_852___(xml)
|
1373
|
-
marc2dc_source_856(xml)
|
1374
|
-
end
|
1360
|
+
def marc2dc_hasversion(xml)
|
1361
|
+
# DCTERMS:HASVERSION
|
1375
1362
|
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
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
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1369
|
+
def marc2dc_source(xml)
|
1370
|
+
# DC:SOURCE
|
1371
|
+
marc2dc_source_852___(xml)
|
1372
|
+
marc2dc_source_856(xml)
|
1373
|
+
end
|
1392
1374
|
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
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
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
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
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
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
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
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
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
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
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
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
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
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
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
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
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
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
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
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
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
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
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
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
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
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
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
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
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
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
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
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
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
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
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
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
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
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
|
-
|
1538
|
-
|
1539
|
-
|
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
|
-
|
1542
|
-
|
1543
|
-
|
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
|
-
|
1546
|
-
|
1547
|
-
|
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
|
-
|
1551
|
-
|
1552
|
-
|
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
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
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
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
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
|
-
|
1577
|
-
|
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
|
-
|
1580
|
-
|
1581
|
-
|
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
|
-
|
1584
|
-
|
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
|
-
|
1591
|
-
|
1592
|
-
|
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
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
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
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
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
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
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
|
-
|
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
|
-
|
1622
|
-
|
1623
|
-
|
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
|
-
|
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
|
-
|
1635
|
-
|
1636
|
-
|
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
|
-
|
1642
|
-
|
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
|
-
|
1646
|
-
|
1647
|
-
|
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
|
-
|
1650
|
-
|
1651
|
-
|
1640
|
+
def taalcode(code)
|
1641
|
+
TAALCODES[code.to_sym]
|
1642
|
+
end
|
1652
1643
|
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1644
|
+
def bibnaam(code)
|
1645
|
+
BIBCODES[code] || ''
|
1646
|
+
end
|
1656
1647
|
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
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
|