WikibaseImport icon indicating copy to clipboard operation
WikibaseImport copied to clipboard

Search entities in the correct namespace

Open lucaswerkmeister opened this issue 7 years ago • 4 comments

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 #22.

lucaswerkmeister avatar Apr 21 '17 21:04 lucaswerkmeister

I encountered the same error, can we push this to master?

D063520 avatar Jun 18 '19 09:06 D063520

The Wikidata/WikibaseImport fork has this and a few other fixes merged, try using that one.

lucaswerkmeister avatar Jun 18 '19 10:06 lucaswerkmeister

Hi Lucas,

you worked quite a bit on this repository ... do you know if pull requests are merged at some point? If not, would you take pull request in your repository?

Salut D063520

D063520 avatar Jun 18 '19 11:06 D063520

Before pulling this, I believe another change is needed for compatibility with Mediawiki 1.37.

WikibaseRepo::getDefaultInstance no longer exists, see https://phabricator.wikimedia.org/T280984 .

I am getting the following error when trying to import entities in Mediawiki 1.38:

Error: Call to undefined method Wikibase\Repo\WikibaseRepo::getDefaultInstance() Backtrace: from /var/www/.../w/extensions/WikibaseImport/maintenance/importEntities.php(112)

JohnRDOrazio avatar Oct 28 '22 14:10 JohnRDOrazio