Skip to content

Commit

Permalink
Add additional date parsing and normalization for downstream consumer…
Browse files Browse the repository at this point in the history
…s to extract actionable information from a variety of date encodings
  • Loading branch information
cbeer committed Nov 29, 2017
1 parent 846ff0b commit 9f32117
Show file tree
Hide file tree
Showing 10 changed files with 719 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ tmp
tmtags
.idea/*
to_delete
.byebug_history
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ end

# Pin to activesupport 4.x for older versions of ruby
gem 'activesupport', '~> 4.2' if RUBY_VERSION < '2.2.2'
gem 'byebug'
4 changes: 4 additions & 0 deletions lib/mods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
module Mods
require 'mods/constants'
require 'mods/nom_terminology'
require 'mods/date'
require 'mods/marc_country_codes'
require 'mods/marc_geo_area_codes'
require 'mods/marc_relator_codes'
require 'mods/name'
require 'mods/origin_info'
require 'mods/reader'
require 'mods/record'
require 'mods/subject'
require 'mods/title_info'
require 'mods/version'

ORIGIN_INFO_DATE_ELEMENTS = Mods::OriginInfo::DATE_ELEMENTS
end
13 changes: 5 additions & 8 deletions lib/mods/constants.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module Mods
# the version of MODS supported by this gem
MODS_VERSION = '3.4'

MODS_NS_V3 = "http://www.loc.gov/mods/v3"
MODS_NS = MODS_NS_V3
MODS_XSD = "http://www.loc.gov/standards/mods/mods.xsd"

DOC_URL = "http://www.loc.gov/standards/mods/"

# top level elements that cannot have subelement children
Expand Down Expand Up @@ -40,7 +40,7 @@ module Mods
# enumerated attribute values
TITLE_INFO_TYPES = ['abbreviated', 'translated', 'alternative', 'uniform']
RELATED_ITEM_TYPES = [
'preceding', 'succeeding', 'original', 'host', 'constituent', 'series',
'preceding', 'succeeding', 'original', 'host', 'constituent', 'series',
'otherVersion', 'otherFormat', 'isReferencedBy', 'references', 'reviewOf'
]

Expand All @@ -51,10 +51,7 @@ module Mods
'still image',
'moving image',
'three dimensional object',
'software',
'software',
'multimedia',
'mixed material']

ORIGIN_INFO_DATE_ELEMENTS = ['dateIssued', 'dateCreated', 'dateCaptured', 'dateValid', 'dateModified', 'copyrightDate', 'dateOther']

end
end

0 comments on commit 9f32117

Please sign in to comment.