Wikibase/Installation/Advanced configuration/fr

Introduction
Cette page décrit les paramètres avancés pour le client Wikibase et le dépôt. Si Wikibase n'est pas encore installé, consultez d'abord les instructions d'installation.

Faire des modifications dans les configurations du client et du dépôt implique qu'il faut ajouter ou modifier ou les lignes de  (respectivement) dans le fichier  de MediaWiki. Ce document ne couvre que quelques options; pour une liste exhaustive, consulter la documentation complète (valeurs par défaut : et  ).

Notez que le prefix wg de est distinct de celui des autres extensions, qui peuvent utiliser le préfixe. La différence est importante; votre configuration va échouer si vous utilisez un préfixe différent.

Les paramètres que vous définissez dans prévalent sur ceux qui ont été trouvés dans les fichiers mentionnés ci-avant. Placez à la fin de votre fichier, les paramètres que vous voulez redéfinir.

Exemple :

La ligne ci-dessus initialise le parameter  du dépôt Wikibase (car  ) à la valeur.



Utiliser uniquement le client ou le dépôt
Dans certaines circonstances vous pouvez utiliser uniquement le client ou le dépôt de code seul.



Dépôt uniquement
Les versions 1.36 et plus récentes utilisent l'enregistrement des extensions :

Utilisez l'extrait de code ci-dessous uniquement si vous utilisez des versions antérieures à la 1.36 :

Ces configurations supposent que vos préfixes interwiki sont  et. Ajuster en fonction des besoins.

Notez que englobe tous les paramètres du dépôt Wikibase. Voir les valeurs par défaut dans Wikibase.default.php.



Client uniquement
Versions 1.36 et supérieures, utiliser l'enregistrement des extensions :

For another lang-wiki client, like Farsi, change the siteGlobalID to:

Utilisez l'extrait de code ci-dessous uniquement si vous utilisez des versions antérieures à la 1.36 :

You can look also the official complete description of the configurations options.

Note that wraps all the Wikibase client configurations. Voir les valeurs par défaut dans WikibaseClient.default.php.



Dépôt Wikibase


Définir les liens pour les identifiants externes
In order to add links for external identifiers in the main interface (as seen in this Wikidata example Q85#P214 and config P214#P1630):
 * 1) Create a property of type "String" (just like the property "formatter URL" in Wikidata). The property that we are creating in this step will be the one used for storing the link formatter in other properties (e.g. usage of "formatter URL" in "VIAF ID"). Properties that use this property should be of type "External identifier".
 * 2) Get the ID of the property we created in the previous step (e.g.,  ).
 * 3) Configurer dans   :
 * 4) Si l'ajout du paramètre ne fonctionne pas tout seul, exécutez la commande suivante
 * 5) Now users can use this property (in the example above P5) in properties whose type is "External Identifier". The value must contain   in the URL formatter (e.g.  ),   will then be replaced by the identifier provided in the items that use the property that we set in the option.

Canonical URIs can be similarly configured in RDF dumps (prefixes wdtn:, psn:, pqn:, prn:), as seen on Wikidata with the property P1921 and used on the property P214#P1921). La configuration est similaire au paramètre.



propertyOrderUrl
 propertyOrderUrl  allows custom ordering of properties using the LUA function as explained in Manual:Interface/Wikibase-SortedProperties

statementSections
statementSections allows a Wikibase administrator to customize statement display and grouping in Wikibase.

In LocalSettings.php, define  with separate sections for each wiki on your instance. For identifiers and constraints, you can define a  which filters certain elements out into their own section.

Les options de syntaxe pour  et   sont :
 * &mdash; aucun élément n'est placé dans une section séparée
 * &mdash; les éléments avec le ou les types de données spécifiés apparaissent dans une section distincte
 * &mdash; spécifier le ou les types à filtrer
 * &mdash; éléments avec la ou les propriétés spécifiées apparaissent dans une section distincte
 * &mdash; spécifier la ou les propriétés à filtrer

For instance, to replicate how Wikidata separates External identifiers from the rest of its properties, set: Vous pouvez personnaliser le nom du libellé en utilisant la page.

Voir aussi :
 * Billet Phabricator pour la déclaration des sections
 * Configuration propre à Wikidata
 * Exemple du dépôt de code Wikibase



Options de configuration disponibles
All available configuration settings are noted in the master configuration document.



Scripts de maintenance
Wikibase provides a few maintenance scripts which can be found in the  subdirectory. Wikibase must be installed in MediaWiki's extensions directory,. If it's installed elsewhere, you can set the  environment variable to the path of your MediaWiki installation and the scripts will use it.

Dépôt
A common way to set the environment for scripts called in cron jobs:

populateSitesTable.php
This script will load the wiki matrix from meta.wikimedia.org and use that information to populate the local  table. This provides Wikibase with the information it needs to connect to other wikis, such as for the purpose of suggesting or normalizing page titles when creating site links.

From the MediaWiki install folder, run:

To insert a new Wikibase client without using the wiki matrix, see Manual:Sites table.

dispatchChanges.php
This script updates the client wiki's local items cache.

1. Provide the script with the information it needs about the client wiki databases.

LocalSettings.php:

2. Run the dispatch changes script.

Note that this script performs the synchronization; the repo and the client will remain in sync only so long as this script is running.

pruneChanges.php
This script allows you to prune the Wikibase changes table. When run with no parameters, it will delete all changes older than 7 days. You may specify the  flag for periods of other lengths:



Fonctionnalités et utilisation
After Wikibase is installed, interlanguage links are automatically obtained from the repo and added to client wiki pages as long as the polling script is running. The extension then sorts the links (as defined by the local wiki), displays them and saves them to the database exactly as they are defined on the page. The extension is robust and retains existing links when the central wiki is down.

