Bug 19616

Summary: Add MARC21 505$g - Formatted Contents Note / Miscellaneous information
Product: Koha Reporter: verolencinas <verolencinas>
Component: OPACAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi (tcohen) <tomascohen>
Severity: enhancement    
Priority: P5 - low CC: lucas, martin.renvoize, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29455
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00
Circulation function:
Bug Depends on:    
Bug Blocks: 28703, 29455, 35675    
Attachments: Example
Bug 19616: Add MARC21 505$g - Formatted Contents Note / Miscellaneous informatoin
Bug 19616: (follow-up) Reindent XSLT code used for 505 display
Bug 19616: (follow-up) Breaking items according to punctuation
Bug 19616: Add MARC21 505$g - Formatted Contents Note / Miscellaneous informatoin
Bug 19616: (follow-up) Reindent XSLT code used for 505 display
Bug 19616: (follow-up) Breaking items according to punctuation
Bug 19616: Add MARC21 505$g - Formatted Contents Note / Miscellaneous informatoin
Bug 19616: (follow-up) Reindent XSLT code used for 505 display
Bug 19616: (follow-up) Breaking items according to punctuation

Description verolencinas 2017-11-13 14:51:51 UTC
The 505 field in Marc 21, Formatted Contents Note, includes subfield g "Miscellaneous information". According to the Marc 21 format for bibliographic data, it is used to record "volume, part, page numbering or other extent information such as dates". If you use it in Koha, this information isn't visible in the OPAC.
Comment 1 verolencinas 2018-11-30 16:00:15 UTC
Created attachment 82798 [details]
Example

Example file in MARC21 format (in spanish)
Comment 2 verolencinas 2018-11-30 16:05:32 UTC
OPAC View (incomplete from example file):
Contenidos:
-> Universidad Nacional de Córdoba / Jorge B. Pilcher. Facultad de Derecho.
-> [Estudiantes en el remate del portal del rectorado de la UNC].
-> Claustro Universidad Nacional de Córdoba / Jorge B. Pilcher.
-> Interior Universidad Nacional de Córdoba / Jorge B. Pilcher.
-> Salón de Grados de la Universidad / Santiago Troisi.
...

