Jump to content

Topic on Talk:Wikibase/Flow

Using the main namespace for items

2
Till Kraemer (talkcontribs)

Hello, I'm running MediaWiki 1.40.0 and I would like to use the main namespace for items like on Wikidata. Can I just add something to LocalSettings.php of the repository or do I have to edit Wikibase.example.php? I'm currently using the default Wikibase.example.php and my LocalSettings.php looks like this.

Also, I'm still having issues with pre-1.37.0 items. They look like this (NSFW) while new items look like this (NSFW).

Any ideas on how to fix this are very much appreciated! Thanks, cheers and all the best!

Till Kraemer (talkcontribs)

I'm not sure if this is the best way to do it but this seems to work for me:


LocalSettings.php of the repo:


wfLoadExtension( 'WikibaseRepository', "$IP/extensions/Wikibase/extension-repo.json" );

$wgWBRepoSettings['siteLinkGroups'] = [ 'mywiki', 'pool', 'quote' ];

$wgWBRepoSettings['localClientDatabases'] = array(

    'de' => 'dewiki',

    'en' => 'enwiki',

    'ja' => 'jawiki',

);

$wgExtraNamespaces[120] = "Property";

$wgExtraNamespaces[121] = "Property_talk";

$entitySources = [

    'data' => [

        'entityNamespaces' => [ 'item' => 0, 'property' => 120 ],

        'repoDatabase' => 'datawiki',

        'baseUri' => 'https://data.mywiki.com/wiki/',

        'interwikiPrefix' => '',

        'rdfNodeNamespacePrefix' => '',

        'rdfPredicateNamespacePrefix' => 'wd',

        'type' => 'db'

    ],

];

$wgWBRepoSettings['entitySources'] = $entitySources;

$wgWBRepoSettings['localEntitySourceName'] = 'data';


LocalSettings.php of the clients:


wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" );

$wgWBClientSettings['repoUrl'] = 'https://data.mywiki.com';

$wgWBClientSettings['repoScriptPath'] = '';

$wgWBClientSettings['repoArticlePath'] = '/wiki/$1';

$entitySources = [

'datawiki' => [

'repoDatabase' => 'datawiki',

        'baseUri' => 'https://data.mywiki.com/wiki/',

        'entityNamespaces' => [

            'item' => 0,

            'property' => 120,

       ],

        'interwikiPrefix' => '',

        'rdfNodeNamespacePrefix' => '',

        'rdfPredicateNamespacePrefix' => 'wd',

    ],

];

$wgWBClientSettings['entitySources'] = $entitySources;

$wgWBClientSettings['itemAndPropertySourceName'] = 'datawiki';

$wgWBClientSettings['siteLinkGroups'] = [ 'mywiki' ];

$wgWBClientSettings['siteGlobalID'] = 'enwiki';

$wgWBClientSettings['otherProjectsLinks'] = [ 'poolwiki', 'quotewiki' ];


After the changes, I also ran cleanupTitles.php on the repo. Thanks and cheers!