Skip to content

Commit

Permalink
feat: APPS-2395 og identifier plus external item record electronic lo…
Browse files Browse the repository at this point in the history
…cator (#955)

* fix specs

* add Identifier label to catalog_controller

* change identifier from ssim to tesim

* add electronic locator

* add CustomSolrizerDescriptor for electronic_locator

* add identifier to manifest_validator

* fix attribute_rows_spec

* delete electronic_locator from some yamls & add identifier test to import_and_show_work_spec

* electronic_locator: External item record to hyrax.en.yml labels-default this adds it to the form in edit collection
  • Loading branch information
jendiamond authored Jan 12, 2024
1 parent 4d3a611 commit 71e1be1
Show file tree
Hide file tree
Showing 29 changed files with 93 additions and 59 deletions.
2 changes: 1 addition & 1 deletion app/assets/csv/import_manifest.csv
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Object Type,Title,Item ARK,Parent ARK,Rights.copyrightStatus,File Name,AltIdentifier.local,AltTitle.other,Binding note,Condition note,Coverage.geographic,Date.creation,Date.normalized,Description.caption,Description.fundingNote,Description.latitude,Description.longitude,Description.note,Format.dimensions,Format.extent,Format.medium,Language,Name.architect,Name.photographer,Name.repository,Name.subject,Name.repository,Opac url,Project Name,Publisher.publisherName,Relation.isPartOf,Rights.countryCreation,Rights.rightsHolderContact,Subject,Type.genre,Type.typeOfResource,Place of origin,AltTitle.uniform,Support,Summary,Page layout,Text direction,viewingHint,IIIF Range,Illustrations note,Provenance; Description.history,Table of Contents; Description.tableOfContents,Subject.conceptTopic,Subject.descriptiveTopic,Collation,Foliation note,Foliation,Illuminator,Name.illuminator,Name.lyricist,Name.composer,Scribe,Name.scribe,Masthead,Representative image,Featured image,Tagline,Subject geographic,Subject temporal,Translator,Name.translator,Commentator,Name.commentator,Colophon,Finding Aid URL, Alt ID.url, Rubricator,Name.rubricator,License,Illustrator,Name.illustrator,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents,Content disclaimer,Interviewer,Name.interviewer,Interviewee,Name.interviewee,Cartographer,Name.cartographer,Artist,Name.artist,Recipient,Name.recipient,Director,Name.director,Producer,Name.producer,Program,Subject.culturalObject,Subject.domainTopic,Series,Host,Name.host,Musician,Name.musician,Printer,Name.printer,Researcher,Name.researcher,Statement of Responsibility,References,AdminNote,Description.adminnote,Note.admin,Format,Related Items,Rights.statementLocal,Related Records,Edition,History,Identifier
Object Type,Title,Item ARK,Parent ARK,Rights.copyrightStatus,File Name,AltIdentifier.local,AltTitle.other,Binding note,Condition note,Coverage.geographic,Date.creation,Date.normalized,Description.caption,Description.fundingNote,Description.latitude,Description.longitude,Description.note,Format.dimensions,Format.extent,Format.medium,Language,Name.architect,Name.photographer,Name.repository,Name.subject,Name.repository,Opac url,Project Name,Publisher.publisherName,Relation.isPartOf,Rights.countryCreation,Rights.rightsHolderContact,Subject,Type.genre,Type.typeOfResource,Place of origin,AltTitle.uniform,Support,Summary,Page layout,Text direction,viewingHint,IIIF Range,Illustrations note,Provenance; Description.history,Table of Contents; Description.tableOfContents,Subject.conceptTopic,Subject.descriptiveTopic,Collation,Foliation note,Foliation,Illuminator,Name.illuminator,Name.lyricist,Name.composer,Scribe,Name.scribe,Masthead,Representative image,Featured image,Tagline,Subject geographic,Subject temporal,Translator,Name.translator,Commentator,Name.commentator,Colophon,Finding Aid URL, Alt ID.url, Rubricator,Name.rubricator,License,Illustrator,Name.illustrator,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents,Content disclaimer,Interviewer,Name.interviewer,Interviewee,Name.interviewee,Cartographer,Name.cartographer,Artist,Name.artist,Recipient,Name.recipient,Director,Name.director,Producer,Name.producer,Program,Subject.culturalObject,Subject.domainTopic,Series,Host,Name.host,Musician,Name.musician,Printer,Name.printer,Researcher,Name.researcher,Statement of Responsibility,References,AdminNote,Description.adminnote,Note.admin,Format,Related Items,Rights.statementLocal,Related Records,Edition,History,External item record,View Record
16 changes: 8 additions & 8 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def self.modified_field
config.add_show_field 'license_tesim'
config.add_show_field 'resource_type_tesim', label: 'Resource Type'
config.add_show_field 'format_tesim'
config.add_show_field 'identifier_tesim'
config.add_show_field 'identifier_tesim', label: 'Identifier'
config.add_show_field 'ark_ssi', label: 'ARK'
config.add_show_field 'access_copy_ssi'

Expand All @@ -137,6 +137,7 @@ def self.modified_field
config.add_show_field 'director_tesim'
config.add_show_field 'edition_ssm', label: 'Edition'
config.add_show_field 'editor_tesim'
config.add_show_field 'electronic_locator_ss', label: 'External item record'
config.add_show_field 'engraver_tesim'
config.add_show_field 'extent_tesim'
config.add_show_field 'finding_aid_url_ssm'
Expand All @@ -146,7 +147,6 @@ def self.modified_field
config.add_show_field 'genre_tesim'
config.add_show_field 'history_tesim', label: 'History'
config.add_show_field 'host_tesim'
config.add_show_field 'identifier_global_ssim', label: 'Identifier'
config.add_show_field 'iiif_manifest_url_ssi'
config.add_show_field 'iiif_range_ssi'
config.add_show_field 'iiif_viewing_hint_ssi'
Expand Down Expand Up @@ -234,13 +234,13 @@ def self.modified_field
# of Solr search fields.
# creator, title, description, publisher, date_created,
# subject, language, resource_type, format, identifier, based_near,
config.add_search_field('contributor') do |field|
# solr_parameters hash are sent to Solr as ordinary url query params.
# solr_parameters hash are sent to Solr as ordinary url query params.
# :solr_local_parameters will be sent using Solr LocalParams
# syntax, as eg {! qf=$title_qf }. This is neccesary to use
# Solr parameter de-referencing like $title_qf.
# See: http://wiki.apache.org/solr/LocalParams

# :solr_local_parameters will be sent using Solr LocalParams
# syntax, as eg {! qf=$title_qf }. This is neccesary to use
# Solr parameter de-referencing like $title_qf.
# See: http://wiki.apache.org/solr/LocalParams
config.add_search_field('contributor') do |field|
solr_name = solr_name('contributor', :stored_searchable)
field.solr_local_parameters = {
qf: solr_name,
Expand Down
5 changes: 3 additions & 2 deletions app/forms/hyrax/californica_collections_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class CalifornicaCollectionsForm < Hyrax::Forms::CollectionForm
:director,
:edition,
:editor,
:electronic_locator,
:engraver,
:featured_image,
:finding_aid_url,
Expand All @@ -33,7 +34,7 @@ class CalifornicaCollectionsForm < Hyrax::Forms::CollectionForm
:genre,
:history,
:host,
:identifier_global,
:identifier,
:iiif_range,
:iiif_manifest_url,
:iiif_text_direction,
Expand Down Expand Up @@ -134,6 +135,7 @@ def secondary_terms
:director,
:edition,
:editor,
:electronic_locator,
:engraver,
:extent,
:featured_image,
Expand All @@ -145,7 +147,6 @@ def secondary_terms
:history,
:host,
:identifier,
:identifier_global,
:iiif_manifest_url,
:iiif_range,
:iiif_text_direction,
Expand Down
2 changes: 1 addition & 1 deletion app/forms/hyrax/work_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class WorkForm < Hyrax::Forms::WorkForm
:director,
:edition,
:editor,
:electronic_locator,
:engraver,
:extent,
:featured_image,
Expand All @@ -39,7 +40,6 @@ class WorkForm < Hyrax::Forms::WorkForm
:genre,
:history,
:host,
:identifier_global,
:iiif_manifest_url,
:iiif_range,
:iiif_text_direction,
Expand Down
7 changes: 6 additions & 1 deletion app/importers/californica_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class CalifornicaMapper < Darlingtonia::HashMapper
dlcs_collection_name: "Relation.isPartOf",
edition: ["Edition"],
editor: ["Editor", "Name.editor"],
electronic_locator: ["External item record", "View Record"],
engraver: ["Engraver", "Name.engraver"],
extent: "Format.extent",
featured_image: ["Featured image"],
Expand All @@ -47,7 +48,7 @@ class CalifornicaMapper < Darlingtonia::HashMapper
genre: ["Type.genre", "Genre"],
history: ["History"],
host: ["Host", "Name.host"],
identifier_global: ["Identifier"],
identifier: ["Identifier"],
iiif_manifest_url: "IIIF Manifest URL",
iiif_range: "IIIF Range",
iiif_text_direction: "Text direction",
Expand Down Expand Up @@ -449,4 +450,8 @@ def in_works_ids
def thumbnail_link
map_field(:thumbnail_link).to_a.first
end

def electronic_locator
map_field(:electronic_locator).to_a.first
end
end
8 changes: 4 additions & 4 deletions app/models/solr_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ def editor
self[:editor_tesim]
end

def electronic_locator
self[:electronic_locator_ss]
end

def engraver
self[:engraver_tesim]
end
Expand Down Expand Up @@ -166,10 +170,6 @@ def human_readable_related_record_title
self[:human_readable_related_record_title_ssm]
end

def identifier_global
self[:identifier_global_ssim]
end

def iiif_manifest_url
self[:iiif_manifest_url_ssi] || ""
end
Expand Down
16 changes: 12 additions & 4 deletions app/models/ucla_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@
module UclaMetadata
extend ActiveSupport::Concern

# Custom module to extend Solrizer
module CustomSolrizerDescriptor
def self.single_valued_stored
@single_valued_stored ||= Solrizer::Descriptor.new(:string, :stored)
end
end

included do
# Use the custom Solrizer descriptor for electronic_locator
property :electronic_locator, predicate: ::RDF::URI.intern('http://id.loc.gov/ontologies/bibframe/electronicLocator'), multiple: false do |index|
index.as CustomSolrizerDescriptor.single_valued_stored
end

property :ark, predicate: ::RDF::Vocab::DC11.identifier, multiple: false do |index|
index.as :stored_sortable
end
Expand Down Expand Up @@ -297,10 +309,6 @@ module UclaMetadata
index.as :displayable
end

property :identifier_global, predicate: ::RDF::URI.intern('http://id.loc.gov/ontologies/bibframe/Identifier') do |index|
index.as :symbol
end

property :opac_url, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/unimarc/terms/ter%23e'), multiple: false do |index|
index.as :stored_sortable
end
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/hyrax/californica_collection_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def self.terms
:director,
:edition,
:editor,
:electronic_locator,
:engraver,
:extent,
:featured_image,
Expand All @@ -40,7 +41,6 @@ def self.terms
:genre,
:history,
:host,
:identifier_global,
:iiif_manifest_url,
:iiif_range,
:iiif_viewing_hint,
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/hyrax/work_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class WorkPresenter < Hyrax::WorkShowPresenter
:dlcs_collection_name,
:edition,
:editor,
:electronic_locator,
:engraver,
:extent,
:featured_image,
Expand All @@ -38,7 +39,6 @@ class WorkPresenter < Hyrax::WorkShowPresenter
:geographic_coordinates,
:history,
:host,
:identifier_global,
:iiif_manifest_url,
:iiif_range,
:illustrations_note,
Expand Down
11 changes: 5 additions & 6 deletions app/views/hyrax/base/_attribute_rows.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<%= presenter.attribute_to_html(:dlcs_collection_name, render_as: :faceted, html_dl: true, label: "DLCS Collection Name") %>
<%= presenter.attribute_to_html(:edition, html_dl: true) %>
<%= presenter.attribute_to_html(:editor, html_dl: true) %>
<%= presenter.attribute_to_html(:electronic_locator, html_dl: true, label: "External item record") %>
<%= presenter.attribute_to_html(:engraver, html_dl: true) %>
<%= presenter.attribute_to_html(:extent, html_dl: true) %>
<%= presenter.attribute_to_html(:featured_image, html_dl: true) %>
Expand All @@ -37,7 +38,6 @@
<%= presenter.attribute_to_html(:geographic_coordinates, html_dl: true) %>
<%= presenter.attribute_to_html(:history, html_dl: true) %>
<%= presenter.attribute_to_html(:host, render_as: :faceted, html_dl: true) %>
<%= presenter.attribute_to_html(:identifier_global, html_dl: true) %>
<%= presenter.attribute_to_html(:identifier, render_as: :linked, search_field: 'identifier_tesim', html_dl: true) %>
<%= presenter.attribute_to_html(:iiif_manifest_url, html_dl: true) %>
<%= presenter.attribute_to_html(:iiif_range, html_dl: true) %>
Expand All @@ -51,6 +51,7 @@
<%= presenter.attribute_to_html(:keyword, render_as: :faceted, html_dl: true) %>
<%= presenter.attribute_to_html(:language, render_as: :language, html_dl: true) %>
<%= presenter.attribute_to_html(:local_identifier, html_dl: true) %>
<%= presenter.attribute_to_html(:local_rights_statement, html_dl: true) %>
<%= presenter.attribute_to_html(:location, html_dl: true) %>
<%= presenter.attribute_to_html(:lyricist, html_dl: true) %>
<%= presenter.attribute_to_html(:masthead_parameters, html_dl: true) %>
Expand Down Expand Up @@ -87,7 +88,6 @@
<% end %>
<%= presenter.attribute_to_html(:related_to, html_dl: true, label: 'Related Items') %>
<%= presenter.attribute_to_html(:citation_source, html_dl: true, label: "References") %>
<%= presenter.attribute_to_html(:related_url, render_as: :external_link, html_dl: true) %>
Expand All @@ -99,21 +99,20 @@
<%= presenter.attribute_to_html(:rights_holder, html_dl: true) %>
<%= presenter.attribute_to_html(:rights_statement, render_as: :rights_statement, html_dl: true) %>
<%= presenter.attribute_to_html(:rubricator, html_dl: true) %>
<%= presenter.attribute_to_html(:local_rights_statement, html_dl: true) %>
<%= presenter.attribute_to_html(:scribe, html_dl: true) %>
<%= presenter.attribute_to_html(:series, render_as: :faceted, html_dl: true) %>
<%= presenter.attribute_to_html(:source, html_dl: true) %>
<%= presenter.attribute_to_html(:resp_statement, html_dl: true, label: "Statement of Responsibility") %>
<%= presenter.attribute_to_html(:subject, render_as: :faceted, html_dl: true) %>
<%= presenter.attribute_to_html(:subject_geographic, render_as: :faceted, html_dl: true) %>
<%= presenter.attribute_to_html(:subject_temporal, render_as: :faceted, html_dl: true) %>
<%= presenter.attribute_to_html(:subject_cultural_object, render_as: :faceted, html_dl: true) %>
<%= presenter.attribute_to_html(:subject_geographic, render_as: :faceted, html_dl: true) %>
<%= presenter.attribute_to_html(:subject_domain_topic, render_as: :faceted, html_dl: true) %>
<%= presenter.attribute_to_html(:subject_temporal, render_as: :faceted, html_dl: true) %>
<%= presenter.attribute_to_html(:subject_topic, html_dl: true) %>
<%= presenter.attribute_to_html(:summary, html_dl: true) %>
<%= presenter.attribute_to_html(:support, html_dl: true) %>
<%= presenter.attribute_to_html(:tagline, html_dl: true) %>
<%= presenter.attribute_to_html(:thumbnail_link, html_dl: true) %>
<%= presenter.attribute_to_html(:translator, html_dl: true) %>
<%= presenter.attribute_to_html(:toc, html_dl: true) %>
<%= presenter.attribute_to_html(:translator, html_dl: true) %>
<%= presenter.attribute_to_html(:uniform_title, html_dl: true) %>
1 change: 1 addition & 0 deletions config/locales/blacklight.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ en:
normalized_date_sim: 'Normalized Date'
rights_country: 'Rights (country of creation)'
services_contact: 'Rights services contact'
electronic_locator: 'External item record'
2 changes: 2 additions & 0 deletions config/locales/hyrax.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ en:
subject_tesim: Subject
subject: Subjects
title_tesim: Title
electronic_locator: External item record
simple_form:
hints:
defaults:
Expand All @@ -64,6 +65,7 @@ en:
rights_holder: 'Rights Holder'
rights_statement: 'Copyright Status'
services_contact: 'Rights services contact'
electronic_locator: External item record
hyrax:
account_name: My Institution Account Id
dashboard:
Expand Down
Loading

0 comments on commit 71e1be1

Please sign in to comment.