Page MenuHomePhabricator

wbmergeitems isn't merging claims properly
Closed, ResolvedPublic

Description

The merge item api module isn't merging claims correctly (example: https://www.wikidata.org/w/index.php?diff=95501306&oldid=88167854).

These merges were probably hit of from client's page connector, which sets ignoreconflicts=label|description (that *shouldn't* matter).

This is probably rather important as the client uses the API module per default without even telling the user that it's about to perform a merge.


Version: unspecified
Severity: major
Whiteboard: backlog

Details

Reference
bz58850

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 2:18 AM
bzimport set Reference to bz58850.
bzimport added a subscriber: Unknown Object (MLST).

This is per a design choice by Denny, I had originally written code that merged claims as I think you are expecting but the decision was made to not do this.

(In reply to comment #1)

This is per a design choice by Denny, I had originally written code that
merged
claims as I think you are expecting but the decision was made to not do this.

I feared that would come up as cause... can you remember the exact thing Denny said? Does it apply to all cases or... (there are quite some different examples for that, some simpler, some more complex ...) ? If this applies to all cases, I guess we want to WONTFIX this bug.

I seems to remember it applying for all cases but will wait for denny to respond

When merging two items, a statement from item 1 and a statement from item 2 can be merged if the claims are completely identical, i.e. if all qualifiers are identical and if the main snaks are identical. In particular, if only one claim has a qualifier and the other one does not, they can not be merged. If the set of qualifiers is overlapping, but not identical, they cannot be merged.

Merging in this case means that the claim stays, but all references can be added on the same claim. So if there is a statement with claim X and reference A on item 1, and a statement with claim X and reference B on item 2, the merged item can have a statement with claim X and references A and B.

Any difference in the claim though forbids merging, i.e.

population 23
reference A

and

population 23
method counting
reference B

can not be merged.

Change 106897 had a related patch set uploaded by Addshore:
Merge References for Statements in wbmergeitems

https://gerrit.wikimedia.org/r/106897

Please note that this will be a problem when we want to turn one item into a redirect after merging because this item *must* be empty after merging so that no data is lost. Perhaps we need some mechanism where the user has to decide which statements should be used in question.

Change 106897 merged by Jeroen De Dauw:
Merge References for Statements in wbmergeitems

https://gerrit.wikimedia.org/r/106897