<commit_before><?php
# DO NOT EDIT - This file is being maintained by Chef

$wgEnableWikibaseRepo = true;
$wgEnableWikibaseClient = true;

wfLoadExtension( 'WikibaseRepository', "$IP/extensions/Wikibase/extension-repo.json" );
wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" );
// Include Wikibase.searchindex.php to include string and text values in the full text index:
require_once "$IP/extensions/Wikibase/repo/config/Wikibase.searchindex.php";

# Adapted from $IP/extensions/Wikibase/repo/config/Wikibase.example.php
call_user_func( function() {
    global $wgContentHandlerUseDB,
        $wgDBname,
        $wgExtraNamespaces,
        $wgNamespacesToBeSearchedDefault,
        $wgWBRepoSettings;

    $wgContentHandlerUseDB = true;

    $baseNs = 120;

    // Define custom namespaces. Use these exact constant names.
    define( 'WB_NS_ITEM', $baseNs );
    define( 'WB_NS_ITEM_TALK', $baseNs + 1 );
    define( 'WB_NS_PROPERTY', $baseNs + 2 );
    define( 'WB_NS_PROPERTY_TALK', $baseNs + 3 );

    // Register extra namespaces.
    $wgExtraNamespaces[WB_NS_ITEM] = 'Item';
    $wgExtraNamespaces[WB_NS_ITEM_TALK] = 'Item_talk';
    $wgExtraNamespaces[WB_NS_PROPERTY] = 'Property';
    $wgExtraNamespaces[WB_NS_PROPERTY_TALK] = 'Property_talk';

    // Tell Wikibase which namespace to use for which kind of entity
    $wgWBRepoSettings['entityNamespaces']['item'] = WB_NS_ITEM;
    $wgWBRepoSettings['entityNamespaces']['property'] = WB_NS_PROPERTY;

    // Make sure we use the same keys on repo and clients, so we can share cached objects.
    $wgWBRepoSettings['sharedCacheKeyPrefix'] = $wgDBname;

    // Include Wikibase items in the regular search result by default
    $wgNamespacesToBeSearchedDefault[WB_NS_ITEM] = true;

    // the special group includes all the sites in the specialSiteLinkGroups,
    // grouped together in a 'Pages linked to other sites' section.
    $wgWBRepoSettings['siteLinkGroups'] = [ 'special' ];

    // these are the site_group codes as listed in the sites table
    $wgWBRepoSettings['specialSiteLinkGroups'] = ['osm'];

    // This option will start working in Wikibase v1.33 release. Noop until then.
    // https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Wikibase/+/469872/
    $wgWBRepoSettings['enableEntitySearchUI'] = false;

} );

// Adapted from "$IP/extensions/Wikibase/client/config/WikibaseClient.example.php";

// The global site ID by which this wiki is known on the repo.
// Defaults to $wgDBname.
// $wgWBClientSettings['siteGlobalID'] = "osm";

$wgWBClientSettings['injectRecentChanges'] = true;
$wgWBClientSettings['showExternalRecentChanges'] = true;

// Base URL for building links to the repository.
// Assumes your wiki is setup as "http://repo.example.org/wiki/"
// This can be protocol relative, such as "//www.wikidata.org"
$wgWBClientSettings['repoUrl'] = "https://wiki.openstreetmap.org";

// This setting is optional if you have the same type of setup for your
// repo and client.  It will default to using the client's $wgArticlePath setting,
// and if you do not have $wgArticlePath set anywhere, MediaWiki has a default for it.
$wgWBClientSettings['repoArticlePath'] = "/wiki/$1";

// Assuming your wiki is setup with such script path as "http://repo.example.org/w/api.php". This
// should be the same as the $wgScriptPath setting if you have it set in your repo. If $wgScriptPath
// is not set, then MediaWiki assumes a default.
//
// If your client and repo are setup in the same way, then the below setting is optional and will
// default to what you have $wgScriptPath set in the client.
$wgWBClientSettings['repoScriptPath'] = "/w";

// Tell the client which namespace ID on the repo holds which type of entity.
$baseRepoNs = 120;

