From 2ce0c379e8f50f60cb9f3f75025eb9eebabc67f7 Mon Sep 17 00:00:00 2001 From: Christy Karpinski Date: Thu, 25 Apr 2024 12:09:53 -0500 Subject: [PATCH 1/3] added faceting to the work type model for fields unique to the work type, they were missing --- app/controllers/catalog_controller.rb | 1 + app/models/etd.rb | 6 +++--- app/models/paper_or_report.rb | 14 +++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 16144509..42d8d486 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -85,6 +85,7 @@ def self.modified_field config.add_facet_field 'degree_sim', limit: 5, label: 'Degree' config.add_facet_field 'discipline_sim', limit: 5, label: 'Discipline' config.add_facet_field 'degree_granting_institution_sim', limit: 5, label: 'Degree Granting Institution' + config.add_facet_field 'department_sim', limit: 5, label: 'Department' config.add_facet_field 'funder_name_sim', limit: 5, label: 'Funder Name' config.add_facet_field 'event_title_sim', limit: 5, label: 'Event Title' config.add_facet_field 'event_date_sim', limit: 5, label: 'Event Date' diff --git a/app/models/etd.rb b/app/models/etd.rb index 26da1366..6eb03970 100644 --- a/app/models/etd.rb +++ b/app/models/etd.rb @@ -71,15 +71,15 @@ def video_embed? end property :advisor, predicate: ::RDF::URI('https://atla.com/terms/advisor') do |index| - index.as :stored_searchable + index.as :stored_searchable, :facetable end property :committee_member, predicate: ::RDF::URI('https://atla.com/terms/committeeMember') do |index| - index.as :stored_searchable + index.as :stored_searchable, :facetable end property :department, predicate: ::RDF::URI('https://atla.com/terms/department') do |index| - index.as :stored_searchable + index.as :stored_searchable, :facetable end property :year, predicate: ::RDF::Vocab::DC.date, multiple: false do |index| diff --git a/app/models/paper_or_report.rb b/app/models/paper_or_report.rb index b61f13e2..227c2481 100644 --- a/app/models/paper_or_report.rb +++ b/app/models/paper_or_report.rb @@ -31,11 +31,11 @@ def video_embed? end property :format, predicate: ::RDF::Vocab::DC11.format do |index| - index.as :stored_searchable + index.as :stored_searchable, :facetable end property :rights_holder, predicate: ::RDF::Vocab::DC.rightsHolder do |index| - index.as :stored_searchable + index.as :stored_searchable, :facetable end property :creator_orcid, predicate: ::RDF::Vocab::SCHEMA.creator, multiple: false do |index| @@ -44,7 +44,7 @@ def video_embed? property :creator_institutional_relationship, predicate: ::RDF::URI.intern('https://atla.com/terms/creatorInstitutionalRelationship') do |index| - index.as :stored_searchable + index.as :stored_searchable, :facetable end property :contributor_orcid, @@ -55,7 +55,7 @@ def video_embed? property :contributor_institutional_relationship, predicate: ::RDF::URI.intern('https://atla.com/terms/contributorInstitutionalRelationship') do |index| - index.as :stored_searchable + index.as :stored_searchable, :facetable end property :contributor_role, predicate: ::RDF::URI('https://atla.com/terms/contributorRole') do |index| @@ -79,11 +79,11 @@ def video_embed? end property :event_location, predicate: ::RDF::URI('https://atla.com/terms/eventLocation') do |index| - index.as :stored_searchable + index.as :stored_searchable, :facetable end property :event_date, predicate: ::RDF::URI('https://atla.com/terms/eventDate') do |index| - index.as :stored_searchable + index.as :stored_searchable, :facetable end property :official_link, predicate: ::RDF::Vocab::SCHEMA.url do |index| @@ -95,7 +95,7 @@ def video_embed? end property :location, predicate: ::RDF::Vocab::DC.coverage do |index| - index.as :stored_searchable, :facetable + index.as :stored_searchable, :facetable, :facetable end # types must be initially defined before the include ::Hyrax::BasicMetadata From 1e1753c04be35c02886f8f12d9a5548c9357c397 Mon Sep 17 00:00:00 2001 From: Christy Karpinski Date: Thu, 25 Apr 2024 12:24:16 -0500 Subject: [PATCH 2/3] on ETD moved license to additional --- app/forms/hyrax/etd_form.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/forms/hyrax/etd_form.rb b/app/forms/hyrax/etd_form.rb index 1072134e..c5bdacba 100644 --- a/app/forms/hyrax/etd_form.rb +++ b/app/forms/hyrax/etd_form.rb @@ -34,11 +34,11 @@ class EtdForm < Hyrax::Forms::WorkForm types ] - self.terms = %i[title location alternative_title creator contributor description abstract - keyword subject rights_statement publisher advisor - committee_member department date_created year resource_type + self.terms = %i[title license location alternative_title creator contributor + description abstract keyword subject rights_statement publisher + advisor committee_member department date_created year resource_type institution degree discipline degree_granting_institution types - license language format identifier based_near access_right + language format identifier based_near access_right rights_notes related_url video_embed bibliographic_citation additional_rights_info representative_id thumbnail_id rendering_ids files @@ -53,7 +53,7 @@ class EtdForm < Hyrax::Forms::WorkForm ] def primary_terms - super - %i[video_embed] + %i[keyword] + %i[license] + super - %i[video_embed] + %i[keyword] end end end From 8d61a3925f5c68e5c8fb7849c4dfb2e0d76c929f Mon Sep 17 00:00:00 2001 From: Christy Karpinski Date: Mon, 29 Apr 2024 11:50:32 -0500 Subject: [PATCH 3/3] fixed doubled facetable --- app/models/paper_or_report.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/paper_or_report.rb b/app/models/paper_or_report.rb index 227c2481..9014f5e3 100644 --- a/app/models/paper_or_report.rb +++ b/app/models/paper_or_report.rb @@ -95,7 +95,7 @@ def video_embed? end property :location, predicate: ::RDF::Vocab::DC.coverage do |index| - index.as :stored_searchable, :facetable, :facetable + index.as :stored_searchable, :facetable end # types must be initially defined before the include ::Hyrax::BasicMetadata