Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Holdings error fix #105

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

dbwwei
Copy link
Contributor

@dbwwei dbwwei commented Nov 15, 2024

Fixed a bug in availability_response.rb to handle empty/nill key or content; added respective tests to multiple_bibs.json.

@@ -70,7 +70,7 @@
"desc": "Default Level"
},
"anies": [
"<?xml version=\"1.0\" encoding=\"UTF-16\"?>\n<record><leader>01940pam a2200397 i 4500</leader><controlfield tag=\"001\">991036880906903811</controlfield><controlfield tag=\"005\">20180302101358.0</controlfield><controlfield tag=\"008\">170926t20192019caua bf 001 0 eng </controlfield><datafield ind1=\" \" ind2=\" \" tag=\"010\"><subfield code=\"a\"> 2017038401</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"020\"><subfield code=\"a\">9781506344744</subfield><subfield code=\"q\">(pbk. : alk. paper)</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"020\"><subfield code=\"a\">1506344747</subfield><subfield code=\"q\">(pbk. : alk. paper)</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"035\"><subfield code=\"a\">(OCoLC)935193850</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"040\"><subfield code=\"a\">DLC</subfield><subfield code=\"b\">eng</subfield><subfield code=\"e\">rda</subfield><subfield code=\"c\">DLC</subfield><subfield code=\"d\">OCLCO</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"042\"><subfield code=\"a\">pcc</subfield></datafield><datafield ind1=\"0\" ind2=\"0\" tag=\"050\"><subfield code=\"a\">PN4775</subfield><subfield code=\"b\">.F45 2019</subfield></datafield><datafield ind1=\"0\" ind2=\"0\" tag=\"082\"><subfield code=\"a\">808.06/607</subfield><subfield code=\"2\">23</subfield></datafield><datafield ind1=\"1\" ind2=\" \" tag=\"100\"><subfield code=\"a\">Filak, Vincent F.,</subfield><subfield code=\"e\">author.</subfield></datafield><datafield ind1=\"1\" ind2=\"0\" tag=\"245\"><subfield code=\"a\">Dynamics of news reporting and writing :</subfield><subfield code=\"b\">foundational skills for a digital age /</subfield><subfield code=\"c\">Vincent F. Filak (University of Wisconsin-Oshkosh).</subfield></datafield><datafield ind1=\" \" ind2=\"1\" tag=\"264\"><subfield code=\"a\">Thousand Oaks, California :</subfield><subfield code=\"b\">CQ Press, a division of SAGE Publications, Inc.,</subfield><subfield code=\"c\">[2019]</subfield></datafield><datafield ind1=\" \" ind2=\"4\" tag=\"264\"><subfield code=\"c\">©2019</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"300\"><subfield code=\"a\">xxi, 316 pages :</subfield><subfield code=\"b\">color illustrations ;</subfield><subfield code=\"c\">26 cm</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"336\"><subfield code=\"a\">text</subfield><subfield code=\"b\">txt</subfield><subfield code=\"2\">rdacontent</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"337\"><subfield code=\"a\">unmediated</subfield><subfield code=\"b\">n</subfield><subfield code=\"2\">rdamedia</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"338\"><subfield code=\"a\">volume</subfield><subfield code=\"b\">nc</subfield><subfield code=\"2\">rdacarrier</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"504\"><subfield code=\"a\">Includes bibliographical references (pages 298-302) and index.</subfield></datafield><datafield ind1=\"0\" ind2=\" \" tag=\"505\"><subfield code=\"a\">Audience-centric journalism -- Critical thinking -- Basics of writing -- Expanded news writing -- Social media -- Interviewing -- Basic reporting: news that finds you -- Beyond basic reporting: news you have to find -- Broadcast-style writing and voicing -- Collecting audio and visuals in the field -- Editing audio and video -- Law and the media -- Ethics.</subfield></datafield><datafield ind1=\" \" ind2=\"0\" tag=\"650\"><subfield code=\"a\">Journalism</subfield><subfield code=\"v\">Handbooks, manuals, etc.</subfield></datafield><datafield ind1=\" \" ind2=\"0\" tag=\"650\"><subfield code=\"a\">Journalism</subfield><subfield code=\"x\">Authorship</subfield><subfield code=\"v\">Handbooks, manuals, etc.</subfield></datafield><datafield ind1=\" \" ind2=\"0\" tag=\"650\"><subfield code=\"a\">Broadcast journalism</subfield><subfield code=\"x\">Authorship</subfield><subfield code=\"v\">Handbooks, manuals, etc.</subfield></datafield><datafield ind1=\" \" ind2=\"0\" tag=\"650\"><subfield code=\"a\">Online journalism</subfield><subfield code=\"x\">Authorship</subfield><subfield code=\"v\">Handbooks, manuals, etc.</subfield></datafield><datafield ind1=\" \" ind2=\"1\" tag=\"945\"><subfield code=\"i\">39074026732875</subfield><subfield code=\"k\">MAIN</subfield><subfield code=\"l\">stacks</subfield><subfield code=\"a\">PN4775</subfield><subfield code=\"b\">.F45 2019</subfield><subfield code=\"z\">090</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"960\"><subfield code=\"k\">MAIN</subfield><subfield code=\"l\">stacks</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"979\"><subfield code=\"a\">(OCoLC)935193850</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"980\"><subfield code=\"a\">02-07-18</subfield><subfield code=\"b\">9500</subfield><subfield code=\"e\">7647</subfield><subfield code=\"f\">I20108006</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"981\"><subfield code=\"a\">Coutt</subfield><subfield code=\"b\">ctssa</subfield><subfield code=\"d\">33587890</subfield><subfield code=\"e\">SLI</subfield><subfield code=\"k\">MAIN</subfield><subfield code=\"l\">stacks</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"997\"><subfield code=\"a\">20180220</subfield><subfield code=\"d\">TEU</subfield><subfield code=\"c\">COUTTS SR</subfield><subfield code=\"e\">MARCIVE</subfield><subfield code=\"e\">WCAT</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"INT\"><subfield code=\"a\">P</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"INST\"><subfield code=\"a\">01TULI_INST</subfield></datafield><datafield ind1=\" \" ind2=\" \" tag=\"AVA\"><subfield code=\"0\">991036880906903811</subfield><subfield code=\"8\">22413618700003811</subfield><subfield code=\"a\">01TULI_INST</subfield><subfield code=\"b\">MAIN</subfield><subfield code=\"c\">Stacks</subfield><subfield code=\"d\">PN4775 .F45 2019</subfield><subfield code=\"e\">available</subfield><subfield code=\"f\">1</subfield><subfield code=\"g\">0</subfield><subfield code=\"i\">m</subfield><subfield code=\"j\">stacks</subfield><subfield code=\"k\">0</subfield><subfield code=\"p\">1</subfield><subfield code=\"q\">Paley Library</subfield><subfield code=\"t\">holding-1</subfield><subfield code=\"t\">holding-2</subfield><subfield code=\"t\">holding-3</subfield></datafield></record>"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these nill subfield values supposed to evaluate to a nil value when parsed?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't run this code, but I suspect another approach is needed to ensure that actual nil values are properly handled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically two questions: if the code is empty, or not defined, shall it be ignored? if the content is empty, shall it be ignored?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@dbwwei dbwwei Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the record the causes problem: there are four cases of: {"code"=>"t"}. Without the "content", they will cause error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants