Template:Wdt

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Todo[edit]

  • Disable fallback language
  • Handle unmet expectations gracefully
  • Return error when locative cannot be extracted for a given language
  • Try getting it from 'category for people who died here' (P1465) if there are no results

Legend[edit]

Examples[edit]

  • {{wdt|Q|Q36}} → Q36
  • {{wdt|S.q|Q36|P1464}} → Q7463337
  • {{wdt|S.t|Q36|P1464|pl}} → Kategoria:Urodzeni w Polsce
  • {{wdt|S.l|Q36|P1464|pl}}Kategoria:Urodzeni w Polsce

Test #1[edit]

{{Trim|
  {{Replace text|
    {{wdt|S.t|
      {{wdt|S.q|
        {{wdt|Q|Category:Istanbul}}
      |P301}}
    |P1464|pl}}
  |{{CityLocativefromCat/replace|pl}}
|}}}}
Result
w Stambule

Test #2[edit]

Note
Avoid; Birth categories are very incomplete in Basque, and its inessive can be generated with a simple rule. See Test #3 below.
{{Trim|
  {{Replace text|
    {{wdt|S.t|
      {{wdt|S.q|
        {{wdt|Q|Category:Bilbao}}
      |P301}}
    |P1465|eu}}
  |{{CityLocativefromCat/replace|eu}}
|}}}}
Result
Kategoria:Bilbon hildakoak

Test #3[edit]

{{wdt|S.t| {{wdt|Q|Category:Bilbao}} |P301|eu}}

Result
Bilbo
Rightmost character
o