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

Search entities in the correct namespace #1

Merged
merged 1 commit into from
Jun 18, 2019
Merged

Conversation

lucaswerkmeister
Copy link
Member

Instead of assuming that all entities are in namespace 0 (which is only true in a Wikidata-like installation, but not in a default Wikibase installation, and even then only for items, not properties), take the actual namespace of the requested entity from an injected EntityNamespaceLookup.

Also, if we can’t find the entity, throw an exception instead of returning count 0: it’s better to fail the import than to duplicate statements.

Fixes filbertkm#22.

Instead of assuming that all entities are in namespace 0 (which is only
true in a Wikidata-like installation, but not in a default Wikibase
installation, and even then only for items, not properties), take the
actual namespace of the requested entity from an injected
EntityNamespaceLookup.

Also, if we can’t find the entity, throw an exception instead of
returning count 0: it’s better to fail the import than to duplicate
statements.

Fixes filbertkm#22.
@lucaswerkmeister lucaswerkmeister merged commit 1e63b56 into master Jun 18, 2019
@lucaswerkmeister lucaswerkmeister deleted the fix22 branch June 18, 2019 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Importing existing entities re-adds statements
1 participant