Bug 29434

Summary: In UNIMARC instances, the authority finder uses MARC21 relationship codes
Product: Koha Reporter: Andreas Roussos <a.roussos>
Component: MARC Authority data supportAssignee: Andreas Roussos <a.roussos>
Status: CLOSED FIXED QA Contact: Fridolin Somers <fridolin.somers>
Severity: normal    
Priority: P5 - low CC: david, jonathan.druart, lucas, victor
Version: Main   
Hardware: All   
OS: All   
URL: authorities/auth_finder.pl
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the values displayed for the relationship codes in the authority finder 'Special relationships' drop down list in UNIMARC catalogs - UNIMARC values are now displayed, instead of MARC21 values.
Version(s) released in:
22.11.00,22.05.06,21.11.12
Attachments: list of sample authorities in the Staff client
hierarchical view of sample authorities
relationship codes for MARC21 in the authority finder
the official source (LoC) of MARC21 relationship codes
Bug 29434: add UNIMARC relationship codes for authorities
Bug 29434: add UNIMARC relationship codes for authorities
Bug 29434: add UNIMARC relationship codes for authorities

Description Andreas Roussos 2021-11-08 07:10:57 UTC
Background information
----------------------
As per the IFLA UNIMARC Manual for Authorities format [1], the 5--
Functional Block (a.k.a. Related Access Point Block) "contains related
authorized access points from which a reference is to be made to see also
the access point of the record".

To put it simply, this allows for linking authority records with other
authority records in order to form, for example, broader/narrower term
hierarchies (see sreenshots 1 and 2).

Control Subfield $5 ("Relationship Control" in IFLA speak, whereas the
UNIMARC Authorities framework in Koha uses the term "Tracing Control")
is key to this idea, because it is used to store a single-character value
that denotes the type of relationship between the authorities being linked.

The actual problem
------------------
When using the authority finder plugin (authorities/auth_finder.pl),
you can pick an entry from the 'Special relationship:' dropdown menu
in order to set the relationship between authorities.

However, in UNIMARC instances the relationship codes listed are those
for MARC21 [2] (see screenshots 3 and 4). The correct codes for UNIMARC
are listed in pages 93-94 of the IFLA UNIMARC Manual for Authorities.

[1] https://repository.ifla.org/handle/123456789/861
[2] https://www.loc.gov/marc/authority/adtracing.html
Comment 1 Andreas Roussos 2021-11-08 07:14:38 UTC
Created attachment 127420 [details]
list of sample authorities in the Staff client
Comment 2 Andreas Roussos 2021-11-08 07:15:23 UTC
Created attachment 127421 [details]
hierarchical view of sample authorities
Comment 3 Andreas Roussos 2021-11-08 07:16:26 UTC
Created attachment 127422 [details]
relationship codes for MARC21 in the authority finder
Comment 4 Andreas Roussos 2021-11-08 07:17:04 UTC
Created attachment 127423 [details]
the official source (LoC) of MARC21 relationship codes
Comment 5 Andreas Roussos 2021-11-08 07:22:31 UTC
Created attachment 127424 [details] [review]
Bug 29434: add UNIMARC relationship codes for authorities

When using the authority finder plugin (authorities/auth_finder.pl),
you can pick an entry from the 'Special relationship:' dropdown menu
in order to set the relationship between authorities.

However, in UNIMARC instances the relationship codes listed are those
for MARC21. The correct codes for UNIMARC are listed in pages 93-94
of the IFLA UNIMARC Manual for Authorities.

Test plan:

1) In a UNIMARC instance, launch authorities/auth_finder.pl in the
   Staff client, by clicking on the 'Tag editor' button. Notice how
   the 'Special relationship:' dropdown menu lists the relationship
   codes for MARC21 instead of UNIMARC.
2) Apply this patch.
3) Launch the authority finder again; this time the correct values
   should be listed in the 'Special relationship:' dropdown menu.
Comment 6 David Nind 2022-04-30 03:15:23 UTC
Hi Andreas.

I'm not familiar with UNIMARC, but I would like to test this bug.

For step 1, how do I set things up so I can "launch authorities/auth_finder.pl"? 
- Are there any fields that have the tag editor already enabled?
- Do I need to edit the authority structure (Administration > Catalog > Authority types)?
- Where does the 'Special relationship:' dropdown menu appear?
- I assume I need to enable the AuthDisplayHierarchy system preference.

I'm using koha-testing-docker and have a UNIMARC instance with the default sample data. Is there an existing authority record that you know of in the sample data with this already setup?

Apologies for such a basic question!

