Help:Default values for labels and aliases

From Wikidata
(Redirected from Help:Mul language code)
Jump to navigation Jump to search

Items can (now) be given default values for labels and aliases, such as names and other proper nouns unlikely to differ between languages. Default values simplify working on items that have identical values for labels and aliases in a plurality of languages. You can still set different values for individual languages. These default values can be accessed via API using the language code mul ("multiple languages").

How does it work?

[edit]
Mockup of the default values feature
  • Add a default value for a label and/or alias.
  • Wikidata uses these default values for labels or aliases where no other value is given (see screenshot).
  • Where applicable: Add a statement to indicate the native language of the label, e.g., name in native language (P1559) or native label (P1705).

When should I use default values for labels and aliases?

[edit]

There are types of Items where you should apply default values:

Names

Titles

Symbols and characters

Codes

  • Country codes, e.g. CH (alias).

Wikimedia pages

FAQ

[edit]

Do I need to repeat aliases in my language?

[edit]

No. The purpose of aliases is only to find entities in searches. All languages are used when searching, so generally aliases need not be repeated. Instead, add aliases that are valid across many languages to the 'default values' section.

Why is this important?

[edit]

More and more we see redundant labels, aliases, and descriptions being added to Wikidata entities. These are hard to maintain, and all superfluous data brings our already overburdened infrastructure closer to its limits (see Wikidata Query Service). Default values improve the situation for labels and aliases; a different solution is in the works for descriptions (viz. T303677).

When will this be rolled out?

[edit]

It is available in a limited release mode now. The full rollout will follow in Q3 2024.

Where can I report problems?

[edit]

Please report problems on the talk page of this page.

How can I add a default value to an item?

[edit]

Add {{#babel:mul-1}} to your user page, below your native language and above your secondary languages. This allows you to add default values using Wikidata's web interface. The order of mul babel tag relative to other language is important: If mul is not the first language immediately after your native language, Wikidata will pick label in your secondary language as a fallback if label in native language is not available, rather than using mul label as the fallback of the label in native language.

Alternatively, default values can be added using QuickStatements with the commands

  • Itemnumber|Lmul|"default label value" for Labels, and
  • Itemnumber|Amul|"default alias value" for Aliases.

How to show the default label in Wikidata Query Service (WDQS)?

[edit]

If your SPARQL query uses the wikibase label service, change SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } into SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }.

If your SPARQL query uses the rdfs:label predicate, you can use the following code:

OPTIONAL { ?item rdfs:label ?labelEN. FILTER ( lang(?labelEN) = 'en' ) }
OPTIONAL { ?item rdfs:label ?labelMUL. FILTER ( lang(?labelMUL) = 'mul' ) }
BIND(COALESCE(?labelEN, ?labelMUL) AS ?itemLabel).