Jump to content

Wikibase/Schema/wb_terms

From mediawiki.org

The wb terms table stores labels, descriptions and aliases of entities.

Fields

[edit]

term_row_id

[edit]
  • Unique row ID.

term_full_entity_id

[edit]
  • The full entity ID of the entity, e. g. "Q42" or "P31".

term_entity_type

[edit]

Contains a plain text string with one of the following values:

  • item — means term_full_entity_id refers to an item
  • property — it refers to a property

term_language

[edit]
  • examples: "ab", "ace", "aeb", "aeb-arab", "aeb-latn", "be-x-old", "de", "de-at", "de-ch", "de-formal", "en", "en-ca", "en-gb"
  • A complete list can be found [where?]

term_type

[edit]

Contains a plain text string with one of the following values:

  • label — the main label to be used for representing the described Entity in Wikidata in the specific languages, e.g., Georgia could be an English label. For properties, the label may be referred as the "name", as it is unique for the particular language (according to the Wikibase DataModel).
  • description — a brief description to clarify the meaning of the label (which may be ambiguous), e.g., a country in the Caucasus could be an English description. The intended use is mainly disambiguation when displaying multiple entities with the same label, for selection. For items (as opposed to properties), the combination of label and description is unique for one particular language, if both label and description are defined (according to the Wikibase DataModel).
  • aliasAlso known as — alternative label in the selected languages, used mainly for searching for items by their name. There may be multiple alias entries per entry_id per language.

More details: Wikibase/DataModel § EntityDescriptions of Items and Properties


term_text

[edit]
  • The term_text column stores textual values of labels, descriptions, and aliases. This can be filtered with the use of term_type

term_search_key

[edit]
  • The same value as term_text contains, but normalized for search, e.g. all lowercase

Versions

[edit]

Current as of

+---------------------+---------------------+------+-----+---------+----------------+
| Field               | Type                | Null | Key | Default | Extra          |
+---------------------+---------------------+------+-----+---------+----------------+
| term_row_id         | bigint(20) unsigned | NO   | PRI | NULL    | auto_increment |
| term_entity_id      | int(10) unsigned    | NO   | MUL | NULL    |                |
| term_full_entity_id | varbinary(32)       | YES  | MUL | NULL    |                |
| term_entity_type    | varbinary(32)       | NO   | MUL | NULL    |                |
| term_language       | varbinary(32)       | NO   | MUL | NULL    |                |
| term_type           | varbinary(32)       | NO   |     | NULL    |                |
| term_text           | varbinary(255)      | NO   | MUL | NULL    |                |
| term_search_key     | varbinary(255)      | NO   | MUL | NULL    |                |
| term_weight         | double unsigned     | NO   |     | 0       |                |
+---------------------+---------------------+------+-----+---------+----------------+

Previously as of Wikibase 0.4 (19 Feb 2013)

+------------------+------------------+------+-----+---------+----------------+
| Field            | Type             | Null | Key | Default | Extra          |
+------------------+------------------+------+-----+---------+----------------+
| term_row_id      | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| term_entity_id   | int(10) unsigned | NO   | MUL | NULL    |                |
| term_entity_type | varbinary(32)    | NO   | MUL | NULL    |                |
| term_language    | varbinary(32)    | NO   | MUL | NULL    |                |
| term_type        | varbinary(32)    | NO   | MUL | NULL    |                |
| term_text        | varbinary(255)   | NO   | MUL | NULL    |                |
| term_search_key  | varbinary(255)   | NO   | MUL | NULL    |                |
+------------------+------------------+------+-----+---------+----------------+

Restrictions

[edit]

According to the Wikibase DataModel,

See also

[edit]