openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Merging works fails in some cases "expected /type/author, found /type/redirect"

Open bitnapper opened this issue 2 years ago • 8 comments

Some Merges do not work, when auther is redirected.

Evidence / Screenshot (if possible)

{ "error": "bad_data", "message": "expected /type/author, found /type/redirect", "at": { "key": "/works/OL2718994W", "property": "authors.author" }, "value": "/authors/OL4335630A" }

Relevant url?

https://openlibrary.org/works/merge?records=OL2718994W,OL2719143W,OL10452052W,OL31461757W,OL31461827W,OL31461997W,OL31462067W,OL31465633W&primary=OL2718994W&mrid=64249

Details

  • Logged in (Y/N)? y
  • Browser type/version? Firefox 114.0.2
  • Operating system? macOS Ventura 13.4.1
  • Environment (prod/dev/local)? prod

bitnapper avatar Jul 09 '23 07:07 bitnapper

@bitnapper Some of those work records (OL31461827W,OL31461997W,OL31462067W) show no linked author, which may be a factor.

LeadSongDog avatar Jul 10 '23 03:07 LeadSongDog

@bitnapper

Some of those work records (OL31461827W,OL31461997W,OL31462067W) show no linked author, which may be a factor.

You are right. It shows an author on the merging page. On the edition page it shows an author in some cases but all seem to have at least one work with no author when editing the work.

bitnapper avatar Jul 10 '23 05:07 bitnapper

This one cant be merged because one edition seems to block it:

https://openlibrary.org/works/merge?records=OL2719042W,OL10452151W,OL31461888W,OL31461962W&primary=OL2719042W&mrid=64257

I tried to set the author again on this one but get an error:

https://openlibrary.org/books/OL22832530M/Inspector_West_at_home/edit

expected /type/author, found /type/redirect

image

bitnapper avatar Jul 10 '23 08:07 bitnapper

  • https://openlibrary.org/books/OL19210124M/
  • https://openlibrary.org/books/OL22832530M/
  • https://openlibrary.org/books/OL18169842M/
  • https://openlibrary.org/books/OL19210124M/
  • https://openlibrary.org/books/OL13719346M/
  • https://openlibrary.org/books/OL13811834M/
  • https://openlibrary.org/books/OL19934721M/
  • https://openlibrary.org/books/OL17844645M/
  • https://openlibrary.org/books/OL17844474M/
  • https://openlibrary.org/books/OL22287496M/
  • https://openlibrary.org/books/OL20026290M/
  • https://openlibrary.org/books/OL17430164M/
  • https://openlibrary.org/books/OL18169842M/

bitnapper avatar Jul 10 '23 09:07 bitnapper

https://openlibrary.org/works/merge?records=OL10581350W,OL11320148W&primary=OL10581350W&mrid=116907

bitnapper avatar Feb 11 '24 07:02 bitnapper

This one cant be merged because one edition seems to block it:

https://openlibrary.org/works/merge?records=OL2719042W,OL10452151W,OL31461888W,OL31461962W&primary=OL2719042W&mrid=64257

I tried to set the author again on this one but get an error:

https://openlibrary.org/books/OL22832530M/Inspector_West_at_home/edit

expected /type/author, found /type/redirect

image

Looking at https://openlibrary.org/works/OL10452151W.json That work has links from two editions OL15004265M and OL22832530M that each show a redirected author record OL4335630A, distinct from but resolving to the merged author record OL2751971A found for the work.

Root cause is that redirects are not being cleaned up from editions after author merges change work records. IMHO, such redirects should simply be pruned from the edition when they resolve to an author listed for the edition’s linked work.

#5594 and others relate.

LeadSongDog avatar Feb 11 '24 12:02 LeadSongDog

This one cant be merged because one edition seems to block it: https://openlibrary.org/works/merge?records=OL2719042W,OL10452151W,OL31461888W,OL31461962W&primary=OL2719042W&mrid=64257 I tried to set the author again on this one but get an error: https://openlibrary.org/books/OL22832530M/Inspector_West_at_home/edit expected /type/author, found /type/redirect image

Looking at https://openlibrary.org/works/OL10452151W.json That work has links from two editions OL15004265M and OL22832530M that each show a redirected author record OL4335630A, distinct from but resolving to the merged author record OL2751971A found for the work.

Root cause is that redirects are not being cleaned up from editions after author merges change work records. IMHO, such redirects should simply be pruned from the edition when they resolve to an author listed for the edition’s linked work.

#5594 and others relate.

I'm not sure if I understand what that means and what I can do when I encounter that problem. But I think the Merge-Page should not result in a success and close the merge-request when this happens.

bitnapper avatar Feb 15 '24 17:02 bitnapper

Agree that reporting success and closing should not happen when there is in fact a failure. My point was it should not need to fail: that seems to be the result of having edition records wrongly point to author records, aggravated by those author records being redirects. While I would prefer removing the author linkages from edition records, they should at least resolve to substantive author records, not redirects.

LeadSongDog avatar Feb 15 '24 19:02 LeadSongDog