define( 'WB_REPO_NS_ITEM', $baseRepoNs );
define( 'WB_REPO_NS_PROPERTY', $baseRepoNs + 2 );

$wgWBClientSettings['entitySources'] = [
        'local' => [
                'repoDatabase' => 'repo',
                'baseUri' => $wgWBClientSettings['repoUrl'] . '/entity',
                'entityNamespaces' => [
                        'item' => WB_REPO_NS_ITEM,
                        'property' => WB_REPO_NS_PROPERTY
                ],
                'rdfNodeNamespacePrefix' => 'wd',
                'rdfPredicateNamespacePrefix' => '',
                'interwikiPrefix' => '',
        ],
];

$wgWBClientSettings['namespaces'] = [ NS_MAIN ];

// Avoid complaints that nobody seems to know the cause off...
$wgWBClientSettings['entityUsagePerPageLimit'] = 500;
                                  
// no edit rights for anonymous users
$wgGroupPermissions['*']['item-term'] = false;
$wgGroupPermissions['*']['item-merge'] = false;
$wgGroupPermissions['*']['item-redirect'] = false;
$wgGroupPermissions['*']['property-term'] = false;
$wgGroupPermissions['*']['property-create'] = false;

// Logged-in users can edit statements, but disable merge/redirect/creating props
$wgGroupPermissions['user']['item-term'] = true;
$wgGroupPermissions['user']['item-merge'] = false;
$wgGroupPermissions['user']['item-redirect'] = false;
$wgGroupPermissions['user']['property-term'] = true;<commit_msg>Update repo configuration for Wikibase<commit_after><?php
# DO NOT EDIT - This file is being maintained by Chef

use MediaWiki\MediaWikiServices;
use Wikibase\Lib\SettingsArray;

$wgEnableWikibaseRepo = true;
$wgEnableWikibaseClient = true;

wfLoadExtension( 'WikibaseRepository', "$IP/extensions/Wikibase/extension-repo.json" );
wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" );
// Include Wikibase.searchindex.php to include string and text values in the full text index:
require_once "$IP/extensions/Wikibase/repo/config/Wikibase.searchindex.php";

# Adapted from $IP/extensions/Wikibase/repo/config/Wikibase.example.php
call_user_func( function() {
    global $wgContentHandlerUseDB,
        $wgDBname,
        $wgExtraNamespaces,
        $wgNamespacesToBeSearchedDefault,
        $wgWBRepoSettings;

    $baseNs = 120;

    // Define custom namespaces. Use these exact constant names.
    define( 'WB_NS_ITEM', $baseNs );
    define( 'WB_NS_ITEM_TALK', $baseNs + 1 );
    define( 'WB_NS_PROPERTY', $baseNs + 2 );
    define( 'WB_NS_PROPERTY_TALK', $baseNs + 3 );

    // Register extra namespaces.
    $wgExtraNamespaces[WB_NS_ITEM] = 'Item';
    $wgExtraNamespaces[WB_NS_ITEM_TALK] = 'Item_talk';
    $wgExtraNamespaces[WB_NS_PROPERTY] = 'Property';
    $wgExtraNamespaces[WB_NS_PROPERTY_TALK] = 'Property_talk';

    $wgWBRepoSettings['entitySources'] = function ( SettingsArray $settings ) {
        global $wgServer;

        $entityNamespaces = [
            'item' => WB_NS_ITEM,
            'property' => WB_NS_PROPERTY,
        ];

        $hookContainer = MediaWikiServices::getInstance()->getHookContainer();
        $hookContainer->run( 'WikibaseRepoEntityNamespaces', [ &$entityNamespaces ] );

        return [
             $settings->getSetting( 'localEntitySourceName' ) => [
                                    'entityNamespaces' => $entityNamespaces,
                                    'repoDatabase' => false,
                                    'baseUri' => $wgServer . '/entity/',
                                    'rdfNodeNamespacePrefix' => 'wd',
                                    'rdfPredicateNamespacePrefix' => '',
                                    'interwikiPrefix' => '',
             ],
        ];
    };

    // Make sure we use the same keys on repo and clients, so we can share cached objects.
    $wgWBRepoSettings['sharedCacheKeyPrefix'] = $wgDBname . ':WBL';
    $wgWBRepoSettings['sharedCacheKeyGroup'] = $wgDBname;

    // Include Wikibase items in the regular search result by default
    $wgNamespacesToBeSearchedDefault[WB_NS_ITEM] = true;

    // the special group includes all the sites in the specialSiteLinkGroups,
    // grouped together in a 'Pages linked to other sites' section.
    $wgWBRepoSettings['siteLinkGroups'] = [ 'special' ];

    // these are the site_group codes as listed in the sites table
    $wgWBRepoSettings['specialSiteLinkGroups'] = ['osm'];

    // This option will start working in Wikibase v1.33 release. Noop until then.
    // https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Wikibase/+/469872/
    $wgWBRepoSettings['enableEntitySearchUI'] = false;

} );

