Bug 29897 - Display author identifiers for researchers
Summary: Display author identifiers for researchers
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 29948
  Show dependency treegraph
 
Reported: 2022-01-18 10:30 UTC by Jonathan Druart
Modified: 2022-05-14 08:59 UTC (History)
4 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Medium patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 29897: Rename get_marc_authors with get_marc_contributors (5.99 KB, patch)
2022-01-26 08:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29897: Move code to private method for reusability (5.87 KB, patch)
2022-01-26 08:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29897: Add new pref OPACAuthorIdentifiers (3.27 KB, patch)
2022-01-26 08:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29897: Display author's identifiers (11.29 KB, patch)
2022-01-26 08:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29897: Rename get_marc_authors with get_marc_contributors (5.99 KB, patch)
2022-04-05 12:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29897: Move code to private method for reusability (5.87 KB, patch)
2022-04-05 12:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29897: Add new pref OPACAuthorIdentifiers (3.27 KB, patch)
2022-04-05 12:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29897: Display author's identifiers (11.29 KB, patch)
2022-04-05 12:25 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29897: Fix linkage (2.84 KB, patch)
2022-04-07 13:20 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29897: Rename get_marc_authors with get_marc_contributors (6.01 KB, patch)
2022-04-08 10:38 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 29897: Move code to private method for reusability (5.90 KB, patch)
2022-04-08 10:38 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 29897: Add new pref OPACAuthorIdentifiers (3.31 KB, patch)
2022-04-08 10:38 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 29897: Display author's identifiers (11.32 KB, patch)
2022-04-08 10:38 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 29897: Fix linkage (2.87 KB, patch)
2022-04-08 10:38 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 29897: Don't use $6 for linkage but build the link instead (5.67 KB, patch)
2022-05-02 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29897: Add and fix POD (1.45 KB, patch)
2022-05-02 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29897: Improve syspref's description (1.16 KB, patch)
2022-05-02 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29897: Add VIAF (2.42 KB, patch)
2022-05-02 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29897: Move the identifier list to an include file (6.21 KB, patch)
2022-05-02 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29897: Don't display identifier if not in the list (1010 bytes, patch)
2022-05-02 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2022-01-18 10:30:27 UTC
For research publications some information about authors could be displayed, like ORCID or SCOPUS ids with a link to the corresponding website.
Comment 1 Jonathan Druart 2022-01-26 08:16:14 UTC
Created attachment 129816 [details] [review]
Bug 29897: Rename get_marc_authors with get_marc_contributors

get_marc_authors actually return authors from 700..712, not the first
author from 200

Sponsored-by: Orex Digital
Comment 2 Jonathan Druart 2022-01-26 08:16:25 UTC
Created attachment 129817 [details] [review]
Bug 29897: Move code to private method for reusability

Sponsored-by: Orex Digital
Comment 3 Jonathan Druart 2022-01-26 08:16:34 UTC
Created attachment 129818 [details] [review]
Bug 29897: Add new pref OPACAuthorIdentifiers

Sponsored-by: Orex Digital
Comment 4 Jonathan Druart 2022-01-26 08:16:44 UTC
Created attachment 129819 [details] [review]
Bug 29897: Display author's identifiers

This new enhancement add the capability to list the different
identifiers of authors. It is helpful for research publications for
instance.

This patch will add a new "Author identifiers" tab on the detail page
(OPAC) of a bibliographic record, with the list of the authors and their
identifiers.
On the detail page of the authority record, the same identifier list
will be displayed.

Test plan:
Create some authority with
024
  $a source
  $2 number
  $6 link to the source
With the pref turned ON you will be able to see the new information.

Sponsored-by: Orex Digital
Comment 5 Jonathan Druart 2022-01-26 08:18:10 UTC
The goal of these patches is to adapt the code from https://gitlab.com/sibeprod/datosautores to Koha core.

It can be viewed there:
https://biblioteca.ecosur.mx/cgi-bin/koha/opac-authoritiesdetail.pl?authid=12374
https://biblioteca.ecosur.mx/cgi-bin/koha/opac-detail.pl?biblionumber=10794

To be integrated correctly into Koha I have decided to add the identifiers in a new tab, but this can be adjusted if someone has a better suggestion.

