Import of entities from Wikidata fails if there are already items in the Wikibase that violate the rules for duplicates.
Specifically:
- properties with matching language+label combination are not allowed in a Wikibase
- items with matching language+label+description combination are not allowed in a Wikibase (unless description is empty - then it's fine).
We could approach fixing this in an iterative way:
First (T381996),
- If a conflict is encountered, the conflicting entity is gracefully skipped.
- For each import, we keep track of which entities were successfully imported and which were skipped due to a conflict.
- Ideally, save the log of the error in the database for skipped entities, so we could analyze why entities are being skipped (in case there are some other potential rules that we are still not aware of).
- Consider import a 'partial' success (new status) even if some/all entities were skipped due to such conflicts.
- Show an import report to the user that lists entities that were imported successfully and those that were skipped due to conflicts with existing entities in the Wikibase.
Then:
- The 'no more than one import per Wikibase' restriction could pretty much be removed.
Later:
- Predict which of the imported entities will conflict with those already existing in the Wikibase and show in UI before the user starts the import.
This sequence is based on the assumption that it is easier to catch errors during import than to write logic for prevention of those errors.