Adding a claim to a redirected item throws a incorrect wikibase-validator-no-such-entity error message
Open, Needs TriagePublic

Description

I tried to add a claim on Q22010361 (https://www.wikidata.org/wiki/Q22010361) to https://www.wikidata.org/wiki/Q21345747 , but turns out it was redirected.

pywikibot.data.api.APIError: modification-failed: [[Q21345747|Q21345747]] not found [messages:[{u'html': {u'*': u'<a href="/wiki/Q21345747" title="Q21345747" class="mw-redirect">Q21345747</a> not found'}, u'name': u'wikibase-validator-no-such-entity', u'parameters': [u'[[Q21345747|Q21345747]]']}]; help:See https://www.wikidata.org/w/api.php for API usage]

The error message is incorrect. The entity at https://www.wikidata.org/entity/Q21345747 exists, it's just a redirect. Correct behaviour would be either:

  • Just accept it and add the target item (bit like how you get redirected when you open https://www.wikidata.org/entity/Q21345747)
  • Throw an error that I'm trying to make a claim with a redirect as target (preferable with the Q id of the target so it's easy to recover)

I would of course prefer option 1.

Multichill updated the task description. (Show Details)
Multichill raised the priority of this task from to Needs Triage.
Multichill added a subscriber: Multichill.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptJan 10 2016, 10:55 PM
hoo added a comment.Jan 11 2016, 8:00 PM

Related to option #1: T122357. For consistency reasons, I think we should go with the second approach.

Thinking about this. Adding a claim to a redirect isn't technically incorrect so it maybe should just be accepted.

Could we add a statement with the redirect and give a warning? Or add a statement with the redirect target and give a warning?

It seems to me that to keep the database in good shape and reduce edits fixing redirects we should resolve the redirect.

Addshore added a comment.EditedJan 21 2016, 1:54 PM

So per https://www.wikidata.org/w/index.php?title=Wikidata:Contact_the_development_team&oldid=294080633#Redirects_not_resolving_with_wbeditentity
This issue will happen with entityIds in any part of any JSON!
This includes using wbeditentity