{"action":"closed","issue":{"url":"https://api.github.com/repos/lcnetdev/marc2bibframe/issues/241","labels_url":"https://api.github.com/repos/lcnetdev/marc2bibframe/issues/241/labels{/name}","comments_url":"https://api.github.com/repos/lcnetdev/marc2bibframe/issues/241/comments","events_url":"https://api.github.com/repos/lcnetdev/marc2bibframe/issues/241/events","html_url":"https://github.com/lcnetdev/marc2bibframe/issues/241","id":64836186,"number":241,"title":"Converter error on certain types of title subfields","user":{"login":"rjyounes","id":1693668,"avatar_url":"https://avatars.githubusercontent.com/u/1693668?v=3","gravatar_id":"","url":"https://api.github.com/users/rjyounes","html_url":"https://github.com/rjyounes","followers_url":"https://api.github.com/users/rjyounes/followers","following_url":"https://api.github.com/users/rjyounes/following{/other_user}","gists_url":"https://api.github.com/users/rjyounes/gists{/gist_id}","starred_url":"https://api.github.com/users/rjyounes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjyounes/subscriptions","organizations_url":"https://api.github.com/users/rjyounes/orgs","repos_url":"https://api.github.com/users/rjyounes/repos","events_url":"https://api.github.com/users/rjyounes/events{/privacy}","received_events_url":"https://api.github.com/users/rjyounes/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-27T19:29:31Z","updated_at":"2015-07-23T14:43:55Z","closed_at":"2015-07-23T14:43:55Z","body":"The converter throws an error and terminates when a title field has a subfield a containing the character '=' and no subfield b. The error message is:\r\n\r\nError on line 3566 of module.MBIB-2-BIBFRAME-Shared.xqy:\r\n  XPTY0004: An empty sequence is not allowed as the first argument of\r\n  marc2bfutils:clean-title-string()\r\n  at mbshared:get-title() (file:/Users/rjy7/Workspace/marc2bibframe/modules/module.MBIB-2-BIBFRAME-Shared.xqy#2592)\r\n  at bfdefault:generate-default-work() (file:/Users/rjy7/Workspace/marc2bibframe/modules/module.MARCXMLBIB-2-BIBFRAME.xqy#92)\r\n  at marcbib2bibframe:marcbib2bibframe() \r\nQuery processing failed: Run-time errors were reported\r\n\r\nI've traced the error to the following code starting at line 3474 of marc2bibframe/modules/module.MBIB-2-BIBFRAME-Shared.xqy, where subfield b is assumed to exist when subfield a contains an equals sign:\r\n  let $parallel:= if (fn:contains(fn:string($d/marcxml:subfield[@code=\"a\"]),\"=\")) then\r\n                    element   {$element-name} {   element bf:Title { \r\n                    element bf:titleValue {fn:normalize-space(marc2bfutils:clean-title-string($d/marcxml:subfield[@code=\"b\"]))},\r\n                    element bf:titleType {\"parallel\"}\r\n                    }\r\n                    }\r\n\r\n\r\nI don't know whether this is bad cataloging practice or not, but the CUL catalog does contain such a subfields without the expected subfield b (19 records in the first 50,000). In general, the expected contents of subfield b are contained in subfield a:\r\n\r\n    <datafield tag=\"245\" ind1=\"0\" ind2=\"0\">\r\n      <subfield code=\"a\">Tours in East Kalimantan = Perjalanan wisata ke Kalimantan Timur.</subfield>\r\n    </datafield>\r\n\r\nAfter adding subfield b the error was gone. In these cases, you could put the contents following '=' into the subtitle. \r\n\r\nHowever, there are cases with two equals signs in subfield a:\r\n\r\n    <datafield tag=\"246\" ind1=\"1\" ind2=\" \">\r\n      <subfield code=\"a\">Education en Roumanie = Education in Romania = Erziehung in Rumänien</subfield>\r\n    </datafield>\r\n\r\nAnd other cases where the equals sign actually functions as an equals sign:\r\n\r\n    <datafield tag=\"245\" ind1=\"1\" ind2=\"0\">\r\n      <subfield code=\"a\">Tables of orthogonal polynomial values extended to N=104,</subfield>\r\n   </datafield>\r\n\r\n    <datafield tag=\"245\" ind1=\"1\" ind2=\"0\">\r\n      <subfield code=\"a\">Tables of inviscid supersonic flow about circular cones at incidence, [gamma] = 1.4,</subfield>\r\n   </datafield>\r\n\r\nThere are similar cases of a subfield a containing an equals sign without a subfield b for non-title fields - specifically in this 50,000-record sample, fields 490, 500, and 505:\r\n\r\n    <datafield tag=\"490\" ind1=\"1\" ind2=\" \">\r\n      <subfield code=\"a\">Meteorologii︠a︡ i Okeanologii︠a︡ = Meteorology and oceanology ;</subfield>\r\n      <subfield code=\"v\">no. 7, 12</subfield>\r\n\r\n    <datafield tag=\"500\" ind1=\" \" ind2=\" \">\r\n      <subfield code=\"a\">On cover: Mezhduvedomstvennyĭ geofizicheskiĭ komitet pri Prezidiume Akademii nauk SSSR = Academy of Sciences of the USSR, Soviet Geophysical Committee.</subfield>\r\n    </datafield>\r\n\r\n    <datafield tag=\"505\" ind1=\"0\" ind2=\" \">\r\n      <subfield code=\"a\">Branche I. Um Karlamagnús konung = Vie de Charlemagne -- Branche III. Oddgeirs þáttr danska = Les enfances d'Ogier le Danois -- Branche VII. Jórsalaferð = Pèlerinage de Charlemagne -- Branche IX. Af Vilhjálmi korneis = Guillaume au Court Nez.</subfield>\r\n    </datafield>\r\n\r\nThese don't cause similar errors, even in the 490 field which gets converted to a work title.\r\n\r\nI can supply full versions of the records if desired. \r\n\r\nRebecca Younes\r\n\r\n"}}