Page MenuHomeMiraheze

WikiBase custom configuration
Closed, InvalidPublic

Description

As mentioned here https://meta.miraheze.org/wiki/Community_noticeboard#WikiBase_custom_configuration I would like to make some specific configuration to the WikiBase Repo extension on my wiki.
I would need to customise the variables

$wgWBRepoSettings['siteLinkGroups']
$wgWBClientSettings['specialSiteLinkGroups']
$wgWBRepoSettings['formatterUrlProperty']

and the sites table accordingly.
First of all, is this even possible? If yes, can you explain how?

Thanks

Event Timeline

Regarding the sites table, the answer is no as it would be overwritten anyway every 2 weeks unless we modified the global one.

The others, if you tells us what you want putting, I don't see why not.

Regarding the sites table, the answer is no as it would be overwritten anyway every 2 weeks unless we modified the global one.

This is unfortunate.
May I ask how other wikis handle SiteLinks and direct access within WikiBase without being able to add sites to the table? As far as I see the group is empty also for Miraheze's wikis themselves, so I assume the sites table only contains the standard sites. So nobody is SiteLinking and, most important, nobody is using direct access on wikis outside the standard ones?
It seems a greatly limiting factor to me, or maybe I misses something here.
Would you consider the possibility to allow users to contribute to new rows to your global sites table? I don't think number of addition will be high and unused sites won't make any harm to other wikis.

The others, if you tells us what you want putting, I don't see why not.

Kindly set them as follows:

$wgWBRepoSettings['siteLinkGroups'] = [ 'wikipedia', 'wikitrek', 'wikia', 'special' ];
$wgWBClientSettings['specialSiteLinkGroups'] = [ 'commons', 'wikidata', 'gamepedia' ];
$wgWBRepoSettings['formatterUrlProperty'] = 'P5';

Thanks a lot for your help in setting this and for considering a different handling process for sites.

The sites table is populated every 2 weeks for all wikis with all Miraheze wikis.

If it's a small specific set of wikis that you want adding then I don't know whether we can try and have the script tweaked to add them.

The sites table is populated every 2 weeks for all wikis with all Miraheze wikis.

Thanks for the info, but then something escapes me.
If you populate the table with all the Miraheze wikis, how come that no SiteLinking is possible?
As you can see here

MHSiteLink.png (90×397 px, 3 KB)

There is not even the field in the SiteLink pane: is this a deliberate choice to prevent SiteLink by design?

And another question: are you only adding Miraheze wikis to sites table? Meaning you are discarding the configuration with the default groups like wikipedia, commons, wikidata and so on?

Sorry if I sound very demanding, but I really need to understand how your SiteLinking infrastructure is organised.

Thanks.

And another question: are you only adding Miraheze wikis to sites table? Meaning you are discarding the configuration with the default groups like wikipedia, commons, wikidata and so on?

Only Miraheze Wikis, it should be running when you turn the extension on as well but I'll do a manual run for your wiki.

And another question: are you only adding Miraheze wikis to sites table? Meaning you are discarding the configuration with the default groups like wikipedia, commons, wikidata and so on?

Only Miraheze Wikis, it should be running when you turn the extension on as well but I'll do a manual run for your wiki.

and it's failing, see T6044: populateWikibaseSitesTable.php fails with Error: 1406 Data too long for column 'site_global_key' at row 1 (db11.miraheze.org)

! In T6041#118138, @RhinosF1 wrote:
Only Miraheze Wikis, it should be running when you turn the extension on as well but I'll do a manual run for your wiki.

May I suggest to modify your policy for sites table as following:

  • Keep all the standard Wikimedia-related sites
  • Add all Miraheze wikis (with the proper group!)
  • Set a procedure for users to be able to request the addition of custom sites.

This procedure will help users that rely on SiteLinks and won't impact all other users in any way.
Would this be agreeable? Shall we start a different request in Phabricator to discuss this?

