Wikibase
MediaWiki Wikibase extension
|
This document describes the configuration of the Wikibase components.
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 the setting foo
is described below, you would need to use $wgWBRepoSettings['foo']
or $wgWBClientSettings['foo']
in LocalSettings.php.
Default settings in each Wikibase settings array are setup buy loading WikibaseLib.default.php followed by the default settings file for either:
Common settings exist on both a Repo and the Client.
The site groups to use in sitelinks.
sites
table.DEFAULT: is []
(This defines which groups of sites can be linked to Wikibase items.)
EXAMPLE: [ 'wikipedia', 'wikibooks', 'special' ]
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.
EXAMPLE: [ 'commons', 'meta', 'wikidata' ]
See md_docs_topics_change-propagation
Whether to record changes in the database, so they can be pushed to clients.
Boolean, may be set to false
in situations where there are no clients to notify to preserve space. If this is true
, the pruneChanges.php script should run periodically to remove old changes from the database table.
DEFAULT: true
The database that changes are recorded to by a repo for processing by clients.
false
means that the wiki's own database shall be used.Base URL of geo shape storage frontend.
Used primarily to build links to the geo shapes. Will be concatenated with the page title, so should end with /
or title=
. Special characters (e.g. space, percent, etc.) should not be encoded.
DEFAULT: "https://commons.wikimedia.org/wiki/"
DEFAULT: "https://commons.wikimedia.org/w/api.php"
Base URL of tabular data storage frontend.
Used primarily to build links to the tabular data pages. Will be concatenated with the page title, so should end with /
or title=
. Special characters (e.g. space, percent, etc.) should not be encoded.
DEFAULT: "https://commons.wikimedia.org/wiki/"
DEFAULT: "https://commons.wikimedia.org/w/api.php"
Group name for a group of Wikibases.
Similar to sharedCacheKeyPrefix and normally a part of sharedCacheKeyPrefix, however this shared cache key group should be used as a part of keys generated within Wikibase.
DEFAULT: Constructed from $wgDBname.
Prefix to use for cache keys that should be shared among a wikibase repo and all its clients.
In order to share caches between clients (and the repo), set a prefix based on the repo's name and optionally some version ID.
DEFAULT: Constructed from $wgDBname.
The duration of entries in the shared object cache, in seconds.
DEFAULT: 3600 seconds (1 hour).
The type of cache to use for the shared object cache. Use CACHE_XXX
constants.
DEFAULT: $wgMainCacheType
The wb_terms table is DEPRECATED and will be removed in the future.
Whether to use the search-related fields (term_search_key
and term_weight
) of the wb_terms table.
This should not be disabled unless some other search backend is used.
If true, write search-related fields of the wb_terms table even if they are not used.
Useful if you want to experiment with useTermsTableSearchFields and don’t want missed updates in the table.
An associative array mapping entity source names to settings relevant to the particular source.
See the entitysources topic for more details about the value of this setting.
Name of the entity source name of the "local" repo. "local" is in quotes here, as "local" does not necessarily mean the local wiki. Should be the name of the entity source defined in entitySources setting.
This setting is intended to be used by Wikibase installations with complex setups which have multiple repos attached. In these complex situations:
DEFAULT: local
Array listing of disabled data types on a wiki.
This setting is intended to be used in a new Wikibase installation without items yet, or to control deployment of new data types. This setting should be set to the same value in both client and repo settings.
DEFAULT: []
(empty array)
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.
DEFAULT: $wgMaxArticleSize
DEFAULT: false
DEFAULT: false
URL to link to license for data contents.
DEFAULT: $wgRightsUrl
URL to link to license in RDF outputs.
DEFAULT: http://creativecommons.org/publicdomain/zero/1.0/
(Public domain)
URL to the service description of the SPARQL end point for the repository.
DEFAULT: null
(There is no SPARQL endpoint.)
EXAMPLE: https://query.wikidata.org/sparql
Base URI for building concept URIs (used in Rdf output).
This has to include the protocol and domain, only an entity identifier will be appended.
DEFAULT: Constructed from $wgServer with http protocol and /entity/ path.
EXAMPLE: http://www.wikidata.org/entity/
Mapping of globe URIs to canonical names, as recognized and used by GeoData extension when indexing and querying for coordinates.
EXAMPLE: ['http://www.wikidata.org/entity/Q2' => 'earth']
Allows the entity id generator to be chosen. (See md_docs_storage_id-counters)
DEFAULT: original
Allows values: original
or mysql-upsert
Should a separate DB connection be used to generate entity IDs? (See md_docs_storage_id-counters)
DEFAULT: false
Items allowed to be used as badges.
This setting expects an array of serialized item IDs pointing to their CSS class names. With this class name it is possible to change the icon of a specific badge.
EXAMPLE: [ 'Q101' => 'wb-badge-goodarticle' ]
List of image property ID strings, in order of preference, that should be considered for the page_image
page property.
DEFAULT: []
(An empty array.)
EXAMPLE: [ 'P10', 'P123', 'P8000' ]
List of properties (by ID string), in order of preference, that are considered when finding primary coordinates for the GeoData extension on an entity.
DEFAULT: []
(An empty array.)
Property to be used on properties that defines a formatter URL which is used to link external identifiers.
The placeholder $1
will be replaced by the identifier. When formatting identifiers, each identifier's property page is checked for its formatter URL (e.g. http://d-nb.info/gnd/$1
) specified by the property from this setting.
EXAMPLE: On wikidata.org, this is set to P1630
, a string property named “formatter URL”.
Property to be used on properties that defines a URI pattern which is used to link external identifiers in RDF and other exports. The placeholder $1
will be replaced by the identifier.
When exporting identifiers to RDF or other formats, each identifier's property page is checked for its URI pattern (e.g. http://d-nb.info/gnd/$1/about/rdf
) specified by the property from this setting.
EXAMPLE: On wikidata.org, this is set to P1921
, a string property named “URI used in RDF”.
If you want to use another lock mechanism for dispatching changes to clients instead of database locking (which can occupy too many connections to the master database), set its name in this config.
See $wgLockManagers documentation in MediaWiki core for more information on configuring a locking mechanism inside core.
If set to a positive number, the median dispatch lag (in seconds) will be divided by this number and passed to core like database lag (see the API maxlag parameter).
DEFAULT: 0
(disabled)
Chunk factor used internally by the dispatchChanges.php script.
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.
DEFAULT: 3
Overrides the default value for batch-size in dispatchChanges.php
DEFAULT: 1000
Overrides the default value for max-chunks in dispatchChanges.php
DEFAULT: 15
Overrides the default value for dispatch-interval in dispatchChanges.php in seconds.
DEFAULT: 60
Overrides the default value for randomness in dispatchChanges.php
DEFAULT: 15
Overrides the default value for max-time in dispatchChanges.php in seconds.
DEFAULT: 3600
(1 hour)
Overrides the default value for idle-delay in dispatchChanges.php in seconds.
DEFAULT: 10
An array of locally accessible client databases, for use by the dispatchChanges.php script.
See md_docs_topics_change-propagation This setting determines to which wikis changes are pushed 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.
DEFAULT: []
(An empty array, indicating no local client databases.)
Wikidata has all client sites listed in this array.
Whether entity revisions stored in a legacy format should be converted on the fly while exporting.
DEFAULT: true
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.
DEFAULT: false
Array that maps between page property values and Wikibase predicates for RDF dumps.
Maps from database property name to an array that contains a key ‘'name’(RDF property name, which will be prefixed by
wikibase:) and an optional key
'type'`.
This is the default database group to use in dump maintenance scripts, it defaults to dump
. Set to null
to use the value from $wgDBDefaultGroup.
DEFAULT: dump
Array of entity type names which are not available to be output as RDF.
DEFAULT: []
(meaning RDF is available for all entity types)
Formats that shall be available via SpecialEntityData.
The first format will be used as the default. Even if a format is allowed here, it may not be supported because when missing optional dependencies (e.g. purtle). The formats are given using logical names as used by EntityDataSerializationService.
Number of seconds for which data output on Special:EntityData should be cached.
Note: keep that low, because such caches cannot always be purged easily.
DEFAULT: $wgCdnMaxAge
Boolean to determine if entity search UI should be enabled or not.
This overrides the behaviour of the default search box UI in MediaWiki.
DEFAULT: true
Array of properties (by ID string) that should be included in the statement_keywords
field of the search index.
Relevant only for search engines supporting it.
Array of auto-indexed type names.
Statements with properties of this type will automatically be indexed in the statement_keywords
field.
Relevant only for search engines supporting it.
Array of properties (by ID string) that should be excluded from the statement_keywords
field.
This takes priority over other searchIndex* settings.
Relevant only for search engines supporting it.
Array of properties (by ID string) that, if used in a qualifier, will be used to write a value to the ‘'statement_quantity’` field.
Relevant only for search engines supporting it.
Enable/Disable Termbox v2. Setting it to true
will enable both client-side and server-side rendering functionality. In order for server-side rendering to work the respective service needs to be set up and ssrServerUrl
has to be set accordingly.
DEFAULT: false
(so all Termbox v2 functionality is disabled)
The url to where the server-side-renderer server (for termbox) is running.
Time after which wikibase aborts the connection to the ssr server.
DEFAULT: 3
Enable/Disable server-side rendering (SSR) for user-specific termbox markup.
DEFAULT: true
It only comes into effect if the general termboxEnabled is true
. If disabled, user-specific termbox markup will only be created by client-side rendering after initial displaying of the generic termbox markup.
Text for data license link.
DEFAULT: $wgRightsText
Configuration to group statements together based on their datatype or other criteria like "propertySet". For example, putting all of external identifiers in one place.
EXAMPLE:
Section configurations other than "statements" and "identifiers" require you to define wikibase-statementsection-*
messages for section headings to be rendered correctly.
DEFAULT: []
A map from entity ID type to a list of IDs to reserve and skip for new entities of that type.
IDs are given as integers.
DEFAULT: []
(empty array)
EXAMPLE: [ 'item' => [ 1, 2, 3 ] ]
Limits to impose on various strings, such as multilanguage terms, various data types etc.
Supported string types:
Supported limits:
DEFAULT:
DEPRECATED ( use string-limits ). Limits to impose on multilanguage strings like labels, descriptions and such. Supported limits:
Which URL schemes should be allowed in URL data values.
Supported schemes are ftps
, ircs
, mms
, nntp
, redis
, sftp
, telnet
, worldwind
and gopher
. Schemes (protocols) added here will only have any effect if validation is supported for that protocol; that is, adding ftps
will work, while adding dummy
will do nothing.
DEFAULT: is ['bzr', 'cvs', 'ftp', 'git', 'http', 'https', 'irc', 'mailto', 'ssh', 'svn']
Defines which kind of entity is managed in which namespace.
It is given as an associative array mapping entity types such as ‘'item’` to namespaces (IDs or canonical names). Mapping must be done for each type of entity that should be supported. If entities are stored in alternative slots, the syntax <namespace>/<slot> can be used to define which slot to use.
EXAMPLE: ['item' => 0, 'property' => 120, 'slottedEntity' => '123/slotname']
An associative array mapping foreign repository names to settings relevant to the particular repository. Each repository's settings are an associative array containing the following keys:
Definition for unit conversion storage.
Should be in the format ObjectFactory understands.
EXAMPLE: [ 'class' => 'Wikibase\\Lib\\JsonUnitStorage', 'args' => [ 'myUnits.json' ] ]
Special non-canonical languages and their BCP 47 mappings
Based on: https://meta.wikimedia.org/wiki/Special_language_codes
Enable the repo parts of the Data Bridge Feature; see the corresponding client setting for more information.
DEFAULT: false
Enable/Disable the tainted reference feature.
DEFAULT: false
Enable the federated properties feature. Note that once this feature is enable (set true), it must not be disabled (set false) again. The behaviour is unpredicted if it is disabled after it was enabled.
DEFAULT: false
A url path for the location of the source wikibase instance. The set url path should allow access to both index.php
and api.php
DEFAULT: https://www.wikidata.org/w/
Whether to propagate changes in revision visibility to client wikis.
DEFAULT: false
.
Value of the $wgRCMaxAge
setting, which specifies the max age (in seconds) of entries in the recentchanges
table, on the client wikis.
DEFAULT: $wgRCMaxAge.
Batch size (how many revisions per job) to use when pushing ChangeVisibilityNotification
jobs to clients.
DEFAULT: 3
.
List of namespaces on the client wiki that should have access to repository items.
DEFAULT: []
(Treated as setting is not set, ie. All namespaces are enabled.)
List of namespaces on the client wiki to disable wikibase links, etc. for.
DEFAULT: []
EXAMPLE: [ NS_USER_TALK ]
.
This site's global ID (e.g. ‘'itwiki’`), as used in the sites table.
DEFAULT: $wgDBname.
This site's local ID respective language code (e.g. ‘'it’`).
DEFAULT: $wgLanguageCode.
NOTE: This setting will be removed once we can take this information from the sites table.
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 desirable to set this explicitly to avoid lookups.
Site ID of connected repository wiki
DEFAULT: is to assume both client and repo are the same.
DEFAULT: Same as siteGlobalID wikibase setting
Site name of the connected repository wiki.
The 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.
DEFAULT: $wgSitename
An array telling the client wiki which namespaces on the repository are used for which entity type.
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: (items in main namespace):
Most Wikibases do not use the main namespace. The example settings file does not use the main namespace.
The repository's base URL, including the schema (protocol) and domain; This URL can be protocol-relative.
DEFAULT: //wikidata.org
NOTE: This may be removed once we can get this information from the sites table.
The repository's script path.
DEFAULT: $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.
The repository's article path.
DEFAULT: $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.
URL to use for retrieving the property order used for sorting properties by property ID.
Will be ignored if set to null.
EXAMPLE: https://www.wikidata.org/w/index.php?title=MediaWiki:Wikibase-SortedProperties&action=raw&sp_ver=1
Switch to enable data transclusion features like the {{#property}}
parser function and the wikibase
Scribunto module.
DEFAULT: true
Switch to enable local override of the central description with {{SHORTDESC:}}
.
DEFAULT: false
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).
DEFAULT: true
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.
DEFAULT: false
List of entity types that access to them in the client should be disabled.
DEFAULT: []
Limit for the number of different full entities that can be loaded on any given page, via Scribunto or the property parser function.
DEFAULT: 250
Maximum number of calls to mw.wikibase.getReferencedEntityId
allowed on a single page.
Maximum search depth for referenced entities in mw.wikibase.getReferencedEntityId
.
Maximum number of entities to visit in a mw.wikibase.getReferencedEntityId
call.
Whether to track Lua function calls with a per-sitegroup key, like MediaWiki.wikipedia.wikibase.client.scribunto.wikibase.functionName.call
.
Whether to track Lua function calls with a per-site key, like MediaWiki.dewiki.wikibase.client.scribunto.wikibase.functionName.call
.
Enable fine-grained tracking on entities accessed through Lua in client.
Not all (X) usage will be recorded, but each aspect will be recorded individually based on actual usage.
ID of the site group to be shown as language links.
DEFAULT: null
(That is the site's own site group.)
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 ['Q101' => 'badge-goodarticle']
. Note that this extension does not add any CSS to actually display the badges.
Site global ID list of sites which should be linked in the other project's sidebar section.
Empty value will suppress this section.
DEFAULT: Everything in the Wikibase siteLinkGroups setting.
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. See md_docs_topics_change-propagation
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. This is intended to temporarily prevent external changes from showing in order to find or fix some issue on a live site.
DEFAULT: true
Number of recentchanges
table rows to create in each InjectRCRecordsJob, a job used to send client wikis notifications about relevant changes to entities.
Higher value mean fewer jobs but longer run-time per job.
DEFAULT: wikiPageUpdaterDbBatchSize, for backwards compatibility, or MediaWiki core's $wgUpdateRowsPerJob, which currently defaults to 300.
If true, allows users on the client wiki to get a notification when a page they created is connected to a repo item.
This requires the Echo extension.
If sendEchoNotification
is set to true
, you can also provide what icon the user will see.
The correct syntax is [ 'url' => '...' ]
or [ 'path' => '...' ]
where path
is relative to $wgExtensionAssetsPath.
DEFAULT: false
(That is there will be the default Echo icon.)
Enables the Data Bridge Feature, which allows editing a repository directly from a client wiki.
To enable it, set this setting to true
on both repo and client and also configure dataBridgeHrefRegExp.
DEFAULT: false
Regular expression to match edit links for which the Data Bridge is enabled.
Uses JavaScript syntax, with the first capturing group containing the title of the entity, the second one containing the entity ID (usually a part of the first capturing group) and the third one containing the property ID to edit. Mandatory if client dataBridgeEnabled is set to true
– there is no default value.
A list of tags for tracking edits through the Data Bridge.
Optional if client dataBridgeEnabled is set to true
, with a default value of []
. Please note: you also have to create those tags in the target repository via Special:Tags.
The URL for link to where the users can report errors with the Data Bridge.
It may have a <body>
placeholder which will be replaced with some text containing more information about the error.
DEFAULT: https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?title=Wikidata+Bridge+error&description=${body}&tags=Wikidata-Bridge
An associative array mapping repository names to settings relevant to the particular repository.
Local repository is identified using the empty string as its name. Each repository's settings are an associative array containing the following keys:
false
would mean “this wiki's database”!Switch to enable or disable the propagation of client changes to the repo.
DEFAULT: true
If a page in client uses too many aspects and entities, Wikibase issues a warning.
This setting determines value of that threshold.
DEFAULT: 100
An array of client namespace ids defaulting to empty (disabled)
Pages with a matching namespace will include a JSON-LD schema script for search engine optimization (SEO).
Namespace id for entity schema data type
DEFAULT: 640
Array of usage aspects that should not be saved in the wbc_entity_usage table.
This supports aspect codes (like “T”, “L” or “X”), but not full aspect keys (like “L.de”). For example [ 'D', 'C' ]
can be used to disable description and statement usages. A replacement usage type can be given in the form of [ 'usage-type-to-replace' => 'replacement' ]
.
DEPRECATED. If set, acts as a default for purgeCacheBatchSize and recentChangesBatchSize.
Number of pages to process in each HTMLCacheUpdateJob, a job used to send client wikis notifications about relevant changes to entities.
A Higher value means fewer jobs but longer run-time per job.
DEFAULT: [wikiPageUpdaterDbBatchSize] (for backwards compatibility) or MediaWiki core's [$wgUpdateRowsPerJob] (which currently defaults to 300).
Associative array mapping usage type to the limit.
If number of modifiers for the given aspect of an entity passes this limit, it turns all modifiers to a general entity usage in the given aspect. This is useful when with bad lua, a page in client uses all languages or statements in the repo causing the wbc_entity_usage become too big.
Batch size for adding entity usage records.
DEFAULT: 500
Associative array mapping certain well-known property roles to the IDs of the properties fulfilling those roles.
When formatting references (currently, only for Data Bridge), a few properties are treated specially. In this setting, those can be specified: the keys referenceUrl
, title
, statedIn
, author
, publisher
, publicationDate
and retrievedDate
correspond to the Wikidata properties reference URL, title, stated in, author, publisher, publication date and retrieved respectively. Each property is optional.
DEFAULT: array mapping each well-known name to null
.