Repository navigation
Refactoring east_in_by_statement() import logic - #14220
Conversation
it's unclear the advantage of sometimes leaving commas in created records on save. It likely interferes with record matching and risks adding duplicates.
|
I totally support cleaning this up, but can you elaborate on what the data shows as far as the prevalence of this? Removing and then re-adding normalization support is one approach, but it seems fraught with the risk of it getting dropped altogether. Also, it's not just "Eastern" names that follow different orders. Wikidata/Wikipedia uses culturally appropriate Last First (as opposed to First Last) for some European cultures (Hungarian?). It looks like the cataloging standards have changed recently in this area and Preferred Name Variant might be something to keep an eye on: https://www.loc.gov/marc/authority/adx00.html One thing I definitely agree with is not changing name forms at the last minute before saving rather than normalizing them for matching first and trying to figure out what the best default display form. |
zgrep -c '"eastern_order":' ol_dump_authors_2026-10-31.txt.gz
0Shows there are no authors with the field I'm removing. I wouldn't characterise the code I'm removing as "normalization support". It seems to detect whether a name is in 'eastern order' if it's I'm not sure what the legacy 'feature' is. It seems to have survived because it hardly ever fires. Using a commafied version of an incoming author name is the one least likely to find an existing match because it is in no version of a natural name order. I suggest names are imported ideally the way they are intended to appear in records. Records will come in 'database' or 'natural' order, and should find existing records in either format (which |
tfmorris
left a comment
There was a problem hiding this comment.
You're right. This is a vestigial "feature" which was never fully implemented.
Culture specific name part ordering needs to be done based on the locale of the reader, so isn't something that can be done as part of import.
Following on from the investigation / TODO prompted by #14217 where this
east_in_by_statement()had a similar use pattern of being unlikely to fire, just before saving records.This PR removes the old
east_in_by_statement()check that is used inconsistently, and only on record save, not matching. It can only ever fire if an import record happens to have aby_statementwhich seems more likely on MARC records, which have other mechanisms for determining correct name forms.The end result seems to be Author records with commas, since the result is only ever used to skip a
do_flip()just before saving a record.If we import
"name": "Toyama, Keiichirō"that happens to have a by_statement containing "Toyama Keiichirō" OL will create a record "Toyama, Keiichirō"
If the "by_statement" is missing (which it will most likely be from most import paths), it will create "Keiichirō Toyama"
In matching, "Keiichirō Toyama" will be considered, but not "Toyama, Keiichirō"
There is one existing use of
load_author_import_records()for works which also ignores eastern name order, and is another source of inconsistency.Bottom line:
(there's a legacy
eastern_orderfield on Authors that is currently never set or used)With the improved 'alternate script' handling, original names in original script can be imported from MARC records.
For real world use cases,
alternate_nameswill suffice.It seems either
or
are preferrable to:
as both occur naturally in differnt contexts, and both can be mapped using
alternate_names"Murakami, Haruki" as the record title is a false compromise that deosn't help anyone, and is excluded from the normal matching lookups.
Technical
Testing
Screenshot
Stakeholders