Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

MediaWiki extension WikibaseManifest

Clone this repo:
  1. 48c94db build: Updating mediawiki/mediawiki-phan-config to 0.15.0 by libraryupgrader · 4 days ago master
  2. e1545ef build: Updating npm dependencies by libraryupgrader · 7 days ago
  3. 3ea2979 build: Updating cross-spawn to 6.0.6, 7.0.6 by libraryupgrader · 3 weeks ago
  4. 9a9090e build: Updating mediawiki/mediawiki-codesniffer to 45.0.0 by libraryupgrader · 7 weeks ago
  5. 8eb839b build: Updating eslint-config-wikimedia to 0.28.2 by libraryupgrader · 2 months ago

WikibaseManifest

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.

Installation

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;

Development

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