2 # DO NOT EDIT - This file is being maintained by Chef
4 $wgEnableWikibaseRepo = true;
5 $wgEnableWikibaseClient = true;
7 wfLoadExtension( 'WikibaseRepository', "$IP/extensions/Wikibase/extension-repo.json" );
8 wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" );
9 // Include Wikibase.searchindex.php to include string and text values in the full text index:
10 require_once "$IP/extensions/Wikibase/repo/config/Wikibase.searchindex.php";
12 # Adapted from $IP/extensions/Wikibase/repo/config/Wikibase.example.php
13 call_user_func( function() {
14 global $wgContentHandlerUseDB,
17 $wgNamespacesToBeSearchedDefault,
20 $wgContentHandlerUseDB = true;
24 // Define custom namespaces. Use these exact constant names.
25 define( 'WB_NS_ITEM', $baseNs );
26 define( 'WB_NS_ITEM_TALK', $baseNs + 1 );
27 define( 'WB_NS_PROPERTY', $baseNs + 2 );
28 define( 'WB_NS_PROPERTY_TALK', $baseNs + 3 );
30 // Register extra namespaces.
31 $wgExtraNamespaces[WB_NS_ITEM] = 'Item';
32 $wgExtraNamespaces[WB_NS_ITEM_TALK] = 'Item_talk';
33 $wgExtraNamespaces[WB_NS_PROPERTY] = 'Property';
34 $wgExtraNamespaces[WB_NS_PROPERTY_TALK] = 'Property_talk';
36 // Tell Wikibase which namespace to use for which kind of entity
37 $wgWBRepoSettings['entityNamespaces']['item'] = WB_NS_ITEM;
38 $wgWBRepoSettings['entityNamespaces']['property'] = WB_NS_PROPERTY;
40 // Make sure we use the same keys on repo and clients, so we can share cached objects.
41 $wgWBRepoSettings['sharedCacheKeyPrefix'] = $wgDBname;
43 // Include Wikibase items in the regular search result by default
44 $wgNamespacesToBeSearchedDefault[WB_NS_ITEM] = true;
46 // the special group includes all the sites in the specialSiteLinkGroups,
47 // grouped together in a 'Pages linked to other sites' section.
48 $wgWBRepoSettings['siteLinkGroups'] = [ 'special' ];
50 // these are the site_group codes as listed in the sites table
51 $wgWBRepoSettings['specialSiteLinkGroups'] = ['osm'];
53 // This option will start working in Wikibase v1.33 release. Noop until then.
54 // https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Wikibase/+/469872/
55 $wgWBRepoSettings['enableEntitySearchUI'] = false;
59 // Adapted from "$IP/extensions/Wikibase/client/config/WikibaseClient.example.php";
61 // The global site ID by which this wiki is known on the repo.
62 // Defaults to $wgDBname.
63 // $wgWBClientSettings['siteGlobalID'] = "osm";
65 $wgWBClientSettings['injectRecentChanges'] = true;
66 $wgWBClientSettings['showExternalRecentChanges'] = true;
68 // Base URL for building links to the repository.
69 // Assumes your wiki is setup as "http://repo.example.org/wiki/"
70 // This can be protocol relative, such as "//www.wikidata.org"
71 $wgWBClientSettings['repoUrl'] = "https://wiki.openstreetmap.org";
73 // This setting is optional if you have the same type of setup for your
74 // repo and client. It will default to using the client's $wgArticlePath setting,
75 // and if you do not have $wgArticlePath set anywhere, MediaWiki has a default for it.
76 $wgWBClientSettings['repoArticlePath'] = "/wiki/$1";
78 // Assuming your wiki is setup with such script path as "http://repo.example.org/w/api.php". This
79 // should be the same as the $wgScriptPath setting if you have it set in your repo. If $wgScriptPath
80 // is not set, then MediaWiki assumes a default.
82 // If your client and repo are setup in the same way, then the below setting is optional and will
83 // default to what you have $wgScriptPath set in the client.
84 $wgWBClientSettings['repoScriptPath'] = "/w";
86 // Tell the client which namespace ID on the repo holds which type of entity.
89 define( 'WB_REPO_NS_ITEM', $baseRepoNs );
90 define( 'WB_REPO_NS_PROPERTY', $baseRepoNs + 2 );
92 $wgWBClientSettings['entitySources'] = [
94 'repoDatabase' => 'repo',
95 'baseUri' => $wgWBClientSettings['repoUrl'] . '/entity',
96 'entityNamespaces' => [
97 'item' => WB_REPO_NS_ITEM,
98 'property' => WB_REPO_NS_PROPERTY
100 'rdfNodeNamespacePrefix' => 'wd',
101 'rdfPredicateNamespacePrefix' => '',
102 'interwikiPrefix' => '',
106 $wgWBClientSettings['namespaces'] = [ NS_MAIN ];
108 // Avoid complaints that nobody seems to know the cause off...
109 $wgWBClientSettings['entityUsagePerPageLimit'] = 500;
111 // no edit rights for anonymous users
112 $wgGroupPermissions['*']['item-term'] = false;
113 $wgGroupPermissions['*']['item-merge'] = false;
114 $wgGroupPermissions['*']['item-redirect'] = false;
115 $wgGroupPermissions['*']['property-term'] = false;
116 $wgGroupPermissions['*']['property-create'] = false;
118 // Logged-in users can edit statements, but disable merge/redirect/creating props
119 $wgGroupPermissions['user']['item-term'] = true;
120 $wgGroupPermissions['user']['item-merge'] = false;
121 $wgGroupPermissions['user']['item-redirect'] = false;
122 $wgGroupPermissions['user']['property-term'] = true;
123 $wgGroupPermissions['user']['property-create'] = false;
125 // data-admin group should be the only one creating properties
126 $wgGroupPermissions['data-admin']['item-redirect'] = true;
127 $wgGroupPermissions['data-admin']['item-merge'] = true;
128 $wgGroupPermissions['data-admin']['property-create'] = true;
131 // See https://www.mediawiki.org/wiki/Wikibase/Installation/Advanced_configuration#Define_links_for_external_identifiers
132 $wgWBRepoSettings['formatterUrlProperty'] = 'P8';