Bug 28639 - Embed see-from headings (from authorities) into bibliographic records at OAI repository level
Summary: Embed see-from headings (from authorities) into bibliographic records at OAI ...
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: Web services (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Thibaud Guillot
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-30 09:43 UTC by Julien Sicot (Univ. Rennes 2)
Modified: 2023-11-06 23:27 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 28639 - Embed see-from headings (from authorities) into bibliographic records at OAI repository level (7.47 KB, patch)
2021-06-30 10:04 UTC, Julien Sicot (Univ. Rennes 2)
Details | Diff | Splinter Review
Bug 28639: Embed see-from headings (from authorities) into bibliographic records at OAI repository level (5.61 KB, patch)
2022-10-21 07:29 UTC, Thibaud Guillot
Details | Diff | Splinter Review
Bug 28639: Embed see-from headings (from authorities) into bibliographic records at OAI repository level (5.71 KB, patch)
2022-10-21 07:34 UTC, Thibaud Guillot
Details | Diff | Splinter Review
Bug 28639: Embed see-from headings (from authorities) into bibliographic records at OAI repository level (5.70 KB, patch)
2022-12-23 13:30 UTC, Thibaud Guillot
Details | Diff | Splinter Review
Bug 28639: (follow_up) changing syspref name on atomic update file (1.70 KB, patch)
2022-12-23 13:30 UTC, Thibaud Guillot
Details | Diff | Splinter Review
Bug 28639: (follow-up) Changes method to embed see-from headings (1.35 KB, patch)
2022-12-28 09:05 UTC, Thibaud Guillot
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Sicot (Univ. Rennes 2) 2021-06-30 09:43:33 UTC
Hi,

It could be interesting to enrich the bibliographic records exposed in OAI with see-from headings, this would allow users who use koha with a discovery tool to be able to manage, normalize and index some authorities data ?

This is something that could be done directly in C4::Biblio::GetMarcBiblio following the same method used for embedding items.
We could use an optional parameter like embed_items (embed_seefromheading) and a function similar to C4::Biblio::EmbedItemsInMarcBiblio by reusing what was made for zebra with EmbedSeeFromHeadings (bug #7417).

Thanks for feedback,
Best
Julien Sicot
Systems Librarian,
Université Rennes 2
Comment 1 Julien Sicot (Univ. Rennes 2) 2021-06-30 10:04:10 UTC
Created attachment 122500 [details] [review]
Bug 28639 - Embed see-from headings (from authorities) into  bibliographic records at OAI repository level

Test plan:
1. Create an authority with at least a 1XX$a and a 4XX$a, for instance:
    100 $a Foo
    400 $a Bar
2. Create a biblio and add a link to this authority using the
   cataloguing plugin
3. Enable OAI-PMH syspref and fill OAI-PMH:archiveID syspref with "oai:sandbox"
4. Go to OAI repository and display the previously created record (at /cgi-bin/koha/oai.pl?verb=GetRecord&metadataPrefix=marcxml&identifier=oai:sandbox:{biblionumber}
5. The record should not contain see-from headings
6. Enable OAI-PMH:EmbedSeeFromInBibRecord
7. Go again to the OAI record, you should see alternative forms at the end of the record
Comment 2 Ere Maijala 2021-07-08 19:29:21 UTC
I think the setting should be in the oai.conf file instead of a syspref. The conf file would allow you to make it format-specific instead of a global setting. You could e.g. setup a new metadataPrefix marc21_with_auth that would include the see-from headings while keeping the normal marc21 format intact.
Comment 3 Fridolin Somers 2021-08-10 23:11:16 UTC
Nice.

But why not using like rebuild_zebra.pl Koha::RecordProcessor and Koha::Filter::MARC::EmbedSeeFromHeadings ?
Code looks the same no ?
Comment 4 Thibaud Guillot 2022-10-21 07:29:53 UTC Comment hidden (obsolete)
Comment 5 Thibaud Guillot 2022-10-21 07:34:24 UTC
Created attachment 142297 [details] [review]
Bug 28639: Embed see-from headings (from authorities) into  bibliographic records at OAI repository level

Test plan:
1. Create an authority with at least a 1XX$a and a 4XX$a, for instance:
    100 $a Foo
    400 $a Bar
2. Create a biblio and add a link to this authority using the
   cataloguing plugin
3. Enable OAI-PMH syspref and fill OAI-PMH:archiveID syspref with "oai:sandbox"
4. Go to OAI repository and display the previously created record (at /cgi-bin/koha/oai.pl?verb=GetRecord&metadataPrefix=marcxml&identifier=oai:sandbox:{biblionumber}
5. The record should not contain see-from headings
6. Run perl installer/data/mysql/atomicupdate/bug_28639-add_EmbedSeeFromInBibRecord_syspref.pl
7. Enable OAI-PMH:EmbedSeeFromInBibRecord
8. Go again to the OAI record, you should see alternative forms at the end of the record
Comment 6 Thibaud Guillot 2022-10-21 07:39:11 UTC
(In reply to Julien Sicot (Univ. Rennes 2) from comment #0)
> Hi,
> 
> It could be interesting to enrich the bibliographic records exposed in OAI
> with see-from headings, this would allow users who use koha with a discovery
> tool to be able to manage, normalize and index some authorities data ?
> 
> This is something that could be done directly in C4::Biblio::GetMarcBiblio
> following the same method used for embedding items.
> We could use an optional parameter like embed_items (embed_seefromheading)
> and a function similar to C4::Biblio::EmbedItemsInMarcBiblio by reusing what
> was made for zebra with EmbedSeeFromHeadings (bug #7417).
> 
> Thanks for feedback,
> Best
> Julien Sicot
> Systems Librarian,
> Université Rennes 2

Thanks to you, I just rebase your proposal on master updated and add a atomic update file.

I just call Koha::Filter::MARC::EmbedSeeFromHeadings on OAI server side to show or hide embed see-from headings. 

I could not test your development due to an error so I hope that the intended behaviour remains the same. Please let me know if not.
Comment 7 Fridolin Somers 2022-12-20 18:52:14 UTC
Hi,

Atomic update is incorrect :
+            INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) 
+            VALUES (
+                'EmbedSeeFromInBibRecord', '0', NULL, 'Add embed see-from headings for OAI', 'YesNo'

Value should be OAI-PMH:EmbedSeeFromInBibRecord

Also :

+    Koha::Filter::MARC::EmbedSeeFromHeadings->filter($record);

Does this work ?
Other call use the RecordProcessor :

https://git.koha-community.org/Koha-community/Koha/src/commit/a57278f39b8c5b7a82b21671f266dbf32e2d41a0/t/db_dependent/RecordProcessor_EmbedSeeFromHeadings.t#L60

Best regards,
Comment 8 Thibaud Guillot 2022-12-23 13:30:27 UTC
Created attachment 144821 [details] [review]
Bug 28639: Embed see-from headings (from authorities) into  bibliographic records at OAI repository level

Test plan:
1. Create an authority with at least a 1XX$a and a 4XX$a, for instance:
    100 $a Foo
    400 $a Bar
2. Create a biblio and add a link to this authority using the
   cataloguing plugin
3. Enable OAI-PMH syspref and fill OAI-PMH:archiveID syspref with "oai:sandbox"
4. Go to OAI repository and display the previously created record (at /cgi-bin/koha/oai.pl?verb=GetRecord&metadataPrefix=marcxml&identifier=oai:sandbox:{biblionumber}
5. The record should not contain see-from headings
6. Run perl installer/data/mysql/atomicupdate/bug_28639-add_EmbedSeeFromInBibRecord_syspref.pl
7. Enable OAI-PMH:EmbedSeeFromInBibRecord
8. Go again to the OAI record, you should see alternative forms at the end of the record
Comment 9 Thibaud Guillot 2022-12-23 13:30:32 UTC
Created attachment 144822 [details] [review]
Bug 28639: (follow_up) changing syspref name on atomic update file
Comment 10 Thibaud Guillot 2022-12-23 13:34:05 UTC
(In reply to Fridolin Somers from comment #7)
> Hi,
> 
> Atomic update is incorrect :
> +            INSERT IGNORE INTO systempreferences
> (variable,value,options,explanation,type) 
> +            VALUES (
> +                'EmbedSeeFromInBibRecord', '0', NULL, 'Add embed see-from
> headings for OAI', 'YesNo'
> 
> Value should be OAI-PMH:EmbedSeeFromInBibRecord
> 
> Also :
> 
> +    Koha::Filter::MARC::EmbedSeeFromHeadings->filter($record);
> 
> Does this work ?
> Other call use the RecordProcessor :
> 
> https://git.koha-community.org/Koha-community/Koha/src/commit/
> a57278f39b8c5b7a82b21671f266dbf32e2d41a0/t/db_dependent/
> RecordProcessor_EmbedSeeFromHeadings.t#L60
> 
> Best regards,

Hi Fridolin :)

Thanks for your reply ! Yes I miss this thing, I fix that by follow-up. And I also rebased on 'fresh' master ^^ 

For this :

+ Koha::Filter::MARC::EmbedSeeFromHeadings->filter($record);

It works as intended apparently but you put me in doubt.. did you test it ? Maybe I miss something
Comment 11 Fridolin Somers 2022-12-23 19:20:19 UTC
(In reply to Thibaud Guillot from comment #10)
> (In reply to Fridolin Somers from comment #7)
> 
> For this :
> 
> + Koha::Filter::MARC::EmbedSeeFromHeadings->filter($record);
> 
> It works as intended apparently but you put me in doubt.. did you test it ?
> Maybe I miss something

I did not test it but since other calls are different.
We try to have same code syntax for clarity.

Great job btw ;)
Comment 12 Thibaud Guillot 2022-12-28 09:05:28 UTC
Created attachment 144857 [details] [review]
Bug 28639: (follow-up) Changes method to embed see-from headings

To have same code syntax call of Koha::RecordProcessor class
Comment 13 Thibaud Guillot 2022-12-28 09:06:36 UTC
(In reply to Fridolin Somers from comment #11)
> (In reply to Thibaud Guillot from comment #10)
> > (In reply to Fridolin Somers from comment #7)
> > 
> > For this :
> > 
> > + Koha::Filter::MARC::EmbedSeeFromHeadings->filter($record);
> > 
> > It works as intended apparently but you put me in doubt.. did you test it ?
> > Maybe I miss something
> 
> I did not test it but since other calls are different.
> We try to have same code syntax for clarity.
> 
> Great job btw ;)

Oh okay, thanks, you're right, I replace it :)
Comment 14 Lucas Gass 2023-11-06 23:27:30 UTC
This no longer applies cleanly to current master.