I can see about the standard wikimedia ones if we can modify the script we reuse. I'd just leave the info on other wikis you want added here and we can work on it.

Try to use the importSites.php script, as explained here, with the following XML file:

<?xml version="1.0"?>
<sites xmlns="http://www.mediawiki.org/xml/sitelist-1.0/" version="1.0">
  <site type="mediawiki">
    <globalid>wikitrek</globalid>
    <group>wikitrek</group>
    <path type="page_path">https://wikitrek.org/index.php/$1</path>
    <path type="file_path">https://wiktrek.org/$1</path>
    <languagecode>it</languagecode>
  </site>
  <site type="mediawiki">
    <globalid>sto</globalid>
    <group>gamepedia</group>
    <path type="page_path">https://sto.gamepedia.com/$1</path>
    <path type="file_path">https://sto.gamepedia.com/$1</path>
    <languagecode>en</languagecode>
  </site>
</sites>

I believe the content is self-explanatory, anyway this file is adding two wikis respectively to wikitrek and gamepedia group. This would allow all users to link WikiBase entities to pages from those sites using SiteLink – of course provided that $wgWBRepoSettings['siteLinkGroups'] is properly configured accordingly.

I can see about the standard wikimedia ones if we can modify the script we reuse. I'd just leave the info on other wikis you want added here and we can work on it.

To do so, you should first (and, probably, periodically) run populateSitesTable.php from WikiBase extension.
Then add all the Miraheze wikis, I assume you have a custom script to do so.
Finally add user-specific site. For those, I am not sure what method to use, but keeping an XML file would be one possibility.

Try to use the importSites.php script, as explained here, with the following XML file:

<?xml version="1.0"?>
<sites xmlns="http://www.mediawiki.org/xml/sitelist-1.0/" version="1.0">
  <site type="mediawiki">
    <globalid>wikitrek</globalid>
    <group>wikitrek</group>
    <path type="page_path">https://wikitrek.org/index.php/$1</path>
    <path type="file_path">https://wiktrek.org/$1</path>
    <languagecode>it</languagecode>
  </site>
  <site type="mediawiki">
    <globalid>sto</globalid>
    <group>gamepedia</group>
    <path type="page_path">https://sto.gamepedia.com/$1</path>
    <path type="file_path">https://sto.gamepedia.com/$1</path>
    <languagecode>en</languagecode>
  </site>
</sites>

I believe the content is self-explanatory, anyway this file is adding two wikis respectively to wikitrek and gamepedia group. This would allow all users to link WikiBase entities to pages from those sites using SiteLink – of course provided that $wgWBRepoSettings['siteLinkGroups'] is properly configured accordingly.

This will just get overridden once the script works. We need to find a method to add other wikis to the script that populates it and get that working.

RhinosF1 edited projects, added Configuration; removed MediaWiki.
RhinosF1 edited projects, added MediaWiki; removed Configuration.

This will just get overridden once the script works. We need to find a method to add other wikis to the script that populates it and get that working.

Not necessarily: as I suggested before you can simply left your script as it is but run it after populateSitesTable.php and before importSites.php.
I understand this means running three script instead of one, but I consider this much easier than adapting your own script.

Script should run within 2 weeks now. Sub tasks are open for the additional feature requests. Closing this as invalid as it's simply a tracking task for 3 seperate issues/requests

Closing this as invalid as it's simply a tracking task for 3 seperate issues/requests

Well, this is not entirely correct: in fact the original request was to set the three parameters

$wgWBRepoSettings['siteLinkGroups'] = [ 'wikipedia', 'wikitrek', 'wikia', 'special' ];
$wgWBClientSettings['specialSiteLinkGroups'] = [ 'commons', 'wikidata', 'gamepedia' ];
$wgWBRepoSettings['formatterUrlProperty'] = 'P5';

which, by the way, I am not sure it ended up being done or not.

The additional tasks arose by this request, but it stand on its own as the configuration is necessary after the table is properly fixed anyway.