Also I am suggesting to deal with other author's information from 371, 372, 373 (email, activity, etc.) on a separate bug report.
Comment 6 Hugo Agud 2022-02-18 10:25:47 UTC
Bug 29897 - Display author identifiers for researchers

129816 - Bug 29897: Rename get_marc_authors with get_marc_contributors
129817 - Bug 29897: Move code to private method for reusability
129818 - Bug 29897: Add new pref OPACAuthorIdentifiers
129819 - Bug 29897: Display author's identifiers

Applying: Bug 29897: Rename get_marc_authors with get_marc_contributors
Using index info to reconstruct a base tree...
M	Koha/Biblio.pm
M	basket/basket.pl
M	basket/sendbasket.pl
M	opac/opac-basket.pl
M	opac/opac-sendbasket.pl
M	opac/opac-sendshelf.pl
M	t/db_dependent/Koha/Biblio.t
M	virtualshelves/sendshelf.pl
Falling back to patching base and 3-way merge...
Auto-merging virtualshelves/sendshelf.pl
Auto-merging t/db_dependent/Koha/Biblio.t
CONFLICT (content): Merge conflict in t/db_dependent/Koha/Biblio.t
Auto-merging opac/opac-basket.pl
Auto-merging basket/basket.pl
Auto-merging Koha/Biblio.pm
CONFLICT (content): Merge conflict in Koha/Biblio.pm
error: Failed to merge in the changes.
Patch failed at 0001 Bug 29897: Rename get_marc_authors with get_marc_contributors
[33mhint: Use 'git am --show-current-patch=diff' to see the failed patch[m
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-29897-Rename-getmarcauthors-with-getmarccontri-5Xn3sp.patch
Apply? [(y)es, (n)o, (i)nteractive] 
DEV atomic update /kohadevbox/koha/installer/data/mysql/atomicupdate/bug_29897.pl  [10:24:08]: Bug 29897 - Add new system preference OPACAuthorIdentifiers
Comment 7 Jonathan Druart 2022-02-18 11:18:04 UTC
The patches apply on current master.
Comment 8 Hugo Agud 2022-03-31 10:37:06 UTC
I am not able to apply the patch in any sandboxes available

Bug 29897 - Display author identifiers for researchers

129816 - Bug 29897: Rename get_marc_authors with get_marc_contributors
129817 - Bug 29897: Move code to private method for reusability
129818 - Bug 29897: Add new pref OPACAuthorIdentifiers
129819 - Bug 29897: Display author's identifiers

fatal: previous rebase directory .git/rebase-apply still exists but mbox given.
Patch left in /tmp/Bug-29897-Rename-getmarcauthors-with-getmarccontri-4JmoX6.patch
Apply? [(y)es, (n)o, (i)nteractive] 

sorry :(
Comment 9 Katrin Fischer 2022-03-31 13:02:31 UTC
Have you tried to add it to a freshly created instance on a sandbox or reusing one? It reads a little bit like some patch before those might have failed to apply.
Comment 10 Jonathan Druart 2022-04-05 12:24:48 UTC
Created attachment 132961 [details] [review]
Bug 29897: Rename get_marc_authors with get_marc_contributors

get_marc_authors actually return authors from 700..712, not the first
author from 200

Sponsored-by: Orex Digital
Comment 11 Jonathan Druart 2022-04-05 12:24:52 UTC
Created attachment 132962 [details] [review]
Bug 29897: Move code to private method for reusability

Sponsored-by: Orex Digital
Comment 12 Jonathan Druart 2022-04-05 12:24:57 UTC
Created attachment 132963 [details] [review]
Bug 29897: Add new pref OPACAuthorIdentifiers

Sponsored-by: Orex Digital
Comment 13 Jonathan Druart 2022-04-05 12:25:01 UTC
Created attachment 132964 [details] [review]
Bug 29897: Display author's identifiers

This new enhancement add the capability to list the different
identifiers of authors. It is helpful for research publications for
instance.

This patch will add a new "Author identifiers" tab on the detail page
(OPAC) of a bibliographic record, with the list of the authors and their
identifiers.
On the detail page of the authority record, the same identifier list
will be displayed.

Test plan:
Create some authority with
024
  $a source
  $2 number
  $6 link to the source
With the pref turned ON you will be able to see the new information.

Sponsored-by: Orex Digital
Comment 14 Hugo Agud 2022-04-07 05:43:28 UTC
The basic functionality is there and it is awesome, good job! however there are some minor issues to fix

At bibliographic level:

I do not think it will available, yet
https://opac-bug29897.sandboxes.biblibre.eu/cgi-bin/koha/opac-detail.pl?biblionumber=439

Inside Authorities identifiers tab

a) None Links are functional:
https://opac-bug29897.sandboxes.biblibre.eu/cgi-bin/koha/https%3A%2F%2Fwww.scopus.com%2Fauthid%2Fdetail.uri%3FauthorId%3D670165077

b) Tag 110 is not included in Authorities identifiers tab


At authority level:
https://opac-bug29897.sandboxes.biblibre.eu/cgi-bin/koha/opac-authoritiesdetail.pl?authid=1708

a) Only orcid link is published, all other identifiers are published without the link
Comment 15 Jonathan Druart 2022-04-07 13:20:55 UTC
Created attachment 133081 [details] [review]
Bug 29897: Fix linkage
Comment 16 Jonathan Druart 2022-04-07 13:22:10 UTC
Thanks Hugo! This last patch should fix the problems you found.
Comment 17 Jonathan Druart 2022-04-07 13:22:27 UTC
I've applied it on the sandbox.
Comment 18 Hugo Agud 2022-04-08 07:35:24 UTC
Thanks, have you seen this bug?

