![]() |
#271 |
Member
![]() Posts: 23
Karma: 10
Join Date: Mar 2022
Device: iPad 8
|
LC misses DDC's that OCLC/Classify catches?
I have looked through the previous 18 pages and do not see this question addressed.
I consistently will have a few ISBN's for which LC does not return a DDC, and for which an author/title search will find no OCLC_OWI. However, when I enter the same ISBN into the OCLC demo page, it does return a DDC. Since LC uses a modified version of the api that the demo page uses, I do not understand why that would happen. I am using the latest plugin and edition of Calibre. Here are some example ISBN's with this behavior: 9783642156298 9784431285519 9783540699590 9781852335229 9781588291998 Can anyone explain this and save me from having to plow through the code? Thank you! |
![]() |
![]() |
![]() |
#272 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,067
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() These have different language/country codes (the '1' is a bit puzzling as English is 0 or 1 ) |
|
![]() |
![]() |
Advert | |
|
![]() |
#273 |
Member
![]() Posts: 23
Karma: 10
Join Date: Mar 2022
Device: iPad 8
|
Yes, but . . .
Thanks for your reply. Even so, would you not expect to get DDC feedback from the LC plugin if you get it from the classifier api demo page?
|
![]() |
![]() |
![]() |
#274 |
Member
![]() Posts: 23
Karma: 10
Join Date: Mar 2022
Device: iPad 8
|
Answer on why LC response appears to differ from Classify
After going through some code, looks like LC "fails" to return a DDC when there are multiple works with the same ISBN. The Classify demo site, otoh, returns all of the multiple works. You then have to click on the one you want to see the DDC for that work.
A similar thing could be done in LC by always taking the most popular work, and then re-running the classifier on its OWI, and outputting the DDC for that work. That would not be 100% accurate, which is probably why it simply returns nothing. For my purposes though, it would be preferable. |
![]() |
![]() |
![]() |
#275 |
Member
![]() Posts: 23
Karma: 10
Join Date: Mar 2022
Device: iPad 8
|
Multi-Work Classify doesn't work for e-books?
From my reading of the code, it appears that, for a multi-work isbn, the OCLC-OWI should be returned for the first work in the list (the most popular usage of the isbn). That is the operation if the format of the work is "Book". However, if the format is "eBook", the OCLC-OWI is not returned. This requires the user to do an author/title lookup to get an OCLC-OWI, which can then be used in turn to get a DDC.
BTW, I love this plugin and thank you DaltonST for all the hard work you have, and continue to, put into it. |
![]() |
![]() |
Advert | |
|
![]() |
#276 | |
Member
![]() Posts: 23
Karma: 10
Join Date: Mar 2022
Device: iPad 8
|
Would this solve my whole problem?
Quote:
|
|
![]() |
![]() |
![]() |
#277 |
Deviser
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
New version of Qt6-compatible LC
New version of Qt6-compatible LC is attached to the url here:
https://www.mobileread.com/forums/sh...9&postcount=19 This version also will prefer eBook over Book as a Classify xdoc_object's format value, if eBook exists, when searching for identifiers using the default ISBN/ISSN route for multi-work response codes from Classify. LC should be executed first to retrieve codes using the 2nd menu item, Using ISBN..., and then second using the 4th menu item, Using OCLC-OWI... . Note that those two menu items have the identical yellow icons. See the attached image of the LC menu. DaltonST Last edited by DaltonST; 03-12-2022 at 01:47 PM. Reason: Clarify recent change is for multi-work response codes from Classify |
![]() |
![]() |
![]() |
#278 |
Member
![]() Posts: 23
Karma: 10
Join Date: Mar 2022
Device: iPad 8
|
Thank you and one more
Thanks Dalton, and that is the way I'm using the plugin. One other issue I found; on multi-work, the OCLC # is not an element of "work", as it is on a single-work return. Instead it is an attribute. Multi-work is bombing because the attempt to retrieve an element fails because there are not any elements.
Thanks again, Sid |
![]() |
![]() |
![]() |
#279 |
Deviser
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
LC uses A to get B, which is used to get C
When I use one of your ISBNs from a previous post as test data, 9783642156298, at the end of running LC using only ISBN I get two more Identifiers for that ISBN:
oclc:913033698, oclc-owi:1059950222 LC uses the ISBN to get the oclc-owi from Classify, and then uses that value to get oclc from Worldcat: https://www.worldcat.org/search?q=kw%3A1059950222. The debug log shows where everything comes from. LC uses A to get B, which is used to get C, which is used to get D & E. To easily run Calibre in debug mode, run it from the command line or file as: "calibre-debug -g " and you will be able to watch what LC does in real-time. DaltonST |
![]() |
![]() |
![]() |
#280 |
Member
![]() Posts: 23
Karma: 10
Join Date: Mar 2022
Device: iPad 8
|
Dead, but not problematic, code
I do understand how it works and have been using the debugger. However, I did get a bit tangled in my own underwear!
There is no functional error; it is just that the first try block below will always fail but, as you say, OWI is all you need from this section of code, and that works fine. try: # Modified by DaltonST #~ work = xdoc.getElementsByTagName('work')[0] work = iterate_work_values(xdoc) if DEBUG: print("first work = ",work.attributes["title"].value) #Added by Sid if work: try: y = work.childNodes[0]; #this will always error, making this try block dead code #http://www.w3schools.com/xml/dom_nodes_get.asp z = y.nodeValue #Sid - work does not have child nodes z = unicode_type(z) #Sid - in multi-work, oclc only appears as an attribute of the edition element; not addressed here z = z.strip() if z.isdigit(): if len(z) > 5: oclc_other_return = z if DEBUG: print("oclc-other is: ", unicode_type(oclc_other_return)) except # will always get this exception. No functional harm though. OWI is all we need here. Sid if DEBUG: print("oclc-other is: ", unicode_type(oclc_other_return)) pass ![]() |
![]() |
![]() |
![]() |
#281 |
Deviser
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
Classify API from 2015
Sid,
You have motivated me to compare the Classify API from 2015 that Library Codes uses to that of 2022, and update what is necessary. I will do that for the next version of LC for Calibre 6. Thanks. DaltonST |
![]() |
![]() |
![]() |
#282 |
Member
![]() Posts: 23
Karma: 10
Join Date: Mar 2022
Device: iPad 8
|
![]() ![]() ![]() |
![]() |
![]() |
![]() |
#283 |
Member
![]() Posts: 23
Karma: 10
Join Date: Mar 2022
Device: iPad 8
|
One change for a big difference - a suggestion
Here is a change that would increase the hit rate dramatically. When a stdnbr or owi Classify search returns a '4' code for multiple works, use this call to get the DDC/LC for the most popular work:
Classify.oclc.org/classify2/ClassifyDemo?wi=xxxxxx where "wi" is an attribute of Work, as in: <work author="Guggenbühl-Craig, Adolf" editions="63" format="Book" holdings="593" hyr="2020" itemtype="itemtype-book" lyr="1971" owi="646433" schemes="DDC LCC NLM" title="Power in the helping professions" wi="2486691"/> It is not obvious that this is available in the API, looking at the website, but it is how the Classify demo site does its magic when you click on a work. Importantly, you cannot put the wi number in the stdnbr field bc sometimes you will also get back an owi that matches. |
![]() |
![]() |
![]() |
#284 |
Deviser
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
Using wi (not owi) to create a '2' from a '4'
Yep. The OCLC Classify API Explorer does not even have an input for wi, just owi. Highly annoying. Good find.
This will create a '2' from a '4' having a returned wi of 2486691: http://classify.oclc.org/classify2/Classify?wi=2486691 Spoiler:
I will add this 2nd lookup to a '4' if 'wi' is included in its attributes. Thanks. DaltonST |
![]() |
![]() |
![]() |
#285 |
Deviser
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
New Test Version Posted
The latest test version with a minimum Calibre Version of 5.99.8 can be found here:
https://www.mobileread.com/forums/sh...9&postcount=13 SidJsn, thank you for the discovery. DaltonST |
![]() |
![]() |
![]() |
Tags |
ddc, dewey decimal, lcc, library of congress, oclc |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] KindleUnpack - The Plugin | DiapDealer | Plugins | 523 | 07-15-2025 06:45 PM |
[GUI Plugin] SmartEject | JimmXinu | Plugins | 125 | 05-08-2025 12:27 AM |
[GUI Plugin] Consolidate All Library Metadata (CALM) | DaltonST | Plugins | 334 | 02-02-2025 02:28 PM |
[GUI Plugin] Astro-ph | iatheia | Plugins | 14 | 07-25-2015 11:41 PM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |