Skip to content

Commit

Permalink
removing uses of publisher metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
jenlindner committed Dec 22, 2017
1 parent 7004f44 commit ac06724
Show file tree
Hide file tree
Showing 21 changed files with 9 additions and 91 deletions.
13 changes: 1 addition & 12 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def self.modified_field
config.add_facet_field solr_name("subject", :facetable), limit: 5
config.add_facet_field solr_name("language", :facetable), limit: 5
config.add_facet_field solr_name("based_near_label", :facetable), limit: 5
config.add_facet_field solr_name("publisher", :facetable), limit: 5
config.add_facet_field solr_name("file_format", :facetable), limit: 5
config.add_facet_field solr_name('member_of_collections', :symbol), limit: 5, label: 'Collections'
config.add_facet_field solr_name("rights_statement", :facetable), limit: 5, label: 'Rights'
Expand Down Expand Up @@ -80,7 +79,6 @@ def self.modified_field
config.add_index_field solr_name("contributor", :stored_searchable), itemprop: 'contributor', link_to_search: solr_name("contributor", :facetable)
config.add_index_field solr_name("proxy_depositor", :symbol), label: "Depositor", helper_method: :link_to_profile
config.add_index_field solr_name("depositor"), label: "Owner", helper_method: :link_to_profile
config.add_index_field solr_name("publisher", :stored_searchable), itemprop: 'publisher', link_to_search: solr_name("publisher", :facetable)
config.add_index_field solr_name("based_near_label", :stored_searchable), itemprop: 'contentLocation', link_to_search: solr_name("based_near_label", :facetable)
config.add_index_field solr_name("date_uploaded", :stored_sortable, type: :date), itemprop: 'datePublished', helper_method: :human_readable_date
config.add_index_field solr_name("date_modified", :stored_sortable, type: :date), itemprop: 'dateModified', helper_method: :human_readable_date
Expand All @@ -102,7 +100,6 @@ def self.modified_field
config.add_show_field solr_name("subject", :stored_searchable)
config.add_show_field solr_name("creator", :stored_searchable)
config.add_show_field solr_name("contributor", :stored_searchable)
config.add_show_field solr_name("publisher", :stored_searchable)
config.add_show_field solr_name("based_near_label", :stored_searchable)
config.add_show_field solr_name("language", :stored_searchable)
config.add_show_field solr_name("date_uploaded", :stored_searchable)
Expand Down Expand Up @@ -154,7 +151,7 @@ def self.modified_field
# Now we see how to over-ride Solr request handler defaults, in this
# case for a BL "search field", which is really a dismax aggregate
# of Solr search fields.
# creator, title, description, publisher, date_created,
# creator, title, description, 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.
Expand Down Expand Up @@ -195,14 +192,6 @@ def self.modified_field
}
end

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

