Page MenuHomePhabricator

Merging Wikidata items triggers EntityContentTooBigException
Open, Needs TriagePublic

Description

Trying to merge https://www.wikidata.org/wiki/Q113451747 and https://www.wikidata.org/wiki/Q113407772 using gadget-merge throws an error:

Error while "Merge with: Q113407772": [d9534912-9ab1-44bb-a284-636318b7cd0e] Caught exception of type Wikibase\Lib\Store\EntityContentTooBigException

I guess the work-around is to empty one of the items, then do the merge - or just to delete rather than merge. But I'm not sure what the best approach is here, hence this bug report'

Event Timeline

This afternoon, I got EntityContentTooBigException same as Mike Peel mentioned above.

Later, I used Gadget-dataDrainer.js to remove labels and descriptions, etc. in https://www.wikidata.org/wiki/Q113407772 before merging.

After removing labels, I did merging it again, but still got EntityContentTooBigException.

Error while "Merge with: Q113407772": [a0e46ed9-4f99-47a4-92b0-315d47389e44] Caught exception of type Wikibase\Lib\Store\EntityContentTooBigException

How to efficiently merge items from https://www.wikidata.org/wiki/Q113407772 to https://www.wikidata.org/wiki/Q113451747?

@Feliciss Your bot makes a ton of edits to just create this one item statement by statement. It would really be a lot better if you created it in one edit. The way the bot is working now is adding a ton of unnecessary edits that the system and editors have to deal with that don't seem necessary.

@Mike_Peel Have you tried Special:Merge already?

@Feliciss Your bot makes a ton of edits to just create this one item statement by statement. It would really be a lot better if you created it in one edit. The way the bot is working now is adding a ton of unnecessary edits that the system and editors have to deal with that don't seem necessary.

I'm not actually aware of a way to do this with pywikibot ... pointers would be appreciated!

@Mike_Peel Have you tried Special:Merge already?

I hadn't, but I just tried https://www.wikidata.org/wiki/Special:MergeItems - it returns "Error: ." in red. Looking at https://www.wikidata.org/w/index.php?title=Q113451747&action=history it got as far as removing the content, but not adding it into the other item.

@Lydia_Pintscher Any hints on how to create an item with one edit would be helpful!

Adding pywikibot tag - does any pywikibot developer have thoughts about saving multiple changes in one edit?

Adding pywikibot tag - does any pywikibot developer have thoughts about saving multiple changes in one edit?

You can create an item in a single edit like this:

import pywikibot

wikidata = pywikibot.Site('wikidata')
item = pywikibot.ItemPage(wikidata)
item.labels.update(...)  # add labels ("language: str" pairs)
item.descriptions.update(...)  # add descriptions ("language: str" pairs)
item.claims.update(...)  # add claims ("property id: list of Claims" pairs)
# etc.
item.editEntity(summary='summary')  # save

But I wonder what EntityContentTooBigException has to do with Pywikibot...

Adding pywikibot tag - does any pywikibot developer have thoughts about saving multiple changes in one edit?

You can create an item in a single edit like this:

import pywikibot

wikidata = pywikibot.Site('wikidata')
item = pywikibot.ItemPage(wikidata)
item.labels.update(...)  # add labels ("language: str" pairs)
item.descriptions.update(...)  # add descriptions ("language: str" pairs)
item.claims.update(...)  # add claims ("property id: list of Claims" pairs)
# etc.
item.editEntity(summary='summary')  # save

Thanks for your code.