A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://doc.wikimedia.org/Wikibase/master/php/docs_topics_entitysources.html below:

Wikibase: Entity sources

In 2019 EntitySource and EntitySourceDefinitions were introduced for defining the source of an entity type.

Currently only a single entity source is allowed per entity type on a given repo.

This concept was introduced in 2019 to allow for the first steps of federation.

Entity source configuration is controlled by a configuration option called entitySources in both repo and client.

Configuration

An entitysource is an associative array mapping entity source names to settings relevant to the particular source.

DEFAULT: None, must be configured. The example (not default!) settings configure a local entity source with items in namespace 120, properties in namespace 122, and extension-defined entity types in namespaces according to the WikibaseRepoEntityNamespaces hook. Custom (non-example) settings will not include extension-defined entity types by default (the WikibaseRepoEntityNamespaces hook is only run by the example settings), all entity types must be configured explicitly in that case.

Configuration of each source is an associative array containing the following keys:

Single entity source example

This example can be used when setting up a simple client repo relationship.

$entitySources = [

'myrepo' => [

'entityNamespaces' => [ 'item' => 120, 'property' => 122 ],

'repoDatabase' => 'myrepodb',

'baseUri' => 'SOME_CONCEPTBASEURI',

'interwikiPrefix' => 'SOME_INTERWIKI',

'rdfNodeNamespacePrefix' => 'SOME_NODERDFPREFIX',

'rdfPredicateNamespacePrefix' => 'SOME_PREDICATERDFPREFIX',

'type' => 'db'

],

];

global $wgWBClientSettings

CI configuration for the Wikibase Client extension.

Definition WikibaseClient.ci.php:22

$wgWBRepoSettings['idGenerator']

Definition Wikibase.ci.php:28

Note that additional entity types defined by extensions will not work out of the box in this configuration: you must explicitly configure them in the entityNamespaces of the entity source.

Wikimedia Commons & Wikidata example

The following example shows Wikimedia Commons using entities from Wikidata.org:

$entitySources = [

'wikidata' => [

'entityNamespaces' => [

'item' => 0,

'property' => 120,

'lexeme' => 146,

],

'repoDatabase' => 'wikidatawiki',

'baseUri' => 'http://www.wikidata.org/entity/',

'rdfNodeNamespacePrefix' => 'wd',

'rdfPredicateNamespacePrefix' => '',

'interwikiPrefix' => 'd',

],

'commons' => [

'entityNamespaces' => [

'mediainfo' => '6/mediainfo',

],

'repoDatabase' => 'commonswiki',

'baseUri' => 'https://commons.wikimedia.org/wiki/Special:EntityData/',

'rdfNodeNamespacePrefix' => 'sdc',

'rdfPredicateNamespacePrefix' => 'sdc',

'interwikiPrefix' => 'c',

],

];

$wgWBRepoSettings

[

'localEntitySourceName'

] = $isThisCommons ?

'commons'

:

'wikidata'

;


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4