b) Tag 110 is not included in Authorities identifiers tab?

however tag 710 is included, but not 110 

thanks you in advance
Comment 19 Jonathan Druart 2022-04-08 08:01:08 UTC
(In reply to Hugo Agud from comment #18)
> Thanks, have you seen this bug?
> 
> b) Tag 110 is not included in Authorities identifiers tab?
> 
> however tag 710 is included, but not 110 
> 
> thanks you in advance

I don't know if it's a bug. We are returning 700..712 and 100. That's the current behaviour in Koha to retrieve authors.
Comment 20 Hugo Agud 2022-04-08 10:37:25 UTC
then it could be a more general bug, however this patch, does, what it suppouse to do in a very smart and beatiful way.

the only it could be target blank in the url, but it works very fine!
Comment 21 sandboxes@biblibre.com 2022-04-08 10:38:36 UTC
Created attachment 133113 [details] [review]
Bug 29897: Rename get_marc_authors with get_marc_contributors

get_marc_authors actually return authors from 700..712, not the first
author from 200

Sponsored-by: Orex Digital

Signed-off-by: Orex Digital <info@orex.es>
Comment 22 sandboxes@biblibre.com 2022-04-08 10:38:40 UTC
Created attachment 133114 [details] [review]
Bug 29897: Move code to private method for reusability

Sponsored-by: Orex Digital

Signed-off-by: Orex Digital <info@orex.es>
Comment 23 sandboxes@biblibre.com 2022-04-08 10:38:44 UTC
Created attachment 133115 [details] [review]
Bug 29897: Add new pref OPACAuthorIdentifiers

Sponsored-by: Orex Digital

Signed-off-by: Orex Digital <info@orex.es>
Comment 24 sandboxes@biblibre.com 2022-04-08 10:38:47 UTC
Created attachment 133116 [details] [review]
Bug 29897: Display author's identifiers

This new enhancement add the capability to list the different
identifiers of authors. It is helpful for research publications for
instance.

This patch will add a new "Author identifiers" tab on the detail page
(OPAC) of a bibliographic record, with the list of the authors and their
identifiers.
On the detail page of the authority record, the same identifier list
will be displayed.

Test plan:
Create some authority with
024
  $a source
  $2 number
  $6 link to the source
With the pref turned ON you will be able to see the new information.

Sponsored-by: Orex Digital

Signed-off-by: Orex Digital <info@orex.es>
Comment 25 sandboxes@biblibre.com 2022-04-08 10:38:51 UTC
Created attachment 133117 [details] [review]
Bug 29897: Fix linkage

