From 576e03bb9d20d5fddd02a367c5587d37c7a09097 Mon Sep 17 00:00:00 2001
From: codycooperross <50597551+codycooperross@users.noreply.github.com>
Date: Fri, 8 Dec 2023 15:35:56 -0500
Subject: [PATCH] Citations may render the `container_title` as a hash in
citations for DOIs with citeproc type `article-journal` Fixes #182
---
lib/bolognese/metadata_utils.rb | 2 +-
spec/fixtures/datacite_journal_article.xml | 64 ++++++++++++++++++++++
spec/writers/citation_writer_spec.rb | 9 +++
3 files changed, 74 insertions(+), 1 deletion(-)
create mode 100644 spec/fixtures/datacite_journal_article.xml
diff --git a/lib/bolognese/metadata_utils.rb b/lib/bolognese/metadata_utils.rb
index bedd1589..08830d52 100644
--- a/lib/bolognese/metadata_utils.rb
+++ b/lib/bolognese/metadata_utils.rb
@@ -96,7 +96,7 @@ def container_title
if container.present?
container["title"]
elsif types["citeproc"] == "article-journal"
- publisher
+ publisher["name"] if publisher.present?
else
nil
end
diff --git a/spec/fixtures/datacite_journal_article.xml b/spec/fixtures/datacite_journal_article.xml
new file mode 100644
index 00000000..41aade44
--- /dev/null
+++ b/spec/fixtures/datacite_journal_article.xml
@@ -0,0 +1,64 @@
+
+
+ 10.60843/5EGY-VC42
+
+
+ Feldman, Heidi Li
+ Heidi Li
+ Feldman
+ https://orcid.org/0000-0003-1905-2698
+
+
+
+ Science and Uncertainty in Mass Exposure Litigation
+ Science and Uncertainty in Mass Exposure Litigation, 74 Tex. L. Rev. 1 (1995)
+
+ Texas Law Review
+ 1995
+ Article
+
+ FOS: Law
+
+
+
+ Georgetown Law Library
+
+ Georgetown University
+
+
+
+ 1995-11
+ 2016-04-25
+
+ en
+
+ 0040-4411
+
+
+
+ 0040-4411
+
+
+ University of Texas School of Law
+
+
+
+ Texas Law Review
+
+ 1995
+ 74
+ 1
+
+
+
+
+ text/html
+ application/pdf
+
+
+
+ Critics of the tort system have condemned courts for their alleged leniency in admitting scientific expert testimony, especially in mass exposure litigation. Claiming that this has resulted in an epidemic of "junk science" in the courtroom, these commentators have urged a more scientific approach to admissibility, intimating that employing more scientific standards would exclude scientific evidence favorable to plaintiffs, thereby demonstrating to factfinders that litigated substances are in fact safe or at least not unsafe.
+
+
\ No newline at end of file
diff --git a/spec/writers/citation_writer_spec.rb b/spec/writers/citation_writer_spec.rb
index 0973c3bb..b688e83f 100644
--- a/spec/writers/citation_writer_spec.rb
+++ b/spec/writers/citation_writer_spec.rb
@@ -48,5 +48,14 @@
expect(subject.locale).to eq("en-US")
expect(subject.citation).to eq("Clark, D. (2019). Exploring the \"Many analysts, one dataset\" project from COS. Gigantum, Inc. https://doi.org/10.34747/g6yb-3412")
end
+
+ it "journal article with container title" do
+ input = fixture_path + "datacite_journal_article.xml"
+ subject = Bolognese::Metadata.new(input: input, from: "datacite")
+ expect(subject.types["citeproc"]).to eq("article-journal")
+ expect(subject.style).to eq("apa")
+ expect(subject.locale).to eq("en-US")
+ expect(subject.citation).to eq('Feldman, H. L. (1995). Science and Uncertainty in Mass Exposure Litigation. Texas Law Review. https://doi.org/10.60843/5egy-vc42')
+ end
end
end