Manual:langlinks テーブル

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:Langlinks table and the translation is 16% complete.
Other languages:
English • ‎español • ‎français • ‎日本語
Manual:コンテンツ MediaWiki のデータベース レイアウト langlinks table/ja


MediaWiki バージョン: 1.7

langlinks テーブルは 言語間リンク を追跡します。

This table is used for displaying pages, as a quick means to find the links that typically appear in the left margin, underneath the navigational and toolbox links. Without this table, MediaWiki would have to parse through the wikitext for each page display. The table has a primary key on page (ll_from) and target language (ll_lang), so each page can only store one link per language.

The table has three columns: ll_from (an integer), ll_lang (20 characters), ll_title (255 characters). If the wiki page "Sweden" contains the interlanguage link [[fr:Suède]], then ll_from will indicate the page Sweden where the link goes from, ll_lang will be "fr" and ll_title will be "Suède". In February 2009 for the Swedish language Wikipedia, this table has 3.2 million rows, of which 145,000 (4.5 %) have ll_lang "fr".

As a side effect of having this table, you can:

  • Find out which are the most popular target languages: select count(*), ll_lang from langlinks group by 2 order by 1 desc limit 20;
  • Find out which pages have the most interlanguage links: select count(*), ll_from from langlinks group by 2 order by 1 desc limit 20;
    (But then you would need to translate ll_from into useful page names.)
  • Interlanguage link statistics are included in the monthly Wikipedia statistics.
  • Since Wikidata, this table no longer keeps accurate track of the actual interlanguage links in Wikipedia and other Wikimedia wikis!
  • Interlanguage links are often referred to as interwiki links. For example, interlanguage links are updated by so-called "interwiki bots". While this table can have millions of rows, the interwiki table typically only has a few hundred.
  • ll_title is a single varchar string, to be used in the URL on the target language wiki. This table alone is not sufficient to determine if that link is unique, since it could lead to a redirect or a namespace alias. For example, the interlanguage links [[fr:Catégorie:Suède]] and [[fr:Category:Suède]] are synonymous even though the namespace is spelled differently.

フィールド

ll_from

page_id of the referring page.

ll_lang

Language code of the target, in the ISO 639-1 standard.

ll_title

Title of the target, including namespace (FULLPAGENAMEE style).

スキーマの要約

MediaWiki バージョン: 1.10

DESCRIBE langlinks;

+----------+------------------+------+-----+---------+-------+
| Field    | Type             | Null | Key | Default | Extra |
+----------+------------------+------+-----+---------+-------+
| ll_from  | int(10) unsigned | NO   | PRI | 0       |       |
| ll_lang  | varbinary(20)    | NO   | PRI |         |       |
| ll_title | varbinary(255)   | NO   |     |         |       |
+----------+------------------+------+-----+---------+-------+
MediaWiki バージョン: 1.7 – 1.9

DESCRIBE langlinks;

+----------+---------------------+------+-----+---------+-------+
| Field    | Type                | Null | Key | Default | Extra |
+----------+---------------------+------+-----+---------+-------+
| ll_from  | int(8) unsigned     | NO   | PRI | 0       |       |
| ll_lang  | varchar(10) binary  | NO   | PRI | NULL    |       |
| ll_title | varchar(255) binary | NO   |     | NULL    |       |
+----------+---------------------+------+-----+---------+-------+