Signed-off-by: Orex Digital <info@orex.es>
Comment 26 Katrin Fischer 2022-04-26 13:40:15 UTC
I'd really love to have this feature, but going through the code sadly found a bigger issue with the specification :(

I am making this 0) now, although I caught it last at the bottom of the source tree:

0) Linkage $6

In your code you assume that $6 is a URL, but that will NEVER be the case according to MARC standard.

$6 is a very specialized field that will never contain a URL. Linkage here means 'linking MARC fields within the record'. For example it is used to link an original script tag with the corresponding tag in transliteration. See: https://www.loc.gov/marc/authority/ecadcntf.html

So I don't think we can push this as is. :(

If at all, a link would probably be in $1, but that's a quite new field and quite unlikely. I think our best bet for a universally working feature right now is to buidl the URLs to the corresponding portals using the cataloged IDs form $a ourselves.

This also means, that we should limit our efforts on a short list of $2 codes for now. The 4 you have in there would be fine with me. We could add others later. 

We should also limit $2 display to the ones we have implemented and checked, some are just not useful to patrons.


1) Missing POD for _get_marc_authors

Could it be a little confusing having _get_marc_authors and get_marc_authors?

2) On get_marc_contributurs, you write:

(700..712 for MARC21)

but:

+    if ( $marcflavour eq "UNIMARC" ) {
+        $mintag = "700";
+        $maxtag = "712";
+        $fields_filter = '7..';
+    } else { # marc21/normarc
+        $mintag = "700";
+        $maxtag = "720";
+        $fields_filter = '7..';
+    }

Overall using a range instead of a list seems a little risky, but works for MARC21. It looks like a lot of fields, but actually it's only: 700, 710, 711 and 720. 
(https://www.loc.gov/marc/bibliographic/bd70x75x.html)


3) Missing 110, 111

If we get 710 and 711 we should probably include 110 and 111 in get_marc_authors as well. As it was 'wrong' before, should we file a separate bug report to extend this method?

4) Pref description

I am struggling a bit with the description.

[Display|Don't display] author identifiers for research publications.

It makes it sound, like it was limited to research publications, while the limit is actually the 024 existing or not.

Adding information that this requires authorities and 024 would be good I think. Maybe:


[Display|Don't display] identifiers for authors and contributors to the detail pages in the OPAC. This feature requires authorities with 024


5) Selection of $2

+  [% CASE 'orcid' %]ORCID:
+  [% CASE 'scopus' %]ScopusID:
+  [% CASE 'loop' %]loop:
+  [% CASE 'rid' %]Publons:

a) Should these be surrounded by <span>?
b) $2 are usually taken from the official LOC list:
https://www.loc.gov/standards/sourcelist/standard-identifier.html

orcid = ORCID OK
scopus = ScopusID OK
loop = doesn't exist in official list. I am fine with it if that is a custom one, but maybe worth checking?
rid = ResearcherID, linking to: http://www.researcherid.com/#rid-for-researchers, stating:
ResearcherID profiles moved to Publons on 15 April 2019 - so probably OK

viaf might be a good candidate (for another bug).

The fallback worries me: 
[% CASE %][% identifier.source | html %]:

I think we should stick with a hardcoded list as not all $2 codes and identifiers are useful to patrons (and they might get into the catalog, if you use a central authority file)

c) I'd also suggest to add a class with the $2 to the <li> element, this way each entry could be hidden and customized easily.
Comment 27 Jonathan Druart 2022-05-02 09:32:31 UTC
Created attachment 134459 [details] [review]
Bug 29897: Don't use $6 for linkage but build the link instead

See comment 26:
$6 is a very specialized field that will never contain a URL. Linkage here means 'linking MARC fields within the record'. For example it is used to link an original script tag with the corresponding tag in transliteration. See: https://www.loc.gov/marc/authority/ecadcntf.html

Sponsored-by: Orex Digital
Comment 28 Jonathan Druart 2022-05-02 09:32:36 UTC
Created attachment 134460 [details] [review]
Bug 29897: Add and fix POD

Sponsored-by: Orex Digital
Comment 29 Jonathan Druart 2022-05-02 09:32:41 UTC
Created attachment 134461 [details] [review]
Bug 29897: Improve syspref's description

