Page MenuHomePhabricator

Enforce statement uniqueness on Filepage
Open, Needs TriagePublic


Should we consider adding some sort of mechanism for enforcing the uniqueness of statements in the Statements Panel on the Filepage?


Currently the user can do this:

  1. Navigate to some uploaded file's File page
  2. Add a statement like: "Depicts Taj Mahal (American Blues Musician)": Q353023
  3. Add another identical statement (also using Q353023)
  4. Publish their changes, so that both (identical) statements appear separately.

Furthermore, they can then set one of these identical statements to "Prominent"; it re-orders properly, but both statements remain. So it will be pretty easy from time of launch for users to add inconsistent data, even with good intentions.

Screenshot showing both prominent and non-prominent version of the same statement, on Test Commons:

Proposed Solution

We want to allow multiple statements which reference the same entity, in principle, because down the road more features may be added which will allow those statements to be differentiated.

But it would probably be good to consider adding a means to enforce statement "uniqueness" programmatically, no matter what level of qualifier support is present. Ideally this should be handled at the level of the data model, not in the UI – introduce a Statement class which has comparison methods, etc.

Depicts Q123 == Depicts Q123: identical statement
Depicts Q123 != Depicts Q123, Qualifier: P456 Q789: not identical

We should test for equality at whatever level of "depth" we support at the given time, and redundant/identical statements should be auto-pruned on publish. In a perfect world, anyway.

Event Timeline

egardner created this task.Apr 15 2019, 4:44 PM
Restricted Application added a project: Multimedia. · View Herald TranscriptApr 15 2019, 4:44 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
egardner updated the task description. (Show Details)Apr 15 2019, 4:51 PM

So, is statement uniqueness something we want to enforce, or are duplicate statements fine?

Ramsey-WMF added a subscriber: Ramsey-WMF.

We should continue to explore this but it's not a high priority now.

I think that it may be worth returning to this issue now that we are working on support for other data types.

Here's an example of the kind of thing I'd love to avoid:

If we have a top-level quantity-type panel ("Number of Wheels", in this example), ideally we would not allow multiple values of "2" to be input here unless they had different qualifiers attached. If we have a mechanism to enforce uniqueness, we could prune or consolidate such redundant items on publish (perform some kind of equality check and discard anything that is a duplicate).