lc_classifications should be normalised and added to the work record
Problem
Import can add multiple copies of effectively the same lc classification
- HE308 .A63
- HE308
- HE308 .A63 1981
from example: https://openlibrary.org/books/OL4735764M
What should we be storing in this field?
Do we want Cutter numbers? (.A63) https://www.loc.gov/aba/publications/FreeCSM/G063.pdf Do we need the years?
We could strip out unneeded data, OR append the Cutter numbers and years to HE308 when it is made available.
Questions
- How is
lc_classificationused on OL? - Who uses it, for what usecases?
Example URL:
https://openlibrary.org/books/OL4735764M/The_urban_transportation_system?m=diff&b=13
Stakeholders
We have code already to normalize LCCs that should handle this; see https://github.com/internetarchive/openlibrary/blob/master/openlibrary/utils/lcc.py . We just have to wire it up/apply it at the right time.
We use it to power the library explorer LCC setting. So we do want cutter numbers for sorting.
Hi there! Can I try to work on this as my first issue, @cdrini @mekarpeles ? As I understand it, all we need to do is hook up the LCC normalizer and add some tests. I can start working on this as soon as it’s assigned. Thanks!
Hi @cdrini, I'm Raj, CS undergrad at SVNIT Surat, applying for GSoC 2026 for the Tag Cleanup project. Came across this issue while going through subjects-related work on the repo. One thing I noticed, there's already normalisation code in lcc.py, so the fix seems like it would be wiring that into the import pipeline so duplicates don't get written in the first place. Rather than cleaning them up after the fact. I'm thinking about something similar for the subjects cleanup, catching bad data at write time rather than having to deal with it retroactively across millions of records. So watching how this gets resolved will be really useful for understanding how the import pipeline works. No need to assign me, just wanted to share the thought and learn from how the team approaches it.
Hi @cdrini @mekarpeles , I'm Saman Aslam and I’ve been exploring this issue while preparing a GSoC proposal around tag/metadata cleanup.
From what I understand, normalization logic for LCC already exists (in lcc.py), but it’s not consistently applied during the import pipeline, which allows multiple variations (e.g., HE308, HE308 .A63) to be stored as separate entries.
It seems like integrating this normalization step at the ingestion stage (before persistence) could prevent these duplicates from being introduced in the first place, rather than relying on cleanup afterward.
I’m also curious, is this normalization currently applied in any specific parts of the pipeline (e.g., edits vs imports), or is it mostly unused at the moment?
Hi @cdrini and @mekarpeles, I'm Shakera, a GSoC 2026 aspirant. While my primary project interest is the Onboarding Flow, my background in Cybersecurity and GRC makes me naturally attentive to the 'input validation' and data integrity challenges presented here.
Since the Breakdown for this issue is currently open, I’ve drafted a structured path to ensure this 'implementation gap' is closed systematically:
- [ ] Governance Audit: Trace the Module: Import pipeline to verify exactly where the lcc.py normalization 'guardrail' is being bypassed.
- [ ] Functional Integrity: Ensure normalization logic preserves Cutter numbers (e.g., .A63) to protect the sorting requirements of the Library Explorer.
- [ ] Validation Suite: Establish a baseline of test cases using the provided samples (e.g., HE308 .A63 1981) to guarantee consistent, high-quality records moving forward.
I’m currently reviewing the logic in openlibrary/utils/lcc.py to identify the most effective 'check-point' for this normalization.
As pointed out in https://github.com/internetarchive/openlibrary/issues/1946#issuecomment-4959701629 , classifications should be stored at a work level since they relate to the work.
The purpose of the Cutter numbers (and years) is to enforce a strict single linear ordering of physical volumes on a shelf which is totally unnecessary in a computer based exploration model. If you want to group the HE308's by author alphabetically you don't need to be limited to a few characters of the Cutter since you have the full author's name available for use.
If someone wanted the full LC call number to reference in the LC, it might make sense to include the whole thing, but then it would need to go on the edition. In any practical scenario, a user is going to want to reconfirm the call number in the Library of Congress catalog anyway, so it doesn't really make sense to try to preserve this information.
Using this as a basis for browsing is archaic and needlessly restrictive. Any given volume can only have a single classification in this system, so for a book about city ferries you need to choose among:
- HE305-311 Urban transportation
- HE380.8-971 Water transportation
- HE5751-5870 Ferries
Of course for books which are about multiple subjects, the problem becomes even worse. The user is then constrained to navigate a multidimensional space in a linear fashion. If they start in a bin with black female Swahili poets, you have no idea if they want to navigate to other black woman writers, other African poets, or ... The linearization is going to have arbitrarily picked one of these dimensions as the "shelf order." Forcing modern readers into a physical shelf paradigm is nuts with the capabilities available from modern cataloging systems and computers.
Bottom line - LC classifications should be preserved for cross walks to legacy systems, but should not be a primary navigation tool.
EDIT: p.s. Wikipedia has this to say:
Because LCC was designed around the collections of the Library of Congress, it has an American, European, and Christian bias, as reflected mainly in the earlier developed schedules of D (World History), E and F (History of the Americas), and B (Philosophy, Psychology, Religion). On the other hand, the later-developed K (Law) gives fairly even weight to global law.[11] Today, the various schedules are maintained and revised by the Library's Policy and Standards Division, in conjunction with experts in each field. However, updating various schedules with classification biases is generally assumed to be impractical due to the massive workload that would result in,[5] especially as the "discipline" based classes of LCC have been entrenched in the average library user's mind.[19]
Like all classification systems, LCC struggles with catering to interdisciplinary scholars and topics, as ultimately, a book can only be shelved in a single location.[19] Additionally, LCC has a problem with "othering" marginalized groups, making works related to or authored by members of these groups particularly difficult to locate.[19] This is not a new issue, and libraries with more specialized collections about minority groups or issues sometimes eschew LCC,[19] with one example alternative classification being the Harvard–Yenching Classification, specifically developed for Chinese language materials.
Although it makes sense in theory that LCC are work-level metadata (similar to subjects), in reality they almost always contain edition-level data like year published, eg PR6029.R8.N647 1984. Some editions even have entirely different LCCs/classifications; e.g. some translations will have their English editions be classified under things like "Works Translated from Spanish", while their Spanish editions might classified under the exact topic.
I think the appropriate solution would be to store them at both levels. This allows the edition-level classifications to remain tightly coupled to the edition where they can be easily verified from in the verso page, and contain edition-specific info that is still useful to keep a record of. On the work, the classification can be stored without the edition-level details, and potentially aggregated/computed from the edition-level classifications. This is how Library Explorer works, but that aggregation happens during solr indexing and isn't saved to the work. E.g. You can see the these in solr here: https://openlibrary.org/search.json?q=ia%3A*+AND+lcc%3A*+AND+readinglog_count%3A[100+TO+*]&fields=key,title,author_name,lcc,lcc_sort . This also shows the wide variety of LCCs that exist for a single work, even excluding year differences.
I think in general that pattern of storing data at the edition-level and aggregating at the work level is a powerful one that allows for (1) easy verification since it keeps data close to the source, (2) avoids making certain details impossible to save, (3) allows for aggregate insights to be surfaced at the work-level.
@tfmorris W.r.t to your notes about Library Explorer, I'll post a comment I made to similar feedback a few years ago: https://news.ycombinator.com/item?id=25500125 . But that is a discussion that's rather adjacent to this issue.
Closing this since not sure there is any more action needed, and not seeing any more discussion.