Some of the constraint violation messages are hard to understand. This one is, in my opinion, particularly bad:
This property's value entity must be in the relation to the item (or a subclass of the item) defined in the parameters.
Example violation: Douglas Adams has religion: atheism, but atheism is not an instance of religion, which the religion property demands.
All the important information you need to understand this message – that the relation is “instance of”, and that the class is ”religion” – is hidden in the parameters, which the user script doesn’t display at all!
We should include this information in the message (hyperlinked), and also split up this particular message into two, one for “instance of” and one for “subclass of”. Suggestion:
This property’s value (atheism) must be an instance of religion, Christian church, or religious denomination (or a subclass thereof).
Perhaps the list of classes needs to be truncated if it’s very long, but most of the time I hope we should be able to include it fully.
Jan also suggested including the property name in the message. Perhaps something like this?
The value for religion (here: atheism) must be an instance of…
An entirely different question is whether we want to assemble this message server-side or in the user script. The API already returns all the information required to assemble the message (constraint type and parameters), but currently the message is built on the server, which keeps the client very simple (it doesn’t have to retrieve labels or know about translations).
T102758 seems to be related to this, but it seems unclear if anyone still knows what to do with that task.