= Wikibase Configuration =
This document describes the configuration of the Wikibase extensions.
As usual, the extension is configured in MediaWiki's LocalSettings.php file. However, Wikibase settings are placed in associative arrays, $wgWBRepoSettings
and $wgWBClientSettings
respectively, instead of individual global variables. So, if below the setting foo
is described below, you would need to use $wgWBClientSettings['foo']
in LocalSettings.php.
== Common Settings ==
=== Basic Settings ===
;changesDatabase: The database that changes are recorded to for processing by clients. This must be set to a symbolic database identifier that MediaWiki's LBFactory class understands; false
means that the wiki's own database shall be used. '''Note''' that on the client, this setting should usually be the same as the repoDatabase
setting.
;siteLinkGroups: The site groups to use in sitelinks. Must correspond to a value used to give the site group in the MediaWiki sites
table. Default is array( "wikipedia" ). This defines which groups of sites can be linked to Wikibase items. '''Note''' that this setting replaces the old ''siteLinkGroup'' setting, which only allowed for a single group.
;specialSiteLinkGroups: This maps one or more site groups into a single "special" group. This is useful if sites from multiple site groups should be shown in a single "special" section on item pages, instead of one section per site group. To show these site-groups you have to add the group "special" to the '''siteLinkGroups''' setting (see above).
;localClientDatabases: An array of locally accessible client databases, for use by the dispatchChanges.php
script. This setting determines which wikis changes are pushed to directly. It must be given either as an associative array, mapping global site IDs to logical database names, or, of the database names are the same as the site IDs, as a list of databases. The default is an empty array, indicating no local client databases.
=== Expert Settings ===
;sharedCacheKeyPrefix: Prefix to use for cache keys that should be shared among a wikibase repo and all its clients. The default is constructed from $wgDBname and WBL_VERSION. In order to share caches between clients (and the repo), set a prefix based on the repo's name and WBL_VERSION or a similar version ID.
:* NOTE: The default may change in order to use the repo's database name automatically.
;sharedCacheDuration: The default duration of entries in the shared object cache, in seconds. Default is 3600 seconds = 1 hour.
;sharedCacheType: The type of cache to use for the shared object cache. Defaults to $wgMainCacheType. Use CACHE_XXX constants.
;useChangesTable: Whether to record changes in the database, so they can be pushed to clients. Boolean, defaults to true
. May be set to false in situations where there are no clients to notify, to preserve space. '''Note''' that if this is true, the pruneChanges.php
script should be run periodically to remove old changes from the database table.
;changeHandlers: Array mapping change type IDs to handler classes. May be used by extensions to register additional change classes.
;disabledDataTypes: Array listing of disabled data types on a wiki. This setting is intended to be used a new Wikibase install without items yet, or to control deployment of new data types. This setting should be set the same in the client and repo settings.
Default:
array()
;maxSerializedEntitySize: The maximum serialized size of entities, in KB. Loading and storing will fail if this size is exceeded. This is intended as a hard limit that prevents very large chunks of data being stored or processed due to abuse or erroneous code. Defaults to MediaWiki core's $wgMaxArticleSize setting.
== Repository Settings ==
=== Basic Settings ===
;entityNamespaces: Defines which kind of entity is managed in which namespace; this is given as an associative array mapping content model IDs such as CONTENT_MODEL_WIKIBASE_ITEM
to namespace IDs. This setting is required for each kind of entity that should be supported.
;dataRightsUrl: Url to link to license for data contents. Defaults to $wgRightsUrl setting.
;dataRightsText: Text for data license link. Defaults to $wgRightsText setting.
;sparqlEndpoint: Url to the service description of the SPARQL end point for the repository. Defaults to null, meaning there is no SPARQL endpoint.
;badgeItems: Items allowed to be used as badges. This setting expects an array of serialized item ids pointing to their CSS class names, like array( 'Q101' => 'wb-badge-goodarticle' )
. With this class name it is possible to change the icon of a specific badge.
;preferredPageImagesProperties: List of image property id strings, in order of preference, that should be considered for the page_image
page property. Defaults to an empty array.
;conceptBaseUri: Base URI for building concept URIs (for example used in Rdf output). This has to include the protocol and domain, only an entity identifier will be appended.
;preferredGeoDataProperties: List of properties (by id string), in order of preference, that are considered when finding primary coordinates for the GeoData extension on an entity. Defaults to an empty array.
=== Expert Settings ===
;dispatchBatchChunkFactor: Chunk factor used internally by the dispatchChanges.php
script. The default is 3. If most clients are not interested in most changes, this factor can be raised to lower the number of database queries needed to fetch a batch of changes.
;idBlacklist: A list of IDs to reserve and skip for new entities. IDs are given as integers, the blacklist applies to all types of entities. '''Note:''' this may change in the future to allow separate blacklists for different kinds of entities.
;multilang-limits: Limits to impose on multilanguage strings like labels, descriptions and such. Supported limits:
:;length: the maximum length of the string, in characters.
:Default: array( 'length' => 250 )
;urlSchemes: Which URL schemes should be allowed in URL data values. The default is array( 'http', 'https' ). Other supported schemes are 'ftp' and 'mailto'. Schemes (protocols) added here will only have any effect if validation is supported for that protocol; that is, adding 'mailto' will work, while adding 'gopher' will do nothing.
;formatterUrlProperty: Property to be used on properties that defines a formatter URL which is used to link identifiers. The placeholder $1
will be replaced by the identifier. Example: https://www.wikidata.org/entity/$1
;transformLegacyFormatOnExport: Whether entity revisions stored in a legacy format should be converted on the fly while exporting. Enabled per default.
;allowEntityImport: allow importing entities via Special:Import and importDump.php. Per default, imports are forbidden, since entities defined in another wiki would have or use IDs that conflict with entities defined locally.
== Client Settings ==
=== Basic Settings ===
;namespaces: List of namespaces on the client wiki that should have access to repository items. Default: array()
(treated as setting is not set; all namespaces enabled)
;excludeNamespaces: List of namespaces on the client wiki to disable wikibase links, etc. for. Default: array()
Example: array( NS_USER_TALK )
;repoUrl: The repository's base URL, including the schema (protocol) and domain; This URL can be protocol-relative. Default is '//wikidata.org'
. '''Note:''' this may be removed once we can get this information from the sites table.
;repoConceptBaseUri: The base of the repository's concept URIs. Default is 'repoUrl/entity/'
. '''Note:''' this may be removed once we can get this information from the sites table.
;repoScriptPath: The repository's script path. Default is $wgScriptPath, assuming that the repo's script path is the same as this wiki's script path. '''Note:''' this may be removed once we can get this information from the sites table.
;repoArticlePath: The repository's article path. Default is $wgArticlePath, assuming that the repo's article path is the same as this wiki's script path. '''Note:''' this may be removed once we can get this information from the sites table.
;sort: How to sort language links in the side bar. Possible values:
:;'code'
: by language code
:;'alphabetic'
: [[meta:Interwiki_sorting_order|By language name]] (meta-native-languagename
)
:;'alphabetic_revised'
: [[meta:Interwiki_sorting_order|By language name (alternative)]] (meta-native-languagename-firstword
)
:;'none'
: Don't sort. Basically, the order of the links is not guaranteed. '''Deprecated''' and dysfunctional.
: Default is 'code'
.
;sortPrepend: List of language codes to put on top of the language links in the side bar. Default: array()
. '''Note''': this may change to use global wiki IDs instead of language codes in the future.
;interwikiSortOrders: Array of arrays of language codes, specifying custom sort orders for interwiki links; default options provided include 'code'
, 'alphabetic'
, 'alphabetic_revised'
, 'alphabetic_sr'
, and 'alphabetic_fy'
.
;alwaysSort: Sort links from wikitext even if {{noexternallanglinks:*}}
is used. Default: true
.
;siteGlobalID: This site's global ID (e.g. 'itwiki'
), as used in the sites table. Default: $wgDBname
.
;siteLocalID: This site's local ID resp. language code (e.g. 'it'
). Default: $wgLanguageCode
. '''Note:''' this setting will be removed once we can take this information from the sites table.
;siteGroup: This site's site group (e.g. 'wikipedia'
or 'wikivoyage'
) as used in the sites table. The setting is optional and falls back to site store lookup. For performance reasons, it may be desireable to set this explicitly to avoid lookups.
;repoSiteId: Site id of connected repository wiki. Default is to assume client and repo, so this setting defaults to siteGlobalID.
;repoSiteName: Site name of the connected repository wiki. Default is to assume client and repo are same wiki, so defaults to global $wgSitename setting. If not the same wiki, defaults to 'Wikidata'. This setting can also be set to an i18n message key and will be handled as a message, if the message key exists so that the repo site name can be translatable.
;repoDatabase: The logical name of the repository database, in a form that LBFactory can understand. If not null
, the client wiki will access the repository's database directly, instead of locally caching information received via change notifications. Default: null. Note that false
would mean "this wiki's database"! '''Note:''' this is currently required to be not null
, since local caching is not fully implemented.
// default for repo items in main namespace
;repoNamespaces: An array telling the client wiki which namespaces on the repository are used for which kind of entity. This is given as an associative array mapping entity type IDs such as Item::ENTITY_TYPE, to namespace names. This information is used when constructing links to entities on the repository. Default:
array(
'wikibase-item' => '',
'wikibase-property' => 'Property'
)
;allowDataTransclusion: switch to enable data transclusion features like the {{#property}} parser function and the wikibase Scribunto module. Defaults to true.
;allowArbitraryDataAccess: switch to allow accessing arbitrary items from the wikibase Scribunto module and the via the parser functions (instead of just the item which is linked to the current page). Defaults to true.
;allowDataAccessInUserLanguage: switch to allow accessing data in the user's language rather than the content language from the wikibase Scribunto module and the via the parser functions. Useful for multilingual wikis: Allows users to split the ParserCache by user language. Defaults to false.
;entityAccessLimit: limit for the number of different full entities that can be loaded on any given page, via Scribunto or the property parser function. Defaults to 200.
;propagateChangesToRepo: switch to enable or disable the propagation of client changes to the repo. Defaults to true.
;languageLinkSiteGroup: the ID of the site group to be shown as language links. Defaults to null, which means the site's own site group.
;badgeClassNames: A list of additional CSS class names for site links that have badges. The array has to consist of serialized item ids pointing to their CSS class names, like array( 'Q101' => 'badge-goodarticle' )
. Note that this extension does not add any CSS to actually display the badges.
;otherProjectsLinks: Site global id list of sites which should be linked in the other projects sidebar section.
;otherProjectsLinksByDefault: Whether to show links to other projects per default. If not set, the links can be enabled as a beta feature (see otherProjectsLinksBeta).
;otherProjectsLinksBeta: If this is set to true links to other projects will be available as beta feature, enabling every user to turn them on/ off if wanted. (Only applies if other project links aren't enabled per default and the BetaFeatures extension is installed)
=== Expert Settings ===
;injectRecentChanges: whether changes on the repository should be injected into this wiki's recent changes table, so they show up on watchlists, etc. Requires the dispatchChanges.php
script to run, and this wiki to be listed in the localClientDatabases
setting on the repository.
;showExternalRecentChanges: whether changes on the repository should be displayed on Special:RecentChanges, Special:Watchlist, etc on the client wiki. In contrast to injectRecentChanges
, this setting just removes the changes from the user interface. The default is false
. This is intended to temporarily prevent external changes from showing in order to find or fix some issue on a live site.