Page MenuHomePhabricator

Merge Lexemes via a Special Page
Closed, ResolvedPublic13 Story Points

Description

As an editor I want to be able to merge two Lexemes in order to eliminate duplicates.

Screenshots:

Before merge of two items:

After successful merge of two items:

BDD

GIVEN I have two Lexemes that I consider to represent the same word
WHEN  I go to Special:MergeLexemes
AND   enter their IDs
AND   I click "merge Lexemes"
THEN  the source Lexeme is emptied and replaced by a redirect to the target Lexeme
AND   the lemmas are merged
      - lemmas that exist both on the target and the source are kept on the target
      - lemmas that exist only on the source are added to the target
AND   the statements are merged
      - statements that exist both on the target and the source are kept on the target
      - statements that exist only on the source are added to the target
      - statements are merged when their main snak is identical (resulting in one statement with the qualifiers and references from both statements)
AND   the forms are merged
      - if there exists a form on the source that is identical to a form on the target (i.e. they have identical grammatical features, at least one common representation and no different representations for the same spelling variant)
        - their representations are merged in the same way lemmas are merged
        - their statements are merged in the same way they're merged on the lexeme level
      - forms that only exist on the source are added to the target
AND   I get a confirmation message saying "L123 was merged into L1234 and redirected."

Acceptance criteria:

  • A new SpecialPage Special:MergeLexemes exists and can be used to merge two Lexemes.
  • After a merge the source Lexeme contains a MediaWiki redirect to the target Lexeme (just like it is done for items).
  • After the merge I can go to the URL of the source Lexeme and am redirected to the target Lexeme.
  • If there are identical Forms (same representation and grammatical features) in each Lexeme then the statements for that Form get added to the existing Form.

Notes:

  • Blocking of specific bad merges is not covered in this ticket.
  • Redirecting on the Form level is not to be done at this point - only the Lexeme level
  • Text and design on Special:MergeLexemes should be the same as on Special:MergeItems with s/Items/Lexemes. The text for the longer message should be "If you merge two Lexemes, all Lemmas, Statements, Forms and Senses will be moved from one Lexeme to the other."
  • Item pages after merge show a dedicated view (do not try to show the emptied item); let's ensure this happens for lexeme likewise

Details

Related Gerrit Patches:
mediawiki/extensions/WikibaseLexeme : masterSpecialMergeLexemes: list special page
mediawiki/extensions/WikibaseLexeme : masterHandle non-MergingExceptions thrown in LexemeMerger
mediawiki/extensions/WikibaseLexeme : masteri18n: add messages for merge summaries

Related Objects

Event Timeline

Lydia_Pintscher triaged this task as Normal priority.Jun 25 2018, 1:51 PM
Lydia_Pintscher created this task.
Lydia_Pintscher updated the task description. (Show Details)
Jakob_WMDE updated the task description. (Show Details)Jun 26 2018, 10:53 AM
Jakob_WMDE updated the task description. (Show Details)Jun 26 2018, 10:55 AM
Jakob_WMDE updated the task description. (Show Details)
Pablo-WMDE updated the task description. (Show Details)Jun 26 2018, 11:02 AM
Pablo-WMDE set the point value for this task to 13.Jun 26 2018, 12:25 PM
Vvjjkkii renamed this task from Merge Lexemes via a Special Page to ecaaaaaaaa.Jul 1 2018, 1:02 AM
Vvjjkkii raised the priority of this task from Normal to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed the point value for this task.
CommunityTechBot renamed this task from ecaaaaaaaa to Merge Lexemes via a Special Page.Jul 2 2018, 10:07 AM
CommunityTechBot lowered the priority of this task from High to Normal.
CommunityTechBot set the point value for this task to 13.
CommunityTechBot updated the task description. (Show Details)
Pablo-WMDE updated the task description. (Show Details)Jul 19 2018, 10:39 AM
KaMan added a subscriber: KaMan.Jul 30 2018, 11:35 AM
Lydia_Pintscher changed the status of subtask T199311: Create page Special:MergeLexemes from Open to Stalled.Aug 1 2018, 9:14 AM
Pablo-WMDE updated the task description. (Show Details)Aug 8 2018, 11:13 AM
Pablo-WMDE added a subscriber: Pablo-WMDE.EditedAug 27 2018, 3:56 PM

I tried the integration of all our changes. It seems to work, supports the expected error handling, and makes sense overall.
One thing I found a bit irritating on the "success page" is that the lexeme ids that were just successfully merged (and mentioned in the success message) are pre-filled into the form fields again - which, of course, leads to an error (the source can not be found) when clicking "Merge Lexemes" another time.
An open question to me are the change summaries; see merge of L11 into L12 as compared to Q153 into Q154.



Added a possible solution at https://gerrit.wikimedia.org/r/455589

UX-wise an item selector to pick the lexemes, and a help text explaining what the merging rules and preconditions are would be great.

Change 455589 had a related patch set uploaded (by Pablo Grass (WMDE); owner: Pablo Grass (WMDE)):
[mediawiki/extensions/WikibaseLexeme@master] i18n: add messages for merge summaries

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

Change 456113 had a related patch set uploaded (by Pablo Grass (WMDE); owner: Pablo Grass (WMDE)):
[mediawiki/extensions/WikibaseLexeme@master] SpecialMergeLexemes: list special page

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

Wohoooooooooo!
This seems to work nicely. One minor thing: There still seems to be an issue with the edit summary. Example at https://wikidata.beta.wmflabs.org/w/index.php?title=Lexeme:L1&diff=1054016&oldid=1054015 and in the screenshot below.

Pablo-WMDE added a comment.EditedAug 30 2018, 12:56 PM

@Lydia_Pintscher You found the control bug, congratulations (kidding). A single patch was not merged yet, is now. Please re-check (from 15:1515:30 to allow for deployment).

Change 455589 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] i18n: add messages for merge summaries

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

Change 456593 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/WikibaseLexeme@master] Handle non-MergingExceptions thrown in LexemeMerger

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

Change 456593 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Handle non-MergingExceptions thrown in LexemeMerger

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

Lydia_Pintscher closed this task as Resolved.Sep 1 2018, 7:09 PM

@Lydia_Pintscher You found the control bug, congratulations (kidding). A single patch was not merged yet, is now. Please re-check (from 15:1515:30 to allow for deployment).

:D

Change 456113 abandoned by Ladsgroup:
[DNM] SpecialMergeLexemes: list special page

Reason:
Suppressed by If06ee19e35f11aa4882223eb190f6fe5dcd396b9

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

Change 456113 restored by Ladsgroup:
[DNM] SpecialMergeLexemes: list special page

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

Change 456113 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] SpecialMergeLexemes: list special page

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