Should be viewed as
Contenidos:
-> Postales: 1/46. Universidad Nacional de Córdoba / Jorge B. Pilcher. [1880?].
-> 2/46. Facultad de Derecho. [1905?].
-> 3/46. [Estudiantes en el remate del portal del rectorado de la UNC]. [1918].
-> 4/46. Claustro Universidad Nacional de Córdoba / Jorge B. Pilcher. [1880?].
-> 5/46. Interior Universidad Nacional de Córdoba / Jorge B. Pilcher. [1880?].
-> 6/46. Salón de Grados de la Universidad / Santiago Troisi. 1903.
Comment 3 Tomás Cohen Arazi (tcohen) 2020-03-13 11:50:18 UTC
(In reply to verolencinas from comment #0)
> The 505 field in Marc 21, Formatted Contents Note, includes subfield g
> "Miscellaneous information". According to the Marc 21 format for
> bibliographic data, it is used to record "volume, part, page numbering or
> other extent information such as dates". If you use it in Koha, this
> information isn't visible in the OPAC.

Verónica, this should be dependent on ind2=0, right? What about $u?
Comment 4 Katrin Fischer 2020-09-13 22:47:48 UTC
Created attachment 110027 [details] [review]
Bug 19616: Add MARC21 505$g - Formatted Contents Note / Miscellaneous informatoin

This adds the subfield $g to the display of the 505 field in
staff and OPAC detail pages.

To test:
- Catalog some records using variations of 505
  Examples can be found in the LOC documentation:
  https://www.loc.gov/marc/bibliographic/bd505.html
- Verify that the display in staff and OPAC is still nice
  and now includes $g
Comment 5 Katrin Fischer 2020-09-13 22:47:53 UTC
Created attachment 110028 [details] [review]
Bug 19616: (follow-up) Reindent XSLT code used for 505 display

Also adds a note at the beginning of the code block.
This causes no functional change, just code clean-up.
Comment 6 Katrin Fischer 2020-09-13 22:51:28 UTC
This doesn't quite work yet, behaviour of line breaks needs to be changed.
Comment 7 Katrin Fischer 2020-09-13 23:38:06 UTC
Created attachment 110029 [details] [review]
Bug 19616: (follow-up) Breaking items according to punctuation

Previously the code assumed that $t indicates a new line in the
listing. But this is not true. The standard tells us that -- or
.-- will indicate a new item.

"In records formulated according to AACR 2, a space-hyphen-hyphen-space
( -- ) is recorded between each item in the contents note unless a
delimiter/subfield code follows in which case there is no ending space.
In pre-AACR 2 records, items are separated by a period-hyphen-hyphen (.--)."

The previous logic did no longer work with $g added. From the LOC
examples:

This would work:
505 2 0 $tBaptisms, 1816-1872 --$tChurch members, 1816-1831 --$tHistory of the Second Presbyterian Church of West Durham /$rby L. H. Fellows.
505 0 0 $tQuatrain II$g(16:35) --$tWater ways$g(1:57) --$tWaves$g(10:49).

This wouldn't:
505 1 0 $gNr. 1.$tRegion Neusiedlersee --$gNr. 2.$tRegion Rosalia/Lithagebirge --$gNr. 3.$tRegion Mettelburgenland --$gNr. 4.$tRegion südliches Burgenland --$gNr. 5.$tRegion Südburgland

With the patches applied, all examples should display nicely now.
Comment 8 Martin Renvoize (ashimema) 2020-09-16 15:17:31 UTC
Created attachment 110215 [details] [review]
Bug 19616: Add MARC21 505$g - Formatted Contents Note / Miscellaneous informatoin

This adds the subfield $g to the display of the 505 field in
staff and OPAC detail pages.

To test:
- Catalog some records using variations of 505
  Examples can be found in the LOC documentation:
  https://www.loc.gov/marc/bibliographic/bd505.html
- Verify that the display in staff and OPAC is still nice
  and now includes $g

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize (ashimema) 2020-09-16 15:17:36 UTC
Created attachment 110216 [details] [review]
Bug 19616: (follow-up) Reindent XSLT code used for 505 display

Also adds a note at the beginning of the code block.
This causes no functional change, just code clean-up.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize (ashimema) 2020-09-16 15:17:41 UTC
Created attachment 110217 [details] [review]
Bug 19616: (follow-up) Breaking items according to punctuation

Previously the code assumed that $t indicates a new line in the
listing. But this is not true. The standard tells us that -- or
.-- will indicate a new item.

"In records formulated according to AACR 2, a space-hyphen-hyphen-space
( -- ) is recorded between each item in the contents note unless a
delimiter/subfield code follows in which case there is no ending space.
In pre-AACR 2 records, items are separated by a period-hyphen-hyphen (.--)."

The previous logic did no longer work with $g added. From the LOC
examples:

This would work:
505 2 0 $tBaptisms, 1816-1872 --$tChurch members, 1816-1831 --$tHistory of the Second Presbyterian Church of West Durham /$rby L. H. Fellows.
505 0 0 $tQuatrain II$g(16:35) --$tWater ways$g(1:57) --$tWaves$g(10:49).

This wouldn't:
505 1 0 $gNr. 1.$tRegion Neusiedlersee --$gNr. 2.$tRegion Rosalia/Lithagebirge --$gNr. 3.$tRegion Mettelburgenland --$gNr. 4.$tRegion südliches Burgenland --$gNr. 5.$tRegion Südburgland

With the patches applied, all examples should display nicely now.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize (ashimema) 2020-09-16 15:18:13 UTC
Works perfectly, Signing off.
Comment 12 Tomás Cohen Arazi (tcohen) 2020-10-07 18:34:06 UTC
Created attachment 111353 [details] [review]
Bug 19616: Add MARC21 505$g - Formatted Contents Note / Miscellaneous informatoin

This adds the subfield $g to the display of the 505 field in
staff and OPAC detail pages.

To test:
- Catalog some records using variations of 505
  Examples can be found in the LOC documentation:
  https://www.loc.gov/marc/bibliographic/bd505.html
- Verify that the display in staff and OPAC is still nice
  and now includes $g

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 13 Tomás Cohen Arazi (tcohen) 2020-10-07 18:34:13 UTC
Created attachment 111354 [details] [review]
Bug 19616: (follow-up) Reindent XSLT code used for 505 display

Also adds a note at the beginning of the code block.
This causes no functional change, just code clean-up.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 14 Tomás Cohen Arazi (tcohen) 2020-10-07 18:34:22 UTC
Created attachment 111355 [details] [review]
Bug 19616: (follow-up) Breaking items according to punctuation

Previously the code assumed that $t indicates a new line in the
listing. But this is not true. The standard tells us that -- or
.-- will indicate a new item.

"In records formulated according to AACR 2, a space-hyphen-hyphen-space
( -- ) is recorded between each item in the contents note unless a
delimiter/subfield code follows in which case there is no ending space.
In pre-AACR 2 records, items are separated by a period-hyphen-hyphen (.--)."

The previous logic did no longer work with $g added. From the LOC
examples:

This would work:
505 2 0 $tBaptisms, 1816-1872 --$tChurch members, 1816-1831 --$tHistory of the Second Presbyterian Church of West Durham /$rby L. H. Fellows.
505 0 0 $tQuatrain II$g(16:35) --$tWater ways$g(1:57) --$tWaves$g(10:49).

This wouldn't:
505 1 0 $gNr. 1.$tRegion Neusiedlersee --$gNr. 2.$tRegion Rosalia/Lithagebirge --$gNr. 3.$tRegion Mettelburgenland --$gNr. 4.$tRegion südliches Burgenland --$gNr. 5.$tRegion Südburgland

With the patches applied, all examples should display nicely now.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 15 Tomás Cohen Arazi (tcohen) 2020-10-07 18:40:31 UTC
I PQA as it does what it was requested. And I guess it doesn't hurt to make it independent on ind2.

I still have my question open about $u (separate enhancement, for sure), and the incidence of ind2=0. I felt like this 'enhanced' formatting/output should be dependent on ind2, but I'm not a MARC expert and I guess if people add the subfields, they expect them to be displayed.
Comment 16 Jonathan Druart 2020-10-08 14:20:33 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 17 Lucas Gass (lukeg) 2020-11-09 20:38:37 UTC
enhancement will not be backported to 20.05.x