Module:Sandbox/Was a bee/getLinkedName/doc


Retrieving text from Wikidata and formatting it in wiki-linked style. Algorithm of this module is as follows.

  • Case 1. If there is sitelink, then use sitelink.
    • Case 2 If sitelink has disambiguation brackets, then remove the brackets.
      • Case 3. If there is no sitelink, then use label.
        • Case 4. If there is no sitelink and label, then use item ID (with editing pencil like this "").

Usage

edit

{{#invoke:Sandbox/Was a bee/getLinkedName|getLinkedName|QID}}

Examples

edit
edit
Input

{{#invoke:Sandbox/Was a bee/getLinkedName|getLinkedName|Q42}}

Output

Douglas Adams


edit
Input

{{#invoke:Sandbox/Was a bee/getLinkedName|getLinkedName|Q6258348}}

Output

John Smith

edit
Input

{{#invoke:Sandbox/Was a bee/getLinkedName|getLinkedName|Q23366230}}

Output

Republic of Geneva


edit
Input

{{#invoke:Sandbox/Was a bee/getLinkedName|getLinkedName|Q11485627}}

Output

Hirose Shrine (Taketa)

Parameters

edit

alias

edit

|alias= parameter specifies text shown as alias without changing the link target.

Input

{{#invoke:Sandbox/Was a bee/getLinkedName|getLinkedName|Q30}}

{{#invoke:Sandbox/Was a bee/getLinkedName|getLinkedName|Q30|alias=US}}

Output

United States

US