Bug 488931 - Bad hypothesis taken on SRU fetcher
Summary: Bad hypothesis taken on SRU fetcher
Status: RESOLVED FIXED
Alias: None
Product: tellico
Classification: Applications
Component: general (show other bugs)
Version: 3.4.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Robby Stephenson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-21 21:28 UTC by glorfindel_ildarion
Modified: 2024-06-23 22:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 3.5.5
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description glorfindel_ildarion 2024-06-21 21:28:24 UTC
SUMMARY

The query is badly formed when I try to retrieve books metadata over SRU connection due to wrong hypothesis taken on the file "srufetcher.cpp".

The comment lines 194/195 of this file takes "dc.identifier=" and "bath.isbn=" as universal parameter for querying an isbn, for DublinCore and *marcXml (lines 196 to 199). Tests were done on LoC, KB and COPAC. It does not work on BnF (french equivalent of LoC) SRU service as the API specs are not the same. It should be "bib.isbn=".

https://www.bnf.fr/sites/default/files/2019-04/tableau_criteres_sru.pdf

STEPS TO REPRODUCE
1. Configure the SRU client as detailled below to connect to BnF's SRU server (need to override version and recordSchema).
2. Try to add an entry via Internet Search, looking for a single ISBN (french book, e.g. 9782070463619) through the SRU BNF connection.
3. Obtain error message

OBSERVED RESULT
error textbox ("Unsupported index (bath.isbn)").

EXPECTED RESULT
Return the search result via SRU protocol

Proposed solution : 
Allow user to override the default parameter (dc, bath, etc.) as for version, recordSchema, etc. (lines 144 to 157).

I tried to test it myself, but I have failed to compile the software. It stopped at the
"Building CXX object src/CMakeFiles/tellico.dir/tellico_autogen/mocs_compilation.cpp.o" step, with of bunch of errors about "/usr/include/KF5/KNewStuff3/knscore/entryinternal.h:536:20: error: ‘KNS3’ has not been declared" and so on.

I'm far from a specialist in C++ / OOP and I didn't found anything to solve this problem. Otherwise, I would have done a merge/pull request on github.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 5

ADDITIONAL INFORMATION

Tellicorc file for BnF SRU connection

[Data Source 1]
Custom Fields=
Format=marcxml
Host=catalogue.bnf.fr
Name=SRU BNF
Path=/api/SRU
Port=80
QueryFields=recordSchema,version
QueryValues=unimarcXchange,1.2
Type=3
UpdateOverwrite=false
Uuid={5bd140eb-02f0-465c-b28c-5a0c2fa1d90f}
Comment 1 Robby Stephenson 2024-06-23 22:18:47 UTC
Git commit b9145dd9528b0c84aeab4b4e2844fa661ee3be57 by Robby Stephenson.
Committed on 23/06/2024 at 22:18.
Pushed by rstephenson into branch '3.5'.

Allow user-entered data to override the SRU index for given searches

By adding a custom query such as x-tellico-isbn, the user can override
the index of the SRU query. Additionally, switch the query operator to
use 'adj' instead of '=' for versions other than 1.1.

Also allow for x-tellico-title to override the title index.
FIXED-IN: 3.5.5

M  +58   -17   src/fetch/srufetcher.cpp
M  +1    -0    src/fetch/srufetcher.h
M  +52   -0    src/tests/srufetchertest.cpp
M  +2    -0    src/tests/srufetchertest.h
M  +3    -0    xslt/mods2tellico.xsl

https://invent.kde.org/office/tellico/-/commit/b9145dd9528b0c84aeab4b4e2844fa661ee3be57
Comment 2 Robby Stephenson 2024-06-23 22:20:27 UTC
Thanks for the detailed bug report and additional information. It made things much easier to implement. For your BnF search and this fix, add x-tellico-isbn,bib.isbn to the custom query (as you suggested) and make sure to enter the format as marcxchange
Comment 3 Robby Stephenson 2024-06-23 22:21:04 UTC
Git commit 2a642fd4a0c616eeb5a65a60cb0efdd68108343a by Robby Stephenson.
Committed on 23/06/2024 at 22:00.
Pushed by rstephenson into branch 'master'.

Allow user-entered data to override the SRU index for given searches

By adding a custom query such as x-tellico-isbn, the user can override
the index of the SRU query. Additionally, switch the query operator to
use 'adj' instead of '=' for versions other than 1.1.

Also allow for x-tellico-title to override the title index.
FIXED-IN: 3.5.5

M  +58   -17   src/fetch/srufetcher.cpp
M  +1    -0    src/fetch/srufetcher.h
M  +52   -0    src/tests/srufetchertest.cpp
M  +2    -0    src/tests/srufetchertest.h
M  +3    -0    xslt/mods2tellico.xsl

https://invent.kde.org/office/tellico/-/commit/2a642fd4a0c616eeb5a65a60cb0efdd68108343a