diff --git a/README.md b/README.md
index f2d47a1..6a92848 100644
--- a/README.md
+++ b/README.md
@@ -36,4 +36,32 @@ docker run -d --rm --init --ulimit core=0 -p 8070:8070 lfoppiano/grobid:latest-f
```
## Helpful task
-Export the metadata for a collection to CSV: `bin/rake "export_csv[druid:jk956kb4381]"`
\ No newline at end of file
+Export the metadata for a collection to CSV: `bin/rake "export_csv[druid:jk956kb4381]"`
+
+## Data model for an article
+```
+{
+ "title": STRING,
+ "authors": [
+ {
+ "first_name": STRING (REQUIRED - includes middle name, initials, etc.),
+ "last_name": STRING (REQUIRED),
+ "affiliations": [
+ "department": STRING,
+ "organization": STRING (REQUIRED)
+ ],
+ "orcid": STRING (for example, https://orcid.org/0000-0003-1527-0030)
+ }
+ ],
+ "abstract": STRING,
+ "keywords": [
+ {
+ value: STRING
+ }
+ ],
+ "related_resource_citation": STRING,
+ "related_resource_doi": STRING (for example, 10.5860/lrts.48n4.8259),
+ "published": BOOLEAN,
+ "collection_druid": STRING (for example, druid:jk956kb4381)
+}
+```
\ No newline at end of file
diff --git a/app/components/works/fallback_form_component.html.erb b/app/components/works/fallback_form_component.html.erb
index c214709..1248531 100644
--- a/app/components/works/fallback_form_component.html.erb
+++ b/app/components/works/fallback_form_component.html.erb
@@ -3,7 +3,7 @@
Provide a DOI or a citation here or manually complete the form below.
<%= form_with url: new_works_path, builder: ShroomFormBuilder, data: { controller: 'submits-with', action: 'submits-with#showStatus', turbo: false } do |form| %>
<%= form.hidden_field :work_file, value: work_file_id %>
- <%= form.hidden_field :preprint, value: preprint %>
+ <%= form.hidden_field :published, value: published %>
<%= form.bs_label :doi, 'DOI:', class: 'mt-2' %>
<%= form.bs_text_field :doi, class: 'form-control', pattern: 'https://doi.org/10.\d+/.+' %>
<%= form.bs_help_text 'For example: https://doi.org/10.1177/1940161218781254' %>
diff --git a/app/components/works/fallback_form_component.rb b/app/components/works/fallback_form_component.rb
index 5523ea9..2afc193 100644
--- a/app/components/works/fallback_form_component.rb
+++ b/app/components/works/fallback_form_component.rb
@@ -3,14 +3,14 @@
module Works
# Provides a fallback to provide a DOI or citation.
class FallbackFormComponent < ViewComponent::Base
- def initialize(work_form:, work_file_id:, preprint:)
+ def initialize(work_form:, work_file_id:, published:)
@work_form = work_form
@work_file_id = work_file_id
- @preprint = preprint
+ @published = published
super()
end
- attr_reader :work_form, :work_file_id, :preprint
+ attr_reader :work_form, :work_file_id, :published
def render?
work_form.title.blank? && work_file_id
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index 1ac0697..6ba9309 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -4,7 +4,7 @@
class FilesController < ApplicationController
def create
work_file = WorkFile.create!(file_params)
- redirect_to new_works_path(work_file:, doi: params[:doi], preprint: params[:preprint])
+ redirect_to new_works_path(work_file:, doi: params[:doi], published: params[:published])
end
private
diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb
index 86c029b..b17c5f3 100644
--- a/app/controllers/works_controller.rb
+++ b/app/controllers/works_controller.rb
@@ -77,28 +77,27 @@ def grobid_service
# rubocop:disable Metrics/AbcSize
def build_new_work_form(work_file:)
if params[:citation].present?
- grobid_service.from_citation(citation: params[:citation], preprint: preprint?)
+ grobid_service.from_citation(citation: params[:citation], published: published?)
elsif params[:doi].present?
- grobid_service.from_citation(citation: params[:doi], preprint: preprint?)
+ grobid_service.from_citation(citation: params[:doi], published: published?)
elsif params.key?(:work_file)
- grobid_service.from_file(path: work_file.path, preprint: preprint?)
+ grobid_service.from_file(path: work_file.path, published: published?)
else
- WorkForm.new(preprint: preprint?)
+ WorkForm.new(published: published?)
end
end
# rubocop:enable Metrics/AbcSize
- def preprint?
- params[:preprint] == 'true'
+ def published?
+ params[:published] == 'true'
end
def work_params
# Perhaps these can be introspected from the model?
params.require(:work).permit(
:title, :abstract, :publisher,
- :published_year, :published_month, :published_day,
- :related_resource_citation, :preprint, :collection_druid,
- :doi, :related_resource_doi,
+ :related_resource_citation, :published, :collection_druid,
+ :related_resource_doi,
authors_attributes: [
:first_name, :last_name, :orcid, { affiliations_attributes: %i[organization department] }
],
diff --git a/app/forms/base_form.rb b/app/forms/base_form.rb
index 3256194..0d3e736 100644
--- a/app/forms/base_form.rb
+++ b/app/forms/base_form.rb
@@ -5,7 +5,7 @@ class BaseForm
include ActiveModel::Model
include ActiveModel::Attributes
include ActiveModel::Validations::Callbacks
- include ActiveModel::Serialization
+ include ActiveModel::Serializers::JSON
def self.model_name
# Remove the "Form" suffix from the class name.
diff --git a/app/forms/work_form.rb b/app/forms/work_form.rb
index a1fbcc3..abdfd33 100644
--- a/app/forms/work_form.rb
+++ b/app/forms/work_form.rb
@@ -28,35 +28,6 @@ def authors_are_valid
attribute :abstract, :string
- # For a preprint, the published date is the date the preprint was published not the actual publication date.
- attribute :published_year, :integer
- validates :published_year, numericality: { only_integer: true, in: 1900..Date.current.year }, allow_nil: true
-
- attribute :published_month, :integer
- validates :published_month, numericality: { only_integer: true, in: 1..12 }, allow_nil: true
- validate :published_month_is_valid
-
- def published_month_is_valid
- errors.add(:published_month, 'requires a year') if published_year.blank? && published_month.present?
- end
-
- attribute :published_day, :integer
- validates :published_day, numericality: { only_integer: true, in: 1..31 }, allow_nil: true
- validate :published_day_is_valid
-
- def published_day_is_valid
- return unless (published_year.blank? || published_month.blank?) && published_day.present?
-
- errors.add(:published_day,
- 'requires a year and month')
- end
-
- # Preprints don't have publishers
- attribute :publisher, :string
-
- attribute :doi, :string
- validates :doi, format: { with: DoiSupport::REGEX }, allow_blank: true, unless: :preprint?
-
attribute :keywords, array: true, default: -> { [] }
before_validation do
keywords.compact_blank!
@@ -66,18 +37,18 @@ def keywords_attributes=(attributes)
self.keywords = attributes.map { |_, keyword| KeywordForm.new(keyword) }
end
- # Preprints have a single related resource.
+ # Published articles have a single related resource.
attribute :related_resource_citation, :string
- validates :related_resource_citation, presence: true, if: :preprint?
+ validates :related_resource_citation, presence: true, if: :published?
attribute :related_resource_doi, :string
- validates :related_resource_doi, format: { with: DoiSupport::REGEX }, allow_blank: true, if: :preprint?
+ validates :related_resource_doi, format: { with: DoiSupport::REGEX }, allow_blank: true, if: :published?
- attribute :preprint, :boolean, default: false
+ attribute :published, :boolean, default: false
attribute :collection_druid, :string
- def preprint?
- preprint || related_resource_citation.present?
+ def published?
+ published || related_resource_citation.present?
end
end
diff --git a/app/services/grobid_service.rb b/app/services/grobid_service.rb
index 2e546a8..0a5198a 100644
--- a/app/services/grobid_service.rb
+++ b/app/services/grobid_service.rb
@@ -13,23 +13,23 @@ def self.from_citation(...)
end
# @param [String] path the path to the PDF file
- # @param [Boolean] preprint whether the work is a preprint
+ # @param [Boolean] published whether the work is a published article
# @return [Work] a Work model with metadata extracted from the PDF
# @raise [Error] if there is an error extracting metadata from the PDF
- def from_file(path:, preprint: false)
+ def from_file(path:, published: false)
@tei = fetch_tei_from_file(path:)
- @bibtex = fetch_tei_from_file(path:, tei: false) if preprint
+ @bibtex = fetch_tei_from_file(path:, tei: false) if published
tei_to_work(tei:, bibtex:)
end
# @param [String] citation for the work
- # @param [Boolean] preprint whether the work is a preprint
+ # @param [Boolean] published whether the work is a published article
# @return [Work] a Work model with metadata extracted from the PDF
# @raise [Error] if there is an error extracting metadata from the PDF
- def from_citation(citation:, preprint: false)
+ def from_citation(citation:, published: false)
tei_fragment = fetch_tei_from_citation(citation:)
@tei = "#{tei_fragment}"
- @bibtex = fetch_tei_from_citation(citation:, tei: false) if preprint
+ @bibtex = fetch_tei_from_citation(citation:, tei: false) if published
tei_to_work(tei:, bibtex:)
end
diff --git a/app/services/tei_cocina_mapper_service.rb b/app/services/tei_cocina_mapper_service.rb
index 6dfba69..3038bc0 100644
--- a/app/services/tei_cocina_mapper_service.rb
+++ b/app/services/tei_cocina_mapper_service.rb
@@ -9,7 +9,7 @@ def self.call(...)
end
# @param [Nokogiri::XML::Document] tei_ng_xml
- # @param [String,nil] related_resource_citation citation for the article this is a preprint of
+ # @param [String,nil] related_resource_citation citation for the article this is a published of
def initialize(tei_ng_xml:, related_resource_citation: nil)
@tei_doc = TeiDocument.new(ng_xml: tei_ng_xml)
@related_resource_citation = related_resource_citation
@@ -40,9 +40,7 @@ def description_params
title: CocinaDescriptionSupport.title(title: tei_doc.title),
contributor: tei_doc.authors.map { |author_attrs| CocinaDescriptionSupport.person_contributor(**author_attrs) },
note: note_params,
- event: event_params,
subject: subject_params,
- identifier: identifier_params,
relatedResource: related_resource_params
}.compact
end
@@ -53,34 +51,14 @@ def note_params
[CocinaDescriptionSupport.note(type: 'abstract', value: tei_doc.abstract)]
end
- def event_params
- return [] if preprint? # If a preprint, these are likely to be for the related resource.
-
- [].tap do |params|
- if tei_doc.published_date.present?
- params << CocinaDescriptionSupport.event_date(date_type: 'publication',
- date_value: tei_doc.published_date)
- end
- if tei_doc.publisher.present?
- params << CocinaDescriptionSupport.event_contributor(contributor_name_value: tei_doc.publisher)
- end
- end
- end
-
def subject_params
return if tei_doc.keywords.blank?
CocinaDescriptionSupport.subjects(values: tei_doc.keywords)
end
- def identifier_params
- return if preprint? || tei_doc.doi.blank?
-
- [CocinaDescriptionSupport.doi_identifier(doi: tei_doc.doi)]
- end
-
def related_resource_params
- return unless preprint?
+ return unless published?
[
{
@@ -91,7 +69,7 @@ def related_resource_params
]
end
- def preprint?
+ def published?
related_resource_citation.present?
end
diff --git a/app/services/work_cocina_mapper_service/to_cocina/description_mapper.rb b/app/services/work_cocina_mapper_service/to_cocina/description_mapper.rb
index 8ef020d..3537f6c 100644
--- a/app/services/work_cocina_mapper_service/to_cocina/description_mapper.rb
+++ b/app/services/work_cocina_mapper_service/to_cocina/description_mapper.rb
@@ -35,9 +35,7 @@ def params
title: CocinaDescriptionSupport.title(title: work_form.title),
contributor: contributors_params.presence,
note: note_params.presence,
- event: event_params.presence,
subject: subject_params.presence,
- identifier: identifier_params,
purl: Sdr::Purl.from_druid(druid:),
relatedResource: related_resource_params
}.compact
@@ -69,29 +67,10 @@ def note_params
end
end
- # rubocop:disable Metrics/AbcSize
- def event_params
- [].tap do |params|
- date_value = EdtfSupport.to_edtf(year: work_form.published_year, month: work_form.published_month,
- day: work_form.published_day)
- params << CocinaDescriptionSupport.event_date(date_value:, date_type: 'publication') if date_value.present?
- if work_form.publisher.present?
- params << CocinaDescriptionSupport.event_contributor(contributor_name_value: work_form.publisher)
- end
- end
- end
- # rubocop:enable Metrics/AbcSize
-
def subject_params
CocinaDescriptionSupport.subjects(values: work_form.keywords.map(&:value))
end
- def identifier_params
- return if work_form.doi.blank?
-
- [CocinaDescriptionSupport.doi_identifier(doi: work_form.doi)]
- end
-
def related_resource_params
resource_params = {}.tap do |params|
if work_form.related_resource_citation.present?
diff --git a/app/services/work_cocina_mapper_service/to_work_mapper.rb b/app/services/work_cocina_mapper_service/to_work_mapper.rb
index 83b5acd..50b8c2c 100644
--- a/app/services/work_cocina_mapper_service/to_work_mapper.rb
+++ b/app/services/work_cocina_mapper_service/to_work_mapper.rb
@@ -19,48 +19,18 @@ def call
attr_reader :cocina_object
- # rubocop:disable Metrics/AbcSize
def params
{
title: CocinaSupport.title_for(cocina_object:),
authors: WorkCocinaMapperService::ToWork::AuthorsMapper.call(cocina_object:),
abstract: cocina_object.description.note.find { |note| note.type == 'abstract' }&.value,
- published_year: published_date&.year,
- published_month: EdtfSupport.month_for(edtf: published_date),
- published_day: EdtfSupport.day_for(edtf: published_date),
- publisher:,
keywords:,
- doi:,
related_resource_citation:,
related_resource_doi:,
collection_druid: CocinaSupport.collection_druid_for(cocina_object:)
}
end
- # rubocop:disable Metrics/CyclomaticComplexity
- # rubocop:disable Metrics/PerceivedComplexity
- def published_date
- @published_date ||= begin
- published_event = cocina_object.description.event.find do |event|
- event.type == 'deposit' \
- && event.date.first&.encoding&.code == 'edtf' \
- && event.date.first&.type == 'publication'
- end
- EdtfSupport.parse_with_precision(date: published_event&.date&.first&.value)
- end
- end
-
- def publisher
- publisher_event = cocina_object.description.event.find do |event|
- event.type == 'publication' \
- && event.contributor&.first&.role&.first&.value == 'publisher'
- end
- publisher_event&.contributor&.first&.name&.first&.value
- end
- # rubocop:enable Metrics/AbcSize
- # rubocop:enable Metrics/CyclomaticComplexity
- # rubocop:enable Metrics/PerceivedComplexity
-
def keywords
cocina_object.description.subject
.select { |subject| subject.type == 'topic' }
@@ -74,10 +44,6 @@ def related_resource_citation
note.value
end
- def doi
- doi_for(cocina_object.description)
- end
-
def related_resource_doi
doi_for(related_resource)
end
diff --git a/app/views/files/_new.html.erb b/app/views/files/_new.html.erb
index 73afe7a..924a585 100644
--- a/app/views/files/_new.html.erb
+++ b/app/views/files/_new.html.erb
@@ -1,11 +1,11 @@
<%= form_with url: files_path, builder: ShroomFormBuilder, data: { controller: 'submits-with', action: 'submits-with#showStatus' } do |form| %>
- <%= form.bs_radio_button :preprint, 'false', required: true %>
- <%= form.bs_radio_label :preprint_false, 'This is an article or manuscript (published or unpublished).' %>
+ <%= form.bs_radio_button :published, 'true', required: true %>
+ <%= form.bs_radio_label :published_true, 'This is a preprint or copy of an article / manuscript that is forthcoming or has been published elsewhere.' %>
- <%= form.bs_radio_button :preprint, 'true', required: true %>
- <%= form.bs_radio_label :preprint_true, 'This is a preprint of an article (forthcoming or published).' %>
+ <%= form.bs_radio_button :published, 'false', required: true %>
+ <%= form.bs_radio_label :published_false, 'This is an article / manuscript that will only be published in SDR or has not been submitted and / or accepted for publication.' %>
<%= form.bs_label :file, 'Upload article:', class: 'mt-2' %>
<%= form.file_field :file, required: true, accept: 'application/pdf', class: 'form-control', direct_upload: true %>
diff --git a/app/views/works/_form.html.erb b/app/views/works/_form.html.erb
index 097abf8..01fb5cc 100644
--- a/app/views/works/_form.html.erb
+++ b/app/views/works/_form.html.erb
@@ -8,41 +8,13 @@
<%= render NestedFormComponent.new(form:, model_class: AuthorForm, field: :authors, form_component: Works::AuthorFormComponent) %>
-
-
- <%= form.bs_label :published_year %>
- <%= form.bs_text_field :published_year %>
- <%= form.bs_invalid_feedback :published_year %>
-
-
- <%= form.bs_label :published_month %>
- <%= form.bs_text_field :published_month %>
- <%= form.bs_invalid_feedback :published_month %>
-
-
- <%= form.bs_label :published_day %>
- <%= form.bs_text_field :published_day %>
- <%= form.bs_invalid_feedback :published_day %>
-
-
- <% if !work_form.preprint? %>
- <%= form.bs_label :doi, 'DOI', class: 'mt-2' %>
- <%= form.bs_text_field :doi %>
- For example, 10.5860/lrts.48n4.8259.
- <%= form.bs_invalid_feedback :doi %>
-
- <%= form.bs_label :publisher, class: 'mt-2' %>
- <%= form.bs_text_field :publisher %>
- <%= form.bs_invalid_feedback :publisher %>
- <% end %>
-
<%= form.bs_label :abstract, class: 'mt-2' %>
<%= form.bs_text_area :abstract, rows: 6 %>
<%= form.bs_invalid_feedback :abstract %>
<%= render Works::KeywordsFormComponent.new(form:) %>
- <% if work_form.preprint? %>
+ <% if work_form.published? %>
<%= form.bs_label :related_resource_citation %>
<%= form.bs_text_area :related_resource_citation, rows: 4 %>
<%= form.bs_help_text 'This is the citation for the published or forthcoming article.' %>
@@ -53,7 +25,7 @@
<%= form.bs_invalid_feedback :related_resource_doi %>
This is the DOI for the published or forthcoming article. For example, 10.5860/lrts.48n4.8259.
- <%= form.hidden_field :preprint, value: true %>
+ <%= form.hidden_field :published, value: true %>
<% end %>
diff --git a/app/views/works/new.html.erb b/app/views/works/new.html.erb
index 6a66460..e82b255 100644
--- a/app/views/works/new.html.erb
+++ b/app/views/works/new.html.erb
@@ -5,7 +5,7 @@
-<%= render Works::FallbackFormComponent.new(work_form: @work_form, work_file_id: params[:work_file], preprint: params[:preprint]) %>
+<%= render Works::FallbackFormComponent.new(work_form: @work_form, work_file_id: params[:work_file], published: params[:published]) %>
<%= render FormLayoutComponent.new(work_file: @work_file) do |component| %>
<% component.with_form do %>
diff --git a/spec/forms/work_form_spec.rb b/spec/forms/work_form_spec.rb
index 3aa6490..ca44625 100644
--- a/spec/forms/work_form_spec.rb
+++ b/spec/forms/work_form_spec.rb
@@ -7,17 +7,11 @@
let(:work) do
described_class.new(
title:,
- published_year:,
- published_month:,
- published_day:,
authors:
)
end
let(:title) { 'A Circulation Analysis Of Print Books And e-Books In An Academic Research Library' }
- let(:published_year) { 2004 }
- let(:published_month) { 10 }
- let(:published_day) { 1 }
let(:authors) { [] }
context 'when title is not present' do
@@ -29,60 +23,6 @@
end
end
- context 'when publication year is out of range' do
- let(:published_year) { 1899 }
-
- it 'is invalid' do
- expect(work).not_to be_valid
- expect(work.errors[:published_year]).to include("must be in 1900..#{Date.current.year}")
- end
- end
-
- context 'when publication month is out of range' do
- let(:published_month) { 13 }
-
- it 'is invalid' do
- expect(work).not_to be_valid
- expect(work.errors[:published_month]).to include('must be in 1..12')
- end
- end
-
- context 'when publication day is out of range' do
- let(:published_day) { 32 }
-
- it 'is invalid' do
- expect(work).not_to be_valid
- expect(work.errors[:published_day]).to include('must be in 1..31')
- end
- end
-
- context 'when publication month is present but year is blank' do
- let(:published_year) { nil }
-
- it 'is invalid' do
- expect(work).not_to be_valid
- expect(work.errors[:published_month]).to include('requires a year')
- end
- end
-
- context 'when publication day is present but year is blank' do
- let(:published_year) { nil }
-
- it 'is invalid' do
- expect(work).not_to be_valid
- expect(work.errors[:published_day]).to include('requires a year and month')
- end
- end
-
- context 'when publication day is present but month is blank' do
- let(:published_month) { nil }
-
- it 'is invalid' do
- expect(work).not_to be_valid
- expect(work.errors[:published_day]).to include('requires a year and month')
- end
- end
-
context 'when author is invalid' do
let(:authors) { [AuthorForm.new(first_name: 'Justin')] }
diff --git a/spec/services/grobid_service_spec.rb b/spec/services/grobid_service_spec.rb
index 89ae64a..d85181f 100644
--- a/spec/services/grobid_service_spec.rb
+++ b/spec/services/grobid_service_spec.rb
@@ -4,9 +4,9 @@
RSpec.describe GrobidService do
describe '.from_file' do
- subject(:work) { described_class.from_file(path: 'spec/fixtures/files/preprint.pdf', preprint:) }
+ subject(:work) { described_class.from_file(path: 'spec/fixtures/files/preprint.pdf', published:) }
- let(:preprint) { false }
+ let(:published) { false }
context 'when successful response' do
before do
@@ -43,7 +43,7 @@
end
context 'when preprint' do
- let(:preprint) { true }
+ let(:published) { true }
before do
stub_request(:post, 'http://localhost:8070/api/processHeaderDocument')
diff --git a/spec/services/tei_cocina_mapper_service_spec.rb b/spec/services/tei_cocina_mapper_service_spec.rb
index 60b54fd..29167e3 100644
--- a/spec/services/tei_cocina_mapper_service_spec.rb
+++ b/spec/services/tei_cocina_mapper_service_spec.rb
@@ -31,13 +31,7 @@
CocinaDescriptionSupport.note(type: 'abstract',
value: 'In order for collection development librarians to justify the adoption of electronic books ...') # rubocop:disable Layout/LineLength
],
- event: [
- CocinaDescriptionSupport.event_date(date_type: 'publication',
- date_value: '2004-10-01'),
- CocinaDescriptionSupport.event_contributor(contributor_name_value: 'American Library Association')
- ],
- subject: CocinaDescriptionSupport.subjects(values: ['Electronic books', 'Academic libraries']),
- identifier: [CocinaDescriptionSupport.doi_identifier(doi: doi_fixture)]
+ subject: CocinaDescriptionSupport.subjects(values: ['Electronic books', 'Academic libraries'])
},
version: 1,
@@ -119,14 +113,6 @@
CocinaDescriptionSupport.person_contributor(forename: 'Justin',
surname: 'Littman',
orcid: 'https://orcid.org/0000-0003-1527-0030')
- ],
- event: [
- CocinaDescriptionSupport.event_date(date_type: 'publication',
- date_value: '2018-06-24'),
- CocinaDescriptionSupport.event_contributor(contributor_name_value: 'SAGE Publications')
- ],
- identifier: [
- CocinaDescriptionSupport.doi_identifier(doi: '10.1177/1940161218781254')
]
},
version: 1,
diff --git a/spec/services/work_cocina_mapper_service/to_cocina_mapper_spec.rb b/spec/services/work_cocina_mapper_service/to_cocina_mapper_spec.rb
index 50bbcf9..2019035 100644
--- a/spec/services/work_cocina_mapper_service/to_cocina_mapper_spec.rb
+++ b/spec/services/work_cocina_mapper_service/to_cocina_mapper_spec.rb
@@ -14,11 +14,6 @@
title: title_fixture,
authors: [author1, author2],
abstract: abstract_fixture,
- published_year: 2004,
- published_month: 10,
- published_day: 1,
- publisher: 'American Library Association',
- doi: doi_fixture,
keywords: [
KeywordForm.new(value: 'Electronic books'),
KeywordForm.new(value: 'Academic libraries')
diff --git a/spec/services/work_cocina_mapper_service/to_work_mapper_spec.rb b/spec/services/work_cocina_mapper_service/to_work_mapper_spec.rb
index c9a463e..45930c0 100644
--- a/spec/services/work_cocina_mapper_service/to_work_mapper_spec.rb
+++ b/spec/services/work_cocina_mapper_service/to_work_mapper_spec.rb
@@ -24,11 +24,6 @@
title: title_fixture,
authors: [author1, author2],
abstract: abstract_fixture,
- published_year: 2004,
- published_month: 10,
- published_day: 1,
- publisher: 'American Library Association',
- doi: doi_fixture,
keywords: [
KeywordForm.new(value: 'Electronic books'),
KeywordForm.new(value: 'Academic libraries')
@@ -42,24 +37,5 @@
it 'maps to work' do
expect(work).to equal_work expected
end
-
- context 'when published year only' do
- let(:cocina_object) { create_request_dro.new(description:) }
- let(:description) do
- {
- title: CocinaDescriptionSupport.title(title: title_fixture),
- event: [
- CocinaDescriptionSupport.event_date(date_type: 'publication',
- date_value: '2004')
- ]
- }
- end
-
- it 'maps to work' do
- expect(work.published_year).to eq 2004
- expect(work.published_month).to be_nil
- expect(work.published_day).to be_nil
- end
- end
end
end
diff --git a/spec/support/cocina_factory.rb b/spec/support/cocina_factory.rb
index d01ed42..e3c0a72 100644
--- a/spec/support/cocina_factory.rb
+++ b/spec/support/cocina_factory.rb
@@ -23,13 +23,7 @@ def create_request_dro
surname: 'Connaway')
],
note: [CocinaDescriptionSupport.note(type: 'abstract', value: abstract_fixture)],
- event: [
- CocinaDescriptionSupport.event_date(date_type: 'publication',
- date_value: '2004-10-01'),
- CocinaDescriptionSupport.event_contributor(contributor_name_value: 'American Library Association')
- ],
subject: CocinaDescriptionSupport.subjects(values: ['Electronic books', 'Academic libraries']),
- identifier: [CocinaDescriptionSupport.doi_identifier(doi: doi_fixture)],
relatedResource: [
{
identifier: [CocinaDescriptionSupport.doi_identifier(doi: doi_fixture)],
@@ -69,13 +63,7 @@ def create_dro
surname: 'Connaway')
],
note: [CocinaDescriptionSupport.note(type: 'abstract', value: abstract_fixture)],
- event: [
- CocinaDescriptionSupport.event_date(date_type: 'publication',
- date_value: '2004-10-01'),
- CocinaDescriptionSupport.event_contributor(contributor_name_value: 'American Library Association')
- ],
subject: CocinaDescriptionSupport.subjects(values: ['Electronic books', 'Academic libraries']),
- identifier: [CocinaDescriptionSupport.doi_identifier(doi: doi_fixture)],
relatedResource: [
{
identifier: [CocinaDescriptionSupport.doi_identifier(doi: doi_fixture)],