Page MenuHomePhabricator

[Federated Values] Add option to enable Wikidata as a source for Item values in statements
Closed, ResolvedPublic5 Estimated Story Points

Description

Summary

Add a wgWBEnableFederatedStatementValueSource feature flag which can be set in LocalSettings.php to enable or disable Federated Statement Values Source (FSVS). Part of this task is to confirm the naming of this flag through confirming/aligning with Product and UX research.

This feature can be complete in anticipation of the actual changes to enable Federated Statement Values, such that this flag is visible to the relevant ares of the codebase.

Details

  • By default the feature is disabled.
  • When enabled, the feature is available only for properties with a datatype of Item.
  • Source for value selection is fixed to Wikidata. Configuration of remote sources is out of scope for this task, but the design should not block future configurability as the ability to configure a list of remote sources is expected in the future (as was done in Federated Properties code).

Config example

// Enable Federated Statement Values Source for Item type properties
$wgWBEnableFederatedStatementValueSource = true;

Done when

  • A name for the flag is established
  • Setting the flag to false fully disables all FSVS-related code paths (UI + API).
  • Setting the flag to true enables the feature

Event Timeline

lojo_wmde renamed this task from [Federated Property Values] Add option to enable Federated Property Values to [Federated Statement Values] Add option to enable Wikidata as a source for Item values in statements.Oct 2 2025, 1:34 PM
lojo_wmde updated the task description. (Show Details)

Here’s a short wiring sketch and notes for adding this federatedStatementValuesEnabled setting (naming TBD) for Federated Statement Values (FSV). This follows the same pattern as was done with the Federated Proeperties proof of concept (i.e federatedPropertiesEnabled)

The user configures in LocalSettings.php, e.g.:

$wgWBRepoSettings['federatedStatementValuesEnabled'] = true;

And we access the value of that setting in code using the following pattern:

use Wikibase\Repo\WikibaseRepo;
...
$enabled = WikibaseRepo::getSettings()->getSetting( 'federatedStatementValuesEnabled' );

Default value:

A default value for this setting should be added to repo/config/Wikibase.default.php such that it’s false / off by default:

// repo/config/Wikibase.default.php
return [
    // ...
    'federatedStatementValuesEnabled' => false,
    // ...
];

Docs:

A new entry for this setting should be added to docs/topics/options.md (this file generates the Wikibase: Options page). For now place it right before federatedPropertiesEnabled under Repository settings → Miscellaneous, and match current formatting. Something very much like this:

#### federatedStatementValuesEnabled {#repo_federatedStatementValuesEnabled}
Enable the Federated Statement Values feature. When enabled, this allows using Items from a remote Wikibase (for example, Wikidata) as values in statements on this repository.

DEFAULT:  `\``false`\``

Todo / next steps:

  • Add default setting in repo/config/Wikibase.default.php
  • Add docs entry to docs/topics/options.md
  • Push changes to a new feature working branch for upcoming/ongoing FSV feature development
conny-kawohl_WMDE renamed this task from [Federated Statement Values] Add option to enable Wikidata as a source for Item values in statements to [Federated Values] Add option to enable Wikidata as a source for Item values in statements.Oct 14 2025, 9:12 AM

The changes to add a federatedValuesEnabled flag are on Gerrit and marked as work in progress. They're meant to be amended by code from other tasks, where the flag can be used and propagated. For that reason, the open change set is linked to the epic ticket.