config.add_search_field('date_created') do |field|
solr_name = solr_name("created", :stored_searchable)
field.solr_local_parameters = {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/datacite/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def initialize(configuration: Datacite::Configuration.instance,
# @return [#identifier] the registered metadata record
# @raise [Datacite::Connection::Error]
#
# @note required fields are: creators, publisher, publicationYear,
# @note required fields are: creators, publicationYear,
# resourceType, subjects, contributors, dates, language,
# alternateIdentifiers, relatedIdentifiers, sizes, formats, version,
# rightsList, descriptions, geoLocations; according to HTTP responses.
Expand Down
3 changes: 1 addition & 2 deletions app/lib/datacite/xml_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module Datacite
#
# @see https://support.datacite.org/v1.1/docs/mds-2p
class XmlBuilder
ATTRIBUTES = [:creators, :identifier, :publisher, :publication_year,
ATTRIBUTES = [:creators, :identifier, :publication_year,
:titles].freeze

##
Expand Down Expand Up @@ -73,7 +73,6 @@ def build
end
end

xml.publisher maybe(:publisher, status: UNAVAILABLE)
xml.publicationYear publication_year if publication_year

xml.resourceType RESOURCE_TYPE, resourceTypeGeneral: RESOURCE_TYPE_GENERAL
Expand Down
3 changes: 1 addition & 2 deletions app/lib/mahonia/citation_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def citation
Rails::Html::WhiteListSanitizer.new.sanitize(cite, tags: %w[i b br]).html_safe
rescue CiteProc::Error, TypeError, ArgumentError
cite = "#{object.creator.join(', ')}. #{object.title.first} " \
"(#{(object.date || []).first}). <i>Scholar Archive</i>. " \
"(#{(object.date || []).first})." \
"#{object.id}.#{' ' + doi if doi}\n#{url}"

Rails::Html::WhiteListSanitizer.new.sanitize(cite, tags: %w[i b br]).html_safe
Expand All @@ -57,7 +57,6 @@ def item
identifier: object.id,
author: object.creator,
issued: object.date,
'container-title': 'Scholar Archive',
DOI: doi,
internal_url: url)
end
Expand Down
3 changes: 1 addition & 2 deletions app/lib/mahonia/datacite_registrar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module Mahonia
class DataciteRegistrar < IdentifierRegistrar
IdentifierRecord =
Struct.new(:identifier, :creator, :publisher, :publication_year, :title)
Struct.new(:identifier, :creator, :publication_year, :title)

##
# @!attribute [rw] connection
Expand All @@ -23,7 +23,6 @@ def initialize(builder: Mahonia::IdentifierBuilder.new(prefix: prefix),
def record_for(object:)
IdentifierRecord.new(builder.build(hint: object.id),
object.try(:creator),
object.try(:publisher),
object.try(:date_uploaded).try(:year),
object.try(:title))
end
Expand Down
1 change: 0 additions & 1 deletion app/views/hyrax/base/_attribute_rows.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<%= presenter.attribute_to_html(:department, render_as: :faceted) %>
<%= presenter.attribute_to_html(:institution, render_as: :faceted) %>
<%= presenter.attribute_to_html(:school, render_as: :faceted) %>
<%= presenter.attribute_to_html(:publisher, render_as: :faceted) %>
<%= presenter.attribute_to_html(:language, render_as: :faceted) %>
<%= presenter.attribute_to_html(:identifier, render_as: :linked, search_field: 'identifier_tesim') %>
<%= presenter.attribute_to_html(:keyword, render_as: :faceted) %>
Expand Down
3 changes: 0 additions & 3 deletions config/locales/hyrax.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ de:
generic_type_sim: Art
keyword_sim: Stichwort
language_sim: Sprache
publisher_sim: Herausgeber
subject_sim: Fach
index:
based_near_tesim: Ort
Expand All @@ -24,7 +23,6 @@ de:
identifier_tesim: Identifikator
keyword_tesim: Stichwort
language_tesim: Sprache
publisher_tesim: Herausgeber
rights_tesim: Rechte
subject_tesim: Fach
show:
Expand All @@ -39,7 +37,6 @@ de:
identifier_tesim: Identifikator
keyword_tesim: Stichwort
language_tesim: Sprache
publisher_tesim: Herausgeber
rights_tesim: Rechte
subject_tesim: Fach
title_tesim: Titel
Expand Down
3 changes: 0 additions & 3 deletions config/locales/hyrax.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ en:
generic_type_sim: Type
keyword_sim: Keyword
language_sim: Language
publisher_sim: Publisher
subject_sim: Subject
degree_sim: Degree Name
rights_statement_sim: Rights
Expand All @@ -26,7 +25,6 @@ en:
identifier_tesim: Identifier
keyword_tesim: Keyword
language_tesim: Language
publisher_tesim: Publisher
rights_tesim: Rights
subject_tesim: Subject
degree_tesim: Degree Name
Expand All @@ -44,7 +42,6 @@ en:
identifier_tesim: Identifier
keyword_tesim: Keyword
language_tesim: Language
publisher_tesim: Publisher
rights_tesim: Rights
subject_tesim: Subject
title_tesim: Title
Expand Down
3 changes: 0 additions & 3 deletions config/locales/hyrax.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ es:
generic_type_sim: Tipo
keyword_sim: Palabra clave
language_sim: Idioma
publisher_sim: Editor
subject_sim: Tema
index:
based_near_tesim: Ubicación
Expand All @@ -24,7 +23,6 @@ es:
identifier_tesim: Identificador
keyword_tesim: Palabra clave
language_tesim: Idioma
publisher_tesim: Editor
rights_tesim: Derechos
subject_tesim: Tema
show:
Expand All @@ -39,7 +37,6 @@ es:
identifier_tesim: Identificador
keyword_tesim: Palabra clave
language_tesim: Idioma
publisher_tesim: Editor
rights_tesim: Derechos
subject_tesim: Tema
title_tesim: Título
Expand Down
3 changes: 0 additions & 3 deletions config/locales/hyrax.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ fr:
generic_type_sim: Type
keyword_sim: Mot-clé
language_sim: La langue
publisher_sim: Éditeur
subject_sim: Assujettir
index:
based_near_tesim: Emplacement
Expand All @@ -24,7 +23,6 @@ fr:
identifier_tesim: Identificateur
keyword_tesim: Mot-clé
language_tesim: La langue
publisher_tesim: Éditeur
rights_tesim: Droits
subject_tesim: Assujettir
show:
Expand All @@ -39,7 +37,6 @@ fr:
identifier_tesim: Identificateur
keyword_tesim: Mot-clé
language_tesim: La langue
publisher_tesim: Éditeur
rights_tesim: Droits
subject_tesim: Assujettir
title_tesim: Titre
Expand Down
3 changes: 0 additions & 3 deletions config/locales/hyrax.it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ it:
generic_type_sim: Tipo
keyword_sim: Parola chiave
language_sim: Lingua
publisher_sim: Editore
subject_sim: Soggetto
index:
based_near_tesim: luogo
Expand All @@ -24,7 +23,6 @@ it:
identifier_tesim: Identifier
keyword_tesim: Parola chiave
language_tesim: Lingua
publisher_tesim: Editore
rights_tesim: Diritti
subject_tesim: Soggetto
show:
Expand All @@ -39,7 +37,6 @@ it:
identifier_tesim: Identifier
keyword_tesim: Parola chiave
language_tesim: Lingua
publisher_tesim: Editore
rights_tesim: Diritti
subject_tesim: Soggetto
title_tesim: Titolo
Expand Down
3 changes: 0 additions & 3 deletions config/locales/hyrax.pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pt-BR:
generic_type_sim: Tipo
keyword_sim: Palavra-chave
language_sim: Língua
publisher_sim: Editor
subject_sim: Sujeito
index:
based_near_tesim: Localização
Expand All @@ -24,7 +23,6 @@ pt-BR:
identifier_tesim: Identificador
keyword_tesim: Palavra-chave
language_tesim: Língua
publisher_tesim: Editor
rights_tesim: Direitos
subject_tesim: Sujeito
show:
Expand All @@ -39,7 +37,6 @@ pt-BR:
identifier_tesim: Identificador
keyword_tesim: Palavra-chave
language_tesim: Língua
publisher_tesim: Editor
rights_tesim: Direitos
subject_tesim: Sujeito
title_tesim: Título
Expand Down
3 changes: 0 additions & 3 deletions config/locales/hyrax.zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ zh:
generic_type_sim: 类型
keyword_sim: 关键词
language_sim: 语言
publisher_sim: 出版者
subject_sim: 学科
index:
based_near_tesim: 位置
Expand All @@ -24,7 +23,6 @@ zh:
identifier_tesim: 识别码
keyword_tesim: 关键词
language_tesim: 语言
publisher_tesim: 出版者
rights_tesim:
subject_tesim: 学科
show:
Expand All @@ -39,7 +37,6 @@ zh:
identifier_tesim: 识别码
keyword_tesim: 关键词
language_tesim: 语言
publisher_tesim: 出版者
rights_tesim:
subject_tesim: 学科
title_tesim: 标题
Expand Down
2 changes: 0 additions & 2 deletions spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
'language',
'license',
'based_near_label',
'publisher',
'file_format',
'member_of_collections',
'generic_type',
Expand All @@ -45,7 +44,6 @@
'creator',
'title',
'description',
'publisher',
'date_created',
'subject',
'resource_type',
Expand Down
1 change: 0 additions & 1 deletion spec/factories/etds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
title ['Moomintroll']
creator ['Moomin', 'Hemulen']
date ['199?']
publisher ['A Publisher']
date_created [Date.parse('2016-12-25')]
date_label ['Winter in Moomin Valley']
date_modified DateTime.current
Expand Down
2 changes: 0 additions & 2 deletions spec/features/create_etd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
fill_in 'Description', with: etd[:description].first
# term for license URI set in factory
select('Creative Commons BY-SA Attribution-ShareAlike 4.0 International', from: 'License')
fill_in 'Publisher', with: etd[:publisher].first
fill_in 'Date Created', with: etd[:date_created].first
fill_in 'Subject', with: etd[:subject].first
fill_in 'Language', with: etd[:language].first
Expand Down Expand Up @@ -68,7 +67,6 @@
expect(page).to have_content etd[:description].first
# license
expect(page).to have_content 'Creative Commons BY-SA Attribution-ShareAlike 4.0 International'
expect(page).to have_content etd[:publisher].first
expect(page).to have_content etd[:subject].first
expect(page).to have_content etd[:language].first
# Identifier sets DOI
Expand Down
2 changes: 1 addition & 1 deletion spec/indexers/etd_indexer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
it 'has facetable fields' do
expect(indexer.rdf_service.stored_and_facetable_fields)
.to include(:date, :date_created, :date_label, :creator, :contributor,
:keyword, :subject, :language, :publisher, :rights_statement)
:keyword, :subject, :language, :rights_statement)
end
end
end
8 changes: 2 additions & 6 deletions spec/lib/mahonia/citation_formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
expect(formatter.citation).to include etd.date.first
end

it 'has the publisher' do
expect(formatter.citation).to include 'Scholar Archive'
it 'does not have the publisher' do
expect(formatter.citation).not_to include 'Scholar Archive'
end

it 'has the doi' do
Expand Down Expand Up @@ -70,10 +70,6 @@
expect(formatter.citation).to include etd.date.first
end

it 'has the publisher' do
expect(formatter.citation).to include 'Scholar Archive'
end

it 'has the doi' do
expect(formatter.citation).to include etd.identifier.first
end
Expand Down
1 change: 0 additions & 1 deletion spec/lib/mahonia/datacite_registrar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
let(:mapped_hash) do
{ identifier: doi,
creator: model.creator,
publisher: model.publisher,
publication_year: model.date_uploaded.year,
title: model.title }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"<identifier identifierType=\"DOI\">10.5072/moomin</identifier>\n " \
"<titles>\n <title>Comet in Moominland</title>\n </titles>\n " \
"<creators>\n <creator>\n <creatorName>:unav</creatorName>\n " \
"</creator>\n </creators>\n <publisher>:unav</publisher>\n " \
"</creator>\n </creators>\n" \
"<publicationYear>2017</publicationYear>\n " \
"<resourceType resourceTypeGeneral=\"Text\">Dissertation</resourceType>\n " \
"<version>4.0</version>\n</resource>\n",
Expand Down
Loading

0 comments on commit ac06724

Please sign in to comment.