Page MenuHomePhabricator

Configuring sitelinks in Wikibase
Open, Needs TriagePublic

Description

Momentarily we are in the process of adapting our new Wikibase to our needs which is a containerized Kubernetes cluster using the Dockerfiles. The Wikibase in question has the URL https://muwi.epfl.ch/

Overarching goal: We want to associate Wiki pages with Items in order to be able to render SPARQL query results.

Documentation: From the issue "documentation for sites setup" I took that the Wikibase Installation Manual is the way to go. My problem is that I couldn't find documentation that thoroughly explains

  1. what the differences are between the architectural decisions (enable Repo/Client only, both, or none)
  2. how the out-of-the-box configuration in the Docker containers behaves with regard to these setup options
  3. how to setup Wikibase Clients with their own databases

Comparing the pre-configured LocalSettings.php to the installation guide reveals that both Repo and Client are enabled even if the true flags for $wgEnableWikibase[Repo/Client] are not set (probably true by default but still a source of confusion for newbies). But the bigger confusion for me stems from section 4 "Let the repo-wiki know about the databases of the other client-wikis" because in the standard config both Repo and Client seem to be using the SQL database my_wiki, whereas in the installation guide, the two Clients seem to somehow be using their own databases enwiki, fawiki. I would be thankful if someone could reference existing documentation regarding the docker images and configuring the pre-configured client so that sitelinks can be used.

Intermediate goal: On every Item page there should (for now) be two sitelinks boxes on the right side, one for the internal Wiki called musewiki and one for Wikipedia. The internal Wiki is one Client only and it is in English.

Undertaken steps: Following the guide lead to me adding the following lines to LocalSettings.php:

$wgWBRepoSettings['siteLinkGroups'] = ['musewiki', 'wikipedia'];
$wgWBClientSettings['siteLinkGroups'] = ['musewiki', 'wikipedia'];

and configuring the heading in https://muwi.epfl.ch/wiki/MediaWiki:Wikibase-sitelinks-musewiki which adds the two sitelinks boxes alright.

Then I executed

php addSite.php --pagepath=https://muwi.epfl.ch/wiki/\$1 --filepath=https://muwi.epfl.ch/wiki/\$1 --language en --interwiki-id en en musewiki

which added the Wiki to the sites table in the my_wiki database (the only database at present).

Problem and resolution attempts:

From here on, I am a bit lost. The sitelink box for wikipedia is not working (does not allow you to search for pages), the sitelink box for musewiki pretends to let you search for a page but doesn't (example item) and the SetSiteLink-page (trying to link the Item Class to the page with the same name) returns the error

A page "https://muwi.epfl.ch/wiki/Class" could not be found on "en".

Following the installation guide and without better knowledge I added to the config the lines

$wgLocalDatabases = [ 'my_wiki' ];
$wgWBRepoSettings['localClientDatabases'] = array(
    'en' => 'my_wiki',
);

which does not resolve the problem. Then I made an attempt to configure the Client using the Required settings from the Advanced_configuration doc:

$wgWBClientSettings['repoUrl'] = 'https://muwi.epfl.ch';
$wgWBClientSettings['repoScriptPath'] = '/w';
$wgWBClientSettings['repoArticlePath'] = '/wiki/$1';
$wgWBClientSettings['siteGlobalID'] = 'en';
$wgWBClientSettings['siteGroup'] = 'musewiki';

but this didn't change the behaviour in any way.

Kindly asking for help:

  • How do I need to change the configuration?
  • Do I have to create a new SQL database for the Wikibase Client?
  • Is there a particular maintenance script that needs to be run?

Event Timeline

Johentsch created this task.Aug 5 2020, 7:56 AM
Restricted Application added a project: Wikidata. · View Herald TranscriptAug 5 2020, 7:56 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

By the way, I also tried adding

$wgWBClientSettings['repositories']['']['repoDatabase'] = 'my_wiki';
$wgWBClientSettings['repositories']['']['changesDatabase'] = 'my_wiki';

which broke the entire wiki with the error

Fatal error: Uncaught Error: Cannot use object of type Closure as array in /var/www/html/LocalSettings.php:98 Stack trace: #0 /var/www/html/includes/Setup.php(124): require_once() #1 /var/www/html/includes/WebStart.php(81): require_once('/var/www/html/i...') #2 /var/www/html/index.php(41): require('/var/www/html/i...') #3 {main} thrown in /var/www/html/LocalSettings.php on line 98
danshick-wmde removed a subscriber: danshick-wmde.
danshick-wmde added a subscriber: danshick-wmde.

Dear @Johentsch , I' ve recently setup a WikiBase on my own as well, so let me try to help you, if I can. Please note I installed it manually not using the containerized version, but I hope I can still be of help Let me try to help you, if I can.

what the differences are between the architectural decisions (enable Repo/Client only, both, or none)

As far as I intend the system:

  • none does not make sense, you would not use WikiBase at all
  • Repo-only if you setup an infrastructure similar to WikiMedia's WikiData: meaning you have a dedicated "data" installation of MediaWiki with WikiBase Repo to provide as a central repositry of data, and you have a separate, client-only, version to consume data. This is how I setup my system as well, incidentally.
  • both is having data and the wiki consuming them in the same MediaWiki installation.

Am I right in understanding that you are setting up things like this last case? Meaning you have a single MediaWiki instance (based on a single database) with WikiBase Repo and Client installed and enabled?

It seems to me you also have an issue with the sites configuration: I think the filepath should be

--filepath=https://muwi.epfl.ch/w/\$1

please check your setup if this is correct

Let's start clarify these few points and then let's go on troubleshooting.

Hi @lucamauri,

Thank you very much for taking the time!

Am I right in understanding that you are setting up things like this last case? Meaning you have a single MediaWiki instance (based on a single database) with WikiBase Repo and Client installed and enabled?

Yes if there are no arguments against this solution, that will be fine.

It seems to me you also have an issue with the sites configuration: I think the filepath should be

--filepath=https://muwi.epfl.ch/w/\$1

In order to correct this, I performed a TRUNCATE TABLE on sites and site_identifiers to then run

php addSite.php --pagepath=https://muwi.epfl.ch/wiki/\$1 --filepath=https://muwi.epfl.ch/w/\$1 --language en --interwiki-id en en musewiki

Now, on the SetSiteLink page, I get the error

The site ID "en" is unknown. Please use an existing site ID, such as "enwiki".

Any ideas as to how to proceed from here? I'm back from vacation so will be quick to reply. Thank you in advance!

Restricted Application added a subscriber: Huji. · View Herald TranscriptSep 14 2020, 3:35 PM