loc_mods 0.2.7 → 0.3.1
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/.rubocop.yml +16 -7
- data/.rubocop_todo.yml +38 -37
- data/README.adoc +44 -0
- data/lib/loc_mods/abstract.rb +2 -2
- data/lib/loc_mods/access_condition.rb +2 -2
- data/lib/loc_mods/alternative_name.rb +2 -2
- data/lib/loc_mods/area.rb +2 -2
- data/lib/loc_mods/cartographic_extension.rb +2 -2
- data/lib/loc_mods/cartographics.rb +2 -2
- data/lib/loc_mods/city_section.rb +2 -2
- data/lib/loc_mods/classification.rb +2 -2
- data/lib/loc_mods/cli.rb +15 -9
- data/lib/loc_mods/collection.rb +2 -2
- data/lib/loc_mods/copy_information.rb +2 -2
- data/lib/loc_mods/date.rb +4 -4
- data/lib/loc_mods/date_other.rb +2 -2
- data/lib/loc_mods/detail.rb +2 -2
- data/lib/loc_mods/edition.rb +2 -2
- data/lib/loc_mods/enumeration_and_chronology.rb +2 -2
- data/lib/loc_mods/extent.rb +2 -2
- data/lib/loc_mods/extent_definition.rb +2 -2
- data/lib/loc_mods/form.rb +2 -2
- data/lib/loc_mods/genre.rb +2 -2
- data/lib/loc_mods/geographic_code.rb +4 -2
- data/lib/loc_mods/hierarchical_geographic.rb +2 -2
- data/lib/loc_mods/hierarchical_part.rb +2 -2
- data/lib/loc_mods/holding_simple.rb +2 -2
- data/lib/loc_mods/identifier.rb +2 -2
- data/lib/loc_mods/item_identifier.rb +2 -2
- data/lib/loc_mods/language.rb +2 -2
- data/lib/loc_mods/language_term.rb +4 -2
- data/lib/loc_mods/location.rb +2 -2
- data/lib/loc_mods/marc_code_lookup.rb +54 -0
- data/lib/loc_mods/name.rb +4 -6
- data/lib/loc_mods/name_part.rb +2 -2
- data/lib/loc_mods/namespace.rb +10 -0
- data/lib/loc_mods/non_sort.rb +4 -5
- data/lib/loc_mods/note.rb +2 -2
- data/lib/loc_mods/occupation.rb +2 -2
- data/lib/loc_mods/origin_info.rb +3 -2
- data/lib/loc_mods/part.rb +2 -2
- data/lib/loc_mods/physical_description.rb +3 -2
- data/lib/loc_mods/physical_description_note.rb +2 -2
- data/lib/loc_mods/physical_location.rb +2 -2
- data/lib/loc_mods/place.rb +2 -2
- data/lib/loc_mods/place_term.rb +4 -2
- data/lib/loc_mods/publisher.rb +2 -2
- data/lib/loc_mods/record.rb +3 -2
- data/lib/loc_mods/record_content_source.rb +1 -1
- data/lib/loc_mods/record_identifier.rb +2 -2
- data/lib/loc_mods/record_info.rb +2 -2
- data/lib/loc_mods/record_info_note.rb +2 -2
- data/lib/loc_mods/region.rb +2 -2
- data/lib/loc_mods/related_item.rb +4 -6
- data/lib/loc_mods/role.rb +2 -2
- data/lib/loc_mods/role_term.rb +10 -2
- data/lib/loc_mods/script_term.rb +2 -2
- data/lib/loc_mods/string_plus_language.rb +2 -2
- data/lib/loc_mods/subject.rb +6 -7
- data/lib/loc_mods/subject_name.rb +2 -2
- data/lib/loc_mods/subject_title_info.rb +2 -2
- data/lib/loc_mods/table_of_contents.rb +2 -2
- data/lib/loc_mods/target_audience.rb +2 -2
- data/lib/loc_mods/temporal.rb +2 -2
- data/lib/loc_mods/text.rb +2 -2
- data/lib/loc_mods/title_info.rb +2 -2
- data/lib/loc_mods/type_of_resource.rb +2 -2
- data/lib/loc_mods/url.rb +2 -2
- data/lib/loc_mods/version.rb +1 -1
- data/lib/loc_mods/xlink_href.rb +9 -0
- data/lib/loc_mods/xlink_namespace.rb +8 -0
- data/lib/loc_mods/xml_space.rb +9 -0
- data/lib/loc_mods.rb +72 -8
- metadata +17 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 584d5591b5dd0701eb44ba475ebcc2394cf16fd443466241aee6909026e1dee0
|
|
4
|
+
data.tar.gz: 62f09654b28776924e52bb197e246d84b1e488df3aff1311ac17be986c6dc61a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 27f161931994921ef73d8c006217267160606932b177b370da7c9d5626bde4081ddcfcc8c57fde5ee1d0d5d2b0fea118610a006b4ec965b97a7a8985e5d0c9bd
|
|
7
|
+
data.tar.gz: df4a2f1ab1565ab22d64035729581d1765c5d85bc16e6dfe61f3ae29ce80331c8005e10dc5aad26dbed30deb973e7e0105e0fa747c5752c18a14ce1b7b7a3705
|
data/.rubocop.yml
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
|
2
|
+
# See https://github.com/metanorma/cimas
|
|
3
|
+
inherit_from:
|
|
4
|
+
- https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
|
|
5
|
+
- .rubocop_todo.yml
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
|
|
7
|
+
inherit_mode:
|
|
8
|
+
merge:
|
|
9
|
+
- Exclude
|
|
5
10
|
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
# local repo-specific modifications
|
|
12
|
+
# ...
|
|
13
|
+
plugins:
|
|
14
|
+
- rubocop-rspec
|
|
15
|
+
- rubocop-performance
|
|
16
|
+
- rubocop-rake
|
|
8
17
|
|
|
9
|
-
|
|
10
|
-
|
|
18
|
+
AllCops:
|
|
19
|
+
TargetRubyVersion: 3.0
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
3
|
+
# on 2026-03-24 02:27:27 UTC using RuboCop version 1.86.0.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
9
|
# Offense count: 1
|
|
10
|
-
# Configuration parameters: Severity, Include.
|
|
11
|
-
# Include: **/*.gemspec
|
|
12
10
|
Gemspec/RequiredRubyVersion:
|
|
13
11
|
Exclude:
|
|
14
12
|
- 'loc_mods.gemspec'
|
|
15
13
|
|
|
14
|
+
# Offense count: 5
|
|
15
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
16
|
+
# Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
|
|
17
|
+
# URISchemes: http, https
|
|
18
|
+
Layout/LineLength:
|
|
19
|
+
Exclude:
|
|
20
|
+
- 'bin/update-nist-mods'
|
|
21
|
+
- 'lib/loc_mods/cli.rb'
|
|
22
|
+
- 'loc_mods.gemspec'
|
|
23
|
+
- 'spec/loc_mods/collection_spec.rb'
|
|
24
|
+
|
|
16
25
|
# Offense count: 1
|
|
17
26
|
# Configuration parameters: AllowedMethods.
|
|
18
27
|
# AllowedMethods: enums
|
|
@@ -20,31 +29,34 @@ Lint/ConstantDefinitionInBlock:
|
|
|
20
29
|
Exclude:
|
|
21
30
|
- 'spec/loc_mods/collection_spec.rb'
|
|
22
31
|
|
|
23
|
-
# Offense count:
|
|
24
|
-
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
|
32
|
+
# Offense count: 2
|
|
33
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
|
25
34
|
Metrics/AbcSize:
|
|
26
|
-
|
|
35
|
+
Exclude:
|
|
36
|
+
- 'lib/loc_mods/cli.rb'
|
|
27
37
|
|
|
28
38
|
# Offense count: 1
|
|
29
|
-
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
39
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
|
|
30
40
|
# AllowedMethods: refine
|
|
31
41
|
Metrics/BlockLength:
|
|
32
|
-
Max:
|
|
42
|
+
Max: 30
|
|
33
43
|
|
|
34
44
|
# Offense count: 2
|
|
35
|
-
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
45
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
36
46
|
Metrics/CyclomaticComplexity:
|
|
37
|
-
|
|
47
|
+
Exclude:
|
|
48
|
+
- 'lib/loc_mods/cli.rb'
|
|
38
49
|
|
|
39
50
|
# Offense count: 3
|
|
40
51
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
41
52
|
Metrics/MethodLength:
|
|
42
|
-
Max:
|
|
53
|
+
Max: 45
|
|
43
54
|
|
|
44
55
|
# Offense count: 2
|
|
45
|
-
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
56
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
46
57
|
Metrics/PerceivedComplexity:
|
|
47
|
-
|
|
58
|
+
Exclude:
|
|
59
|
+
- 'lib/loc_mods/cli.rb'
|
|
48
60
|
|
|
49
61
|
# Offense count: 1
|
|
50
62
|
# Configuration parameters: ForbiddenDelimiters.
|
|
@@ -54,34 +66,23 @@ Naming/HeredocDelimiterNaming:
|
|
|
54
66
|
- 'bin/update-nist-mods'
|
|
55
67
|
|
|
56
68
|
# Offense count: 1
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
# Offense count: 63
|
|
62
|
-
# Configuration parameters: AllowedConstants.
|
|
63
|
-
Style/Documentation:
|
|
64
|
-
Enabled: false
|
|
69
|
+
# Configuration parameters: CountAsOne.
|
|
70
|
+
RSpec/ExampleLength:
|
|
71
|
+
Max: 7
|
|
65
72
|
|
|
66
73
|
# Offense count: 1
|
|
67
|
-
|
|
68
|
-
# Configuration parameters: Strict, AllowedNumbers, AllowedPatterns.
|
|
69
|
-
Style/NumericLiterals:
|
|
70
|
-
MinDigits: 6
|
|
71
|
-
|
|
72
|
-
# Offense count: 2
|
|
73
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
74
|
-
# Configuration parameters: EnforcedStyleForMultiline.
|
|
75
|
-
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
|
|
76
|
-
Style/TrailingCommaInArguments:
|
|
74
|
+
RSpec/LeakyConstantDeclaration:
|
|
77
75
|
Exclude:
|
|
78
|
-
- 'lib/loc_mods/cli.rb'
|
|
79
76
|
- 'spec/loc_mods/collection_spec.rb'
|
|
80
77
|
|
|
81
78
|
# Offense count: 1
|
|
82
|
-
#
|
|
83
|
-
#
|
|
84
|
-
|
|
85
|
-
Style/TrailingCommaInArrayLiteral:
|
|
79
|
+
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
|
|
80
|
+
# SupportedInflectors: default, active_support
|
|
81
|
+
RSpec/SpecFilePathFormat:
|
|
86
82
|
Exclude:
|
|
87
|
-
- 'spec/
|
|
83
|
+
- 'spec/loc_mods_spec.rb'
|
|
84
|
+
|
|
85
|
+
# Offense count: 1
|
|
86
|
+
Security/Open:
|
|
87
|
+
Exclude:
|
|
88
|
+
- 'bin/update-nist-mods'
|
data/README.adoc
CHANGED
|
@@ -26,6 +26,34 @@ LocMods::Collection.from_xml(File.read("spec/fixtures/record_1.xml"))
|
|
|
26
26
|
LocMods::Collection.from_xml(File.read("reference/allrecords-MODS.xml"))
|
|
27
27
|
----
|
|
28
28
|
|
|
29
|
+
=== MARC 21 code lookup
|
|
30
|
+
|
|
31
|
+
`RoleTerm`, `PlaceTerm`, `LanguageTerm` and `GeographicCode` can look up a
|
|
32
|
+
coded value in the MARC 21 code lists of the
|
|
33
|
+
https://github.com/relaton/loc_marc[`loc_marc`] gem.
|
|
34
|
+
The `authority` attribute selects the code list:
|
|
35
|
+
|
|
36
|
+
|===
|
|
37
|
+
| `authority` | Code list
|
|
38
|
+
|
|
39
|
+
| `marcrelator` | https://www.loc.gov/marc/relators/[MARC Code List for Relators]
|
|
40
|
+
| `marccountry` | https://www.loc.gov/marc/countries/[MARC Code List for Countries]
|
|
41
|
+
| `marcgac` | https://www.loc.gov/marc/geoareas/[MARC Code List for Geographic Areas]
|
|
42
|
+
| `iso639-2b` | https://www.loc.gov/marc/languages/[MARC Code List for Languages]
|
|
43
|
+
|===
|
|
44
|
+
|
|
45
|
+
[source,ruby]
|
|
46
|
+
----
|
|
47
|
+
term = LocMods::RoleTerm.from_xml(
|
|
48
|
+
'<roleTerm xmlns="http://www.loc.gov/mods/v3" type="code" authority="marcrelator">aut</roleTerm>'
|
|
49
|
+
)
|
|
50
|
+
term.code_info # => {code: "aut", description: "Author", deprecated: false}
|
|
51
|
+
term.code_description # => "Author"
|
|
52
|
+
----
|
|
53
|
+
|
|
54
|
+
The methods return `nil` for a `type="text"` term, for an authority without a
|
|
55
|
+
MARC code list, and for an unknown code.
|
|
56
|
+
|
|
29
57
|
=== Command line interface
|
|
30
58
|
|
|
31
59
|
LocMods provides a command-line interface (CLI) for various operations.
|
|
@@ -119,6 +147,22 @@ metadata.
|
|
|
119
147
|
bin/update-nist-mods
|
|
120
148
|
----
|
|
121
149
|
|
|
150
|
+
=== Running tests
|
|
151
|
+
|
|
152
|
+
Run all tests:
|
|
153
|
+
|
|
154
|
+
[source,sh]
|
|
155
|
+
----
|
|
156
|
+
bundle exec rake spec
|
|
157
|
+
----
|
|
158
|
+
|
|
159
|
+
Run a single test by description:
|
|
160
|
+
|
|
161
|
+
[source,sh]
|
|
162
|
+
----
|
|
163
|
+
bundle exec rspec spec/loc_mods/collection_spec.rb --example "991000197019708106"
|
|
164
|
+
----
|
|
165
|
+
|
|
122
166
|
== License
|
|
123
167
|
|
|
124
168
|
Copyright Ribose.
|
data/lib/loc_mods/abstract.rb
CHANGED
|
@@ -13,8 +13,8 @@ module LocMods
|
|
|
13
13
|
attribute :content_type, :string
|
|
14
14
|
|
|
15
15
|
xml do
|
|
16
|
-
|
|
17
|
-
namespace
|
|
16
|
+
element "abstract"
|
|
17
|
+
namespace Namespace
|
|
18
18
|
|
|
19
19
|
map_content to: :content
|
|
20
20
|
map_attribute "displayLabel", to: :display_label
|
|
@@ -15,8 +15,8 @@ module LocMods
|
|
|
15
15
|
attribute :content_type, :string
|
|
16
16
|
|
|
17
17
|
xml do
|
|
18
|
-
|
|
19
|
-
namespace
|
|
18
|
+
element "accessCondition"
|
|
19
|
+
namespace Namespace
|
|
20
20
|
|
|
21
21
|
map_content to: :content
|
|
22
22
|
map_attribute "displayLabel", to: :display_label
|
|
@@ -21,8 +21,8 @@ module LocMods
|
|
|
21
21
|
attribute :name_identifier, Identifier, collection: true
|
|
22
22
|
|
|
23
23
|
xml do
|
|
24
|
-
|
|
25
|
-
namespace
|
|
24
|
+
element "alternativeName"
|
|
25
|
+
namespace Namespace
|
|
26
26
|
|
|
27
27
|
map_attribute "lang", to: :lang
|
|
28
28
|
map_attribute "script", to: :script
|
data/lib/loc_mods/area.rb
CHANGED
|
@@ -8,8 +8,8 @@ module LocMods
|
|
|
8
8
|
attribute :display_label, :string
|
|
9
9
|
|
|
10
10
|
xml do
|
|
11
|
-
|
|
12
|
-
namespace
|
|
11
|
+
element "cartographicExtension"
|
|
12
|
+
namespace Namespace
|
|
13
13
|
|
|
14
14
|
map_content to: :content
|
|
15
15
|
map_attribute "displayLabel", to: :display_label
|
|
@@ -15,8 +15,8 @@ module LocMods
|
|
|
15
15
|
attribute :cartographic_extension, CartographicExtension, collection: true
|
|
16
16
|
|
|
17
17
|
xml do
|
|
18
|
-
|
|
19
|
-
namespace
|
|
18
|
+
element "cartographics"
|
|
19
|
+
namespace Namespace
|
|
20
20
|
|
|
21
21
|
map_attribute "authority", to: :authority
|
|
22
22
|
map_attribute "authorityURI", to: :authority_uri
|
|
@@ -10,8 +10,8 @@ module LocMods
|
|
|
10
10
|
attribute :city_section_type, :string
|
|
11
11
|
|
|
12
12
|
xml do
|
|
13
|
-
|
|
14
|
-
namespace
|
|
13
|
+
element "citySection"
|
|
14
|
+
namespace Namespace
|
|
15
15
|
|
|
16
16
|
map_content to: :content
|
|
17
17
|
map_attribute "citySectionType", to: :city_section_type
|
|
@@ -13,8 +13,8 @@ module LocMods
|
|
|
13
13
|
attribute :generator, :string
|
|
14
14
|
|
|
15
15
|
xml do
|
|
16
|
-
|
|
17
|
-
namespace
|
|
16
|
+
element "classification"
|
|
17
|
+
namespace Namespace
|
|
18
18
|
|
|
19
19
|
map_content to: :content
|
|
20
20
|
map_attribute "authority", to: :authority
|
data/lib/loc_mods/cli.rb
CHANGED
|
@@ -5,9 +5,12 @@ require "loc_mods"
|
|
|
5
5
|
|
|
6
6
|
module LocMods
|
|
7
7
|
class Cli < Thor
|
|
8
|
-
desc "detect-duplicates PATH...",
|
|
9
|
-
|
|
10
|
-
method_option :
|
|
8
|
+
desc "detect-duplicates PATH...",
|
|
9
|
+
"Detect duplicate records in MODS XML files or directories"
|
|
10
|
+
method_option :show_unchanged, type: :boolean, default: false,
|
|
11
|
+
desc: "Show unchanged attributes in the diff output"
|
|
12
|
+
method_option :highlight_diff, type: :boolean, default: false,
|
|
13
|
+
desc: "Highlight only the differences"
|
|
11
14
|
method_option :color, type: :string, enum: %w[auto on off], default: "auto",
|
|
12
15
|
desc: "Use colors in the diff output (auto, on, off)"
|
|
13
16
|
|
|
@@ -27,7 +30,9 @@ module LocMods
|
|
|
27
30
|
|
|
28
31
|
records_by_url = {}
|
|
29
32
|
all_records.each do |record|
|
|
30
|
-
urls = record[:record].location.flat_map
|
|
33
|
+
urls = record[:record].location.flat_map do |loc|
|
|
34
|
+
loc.url.map(&:content)
|
|
35
|
+
end.compact
|
|
31
36
|
unless urls.any?
|
|
32
37
|
puts "Warning: Record without URL found in file: #{record[:file]}"
|
|
33
38
|
next
|
|
@@ -54,7 +59,7 @@ module LocMods
|
|
|
54
59
|
record2[:record],
|
|
55
60
|
options[:show_unchanged],
|
|
56
61
|
options[:highlight_diff],
|
|
57
|
-
color_enabled
|
|
62
|
+
color_enabled?,
|
|
58
63
|
)
|
|
59
64
|
puts "\n"
|
|
60
65
|
end
|
|
@@ -71,14 +76,15 @@ module LocMods
|
|
|
71
76
|
end
|
|
72
77
|
end
|
|
73
78
|
|
|
74
|
-
def print_differences(record1, record2, show_unchanged, highlight_diff,
|
|
79
|
+
def print_differences(record1, record2, show_unchanged, highlight_diff,
|
|
80
|
+
use_colors)
|
|
75
81
|
diff_score, diff_tree = Lutaml::Model::Serialize.diff_with_score(
|
|
76
82
|
record1,
|
|
77
83
|
record2,
|
|
78
84
|
show_unchanged: show_unchanged,
|
|
79
85
|
highlight_diff: highlight_diff,
|
|
80
86
|
use_colors: use_colors,
|
|
81
|
-
indent: " "
|
|
87
|
+
indent: " ",
|
|
82
88
|
)
|
|
83
89
|
similarity_percentage = (1 - diff_score) * 100
|
|
84
90
|
|
|
@@ -101,7 +107,7 @@ module LocMods
|
|
|
101
107
|
def supports_color?
|
|
102
108
|
return false unless $stdout.tty?
|
|
103
109
|
|
|
104
|
-
if RbConfig::CONFIG["host_os"]
|
|
110
|
+
if /mswin|mingw|cygwin/.match?(RbConfig::CONFIG["host_os"])
|
|
105
111
|
return true if ENV["ANSICON"]
|
|
106
112
|
return true if ENV["ConEmuANSI"] == "ON"
|
|
107
113
|
return true if ENV["TERM"] == "xterm"
|
|
@@ -109,7 +115,7 @@ module LocMods
|
|
|
109
115
|
|
|
110
116
|
return true if ENV["COLORTERM"]
|
|
111
117
|
|
|
112
|
-
term = ENV
|
|
118
|
+
term = ENV.fetch("TERM", nil)
|
|
113
119
|
return false if term.nil? || term.empty?
|
|
114
120
|
|
|
115
121
|
color_terms = %w[ansi color console cygwin gnome konsole kterm
|
data/lib/loc_mods/collection.rb
CHANGED
|
@@ -19,8 +19,8 @@ module LocMods
|
|
|
19
19
|
attribute :item_identifier, ItemIdentifier, collection: true
|
|
20
20
|
|
|
21
21
|
xml do
|
|
22
|
-
|
|
23
|
-
namespace
|
|
22
|
+
element "copyInformation"
|
|
23
|
+
namespace Namespace
|
|
24
24
|
|
|
25
25
|
map_element "form", to: :form
|
|
26
26
|
map_element "subLocation", to: :sub_location
|
data/lib/loc_mods/date.rb
CHANGED
|
@@ -5,18 +5,18 @@ require "lutaml/model"
|
|
|
5
5
|
module LocMods
|
|
6
6
|
class Date < Lutaml::Model::Serializable
|
|
7
7
|
attribute :content, :string
|
|
8
|
-
attribute :
|
|
8
|
+
attribute :encoding_code, :string
|
|
9
9
|
attribute :qualifier, :string
|
|
10
10
|
attribute :point, :string
|
|
11
11
|
attribute :key_date, :string
|
|
12
12
|
attribute :calendar, :string
|
|
13
13
|
|
|
14
14
|
xml do
|
|
15
|
-
|
|
16
|
-
namespace
|
|
15
|
+
element "recordChangeDate"
|
|
16
|
+
namespace Namespace
|
|
17
17
|
|
|
18
18
|
map_content to: :content
|
|
19
|
-
map_attribute "encoding", to: :
|
|
19
|
+
map_attribute "encoding", to: :encoding_code
|
|
20
20
|
map_attribute "qualifier", to: :qualifier
|
|
21
21
|
map_attribute "point", to: :point
|
|
22
22
|
map_attribute "keyDate", to: :key_date
|
data/lib/loc_mods/date_other.rb
CHANGED
data/lib/loc_mods/detail.rb
CHANGED
|
@@ -11,8 +11,8 @@ module LocMods
|
|
|
11
11
|
attribute :title, :string, collection: true
|
|
12
12
|
|
|
13
13
|
xml do
|
|
14
|
-
|
|
15
|
-
namespace
|
|
14
|
+
element "detail"
|
|
15
|
+
namespace Namespace
|
|
16
16
|
|
|
17
17
|
map_attribute "type", to: :type
|
|
18
18
|
map_attribute "level", to: :level
|
data/lib/loc_mods/edition.rb
CHANGED
|
@@ -8,8 +8,8 @@ module LocMods
|
|
|
8
8
|
attribute :unit_type, :string
|
|
9
9
|
|
|
10
10
|
xml do
|
|
11
|
-
|
|
12
|
-
namespace
|
|
11
|
+
element "enumerationAndChronology"
|
|
12
|
+
namespace Namespace
|
|
13
13
|
|
|
14
14
|
map_content to: :content
|
|
15
15
|
map_attribute "unitType", to: :unit_type
|
data/lib/loc_mods/extent.rb
CHANGED
data/lib/loc_mods/form.rb
CHANGED
data/lib/loc_mods/genre.rb
CHANGED
|
@@ -4,14 +4,16 @@ require "lutaml/model"
|
|
|
4
4
|
|
|
5
5
|
module LocMods
|
|
6
6
|
class GeographicCode < Lutaml::Model::Serializable
|
|
7
|
+
include MarcCodeLookup
|
|
8
|
+
|
|
7
9
|
attribute :content, :string
|
|
8
10
|
attribute :authority_uri, :string
|
|
9
11
|
attribute :value_uri, :string
|
|
10
12
|
attribute :authority, :string
|
|
11
13
|
|
|
12
14
|
xml do
|
|
13
|
-
|
|
14
|
-
namespace
|
|
15
|
+
element "geographicCode"
|
|
16
|
+
namespace Namespace
|
|
15
17
|
|
|
16
18
|
map_content to: :content
|
|
17
19
|
map_attribute "authorityURI", to: :authority_uri
|
|
@@ -26,8 +26,8 @@ module LocMods
|
|
|
26
26
|
attribute :area, Area, collection: true
|
|
27
27
|
|
|
28
28
|
xml do
|
|
29
|
-
|
|
30
|
-
namespace
|
|
29
|
+
element "hierarchicalGeographic"
|
|
30
|
+
namespace Namespace
|
|
31
31
|
|
|
32
32
|
map_attribute "authority", to: :authority
|
|
33
33
|
map_attribute "authorityURI", to: :authority_uri
|
|
@@ -9,8 +9,8 @@ module LocMods
|
|
|
9
9
|
attribute :copy_information, CopyInformation, collection: true
|
|
10
10
|
|
|
11
11
|
xml do
|
|
12
|
-
|
|
13
|
-
namespace
|
|
12
|
+
element "holdingSimple"
|
|
13
|
+
namespace Namespace
|
|
14
14
|
|
|
15
15
|
map_element "copyInformation", to: :copy_information
|
|
16
16
|
end
|
data/lib/loc_mods/identifier.rb
CHANGED
|
@@ -12,8 +12,8 @@ module LocMods
|
|
|
12
12
|
attribute :alt_rep_group, :string
|
|
13
13
|
|
|
14
14
|
xml do
|
|
15
|
-
|
|
16
|
-
namespace
|
|
15
|
+
element "nameIdentifier"
|
|
16
|
+
namespace Namespace
|
|
17
17
|
|
|
18
18
|
map_content to: :content
|
|
19
19
|
map_attribute "displayLabel", to: :display_label
|
data/lib/loc_mods/language.rb
CHANGED
|
@@ -18,8 +18,8 @@ module LocMods
|
|
|
18
18
|
attribute :script_term, ScriptTerm, collection: true
|
|
19
19
|
|
|
20
20
|
xml do
|
|
21
|
-
|
|
22
|
-
namespace
|
|
21
|
+
element "languageOfCataloging"
|
|
22
|
+
namespace Namespace
|
|
23
23
|
|
|
24
24
|
map_attribute "objectPart", to: :object_part
|
|
25
25
|
map_attribute "lang", to: :lang
|
|
@@ -4,6 +4,8 @@ require "lutaml/model"
|
|
|
4
4
|
|
|
5
5
|
module LocMods
|
|
6
6
|
class LanguageTerm < Lutaml::Model::Serializable
|
|
7
|
+
include MarcCodeLookup
|
|
8
|
+
|
|
7
9
|
attribute :content, :string
|
|
8
10
|
attribute :authority_uri, :string
|
|
9
11
|
attribute :value_uri, :string
|
|
@@ -11,8 +13,8 @@ module LocMods
|
|
|
11
13
|
attribute :type, :string
|
|
12
14
|
|
|
13
15
|
xml do
|
|
14
|
-
|
|
15
|
-
namespace
|
|
16
|
+
element "languageTerm"
|
|
17
|
+
namespace Namespace
|
|
16
18
|
|
|
17
19
|
map_content to: :content
|
|
18
20
|
map_attribute "authorityURI", to: :authority_uri
|