filbertkm / WikibaseImport

Import entities from another Wikibase instance (e.g. Wikidata)
GNU General Public License v2.0
28 stars 18 forks source link

Search entities in the correct namespace #23

Open lucaswerkmeister opened 7 years ago

lucaswerkmeister commented 7 years ago

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.

D063520 commented 5 years ago

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

lucaswerkmeister commented 5 years ago

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

D063520 commented 5 years ago

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

JohnRDOrazio commented 1 year ago

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)