Module: NEU::MODS::Projection
- Includes:
- Access, Dates, Identifiers, Languages, NameDisplay, Names, OriginInfo, PhysicalDescription, RelatedItems, Subjects, Support, Titles
- Included in:
- Document
- Defined in:
- lib/neu/mods/projection.rb,
lib/neu/mods/projection/dates.rb,
lib/neu/mods/projection/names.rb,
lib/neu/mods/projection/access.rb,
lib/neu/mods/projection/titles.rb,
lib/neu/mods/projection/support.rb,
lib/neu/mods/projection/subjects.rb,
lib/neu/mods/projection/languages.rb,
lib/neu/mods/projection/identifiers.rb,
lib/neu/mods/projection/origin_info.rb,
lib/neu/mods/projection/name_display.rb,
lib/neu/mods/projection/related_items.rb,
lib/neu/mods/projection/physical_description.rb
Overview
Node -> plain data: what a MODS document projects to for indexing and display. Each MODS area is its own mixin under projection/; this module composes them and owns FIELDS. See docs/fields.md.
Defined Under Namespace
Modules: Access, Dates, Identifiers, Languages, NameDisplay, Names, OriginInfo, PhysicalDescription, RelatedItems, Subjects, Support, Titles
Constant Summary collapse
- FIELDS =
Field name => :one or :many. #to_h and Atlas's Metadata::MODS attribute set are both derived from it, so each key is a public method name that a consumer depends on. See docs/fields.md.
{ # titles main_title: :one, main_title_display_label: :one, alternative_title: :many, uniform_title: :many, translated_title: :many, abbreviated_title: :many, names: :many, languages: :many, abstract: :one, abstract_display_label: :one, abstract_href: :one, # origin publication_information: :many, place_of_publication: :many, origin_agents: :many, edition: :many, issuance: :many, frequency: :many, # Nine generated rows for each of the seven date elements (docs/dates.md). **Dates::DATE_FIELD_ROWS, # physical description resource_type: :many, target_audience: :many, genres: :many, format: :many, extent: :many, digital_origin: :many, reformatting_quality: :many, physical_description_notes: :many, notes: :many, table_of_contents: :many, # subjects subject_headings: :many, topical_subjects: :many, geographic_subjects: :many, temporal_subjects: :many, personal_name_subjects: :many, corporate_name_subjects: :many, occupation_subjects: :many, genre_subjects: :many, geographic_code_subjects: :many, title_subjects: :many, hierarchical_geographic_subjects: :many, map_data: :many, # related items related_series: :many, host_collections: :many, related_items: :many, # identifiers and location identifiers: :many, classification: :many, permanent_url: :one, permanent_url_display_label: :one, record_info: :one, location: :many, # access access_condition: :one, access_condition_display_label: :one, access_condition_href: :one, use_and_reproduction: :one, use_and_reproduction_display_label: :one, use_and_reproduction_href: :one, restriction_on_access: :one, restriction_on_access_display_label: :one, restriction_on_access_href: :one }.freeze
Constants included from Identifiers
Identifiers::RECORD_INFO_PARTS
Constants included from Support
Constants included from RelatedItems
RelatedItems::NAMED_HOST_DETAIL_TYPES, RelatedItems::NAMED_RELATED_ITEM_TYPES
Constants included from OriginInfo
OriginInfo::MARC_COUNTRY_AUTHORITY
Constants included from Dates
Dates::DATE_ELEMENTS, Dates::DATE_FIELDS, Dates::DATE_FIELD_ROWS, Dates::DATE_KEYS, Dates::EMPTY_DATE, Dates::ISO8601_BASIC_DATE, Dates::ISO8601_ENCODING, Dates::W3CDTF_DATE
Constants included from Subjects
Subjects::HEADING_OMITTED_CHILDREN, Subjects::HEADING_SEPARATOR, Subjects::HIERARCHICAL_GEOGRAPHIC_LEVELS, Subjects::TYPELESS_NAME_SUBJECT_TYPE
Constants included from Titles
Titles::NON_SORT_BINDING, Titles::TITLE_SEPARATORS
Class Method Summary collapse
-
.cardinality_of(value) ⇒ Object
The cardinality a projected value has, for checking it against its FIELDS row: an Array is :many and anything else is :one.
-
.compose_title(parts) ⇒ Object
The area mixins' module methods, callable on Projection too.
- .fold_type(str) ⇒ Object
- .join_non_sort(non_sort, title) ⇒ Object
Instance Method Summary collapse
-
#to_h ⇒ Object
The complete read projection, keyed to Atlas's Metadata::MODS attribute names -- a drop-in source for
convert_xml_to_json.
Methods included from Identifiers
#classification, #identifiers, #location, #permanent_url, #permanent_url_display_label, #record_info
Methods included from RelatedItems
#host_collections, #related_items, #related_series
Methods included from PhysicalDescription
#digital_origin, #extent, #format, #genres, #notes, #physical_description_notes, #reformatting_quality, #resource_type, #table_of_contents, #target_audience
Methods included from OriginInfo
#edition, #frequency, #issuance, #origin_agents, #place_of_publication, #place_term_value, #publication_information
Methods included from Dates
#copyright_date_with_precision, #date_created_with_precision, #date_issued_with_precision
Methods included from Names
#alternative_names, #editable_corporate_creators, #editable_personal_creators, #name_entry, #names, #preserved_names
Methods included from Selectors
#abstract_nodes, #editable_creator_nodes, #keyword_subjects, #primary_title_info, #variant_title?
Methods included from Languages
Methods included from Subjects
#corporate_name_subjects, #genre_subjects, #geographic_code_subjects, #geographic_subjects, #hierarchical_geographic_subjects, #keywords, #map_data, #occupation_subjects, #personal_name_subjects, #subject_headings, #temporal_subjects, #title_subjects, #topical_subjects
Methods included from Titles
#abbreviated_title, #access_title_parts, #alternative_title, #main_title, #main_title_display_label, #plain_title, #title_parts, #translated_title, #uniform_title
Methods included from Access
#abstract, #abstract_display_label, #abstract_href, #access_condition, #access_condition_display_label, #access_condition_href, #restriction_on_access, #restriction_on_access_display_label, #restriction_on_access_href, #use_and_reproduction, #use_and_reproduction_display_label, #use_and_reproduction_href
Class Method Details
.cardinality_of(value) ⇒ Object
The cardinality a projected value has, for checking it against its FIELDS row: an Array is :many and anything else is :one.
122 |
# File 'lib/neu/mods/projection.rb', line 122 def self.cardinality_of(value) = value.is_a?(Array) ? :many : :one |
.compose_title(parts) ⇒ Object
The area mixins' module methods, callable on Projection too. A module
method does not travel with include, and callers outside the gem name
Projection rather than the mixin that owns the method.
127 |
# File 'lib/neu/mods/projection.rb', line 127 def self.compose_title(parts) = Titles.compose_title(parts) |
.fold_type(str) ⇒ Object
129 |
# File 'lib/neu/mods/projection.rb', line 129 def self.fold_type(str) = Access.fold_type(str) |
.join_non_sort(non_sort, title) ⇒ Object
128 |
# File 'lib/neu/mods/projection.rb', line 128 def self.join_non_sort(non_sort, title) = Titles.join_non_sort(non_sort, title) |
Instance Method Details
#to_h ⇒ Object
The complete read projection, keyed to Atlas's Metadata::MODS attribute
names -- a drop-in source for convert_xml_to_json.
116 117 118 |
# File 'lib/neu/mods/projection.rb', line 116 def to_h FIELDS.keys.to_h { |field| [field, public_send(field)] } end |