Sponsored-by: Orex Digital
Comment 30 Jonathan Druart 2022-05-02 09:32:46 UTC
Created attachment 134462 [details] [review]
Bug 29897: Add VIAF

Sponsored-by: Orex Digital
Comment 31 Jonathan Druart 2022-05-02 09:32:51 UTC
Created attachment 134463 [details] [review]
Bug 29897: Move the identifier list to an include file

Sponsored-by: Orex Digital
Comment 32 Jonathan Druart 2022-05-02 09:32:56 UTC
Created attachment 134464 [details] [review]
Bug 29897: Don't display identifier if not in the list

Requested by QA, see comment 26.

Sponsored-by: Orex Digital
Comment 33 Jonathan Druart 2022-05-02 09:33:48 UTC
(In reply to Katrin Fischer from comment #26)

Thanks for your time, Katrin!

> 0) Linkage $6
> 
> In your code you assume that $6 is a URL, but that will NEVER be the case
> according to MARC standard.

We are going to lose flexibility, but I agree we should follow the standard.

> 1) Missing POD for _get_marc_authors
> 
> Could it be a little confusing having _get_marc_authors and get_marc_authors?

Added POD.

> 2) On get_marc_contributurs, you write:
> 
> (700..712 for MARC21)
> 
> but:
> 
> +    if ( $marcflavour eq "UNIMARC" ) {
> +        $mintag = "700";
> +        $maxtag = "712";
> +        $fields_filter = '7..';
> +    } else { # marc21/normarc
> +        $mintag = "700";
> +        $maxtag = "720";
> +        $fields_filter = '7..';
> +    }
> 
> Overall using a range instead of a list seems a little risky, but works for
> MARC21. It looks like a lot of fields, but actually it's only: 700, 710, 711
> and 720. 
> (https://www.loc.gov/marc/bibliographic/bd70x75x.html)

Adjusted the POD!

> 3) Missing 110, 111
> 
> If we get 710 and 711 we should probably include 110 and 111 in
> get_marc_authors as well. As it was 'wrong' before, should we file a
> separate bug report to extend this method?

Hum, yes? I don't know! Any ideas why it's missing here?

> 4) Pref description
> 
> I am struggling a bit with the description.
> 
> [Display|Don't display] author identifiers for research publications.
> 
> It makes it sound, like it was limited to research publications, while the
> limit is actually the 024 existing or not.
> 
> Adding information that this requires authorities and 024 would be good I
> think. Maybe:
> 
> 
> [Display|Don't display] identifiers for authors and contributors to the
> detail pages in the OPAC. This feature requires authorities with 024

Done, thanks for the suggestion.

> 5) Selection of $2
> 
> +  [% CASE 'orcid' %]ORCID:
> +  [% CASE 'scopus' %]ScopusID:
> +  [% CASE 'loop' %]loop:
> +  [% CASE 'rid' %]Publons:
> 
> a) Should these be surrounded by <span>?
> b) $2 are usually taken from the official LOC list:
> https://www.loc.gov/standards/sourcelist/standard-identifier.html
> 
> orcid = ORCID OK
> scopus = ScopusID OK
> loop = doesn't exist in official list. I am fine with it if that is a custom
> one, but maybe worth checking?
> rid = ResearcherID, linking to:
> http://www.researcherid.com/#rid-for-researchers, stating:
> ResearcherID profiles moved to Publons on 15 April 2019 - so probably OK

Hugo, do you know "loop"?

> viaf might be a good candidate (for another bug).

I have added here.

> The fallback worries me: 
> [% CASE %][% identifier.source | html %]:
> 
> I think we should stick with a hardcoded list as not all $2 codes and
> identifiers are useful to patrons (and they might get into the catalog, if
> you use a central authority file)

Done, but I am not sure I agree with this :)
Won't we get request from lot of people to add theirs?

> c) I'd also suggest to add a class with the $2 to the <li> element, this way
> each entry could be hidden and customized easily.

Can you be more specific please? There is a class on the div already (author_identifier).
With the new patches, do you think we should have:
  <span class="orcid">ORCID</span>
?