Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid creation of duplicates #116

Open
nichtich opened this issue Jun 10, 2020 · 2 comments
Open

Avoid creation of duplicates #116

nichtich opened this issue Jun 10, 2020 · 2 comments

Comments

@nichtich
Copy link
Contributor

nichtich commented Jun 10, 2020

When creating entities it is easy to accidentally create duplicates. Given the use case that:

  • you want to create a set of new entities
  • each entity can be identified by a unique value (aka "external identifier")

The creation of duplicates can be avoided by addition of an option --unique <property> (the letter i is already taken, so no --identifier). If this option is used, the creation of an entity will be rejected if

  • the entity to be created does not use the property
  • no entity with this property and its given value exist (requires to call MediaWiki API with haswbstatement)
@maxlath
Copy link
Owner

maxlath commented Jun 11, 2020

the uniqueness requirements of a property could actually be pulled from the properties constraints (ex: P268 constraints); we could default to applying the property constraints and having a flag to disable those checks(?) That would have a complexity and performance cost, but that could very much be worth it

@nichtich
Copy link
Contributor Author

Support of constraints seems more complex, might require SPARQL (which sometimes lags a few minutes), not all Wikibase instances use constraints, and Wikidata constraints are sometimes too strict but you don't want to turn of all of them . For my use case I'd prefer to check uniqueness but general support of constraints could be more useful in the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants