I'm currently working on validation, and would like some input on the following issue:
Data we already have in the database may become "invalid" by some definition. This may happen because a property is deleted, the type of a property changes, or rules for validation become stricter, etc.
It would be bad if an invalid Snak somewhere in an entity would cause all processing of that claim or entity to fail - which would be the case if we just triggered an exception when we encountered such a snak. Just skipping over such Snaks would bean silently removing them with the next edit - also not a great option.
We really want to be able to show the snak as invalid in the UI, and allow users to replace it with something valid or remove it explicitly. So I came up with the notion of a PropertyBadValueSnak to represent invalid snaks. Relevant patches on gerrit:
https://gerrit.wikimedia.org/r/#/c/68952/ https://gerrit.wikimedia.org/r/#/c/68002/
(if you can't see these, it'S because they are tagged as "draft" and gerrit makes drafts visible only to invited reviewers... let me know and I'll add you).
So, to you think this is a good approach? Is the Snak level the right place for handling this case?
-- daniel