David
Comment 7 Andreas Roussos 2022-07-23 05:26:18 UTC
(In reply to David Nind from comment #6)
> Hi Andreas.
Hi David!

> I'm not familiar with UNIMARC, but I would like to test this bug.
That's great! Thank you for your interest in this bug report.

> For step 1, how do I set things up so I can "launch
> authorities/auth_finder.pl"?
> - Are there any fields that have the tag editor already enabled?
There aren't any, no. See below for instructions on how to enable.

> - Do I need to edit the authority structure (Administration > Catalog >
> Authority types)?
Yes. I'll outline the steps required below:
- Go to 'Home > Administration > Authority types' and click on
  'Actions -> MARC structure' for the 'NP' (Personal Name) auth type.
- Next, search for tag 510 and click on 'Actions -> Subfields' for
  that tag.
- Finally, click 'Edit' next to subfield 'a' (Entry element), then
  pick 'CO' from the 'Thesaurus' dropdown menu. Save your settings
  and you're good to go! From now on, when editing a Personal Name
  authority, the 'Tag editor' button next to subfield 510$a will
  launch the authority finder plugin.

> - Where does the 'Special relationship:' dropdown menu appear?
It will appear when you launch the authority finder plugin via
the 'Tag editor' button. The menu itself will be near the bottom
of the popup window, under the 'Relationship information' section.

> - I assume I need to enable the AuthDisplayHierarchy system preference.
Actually you're not required to have this system preference enabled
if you just want to link authorities with other authorities.
It certainly helps to have in enabled, though, as you'll get
the nice hierarchical view of authorities in their Details page.

> I'm using koha-testing-docker and have a UNIMARC instance with the default
> sample data. Is there an existing authority record that you know of in the
> sample data with this already setup?
I ran a SELECT query on the SQL sample data for UNIMARC (provided
by koha-misc4dev) looking for records where the `authtrees` column
would be != NULL but couldn't find such a record. So, I guess
the answer is no.

> Apologies for such a basic question!
No worries, my test plan and the Bug Description did not include
all the information so your question is absolutely valid.
I apologise myself for the very late reply!
Comment 8 David Nind 2022-07-23 22:51:29 UTC
Created attachment 138065 [details] [review]
Bug 29434: add UNIMARC relationship codes for authorities

When using the authority finder plugin (authorities/auth_finder.pl),
you can pick an entry from the 'Special relationship:' dropdown menu
in order to set the relationship between authorities.

However, in UNIMARC instances the relationship codes listed are those
for MARC21. The correct codes for UNIMARC are listed in pages 93-94
of the IFLA UNIMARC Manual for Authorities.

Test plan:

1) In a UNIMARC instance, launch authorities/auth_finder.pl in the
   Staff client, by clicking on the 'Tag editor' button. Notice how
   the 'Special relationship:' dropdown menu lists the relationship
   codes for MARC21 instead of UNIMARC.
2) Apply this patch.
3) Launch the authority finder again; this time the correct values
   should be listed in the 'Special relationship:' dropdown menu.

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 David Nind 2022-07-23 23:00:27 UTC
Thanks Andreas!

Was able to test successfully, and the bug is now signed off.

David
Comment 10 Fridolin Somers 2022-08-09 09:02:33 UTC
Created attachment 138885 [details] [review]
Bug 29434: add UNIMARC relationship codes for authorities

When using the authority finder plugin (authorities/auth_finder.pl),
you can pick an entry from the 'Special relationship:' dropdown menu
in order to set the relationship between authorities.

However, in UNIMARC instances the relationship codes listed are those
for MARC21. The correct codes for UNIMARC are listed in pages 93-94
of the IFLA UNIMARC Manual for Authorities.

Test plan:

1) In a UNIMARC instance, launch authorities/auth_finder.pl in the
   Staff client, by clicking on the 'Tag editor' button. Notice how
   the 'Special relationship:' dropdown menu lists the relationship
   codes for MARC21 instead of UNIMARC.
2) Apply this patch.
3) Launch the authority finder again; this time the correct values
   should be listed in the 'Special relationship:' dropdown menu.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Comment 11 Tomás Cohen Arazi 2022-08-09 10:51:34 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 12 Lucas Gass 2022-09-30 22:37:18 UTC
Backported to 22.05.x for 22.05.06
Comment 13 Victor Grousset/tuxayo 2022-10-13 22:08:16 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document it seems, marking resolved.
Comment 14 Arthur Suzuki 2022-10-22 22:07:40 UTC
Thanks!

Pushed to 21.11 for 21.11.12