// Adapted from "$IP/extensions/Wikibase/client/config/WikibaseClient.example.php";

// The global site ID by which this wiki is known on the repo.
// Defaults to $wgDBname.
// $wgWBClientSettings['siteGlobalID'] = "osm";

$wgWBClientSettings['injectRecentChanges'] = true;
$wgWBClientSettings['showExternalRecentChanges'] = true;

// Base URL for building links to the repository.
// Assumes your wiki is setup as "http://repo.example.org/wiki/"
// This can be protocol relative, such as "//www.wikidata.org"
$wgWBClientSettings['repoUrl'] = "https://wiki.openstreetmap.org";

// This setting is optional if you have the same type of setup for your
// repo and client.  It will default to using the client's $wgArticlePath setting,
// and if you do not have $wgArticlePath set anywhere, MediaWiki has a default for it.
$wgWBClientSettings['repoArticlePath'] = "/wiki/$1";

// Assuming your wiki is setup with such script path as "http://repo.example.org/w/api.php". This
// should be the same as the $wgScriptPath setting if you have it set in your repo. If $wgScriptPath
// is not set, then MediaWiki assumes a default.
//
// If your client and repo are setup in the same way, then the below setting is optional and will
// default to what you have $wgScriptPath set in the client.
$wgWBClientSettings['repoScriptPath'] = "/w";

// Tell the client which namespace ID on the repo holds which type of entity.
$baseRepoNs = 120;

define( 'WB_REPO_NS_ITEM', $baseRepoNs );
define( 'WB_REPO_NS_PROPERTY', $baseRepoNs + 2 );

$wgWBClientSettings['entitySources'] = [
        'local' => [
                'repoDatabase' => $wgDBname,
                'baseUri' => $wgWBClientSettings['repoUrl'] . '/entity',
                'entityNamespaces' => [
                        'item' => WB_REPO_NS_ITEM,
                        'property' => WB_REPO_NS_PROPERTY
                ],
                'rdfNodeNamespacePrefix' => 'wd',
                'rdfPredicateNamespacePrefix' => '',
                'interwikiPrefix' => '',
        ],
];

$wgWBClientSettings['namespaces'] = [ NS_MAIN ];

// Avoid complaints that nobody seems to know the cause off...
$wgWBClientSettings['entityUsagePerPageLimit'] = 500;
                                  
// no edit rights for anonymous users
$wgGroupPermissions['*']['item-term'] = false;
$wgGroupPermissions['*']['item-merge'] = false;
$wgGroupPermissions['*']['item-redirect'] = false;
$wgGroupPermissions['*']['property-term'] = false;
$wgGroupPermissions['*']['property-create'] = false;

// Logged-in users can edit statements, but disable merge/redirect/creating props
$wgGroupPermissions['user']['item-term'] = true;
$wgGroupPermissions['user']['item-merge'] = false;
$wgGroupPermissions['user']['item-redirect'] = false;
$wgGroupPermissions['user']['property-term'] = true;
{'fraction_non_alphanumeric': 0.12478678516922524, 'fraction_numerical': 0.004129634617111052, 'mean_word_length': 3.373773066352572, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2494551', 'n_tokens_mistral': 3536, 'n_tokens_neox': 3262, 'n_words': 881}