Currently “single value” counts non-deprecated statements. However, there are many properties where it makes more sense to require one best-rank statement, but allow several other non-deprecated statements as long as the best one is marked with preferred rank (for example “ethnic group”, “official website”, various website usernames, or “head of government”). There should be an optional constraint parameter to select this interpretation instead of the default one.
This is required for {T173695}, because currently there are many “single value” constraints that make more sense with this relaxed interpretation, so users would see too many invalid constraint violations.
For now, I would suggest the constraint parameter (property) name “counting mode”, with values “non-deprecated statements” (default) and “best-rank statements”. But that’s up for discussion :)
---
#patch-for-review:
- [x] [prepare `Context::getGroup`](https://gerrit.wikimedia.org/r/427675)
- [ ] [add `SingleBestValueChecker`](https://gerrit.wikimedia.org/r/427901)