Skip to content

Commit

Permalink
feat: Add metadata researcher musician host printer (#921)
Browse files Browse the repository at this point in the history
* feat: fix spacing

* feat: import_manifest

* feat: importer_guide

* feat: catalog_controller

* feat: californica_collections_form

* feat: solr_document

* feat: ucla_metadata

* feat: californica_collection_presenter

* feat: work_presenter

* feat: _attribute_rows.html

* feat: coordinates_example.csv, coordinates_example_update.csv, example-ingest_dot_iiif_url

* feat: all_fields.csv

* feat: example-missing_thumbnail

* feat: example.csv

* feat: simple_example.csv

* feat: child_work_form_spec

* feat: work_form_spec

* feat: californica_csv_parser_spec

* feat: californica_mapper_spec

* feat: edit_collection_spec

* feat: edit_work_spec

* feat: import_and_show_work_spec

* feat: show_collection_spec

* feat: csv_manifest_validator_spec, _attribute_rows.html.erb_spec

* feat: rubocop

* feat: rubocop

* feat: change from sortable to searchable

* feat: fix typos

* feat: update work_form and spec

* feat: update californica_mapper

* feat: add new fields to amed_subject: in catalog controller to show facets in Ursus

* feat: update californica_mapper and csv_manifest_validator_spec for Browse facet Names
  • Loading branch information
jendiamond authored Mar 4, 2023
1 parent fd29104 commit 84fe3c6
Show file tree
Hide file tree
Showing 29 changed files with 345 additions and 117 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Metrics/AbcSize:
Metrics/ClassLength:
Enabled: true
Exclude:
- app/forms/hyrax/work_form.rb
- app/models/solr_document.rb
- app/controllers/catalog_controller.rb
- app/controllers/catalog_controller.rb
Expand Down
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,Rights.statementLocal,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
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,Rights.statementLocal,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
25 changes: 24 additions & 1 deletion app/assets/markdown/importer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- [Format.extent](#formatextent)
- [Format.medium](#formatmedium)
- [Genre](#genre)
- [Host](#host)
- [IIIF Access URL](#iiif-access-url)
- [IIIF Range (for future use in Festerize to generate Ranges)](#iiif-range-for-future-use-in-festerize-to-generate-ranges)
- [Illustrations note](#illustrations-note)
Expand All @@ -44,6 +45,7 @@
- [License](#license)
- [Local identifier](#local-identifier)
- [Masthead](#masthead)
- [Musician](#musician)
- [Name.architect](#namearchitect)
- [Name.artist](#nameartist)
- [Name.calligrapher](#namecalligrapher)
Expand All @@ -59,24 +61,29 @@
- [Name.interviewee](#nameinterviewee)
- [Name.interviewer](#nameinterviewer)
- [Name.lyricist](#namelyricist)
- [Name.musician](#namemusician)
- [Name.photographer](#namephotographer)
- [Name.printer](#nameprinter)
- [Name.printmaker](#nameprintmaker)
- [Name.producer](#nameproducer)
- [Name.recipient](#namerecipient)
- [Name.researcher](#nameresearcher)
- [Name.rubricator](#namerubricator)
- [Name.scribe](#namescribe)
- [Name.translator](#nametranslator)
- [Note](#note)
- [Opac url](#opac-url)
- [Page layout](#page-layout)
- [Place of origin](#place-of-origin)
- [Printer](#printer)
- [Program](#program)
- [Project Name](#project-name)
- [Provenance](#provenance)
- [Publisher.publisherName](#publisherpublishername)
- [Relation.isPartOf](#relationispartof)
- [Repository](#repository)
- [Representative image](#representative-image)
- [Researcher](#researcher)
- [Rights.countryCreation](#rightscountrycreation)
- [Rights.rightsHolderContact](#rightsrightsholdercontact)
- [Rights.statementLocal](#rightsstatementlocal)
Expand Down Expand Up @@ -261,6 +268,10 @@ Also accepts: `Foliation note`

Also accepts: `Type.genre`

#### Host

Also accepts `Name.host`

#### IIIF Access URL

The URL of a IIIF resource that can be used to view the image. This is populated by processing the CSV via [bucketeer](https://bucketeer.library.ucla.edu/upload/csv). This URL is used to generate thumbnails for simple objects.
Expand Down Expand Up @@ -298,11 +309,15 @@ Examples:

The IIIF parameters following a IIIF image base URL. Used for the masthead image on a collections page. See `Representative image` below.

#### Musician

Also accepts: `Name.musician`

#### Name.architect

#### Name.artist

Also accepts: `Artist
Also accepts: `Artist`

#### Name.calligrapher

Expand Down Expand Up @@ -390,6 +405,10 @@ Also accepts: `Description.opac`

Also accepts: `Publisher.placeOfOrigin`

#### Printer

Also accepts: `Name.printer`

#### Program

#### Project Name
Expand All @@ -414,6 +433,10 @@ Also accepts: `Name.repository`, `repository`, `Personal or Corporate Name.repos

The base URL of a IIIF image to be used for the collection page masthead. See `Masthead` above.

#### Researcher

Also accepts: `Name.researcher`

#### Rights.countryCreation

#### Rights.rightsHolderContact
Expand Down
42 changes: 41 additions & 1 deletion app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ def self.modified_field
config.add_facet_field solr_name('genre', :facetable), label: 'Genre', limit: 5
config.add_facet_field solr_name('location', :facetable), label: 'Location', limit: 5
config.add_facet_field solr_name('series', :facetable), label: 'Series', limit: 5
config.add_facet_field solr_name('host', :facetable), label: 'Host', limit: 5
config.add_facet_field solr_name('musician', :facetable), label: 'Musician', limit: 5
config.add_facet_field solr_name('printer', :facetable), label: 'Printer', limit: 5
config.add_facet_field solr_name('researcher', :facetable), label: 'Researcher', limit: 5

# The generic_type isn't displayed on the facet list
# It's used to give a label to the filter that comes from the user profile
Expand Down Expand Up @@ -136,6 +140,7 @@ def self.modified_field
config.add_show_field 'masthead_parameters_ssi'
config.add_show_field 'funding_note_tesim'
config.add_show_field 'genre_tesim'
config.add_show_field 'host_tesim'
config.add_show_field 'iiif_manifest_url_ssi'
config.add_show_field 'iiif_range_ssi'
config.add_show_field 'iiif_viewing_hint_ssi'
Expand All @@ -148,6 +153,7 @@ def self.modified_field
config.add_show_field 'local_identifier_ssm'
config.add_show_field 'lyricist_tesim'
config.add_show_field 'medium_tesim'
config.add_show_field 'musician_tesim'
config.add_show_field 'named_subject_tesim'
config.add_show_field 'normalized_date_tesim'
config.add_show_field 'note_tesim'
Expand All @@ -156,12 +162,14 @@ def self.modified_field
config.add_show_field 'photographer_tesim'
config.add_show_field 'place_of_origin_tesim'
config.add_show_field 'preservation_copy_ssi'
config.add_show_field 'printer_tesim'
config.add_show_field 'printmaker_tesim'
config.add_show_field 'producer_tesim'
config.add_show_field 'program_tesim'
config.add_show_field 'provenance_tesim'
config.add_show_field 'recipient_tesim'
config.add_show_field 'repository_tesim'
config.add_show_field 'researcher_tesim'
config.add_show_field 'rights_country_tesim'
config.add_show_field 'rights_holder_tesim'
config.add_show_field 'rubricator_tesim'
Expand Down Expand Up @@ -502,6 +510,14 @@ def self.modified_field
}
end

config.add_search_field('host') do |field|
solr_name = solr_name('host', :stored_searchable)
field.solr_local_parameters = {
qf: solr_name,
pf: solr_name
}
end

config.add_search_field('identifier') do |field|
solr_name = solr_name('id', :stored_searchable)
field.solr_local_parameters = {
Expand Down Expand Up @@ -566,6 +582,22 @@ def self.modified_field
}
end

config.add_search_field('musician') do |field|
solr_name = solr_name('musician', :stored_searchable)
field.solr_local_parameters = {
qf: solr_name,
pf: solr_name
}
end

config.add_search_field('printer') do |field|
solr_name = solr_name('printer', :stored_searchable)
field.solr_local_parameters = {
qf: solr_name,
pf: solr_name
}
end

config.add_search_field('subject_topic') do |field|
solr_name = solr_name('subject_topic', :stored_searchable)
field.solr_local_parameters = {
Expand Down Expand Up @@ -607,7 +639,15 @@ def self.modified_field
end

config.add_search_field('repository') do |field|
solr_name = solr_name('repository', :stored_sortable)
solr_name = solr_name('repository', :stored_searchable)
field.solr_local_parameters = {
qf: solr_name,
pf: solr_name
}
end

config.add_search_field('researcher') do |field|
solr_name = solr_name('researcher', :stored_searchable)
field.solr_local_parameters = {
qf: solr_name,
pf: solr_name
Expand Down
8 changes: 8 additions & 0 deletions app/forms/hyrax/californica_collections_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class CalifornicaCollectionsForm < Hyrax::Forms::CollectionForm
:foliation,
:funding_note,
:genre,
:host,
:iiif_range,
:iiif_manifest_url,
:iiif_text_direction,
Expand All @@ -44,20 +45,23 @@ class CalifornicaCollectionsForm < Hyrax::Forms::CollectionForm
:lyricist,
:masthead_parameters,
:medium,
:musician,
:named_subject,
:normalized_date,
:note,
:opac_url,
:page_layout,
:photographer,
:place_of_origin,
:printer,
:printmaker,
:producer,
:program,
:provenance,
:recipient,
:repository,
:representative_image,
:researcher,
:resource_type,
:rights_country,
:rights_holder,
Expand Down Expand Up @@ -124,6 +128,7 @@ def secondary_terms
:foliation,
:funding_note,
:genre,
:host,
:identifier,
:iiif_manifest_url,
:iiif_range,
Expand All @@ -143,13 +148,15 @@ def secondary_terms
:lyricist,
:masthead_parameters,
:medium,
:musician,
:named_subject,
:normalized_date,
:note,
:opac_url,
:page_layout,
:photographer,
:place_of_origin,
:printer,
:printmaker,
:producer,
:program,
Expand All @@ -159,6 +166,7 @@ def secondary_terms
:related_url,
:repository,
:representative_image,
:researcher,
:resource_type,
:rights_country,
:rights_holder,
Expand Down
16 changes: 9 additions & 7 deletions app/forms/hyrax/work_form.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true
# Generated via
# `rails generate hyrax:work Work`
# Generated via `rails generate hyrax:work Work`
module Hyrax
# Generated form for Work
class WorkForm < Hyrax::Forms::WorkForm
Expand All @@ -23,6 +22,8 @@ class WorkForm < Hyrax::Forms::WorkForm
:condition_note,
:content_disclaimer,
:contents_note,
:contributor,
# :creator,
:dimensions,
:director,
:editor,
Expand All @@ -33,6 +34,7 @@ class WorkForm < Hyrax::Forms::WorkForm
:foliation,
:funding_note,
:genre,
:host,
:iiif_manifest_url,
:iiif_range,
:iiif_text_direction,
Expand All @@ -50,6 +52,7 @@ class WorkForm < Hyrax::Forms::WorkForm
:lyricist,
:masthead_parameters,
:medium,
:musician,
:named_subject,
:normalized_date,
:note,
Expand All @@ -58,13 +61,15 @@ class WorkForm < Hyrax::Forms::WorkForm
:photographer,
:place_of_origin,
:preservation_copy,
:printer,
:printmaker,
:producer,
:program,
:provenance,
:recipient,
:repository,
:representative_image,
:researcher,
:resource_type,
:rights_country,
:rights_holder,
Expand All @@ -80,18 +85,15 @@ class WorkForm < Hyrax::Forms::WorkForm
:summary,
:support,
:tagline,
:toc,
:thumbnail_link,
:toc,
:translator,
:uniform_title
]
self.terms -= [:based_near]

self.required_fields = [:title, :ark, :rights_statement]

##
# Fields that are automatically drawn on the page above the fold
#
# Fields that are automatically drawn on the page above the fol
# @return [Enumerable<Symbol>] symbols representing each primary term
def primary_terms
primary = required_fields + [:access_copy, :preservation_copy, :thumbnail_link]
Expand Down
14 changes: 13 additions & 1 deletion app/importers/californica_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class CalifornicaMapper < Darlingtonia::HashMapper
foliation: ["Foliation note", "Foliation"],
funding_note: "Description.fundingNote",
genre: ["Type.genre", "Genre"],
host: ["Host", "Name.host"],
iiif_manifest_url: "IIIF Manifest URL",
iiif_range: "IIIF Range",
iiif_text_direction: "Text direction",
Expand All @@ -64,11 +65,20 @@ class CalifornicaMapper < Darlingtonia::HashMapper
lyricist: "Name.lyricist",
masthead_parameters: ["Masthead"],
medium: "Format.medium",
musician: ["Musician", "Name.musician"],
named_subject: ["Name.subject",
"Personal or Corporate Name.subject",
"Subject.corporateName",
"Subject.personalName",
"Subject name"],
"Subject name",
"Host",
"Name.host",
"Musician",
"Name.musician",
"Name.printer",
"Printer",
"Name.researcher",
"Researcher"],
normalized_date: "Date.normalized",
note: ["Note"],
opac_url: ["Opac url", "Description.opac"],
Expand All @@ -78,6 +88,7 @@ class CalifornicaMapper < Darlingtonia::HashMapper
place_of_origin: ["Place of origin",
"Publisher.placeOfOrigin"],
preservation_copy: "File Name",
printer: ["Printer", "Name.printer"],
printmaker: ["Printmaker", "Name.printmaker"],
producer: ["Producer", "Name.producer"],
program: ["Program"],
Expand All @@ -87,6 +98,7 @@ class CalifornicaMapper < Darlingtonia::HashMapper
repository: ["Repository", "repository", "Name.repository",
"Personal or Corporate Name.repository"],
representative_image: ["Representative image"],
researcher: ["Researcher", "Name.researcher"],
resource_type: "Type.typeOfResource",
rights_country: "Rights.countryCreation",
rights_holder: ["Personal or Corporate Name.copyrightHolder",
Expand Down
Loading

0 comments on commit 84fe3c6

Please sign in to comment.