By default the extension works only in the main namespace, but this can be changed using the namespaces configuration option.



Avoir des liens Wikidata et des liens locaux
The extension doesn't affect how interlanguage links work; they can be used in parallel with the extension. There are several use cases:


 * Links on pages in namespaces not configured to use the extension will work as if the extension were not installed.
 * If you want to add links in addition to the links stored in Wikidata, simply add new links in wikitext; your links and the Wikidata links will be displayed together.
 * To exclude one or more Wikidata links, use noexternallanglinks with the desired language(s). Other links will work normally.
 * To supersede one or more Wikidata links, use noexternallanglinks and add the new links in wikitext.
 * To turn off Wikidata links altogether, use noexternallanglinks on its own. Links you provide will work as if the extension were not installed.

noexternallanglinks
is a magic word and a parser function which can turn this extension off for a specific page, or suppress some of the interlanguage links produced by the extension.

When used on its own, Wikibase is effectively disabled on the given page. Only interlanguage links present in the wikitext are used. The word works the same when used as a function, with an asterisk:  (the asterisk "matches" all the languages).

When invoked as a function with parameters, links to the specified languages will be removed. For example,  removes links to French and Indonesian languages. You may also invoke the function more than once:. It is safe to remove links to languages that don't exist.



Transclusion de données
WikibaseClient allows data inclusion from the Wikibase repo using the  parser function along with Lua.


 * Lua
 * Lua documentation


 * Parser functions
 * Lookup by property ID (e.g., P2), to include data from a Wikibase item connected by sitelink. For example,.
 * Lookup by property label. For example,.
 * With arbitrary access enabled, it can be applied to any item. For example,.
 * In addition to, which outputs linked wikitext, you can use  , which outputs unlinked labels.
 * See d:Wikidata:How to use data on Wikimedia projects for further documentation.



Autre barre latérale de projets

 * See also Requests for comment/Interproject links interface for the current status for Wikimedia projects.

The configuration option  creates an "Other projects" sidebar section with links to other projects from the item linked to the current page. It currently supports exactly one link per project and does not yet override links in wikitext using a parser function (though current JavaScript hacks may be easily adapted).

Configuration sample (links will be displayed in the order specified):

The sidebar's id is "wikibase-otherprojects". You can use it to customize the section's position in the sidebar using MediaWiki:Sidebar.

Each link has a the label containing the i18n messages "wikibase-otherprojects- ID " with ID the id of the linked site group (like "wikipedia", "wikisource" or "commons").

Sample page: w:Wikipedia:Village pump.

commaseparatedlist
is a parser function that can be used in edit summaries for text formatting. It returns its list of arguments separated by the given language's proper separator. for example, results in word1, word2, word3.



Activer les liens de sites
Les liens de site sont des liens spéciaux avec un site et un titre, liant les éléments individuels à des pages qui appartiennent à d'autres wikis. Dans Wikidata ils pointent vers les autres sites Wikimedia tels que Wikipedia, Wikisource et Wikivoyage. Parmi les autres choses, les liens de site permettent de référencer une propriété d'élément sur la page liée dans le wiki client, une fonctionnalité connue sous le nom d' Accès direct.



Configurer ses groupes de liens de site
First, consider how to group the client wikis you want to see in your sitelinks area for the Items in your repo wiki.



Définir des groupes personnalisés
In your repo wiki, replace the content of in   with the groups you would like to see there.

For example, consider the following line in :

This would create three groups in the Item page's sitelinks box:
 * the standard defined  for the global Wikipedia sites
 * two custom wiki groups (here named  and  )

The names defined here will relate to the  field in the   table, as specified below.

In your client wiki, add a similar configuration line with your :



Désactiver la fonctionnalité des liens de sites
If you do not want your installation to make use of sitelinks at all, you can deactivate them by setting the configuration to an empty array:

<span id="Localize_your_groups">

Internationalisez vos groupes
To show the correct heading for your groups, you must create the page with the desired heading as text.

You can create subpages to set headings for different languages, e.g., create  to create a German heading.

<span id="Add_the_wikis_to_the_sites_table">

Ajouter les wikis à la table des sites
In order to add sitelinks to Items in your repo wiki, you must add the client wikis to the sites table. Group names must match the group names you added to your configuration. Following the example above, you would have one or more sites with  and   as text in the   field. You must set both the file path and the page path, and each must include the  placeholder.

Exemple
To add your wiki (with an id ending with ) to the  group , runL Be sure to do this on the repo wiki and all client wikis so that the "Add links" functionality in the other languages section works correctly.

For further details on how to add sites to the table, please see these instructions.

<span id="Inform_the_repo_wiki_of_the_other_client_wiki_databases">

Informer le wiki du dépôt avec les bases de données des autres wikis clients
localClientDatabases: An array of locally accessible client databases, for use by the change dispatching mechanism. This setting specifies which wikis to directly push changes to. It must be specified either as an associative array (mapping global site IDs to logical database names) or as a list of databases (if the database names match the site IDs). The default is an empty array, indicating no local client databases.

<span id="Verify_that_you_can_add_sitelinks">

Vérifier que l'on peut ajouter des liens de sites

 * 1) Go to the   page in your repo wiki and try to link an existing Item (field "ID") to one of the sites configured above (field "Site ID") by specifying an existing page on that wiki (field "Sitelink"). If it fails, it should provide a useful error message.
 * 2) On the page you added above, check that Direct access works by referencing a property of the Item in a parser function.

Résolution des problèmes
<span id="There_are_no_sites_I_can_link_pages_to_in_an_item.">

Il n'existe pas de site pour lier les pages à un élément
One or more of the following may help: