Version: master
Severity: normal
Description
Details
- Reference
- bz48965
Event Timeline
I am allowed to save in the api (via wbcreateclaim) the following:
datavalue: {
value: {
time: "+00000001936-15-08T00:00:00Z",
timezone: 0,
before: 0,
after: 0,
precision: 11,
calendarmodel: "http://www.wikidata.org/wiki/Q12138"
},
type: "time"
http://www.wikidata.org/wiki/Q12138 is not a valid calendar model. It should be http://www.wikidata.org/entity/Q1985727.
This should be validated when the claim gets saved and return an error if the data value is not valid.
As it does get saved currently, we then see an error in the UI on an item page in the snak view:
"The value does not comply with the property's definition.
The value's data value type "ununserializable" does not match the property's data type's data value type "time"."
hmm... yeah, that's a tough one. On the one hand, do we really want to restrict it too much?
I would say that the error message is not too good. It should actually be "The data is saved with an unknown calendar model, to which we do not know how to translate to".
And then the saved data in proleptic gregorian could still be displayed.
I want to ask if we click on "http://www.wikidata.org/entity/Q1985727" we find error 404 so i think it should changes to something better like "
http://www.wikidata.org/wiki/Q12138" I mean don't remove restrictions, change it!
@amir we have a patch for supporting /entity/QXXX in apache. It should work soon.
@Denny it seems any arbitrary url or string can be put as calendar model. bots will go astray and have a potential mess.
I think it's best to have validation checked during save, so the api user has a chance to get it "right". Not sure about hard-coding the calendar models though. If they could be configurable and more flexible, that would be nice.
https://gerrit.wikimedia.org/r/68150 (Gerrit Change I891606) | change APPROVED and MERGED [by jenkins-bot]
https://gerrit.wikimedia.org/r/67962 (Gerrit Change I699098) | change ABANDONED [by Daniel Kinzler]
https://gerrit.wikimedia.org/r/68397 (Gerrit Change Ib3e7b1) | change ABANDONED [by Daniel Kinzler]