Deprecated: $wgMWOAuthSharedUserIDs=false is deprecated, set $wgMWOAuthSharedUserIDs=true, $wgMWOAuthSharedUserSource='local' instead [Called from MediaWiki\HookContainer\HookContainer::run in /var/www/html/w/includes/HookContainer/HookContainer.php at line 135] in /var/www/html/w/includes/Debug/MWDebug.php on line 372
Project:BotBased imports - MaRDI portal

Project:BotBased imports

From MaRDI portal

Synopsis

If you want to use a script to import / update items in the MaRDI Knowledge Graph, you might want to to that by using a Python script and the MardiClient library. This document describes the main steps.

Create a bot that will do the changes

  1. Login to the mardi-wikibase docker container
  2. Execute: php /var/www/html/w/maintenance/createAndPromote.php <BOTUSER_NAME> <BOTUSER_PW> --bot
  3. In case you need to change the Bot's password, use: php /var/www/html/w/maintenance/run.php changePassword --user=example --password=newpassword


Create the Python script

The core is something like this:

from mardiclient import MardiClient
mc = MardiClient(user="bot_username", password="bot_password", login_with_bot=True)
item = mc.item.new()
item.labels.set(language='en', value='My Label')
item.write()


Run the Python script

-)