WikibaseManifest is an extension that combines metadata about a Wikibase installation exposing it as a simple API. The goal is to help toolmakers write tools that can target any Wikibase.
The manifest will be exposed at an endpoint such as https://www.wikidata.org/w/rest.php/wikibase-manifest/v0/manifest
More about the format of the manifest and how it came to be can be found here.
In order to use this extension you need to load the extension.
wfLoadExtension( 'WikibaseManifest' );
Then configure as appropriate:
$wgWbManifestExternalServiceMapping = [
'queryservice_ui' => 'https://query.wikidata.org',
];
$wgWbManifestWikidataEntityMapping = [
'properties' => [
'P31' => 'P1',
],
'items' => [
'Q5' => 'Q15'
],
];
$wgWbManifestMaxLag = 7;
We recommend using mediawiki-docker-dev
for development.
You can test the development endpoint at: http://default.web.mw.localhost:8080/mediawiki/rest.php/wikibase-manifest/v0/manifest
PHP
You can run the code linting with:
composer test
Then fix errors with:
composer fix
To run phpunit tests with mediawiki-docker-dev run:
mw-docker-dev phpunit-file default extensions/WikibaseManifest/tests/phpunit/
JS
You can run the api end-to-end tests using:
npm run api-testing
You can run the api end-to-end test linting with:
npm run api-testing-lint
Then fix errors with:
npm run api-testing-lint -- --fix