Wikipedia
minwiki
https://min.wikipedia.org/wiki/Laman_Utamo
MediaWiki 1.39.0-wmf.23
first-letter
Media
Istimewa
Rundiang
Pangguno
Rundiang Pangguno
Wikipedia
Rundiang Wikipedia
Berkas
Rundiang Berkas
MediaWiki
Rundiang MediaWiki
Templat
Rundiang Templat
Bantuan
Rundiang Bantuan
Kategori
Rundiang Kategori
Portal
Diskusi Portal
TimedText
TimedText talk
Modul
Rundiang Modul
Gadget
Gadget talk
Gadget definition
Gadget definition talk
Kota Payakumbuh
0
380
2444296
2059494
2022-08-13T13:36:47Z
777sms
16217
([[c:GR|GR]]) [[c:COM:FR|File renamed]]: [[File:Gedung-dprd-payakumbuh.jpg]] → [[File:Gedung DPRD Payakumbuh.jpg]] [[c:COM:FR#FR4|Criterion 4]] (harmonizing names of file set)
wikitext
text/x-wiki
{{Untuk|namo kecamatan|Payakumbuh, Lima Puluh Kota}}
{{Infobox settlement
|official_name = Kota Payakumbuh
|native_name = كوتو ڤايوكومبواه
|nickname = ''Kota Kuliner<br>Kota Galamai''
|motto =
|image_skyline = {{Photomontage|border=0|color_border=transparent|color=transparent|spacing=1|size=250|foot_montage =Dari ateh, kida ka suokː Ngalau Indah, [[Musajik Gadang Balai Nan Duo]], Kantua DPRD Kota Payakumbuh, Tugu di Jalan Soekarno-Hatta yang kini menjadi Tugu Adipura, [[Gunuang Sago]], Pasimpangan jalan Tugu Adipura, dan pasawahan.
|photo1a=Ko Difoto Dari Puncak Ngalau - panoramio.jpg{{!}}Ngalau Indah
|photo2a=Masjid Gadang Balai Nan Duo.jpg{{!}}Musajik Gadang Balai Nan Duo
|photo2b=Gedung DPRD Payakumbuh.jpg{{!}}Gaduang DPRD Kota Payakumbuh
|photo3a=Payakumbuh.JPG{{!}} Tugu Adipura
|photo3b=Mount Sago Payakumbuh - panoramio.jpg{{!}}Gunuang Sago
|photo4a=Kota Payakumbuh - panoramio.jpg{{!}} Pasimpangan jalan
|photo4b=Jalan membelah sawah Payakumbuh.jpg{{!}} Pasawahan
}}
|image_flag =
|image_blank_emblem =
|image_seal = Lambang Kota Payakumbuh.png
|image_shield =
|image_map = Lokasi Sumatera Barat Kota Payakumbuh.svg
|mapsize = 250px
|map_caption = Letak Payakumbuh di [[Sumatera Barat]]
|pushpin_map_caption= Letak Payakumbuh di [[Indonesia]]
|pushpin_map = Indonesia
|coordinates_region = ID
|subdivision_type = Negara
|subdivision_name = [[Indonesia]]
|subdivision_type1 = Provinsi
|subdivision_name1 = [[Sumatera Barat]]
|subdivision_type2 = Administratif
|subdivision_name2 = [[Kecamatan]]: 5 <br> [[Kelurahan]]: 47
|government_type =
|leader_title = Wali Kota
|leader_name = [[Riza Falepi]]
|leader_title1 = Wakil Wali Kota
|leader_name1 = [[Erwin Yunaz]]
|leader_title2 = Ketua DPRD
|leader_name2 = [[YB. Datuk Parmato Alam]]
|leader_title3 =
|leader_name3 =
|established_title = Hari jadi
|established_date = [[17 Desember]] [[1970]]
|established_title2 =
|established_date2 =
|established_title3 =
|established_date3 =
|area_magnitude =
|area_total_km2 = 80,43
|area_total_sq_mi =
|area_land_km2 =
|area_land_sq_mi =
|area_water_km2 =
|area_water_sq_mi =
|area_water_percent =
|area_urban_km2 =
|area_urban_sq_mi =
|area_metro_km2 =
|area_metro_sq_mi =
|population_as_of = [[2021]]
|population_note =
|population_total = 141171
|population_density_km2 = auto
|population_density_sq_mi =
|population_metro =
|population_density_metro_km2 =
|population_density_metro_sq_mi =
|population_urban =
|population_density_urban_km2 =
|population_density_urban_mi2 =
|population_blank1_title = Agamo
|population_blank1 = [[Islam]] 98,82%<br> [[Kristen]] 1,09%<br>- [[Protestan]] 0,59%<br>- [[Katolik]] 0,50%<br> [[Agama Buddha|Buddha]] 0,09%<ref name="DUKCAPIL">{{cite web|url=https://gis.dukcapil.kemendagri.go.id/peta/|title=Visualisasi Data Kependuduakan - Kementerian Dalam Negeri 2020|website=www.dukcapil.kemendagri.go.id|accessdate=30 Juli 2021|format=visual}}</ref>
|population_density_blank1_km2 =
|population_density_blank1_sq_mi=
|timezone = [[Wakatu Indonesia Barat|WIB]]
|utc_offset = +7
|timezone_DST =
|utc_offset_DST =
|latd = 0 |latm = 13 |lats = 50.19 |latNS = S
|longd = 100 |longm = 37 |longs = 53.83 |longEW = E
|coordinates_display =
|elevation_m = 514
|elevation_ft =
|postal_code_type =
|postal_code =
|area_code = +62 752
<!-- blank fields (section 2) -->
|blank_name_sec2 = [[Indeks Pambangunan Manusia|IPM]] {{nobold|(2020)}}
|blank_info_sec2 = {{decrease}} 78,90 {{br}}{{fontcolor|green|Tinggi}} <ref name="IPM">{{cite web|url=https://www.bps.go.id/indicator/26/413/1/-metode-baru-indeks-pembangunan-manusia.html|title=Metode Baru Indeks Pembangunan 2019-2020|website=www.bps.go.id|accessdate=30 Juli 2021}}</ref>
|blank1_name_sec2 = [[Dana Alokasi Umum|DAU]] {{nobold|(2020)}}
|blank1_info_sec2 = Rp 465.684.926.000,-<ref>{{cite web|url=http://www.djpk.kemenkeu.go.id/wp-content/uploads/2019/09/2.-DAU.pdf |title=Rincian Alokasi Dana Alokasi Umum Provinsi/Kabupaten Kota Dalam APBN T.A 2020|website=www.djpk.kemenkeu.go.id|date=(2020)|accessdate=30 Juli 2021}}</ref>
|website = {{url|http://www.payakumbuhkota.go.id/}}
|footnotes =
}}
'''Kota Payakumbuh''' ([[Bahaso Minangkabau|Minang]]: ''Payokumbuah'' atau ''Pikumbuah''; disingkek manjadi ''PYK'') adolah salah satu [[kota]] nan talatak di provinsi [[Sumatera Barat]], [[Indonesia]].
Baragam panghargaan alah diraiah dek Pamarintah Kota Payakumbuh sajak babarapo taun taakhia. Dengan patumbuahan ekonomi 6,38 %, dan maningkek manjadi 6,79% pado taun 2011, Payakumbuh marupokan salah satu daerah Jo patumbuahan ekonomi tatinggi di Sumatera Barat. Inovasi dalam bidang sanitasi, pangalolaan sarok, pasa tradisional sihaik, pambinaan padagang kaki limo, jo drainase pakotaan mambaok kota iko maraih pangaragoan Inovasi Managemen Pakotaan (IMP) pado 2012, Indonesia Green Regional Award (IGRA), Kota Sihaik Wistara, jo saderet pangaragoaan lainnyo.
Kota Payakumbuh tadiri dari 5 kecamatan, iyolah [[Payakumbuh Utara, Payakumbuh|Payakumbuh Utara]], [[Payakumbuh Barat, Payakumbuh|Payakumbuh Barat]], [[Payakumbuh Timur, Payakumbuh|Payakumbuh Timur]], [[Payakumbuh Selatan, Payakumbuh|Payakumbuh Selatan]], dan tarakia [[Lamposi Tigo Nagari, Payakumbuh|Lamposi Tigo Nagari]].
== Geografi ==
[[Berkas:Mount Sago Payakumbuh - panoramio.jpg|jmpl|[[Gunuang Sago]] di selatan Payakumbuh]]
Kota Payakumbuh talatak di daerah dataran tinggi nan marupokan bagian dari Bukik Barisan. Talatak pado hamparan kaki [[Gunuang Sago]], bantangan alam kota ko mamiliki katinggian nan babeda-beda. Topografi daerah kota ko tadiri dari pabukitan jo rato-rato katinggian 514 m di ateh pamukoan lauik. Wilayahnyo dilalui dek tigo sungai, iyolah [[Batang Agam]], [[Batang Lampasi]], jo [[Batang Sinama|Batang Sinamo]]. Suhu udaronyo rato-rato bakisar antaro 26 °C jo kalembapan udaro antaro 45–50%.
Payakumbuh bajarak sakitar 30 km dari [[Kota Bukittinggi]] atau 120 km dari [[Kota Padang]] dan 188 km dari [[Kota Pekanbaru]]. Wilayah administratif kota ko dikaliliangi dek [[Kabupaten Lima Puluh Kota]]. Jo laweh wilayah 80,43 km² atau samo jo 0,19% dari laweh wilayah Sumatera Barat, Payokumbuah marupokan kota talaweh katigo di Sumatera Barat. Kota ko panah manjadi kota talaweh pado taun 1970, sabalun paluasan wilayah administratif Kota Padang jo Kota [[Sawahlunto]]. Kota Sawahlunto nan pado taun 1970 marupokan kota nan paliang ketek jo laweh 6,3 km² dipalaweh manjadi 273,45 km² atau maningkek sabanyak 43,4 kali dari sabalunnyo, samantaro Kota Padang dipalaweh manjadi 694,96 km² dan sakaligus manjadi kota nan talaweh di Sumatera Barat. Paluasan ko manyababkan Sawahlunto manjadi kota talaweh kadua jo Payakumbuh turun manjadi talaweh katigo di Sumatera Barat.
== Sijarah ==
[[Berkas:COLLECTIE_TROPENMUSEUM_Straatgezicht_Pajakoemboeh_TMnr_60054627.jpg|pra=https://id.wikipedia.org/wiki/Berkas:COLLECTIE_TROPENMUSEUM_Straatgezicht_Pajakoemboeh_TMnr_60054627.jpg|jmpl|Pamandangan jalan di Payakumbuh di akhia abaik ka-19]]
Kota Payakumbuh tarutamo pusek kotanyo dibangun dek [[Pamarintah kolonial Hindia Balando|Pamarintah Kolonial Hindia Balando]]. Sajak katalibatan [[Balando]] dalam [[Parang Pidari]], kawasan ko bakambang manjadi depot atau kawasan gudang panyimpanan dari hasil tanam kopi dan taruih bakambang manjadi salah satu daerah administrasi distrik pamarintahan kolonial Hindia Balando kutiko ko.<ref>Abdullah, Taufik, (2009), ''Schools and Politics: The Kaum Muda Movement in West Sumatra (1927-1933)'', Equinox Publishing, ISBN 978-602-8397-50-6.</ref>
Manuruik [[tambo]] satampek, dari salah satu kawasan di dalam kota ko ado suatu [[nagari]] tatuo iyolah nagari [[Payakumbuh Timur, Payakumbuh|Aie Tabik]] dan pado taun 1840, [[Balando]] mambangun jambatan batu untuak mangubuangkan kawasan tasabuik jo pusek kota kini.<ref>Reimar Schefold, P. Nas, Gaudenz Domenig, (2004), ''Indonesian Houses: Tradition and transformation in vernacular architecture'', Vol. 1, Illustrated, ISBN 978-9971-69-292-6.</ref> Jambatan itu kini tanamo juo jo namo [[Jambatan Ratapan Ibu]].
Payakumbuh sajak zaman sabalun kamardekaan alah manjadi pusek palayanan pamarintahan, padagangan, jo pandidikan tarutamo bagi [[Luhak Limo Puluah]]. Pado zaman pamarintahan Balando, Payakumbuh adolah tampek kadudukan asisten residen nan manguasoi wilayah Luhak Limo Puluah, dan pado zaman pamarintahan Japang, Payakumbuh manjadi pusek kadudukan pamarintah Luhak Limo Puluah.
== Pamarintahan ==
[[Berkas:COLLECTIE_TROPENMUSEUM_Huis_van_de_assistent_resident_te_Pajakoemboeh_TMnr_60001326.jpg|pra=https://id.wikipedia.org/wiki/Berkas:COLLECTIE_TROPENMUSEUM_Huis_van_de_assistent_resident_te_Pajakoemboeh_TMnr_60001326.jpg|jmpl|Rumah ''assistent-resident'' Payakumbuh di sakitar tahun 1900]]
Kota Payakumbuh sabagai [[pamarintah daerah]] manuruik Undang-undang Nomor 8 Taun 1956 tanggal [[19 Maret]] [[1956]], nan manatapkan kota ko sabagai ''kota kecil''.<ref>http://www.legalitas.org [http://www.legalitas.org/incl-php/buka.php?d=1900+56&f=uu8-1956.htm Undang-undang Nomor 8 tahun 1956] (diakses pada 27 Juni 2010)</ref> Kudian ditindaklanjuti dek Peraturan Menteri Dalam Nagari Nomor 8 taun 1970 tanggal [[17 Desember]] [[1970]] manatapkan kota ko manjadi daerah otonom pamarintah daerah tingkek II Kotamadya Payakumbuh. Salanjuiknyo wilayah administrasi pamarintahan tadiri ateh 3 wilayah [[kecamatan]] jo 73 [[kelurahan]] nan barasa dari 7 jorong nan ado di 7 ka[[nagari]]an nan ado sangkek itu, jo pambagian kecamatan Payakumbuh Barat jo 31 Kelurahan, kecamatan Payakumbuh Timur jo 14 kelurahan sarato kecamatan Payakumbuh Utara jo 28 kelurahan.
Sabalun taun 1970, Payakumbuh adolah bagian dari Kabupaten Lima Puluh Kota nan sakaligus ibu kota kabupaten tasabuik.
Pado taun [[2008]], sasuai jo pakambangannyo mako dilakukan pangambangan wilayah kecamatan, sainggo kota Payakumbuh mamiliki 5 wilayah kecamatan, jo 8 kanagarian sarato 76 wilayah kelurahan. Pado taun 2014 jo 2016 tajadi panggabuangan babarapo kelurahan nan wilayahnyo ketek jo saketek panduduak, sainggo jumlah kelurahan manyusuik manjadi 48 kelurahan.
Adopun wilayah kecamatan nan baru tu adolah kecamatan Lamposi Tigo Nagari, nan tadiri dari 6 kelurahan dalam kanagarian Sungai Durian, Lamposi jo Koto Panjang. [[Payakumbuh Selatan, Payakumbuh|Kecamatan Payakumbuh Selatan]], nan tadiri dari 6 kelurahan dalam 2 kanagarian iyolah [[Limbukan, Payakumbuh Selatan, Payakumbuh|Limbukan]] jo [[Aur Kuning, Payakumbuh Selatan, Payakumbuh|Aur Kuning]]. [[Payakumbuh Barat, Payakumbuh|Kecamatan Payakumbuh Barat]] tadiri dari 18 kelurahan dalam [[Koto Nan IV, Payakumbuh Barat, Payakumbuh|Kanagarian Koto Nan IV]]. [[Payakumbuh Timur, Payakumbuh|Kecamatan Payakumbuh Timur]] tadiri dari 9 kelurahan dalam 3 kanagarian, iyolah [[Aie Tabik, Payakumbuh Timur, Payakumbuh|Aie Tabik]], [[Payobasuang, Payakumbuh Timur, Payakumbuh|Payobasuang]] jo [[Tiakar, Payakumbuh Timur, Payakumbuh|Tiakar]]. [[Payakumbuh Utara, Payakumbuh|Kecamatan Payakumbuh Utara]] tadiri dari 9 kelurahan dalam [[Koto Nan Godang, Payakumbuh Utara, Payakumbuh|Kanagarian Koto Nan Godang]].<ref>http://www.payakumbuhkota.go.id [http://www.payakumbuhkota.go.id/?lang=ina&action=profil&tipe=umum Profil] (diakses pada 27 Juni 2010)</ref>
=== Daftar Wali Kota ===
{{utama|Daftar Wali Kota Payakumbuh}}
{{:Daftar Wali Kota Payakumbuh}}
=== Dewan Perwakilan ===
{{utama|Dewan Perwakilan Rakyat Daerah Kota Payakumbuh}}
{{:Dewan Perwakilan Rakyat Daerah Kota Payakumbuh}}
=== Kecamatan ===
{{utama|Daftar kecamatan dan kelurahan di Kota Payakumbuh}}
{{:Daftar kecamatan dan kelurahan di Kota Payakumbuh}}
== Panduduak ==
Kota ko didominasi dek etnis [[Minangkabau]], namun ado juo etnis [[Tionghoa-Indonesia|Tionghoa]], [[Tamil]], [[Urang Malayu|Malayu]], [[Urang Jawa|Jawa]], jo [[Urang Batak|Batak]], jo jumlah angkatan karajo 50.492 urang nan sakitar 3.483 urang diantaronyo marupokan pangangguran. Pado taun [[1943]] etnis Tionghoa di kota ko panah mancapai 2.000 jiwa dari 10.000 jiwa total populasi maso itu.<ref>Yoon-wah Wong, (1988), ''Essays on Chinese literature: a comparative approach'', NUS Press, ISBN 978-9971-69-109-7.</ref>
Dari segi jumlah panduduak, pado taun 1970 Payakumbuh ado pado paringkek katigo sasudah Padang jo Bukittinggi. Akan tetapi pabedaan jumlah panduduak Payakumbuh jo Bukittinggi relatif kaciak iyolah anyo 784 urang. Pado taun 2009 atau 40 taun kudian, jumlah panduduak Payakumbuh maningkek jauah manjadi 106 726 jiwa. Akan tetapi masih tatap ado pado paringkek katigo sasudah Bukittinggi jo pabedaan jumlah 894 urang.
Walaupun baitu, paningkekan jumlah panduduak ko maningkekan status Kota Payakumbuh dari kota kaciak (jumlah panduduak < 100.000 urang), manjadi kota manangah (jumlah panduduak > 100.000 urang)
== Pandidikan ==
Pado taun 1954 di Payakumbuh didirian paguruan tinggi patanian nan marupokan paguruan tinggi nagari nan tatuo di lua Jawa. PTN ikolah nan kudian bakambang manjadi [[Universitas Andalas]]. Pado taun 1960-an batagak pulo salah satu fakultas dari IAIN Imam Bonjol.
{| class="wikitable" style="font-size:90%;width:65%;border:0px;text-align:center;line-height:120%;"
! height="17" style="background: #E0FFFF; color: #000080" |Pandidikan formal
! style="background: #FFFFFF; color:#000080;" |SD atau MI nagari jo swasta
! style="background: #FFFFFF; color:#000080;" |SMP atau MTs nagari jo swasta
! style="background: #FFFFFF; color:#000080;" |SMA nagari jo swasta
! style="background: #FFFFFF; color:#000080;" |MA nagari jo swasta
! style="background: #FFFFFF; color:#000080;" |SMK nagari jo swasta
! style="background: #FFFFFF; color:#000080;" |Paguruan tinggi
|- align="center"
! height="17" style="background: #E0FFFF; color: #000080" |Jumlah satuan
| style="background: #FFFFFF; color: black;" |75
| style="background: #FFFFFF; color: black;" |20
| style="background: #FFFFFF; color: black;" |11
| style="background: #FFFFFF; color: black;" |5
| style="background: #FFFFFF; color: black;" |12
| style="background: #FFFFFF; color: black;" |2
|-
| colspan="13" style="text-align:center;font-size:90%;" |<small>Data sikolah di kota Payakumbuh</small><small>'''Sumber:'''<ref>nisn.jardiknas.org [http://nisn.jardiknas.org/cont/data_statistik/index.php?prop=103 Rekap Data]</ref></small>
|}
== Kasehatan ==
Untuak maningkekan taraf kasehatan, pamarintah kota Payakumbuh alah mambangun sabuah rumah sakit nan banamo [[Rumah Sakik Umum Daerah Dr. Adnaan WD]] sarato juo mandirikan 6 buah [[puskesmas]] jo 23 puskesmas pambantu.<ref>http://www.depkes.go.id [http://www.depkes.go.id/downloads/profil/kota%20payakumbuh%202008.pdf Profil Kesehatan Kota Payakumbuh] (diakses pada 3 Juli 2010)</ref>
Salain itu di kota ko juo ado sabuah rumah sakik swasta nan banama Rumah Sakik Yarsi.
== Parubuangan ==
[[Berkas:COLLECTIE_TROPENMUSEUM_Het_station_van_Pajakoemboeh_Sumatra`s_Westkust_TMnr_60009217.jpg|pra=https://id.wikipedia.org/wiki/Berkas:COLLECTIE_TROPENMUSEUM_Het_station_van_Pajakoemboeh_Sumatra%60s_Westkust_TMnr_60009217.jpg|ka|jmpl|250x250px|Stasiun kareta api Payakumbuh di sakitar tahun 1900]]
[[Berkas:COLLECTIE_TROPENMUSEUM_Stoomlocomotief_passeert_ijzeren_spoorbrug_bij_Pajakoemboeh_TMnr_60054626.jpg|pra=https://id.wikipedia.org/wiki/Berkas:COLLECTIE_TROPENMUSEUM_Stoomlocomotief_passeert_ijzeren_spoorbrug_bij_Pajakoemboeh_TMnr_60054626.jpg|ka|jmpl|250x250px|Lokomotif gerigi tipe B malintasi jambatan Payakumbuh]]
Kota ko tamasuak kota pangubuang antaro [[kota Padang]] jo [[kota Pekanbaru]], dari kota ko dapek juo tarubuang ka jalur linteh tangah Sumatera tanpa musti malalui [[kota Bukittinggi]]. [[Terminal Koto Nan Ampek]] marupokan terminal angkutan darek nan ado di kota ko. Sabagai pusek pelayanan, Payakumbuh dulu juo mampunyoi lapangan tabang, iyolah Lapangan Tabang Piobang.
Kini alah dibangun jalan lingka lua bagian utara (10,45 km) jo selatan (15,34 km) nan disabuik ''Payakumbuh Bypass'' untuak mamudahan akses transportasi jo indak harus malalui pusek kota dan untuak mandorong patumbuahan ekonominyo. Pambangunan jalan ko barasa dari dana pinjaman pamarintah pusek kapado [[Bank Pambangunan Asia]] (ADB).<ref>payakumbuhkota.go.id [http://payakumbuhkota.go.id/?lang=ina&action=profil&tipe=potensi Infrastruktur]</ref>
== Parekonomian ==
Kota Payakumbuh sabagai kota pasinggahan, manjadikan sektor [[jaso]] jo padagangan manjadi sektor andalan. Namun sektor lain sarupo [[patanian]], taranak jo [[parikanan]] masih manjanjikan bagi masyarakaik kota ko<ref>http://www.cps-sss.org [http://www.cps-sss.org/web/home/kabupaten/kab/Kota+Payakumbuh kota Payakumbuh] (diakses pada 27 Juni 2010)</ref> karano didukuang dek kondisi tanahnyo juo masih subur.
Untuak manjadikan kota ko sabagai sentra padagangan salain jo maningkekan pasa-pasa tradisional nan ado salamo ko, pamarintah satampek basamo masyarakaiknyo mancubo mambangun sistem pagudangan untuak mandukuang aktivitas padagangan nan modern. Kini kota Payakumbuh alah mamiliki sabuah pasa modern nan talatak di jantuang kotanyo.<ref>payakumbuhkota.go.id [http://payakumbuhkota.go.id/?lang=ina&action=profil&tipe=potensi Perdagangan] (diakses pada 3 Juli 2010)</ref>
Samantaro industri-industri nan ado di kota ko baru baskala ketek, namun alah mampu baproduksi untuak mamanuahi pamintaan pasa lua nagari, diantaronyo sulaman bordir jo songkok/peci. Salain itu industri makanan tradisional manjadi industri andalan nan bakambang di kota ko<ref>[http://www.sumbarprov.go.id/details/news/9070 Potensi Komoditi Industri Kecil dan Menengah Kota Payakumbuh Provinsi Sumatera Barat Tahun 2014]. Pemprov Sumatera Barat</ref>, dapek tasuo dari pusek kota inggo ka pinggia kota, sarupo di [[Lamposi Tigo Nagari, Payakumbuh|Lamposi]] nan tanamo sabagai ''Kampuang Randang''.<ref>[https://kumparan.com/langkanid/pemko-payakumbuh-tingkatkan-kualitas-produksi-kampung-rendang Pemko Payakumbuh Tingkatkan Kualitas Produksi Kampung Rendang.] kumparan.com</ref>
== Pariwisata ==
[[Berkas:Masjid Gadang Balai Nan Duo.jpg|jmpl|243x243px|Masajik Gadang Balai Nan Duo]]
Kota Payakumbuh tanamo mampunyoi makanan khas di antaronyo [[botiah]] (batiah) jo galamai, salain itu ado juo makanan khas lainnyo sarupo bareh randang, kipang, randang baluik, randang talua, jo martabak mesir. Di Nagari Tiakar tanamo makanan khasnyo banamo paniaram, iyolah kue dari bareh katan nan dicampua gulo saka.
Babarapo kawasan wisata di kota ko antaro lain [[Ngalau indah|Ngalau Indah]], [[Ngalau Sompik]], [[Puncak Simarajo]], [[Panorama Ampangan]], jo sabagainyo. Salain itu patunjukan [[Pacu itiak|Pacu Itiak]] marupokan tradisi nan satiok tahunnyo diadokan pado nagari-nagari nan ado dalam kota ko juo manjadi salah satu atraksi pariwisata di kota ko.
Babarapo objek wisata di sakitar kota Payakumbuh adolah:
* [[Jambatan Ratapan Ibu]]
* [[Surau Dagang Rao-Rao Labuah Baru]]
* [[Rumah Gadang Kapten Tantawi]]
* [[Masajik Tuo Koto Nan Ompek]]
* [[Masajik Gadang Balai Nan Duo Koto Nan Ompek]]
* [[Rumah Gadang Tuanku Lareh Koto Nan Ompek]]
* [[Makam Kiramaik Tanjuang Lilin]]
* [[Kampuang Tradisional Minangkabau Balai Kaliki Koto Nan Godang]]
== Olahraga jo Budayo ==
Masyarakaikkota ko mampunyoi klub sipak bola nan banamo Persepak Payakumbuh nan bamarkas di Stadion Kapten Tantawi.
Olahraga pacu kudo juo marupokan patunjukan nan paliang dituju dek masyarakaik kota ko, dan biaso satiok tahunnyo diadokan di galanggang pacuan kudo nan banamo Kubu Gadang nan kini manjadi bagian dari kompleks GOR M. Yamin.
Kota Payakumbuh mampunyoi babarapo patunjukan tradisional, di antaronyo tarian-tarian daerah nan bacampua jo gerakan silek sarato diiriangi jo nyanyian nan biaso ditampikan pado alek-alek adaik atau pagelaran seni nan banamo [[randai]].<ref>Phillips, Nigel, (1981), ''Sijobang: sung narrative poetry of West Sumatra'', Cambridge University Press, ISBN 978-0-521-23737-6.</ref> Salah satu kalompok randai nan tanamo diantaronyo dari daerah [[Padang Alai]], nan banamo ''Randai Cindua Mato''.
Masyarakaik kota Payakumbuh juo tanamo jo alaik musik jinih ''Talempong'', nan biaso ditampilkan dalam alek-alek adat, alek pakawinan, jo lain sabagainyo. Salain itu alaik musik lain nan masih tasuo di kota ko adolah ''Saluang'', iyolah sajinih alaik musik tiup atau ampia sarupo jo suliang.
== Seni ==
* [[Salawaik Talam]]
== Rujuakan ==
{{Reflist|2}}
== Pautan lua ==
*[http://www.payakumbuhkota.go.id/ Laman rasmi Pamarintah Kota Payakumbuh]
{{commonscat|Payakumbuh}}
{{Kota Payakumbuh}}
{{Sumatera Barat}}
[[Kategori:Kota di Sumatera Barat|Payakumbuh]]
[[Kategori:Kota di Indonesia]]
[[Kategori:Kota Payakumbuh]]
jh5t01m59r74y2gme2khzseg4dxh325
Templat:Infobox football biography
10
827
2444310
6126
2022-08-13T14:48:17Z
David Wadie Fisher-Freberg
51
tes
wikitext
text/x-wiki
{{Infobox3cols
| child = {{Yesno|{{{embed|no}}}}}
| bodyclass = vcard
| bodystyle = line-height: 1.2em;
| title = {{#ifeq:{{Yesno|{{{embed|no}}}}}|yes|{{#if:{{{header-color|}}}|<hr style="background-color: {{{header-color|transparent}}}; height: 3px;" />|}}<div style="text-align: center;">{{#if:{{{embed-header|}}}|{{{embed-header}}}|Association football career}}</div>|{{{name|<includeonly>{{{playername|{{PAGENAMEBASE}} }}}</includeonly>}}}}}
| titleclass = fn
| titlestyle = font-size: 125%; text-align: center; line-height: 1.2em;
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|}}}|sizedefault=frameless|upright={{{upright|}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
| caption = {{{caption|}}}
| captionstyle = padding:0.2em 0 0 0;
| headerstyle = background-color: {{#ifeq:{{Yesno|{{{embed|no}}}}}|yes|{{{header-color|transparent}}}|#b0c4de}}; line-height: 1.5em
| labelstyle = white-space: nowrap; vertical-align: baseline; text-align: left
| datastyle = white-space: nowrap; vertical-align: baseline;
| datastylea = white-space: nowrap; vertical-align: baseline;
| datastyleb = white-space: nowrap; vertical-align: baseline;{{#if:{{{caps(goals)1|{{{caps(goals)|}}}}}}{{{nationalcaps(goals)1|{{{nationalcaps(goals)|}}}}}}||text-align: right}}
| datastylec = white-space: nowrap; vertical-align: baseline; text-align: right
| header1 = {{#ifeq:{{Yesno|{{{embed|no}}}}}|yes||{{#if:{{{full_name|}}}{{{fullname|}}}{{{birth_name|}}}{{{birth_date|}}}{{{birth_place|}}}{{{death_date|}}}{{{death_place|}}}{{{height|}}}{{{position|}}}|Personal information}}}}
| label2 = Full name
| data2 = {{{full_name|{{{fullname|}}}}}}
|extracellstyles=2,3,4,5,6,7,8,9,11=white-space: normal;
| class2 = nickname
| label3 = Birth name
| data3 = {{{birth_name|}}}
| class3 = nickname
| label4 = Date of birth
| data4 = {{{birth_date|}}}
| label5 = Place of birth
| data5 = {{{birth_place|}}}
| class5 = birthplace
| label6 = Date of death
| data6 = {{{death_date|}}}
| label7 = Place of death
| class7 = deathplace
| data7 = {{{death_place|}}}
| label8 = Height
| data8 = {{#if:{{{height_m|{{{height_cm|}}}}}}{{{height_ft|}}}{{{height_in|}}} | {{convinfobox|{{{height_m|{{{height_cm|}}}}}}|{{#if:{{{height_m|}}}|m|cm}}|{{{height_ft|}}}|ft|{{{height_in|}}}|in}} }}{{#if:{{{height|}}} | {{#invoke:person height|main|{{{height|}}}}} }}
| label9 = Position(s)
| class9 = role
| data9 = {{{position|}}}
| header10 = {{#if:{{{currentclub|}}}|Club information}}
| label11 = {{Longitem|Current team}}
| class11 = org
| data11 = {{{currentclub|}}}
| label12 = Number
| data12 = {{{clubnumber|}}}
| header13 = {{#if:{{{youthclubs1|{{{youthclubs|}}}}}}|Youth career}}
| label14 = {{#if:{{{clubs1|{{{clubs|}}}}}}||{{#if:{{{youthyears1|{{{youthyears|}}}}}}|Years}} }}
| data14 = {{#if:{{{clubs1|{{{clubs|}}}}}}||{{#if:{{{youthclubs1|{{{youthclubs|}}}}}}|'''Team'''}} }}
| label15 = {{#if:{{{youthclubs|}}}|<span style="line-height:1.7em">}}{{#if:{{{youthclubs1|{{{youthclubs|}}}}}}|<span style="font-weight:normal">{{{youthyears1|{{{youthyears|–}}}}}}</span>}}
| data15 = {{#if:{{{youthclubs|}}}|<span style="line-height:1.7em">}}{{{youthclubs1|{{{youthclubs|}}}}}}
| label16 = {{#if:{{{youthclubs2|}}}|<span style="font-weight:normal">{{{youthyears2|–}}}</span>}}
| data16 = {{{youthclubs2|}}}
| label17 = {{#if:{{{youthclubs3|}}}|<span style="font-weight:normal">{{{youthyears3|–}}}</span>}}
| data17 = {{{youthclubs3|}}}
| label18 = {{#if:{{{youthclubs4|}}}|<span style="font-weight:normal">{{{youthyears4|–}}}</span>}}
| data18 = {{{youthclubs4|}}}
| label19 = {{#if:{{{youthclubs5|}}}|<span style="font-weight:normal">{{{youthyears5|–}}}</span>}}
| data19 = {{{youthclubs5|}}}
| label20 = {{#if:{{{youthclubs6|}}}|<span style="font-weight:normal">{{{youthyears6|–}}}</span>}}
| data20 = {{{youthclubs6|}}}
| label21 = {{#if:{{{youthclubs7|}}}|<span style="font-weight:normal">{{{youthyears7|–}}}</span>}}
| data21 = {{{youthclubs7|}}}
| label22 = {{#if:{{{youthclubs8|}}}|<span style="font-weight:normal">{{{youthyears8|–}}}</span>}}
| data22 = {{{youthclubs8|}}}
| label23 = {{#if:{{{youthclubs9|}}}|<span style="font-weight:normal">{{{youthyears9|–}}}</span>}}
| data23 = {{{youthclubs9|}}}
| label24 = {{#if:{{{youthclubs10|}}}|<span style="font-weight:normal">{{{youthyears10|–}}}</span>}}
| data24 = {{{youthclubs10|}}}
| header25 = {{#if:{{{college1|{{{colleges|}}}}}}|College career }}
| label26 = {{#if:{{{college1|{{{colleges|}}}}}}|Years}}
| data26a = {{#if:{{{college1|{{{colleges|}}}}}}|'''Team'''}}
| data26b = {{#if:{{{college1|{{{colleges|}}}}}}|{{#if:{{{collegecaps(goals)1|{{{collegecaps(goals)|}}}}}}|'''{{abbr|Apps|League appearances}} ({{abbr|Gls|League goals}})'''|'''{{abbr|Apps|League appearances}}'''}} }}
| data26c = {{#if:{{{collegecaps(goals)1|{{{collegecaps(goals)|}}}}}}||'''({{abbr|Gls|League goals}})'''}}
| label27 = {{#if:{{{colleges|}}}|<span style="line-height:1.7em">}}{{#if:{{{college1|{{{colleges|}}}}}}|<span style="font-weight:normal">{{{collegeyears1|{{{collegeyears|–}}}}}}</span>}}
| data27a = {{#if:{{{colleges|}}}|<span style="line-height:1.7em">}}{{{college1|{{{colleges|}}}}}}
| data27b = {{#if:{{{colleges|}}}|<span style="line-height:1.7em">}}{{{collegecaps1| {{{collegecaps|{{{collegecaps(goals)1|{{{collegecaps(goals)|}}}}}} }}}}}}
| data27c = {{#if:{{{colleges|}}}|<span style="line-height:1.7em">}}{{#if:{{{collegegoals1|{{{collegegoals|}}}}}}|({{{collegegoals1|{{{collegegoals|}}}}}})}}
| label28 = {{#if:{{{college2|}}}|<span style="font-weight:normal">{{{collegeyears2|–}}}</span>}}
| data28a = {{{college2|}}}
| data28b = {{{collegecaps2|{{{collegecaps(goals)2|}}} }}}
| data28c = {{#if:{{{collegegoals2|}}}|({{{collegegoals2}}})}}
| label29 = {{#if:{{{college3|}}}|<span style="font-weight:normal">{{{collegeyears3|–}}}</span>}}
| data29a = {{{college3|}}}
| data29b = {{{collegecaps3|{{{collegecaps(goals)3|}}} }}}
| data29c = {{#if:{{{collegegoals3|}}}|({{{collegegoals3}}})}}
| label30 = {{#if:{{{college4|}}}|<span style="font-weight:normal">{{{collegeyears4|–}}}</span>}}
| data30a = {{{college4|}}}
| data30b = {{{collegecaps4|{{{collegecaps(goals)4|}}} }}}
| data30c = {{#if:{{{collegegoals4|}}}|({{{collegegoals4}}})}}
| header31 = {{#if:{{{clubs1|{{{clubs|}}}}}}|Senior career* }}
| label32 = {{#if:{{{clubs1|{{{clubs|}}}}}}|Years}}
| data32a = {{#if:{{{clubs1|{{{clubs|}}}}}}|'''Team'''}}
| data32b = {{#if:{{{clubs1|{{{clubs|}}}}}}|{{#if:{{{caps(goals)1|{{{caps(goals)|}}}}}}|'''{{abbr|Apps|League appearances}} ({{abbr|Gls|League goals}})'''|'''{{abbr|Apps|League appearances}}'''}} }}
| data32c = {{#if:{{{caps(goals)1|{{{caps(goals)|}}}}}}||'''({{abbr|Gls|League goals}})'''}}
| label33 = {{#if:{{{clubs|}}}|<span style="line-height:1.7em">}}{{#if:{{{clubs1|{{{clubs|}}}}}}|<span style="font-weight:normal">{{{years1|{{{years|–}}}}}}</span>}}
| data33a = {{#if:{{{clubs|}}}|<span style="line-height:1.7em">}}{{{clubs1|{{{clubs|}}}}}}
| data33b = {{#if:{{{clubs|}}}|<span style="line-height:1.7em">}}{{{caps1| {{{caps|{{{caps(goals)1|{{{caps(goals)|}}}}}} }}}}}}
| data33c = {{#if:{{{clubs|}}}|<span style="line-height:1.7em">}}{{#if:{{{goals1|{{{goals|}}}}}}|({{{goals1|{{{goals|}}}}}})}}
| label34 = {{#if:{{{clubs2|}}}|<span style="font-weight:normal">{{{years2|–}}}</span>}}
| data34a = {{{clubs2|}}}
| data34b = {{{caps2|{{{caps(goals)2|}}} }}}
| data34c = {{#if:{{{goals2|}}}|({{{goals2}}})}}
| label35 = {{#if:{{{clubs3|}}}|<span style="font-weight:normal">{{{years3|–}}}</span>}}
| data35a = {{{clubs3|}}}
| data35b = {{{caps3|{{{caps(goals)3|}}} }}}
| data35c = {{#if:{{{goals3|}}}|({{{goals3}}})}}
| label36 = {{#if:{{{clubs4|}}}|<span style="font-weight:normal">{{{years4|–}}}</span>}}
| data36a = {{{clubs4|}}}
| data36b = {{{caps4|{{{caps(goals)4|}}} }}}
| data36c = {{#if:{{{goals4|}}}|({{{goals4}}})}}
| label37 = {{#if:{{{clubs5|}}}|<span style="font-weight:normal">{{{years5|–}}}</span>}}
| data37a = {{{clubs5|}}}
| data37b = {{{caps5|{{{caps(goals)5|}}} }}}
| data37c = {{#if:{{{goals5|}}}|({{{goals5}}})}}
| label38 = {{#if:{{{clubs6|}}}|<span style="font-weight:normal">{{{years6|–}}}</span>}}
| data38a = {{{clubs6|}}}
| data38b = {{{caps6|{{{caps(goals)6|}}} }}}
| data38c = {{#if:{{{goals6|}}}|({{{goals6}}})}}
| label39 = {{#if:{{{clubs7|}}}|<span style="font-weight:normal">{{{years7|–}}}</span>}}
| data39a = {{{clubs7|}}}
| data39b = {{{caps7|{{{caps(goals)7|}}} }}}
| data39c = {{#if:{{{goals7|}}}|({{{goals7}}})}}
| label40 = {{#if:{{{clubs8|}}}|<span style="font-weight:normal">{{{years8|–}}}</span>}}
| data40a = {{{clubs8|}}}
| data40b = {{{caps8|{{{caps(goals)8|}}} }}}
| data40c = {{#if:{{{goals8|}}}|({{{goals8}}})}}
| label41 = {{#if:{{{clubs9|}}}|<span style="font-weight:normal">{{{years9|–}}}</span>}}
| data41a = {{{clubs9|}}}
| data41b = {{{caps9|{{{caps(goals)9|}}} }}}
| data41c = {{#if:{{{goals9|}}}|({{{goals9}}})}}
| label42 = {{#if:{{{clubs10|}}}|<span style="font-weight:normal">{{{years10|–}}}</span>}}
| data42a = {{{clubs10|}}}
| data42b = {{{caps10|{{{caps(goals)10|}}} }}}
| data42c = {{#if:{{{goals10|}}}|({{{goals10}}})}}
| label43 = {{#if:{{{clubs11|}}}|<span style="font-weight:normal">{{{years11|–}}}</span>}}
| data43a = {{{clubs11|}}}
| data43b = {{{caps11|{{{caps(goals)11|}}} }}}
| data43c = {{#if:{{{goals11|}}}|({{{goals11}}})}}
| label44 = {{#if:{{{clubs12|}}}|<span style="font-weight:normal">{{{years12|–}}}</span>}}
| data44a = {{{clubs12|}}}
| data44b = {{{caps12|{{{caps(goals)12|}}} }}}
| data44c = {{#if:{{{goals12|}}}|({{{goals12}}})}}
| label45 = {{#if:{{{clubs13|}}}|<span style="font-weight:normal">{{{years13|–}}}</span>}}
| data45a = {{{clubs13|}}}
| data45b = {{{caps13|{{{caps(goals)13|}}} }}}
| data45c = {{#if:{{{goals13|}}}|({{{goals13}}})}}
| label46 = {{#if:{{{clubs14|}}}|<span style="font-weight:normal">{{{years14|–}}}</span>}}
| data46a = {{{clubs14|}}}
| data46b = {{{caps14|{{{caps(goals)14|}}} }}}
| data46c = {{#if:{{{goals14|}}}|({{{goals14}}})}}
| label47 = {{#if:{{{clubs15|}}}|<span style="font-weight:normal">{{{years15|–}}}</span>}}
| data47a = {{{clubs15|}}}
| data47b = {{{caps15|{{{caps(goals)15|}}} }}}
| data47c = {{#if:{{{goals15|}}}|({{{goals15}}})}}
| label48 = {{#if:{{{clubs16|}}}|<span style="font-weight:normal">{{{years16|–}}}</span>}}
| data48a = {{{clubs16|}}}
| data48b = {{{caps16|{{{caps(goals)16|}}} }}}
| data48c = {{#if:{{{goals16|}}}|({{{goals16}}})}}
| label49 = {{#if:{{{clubs17|}}}|<span style="font-weight:normal">{{{years17|–}}}</span>}}
| data49a = {{{clubs17|}}}
| data49b = {{{caps17|{{{caps(goals)17|}}} }}}
| data49c = {{#if:{{{goals17|}}}|({{{goals17}}})}}
| label50 = {{#if:{{{clubs18|}}}|<span style="font-weight:normal">{{{years18|–}}}</span>}}
| data50a = {{{clubs18|}}}
| data50b = {{{caps18|{{{caps(goals)18|}}} }}}
| data50c = {{#if:{{{goals18|}}}|({{{goals18}}})}}
| label51 = {{#if:{{{clubs19|}}}|<span style="font-weight:normal">{{{years19|–}}}</span>}}
| data51a = {{{clubs19|}}}
| data51b = {{{caps19|{{{caps(goals)19|}}} }}}
| data51c = {{#if:{{{goals19|}}}|({{{goals19}}})}}
| label52 = {{#if:{{{clubs20|}}}|<span style="font-weight:normal">{{{years20|–}}}</span>}}
| data52a = {{{clubs20|}}}
| data52b = {{{caps20|{{{caps(goals)20|}}} }}}
| data52c = {{#if:{{{goals20|}}}|({{{goals20}}})}}
| label53 = {{#if:{{{clubs21|}}}|<span style="font-weight:normal">{{{years21|–}}}</span>}}
| data53a = {{{clubs21|}}}
| data53b = {{{caps21|{{{caps(goals)21|}}} }}}
| data53c = {{#if:{{{goals21|}}}|({{{goals21}}})}}
| label54 = {{#if:{{{clubs22|}}}|<span style="font-weight:normal">{{{years22|–}}}</span>}}
| data54a = {{{clubs22|}}}
| data54b = {{{caps22|{{{caps(goals)22|}}} }}}
| data54c = {{#if:{{{goals22|}}}|({{{goals22}}})}}
| label55 = {{#if:{{{clubs23|}}}|<span style="font-weight:normal">{{{years23|–}}}</span>}}
| data55a = {{{clubs23|}}}
| data55b = {{{caps23|{{{caps(goals)23|}}} }}}
| data55c = {{#if:{{{goals23|}}}|({{{goals23}}})}}
| label56 = {{#if:{{{clubs24|}}}|<span style="font-weight:normal">{{{years24|–}}}</span>}}
| data56a = {{{clubs24|}}}
| data56b = {{{caps24|{{{caps(goals)24|}}} }}}
| data56c = {{#if:{{{goals24|}}}|({{{goals24}}})}}
| label57 = {{#if:{{{clubs25|}}}|<span style="font-weight:normal">{{{years25|–}}}</span>}}
| data57a = {{{clubs25|}}}
| data57b = {{{caps25|{{{caps(goals)25|}}} }}}
| data57c = {{#if:{{{goals25|}}}|({{{goals25}}})}}
| label58 = {{#if:{{{clubs26|}}}|<span style="font-weight:normal">{{{years26|–}}}</span>}}
| data58a = {{{clubs26|}}}
| data58b = {{{caps26|{{{caps(goals)26|}}} }}}
| data58c = {{#if:{{{goals26|}}}|({{{goals26}}})}}
| label59 = {{#if:{{{clubs27|}}}|<span style="font-weight:normal">{{{years27|–}}}</span>}}
| data59a = {{{clubs27|}}}
| data59b = {{{caps27|{{{caps(goals)27|}}} }}}
| data59c = {{#if:{{{goals27|}}}|({{{goals27}}})}}
| label60 = {{#if:{{{clubs28|}}}|<span style="font-weight:normal">{{{years28|–}}}</span>}}
| data60a = {{{clubs28|}}}
| data60b = {{{caps28|{{{caps(goals)28|}}} }}}
| data60c = {{#if:{{{goals28|}}}|({{{goals28}}})}}
| label61 = {{#if:{{{clubs29|}}}|<span style="font-weight:normal">{{{years29|–}}}</span>}}
| data61a = {{{clubs29|}}}
| data61b = {{{caps29|{{{caps(goals)29|}}} }}}
| data61c = {{#if:{{{goals29|}}}|({{{goals29}}})}}
| label62 = {{#if:{{{clubs30|}}}|<span style="font-weight:normal">{{{years30|–}}}</span>}}
| data62a = {{{clubs30|}}}
| data62b = {{{caps30|{{{caps(goals)30|}}} }}}
| data62c = {{#if:{{{goals30|}}}|({{{goals30}}})}}
| label63 = {{#if:{{{clubs31|}}}|<span style="font-weight:normal">{{{years31|–}}}</span>}}
| data63a = {{{clubs31|}}}
| data63b = {{{caps31|{{{caps(goals)31|}}} }}}
| data63c = {{#if:{{{goals31|}}}|({{{goals31}}})}}
| label64 = {{#if:{{{clubs32|}}}|<span style="font-weight:normal">{{{years32|–}}}</span>}}
| data64a = {{{clubs32|}}}
| data64b = {{{caps32|{{{caps(goals)32|}}} }}}
| data64c = {{#if:{{{goals32|}}}|({{{goals32}}})}}
| label65 = {{#if:{{{clubs33|}}}|<span style="font-weight:normal">{{{years33|–}}}</span>}}
| data65a = {{{clubs33|}}}
| data65b = {{{caps33|{{{caps(goals)33|}}} }}}
| data65c = {{#if:{{{goals33|}}}|({{{goals33}}})}}
| label66 = {{#if:{{{clubs34|}}}|<span style="font-weight:normal">{{{years34|–}}}</span>}}
| data66a = {{{clubs34|}}}
| data66b = {{{caps34|{{{caps(goals)34|}}} }}}
| data66c = {{#if:{{{goals34|}}}|({{{goals34}}})}}
| label67 = {{#if:{{{clubs35|}}}|<span style="font-weight:normal">{{{years35|–}}}</span>}}
| data67a = {{{clubs35|}}}
| data67b = {{{caps35|{{{caps(goals)35|}}} }}}
| data67c = {{#if:{{{goals35|}}}|({{{goals35}}})}}
| label68 = {{#if:{{{clubs36|}}}|<span style="font-weight:normal">{{{years36|–}}}</span>}}
| data68a = {{{clubs36|}}}
| data68b = {{{caps36|{{{caps(goals)36|}}} }}}
| data68c = {{#if:{{{goals36|}}}|({{{goals36}}})}}
| label69 = {{#if:{{{clubs37|}}}|<span style="font-weight:normal">{{{years37|–}}}</span>}}
| data69a = {{{clubs37|}}}
| data69b = {{{caps37|{{{caps(goals)37|}}} }}}
| data69c = {{#if:{{{goals37|}}}|({{{goals37}}})}}
| label70 = {{#if:{{{clubs38|}}}|<span style="font-weight:normal">{{{years38|–}}}</span>}}
| data70a = {{{clubs38|}}}
| data70b = {{{caps38|{{{caps(goals)38|}}} }}}
| data70c = {{#if:{{{goals38|}}}|({{{goals38}}})}}
| label71 = {{#if:{{{clubs39|}}}|<span style="font-weight:normal">{{{years39|–}}}</span>}}
| data71a = {{{clubs39|}}}
| data71b = {{{caps39|{{{caps(goals)39|}}} }}}
| data71c = {{#if:{{{goals39|}}}|({{{goals39}}})}}
| label72 = {{#if:{{{clubs40|}}}|<span style="font-weight:normal">{{{years40|–}}}</span>}}
| data72a = {{{clubs40|}}}
| data72b = {{{caps40|{{{caps(goals)40|}}} }}}
| data72c = {{#if:{{{goals40|}}}|({{{goals40}}})}}
| label73 = {{#if:{{{clubs41|}}}|<span style="font-weight:normal">{{{years41|–}}}</span>}}
| data73a = {{{clubs41|}}}
| data73b = {{{caps41|{{{caps(goals)41|}}} }}}
| data73c = {{#if:{{{goals41|}}}|({{{goals41}}})}}
| label74 = {{#if:{{{clubs42|}}}|<span style="font-weight:normal">{{{years42|–}}}</span>}}
| data74a = {{{clubs42|}}}
| data74b = {{{caps42|{{{caps(goals)42|}}} }}}
| data74c = {{#if:{{{goals42|}}}|({{{goals42}}})}}
| label75 = {{#if:{{{clubs43|}}}|<span style="font-weight:normal">{{{years43|–}}}</span>}}
| data75a = {{{clubs43|}}}
| data75b = {{{caps43|{{{caps(goals)43|}}} }}}
| data75c = {{#if:{{{goals43|}}}|({{{goals43}}})}}
| label76 = {{#if:{{{clubs44|}}}|<span style="font-weight:normal">{{{years44|–}}}</span>}}
| data76a = {{{clubs44|}}}
| data76b = {{{caps44|{{{caps(goals)44|}}} }}}
| data76c = {{#if:{{{goals44|}}}|({{{goals44}}})}}
| label77 = {{#if:{{{clubs45|}}}|<span style="font-weight:normal">{{{years45|–}}}</span>}}
| data77a = {{{clubs45|}}}
| data77b = {{{caps45|{{{caps(goals)45|}}} }}}
| data77c = {{#if:{{{goals45|}}}|({{{goals45}}})}}
| label78 = {{#if:{{{clubs46|}}}|<span style="font-weight:normal">{{{years46|–}}}</span>}}
| data78a = {{{clubs46|}}}
| data78b = {{{caps46|{{{caps(goals)46|}}} }}}
| data78c = {{#if:{{{goals46|}}}|({{{goals46}}})}}
| label79 = {{#if:{{{clubs47|}}}|<span style="font-weight:normal">{{{years47|–}}}</span>}}
| data79a = {{{clubs47|}}}
| data79b = {{{caps47|{{{caps(goals)47|}}} }}}
| data79c = {{#if:{{{goals47|}}}|({{{goals47}}})}}
| label80 = {{#if:{{{clubs48|}}}|<span style="font-weight:normal">{{{years48|–}}}</span>}}
| data80a = {{{clubs48|}}}
| data80b = {{{caps48|{{{caps(goals)48|}}} }}}
| data80c = {{#if:{{{goals48|}}}|({{{goals48}}})}}
| label81 = {{#if:{{{clubs49|}}}|<span style="font-weight:normal">{{{years49|–}}}</span>}}
| data81a = {{{clubs49|}}}
| data81b = {{{caps49|{{{caps(goals)49|}}} }}}
| data81c = {{#if:{{{goals49|}}}|({{{goals49}}})}}
| label82 = {{#if:{{{clubs50|}}}|<span style="font-weight:normal">{{{years50|–}}}</span>}}
| data82a = {{{clubs50|}}}
| data82b = {{{caps50|{{{caps(goals)50|}}} }}}
| data82c = {{#if:{{{goals50|}}}|({{{goals50}}})}}
| label83 = {{#if:{{{totalyears|}}}|{{{totalyears}}}|{{#if:{{{totalcaps|}}}{{{totalcaps(goals)|}}}|Total}}}}
| data83a = {{#if:{{{totalyears|}}}|{{#if:{{{totalcaps|}}}{{{totalcaps(goals)|}}}|'''Total'''}}}}
| data83b = {{#if:{{{totalcaps|}}}{{{totalcaps(goals)|}}}|'''{{{totalcaps|{{{totalcaps(goals)}}} }}}'''}}
| data83c = {{#if:{{{totalgoals|}}}|'''({{{totalgoals}}})'''}}
| header84 = {{#if:{{{nationalteam1|{{{nationalteam|}}}}}}|National team{{#if:{{{ntupdate|{{{nationalteam-update|}}}}}}|<sup>‡</sup> }} }}
| label85 = {{#if:{{{clubs1|{{{clubs|}}}}}}||{{#if:{{{nationalyears1|{{{nationalyears|}}}}}}|Years}} }}
| data85a = {{#if:{{{clubs1|{{{clubs|}}}}}}||{{#if:{{{nationalteam1|{{{nationalteam|}}}}}}|'''Team'''}} }}
| data85b = {{#if:{{{clubs1|{{{clubs|}}}}}}||{{#if:{{{nationalcaps(goals)1|{{{nationalcaps(goals)|}}}}}}|'''{{abbr|Apps|National team appearances}} ({{abbr|Gls|National team goals}})'''|'''{{abbr|Apps|National team appearances}}'''}} }}
| data85c = {{#if:{{{goals1|{{{goals|}}}}}}||{{#if:{{{nationalcaps(goals)1|{{{nationalcaps(goals)|}}}}}}||'''({{abbr|Gls|National team goals}})'''}} }}
| label86 = {{#if:{{{nationalteam|}}}|<span style="line-height:1.7em">}}{{#if:{{{nationalteam1|{{{nationalteam|}}}}}}|<span style="font-weight:normal">{{{nationalyears1|{{{nationalyears|–}}}}}}</span>}}
| data86a = {{#if:{{{nationalteam|}}}|<span style="line-height:1.7em">}}{{{nationalteam1|{{{nationalteam|}}}}}}
| data86b = {{#if:{{{nationalteam|}}}|<span style="line-height:1.7em">}}{{{nationalcaps1|{{{nationalcaps(goals)1|{{{nationalcaps|{{{nationalcaps(goals)|}}} }}} }}} }}}
| data86c = {{#if:{{{nationalteam|}}}|<span style="line-height:1.7em">}}{{#if:{{{nationalgoals1|{{{nationalgoals|}}}}}}|({{{nationalgoals1|{{{nationalgoals|}}}}}})}}
| label87 = {{#if:{{{nationalteam2|}}}|<span style="font-weight:normal">{{{nationalyears2|–}}}</span>}}
| data87a = {{{nationalteam2|}}}
| data87b = {{{nationalcaps2|{{{nationalcaps(goals)2|}}} }}}
| data87c = {{#if:{{{nationalgoals2|}}}|({{{nationalgoals2}}})}}
| label88 = {{#if:{{{nationalteam3|}}}|<span style="font-weight:normal">{{{nationalyears3|–}}}</span>}}
| data88a = {{{nationalteam3|}}}
| data88b = {{{nationalcaps3|{{{nationalcaps(goals)3|}}} }}}
| data88c = {{#if:{{{nationalgoals3|}}}|({{{nationalgoals3}}})}}
| label89 = {{#if:{{{nationalteam4|}}}|<span style="font-weight:normal">{{{nationalyears4|–}}}</span>}}
| data89a = {{{nationalteam4|}}}
| data89b = {{{nationalcaps4|{{{nationalcaps(goals)4|}}} }}}
| data89c = {{#if:{{{nationalgoals4|}}}|({{{nationalgoals4}}})}}
| label90 = {{#if:{{{nationalteam5|}}}|<span style="font-weight:normal">{{{nationalyears5|–}}}</span>}}
| data90a = {{{nationalteam5|}}}
| data90b = {{{nationalcaps5|{{{nationalcaps(goals)5|}}} }}}
| data90c = {{#if:{{{nationalgoals5|}}}|({{{nationalgoals5}}})}}
| label91 = {{#if:{{{nationalteam6|}}}|<span style="font-weight:normal">{{{nationalyears6|–}}}</span>}}
| data91a = {{{nationalteam6|}}}
| data91b = {{{nationalcaps6|{{{nationalcaps(goals)6|}}} }}}
| data91c = {{#if:{{{nationalgoals6|}}}|({{{nationalgoals6}}})}}
| label92 = {{#if:{{{nationalteam7|}}}|<span style="font-weight:normal">{{{nationalyears7|–}}}</span>}}
| data92a = {{{nationalteam7|}}}
| data92b = {{{nationalcaps7|{{{nationalcaps(goals)7|}}} }}}
| data92c = {{#if:{{{nationalgoals7|}}}|({{{nationalgoals7}}})}}
| label93 = {{#if:{{{nationalteam8|}}}|<span style="font-weight:normal">{{{nationalyears8|–}}}</span>}}
| data93a = {{{nationalteam8|}}}
| data93b = {{{nationalcaps8|{{{nationalcaps(goals)8|}}} }}}
| data93c = {{#if:{{{nationalgoals8|}}}|({{{nationalgoals8}}})}}
| label94 = {{#if:{{{nationalteam9|}}}|<span style="font-weight:normal">{{{nationalyears9|–}}}</span>}}
| data94a = {{{nationalteam9|}}}
| data94b = {{{nationalcaps9|{{{nationalcaps(goals)9|}}} }}}
| data94c = {{#if:{{{nationalgoals9|}}}|({{{nationalgoals9}}})}}
| header95 = {{#if:{{{managerclubs1|{{{managerclubs|}}}}}}|Teams managed}}
| label96 = {{#if:{{{clubs1|{{{clubs|}}}}}}||{{#if:{{{managerclubs1|{{{managerclubs|}}}}}}|Years}} }}
| data96a = {{#if:{{{clubs1|{{{clubs|}}}}}}||{{#if:{{{manageryears1|{{{manageryears|}}}}}}|'''Team'''}} }}
| label97 = {{#if:{{{managerclubs|}}}|<span style="line-height:1.7em; font-weight:normal">{{{manageryears|–}}}</span>}}{{
#if:{{{managerclubs1|}}}|{{
#if:{{{managerclubs|}}} |<span style="line-height:1.8em"><br></span>
}}<span style="font-weight:normal">{{{manageryears1|–}}}</span>}}
| data97 = {{#if:{{{managerclubs|}}}|<span style="line-height:1.7em">{{{managerclubs}}}</span>}}{{
#if:{{{managerclubs1|}}} |{{
#if:{{{managerclubs|}}} |<span style="line-height:1.8em"><br></span>
}}{{{managerclubs1}}} }}
| label98 = {{#if:{{{managerclubs2|}}}|<span style="font-weight:normal">{{{manageryears2|–}}}</span>}}
| data98 = {{{managerclubs2|}}}
| label99 = {{#if:{{{managerclubs3|}}}|<span style="font-weight:normal">{{{manageryears3|–}}}</span>}}
| data99 = {{{managerclubs3|}}}
| label100 = {{#if:{{{managerclubs4|}}}|<span style="font-weight:normal">{{{manageryears4|–}}}</span>}}
| data100 = {{{managerclubs4|}}}
| label101 = {{#if:{{{managerclubs5|}}}|<span style="font-weight:normal">{{{manageryears5|–}}}</span>}}
| data101 = {{{managerclubs5|}}}
| label102 = {{#if:{{{managerclubs6|}}}|<span style="font-weight:normal">{{{manageryears6|–}}}</span>}}
| data102 = {{{managerclubs6|}}}
| label103 = {{#if:{{{managerclubs7|}}}|<span style="font-weight:normal">{{{manageryears7|–}}}</span>}}
| data103 = {{{managerclubs7|}}}
| label104 = {{#if:{{{managerclubs8|}}}|<span style="font-weight:normal">{{{manageryears8|–}}}</span>}}
| data104 = {{{managerclubs8|}}}
| label105 = {{#if:{{{managerclubs9|}}}|<span style="font-weight:normal">{{{manageryears9|–}}}</span>}}
| data105 = {{{managerclubs9|}}}
| label106 = {{#if:{{{managerclubs10|}}}|<span style="font-weight:normal">{{{manageryears10|–}}}</span>}}
| data106 = {{{managerclubs10|}}}
| label107 = {{#if:{{{managerclubs11|}}}|<span style="font-weight:normal">{{{manageryears11|–}}}</span>}}
| data107 = {{{managerclubs11|}}}
| label108 = {{#if:{{{managerclubs12|}}}|<span style="font-weight:normal">{{{manageryears12|–}}}</span>}}
| data108 = {{{managerclubs12|}}}
| label109 = {{#if:{{{managerclubs13|}}}|<span style="font-weight:normal">{{{manageryears13|–}}}</span>}}
| data109 = {{{managerclubs13|}}}
| label110 = {{#if:{{{managerclubs14|}}}|<span style="font-weight:normal">{{{manageryears14|–}}}</span>}}
| data110 = {{{managerclubs14|}}}
| label111 = {{#if:{{{managerclubs15|}}}|<span style="font-weight:normal">{{{manageryears15|–}}}</span>}}
| data111 = {{{managerclubs15|}}}
| label112 = {{#if:{{{managerclubs16|}}}|<span style="font-weight:normal">{{{manageryears16|–}}}</span>}}
| data112 = {{{managerclubs16|}}}
| label113 = {{#if:{{{managerclubs17|}}}|<span style="font-weight:normal">{{{manageryears17|–}}}</span>}}
| data113 = {{{managerclubs17|}}}
| label114 = {{#if:{{{managerclubs18|}}}|<span style="font-weight:normal">{{{manageryears18|–}}}</span>}}
| data114 = {{{managerclubs18|}}}
| label115 = {{#if:{{{managerclubs19|}}}|<span style="font-weight:normal">{{{manageryears19|–}}}</span>}}
| data115 = {{{managerclubs19|}}}
| label116 = {{#if:{{{managerclubs20|}}}|<span style="font-weight:normal">{{{manageryears20|–}}}</span>}}
| data116 = {{{managerclubs20|}}}
| label117 = {{#if:{{{managerclubs21|}}}|<span style="font-weight:normal">{{{manageryears21|–}}}</span>}}
| data117 = {{{managerclubs21|}}}
| label118 = {{#if:{{{managerclubs22|}}}|<span style="font-weight:normal">{{{manageryears22|–}}}</span>}}
| data118 = {{{managerclubs22|}}}
| label119 = {{#if:{{{managerclubs23|}}}|<span style="font-weight:normal">{{{manageryears23|–}}}</span>}}
| data119 = {{{managerclubs23|}}}
| label120 = {{#if:{{{managerclubs24|}}}|<span style="font-weight:normal">{{{manageryears24|–}}}</span>}}
| data120 = {{{managerclubs24|}}}
| label121 = {{#if:{{{managerclubs25|}}}|<span style="font-weight:normal">{{{manageryears25|–}}}</span>}}
| data121 = {{{managerclubs25|}}}
| label122 = {{#if:{{{managerclubs26|}}}|<span style="font-weight:normal">{{{manageryears26|–}}}</span>}}
| data122 = {{{managerclubs26|}}}
| label123 = {{#if:{{{managerclubs27|}}}|<span style="font-weight:normal">{{{manageryears27|–}}}</span>}}
| data123 = {{{managerclubs27|}}}
| label124 = {{#if:{{{managerclubs28|}}}|<span style="font-weight:normal">{{{manageryears28|–}}}</span>}}
| data124 = {{{managerclubs28|}}}
| label125 = {{#if:{{{managerclubs29|}}}|<span style="font-weight:normal">{{{manageryears29|–}}}</span>}}
| data125 = {{{managerclubs29|}}}
| label126 = {{#if:{{{managerclubs30|}}}|<span style="font-weight:normal">{{{manageryears30|–}}}</span>}}
| data126 = {{{managerclubs30|}}}
| label127 = {{#if:{{{managerclubs31|}}}|<span style="font-weight:normal">{{{manageryears31|–}}}</span>}}
| data127 = {{{managerclubs31|}}}
| label128 = {{#if:{{{managerclubs32|}}}|<span style="font-weight:normal">{{{manageryears32|–}}}</span>}}
| data128 = {{{managerclubs32|}}}
| label129 = {{#if:{{{managerclubs33|}}}|<span style="font-weight:normal">{{{manageryears33|–}}}</span>}}
| data129 = {{{managerclubs33|}}}
| label130 = {{#if:{{{managerclubs34|}}}|<span style="font-weight:normal">{{{manageryears34|–}}}</span>}}
| data130 = {{{managerclubs34|}}}
| label131 = {{#if:{{{managerclubs35|}}}|<span style="font-weight:normal">{{{manageryears35|–}}}</span>}}
| data131 = {{{managerclubs35|}}}
| label132 = {{#if:{{{managerclubs36|}}}|<span style="font-weight:normal">{{{manageryears36|–}}}</span>}}
| data132 = {{{managerclubs36|}}}
| label133 = {{#if:{{{managerclubs37|}}}|<span style="font-weight:normal">{{{manageryears37|–}}}</span>}}
| data133 = {{{managerclubs37|}}}
| label134 = {{#if:{{{managerclubs38|}}}|<span style="font-weight:normal">{{{manageryears38|–}}}</span>}}
| data134 = {{{managerclubs38|}}}
| label135 = {{#if:{{{managerclubs39|}}}|<span style="font-weight:normal">{{{manageryears39|–}}}</span>}}
| data135 = {{{managerclubs39|}}}
| label136 = {{#if:{{{managerclubs40|}}}|<span style="font-weight:normal">{{{manageryears40|–}}}</span>}}
| data136 = {{{managerclubs40|}}}
| label137 = {{#if:{{{managerclubs41|}}}|<span style="font-weight:normal">{{{manageryears41|–}}}</span>}}
| data137 = {{{managerclubs41|}}}
| label138 = {{#if:{{{managerclubs42|}}}|<span style="font-weight:normal">{{{manageryears42|–}}}</span>}}
| data138 = {{{managerclubs42|}}}
| label139 = {{#if:{{{managerclubs43|}}}|<span style="font-weight:normal">{{{manageryears43|–}}}</span>}}
| data139 = {{{managerclubs43|}}}
| label140 = {{#if:{{{managerclubs44|}}}|<span style="font-weight:normal">{{{manageryears44|–}}}</span>}}
| data140 = {{{managerclubs44|}}}
| label141 = {{#if:{{{managerclubs45|}}}|<span style="font-weight:normal">{{{manageryears45|–}}}</span>}}
| data141 = {{{managerclubs45|}}}
| label142 = {{#if:{{{managerclubs46|}}}|<span style="font-weight:normal">{{{manageryears46|–}}}</span>}}
| data142 = {{{managerclubs46|}}}
| label143 = {{#if:{{{managerclubs47|}}}|<span style="font-weight:normal">{{{manageryears47|–}}}</span>}}
| data143 = {{{managerclubs47|}}}
| label144 = {{#if:{{{managerclubs48|}}}|<span style="font-weight:normal">{{{manageryears48|–}}}</span>}}
| data144 = {{{managerclubs48|}}}
| label145 = {{#if:{{{managerclubs49|}}}|<span style="font-weight:normal">{{{manageryears49|–}}}</span>}}
| data145 = {{{managerclubs49|}}}
| header146 = {{Infobox medal templates
|title = {{{medaltemplates-title|Honours}}}
|medals = {{{medaltemplates|}}}
|expand = {{{medaltemplates-expand|{{{show-medals|}}}}}}
}}
| data147 = {{#if:{{{module|}}}|<nowiki />
{{{!}} style="text-align:left; width:100%; margin:0; border-spacing:0; line-height: normal"
{{!}}-
{{!}}
{{{module|}}}
{{!}}}
}}
| belowstyle = color:darkslategray; font-size:95%
| below = {{br separated entries
| 1 = {{#if:{{{clubs1|{{{clubs|}}}}}}|<nowiki>*</nowiki>Club domestic league appearances and goals{{#if:{{{pcupdate|{{{club-update|}}}}}}|, correct as of {{{pcupdate|{{{club-update}}}}}}}} }}
| 2 = {{#if:{{{ntupdate|{{{nationalteam-update|}}}}}}|‡ National team caps and goals, correct as of {{{ntupdate|{{{nationalteam-update}}}}}} }}
}}
}}<includeonly><!--
-->{{#ifeq:MATCH|{{#invoke:string|replace|{{{position|}}}|.*[Rr][Ee][Tt][Ii][Rr][Ee][Dd].*|MATCH|plain=false}}|[[Category:Pages using infobox football biography with position matching retired]]
}}<!--
-->{{#ifeq:{{Yesno|{{{embed|no}}}}}|yes||{{Wikidata image|1={{{image|}}}|2={{{nocat_wdimage|}}} }}}}<!--
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox football biography with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox football biography]] with unknown parameter "_VALUE_"|ignoreblank=y| alt | birth_date | birth_name | birth_place | caption | club-update | clubnumber | currentclub | death_date | death_place | embed | embed-header | full_name | fullname | header-color | height | height_cm | height_ft | height_in | height_m | image | image_size | medaltemplates | medaltemplates-expand | medaltemplates-title | module | name | nationalteam-update | nocat_wdimage | ntupdate | pcupdate | playername | position | show-medals | upright
| regexp1 = youthyears[1-9] | regexp2 = youthclubs[1-9] | youthyears10 | youthclubs10
| regexp3 = collegeyears[1-4] | regexp4 = college[1-4] | regexp5 = collegecaps[1-4] | regexp6 = collegegoals[1-4]
| regexp7 = years[1-9] | regexp8 = clubs[1-9] | regexp9 = caps[1-9] | regexp10 = goals[1-9]
| regexp11 = years[1-4][%d] | regexp12 = clubs[1-4][%d] | regexp13 = caps[1-4][%d] | regexp14 = goals[1-4][%d]
| years50 | clubs50 | caps50 | goals50
| totalyears | totalcaps | totalgoals
| regexp15 = nationalyears[1-9] | regexp16 = nationalteam[1-9] | regexp17 = nationalcaps[1-9] | regexp18 = nationalgoals[1-9]
| regexp19 = manageryears[1-9] | regexp20 = managerclubs[1-9]
| regexp21 = manageryears[1-4][%d] | regexp22 = managerclubs[1-4][%d]
}}{{#if:{{{module|}}}|[[Category:Pages using infobox football biography with a module]]}}</includeonly><noinclude>
{{documentation}}
</noinclude>
mhl5x4dk47eg6f66n31iogjj959bbik
Templat:Infobox football biography/doc
10
828
2444311
3997
2022-08-13T14:48:37Z
David Wadie Fisher-Freberg
51
update
wikitext
text/x-wiki
{{Documentation subpage}}
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
{{For|American football biographies|Template:Infobox NFL biography}}
{{#ifeq:{{SUBPAGENAME}}|sandbox||{{High-use}}}}
{{Tracks Wikidata|P18|cat=No local image but image on Wikidata}}
{{Lua|Module:Infobox3cols|Module:InfoboxImage|Module:Check for unknown parameters|Module:String}}
{{tl|Infobox football biography}} is intended to provide a quick overview of an [[association football]] player's or manager's details to enable a reader to extract the most oft-needed information without trawling through the article proper.
{{Parameter names example
| name | image | image_size | alt | caption | fullname | birth_name | birth_date | birth_place | death_date | death_place | height | position | currentclub | clubnumber
| youthyears1 | youthclubs1 | youthyears2 | youthclubs2 | youthyears3 | youthclubs3 | youthyears4 | youthclubs4 | youthyears5 | youthclubs5 | youthyears6 | youthclubs6 | youthyears7 | youthclubs7 | youthyears8 | youthclubs8 | youthyears9 | youthclubs9 | youthyears10 | youthclubs10
| collegeyears1 | college1 | collegecaps1 | collegegoals1
| collegeyears2 | college2 | collegecaps2 | collegegoals2
| collegeyears3 | college3 | collegecaps3 | collegegoals3
| years1 | clubs1 | caps1 | goals1 | years2 | clubs2 | caps2 | goals2 | years3 | clubs3 | caps3 | goals3 | years4 | clubs4 | caps4 | goals4 | years5 | clubs5 | caps5 | goals5 | years6 | clubs6 | caps6 | goals6 | years7 | clubs7 | caps7 | goals7 | years8 | clubs8 | caps8 | goals8 | years9 | clubs9 | caps9 | goals9 | years10 | clubs10 | caps10 | goals10 | years11 | clubs11 | caps11 | goals11 | years12 | clubs12 | caps12 | goals12 | years13 | clubs13 | caps13 | goals13 | years14 | clubs14 | caps14 | goals14 | years15 | clubs15 | caps15 | goals15 | years16 | clubs16 | caps16 | goals16 | years17 | clubs17 | caps17 | goals17 | years18 | clubs18 | caps18 | goals18 | years19 | clubs19 | caps19 | goals19 | years20 | clubs20 | caps20 | goals20 | years21 | clubs21 | caps21 | goals21 | years22 | clubs22 | caps22 | goals22 | years23 | clubs23 | caps23 | goals23 | years24 | clubs24 | caps24 | goals24 | years25 | clubs25 | caps25 | goals25 | years26 | clubs26 | caps26 | goals26 | years27 | clubs27 | caps27 | goals27 | years28 | clubs28 | caps28 | goals28 | years29 | clubs29 | caps29 | goals29 | years30 | clubs30 | caps30 | goals30 | years31 | clubs31 | caps31 | goals31 | years32 | clubs32 | caps32 | goals32 | years33 | clubs33 | caps33 | goals33 | years34 | clubs34 | caps34 | goals34 | years35 | clubs35 | caps35 | goals35 | years36 | clubs36 | caps36 | goals36 | years37 | clubs37 | caps37 | goals37 | years38 | clubs38 | caps38 | goals38 | years39 | clubs39 | caps39 | goals39 | years40 | clubs40 | caps40 | goals40 | years41 | clubs41 | caps41 | goals41 | years42 | clubs42 | caps42 | goals42 | years43 | clubs43 | caps43 | goals43 | years44 | clubs44 | caps44 | goals44 | years45 | clubs45 | caps45 | goals45 | years46 | clubs46 | caps46 | goals46 | years47 | clubs47 | caps47 | goals47 | years48 | clubs48 | caps48 | goals48 | years49 | clubs49 | caps49 | goals49 | years50 | clubs50 | caps50 | goals50
| totalyears | totalcaps | totalgoals
| nationalyears1 | nationalteam1 | nationalcaps1 | nationalgoals1 | nationalyears2 | nationalteam2 | nationalcaps2 | nationalgoals2 | nationalyears3 | nationalteam3 | nationalcaps3 | nationalgoals3 | nationalyears4 | nationalteam4 | nationalcaps4 | nationalgoals4 | nationalyears5 | nationalteam5 | nationalcaps5 | nationalgoals5 | nationalyears6 | nationalteam6 | nationalcaps6 | nationalgoals6 | nationalyears7 | nationalteam7 | nationalcaps7 | nationalgoals7 | nationalyears8 | nationalteam8 | nationalcaps8 | nationalgoals8 | nationalyears9 | nationalteam9 | nationalcaps9 | nationalgoals9
| manageryears1 | managerclubs1 | manageryears2 | managerclubs2 | manageryears3 | managerclubs3 | manageryears4 | managerclubs4 | manageryears5 | managerclubs5 | manageryears6 | managerclubs6 | manageryears7 | managerclubs7 | manageryears8 | managerclubs8 | manageryears9 | managerclubs9 | manageryears10 | managerclubs10 | manageryears11 | managerclubs11 | manageryears12 | managerclubs12 | manageryears13 | managerclubs13 | manageryears14 | managerclubs14 | manageryears15 | managerclubs15 | manageryears16 | managerclubs16 | manageryears17 | managerclubs17 | manageryears18 | managerclubs18 | manageryears19 | managerclubs19 | manageryears20 | managerclubs20 | manageryears21 | managerclubs21 | manageryears22 | managerclubs22 | manageryears23 | managerclubs23 | manageryears24 | managerclubs24 | manageryears25 | managerclubs25 | manageryears26 | managerclubs26 | manageryears27 | managerclubs27 | manageryears28 | managerclubs28 | manageryears29 | managerclubs29 | manageryears30 | managerclubs30 | manageryears31 | managerclubs31 | manageryears32 | managerclubs32 | manageryears33 | managerclubs33 | manageryears34 | managerclubs34 | manageryears35 | managerclubs35 | manageryears36 | managerclubs36 | manageryears37 | managerclubs37 | manageryears38 | managerclubs38 | manageryears39 | managerclubs39 | manageryears40 | managerclubs40 | manageryears41 | managerclubs41 | manageryears42 | managerclubs42 | manageryears43 | managerclubs43 | manageryears44 | managerclubs44 | manageryears45 | managerclubs45 | manageryears46 | managerclubs46 | manageryears47 | managerclubs47 | manageryears48 | managerclubs48 | manageryears49 | managerclubs49
| medaltemplates-title | medaltemplates | medaltemplates-expand
| module | club-update | nationalteam-update
}}
== Usage ==
Note: all the field names ending in '''1''' should be repeated for each team, e.g. '''youthyears1''' and '''youthclubs1''' should be followed by '''youthyears2''' and '''youthclubs2''' and so on, as needed.
===Current players===
<pre style="overflow: auto;">
{{Infobox football biography
|embed =
|name =
|image =
|image_size =
|alt =
|caption =
|fullname =
|birth_date =
|birth_place =
|height =
|position =
|currentclub =
|clubnumber =
|youthyears1 =
|youthclubs1 =
|collegeyears1 =
|college1 =
|collegecaps1 =
|collegegoals1 =
|years1 =
|clubs1 =
|caps1 =
|goals1 =
|nationalyears1 =
|nationalteam1 =
|nationalcaps1 =
|nationalgoals1 =
|medaltemplates =
|club-update =
|nationalteam-update =
}}
</pre>
===Former players===
<pre style="overflow: auto;">
{{Infobox football biography
|embed =
|name =
|image =
|image_size =
|alt =
|caption =
|fullname =
|birth_date =
|birth_place =
|death_date =
|death_place =
|height =
|position =
|youthyears1 =
|youthclubs1 =
|collegeyears1 =
|college1 =
|collegecaps1 =
|collegegoals1 =
|years1 =
|clubs1 =
|caps1 =
|goals1 =
|totalcaps =
|totalgoals =
|nationalyears1 =
|nationalteam1 =
|nationalcaps1 =
|nationalgoals1 =
|medaltemplates =
}}
</pre>
===Managers who were players===
<pre style="overflow: auto;">
{{Infobox football biography
|embed =
|name =
|image =
|image_size =
|alt =
|caption =
|fullname =
|birth_date =
|birth_place =
|death_date =
|death_place =
|height =
|position =
|currentclub =
|youthyears1 =
|youthclubs1 =
|collegeyears1 =
|college1 =
|collegecaps1 =
|collegegoals1 =
|years1 =
|clubs1 =
|caps1 =
|goals1 =
|totalcaps =
|totalgoals =
|nationalyears1 =
|nationalteam1 =
|nationalcaps1 =
|nationalgoals1 =
|medaltemplates =
|manageryears1 =
|managerclubs1 =
}}
</pre>
===Managers who were not players===
<pre style="overflow: auto;">
{{Infobox football biography
|embed =
|name =
|image =
|image_size =
|caption =
|fullname =
|birth_date =
|birth_place =
|death_date =
|death_place =
|currentclub =
|manageryears1 =
|managerclubs1 =
}}
</pre>
=== Full blank template ===
{{Hidden begin |showhide=left |title=Blank template with all parameters |bodystyle=font-size:105%;}}
<pre style="overflow: auto;">
{{Infobox football biography
| embed =
| name =
| image =
| image_size =
| alt =
| caption =
| fullname =
| birth_name =
| birth_date =
| birth_place =
| death_date =
| death_place =
| height =
| position =
| currentclub =
| clubnumber =
| youthyears1 =
| youthclubs1 =
| youthyears2 =
| youthclubs2 =
| youthyears3 =
| youthclubs3 =
| youthyears4 =
| youthclubs4 =
| youthyears5 =
| youthclubs5 =
| youthyears6 =
| youthclubs6 =
| youthyears7 =
| youthclubs7 =
| youthyears8 =
| youthclubs8 =
| collegeyears1 =
| college1 =
| collegecaps1 =
| collegegoals1 =
| collegeyears2 =
| college2 =
| collegecaps2 =
| collegegoals2 =
| collegeyears3 =
| college3 =
| collegecaps3 =
| collegegoals3 =
| years1 =
| clubs1 =
| caps1 =
| goals1 =
| years2 =
| clubs2 =
| caps2 =
| goals2 =
| years3 =
| clubs3 =
| caps3 =
| goals3 =
| years4 =
| clubs4 =
| caps4 =
| goals4 =
| years5 =
| clubs5 =
| caps5 =
| goals5 =
| years6 =
| clubs6 =
| caps6 =
| goals6 =
| years7 =
| clubs7 =
| caps7 =
| goals7 =
| years8 =
| clubs8 =
| caps8 =
| goals8 =
| years9 =
| clubs9 =
| caps9 =
| goals9 =
| years10 =
| clubs10 =
| caps10 =
| goals10 =
| years11 =
| clubs11 =
| caps11 =
| goals11 =
| years12 =
| clubs12 =
| caps12 =
| goals12 =
| years13 =
| clubs13 =
| caps13 =
| goals13 =
| years14 =
| clubs14 =
| caps14 =
| goals14 =
| years15 =
| clubs15 =
| caps15 =
| goals15 =
| years16 =
| clubs16 =
| caps16 =
| goals16 =
| years17 =
| clubs17 =
| caps17 =
| goals17 =
| years18 =
| clubs18 =
| caps18 =
| goals18 =
| years19 =
| clubs19 =
| caps19 =
| goals19 =
| years20 =
| clubs20 =
| caps20 =
| goals20 =
| years21 =
| clubs21 =
| caps21 =
| goals21 =
| years22 =
| clubs22 =
| caps22 =
| goals22 =
| years23 =
| clubs23 =
| caps23 =
| goals23 =
| years24 =
| clubs24 =
| caps24 =
| goals24 =
| years25 =
| clubs25 =
| caps25 =
| goals25 =
| years26 =
| clubs26 =
| caps26 =
| goals26 =
| years27 =
| clubs27 =
| caps27 =
| goals27 =
| years28 =
| clubs28 =
| caps28 =
| goals28 =
| years29 =
| clubs29 =
| caps29 =
| goals29 =
| years30 =
| clubs30 =
| caps30 =
| goals30 =
| years31 =
| clubs31 =
| caps31 =
| goals31 =
| years32 =
| clubs32 =
| caps32 =
| goals32 =
| years33 =
| clubs33 =
| caps33 =
| goals33 =
| years34 =
| clubs34 =
| caps34 =
| goals34 =
| years35 =
| clubs35 =
| caps35 =
| goals35 =
| years36 =
| clubs36 =
| caps36 =
| goals36 =
| years37 =
| clubs37 =
| caps37 =
| goals37 =
| years38 =
| clubs38 =
| caps38 =
| goals38 =
| years39 =
| clubs39 =
| caps39 =
| goals39 =
| totalyears =
| totalcaps =
| totalgoals =
| nationalyears1 =
| nationalteam1 =
| nationalcaps1 =
| nationalgoals1 =
| nationalyears2 =
| nationalteam2 =
| nationalcaps2 =
| nationalgoals2 =
| nationalyears3 =
| nationalteam3 =
| nationalcaps3 =
| nationalgoals3 =
| nationalyears4 =
| nationalteam4 =
| nationalcaps4 =
| nationalgoals4 =
| nationalyears5 =
| nationalteam5 =
| nationalcaps5 =
| nationalgoals5 =
| nationalyears6 =
| nationalteam6 =
| nationalcaps6 =
| nationalgoals6 =
| nationalyears7 =
| nationalteam7 =
| nationalcaps7 =
| nationalgoals7 =
| nationalyears8 =
| nationalteam8 =
| nationalcaps8 =
| nationalgoals8 =
| nationalyears9 =
| nationalteam9 =
| nationalcaps9 =
| nationalgoals9 =
| manageryears1 =
| managerclubs1 =
| manageryears2 =
| managerclubs2 =
| manageryears3 =
| managerclubs3 =
| manageryears4 =
| managerclubs4 =
| manageryears5 =
| managerclubs5 =
| manageryears6 =
| managerclubs6 =
| manageryears7 =
| managerclubs7 =
| manageryears8 =
| managerclubs8 =
| manageryears9 =
| managerclubs9 =
| manageryears10 =
| managerclubs10 =
| manageryears11 =
| managerclubs11 =
| manageryears12 =
| managerclubs12 =
| manageryears13 =
| managerclubs13 =
| manageryears14 =
| managerclubs14 =
| manageryears15 =
| managerclubs15 =
| manageryears16 =
| managerclubs16 =
| manageryears17 =
| managerclubs17 =
| manageryears18 =
| managerclubs18 =
| manageryears19 =
| managerclubs19 =
| manageryears20 =
| managerclubs20 =
| manageryears21 =
| managerclubs21 =
| manageryears22 =
| managerclubs22 =
| manageryears23 =
| managerclubs23 =
| manageryears24 =
| managerclubs24 =
| manageryears25 =
| managerclubs25 =
| manageryears26 =
| managerclubs26 =
| manageryears27 =
| managerclubs27 =
| manageryears28 =
| managerclubs28 =
| manageryears29 =
| managerclubs29 =
| manageryears30 =
| managerclubs30 =
| manageryears31 =
| managerclubs31 =
| manageryears32 =
| managerclubs32 =
| manageryears33 =
| managerclubs33 =
| manageryears34 =
| managerclubs34 =
| manageryears35 =
| managerclubs35 =
| manageryears36 =
| managerclubs36 =
| manageryears37 =
| managerclubs37 =
| manageryears38 =
| managerclubs38 =
| manageryears39 =
| managerclubs39 =
| manageryears40 =
| managerclubs40 =
| manageryears41 =
| managerclubs41 =
| manageryears42 =
| managerclubs42 =
| manageryears43 =
| managerclubs43 =
| manageryears44 =
| managerclubs44 =
| manageryears45 =
| managerclubs45 =
| manageryears46 =
| managerclubs46 =
| manageryears47 =
| managerclubs47 =
| manageryears48 =
| managerclubs48 =
| manageryears49 =
| managerclubs49 =
| medaltemplates-title =
| medaltemplates =
| medaltemplates-expand =
| module =
| club-update =
| nationalteam-update =
}}
</pre>
{{Hidden end}}
{{Clear}}
== Parameters ==
All parameters are optional.
;{{{embed}}}: Enables the template to be embedded into another template, such as {{tl|Infobox person}}.
;{{{name}}}: The commonly used name of the player. If this is omitted, it will be inferred from the title of the article.
;{{{fullname}}}: The player's complete name. Long names will wrap automatically to the width of the infobox, so there's no need to include explicit linebreaks.
;{{{image}}}: A picture of the player, ideally on the pitch in the strip of their most recent team (or the team the player is most well known for, in the case of retirees). Images should be given in the format {{mono|<nowiki>Example.jpg</nowiki>}}, rather than {{mono|<nowiki>[[File:Example.jpg]]</nowiki>}}.
;{{{image_size}}}: The image's size, given as a number.
;{{{alt}}}: [[WP:ALT|Alternative text]] for the image.
;{{{caption}}}: A caption for the image.
;{{{birth_name}}}: If different from name and fullname.
;{{{birth_date}}}: The player's date of birth. A template ({{Tl|Birth date}}, {{Tl|Birth date and age}}) should be used to add the date, but be sure to use the appropriate parameters to present the date in the same format as used in the text. The date should not be wikilinked.
;{{{birth_place}}}: The location of the player's birth.
;{{{height}}}: The player's height in the units most common within the country in which they play, with a conversion (e.g. by using {{tl|height}}). The infobox also supports [[Template:Infobox person/height/doc|automatic conversion]] if the height is specified as "X m", "X cm", or "X ft Y in".
;{{{position}}}: The player's '''most common''' position or positions. If a player is known for playing in multiple roles then explain the point more fully within the article.
;{{{currentclub}}}: The club for which the player currently plays, or is employed by. If the player now works in a non-playing role at the club, add this after the club in brackets. For retired players and free agents not currently employed by any club or federation, leave blank.
;{{{clubnumber}}}: The shirt number of the player at their current club.
;{{{youthclubs1}}}, {{{youthclubs2}}}... {{{youthclubs8}}}: A list of clubs that the player was a member of as a youth, one per attribute, earliest to latest.
;{{{college1}}}... {{{college3}}}: A list of colleges that the player was a member of as a part of a scholarship, one per attribute, earliest to latest.
;{{{youthyears1}}}, {{{youthyears2}}}... {{{youthyears8}}}: A list of years that the player has been at each club as a youth, one per attribute, earliest to latest.
;{{{years1}}}, {{{years2}}}... {{{years39}}}: A list of years that the player has been contracted at each club, one per attribute, earliest to latest.
;{{{clubs1}}}, {{{clubs2}}}... {{{clubs39}}}: A list of clubs that the player has been contracted at, one per attribute, earliest to latest.
;{{{caps1}}}, {{{caps2}}}... {{{caps39}}}: A list of appearances that the player has been awarded in '''league competition''' only for each club (note: Playoff matches are '''not''' counted as league matches by most statistical sources (e.g. [http://www.soccerbase.com Soccerbase] and the Sky Sports (Rothmans) Football Yearbook), so they should not be included in this infobox), one per attribute, earliest to latest.
;{{{totalcaps}}}: The total number of appearances the player has been awarded in '''league competition''' for all clubs.
;{{{goals1}}}, {{{goals2}}}... {{{goals39}}}: A list of goals that the player has been awarded in '''league competition''' only for each club (note: Playoff matches are '''not''' counted as league matches by most statistical sources (e.g. [http://www.soccerbase.com Soccerbase] and the Sky Sports (Rothmans) Football Yearbook), so they should not be included in this infobox), one per attribute, earliest to latest.
;{{{totalgoals}}}: The total number of goals the player has scored in '''league competition''' for all clubs.
;{{{nationalyears1}}}, {{{nationalyears2}}}... {{{nationalyears9}}}: A list of years that the player has played for each national team, one per attribute, earliest to latest.
;{{{nationalteam1}}}, {{{nationalteam2}}}... {{{nationalteam9}}}: A list of international teams that the player has played for, including non-senior teams such as U21, one per attribute, earliest to latest.
;{{{nationalcaps1}}}, {{{nationalcaps2}}}... {{{nationalcaps9}}}: A list of appearances that the player has been awarded in '''all competitions and friendlies''' for each national team, one per attribute, earliest to latest.
;{{{nationalgoals1}}}, {{{nationalgoals2}}}... {{{nationalgoals9}}}: A list of goals that the player has been awarded in '''all competitions and friendlies''' for each national team, one per attribute, earliest to latest.
;{{{managerclubs1}}}, {{{managerclubs2}}}... {{{managerclubs30}}}: A list of clubs that the person has served within the capacity of team manager. Please '''do not''' list positions other than team manager (such as assistant or coach positions, or director of football roles where this role is not considered managerial) unless that position is a significant part of the person's career; this will apply primarily to those with significant or perhaps primary experience in management. Clubs listed can be both local and national and should be restricted to those ordinarily considered notable in themselves.
;{{{manageryears1}}}, {{{manageryears2}}}... {{{manageryears30}}}: A list of years to accompany the above clubs.
;{{{medaltemplates}}}: Honours can be added here using the templates {{tl|Medal}}.
;{{{club-update}}} (''previously {{{pcupdate}}}''): A timestamp at which the player's infobox club statistics are unambiguously correct. The bare date of the last match played should not be used because this is not unambiguous. Dates should use the same format as the rest of the article; use five tildes (<nowiki>~~~~~</nowiki>) to generate the current date/time in dmy format, or {{subst|mdytime}} for mdy format. The parameter is not needed if the player has retired.
;{{{nationalteam-update}}} (''previously {{{ntupdate}}}''): A timestamp at which the player's infobox national team statistics are unambiguously correct. The bare date of the last match played should not be used because this is not unambiguous. Dates should use the same format as the rest of the article; use five tildes (<nowiki>~~~~~</nowiki>) to generate the current date/time in dmy format, or {{subst|mdytime}} for mdy format. The parameter is not needed if the player has retired.
=== Use as a child template ===
The '''embed''' parameter is used when embedding this infobox into another.
{{Infobox person module documentation|Infobox football biography|parameter=embed}}
=== Embedding other templates ===
The '''module''' parameter is used for embedding other templates into this infobox (see [[Wikipedia:Infobox modules]] and [[:Category:Biographical templates usable as a module]]).
<pre style="overflow: auto;">
{{Infobox football biography
| name =
| <!-- etc. -->
| module =
{{Infobox ABC
| embed = yes <!-- or child=yes / subbox=yes-->
| <!-- etc. -->
}}
}}
</pre>
== Examples ==
=== Independent ===
{{Infobox football biography
|name = Tim Template
|image = Nizar-Khalfan.jpg
|alt = Photo of a player in blue football kit, hair braided.
|caption = Tim Template with the Template Rangers
|fullname = Tim Tenerife Template
|birth_date = {{birth date and age|1975|1|1|df=y}}
|birth_place = Template City, Templatia
|height = {{height|m=1.75}}
|position = [[Forward (association football)|Striker]]
|currentclub = Template City F.C.
|clubnumber = 9
|youthyears1 = 1985–1987
|youthclubs1 = Template Juniors
|youthyears2 = 1987–1992
|youthclubs2 = Template Youth
|collegeyears1 = 1983–1985
|college1 = Template College
|collegecaps1 = 2
|collegegoals1 = 1
|years1 = 1992–1999
|clubs1 = Template United F.C.
|caps1 = 75
|goals1 = 26
|years2 = 1999–2002
|clubs2 = Template Rangers
|caps2 = 32
|goals2 = 11
|years3 = 2001
|clubs3 = → Example F.C. (loan)
|caps3 = 15
|goals3 = 7
|years4 = 2002–
|clubs4 = Template City F.C.
|caps4 = 113
|goals4 = 46
|nationalyears1 = 1991
|nationalteam1 = Examplia U16
|nationalcaps1 = 1
|nationalgoals1 = 0
|nationalyears2 = 1996–1998
|nationalteam2 = Templatia U21
|nationalcaps2 = 8
|nationalgoals2 = 2
|nationalyears3 = 1999–
|nationalteam3 = Templatia
|nationalcaps3 = 46
|nationalgoals3 = 13
|medaltemplates =
{{medal|Team|Template City F.C.}}
{{medal|W|Template League| 2003}}
{{medal|RU|Template Cup| 2004}}
{{medal|Team|Templatia}}
{{medal|3rd|FIFA Template Cup| 2001}}
|club-update = 14:56, 6 October 2014 (UTC)
|nationalteam-update = 14:56, 6 October 2014 (UTC)
}}
<pre style="overflow:auto;">
{{Infobox football biography
|name = Tim Template
|image = Nizar-Khalfan.jpg
|alt = Photo of a player in blue football kit, hair braided.
|caption = Tim Template with the Template Rangers
|fullname = Tim Tenerife Template
|birth_date = {{birth date and age|1975|1|1|df=y}}
|birth_place = Template City, Templatia
|height = {{height|m=1.75}}
|position = [[Forward (association football)|Striker]]
|currentclub = Template City F.C.
|clubnumber = 9
|youthyears1 = 1985–1987
|youthclubs1 = Template Juniors
|youthyears2 = 1987–1992
|youthclubs2 = Template Youth
|collegeyears1 = 1983–1985
|college1 = Template College
|collegecaps1 = 2
|collegegoals1 = 1
|years1 = 1992–1999
|clubs1 = Template United F.C.
|caps1 = 75
|goals1 = 26
|years2 = 1999–2002
|clubs2 = Template Rangers
|caps2 = 32
|goals2 = 11
|years3 = 2001
|clubs3 = → Example F.C. (loan)
|caps3 = 15
|goals3 = 7
|years4 = 2002–
|clubs4 = Template City F.C.
|caps4 = 113
|goals4 = 46
|nationalyears1 = 1991
|nationalteam1 = Examplia U16
|nationalcaps1 = 1
|nationalgoals1 = 0
|nationalyears2 = 1996–1998
|nationalteam2 = Templatia U21
|nationalcaps2 = 8
|nationalgoals2 = 2
|nationalyears3 = 1999–
|nationalteam3 = Templatia
|nationalcaps3 = 46
|nationalgoals3 = 13
|medaltemplates =
{{medal|Team|Template City F.C.}}
{{medal|W|Template League| 2003}}
{{medal|RU|Template Cup| 2004}}
{{medal|Team|Templatia}}
{{medal|3rd|FIFA Template Cup| 2001}}
|club-update = ~~~~~
|nationalteam-update = ~~~~~
}}
</pre> {{clear}}
=== Embedded in a different infobox (embed parameter) ===
{{Infobox person
|name = Tim Template
|image = Nizar-Khalfan.jpg
|alt = Photo of a player in blue football kit, hair braided.
|caption = Tim Template with the Template Rangers
|birth_name = Tim Tenerife Template
|birth_date = {{birth date and age|1975|1|1|df=y}}
|birth_place = Template City, Templatia
|height = {{height|m=1.75}}
|module =
{{Infobox football biography
|embed = yes
|position = [[Forward (association football)|Striker]]
|currentclub = Template City F.C.
|clubnumber = 9
|youthyears1 = 1985–1987
|youthclubs1 = Template Juniors
|youthyears2 = 1987–1992
|youthclubs2 = Template Youth
|collegeyears1 = 1983-1985
|college1 = Template College
|collegecaps1 = 2
|collegegoals1 = 1
|years1 = 1992–1999
|clubs1 = Template United F.C.
|caps1 = 75
|goals1 = 26
|years2 = 1999–2002
|clubs2 = Template Rangers
|caps2 = 32
|goals2 = 11
|years3 = 2001
|clubs3 = → Example F.C. (loan)
|caps3 = 15
|goals3 = 7
|years4 = 2002–
|clubs4 = Template City F.C.
|caps4 = 113
|goals4 = 46
|nationalyears1 = 1991
|nationalteam1 = Examplia U16
|nationalcaps1 = 1
|nationalgoals1 = 0
|nationalyears2 = 1996–1998
|nationalteam2 = Templatia U21
|nationalcaps2 = 8
|nationalgoals2 = 2
|nationalyears3 = 1999–
|nationalteam3 = Templatia
|nationalcaps3 = 46
|nationalgoals3 = 13
|medaltemplates =
{{medal|Team|Template City F.C.}}
{{medal|W|Template League| 2003}}
{{medal|RU|Template Cup| 2004}}
{{medal|Team|Templatia}}
{{medal|3rd|FIFA Template Cup| 2001}}
|club-update = 14:56, 6 October 2014 (UTC)
|nationalteam-update = 14:56, 6 October 2014 (UTC)
}}
}}
<pre style="overflow:auto;">
{{Infobox person
|name = Tim Template
|image = Nizar-Khalfan.jpg
|alt = Photo of a player in blue football kit, hair braided.
|caption = Tim Template with the Template Rangers
|birth_name = Tim Tenerife Template
|birth_date = {{birth date and age|1975|1|1|df=y}}
|birth_place = Template City, Templatia
|height = {{height|m=1.75}}
|module =
{{Infobox football biography
|embed = yes
|position = [[Forward (association football)|Striker]]
|currentclub = Template City F.C.
|clubnumber = 9
|youthyears1 = 1985–1987
|youthclubs1 = Template Juniors
|youthyears2 = 1987–1992
|youthclubs2 = Template Youth
|years1 = 1992–1999
|clubs1 = Template United F.C.
|caps1 = 75
|goals1 = 26
|years2 = 1999–2002
|clubs2 = Template Rangers
|caps2 = 32
|goals2 = 11
|years3 = 2001
|clubs3 = → Example F.C. (loan)
|caps3 = 15
|goals3 = 7
|years4 = 2002–
|clubs4 = Template City F.C.
|caps4 = 113
|goals4 = 46
|nationalyears1 = 1991
|nationalteam1 = Examplia U16
|nationalcaps1 = 1
|nationalgoals1 = 0
|nationalyears2 = 1996–1998
|nationalteam2 = Templatia U21
|nationalcaps2 = 8
|nationalgoals2 = 2
|nationalyears3 = 1999–
|nationalteam3 = Templatia
|nationalcaps3 = 46
|nationalgoals3 = 13
|medaltemplates =
{{medal|Team|Template City F.C.}}
{{medal|W|Template League| 2003}}
{{medal|RU|Template Cup| 2004}}
{{medal|Team|Templatia}}
{{medal|3rd|FIFA Template Cup| 2001}}
|club-update = ~~~~~
|nationalteam-update = ~~~~~
}}
}}
</pre> {{clear}}
{{Infobox rugby biography
| name = Alev Kelter
| birth_name = Leyla Alev Kelter
| birth_date = {{Birth-date and age|March 21, 1991}}
| birth_place = [[Tampa, Florida]], U.S.
| height = 5 ft 6 in
| ru_position = Centre
| repyears1 = 2016–present
| repteam1 = [[United States women's national rugby union team|United States]]
| repcaps1 = 9
| reppoints1 = 32
| ru_sevensnationalyears1 = 2014
| ru_sevensnationalteam1 = [[United States women's national rugby sevens team|United States]]
| ru_sevensnationalcomp1 = -
| module =
{{Infobox football biography | embed = yes
| position = [[Midfielder]]
| collegeyears1 = 2009–2013
| college1 = [[Wisconsin Badgers women's soccer|Wisconsin Badgers]]
| nationalyears1 = 2009
| nationalteam1 = [[United States women's national under-20 soccer team|United States U20]]
}}
}}
<pre style="overflow:auto;">
{{Infobox rugby biography
| name = Alev Kelter
| birth_name = Leyla Alev Kelter
| birth_date = {{Birth-date and age|March 21, 1991}}
| birth_place = [[Tampa, Florida]], U.S.
| height = 5 ft 6 in
| ru_position = Centre
| repyears1 = 2016–present
| repteam1 = [[United States women's national rugby union team|United States]]
| repcaps1 = 9
| reppoints1 = 32
| ru_sevensnationalyears1 = 2014
| ru_sevensnationalteam1 = [[United States women's national rugby sevens team|United States]]
| ru_sevensnationalcomp1 = -
| module =
{{Infobox football biography | embed = yes
| position = [[Midfielder]]
| collegeyears1 = 2009–2013
| college1 = [[Wisconsin Badgers women's soccer|Wisconsin Badgers]]
| nationalyears1 = 2009
| nationalteam1 = [[United States women's national under-20 soccer team|United States U20]]
}}
}}
</pre> {{clear}}
=== Embedding other infoboxes (module parameter) ===
{{Infobox football biography
| name = Alev Kelter
| birth_name = Leyla Alev Kelter
| birth_date = {{Birth-date and age|March 21, 1991}}
| birth_place = [[Tampa, Florida]], U.S.
| height = 5 ft 6 in
| position = [[Midfielder]]
| collegeyears1 = 2009–2013
| college1 = [[Wisconsin Badgers women's soccer|Wisconsin Badgers]]
| nationalyears1 = 2009
| nationalteam1 = [[United States women's national under-20 soccer team|United States U20]]
| module =
{{Infobox rugby biography | embed = yes
| ru_position = Centre
| repyears1 = 2016–present
| repteam1 = [[United States women's national rugby union team|United States]]
| repcaps1 = 9
| reppoints1 = 32
| ru_sevensnationalyears1 = 2014
| ru_sevensnationalteam1 = [[United States women's national rugby sevens team|United States]]
| ru_sevensnationalcomp1 = -
}}
}}
<pre style="overflow:auto;">
{{Infobox football biography
| name = Alev Kelter
| birth_name = Leyla Alev Kelter
| birth_date = {{Birth-date and age|March 21, 1991}}
| birth_place = [[Tampa, Florida]], U.S.
| height = 5 ft 6 in
| position = [[Midfielder]]
| collegeyears1 = 2009–2013
| college1 = [[Wisconsin Badgers women's soccer|Wisconsin Badgers]]
| nationalyears1 = 2009
| nationalteam1 = [[United States women's national under-20 soccer team|United States U20]]
| module =
{{Infobox rugby biography | embed = yes
| ru_position = Centre
| repyears1 = 2016–present
| repteam1 = [[United States women's national rugby union team|United States]]
| repcaps1 = 9
| reppoints1 = 32
| ru_sevensnationalyears1 = 2014
| ru_sevensnationalteam1 = [[United States women's national rugby sevens team|United States]]
| ru_sevensnationalcomp1 = -
}}
}}
</pre> {{clear}}
== Style guide ==
Try to always consider that an infobox exists to support an article and provide a quick synopsis of important facts. This becomes vital when considering that the amount of space available within an infobox is significantly less than that available outside of it.
As per the [[Wikipedia:Manual of Style (links)|manual of style]] entry on linking, years and dates should not be linked as they do not provide much benefit to the user.
Do not add flag icons to the birth_place, death_place, club, national team or other fields. See: [[Wikipedia:Manual of Style (flags)]].
As per the [[Wikipedia:Manual of Style (dates and numbers)|manual of style]] the player's height should be in the units most common in the country in which they play. Units should be abbreviated in the infobox and spelt out in the article text. Ideally, measurements should be presented using the {{tl|convert}} template, which automatically converts units between formats and handles the presentation of units. In this case, use the {{mono||abbr=on}} flag to ensure that units are presented in their short forms. {{tl|height}} is a similar template designed for infoboxes, which presents units in short form by default.
Using {{tl|convert}}:
*{{mono|<nowiki>{{convert|5|ft|10|in|abbr=on}}</nowiki>}} produces {{convert|5|ft|10|in|abbr=on}}
*{{mono|<nowiki>{{convert|1.78|m|abbr=on}}</nowiki>}} produces {{convert|1.78|m|abbr=on}}
and using {{tl|height}}:
*{{mono|<nowiki>{{height|ft=5|in=10}}</nowiki>}} produces {{height|ft=5|in=10}}
*{{mono|<nowiki>{{height|m=1.78}}</nowiki>}} produces {{height|m=1.78}}
== Microformats ==
{{UF-hcard-person}}
==TemplateData==
{{Collapse top|[[Wikipedia:TemplateData|TemplateData]] documentation used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools}}
{{TemplateData header|noheader=1}}
<templatedata>
{
"description": "This infobox template provides a quick overview of an association football player's or manager's details to enable a reader to extract the most oft-needed information without trawling through the article proper.",
"params": {
"name": {
"type": "string",
"label": "Name",
"description": "The commonly used name of the player. If this is omitted, it will be inferred from the title of the article."
},
"image": {
"type": "wiki-file-name",
"label": "Picture",
"description": "A picture of the player, ideally on the pitch in the strip of their most recent team (or the team the player is most well-known for, in the case of retirees). Use the format Example.jpg, rather than [[File:Example.jpg]]."
},
"image_size": {
"type": "number",
"label": "Picture size",
"description": "The picture's size, given as a number."
},
"alt": {
"type": "string",
"label": "Picture alt text",
"description": "Alt text for the picture."
},
"caption": {
"type": "string",
"label": "Picture caption",
"description": "A caption for the picture."
},
"fullname": {
"type": "string",
"label": "Full name",
"description": "The player's complete name."
},
"birth_date": {
"type": "number",
"label": "Birth date",
"description": "The player's date of birth. A template ({{Birth date}}, {{Birth date and age}}) should be used to add the date, but be sure to use the appropriate parameters to present the date in the same format as used in the text. The date should not be wikilinked."
},
"birth_place": {
"type": "string",
"label": "Birth place",
"description": "The location of the player's birth."
},
"death_date": {
"label": "Date of death",
"description": "Use exact date if known, but otherwise as close an approximation as possible. Example: April 27, 1992",
"type": "string",
"required": false
},
"death_place": {
"label": "Place of death",
"description": "Example: Washington, DC, USA",
"type": "string",
"required": false
},
"height": {
"type": "number",
"label": "Height",
"description": "The player's height in the units most common within the country in which they play. The {{height}} template should be used for automatic formatting. The infobox also supports automatic conversion if the height is specified as \"X m\", \"X cm\", or \"X ft Y in\"."
},
"position": {
"type": "string",
"label": "Position",
"description": "The player's most common position or positions. If a player is known for playing in multiple roles then explain the point more fully within the article."
},
"currentclub": {
"type": "string",
"label": "Current club",
"description": "The club for which the player currently plays, or is employed by. If the player now works in a non-playing role at the club, add this after the club in brackets. For retired players and free agents not currently employed by any club or federation, leave blank."
},
"clubnumber": {
"type": "number",
"label": "Number",
"description": "The shirt number of the player at their current club."
},
"youthyears1": {
"type": "number",
"label": "Youth club 1 years",
"description": "The years that the player was at their first youth club. Up to 8 clubs can be added using the parameter names \"youthyears2\", \"youthyears3\", etc."
},
"youthclubs1": {
"type": "string",
"label": "Youth club 1",
"description": "The first club that the player was a member of as a youth. Up to 8 clubs can be added using the parameter names \"youthclubs2\", \"youthclubs3\", etc."
},
"youthyears2": {
"type": "number",
"label": "Youth club 2 years",
"description": "The years that the player was at their second youth club."
},
"youthclubs2": {
"type": "string",
"label": "Youth club 2",
"description": "The second club that the player was a member of as a youth."
},
"youthyears3": {
"type": "number",
"label": "Youth club 3 years",
"description": "The years that the player was at their third youth club."
},
"youthclubs3": {
"type": "string",
"label": "Youth club 3",
"description": "The third club that the player was a member of as a youth."
},
"youthyears4": {
"type": "number",
"label": "Youth club 4 years",
"description": "The years that the player was at their fourth youth club."
},
"youthclubs4": {
"type": "string",
"label": "Youth club 4",
"description": "The fourth club that the player was a member of as a youth."
},
"youthyears5": {
"type": "number",
"label": "Youth club 5 years",
"description": "The years that the player was at their fifth youth club."
},
"youthclubs5": {
"type": "string",
"label": "Youth club 5",
"description": "The fifth club that the player was a member of as a youth."
},
"years1": {
"type": "number",
"label": "Club 1 years",
"description": "The years that the player was at their first club. Up to 39 years can be added using the parameter names \"years2\", \"years3\", etc."
},
"clubs1": {
"type": "string",
"label": "Club 1",
"description": "The first (senior) club that the player has been contracted at. Up to 39 clubs can be added using the parameter names \"clubs2\", \"clubs3\", etc."
},
"caps1": {
"type": "number",
"label": "Club 1 appearances",
"description": "The number of appearances that the player has been awarded in league competition for the first club. Playoff matches should not be included. Up to 39 caps can be added using the parameter names \"caps2\", \"caps3\", etc."
},
"goals1": {
"type": "number",
"label": "Club 1 goals",
"description": "The number of goals that the player has been awarded in league competition for the first club. Playoff matches should not be included. Up to 39 can be added using the parameter names \"goals2\", \"goals3\", etc."
},
"years2": {
"type": "number",
"label": "Club 2 years",
"description": "The years that the player was at their second club."
},
"clubs2": {
"type": "string",
"label": "Club 2",
"description": "The second club that the player has been contracted at."
},
"caps2": {
"type": "number",
"label": "Club 2 appearances",
"description": "The number of appearances that the player has been awarded in league competition for the second club."
},
"goals2": {
"type": "number",
"label": "Club 2 goals",
"description": "The number of goals that the player has been awarded in league competition for the second club."
},
"years3": {
"type": "number",
"label": "Club 3 years",
"description": "The years that the player was at their third club."
},
"clubs3": {
"type": "string",
"label": "Club 3",
"description": "The third club that the player has been contracted at."
},
"caps3": {
"type": "number",
"label": "Club 3 appearances",
"description": "The number of appearances that the player has been awarded in league competition for the third club."
},
"goals3": {
"type": "number",
"label": "Club 3 goals",
"description": "The number of goals that the player has been awarded in league competition for the third club."
},
"years4": {
"type": "number",
"label": "Club 4 years",
"description": "The years that the player was at their forth club."
},
"clubs4": {
"type": "string",
"label": "Club 4",
"description": "The forth club that the player has been contracted at."
},
"caps4": {
"type": "number",
"label": "Club 4 appearances",
"description": "The number of appearances that the player has been awarded in league competition for the forth club."
},
"goals4": {
"type": "number",
"label": "Club 4 goals",
"description": "The number of goals that the player has been awarded in league competition for the forth club."
},
"years5": {
"type": "number",
"label": "Club 5 years",
"description": "The years that the player was at their fifth club."
},
"clubs5": {
"type": "string",
"label": "Club 5",
"description": "The fifth club that the player has been contracted at."
},
"caps5": {
"type": "number",
"label": "Club 5 appearances",
"description": "The number of appearances that the player has been awarded in league competition for the fifth club."
},
"goals5": {
"type": "number",
"label": "Club 5 goals",
"description": "The number of goals that the player has been awarded in league competition for the fifth club."
},
"years6": {
"type": "number",
"label": "Club 6 years",
"description": "The years that the player was at their sixth club."
},
"clubs6": {
"type": "string",
"label": "Club 6",
"description": "The sixth club that the player has been contracted at."
},
"caps6": {
"type": "number",
"label": "Club 6 appearances",
"description": "The number of appearances that the player has been awarded in league competition for the sixth club."
},
"goals6": {
"type": "number",
"label": "Club 6 goals",
"description": "The number of goals that the player has been awarded in league competition for the sixth club."
},
"years7": {
"type": "number",
"label": "Club 7 years",
"description": "The years that the player was at their seventh club."
},
"clubs7": {
"type": "string",
"label": "Club 7",
"description": "The seventh club that the player has been contracted at."
},
"caps7": {
"type": "number",
"label": "Club 7 appearances",
"description": "The number of appearances that the player has been awarded in league competition for the seventh club."
},
"goals7": {
"type": "number",
"label": "Club 7 goals",
"description": "The number of goals that the player has been awarded in league competition for the seventh club."
},
"years8": {
"type": "number",
"label": "Club 8 years",
"description": "The years that the player was at their eighth club."
},
"clubs8": {
"type": "string",
"label": "Club 8",
"description": "The eighth club that the player has been contracted at."
},
"caps8": {
"type": "number",
"label": "Club 8 appearances",
"description": "The number of appearances that the player has been awarded in league competition for the eighth club."
},
"goals8": {
"type": "number",
"label": "Club 8 goals",
"description": "The number of goals that the player has been awarded in league competition for the eighth club."
},
"years9": {
"type": "number",
"label": "Club 9 years",
"description": "The years that the player was at their ninth club."
},
"clubs9": {
"type": "string",
"label": "Club 9",
"description": "The ninth club that the player has been contracted at."
},
"caps9": {
"type": "number",
"label": "Club 9 appearances",
"description": "The number of appearances that the player has been awarded in league competition for the ninth club."
},
"goals9": {
"type": "number",
"label": "Club 9 goals",
"description": "The number of goals that the player has been awarded in league competition for the ninth club."
},
"years10": {
"type": "number",
"label": "Club 10 years",
"description": "The years that the player was at their tenth club."
},
"clubs10": {
"type": "string",
"label": "Club 10",
"description": "The tenth club that the player has been contracted at."
},
"caps10": {
"type": "number",
"label": "Club 10 appearances",
"description": "The number of appearances that the player has been awarded in league competition for the tenth club."
},
"goals10": {
"type": "number",
"label": "Club 10 goals",
"description": "The number of goals that the player has been awarded in league competition for the tenth club."
},
"totalcaps": {
"type": "number",
"label": "Club appearances total",
"description": "The total number of appearances the player has been awarded in league competition for all non-youth clubs."
},
"totalgoals": {
"label": "Club goals total",
"description": "The total number of goals the player has scored in league competition for all non-youth clubs.",
"type": "number"
},
"nationalyears1": {
"type": "number",
"label": "National team 1 years",
"description": "The years that the player has played for the first national team. Up to 9 years can be added using the parameter names \"nationalyears2\", \"nationalyears3\", etc."
},
"nationalteam1": {
"type": "string",
"label": "National team 1",
"description": "The first national team that the player has played for (including non-senior teams such as U21). Up to 9 teams can be added using the parameter names \"nationalteam2\", \"nationalteam3\", etc."
},
"nationalcaps1": {
"type": "number",
"label": "National team 1 appearances",
"description": "The number of appearances that the player has been awarded in all competitions and friendlies for the first national team. Up to 9 numbers can be added using the parameter names \"nationalcaps2\", \"nationalcaps3\", etc."
},
"nationalgoals1": {
"type": "number",
"label": "National team 1 goals",
"description": "The number of goals that the player has been awarded in all competitions and friendlies for the first national team. Up to 9 numbers can be added using the parameter names \"nationalgoals2\", \"nationalgoals3\", etc."
},
"nationalyears2": {
"type": "number",
"label": "National team 2 years",
"description": "The years that the player has played for the second national team."
},
"nationalteam2": {
"type": "string",
"label": "National team 2",
"description": "The second national team that the player has played for."
},
"nationalcaps2": {
"type": "number",
"label": "National team 2 appearances",
"description": "The number of appearances that the player has been awarded in all competitions and friendlies for the second national team."
},
"nationalgoals2": {
"type": "number",
"label": "National team 2 goals",
"description": "The number of goals that the player has been awarded in all competitions and friendlies for the second national team."
},
"nationalyears3": {
"type": "number",
"label": "National team 3 years",
"description": "The years that the player has played for the third national team."
},
"nationalteam3": {
"type": "string",
"label": "National team 3",
"description": "The third national team that the player has played for."
},
"nationalcaps3": {
"type": "number",
"label": "National team 3 appearances",
"description": "The number of appearances that the player has been awarded in all competitions and friendlies for the third national team."
},
"nationalgoals3": {
"type": "number",
"label": "National team 3 goals",
"description": "The number of goals that the player has been awarded in all competitions and friendlies for the third national team."
},
"nationalyears4": {
"type": "number",
"label": "National team 4 years",
"description": "The years that the player has played for the fourth national team."
},
"nationalteam4": {
"type": "string",
"label": "National team 4",
"description": "The fourth national team that the player has played for."
},
"nationalcaps4": {
"type": "number",
"label": "National team 4 appearances",
"description": "The number of appearances that the player has been awarded in all competitions and friendlies for the fourth national team."
},
"nationalgoals4": {
"type": "number",
"label": "National team 4 goals",
"description": "The number of goals that the player has been awarded in all competitions and friendlies for the fourth national team."
},
"nationalyears5": {
"type": "number",
"label": "National team 5 years",
"description": "The years that the player has played for the fifth national team."
},
"nationalteam5": {
"type": "string",
"label": "National team 5",
"description": "The fifth national team that the player has played for."
},
"nationalcaps5": {
"type": "number",
"label": "National team 5 appearances",
"description": "The number of appearances that the player has been awarded in all competitions and friendlies for the fifth national team."
},
"nationalgoals5": {
"type": "number",
"label": "National team 5 goals",
"description": "The number of goals that the player has been awarded in all competitions and friendlies for the fifth national team."
},
"manageryears1": {
"type": "number",
"label": "Manager club 1 years",
"description": "The years that the person has served with the first club in the capacity of team manager."
},
"managerclubs1": {
"type": "string",
"label": "Manager club 1",
"description": "The first club that the person has served within the capacity of team manager. Please do not list positions other than team manager (such as assistant or coach positions, or director of football roles where this role is not considered managerial) unless that position is a significant part of the person's career; this will apply primarily to those with significant or perhaps primary experience in management. Clubs listed can be both local and national and should be restricted to those ordinarily considered notable in themselves."
},
"manageryears2": {
"type": "number",
"label": "Manager club 2 years",
"description": "The years that the person has served with the second club in the capacity of team manager. Up to 30 can be added using the parameter names \"manageryears3\", \"manageryears4\", etc."
},
"managerclubs2": {
"type": "string",
"label": "Manager club 2",
"description": "The second club that the person has served within the capacity of team manager. Up to 30 can be added using the parameter names \"managerclubs3\", \"managerclubs4\", etc."
},
"manageryears3": {
"type": "number",
"label": "Manager club 3 years",
"description": "The years that the person has served with the third club in the capacity of team manager."
},
"managerclubs3": {
"type": "string",
"label": "Manager club 3",
"description": "The third club that the person has served within the capacity of team manager."
},
"manageryears4": {
"type": "number",
"label": "Manager club 4 years",
"description": "The years that the person has served with the fourth club in the capacity of team manager."
},
"managerclubs4": {
"type": "string",
"label": "Manager club 4",
"description": "The fourth club that the person has served within the capacity of team manager."
},
"manageryears5": {
"type": "number",
"label": "Manager club 5 years",
"description": "The years that the person has served with the fifth club in the capacity of team manager."
},
"managerclubs5": {
"type": "string",
"label": "Manager club 5",
"description": "The fifth club that the person has served within the capacity of team manager."
},
"manageryears6": {
"type": "number",
"label": "Manager club 6 years",
"description": "The years that the person has served with the sixth club in the capacity of team manager."
},
"managerclubs6": {
"type": "string",
"label": "Manager club 6",
"description": "The sixth club that the person has served within the capacity of team manager."
},
"manageryears7": {
"type": "number",
"label": "Manager club 7 years",
"description": "The years that the person has served with the seventh club in the capacity of team manager."
},
"managerclubs7": {
"type": "string",
"label": "Manager club 7",
"description": "The seventh club that the person has served within the capacity of team manager."
},
"manageryears8": {
"type": "number",
"label": "Manager club 8 years",
"description": "The years that the person has served with the eighth club in the capacity of team manager."
},
"managerclubs8": {
"type": "string",
"label": "Manager club 8",
"description": "The eighth club that the person has served within the capacity of team manager."
},
"manageryears9": {
"type": "number",
"label": "Manager club 9 years",
"description": "The years that the person has served with the ninth club in the capacity of team manager."
},
"managerclubs9": {
"type": "string",
"label": "Manager club 9",
"description": "The ninth club that the person has served within the capacity of team manager."
},
"manageryears10": {
"type": "number",
"label": "Manager club 10 years",
"description": "The years that the person has served with the tenth club in the capacity of team manager."
},
"managerclubs10": {
"type": "string",
"label": "Manager club 10",
"description": "The tenth club that the person has served within the capacity of team manager."
},
"medaltemplates": {
"type": "string",
"label": "Medal templates",
"description": "Honors can be added here using {{Medal}} templates."
},
"club-update": {
"type": "string",
"label": "Club update timestamp",
"description": "A timestamp at which the player's infobox club statistics are unambiguously correct. The bare date of the last match played should not be used because this is not unambiguous. Dates should use the same format as the rest of the article; use five tildes (<nowiki>~~~~~</nowiki>) to generate the current date/time in dmy format, or {{subst:mdytime}} for mdy format. The parameter is not needed if the player has retired."
},
"nationalteam-update": {
"label": "National team update timestamp",
"description": "A timestamp at which the player's infobox national team statistics are unambiguously correct. The bare date of the last match played should not be used because this is not unambiguous. Dates should use the same format as the rest of the article; use five tildes (<nowiki>~~~~~</nowiki>) to generate the current date/time in dmy format, or {{subst:mdytime}} for mdy format. The parameter is not needed if the player has retired.",
"type": "string"
}
},
"format": "block"
}
</templatedata>
{{Collapse bottom}}
== Tracking categories ==
* {{clc|Pages using infobox football biography with unknown parameters}}
* {{clc|Pages using infobox football biography with a module}}
* {{clc|Pages using infobox football biography with position matching retired}}
* {{clc|Pages using deprecated image syntax}} – Used by [[Module:InfoboxImage]] to track articles where an infobox uses image syntax in the format <kbd><nowiki>|image=[[File:Example.jpg]]</nowiki></kbd>. To exclude articles from this category, change it to {{samp|<nowiki>|image=Example.jpg</nowiki>}}.
* {{clc|No local image but image on Wikidata}} – Used by [[Template:Wikidata image]] to track articles where an infobox has no image but [[Wikidata]] has an image name. To exclude articles from this category, add an image or {{para|nocat_wdimage|yes}} to the infobox.
== Supporting templates ==
The following templates are used directly from this template:
{{Columns-list|colwidth=20em|
* {{tl|Infobox3cols}}
* {{tl|Abbr}}
* {{tl|Br separated entries}}
* {{tl|Convinfobox}}
* {{tl|Infobox medal templates}}
* {{tl|Infobox person/height}}
* {{tl|Longitem}}
* {{tl|Main other}}
* {{tl|PAGENAMEBASE}}
* {{tl|Wikidata image}}
* {{tl|Yesno}}
}}
<includeonly>{{Basepage subpage|
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:Association football infobox templates|Football biography]]
[[Category:Sportsperson infobox templates|Football biography]]
[[Category:Biographical templates usable as a module|Football biography]]
[[Category:Infobox templates with module parameter|Football biography]]
[[Category:Infobox templates with updated parameter]]
[[Category:Templates that add a tracking category]]
}}</includeonly>
24onordauorguma3gllf9t0t1mshm8h
Templat:Infobox person
10
846
2444292
1973964
2022-08-13T13:34:14Z
David Wadie Fisher-Freberg
51
update
wikitext
text/x-wiki
{{Infobox|child={{{child|{{{embed|}}}}}}
| bodyclass = biography vcard
| above = {{Br separated entries
| 1 = {{#if:{{{honorific prefix|{{{honorific_prefix|{{{honorific-prefix|{{{pre-nominals|}}}}}}}}}}}}|<div class="honorific-prefix" style="font-size: 77%; font-weight: normal; display:inline;">{{{honorific prefix|{{{honorific_prefix|{{{honorific-prefix|{{{pre-nominals|}}}}}}}}}}}}</div>}}
| 2 = <div class="fn" style="display:inline">{{#if:{{{name|}}}|{{{name}}}|{{PAGENAMEBASE}}}}</div>
| 3 = {{#if:{{{honorific suffix|{{{honorific_suffix|{{{honorific-suffix|{{{post-nominals|}}}}}}}}}}}}|<div class="honorific-suffix" style="font-size: 77%; font-weight: normal; display:inline;">{{{honorific suffix|{{{honorific_suffix|{{{honorific-suffix|{{{post-nominals|}}}}}}}}}}}}</div>}}
}}
| abovestyle = font-size:125%; {{{abovestyle|}}}
| subheaderstyle = font-size:125%; font-weight:bold;
| subheader = {{#switch:{{{child|{{{embed|}}}}}}|yes=<!--empty when this infobox is embedded-->|#default={{#if:{{{native_name|}}}|{{#if:{{{native_name_lang|}}}|<div class="nickname" lang="{{{native_name_lang}}}">}}{{{native_name}}}{{#if:{{{native_name_lang|}}}|</div>}} }} }}
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{#ifeq:{{lc:{{{landscape|}}}}}|yes|{{min|300|{{#if:{{#ifexpr:{{{image size|{{{image_size|{{{imagesize|}}}}}}}}}}}|300|{{{image size|{{{image_size|{{{imagesize|}}}}}}}}}}}}}x200px|{{{image size|{{{image_size|{{{imagesize|}}}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
| caption = {{{image caption|{{{caption|{{{image_caption|}}}}}}}}}
| label2 = Pronunciation
| data2 = {{{pronunciation|}}}
| label10 = Born
| data10 = {{Br separated entries|1={{#if:{{{birth_name|{{{birthname|}}}}}}|<div style="display:inline" class="nickname">{{{birth_name|{{{birthname|}}}}}}</div>}}|2={{{birth_date|}}}|3={{#if:{{{birth_place|}}}|<div style="display:inline" class="birthplace">{{{birth_place|}}}</div>}}}}
| label11 = Bapti{{#if:{{{baptized|}}}|z|s}}ed
| data11 = {{#if:{{{birth_date|}}}||{{{baptized|{{{baptised|}}}}}}}}
| label12 = Disappeared
| data12 = {{Br separated entries|1={{{disappeared_date|}}}|2={{{disappeared_place|}}}}}
| label13 = Status
| data13 = {{{status|{{{disappeared_status|}}}}}}
| label14 = Died
| data14 = {{Br separated entries|1={{{death_date|}}}|2={{#if:{{{death_place|}}}|<div style="display:inline" class="deathplace">{{{death_place|}}}</div>}}}}
| label15 = Cause of death
| data15 = {{{death cause|{{{death_cause|}}}}}}
| label16 = Body discovered
| data16 = {{{body discovered|{{{body_discovered|}}}}}}
| label17 = {{#if:{{{burial_place|}}}|Burial place|Resting place}}
| data17 = {{#if:{{{burial_place|}}}|{{Br separated entries|1={{{burial_place|}}}|2={{{burial_coordinates|}}}}}|{{Br separated entries|1={{{resting place|{{{resting_place|{{{restingplace|}}}}}}}}}|2={{{resting place coordinates|{{{resting_place_coordinates|{{{restingplacecoordinates|}}}}}}}}}}}}}
| class17 = label
| label18 = Monuments
| data18 = {{{monuments|}}}
<!-- removed per discussion at https://en.wikipedia.org/w/index.php?title=Template_talk:Infobox_person&oldid=932429196#Residence_parameter
| label19 = Residence
| data19 = {{{residence|}}}
| class19 = {{#if:{{{death_date|}}}{{{death_place|}}}||label}}
-->
| label20 = Nationality
| data20 = {{{nationality|}}}
| class20 = category
| label21 = Other names
| data21 = {{{other names|{{{other_names|{{{othername|{{{nickname|{{{alias|}}}}}}}}}}}}}}}
| class21 = nickname
| label22 = Siglum
| data22 = {{{siglum|}}}
| label23 = Citizenship
| data23 = {{{citizenship|}}}
| class23 = category
| label24 = Education
| data24 = {{{education|}}}
| label25 = Alma mater
| data25 = {{{alma mater|{{{alma_mater|}}}}}}
| label26 = Occupation
| data26 = {{{occupation|}}}
| class26 = role
| label27 = Years active
| data27 = {{{years active|{{{years_active|{{{yearsactive|}}}}}}}}}
| label28 = Era
| data28 = {{{era|}}}
| class28 = category
| label29 = Employer
| data29 = {{{employer|}}}{{main other|{{Pluralize from text| {{{employer|}}} |||[[Category:Pages using infobox person with multiple employers]]}}}}
| class29 = org
| label30 = {{#if:{{{organisation|}}}|Organisation|Organization}}
| data30 = {{{organisation|{{{organization|{{{organizations|}}}}}}}}}{{main other|{{Pluralize from text|{{{organization|{{{organisation|}}}}}}|||[[Category:Pages using infobox person with multiple organizations]]}}}}
| class30 = org
| label31 = Agent
| data31 = {{{agent|}}}{{main other|{{Pluralize from text|{{{agent|}}}|||[[Category:Pages using infobox person with multiple agents]]}}}}
| class31 = agent
| label32 = Known for
| data32 = {{{known for|{{{known_for|{{{known|}}}}}}}}}
| label33 = <div style="white-space:nowrap;">{{#if:{{{works|}}}|Works|{{#if:{{{credits|}}}|Notable credit(s)|{{#if:{{{label_name|}}}|Label(s)|Notable work}}}}}}</div>
| data33 = {{#if:{{{works|}}}|{{{works|}}}|{{#if:{{{credits|}}}|{{{credits}}}|{{#if:{{{label_name|}}}|{{{label_name}}}|{{{notable works|{{{notable_works|}}}}}}}}}}}}{{main other|{{Pluralize from text|{{{label_name|}}}|||[[Category:Pages using infobox person with multiple labels]]}}}}
| label34 = Style
| data34 = {{{style|}}}
| class34 = category
| label40 = Height
| data40 = {{#if:{{{height_m|{{{height_cm|}}}}}}{{{height_ft|}}}{{{height_in|}}} | {{convinfobox|{{{height_m|{{{height_cm|}}}}}}|{{#if:{{{height_m|}}}|m|cm}}|{{{height_ft|}}}|ft|{{{height_in|}}}|in}}}}{{#if:{{{height|}}} | {{infobox person/height|{{{height|}}}}}}}
| label41 = Television
| data41 = {{{television|}}}
| label42 = {{#if:{{{office|}}}|Office|Title}}
| data42 = {{{office|{{{title|}}}}}}
| class42 = title
| label43 = Term
| data43 = {{{term|}}}
| label44 = Predecessor
| data44 = {{{predecessor|}}}
| label45 = Successor
| data45 = {{{successor|}}}
| label46 = Political party
| data46 = {{{party|}}}
| class46 = org
| label47 = Other political<br />affiliations
| data47 = {{{otherparty|}}}
| class47 = org
| label48 = Movement
| data48 = {{{movement|}}}
| class48 = category
| label49 = <span class="nowrap">Opponent(s)</span>
| data49 = {{{opponents|}}}{{main other|{{Pluralize from text|{{{opponents|}}}|||[[Category:Pages using infobox person with multiple opponents]]}}}}
| label50 = Board member of
| data50 = {{{boards|}}}
| label51 = Criminal charge(s)
| data51 = {{{criminal_charges|{{{criminal charge|{{{criminal_charge|}}}}}}}}}{{main other|{{Pluralize from text|{{{criminal charge|{{{criminal_charge|}}}}}}|||[[Category:Pages using infobox person with multiple criminal charges]]}}}}
| label52 = Criminal penalty
| data52 = {{{criminal penalty|{{{criminal_penalty|}}}}}}
| label53 = {{#if:{{{judicial status|{{{judicial_status|}}}}}}|Judicial status|Criminal status}}
| data53 = {{#if:{{{judicial status|{{{judicial_status|}}}}}} | {{{judicial status|{{{judicial_status}}}}}} | {{{criminal status|{{{criminal_status|}}}}}}}}
| class53 = category
| label54 = <span class="nowrap">Spouse(s)</span>
| data54 = {{{spouse|{{{spouses|{{{spouse(s)|}}}}}}}}}{{main other|{{Pluralize from text| {{{spouse|{{{spouse(s)|}}}}}} |||[[Category:Pages using infobox person with multiple spouses]]}}}}
| label55 = <span class="nowrap">Partner(s)</span>
| data55 = {{{partner|{{{domesticpartner|{{{domestic_partner|{{{partners|{{{partner(s)|}}}}}}}}}}}}}}}{{main other|{{Pluralize from text| {{{partner|{{{domesticpartner|{{{domestic_partner|{{{partner(s)|}}}}}}}}}}}} |||[[Category:Pages using infobox person with multiple partners]]}}}}
| label56 = Children
| data56 = {{{children|}}}
| label57 = Parent{{#if:{{{parents|}}}|(s)|{{#if:{{{father|}}}|{{#if:{{{mother|}}}|s|(s)}}|(s)}}}}
| data57 = {{#if:{{{parents|}}}|{{{parents}}}|{{Unbulleted list|{{#if:{{{father|}}}|{{{father}}} (father)}}|{{#if:{{{mother|}}}|{{{mother}}} (mother)}}}}}}{{main other|{{Pluralize from text|{{{parents|}}}|||[[Category:Pages using infobox person with multiple parents]]}}}}
| label58 = Relatives
| data58 = {{{relations|{{{relatives|}}}}}}
| label59 = Family
| data59 = {{{family|}}}
| label60 = Call sign
| data60 = {{{callsign|}}}
| label61 = Awards
| data61 = {{{awards|}}}
| label62 = {{#if:{{{honours|}}}|Honours|Honors}}
| data62 = {{{honours|{{{honors|}}}}}}
| data64 = {{{misc|{{{module|}}}}}}
| data65 = {{{misc2|{{{module2|}}}}}}
| data66 = {{{misc3|{{{module3|}}}}}}
| data67 = {{{misc4|{{{module4|}}}}}}
| data68 = {{{misc5|{{{module5|}}}}}}
| data69 = {{{misc6|{{{module6|}}}}}}
| label70 = Website
| data70 = {{{website|{{{homepage|{{{URL|{{{url|}}}}}}}}}}}}
| header71 = {{#if:{{{signature|}}}|Signature}}
| data72 = {{#invoke:InfoboxImage|InfoboxImage|image={{{signature|}}}|size={{{signature_size|}}}|sizedefault=150px|alt={{{signature alt|{{{signature_alt|}}}}}}}}
| header73 = {{#if:{{{footnotes|}}}|Notes}}
| data74 = {{#if:{{{footnotes|}}}|<div style="text-align: left;">{{{footnotes}}}</div>}}
}}<!--
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox person with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview = Page using [[Template:Infobox person]] with unknown parameter "_VALUE_"|ignoreblank=y
| abovestyle | agent | alias | alma mater | alma_mater | alt | awards | baptised | baptized | birth_date | birth_name | birth_place | birthname | boards | body discovered | body_discovered | burial_coordinates | burial_place | callsign | caption | child | children | citizenship | credits | criminal charge | criminal penalty | criminal status | criminal_charge | criminal_charges | criminal_penalty | criminal_status | death cause | death_cause | death_date | death_place | disappeared_date | disappeared_place | disappeared_status | domestic_partner | domesticpartner | education | embed | employer | era | family | father | footnotes | height | height_cm | height_ft | height_in | height_m | homepage | honorific prefix | honorific suffix | honorific_prefix | honorific_suffix | honorific-prefix | honorific-suffix | honors | honours | image | image caption | image size | image_caption | image_size | image_upright | imagesize | judicial status | judicial_status | known | known for | known_for | label_name | landscape | misc | misc2 | misc3 | misc4 | misc5 | misc6 | module | module2 | module3 | module4 | module5 | module6 | monuments | mother | movement | name | nationality | native_name | native_name_lang | net worth | net_worth | networth | nickname | nocat_wdimage | notable works | notable_works | occupation | office | opponents | organisation | organization | organizations | other names | other_names | othername | otherparty | parents | partner | partners | partner(s) | party | predecessor | pre-nominals | post-nominals | pronunciation | relations | relatives | resting place | resting place coordinates | resting_place | resting_place_coordinates | restingplace | restingplacecoordinates | siglum | signature | signature alt | signature_alt | signature_size | spouse | spouses | spouse(s) | status | style | successor | television | term | title | URL | url | website | works | years active | years_active | yearsactive }}<!--
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox person with unknown empty parameters|_VALUE_{{PAGENAME}}]]}}|preview = Page using [[Template:Infobox person]] with unknown empty parameter "_VALUE_"
| abovestyle | agent | alias | alma mater | alma_mater | alt | awards | baptised | baptized | birth_date | birth_name | birth_place | birthname | boards | body discovered | body_discovered | burial_coordinates | burial_place | callsign | caption | child | children | citizenship | credits | criminal charge | criminal penalty | criminal status | criminal_charge | criminal_charges | criminal_penalty | criminal_status | death cause | death_cause | death_date | death_place | disappeared_date | disappeared_place | disappeared_status | domestic_partner | domesticpartner | education | embed | employer | era | family | father | footnotes | height | height_cm | height_ft | height_in | height_m | homepage | honorific prefix | honorific suffix | honorific_prefix | honorific_suffix | honorific-prefix | honorific-suffix | honors | honours | image | image caption | image size | image_caption | image_size | image_upright | imagesize | judicial status | judicial_status | known | known for | known_for | label_name | landscape | misc | misc2 | misc3 | misc4 | misc5 | misc6 | module | module2 | module3 | module4 | module5 | module6 | monuments | mother | movement | name | nationality | native_name | native_name_lang | net worth | net_worth | networth | nickname | nocat_wdimage | notable works | notable_works | occupation | office | opponents | organisation | organization | organizations | other names | other_names | othername | otherparty | parents | partner | partners | partner(s) | party | predecessor | pre-nominals | post-nominals | pronunciation | relations | relatives | resting place | resting place coordinates | resting_place | resting_place_coordinates | restingplace | restingplacecoordinates | siglum | signature | signature alt | signature_alt | signature_size | spouse | spouses | spouse(s) | status | style | successor | television | term | title | URL | url | website | works | years active | years_active | yearsactive }}<!--
-->{{Main other|
{{#if:{{{1|}}}{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}|[[Category:Infobox person using numbered parameter]]}}<!--
-->{{#if:{{{death_date|}}}{{{death_place|}}}|{{#if:{{{net worth|{{{net_worth|{{{networth|}}}}}}}}}|[[Category:Infobox person using certain parameters when dead]]}}}}<!--
-->{{#if:{{{pronunciation|}}}|[[Category:Biography template using pronunciation]]}}<!--
-->{{#if:{{{signature|}}}|[[Category:Biography with signature]]}}<!--
-->[[Category:Articles with hCards]]
}}<!--
-->{{#invoke:Check for clobbered parameters|check
| nested = 1
| template = Infobox person
| cat = {{main other|Category:Pages using infobox person with conflicting parameters}}
| child; embed
| honorific prefix; honorific_prefix; honorific-prefix; pre-nominals
| honorific suffix; honorific_suffix; honorific-suffix; post-nominals
| image size; image_size; imagesize
| image caption; caption; image_caption
| birth_name; birthname
| baptized; baptised
| status; disappeared_status
| death cause; death_cause
| body discovered; body_discovered
| resting place; resting_place; restingplace
| resting place coordinates; resting_place_coordinates; restingplacecoordinates
| other names; other_names; othername; nickname; alias
| alma mater; alma_mater
| years active; years_active; yearsactive
| organisation; organization; organizations
| known for= known_for; known
| {{#if:{{{works|}}}|works;}} {{#if:{{{credits|}}}|credits;}} {{#if:{{{label_name|}}}|label_name;}} notable works; notable_works
| net worth; net_worth; networth
| height_m; height_cm
| office; title
| criminal_charges; criminal charge; criminal_charge
| criminal penalty; criminal_penalty
| judicial status; judicial_status
| criminal status; criminal_status
| spouse; spouses; spouse(s)
| partner; domesticpartner; domestic_partner; partners; partner(s)
| {{#if:{{{parents|}}}||NULL_}}parents; {{#if:{{{father|}}}||NULL_}}father
| {{#if:{{{parents|}}}||NULL_}}parents; {{#if:{{{mother|}}}||NULL_}}mother
| relations; relatives
| honours; honors
| misc; module
| misc2; module2
| misc3; module3
| misc4; module4
| misc5; module5
| misc6; module6
| website; homepage; URL; url
}}{{main other|{{#if:{{{net worth|{{{net_worth|{{{networth|}}}}}}}}}|[[Category:Pages using infobox person with deprecated net worth parameter]]}}}}<includeonly>{{#ifeq:{{{child|{{{embed|}}}}}}|yes||{{Wikidata image|1={{{image|}}}|2={{{nocat_wdimage|}}}}}}}</includeonly><noinclude>
{{documentation}}</noinclude>
2xy7ph0hn752snjnj26lipt7xfy8krz
Templat:Infobox settlement
10
849
2444341
2059319
2022-08-14T11:31:41Z
Fexpr
7716
wikitext
text/x-wiki
<includeonly>{{main other|{{#invoke:Settlement short description|main}}|}}{{Infobox
| child = {{yesno|{{{embed|}}}}}
| templatestyles = Infobox settlement/styles.css
| bodyclass = ib-settlement vcard
<!--** names, type, and transliterations ** -->
| above = <div class="fn org">{{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}</div>
{{#if:{{{native_name|}}}|<div class="nickname ib-settlement-native" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</div>}}{{#if:{{{other_name|}}}|<div class="nickname ib-settlement-other-name">{{{other_name}}}</div>}}
| subheader = {{#if:{{{settlement_type|{{{type|}}}}}}|<div class="category">{{{settlement_type|{{{type}}}}}}</div>}}
| rowclass1 = mergedtoprow ib-settlement-official
| data1 = {{#if:{{{name|}}}|{{{official_name|}}}}}
<!-- ***Transliteration language 1*** -->
| rowclass2 = mergedtoprow
| header2 = {{#if:{{{translit_lang1|}}}|{{{translit_lang1}}} transcription(s)}}
| rowclass3 = {{#if:{{{translit_lang1_type1|}}}|mergedrow|mergedbottomrow}}
| label3 = • {{{translit_lang1_type}}}
| data3 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type|}}}|{{{translit_lang1_info|}}}}}}}
| rowclass4 = {{#if:{{{translit_lang1_type2|}}}|mergedrow|mergedbottomrow}}
| label4 = • {{{translit_lang1_type1}}}
| data4 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type1|}}}|{{{translit_lang1_info1|}}}}}}}
| rowclass5 = {{#if:{{{translit_lang1_type3|}}}|mergedrow|mergedbottomrow}}
| label5 = • {{{translit_lang1_type2}}}
| data5 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type2|}}}|{{{translit_lang1_info2|}}}}}}}
| rowclass6 = {{#if:{{{translit_lang1_type4|}}}|mergedrow|mergedbottomrow}}
| label6 = • {{{translit_lang1_type3}}}
| data6 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type3|}}}|{{{translit_lang1_info3|}}}}}}}
| rowclass7 = {{#if:{{{translit_lang1_type5|}}}|mergedrow|mergedbottomrow}}
| label7 = • {{{translit_lang1_type4}}}
| data7 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type4|}}}|{{{translit_lang1_info4|}}}}}}}
| rowclass8 = {{#if:{{{translit_lang1_type6|}}}|mergedrow|mergedbottomrow}}
| label8 = • {{{translit_lang1_type5}}}
| data8 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type5|}}}|{{{translit_lang1_info5|}}}}}}}
| rowclass9 = mergedbottomrow
| label9 = • {{{translit_lang1_type6}}}
| data9 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type6|}}}|{{{translit_lang1_info6|}}}}}}}
<!-- ***Transliteration language 2*** -->
| rowclass10 = mergedtoprow
| header10 = {{#if:{{{translit_lang2|}}}|{{{translit_lang2}}} transcription(s)}}
| rowclass11 = {{#if:{{{translit_lang2_type1|}}}|mergedrow|mergedbottomrow}}
| label11 = • {{{translit_lang2_type}}}
| data11 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type|}}}|{{{translit_lang2_info|}}}}}}}
| rowclass12 = {{#if:{{{translit_lang2_type2|}}}|mergedrow|mergedbottomrow}}
| label12 = • {{{translit_lang2_type1}}}
| data12 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type1|}}}|{{{translit_lang2_info1|}}}}}}}
| rowclass13 = {{#if:{{{translit_lang2_type3|}}}|mergedrow|mergedbottomrow}}
| label13 = • {{{translit_lang2_type2}}}
| data13 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type2|}}}|{{{translit_lang2_info2|}}}}}}}
| rowclass14 = {{#if:{{{translit_lang2_type4|}}}|mergedrow|mergedbottomrow}}
| label14 = • {{{translit_lang2_type3}}}
| data14 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type3|}}}|{{{translit_lang2_info3|}}}}}}}
| rowclass15 = {{#if:{{{translit_lang2_type5|}}}|mergedrow|mergedbottomrow}}
| label15 = • {{{translit_lang2_type4}}}
| data15 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type4|}}}|{{{translit_lang2_info4|}}}}}}}
| rowclass16 = {{#if:{{{translit_lang2_type6|}}}|mergedrow|mergedbottomrow}}
| label16 = • {{{translit_lang2_type5}}}
| data16 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type5|}}}|{{{translit_lang2_info5|}}}}}}}
| rowclass17 = mergedbottomrow
| label17 = • {{{translit_lang2_type6}}}
| data17 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type6|}}}|{{{translit_lang2_info6|}}}}}}}
<!-- end ** names, type, and transliterations ** -->
<!-- ***Skyline Image*** -->
| rowclass18 = mergedtoprow
| data18 = {{#if:{{{image_skyline|}}}|<!--
-->{{#invoke:InfoboxImage|InfoboxImage<!--
-->|image={{{image_skyline|}}}<!--
-->|size={{if empty|{{{image_size|}}}|{{{imagesize|}}}}}|sizedefault=250px<!--
-->|alt={{if empty|{{{image_alt|}}}|{{{alt|}}}}}<!--
-->|title={{if empty|{{{image_caption|}}}|{{{caption|}}}|{{{image_alt|}}}|{{{alt|}}}}}}}<!--
-->{{#if:{{{image_caption|}}}{{{caption|}}}|<div class="ib-settlement-caption">{{if empty|{{{image_caption|}}}|{{{caption|}}}}}</div>}} }}
<!-- ***Flag, Seal, Shield and Coat of arms*** -->
| rowclass19 = mergedtoprow
| class19 = maptable
| data19 = {{#if:{{{image_flag|}}}{{{image_seal|}}}{{{image_shield|}}}{{{image_blank_emblem|}}}{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}
|{{Infobox settlement/columns
| 1 = {{#if:{{{image_flag|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_flag}}}|size={{{flag_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|125px|100x100px}}|border={{yesno |{{{flag_border|}}}|yes=yes|blank=yes}}|alt={{{flag_alt|}}}|title=Flag of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Flag|link={{{flag_link|}}}|name={{{official_name}}}}}</div>}}
| 2 = {{#if:{{{image_seal|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_seal|}}}|size={{{seal_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{seal_alt|}}}|title=Official seal of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{seal_type|}}}|{{{seal_type}}}|Seal}}|link={{{seal_link|}}}|name={{{official_name}}}}}</div>}}
| 3 = {{#if:{{{image_shield|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_shield|}}}||size={{{shield_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{shield_alt|}}}|title=Coat of arms of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type=Coat of arms|link={{{shield_link|}}}|name={{{official_name}}}}}</div>}}
| 4 = {{#if:{{{image_blank_emblem|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_blank_emblem|}}}|size={{{blank_emblem_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100x100px}}|alt={{{blank_emblem_alt|}}}|title=Official logo of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{#if:{{{blank_emblem_type|}}}|{{{blank_emblem_type}}}}}|link={{{blank_emblem_link|}}}|name={{{official_name}}}}}</div>}}
| 5 = {{#if:{{{image_map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=100x100px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption-link">{{{map_caption}}}</div>}}}}
| 0 = {{#if:{{{pushpin_map_narrow|}}}|{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{{map_caption}}}}}}}}}
|float = center
|width = {{#if:{{{pushpin_mapsize|}}}|{{{pushpin_mapsize}}}|150}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
}} }}
<!-- ***Etymology*** -->
| rowclass20 = mergedtoprow
| data20 = {{#if:{{{etymology|}}}|Etymology: {{{etymology}}} }}
<!-- ***Nickname*** -->
| rowclass21 = {{#if:{{{etymology|}}}|mergedrow|mergedtoprow}}
| data21 = {{#if:{{{nickname|}}}|{{#if:{{{nickname_link|}}}|[[{{{nickname_link|}}}|Nickname(s):]]|Nickname(s):}}|{{#if:{{{nicknames|}}}|{{#if:{{{nickname_link|}}}|[[{{{nickname_link|}}}|Nicknames:]]|Nicknames:}}}}}}{{#if:{{{nickname|}}}{{{nicknames|}}}| <div class="ib-settlement-nickname nickname">{{if empty|{{{nickname|}}}|{{{nicknames|}}}}}</div>}}{{Main other|{{Pluralize from text|parse_links=1|no_and=1|{{{nickname|}}}|||[[Category:Pages using infobox settlement with possible nickname list]]}}}}
<!-- ***Motto*** -->
| rowclass22 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}|mergedrow|mergedtoprow}}
| data22 = {{#if:{{{motto|}}}|{{#if:{{{motto_link|}}}|[[{{{motto_link|}}}|Motto(s):]]|Motto(s):}}|{{#if:{{{mottoes|}}}|{{#if:{{{motto_link|}}}|[[{{{motto_link|}}}|Mottoes:]]|Mottoes:}}}}}}{{#if:{{{motto|}}}{{{mottoes|}}}| <div class="ib-settlement-nickname nickname">{{if empty|{{{motto|}}}|{{{mottoes|}}}}}</div>}}{{Main other|{{Pluralize from text|{{{motto|}}}|||[[Category:Pages using infobox settlement with possible motto list]]|no_and=1|no_comma=1}}}}
<!-- ***Anthem*** -->
| rowclass23 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}{{{motto|}}}{{{mottoes|}}}|mergedrow|mergedtoprow}}
| data23 = {{#if:{{{anthem|}}}|{{#if:{{{anthem_link|}}}|[[{{{anthem_link|}}}|Anthem:]]|Anthem:}} {{{anthem}}}}}
<!-- ***Map*** -->
| rowclass24 = mergedtoprow
| data24 = {{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}||{{#if:{{{image_map|}}}
|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=250px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption">{{{map_caption}}}</div>}}
}}}}
| rowclass25 = mergedrow
| data25 = {{#if:{{{image_map1|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map1}}}|size={{{mapsize1|}}}|sizedefault=250px|alt={{{map_alt1|}}}|title={{{map_caption1|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption1|}}}|<div class="ib-settlement-caption">{{{map_caption1}}}</div>}} }}
<!-- ***Pushpin Map*** -->
| rowclass26 = mergedtoprow
| data26 = {{#if:{{{pushpin_map_narrow|}}}||{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{#if:{{{image_map|}}}||{{{map_caption}}}}}}}}}}}
|float = center
|width = {{{pushpin_mapsize|}}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
<!-- ***Coordinates*** -->
| rowclass27 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|{{#if:{{{grid_position|}}}|mergedrow|mergedbottomrow}}}}
| data27 = {{#if:{{{coordinates|}}}
|Coordinates{{#if:{{{coor_pinpoint|{{{coor_type|}}}}}}| ({{{coor_pinpoint|{{{coor_type|}}}}}})}}: {{#invoke:ISO 3166|geocoordinsert|nocat=true|1={{{coordinates|}}}|country={{{subdivision_name|}}}|subdivision1={{{subdivision_name1|}}}|subdivision2={{{subdivision_name2|}}}|subdivision3={{{subdivision_name3|}}}|type=city{{#if:{{{population_total|}}}|{{#iferror:{{#expr:{{formatnum:{{{population_total}}}|R}}+1}}||({{formatnum:{{replace|{{{population_total}}}|,|}}|R}})}}}} }}{{{coordinates_footnotes|}}} }}
| rowclass28 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|mergedbottomrow|mergedrow}}
| label28 = {{if empty|{{{grid_name|}}}|Grid position}}
| data28 = {{{grid_position|}}}
<!-- ***Subdivisions*** -->
| rowclass29 = mergedtoprow
| label29 = {{{subdivision_type}}}
| data29 = {{#if:{{{subdivision_type|}}}|{{{subdivision_name|}}} }}
| rowclass30 = mergedrow
| label30 = {{{subdivision_type1}}}
| data30 = {{#if:{{{subdivision_type1|}}}|{{{subdivision_name1|}}} }}
| rowclass31 = mergedrow
| label31 = {{{subdivision_type2}}}
| data31 = {{#if:{{{subdivision_type2|}}}|{{{subdivision_name2|}}} }}
| rowclass32 = mergedrow
| label32 = {{{subdivision_type3}}}
| data32 = {{#if:{{{subdivision_type3|}}}|{{{subdivision_name3|}}} }}
| rowclass33 = mergedrow
| label33 = {{{subdivision_type4}}}
| data33 = {{#if:{{{subdivision_type4|}}}|{{{subdivision_name4|}}} }}
| rowclass34 = mergedrow
| label34 = {{{subdivision_type5}}}
| data34 = {{#if:{{{subdivision_type5|}}}|{{{subdivision_name5|}}} }}
| rowclass35 = mergedrow
| label35 = {{{subdivision_type6}}}
| data35 = {{#if:{{{subdivision_type6|}}}|{{{subdivision_name6|}}} }}
<!--***Established*** -->
| rowclass36 = mergedtoprow
| label36 = {{{established_title}}}
| data36 = {{#if:{{{established_title|}}}|{{{established_date|}}} }}
| rowclass37 = mergedrow
| label37 = {{{established_title1}}}
| data37 = {{#if:{{{established_title1|}}}|{{{established_date1|}}} }}
| rowclass38 = mergedrow
| label38 = {{{established_title2}}}
| data38 = {{#if:{{{established_title2|}}}|{{{established_date2|}}} }}
| rowclass39 = mergedrow
| label39 = {{{established_title3}}}
| data39 = {{#if:{{{established_title3|}}}|{{{established_date3|}}} }}
| rowclass40 = mergedrow
| label40 = {{{established_title4}}}
| data40 = {{#if:{{{established_title4|}}}|{{{established_date4|}}} }}
| rowclass41 = mergedrow
| label41 = {{{established_title5}}}
| data41 = {{#if:{{{established_title5|}}}|{{{established_date5|}}} }}
| rowclass42 = mergedrow
| label42 = {{{established_title6}}}
| data42 = {{#if:{{{established_title6|}}}|{{{established_date6|}}} }}
| rowclass43 = mergedrow
| label43 = {{{established_title7}}}
| data43 = {{#if:{{{established_title7|}}}|{{{established_date7|}}} }}
| rowclass44 = mergedrow
| label44 = {{{extinct_title}}}
| data44 = {{#if:{{{extinct_title|}}}|{{{extinct_date|}}} }}
| rowclass45 = mergedrow
| label45 = Founded by
| data45 = {{{founder|}}}
| rowclass46 = mergedrow
| label46 = [[Namesake|Named for]]
| data46 = {{{named_for|}}}
<!-- ***Seat of government and subdivisions within the settlement*** -->
| rowclass47 = mergedtoprow
| label47 = {{#if:{{{seat_type|}}}|{{{seat_type}}}|Seat}}
| data47 = {{{seat|}}}
| rowclass48 = mergedrow
| label48 = {{#if:{{{seat1_type|}}}|{{{seat1_type}}}|Former seat}}
| data48 = {{{seat1|}}}
| rowclass49 = mergedrow
| label49 = {{#if:{{{seat2_type|}}}|{{{seat2_type}}}|Former seat}}
| data49 = {{{seat2|}}}
| rowclass51 = {{#if:{{{seat|}}}{{{seat1|}}}{{{seat2|}}}|mergedrow|mergedtoprow}}
| label51 = {{#if:{{{parts_type|}}}|{{{parts_type}}}|Boroughs}}
| data51 = {{#if:{{{parts|}}}{{{p1|}}}
|{{#ifeq:{{{parts_style|}}}|para
|<b>{{{parts|}}}{{#if:{{both|{{{parts|}}}|{{{p1|}}}}}|: |}}</b>{{comma separated entries|{{{p1|}}}|{{{p2|}}}|{{{p3|}}}|{{{p4|}}}|{{{p5|}}}|{{{p6|}}}|{{{p7|}}}|{{{p8|}}}|{{{p9|}}}|{{{p10|}}}|{{{p11|}}}|{{{p12|}}}|{{{p13|}}}|{{{p14|}}}|{{{p15|}}}|{{{p16|}}}|{{{p17|}}}|{{{p18|}}}|{{{p19|}}}|{{{p20|}}}|{{{p21|}}}|{{{p22|}}}|{{{p23|}}}|{{{p24|}}}|{{{p25|}}}|{{{p26|}}}|{{{p27|}}}|{{{p28|}}}|{{{p29|}}}|{{{p30|}}}|{{{p31|}}}|{{{p32|}}}|{{{p33|}}}|{{{p34|}}}|{{{p35|}}}|{{{p36|}}}|{{{p37|}}}|{{{p38|}}}|{{{p39|}}}|{{{p40|}}}|{{{p41|}}}|{{{p42|}}}|{{{p43|}}}|{{{p44|}}}|{{{p45|}}}|{{{p46|}}}|{{{p47|}}}|{{{p48|}}}|{{{p49|}}}|{{{p50|}}}}}
|{{#if:{{{p1|}}}|{{Collapsible list|title={{{parts|}}}|expand={{#switch:{{{parts_style|}}}|coll=|list=y|{{#if:{{{p6|}}}||y}}}}|1={{{p1|}}}|2={{{p2|}}}|3={{{p3|}}}|4={{{p4|}}}|5={{{p5|}}}|6={{{p6|}}}|7={{{p7|}}}|8={{{p8|}}}|9={{{p9|}}}|10={{{p10|}}}|11={{{p11|}}}|12={{{p12|}}}|13={{{p13|}}}|14={{{p14|}}}|15={{{p15|}}}|16={{{p16|}}}|17={{{p17|}}}|18={{{p18|}}}|19={{{p19|}}}|20={{{p20|}}}|21={{{p21|}}}|22={{{p22|}}}|23={{{p23|}}}|24={{{p24|}}}|25={{{p25|}}}|26={{{p26|}}}|27={{{p27|}}}|28={{{p28|}}}|29={{{p29|}}}|30={{{p30|}}}|31={{{p31|}}}|32={{{p32|}}}|33={{{p33|}}}|34={{{p34|}}}|35={{{p35|}}}|36={{{p36|}}}|37={{{p37|}}}|38={{{p38|}}}|39={{{p39|}}}|40={{{p40|}}}|41={{{p41|}}}|42={{{p42|}}}|43={{{p43|}}}|44={{{p44|}}}|45={{{p45|}}}|46={{{p46|}}}|47={{{p47|}}}|48={{{p48|}}}|49={{{p49|}}}|50={{{p50|}}}}}
|{{{parts}}}
}}
}} }}
<!-- ***Government type and Leader*** -->
| rowclass52 = mergedtoprow
| header52 = {{#if:{{{government_type|}}}{{{governing_body|}}}{{{leader_name|}}}{{{leader_name1|}}}{{{leader_name2|}}}{{{leader_name3|}}}{{{leader_name4|}}}|Government<div class="ib-settlement-fn">{{{government_footnotes|}}}</div>}}
<!-- ***Government*** -->
| rowclass53 = mergedrow
| label53 = • Type
| data53 = {{{government_type|}}}
| rowclass54 = mergedrow
| label54 = • Body
| class54 = agent
| data54 = {{{governing_body|}}}
| rowclass55 = mergedrow
| label55 = • {{{leader_title}}}
| data55 = {{#if:{{{leader_title|}}}|{{{leader_name|}}} {{#if:{{{leader_party|}}}|({{Polparty|{{{subdivision_name}}}|{{{leader_party}}}}})}}}}
| rowclass56 = mergedrow
| label56 = • {{{leader_title1}}}
| data56 = {{#if:{{{leader_title1|}}}|{{{leader_name1|}}}}}
| rowclass57 = mergedrow
| label57 = • {{{leader_title2}}}
| data57 = {{#if:{{{leader_title2|}}}|{{{leader_name2|}}}}}
| rowclass58 = mergedrow
| label58 = • {{{leader_title3}}}
| data58 = {{#if:{{{leader_title3|}}}|{{{leader_name3|}}}}}
| rowclass59 = mergedrow
| label59 = • {{{leader_title4}}}
| data59 = {{#if:{{{leader_title4|}}}|{{{leader_name4|}}}}}
| rowclass60 = mergedrow
| label60 = {{{government_blank1_title}}}
| data60 = {{#if:{{{government_blank1|}}}|{{{government_blank1|}}}}}
| rowclass61 = mergedrow
| label61 = {{{government_blank2_title}}}
| data61 = {{#if:{{{government_blank2|}}}|{{{government_blank2|}}}}}
| rowclass62 = mergedrow
| label62 = {{{government_blank3_title}}}
| data62 = {{#if:{{{government_blank3|}}}|{{{government_blank3|}}}}}
| rowclass63 = mergedrow
| label63 = {{{government_blank4_title}}}
| data63 = {{#if:{{{government_blank4|}}}|{{{government_blank4|}}}}}
| rowclass64 = mergedrow
| label64 = {{{government_blank5_title}}}
| data64 = {{#if:{{{government_blank5|}}}|{{{government_blank5|}}}}}
| rowclass65 = mergedrow
| label65 = {{{government_blank6_title}}}
| data65 = {{#if:{{{government_blank6|}}}|{{{government_blank6|}}}}}
<!-- ***Geographical characteristics*** -->
<!-- ***Area*** -->
| rowclass66 = mergedtoprow
| header66 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_rural_sq_mi|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_km2|}}}{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_metro_sq_mi|}}}{{{area_blank1_sq_mi|}}}
|{{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|<!-- displayed below -->
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
}}
}}
| rowclass67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}|mergedtoprow|mergedrow}}
| label67 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|Area<div class="ib-settlement-fn">{{{area_footnotes|}}}</div>
| • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
}}
| data67 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_total_km2|}}}
|ha ={{{area_total_ha|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|dunam={{{area_total_dunam|}}}
|link ={{#switch:{{{dunam_link|}}}||on|total=on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass68 = mergedrow
| label68 = • Land
| data68 = {{#if:{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_land_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_land_km2|}}}
|ha ={{{area_land_ha|}}}
|acre ={{{area_land_acre|}}}
|sqmi ={{{area_land_sq_mi|}}}
|dunam={{{area_land_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|land|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass69 = mergedrow
| label69 = • Water
| data69 = {{#if:{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_water_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_water_km2|}}}
|ha ={{{area_water_ha|}}}
|acre ={{{area_water_acre|}}}
|sqmi ={{{area_water_sq_mi|}}}
|dunam={{{area_water_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|water|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}} {{#if:{{{area_water_percent|}}}| {{{area_water_percent}}}%}}}}
| rowclass70 = mergedrow
| label70 = • Urban<div class="ib-settlement-fn">{{{area_urban_footnotes|}}}</div>
| data70 = {{#if:{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_urban_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_urban_km2|}}}
|ha ={{{area_urban_ha|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|urban|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass71 = mergedrow
| label71 = • Rural<div class="ib-settlement-fn">{{{area_rural_footnotes|}}}</div>
| data71 = {{#if:{{{area_rural_km2|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_sq_mi|}}}{{{area_rural_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_rural_km2|}}}
|ha ={{{area_rural_ha|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|rural|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass72 = mergedrow
| label72 = • Metro<div class="ib-settlement-fn">{{{area_metro_footnotes|}}}</div>
| data72 = {{#if:{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_metro_sq_mi|}}}{{{area_metro_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_metro_km2|}}}
|ha ={{{area_metro_ha|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|metro|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Area rank*** -->
| rowclass73 = mergedrow
| label73 = • Rank
| data73 = {{{area_rank|}}}
| rowclass74 = mergedrow
| label74 = • {{{area_blank1_title}}}
| data74 = {{#if:{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_blank1_sq_mi|}}}{{{area_blank1_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank1_km2|}}}
|ha ={{{area_blank1_ha|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank1|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass75 = mergedrow
| label75 = • {{{area_blank2_title}}}
| data75 = {{#if:{{{area_blank2_km2|}}}{{{area_blank2_ha|}}}{{{area_blank2_acre|}}}{{{area_blank2_sq_mi|}}}{{{area_blank2_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank2_km2|}}}
|ha ={{{area_blank2_ha|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank2|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass76 = mergedrow
| label76 =
| data76 = {{{area_note|}}}
<!-- ***Dimensions*** -->
| rowclass77 = mergedtoprow
| header77 = {{#if:{{{length_km|}}}{{{length_mi|}}}{{{width_km|}}}{{{width_mi|}}}|Dimensions<div class="ib-settlement-fn">{{{dimensions_footnotes|}}}</div>}}
| rowclass78 = mergedrow
| label78 = • Length
| data78 = {{#if:{{{length_km|}}}{{{length_mi|}}}
| {{infobox_settlement/lengthdisp
|km ={{{length_km|}}}
|mi ={{{length_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass79 = mergedrow
| label79 = • Width
| data79 = {{#if:{{{width_km|}}}{{{width_mi|}}}
|{{infobox_settlement/lengthdisp
|km ={{{width_km|}}}
|mi ={{{width_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation*** -->
| rowclass80 = mergedtoprow
| label80 = {{#if:{{{elevation_link|}}}|[[{{{elevation_link|}}}|Elevation]]|Elevation}}<div class="ib-settlement-fn">{{{elevation_footnotes|}}}{{#if:{{{elevation_point|}}}| ({{{elevation_point}}})}}</div>
| data80 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_m|}}}
|ft ={{{elevation_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass81 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}|mergedrow|mergedtoprow}}
| label81 = Highest elevation<div class="ib-settlement-fn">{{{elevation_max_footnotes|}}}{{#if:{{{elevation_max_point|}}}| ({{{elevation_max_point}}})}}</div>
| data81 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_max_m|}}}
|ft ={{{elevation_max_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation max rank*** -->
| rowclass82 = mergedrow
| label82 = • Rank
| data82 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}| {{{elevation_max_rank|}}} }}
| rowclass83 = {{#if:{{{elevation_min_rank|}}}|mergedrow|mergedbottomrow}}
| label83 = Lowest elevation<div class="ib-settlement-fn">{{{elevation_min_footnotes|}}}{{#if:{{{elevation_min_point|}}}| ({{{elevation_min_point}}})}}</div>
| data83 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_min_m|}}}
|ft ={{{elevation_min_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation min rank*** -->
| rowclass84 = mergedrow
| label84 = • Rank
| data84 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}|{{{elevation_min_rank|}}}}}
<!-- ***Population*** -->
| rowclass85 = mergedtoprow
| label85 = Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
| data85 = {{#if:{{{population|}}}
| {{formatnum:{{replace|{{{population}}}|,|}}}}
| {{#ifeq:{{{total_type}}}|
| {{#if:{{{population_total|}}}
| {{formatnum:{{replace|{{{population_total}}}|,|}}}}
}}
}}
}}
| rowclass86 = mergedtoprow
| header86 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}{{{population_urban|}}}{{{population_rural|}}}{{{population_metro|}}}{{{population_blank1|}}}{{{population_blank2|}}}{{{population_est|}}}
|Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
}}
}}
}}
| rowclass87 = mergedrow
| label87 = • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
| data87 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}
| {{formatnum:{{replace|{{{population_total}}}|,|}}}}
}}
}}
}}
| rowclass88 = mergedrow
| label88 = • Estimate <div class="ib-settlement-fn">({{{pop_est_as_of}}}){{{pop_est_footnotes|}}}</div>
| data88 = {{#if:{{{population_est|}}}|{{formatnum:{{replace|{{{population_est}}}|,|}}}} }}
<!-- ***Population rank*** -->
| rowclass89 = mergedrow
| label89 = • Rank
| data89 = {{{population_rank|}}}
| rowclass90 = mergedrow
| label90 = • Density
| data90 = {{#if:{{{population_density_km2|}}}{{{population_density_sq_mi|}}}{{{population_total|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_km2|}}}
|/sqmi={{{population_density_sq_mi|}}}
|pop ={{{population_total|}}}
|dunam={{{area_total_dunam|}}}
|ha ={{{area_total_ha|}}}
|km2 ={{{area_total_km2|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Population density rank*** -->
| rowclass91 = mergedrow
| label91 = • Rank
| data91 = {{{population_density_rank|}}}
| rowclass92 = mergedrow
| label92 = • [[Urban area|Urban]]<div class="ib-settlement-fn">{{{population_urban_footnotes|}}}</div>
| data92 = {{#if:{{{population_urban|}}}| {{formatnum:{{replace|{{{population_urban}}}|,|}}}} }}
| rowclass93 = mergedrow
| label93 = • Urban density
| data93 = {{#if:{{{population_density_urban_km2|}}}{{{population_density_urban_sq_mi|}}}{{{population_urban|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_urban_km2|}}}
|/sqmi={{{population_density_urban_sq_mi|}}}
|pop ={{{population_urban|}}}
|ha ={{{area_urban_ha|}}}
|km2 ={{{area_urban_km2|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass94 = mergedrow
| label94 = • [[Rural area|Rural]]<div class="ib-settlement-fn">{{{population_rural_footnotes|}}}</div>
| data94 = {{#if:{{{population_rural|}}}|{{formatnum:{{replace|{{{population_rural}}}|,|}}}}}}
| rowclass95 = mergedrow
| label95 = • Rural density
| data95 = {{#if:{{{population_density_rural_km2|}}}{{{population_density_rural_sq_mi|}}}{{{population_rural|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_rural_km2|}}}
|/sqmi={{{population_density_rural_sq_mi|}}}
|pop ={{{population_rural|}}}
|ha ={{{area_rural_ha|}}}
|km2 ={{{area_rural_km2|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass96 = mergedrow
| label96 = • [[Metropolitan area|Metro]]<div class="ib-settlement-fn">{{{population_metro_footnotes|}}}</div>
| data96 = {{#if:{{{population_metro|}}}| {{formatnum:{{replace|{{{population_metro}}}|,|}}}} }}
| rowclass97 = mergedrow
| label97 = • Metro density
| data97 = {{#if:{{{population_density_metro_km2|}}}{{{population_density_metro_sq_mi|}}}{{{population_metro|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_metro_km2|}}}
|/sqmi={{{population_density_metro_sq_mi|}}}
|pop ={{{population_metro|}}}
|ha ={{{area_metro_ha|}}}
|km2 ={{{area_metro_km2|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass98 = mergedrow
| label98 = • {{{population_blank1_title|}}}<div class="ib-settlement-fn">{{{population_blank1_footnotes|}}}</div>
| data98 = {{#if:{{{population_blank1|}}}|{{formatnum:{{replace|{{{population_blank1}}}|,|}}}}}}
| rowclass99 = mergedrow
| label99 = • {{#if:{{{population_blank1_title|}}}|{{{population_blank1_title}}} density|Density}}
| data99 = {{#if:{{{population_density_blank1_km2|}}}{{{population_density_blank1_sq_mi|}}}{{{population_blank1|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank1_km2|}}}
|/sqmi={{{population_density_blank1_sq_mi|}}}
|pop ={{{population_blank1|}}}
|ha ={{{area_blank1_ha|}}}
|km2 ={{{area_blank1_km2|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass100 = mergedrow
| label100 = • {{{population_blank2_title|}}}<div class="ib-settlement-fn">{{{population_blank2_footnotes|}}}</div>
| data100 = {{#if:{{{population_blank2|}}}|{{formatnum:{{replace|{{{population_blank2}}}|,|}}}}}}
| rowclass101 = mergedrow
| label101 = • {{#if:{{{population_blank2_title|}}}|{{{population_blank2_title}}} density|Density}}
| data101 = {{#if:{{{population_density_blank2_km2|}}}{{{population_density_blank2_sq_mi|}}}{{{population_blank2|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank2_km2|}}}
|/sqmi={{{population_density_blank2_sq_mi|}}}
|pop ={{{population_blank2|}}}
|ha ={{{area_blank2_ha|}}}
|km2 ={{{area_blank2_km2|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass102 = mergedrow
| label102 =
| data102 = {{{population_note|}}}
| rowclass103 = mergedtoprow
| label103 = {{#if:{{{population_demonym|}}}|[[Demonym|Demonym(s)]]|{{#if:{{{population_demonyms|}}}|[[Demonym]]s}}}}
| data103 = {{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}}}{{Main other|{{Pluralize from text|{{{population_demonym|}}}|||[[Category:Pages using infobox settlement with possible demonym list]]}}}}
<!-- ***Demographics 1*** -->
| rowclass104 = mergedtoprow
| header104 = {{#if:{{{demographics_type1|}}}
|{{{demographics_type1}}}<div class="ib-settlement-fn">{{{demographics1_footnotes|}}}</div>}}
| rowclass105 = mergedrow
| label105 = • {{{demographics1_title1}}}
| data105 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title1|}}}|{{{demographics1_info1|}}}}}}}
| rowclass106 = mergedrow
| label106 = • {{{demographics1_title2}}}
| data106 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title2|}}}|{{{demographics1_info2|}}}}}}}
| rowclass107 = mergedrow
| label107 = • {{{demographics1_title3}}}
| data107 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title3|}}}|{{{demographics1_info3|}}}}}}}
| rowclass108 = mergedrow
| label108 = • {{{demographics1_title4}}}
| data108 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title4|}}}|{{{demographics1_info4|}}}}}}}
| rowclass109 = mergedrow
| label109 = • {{{demographics1_title5}}}
| data109 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title5|}}}|{{{demographics1_info5|}}}}}}}
| rowclass110 = mergedrow
| label110 = • {{{demographics1_title6}}}
| data110 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title6|}}}|{{{demographics1_info6|}}}}}}}
| rowclass111 = mergedrow
| label111 = • {{{demographics1_title7}}}
| data111 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title7|}}}|{{{demographics1_info7|}}}}}}}
| rowclass112 = mergedrow
| label112 = • {{{demographics1_title8}}}
| data112 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title8|}}}|{{{demographics1_info8|}}}}}}}
| rowclass113 = mergedrow
| label113 = • {{{demographics1_title9}}}
| data113 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title9|}}}|{{{demographics1_info9|}}}}}}}
| rowclass114 = mergedrow
| label114 = • {{{demographics1_title10}}}
| data114 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title10|}}}|{{{demographics1_info10|}}}}}}}
<!-- ***Demographics 2*** -->
| rowclass115 = mergedtoprow
| header115 = {{#if:{{{demographics_type2|}}}
|{{{demographics_type2}}}<div class="ib-settlement-fn">{{{demographics2_footnotes|}}}</div>}}
| rowclass116 = mergedrow
| label116 = • {{{demographics2_title1}}}
| data116 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title1|}}}|{{{demographics2_info1|}}}}}}}
| rowclass117 = mergedrow
| label117 = • {{{demographics2_title2}}}
| data117 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title2|}}}|{{{demographics2_info2|}}}}}}}
| rowclass118 = mergedrow
| label118 = • {{{demographics2_title3}}}
| data118 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title3|}}}|{{{demographics2_info3|}}}}}}}
| rowclass119 = mergedrow
| label119 = • {{{demographics2_title4}}}
| data119 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title4|}}}|{{{demographics2_info4|}}}}}}}
| rowclass120 = mergedrow
| label120 = • {{{demographics2_title5}}}
| data120 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title5|}}}|{{{demographics2_info5|}}}}}}}
| rowclass121 = mergedrow
| label121 = • {{{demographics2_title6}}}
| data121 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title6|}}}|{{{demographics2_info6|}}}}}}}
| rowclass122 = mergedrow
| label122 = • {{{demographics2_title7}}}
| data122 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title7|}}}|{{{demographics2_info7|}}}}}}}
| rowclass123 = mergedrow
| label123 = • {{{demographics2_title8}}}
| data123 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title8|}}}|{{{demographics2_info8|}}}}}}}
| rowclass124 = mergedrow
| label124 = • {{{demographics2_title9}}}
| data124 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title9|}}}|{{{demographics2_info9|}}}}}}}
| rowclass125 = mergedrow
| label125 = • {{{demographics2_title10}}}
| data125 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title10|}}}|{{{demographics2_info10|}}}}}}}
<!-- ***Time Zones*** -->
| rowclass126 = mergedtoprow
| header126 = {{#if:{{{timezone1_location|}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}|}}
| rowclass127 = {{#if:{{{timezone1_location|}}}|mergedrow|mergedtoprow}}
| label127 = {{#if:{{{timezone1_location|}}}|{{{timezone1_location}}}|{{#if:{{{timezone2_location|}}}|{{{timezone2_location}}}|{{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}}}}}
| data127 = {{#if:{{{utc_offset1|{{{utc_offset|}}} }}}
|[[UTC{{{utc_offset1|{{{utc_offset}}}}}}]] {{#if:{{{timezone1|{{{timezone|}}}}}}|({{{timezone1|{{{timezone}}}}}})}}
|{{{timezone1|{{{timezone|}}}}}}
}}
| rowclass128 = mergedrow
| label128 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data128 = {{#if:{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}
|[[UTC{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}]] {{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|({{{timezone1_DST|{{{timezone_DST}}}}}})}}
|{{{timezone1_DST|{{{timezone_DST|}}}}}}
}}
| rowclass129 = mergedrow
| label129 = {{#if:{{{timezone2_location|}}}| {{{timezone2_location|}}}|<nowiki />}}
| data129 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset2|{{{utc_offset2|}}} }}}
|[[UTC{{{utc_offset2|{{{utc_offset2}}}}}}]] {{#if:{{{timezone2|}}}|({{{timezone2}}})}}
|{{{timezone2|}}}
}}
}}
| rowclass130 = mergedrow
| label130 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data130 = {{#if:{{{utc_offset2_DST|}}}|[[UTC{{{utc_offset2_DST|}}}]] {{#if:{{{timezone2_DST|}}}|({{{timezone2_DST|}}})}}
|{{{timezone2_DST|}}}
}}
| rowclass131 = mergedrow
| label131 = {{#if:{{{timezone3_location|}}}| {{{timezone3_location|}}}|<nowiki />}}
| data131 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset3|{{{utc_offset3|}}} }}}
|[[UTC{{{utc_offset3|{{{utc_offset3}}}}}}]] {{#if:{{{timezone3|}}}|({{{timezone3}}})}}
|{{{timezone3|}}}
}}
}}
| rowclass132 = mergedrow
| label132 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data132 = {{#if:{{{utc_offset3_DST|}}}|[[UTC{{{utc_offset3_DST|}}}]] {{#if:{{{timezone3_DST|}}}|({{{timezone3_DST|}}})}}
|{{{timezone3_DST|}}}
}}
| rowclass133 = mergedrow
| label133 = {{#if:{{{timezone4_location|}}}| {{{timezone4_location|}}}|<nowiki />}}
| data133 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset4|{{{utc_offset4|}}} }}}
|[[UTC{{{utc_offset4|{{{utc_offset4}}}}}}]] {{#if:{{{timezone4|}}}|({{{timezone4}}})}}
|{{{timezone4|}}}
}}
}}
| rowclass134 = mergedrow
| label134 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data134 = {{#if:{{{utc_offset4_DST|}}}|[[UTC{{{utc_offset4_DST|}}}]] {{#if:{{{timezone4_DST|}}}|({{{timezone4_DST|}}})}}
|{{{timezone4_DST|}}}
}}
| rowclass135 = mergedrow
| label135 = {{#if:{{{timezone5_location|}}}| {{{timezone5_location|}}}|<nowiki />}}
| data135 = {{#if:{{{timezone1|{{{timezone|}}}}}}{{{utc_offset1|{{{utc_offset|}}}}}}
|{{#if:{{{utc_offset5|{{{utc_offset5|}}} }}}
|[[UTC{{{utc_offset5|{{{utc_offset5}}}}}}]] {{#if:{{{timezone5|}}}|({{{timezone5}}})}}
|{{{timezone5|}}}
}}
}}
| rowclass136 = mergedrow
| label136 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data136 = {{#if:{{{utc_offset5_DST|}}}|[[UTC{{{utc_offset5_DST|}}}]] {{#if:{{{timezone5_DST|}}}|({{{timezone5_DST|}}})}}
|{{{timezone5_DST|}}}
}}
<!-- ***Postal Code(s)*** -->
| rowclass137 = mergedtoprow
| label137 = {{{postal_code_type}}}
| class137 = adr
| data137 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|<div class="postal-code">{{{postal_code}}}</div>}}}}
| rowclass138 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}|mergedbottomrow|mergedtoprow}}
| label138 = {{{postal2_code_type}}}
| class138 = adr
| data138 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|<div class="postal-code">{{{postal2_code}}}</div>}} }} }}
<!-- ***Area Code(s)*** -->
| rowclass139 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}|mergedrow|mergedtoprow}}
| label139 = {{#if:{{{area_code_type|}}}|{{{area_code_type}}}|{{#if:{{{area_code|}}}|[[Telephone numbering plan|Area code(s)]]|{{#if:{{{area_codes|}}}|[[Telephone numbering plan|Area codes]]}}}}}}
| data139 = {{if empty|{{{area_code|}}}|{{{area_codes|}}}}}{{#if:{{{area_code_type|}}}{{{area_codes|}}}||{{Main other|{{Pluralize from text|any_comma=1|parse_links=1|{{{area_code|}}}|||[[Category:Pages using infobox settlement with possible area code list]]}}}}}}
<!-- Geocode-->
| rowclass140 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}|mergedrow|mergedtoprow}}
| label140 = [[Geocode]]
| class140 = nickname
| data140 = {{{geocode|}}}
<!-- ISO Code-->
| rowclass141 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}|mergedrow|mergedtoprow}}
| label141 = [[ISO 3166|ISO 3166 code]]
| class141 = nickname
| data141 = {{{iso_code|}}}
<!-- Vehicle registration plate-->
| rowclass142 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|mergedrow|mergedtoprow}}
| label142 = {{#if:{{{registration_plate_type|}}}|{{{registration_plate_type}}}|[[Vehicle registration plate|Vehicle registration]]}}
| data142 = {{{registration_plate|}}}
<!-- Other codes -->
| rowclass143 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|mergedrow|mergedtoprow}}
| label143 = {{{code1_name|}}}
| class143 = nickname
| data143 = {{#if:{{{code1_name|}}}|{{{code1_info|}}}}}
| rowclass144 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|{{{code1_name|}}}|mergedrow|mergedtoprow}}
| label144 = {{{code2_name|}}}
| class144 = nickname
| data144 = {{#if:{{{code2_name|}}}|{{{code2_info|}}}}}
<!-- ***Blank Fields (two sections)*** -->
| rowclass145 = mergedtoprow
| label145 = {{{blank_name_sec1|{{{blank_name|}}}}}}
| data145 = {{#if:{{{blank_name_sec1|{{{blank_name|}}}}}}|{{{blank_info_sec1|{{{blank_info|}}}}}}}}
| rowclass146 = mergedrow
| label146 = {{{blank1_name_sec1|{{{blank1_name|}}}}}}
| data146 = {{#if:{{{blank1_name_sec1|{{{blank1_name|}}}}}}|{{{blank1_info_sec1|{{{blank1_info|}}}}}}}}
| rowclass147 = mergedrow
| label147 = {{{blank2_name_sec1|{{{blank2_name|}}}}}}
| data147 = {{#if:{{{blank2_name_sec1|{{{blank2_name|}}}}}}|{{{blank2_info_sec1|{{{blank2_info|}}}}}}}}
| rowclass148 = mergedrow
| label148 = {{{blank3_name_sec1|{{{blank3_name|}}}}}}
| data148 = {{#if:{{{blank3_name_sec1|{{{blank3_name|}}}}}}|{{{blank3_info_sec1|{{{blank3_info|}}}}}}}}
| rowclass149 = mergedrow
| label149 = {{{blank4_name_sec1|{{{blank4_name|}}}}}}
| data149 = {{#if:{{{blank4_name_sec1|{{{blank4_name|}}}}}}|{{{blank4_info_sec1|{{{blank4_info|}}}}}}}}
| rowclass150 = mergedrow
| label150 = {{{blank5_name_sec1|{{{blank5_name|}}}}}}
| data150 = {{#if:{{{blank5_name_sec1|{{{blank5_name|}}}}}}|{{{blank5_info_sec1|{{{blank5_info|}}}}}}}}
| rowclass151 = mergedrow
| label151 = {{{blank6_name_sec1|{{{blank6_name|}}}}}}
| data151 = {{#if:{{{blank6_name_sec1|{{{blank6_name|}}}}}}|{{{blank6_info_sec1|{{{blank6_info|}}}}}}}}
| rowclass152 = mergedrow
| label152 = {{{blank7_name_sec1|{{{blank7_name|}}}}}}
| data152 = {{#if:{{{blank7_name_sec1|{{{blank7_name|}}}}}}|{{{blank7_info_sec1|{{{blank7_info|}}}}}}}}
| rowclass153 = mergedtoprow
| label153 = {{{blank_name_sec2}}}
| data153 = {{#if:{{{blank_name_sec2|}}}|{{{blank_info_sec2|}}}}}
| rowclass154 = mergedrow
| label154 = {{{blank1_name_sec2}}}
| data154 = {{#if:{{{blank1_name_sec2|}}}|{{{blank1_info_sec2|}}}}}
| rowclass155 = mergedrow
| label155 = {{{blank2_name_sec2}}}
| data155 = {{#if:{{{blank2_name_sec2|}}}|{{{blank2_info_sec2|}}}}}
| rowclass156 = mergedrow
| label156 = {{{blank3_name_sec2}}}
| data156 = {{#if:{{{blank3_name_sec2|}}}|{{{blank3_info_sec2|}}}}}
| rowclass157 = mergedrow
| label157 = {{{blank4_name_sec2}}}
| data157 = {{#if:{{{blank4_name_sec2|}}}|{{{blank4_info_sec2|}}}}}
| rowclass158 = mergedrow
| label158 = {{{blank5_name_sec2}}}
| data158 = {{#if:{{{blank5_name_sec2|}}}|{{{blank5_info_sec2|}}}}}
| rowclass159 = mergedrow
| label159 = {{{blank6_name_sec2}}}
| data159 = {{#if:{{{blank6_name_sec2|}}}|{{{blank6_info_sec2|}}}}}
| rowclass160 = mergedrow
| label160 = {{{blank7_name_sec2}}}
| data160 = {{#if:{{{blank7_name_sec2|}}}|{{{blank7_info_sec2|}}}}}
<!-- ***Website*** -->
| rowclass161 = mergedtoprow
| label161 = Website
| data161 = {{#if:{{{website|}}}|{{{website}}}}}
| class162 = maptable
| data162 = {{#if:{{{module|}}}|{{{module}}}}}
<!-- ***Footnotes*** -->
| belowrowclass = mergedtoprow
| below = {{{footnotes|}}}
}}<!-- Check for unknowns
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox settlement with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox settlement]] with unknown parameter "_VALUE_"|ignoreblank=y
| alt | anthem | anthem_link | area_blank1_acre | area_blank1_dunam | area_blank1_ha | area_blank1_km2 | area_blank1_sq_mi | area_blank1_title | area_blank2_acre | area_blank2_dunam | area_blank2_ha | area_blank2_km2 | area_blank2_sq_mi | area_blank2_title | area_code | area_code_type | area_codes | area_footnotes | area_land_acre | area_land_dunam | area_land_ha | area_land_km2 | area_land_sq_mi | area_metro_acre | area_metro_dunam | area_metro_footnotes | area_metro_ha | area_metro_km2 | area_metro_sq_mi | area_note | area_rank | area_rural_acre | area_rural_dunam | area_rural_footnotes | area_rural_ha | area_rural_km2 | area_rural_sq_mi | area_total_acre | area_total_dunam | area_total_ha | area_total_km2 | area_total_sq_mi | area_urban_acre | area_urban_dunam | area_urban_footnotes | area_urban_ha | area_urban_km2 | area_urban_sq_mi | area_water_acre | area_water_dunam | area_water_ha | area_water_km2 | area_water_percent | area_water_sq_mi | blank_emblem_alt | blank_emblem_link | blank_emblem_size | blank_emblem_type | blank_info | blank_info_sec1 | blank_info_sec2 | blank_name | blank_name_sec1 | blank_name_sec2 | blank1_info | blank1_info_sec1 | blank1_info_sec2 | blank1_name | blank1_name_sec1 | blank1_name_sec2 | blank2_info | blank2_info_sec1 | blank2_info_sec2 | blank2_name | blank2_name_sec1 | blank2_name_sec2 | blank3_info | blank3_info_sec1 | blank3_info_sec2 | blank3_name | blank3_name_sec1 | blank3_name_sec2 | blank4_info | blank4_info_sec1 | blank4_info_sec2 | blank4_name | blank4_name_sec1 | blank4_name_sec2 | blank5_info | blank5_info_sec1 | blank5_info_sec2 | blank5_name | blank5_name_sec1 | blank5_name_sec2 | blank6_info | blank6_info_sec1 | blank6_info_sec2 | blank6_name | blank6_name_sec1 | blank6_name_sec2 | blank7_info | blank7_info_sec1 | blank7_info_sec2 | blank7_name | blank7_name_sec1 | blank7_name_sec2 | caption | code1_info | code1_name | code2_info | code2_name | coor_pinpoint | coor_type | coordinates | coordinates_footnotes | demographics_type1 | demographics_type2 | demographics1_footnotes | demographics1_info1 | demographics1_info10 | demographics1_info2 | demographics1_info3 | demographics1_info4 | demographics1_info5 | demographics1_info6 | demographics1_info7 | demographics1_info8 | demographics1_info9 | demographics1_title1 | demographics1_title10 | demographics1_title2 | demographics1_title3 | demographics1_title4 | demographics1_title5 | demographics1_title6 | demographics1_title7 | demographics1_title8 | demographics1_title9 | demographics2_footnotes | demographics2_info1 | demographics2_info10 | demographics2_info2 | demographics2_info3 | demographics2_info4 | demographics2_info5 | demographics2_info6 | demographics2_info7 | demographics2_info8 | demographics2_info9 | demographics2_title1 | demographics2_title10 | demographics2_title2 | demographics2_title3 | demographics2_title4 | demographics2_title5 | demographics2_title6 | demographics2_title7 | demographics2_title8 | demographics2_title9 | dimensions_footnotes | dunam_link | elevation_footnotes | elevation_ft | elevation_link | elevation_m | elevation_max_footnotes | elevation_max_ft | elevation_max_m | elevation_max_point | elevation_max_rank | elevation_min_footnotes | elevation_min_ft | elevation_min_m | elevation_min_point | elevation_min_rank | elevation_point | embed | established_date | established_date1 | established_date2 | established_date3 | established_date4 | established_date5 | established_date6 | established_date7 | established_title | established_title1 | established_title2 | established_title3 | established_title4 | established_title5 | established_title6 | established_title7 | etymology | extinct_date | extinct_title | flag_alt | flag_border | flag_link | flag_size | footnotes | founder | geocode | governing_body | government_footnotes | government_type | government_blank1_title | government_blank1 | government_blank2_title | government_blank2 | government_blank2_title | government_blank3 | government_blank3_title | government_blank3 | government_blank4_title | government_blank4 | government_blank5_title | government_blank5 | government_blank6_title | government_blank6 | grid_name | grid_position | image_alt | image_blank_emblem | image_caption | image_flag | image_map | image_map1 | image_seal | image_shield | image_size | image_skyline | imagesize | iso_code | leader_name | leader_name1 | leader_name2 | leader_name3 | leader_name4 | leader_party | leader_title | leader_title1 | leader_title2 | leader_title3 | leader_title4 | length_km | length_mi | map_alt | map_alt1 | map_caption | map_caption1 | mapsize | mapsize1 | module | motto | motto_link | mottoes | name | named_for | native_name | native_name_lang | nickname | nickname_link | nicknames | official_name | other_name | p1 | p10 | p11 | p12 | p13 | p14 | p15 | p16 | p17 | p18 | p19 | p2 | p20 | p21 | p22 | p23 | p24 | p25 | p26 | p27 | p28 | p29 | p3 | p30 | p31 | p32 | p33 | p34 | p35 | p36 | p37 | p38 | p39 | p4 | p40 | p41 | p42 | p43 | p44 | p45 | p46 | p47 | p48 | p49 | p5 | p50 | p6 | p7 | p8 | p9 | parts | parts_style | parts_type | pop_est_as_of | pop_est_footnotes | population | population_as_of | population_blank1 | population_blank1_footnotes | population_blank1_title | population_blank2 | population_blank2_footnotes | population_blank2_title | population_demonym | population_demonyms | population_density_blank1_km2 | population_density_blank1_sq_mi | population_density_blank2_km2 | population_density_blank2_sq_mi | population_density_km2 | population_density_metro_km2 | population_density_metro_sq_mi | population_density_rank | population_density_rural_km2 | population_density_rural_sq_mi | population_density_sq_mi | population_density_urban_km2 | population_density_urban_sq_mi | population_est | population_footnotes | population_metro | population_metro_footnotes | population_note | population_rank | population_rural | population_rural_footnotes | population_total | population_urban | population_urban_footnotes | postal_code | postal_code_type | postal2_code | postal2_code_type | pushpin_image | pushpin_label | pushpin_label_position | pushpin_map | pushpin_map_alt | pushpin_map_caption | pushpin_map_caption_notsmall | pushpin_map_narrow | pushpin_mapsize | pushpin_outside | pushpin_overlay | pushpin_relief | registration_plate | registration_plate_type | seal_alt | seal_link | seal_size | seal_type | seat | seat_type | seat1 | seat1_type | seat2 | seat2_type | settlement_type | shield_alt | shield_link | shield_size | short_description | subdivision_name | subdivision_name1 | subdivision_name2 | subdivision_name3 | subdivision_name4 | subdivision_name5 | subdivision_name6 | subdivision_type | subdivision_type1 | subdivision_type2 | subdivision_type3 | subdivision_type4 | subdivision_type5 | subdivision_type6 | timezone | timezone_DST | timezone_link | timezone1 | timezone1_DST | timezone1_location | timezone2 | timezone2_DST | timezone2_location | timezone3 | timezone3_DST | timezone3_location | timezone4 | timezone4_DST | timezone4_location | timezone5 | timezone5_DST | timezone5_location | total_type | translit_lang1 | translit_lang1_info | translit_lang1_info1 | translit_lang1_info2 | translit_lang1_info3 | translit_lang1_info4 | translit_lang1_info5 | translit_lang1_info6 | translit_lang1_type | translit_lang1_type1 | translit_lang1_type2 | translit_lang1_type3 | translit_lang1_type4 | translit_lang1_type5 | translit_lang1_type6 | translit_lang2 | translit_lang2_info | translit_lang2_info1 | translit_lang2_info2 | translit_lang2_info3 | translit_lang2_info4 | translit_lang2_info5 | translit_lang2_info6 | translit_lang2_type | translit_lang2_type1 | translit_lang2_type2 | translit_lang2_type3 | translit_lang2_type4 | translit_lang2_type5 | translit_lang2_type6 | type | unit_pref | utc_offset | utc_offset_DST | utc_offset1 | utc_offset1_DST | utc_offset2 | utc_offset2_DST | utc_offset3 | utc_offset3_DST | utc_offset4 | utc_offset4_DST | utc_offset5 | utc_offset5_DST | website | width_km | width_mi
}}<!--
-->{{#invoke:Check for clobbered parameters|check
| template = Infobox settlement
| cat = {{main other|Category:Pages using infobox settlement with conflicting parameters}}
| population; population_total
| image_size; imagesize
| image_alt; alt
| image_caption; caption
}}<!-- Wikidata
-->{{#if:{{{coordinates_wikidata|}}}{{{wikidata|}}}
|[[Category:Pages using infobox settlement with the wikidata parameter]]
}}{{main other|<!-- Missing country
-->{{#if:{{{subdivision_name|}}}||[[Category:Pages using infobox settlement with missing country]]}}<!-- No map
-->{{#if:{{{pushpin_map|}}}{{{image_map|}}}{{{image_map1|}}}||[[Category:Pages using infobox settlement with no map]]}}<!-- Image_map1 without image_map
-->{{#if:{{{image_map1|}}}|{{#if:{{{image_map|}}}||[[Category:Pages using infobox settlement with image_map1 but not image_map]]}}}}<!-- No coordinates
-->{{#if:{{{coordinates|}}}||[[Category:Pages using infobox settlement with no coordinates]]}}<!--
-->{{#if:{{{type|}}}|{{#ifeq:{{{settlement_type|a}}}|{{{settlement_type|b}}}|[[Category:Pages using infobox settlement with ignored type]]|}}|}}<!-- Ignored type parameter
-->{{#if:{{{embed|}}}|[[Category:Pages using infobox settlement with embed]]}}
}}</includeonly><noinclude>
{{documentation}}
<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
</noinclude>
f2me2f2xzton97zx6jjs5h82bpjj23b
2444342
2444341
2022-08-14T11:33:27Z
Fexpr
7716
Mambatalan revisi 2444341 oleh [[Special:Contributions/Fexpr|Fexpr]] ([[User talk:Fexpr|maota]])
wikitext
text/x-wiki
{{infobox
| bodyclass = geography vcard
| bodystyle = width:23em
| headerstyle = text-align:left
| abovestyle = font-size:1.25em; white-space:nowrap
| above = <span class="fn org">{{#if:{{{name|}}}|{{{name}}}|{{#if:{{{official_name|}}}|{{{official_name}}}|{{PAGENAME}}}}}}</span>{{#if:{{{native_name|}}}|<br /><span class="nickname" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</span>}}{{#if:{{{other_name|}}}|<br /><span class="nickname" style="font-size:78%">{{{other_name}}}</span>}}<!--
** names, type, and transliterations **
-->{{infobox|child=yes|decat=yes<!-- Remove from [[Category:Articles which use infobox templates with no data rows]] -->
| subheaderstyle = background-color:#cddeff; font-weight:bold;
| subheader = {{#if:{{{subheader|}}}|{{{subheader}}}|{{#if:{{both|{{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}{{#ifeq:{{yesno|{{{embed|}}}}}|yes|1}}|{{{settlement_type|{{{type|}}}}}}}}|<div class="category">{{{settlement_type|{{{type}}}}}}</div>}}}}
| rowclass1 = mergedtoprow
| header1 = {{#if:{{{name|}}}|{{{official_name|}}}}}
| rowclass2 = mergedtoprow
| header2 = {{#if:{{{translit_lang1|}}}|Transkripsi {{{translit_lang1}}}<!--
***Transliteration language 1***
-->{{infobox|child=yes
|rowclass1 = {{#if:{{{translit_lang1_type1|}}}|mergedrow|mergedbottomrow}}
|label1 = • {{{translit_lang1_type}}}
|data1 = {{#if:{{{translit_lang1_type|}}}|{{{translit_lang1_info|}}}}}
|rowclass2 = {{#if:{{{translit_lang1_type2|}}}|mergedrow|mergedbottomrow}}
|label2 = • {{{translit_lang1_type1}}}
|data2 = {{#if:{{{translit_lang1_type1|}}}|{{{translit_lang1_info1|}}}}}
|rowclass3 = {{#if:{{{translit_lang1_type3|}}}|mergedrow|mergedbottomrow}}
|label3 = • {{{translit_lang1_type2}}}
|data3 = {{#if:{{{translit_lang1_type2|}}}|{{{translit_lang1_info2|}}}}}
|rowclass4 = {{#if:{{{translit_lang1_type4|}}}|mergedrow|mergedbottomrow}}
|label4 = • {{{translit_lang1_type3}}}
|data4 = {{#if:{{{translit_lang1_type3|}}}|{{{translit_lang1_info3|}}}}}
|rowclass5 = {{#if:{{{translit_lang1_type5|}}}|mergedrow|mergedbottomrow}}
|label5 = • {{{translit_lang1_type4}}}
|data5 = {{#if:{{{translit_lang1_type4|}}}|{{{translit_lang1_info4|}}}}}
|rowclass6 = {{#if:{{{translit_lang1_type6|}}}|mergedrow|mergedbottomrow}}
|label6 = • {{{translit_lang1_type5}}}
|data6 = {{#if:{{{translit_lang1_type5|}}}|{{{translit_lang1_info5|}}}}}
|rowclass7 = mergedbottomrow
|label7 = • {{{translit_lang1_type6}}}
|data7 = {{#if:{{{translit_lang1_type6|}}}|{{{translit_lang1_info6|}}} }}
}} }}
| rowclass3 = mergedtoprow
| header3 = {{#if:{{{translit_lang2|}}}|Transkripsi {{{translit_lang2}}}<!--
***Transliteration language 2***
-->{{infobox|child=yes
|rowclass1 = {{#if:{{{translit_lang2_type1|}}}|mergedrow|mergedbottomrow}}
|label1 = • {{{translit_lang2_type}}}
|data1 = {{#if:{{{translit_lang2_type|}}}|{{{translit_lang2_info|}}}}}
|rowclass2 = {{#if:{{{translit_lang2_type2|}}}|mergedrow|mergedbottomrow}}
|label2 = • {{{translit_lang2_type1}}}
|data2 = {{#if:{{{translit_lang2_type1|}}}|{{{translit_lang2_info1|}}}}}
|rowclass3 = {{#if:{{{translit_lang2_type3|}}}|mergedrow|mergedbottomrow}}
|label3 = • {{{translit_lang2_type2}}}
|data3 = {{#if:{{{translit_lang2_type2|}}}|{{{translit_lang2_info2|}}}}}
|rowclass4 = {{#if:{{{translit_lang2_type4|}}}|mergedrow|mergedbottomrow}}
|label4 = • {{{translit_lang2_type3}}}
|data4 = {{#if:{{{translit_lang2_type3|}}}|{{{translit_lang2_info3|}}}}}
|rowclass5 = {{#if:{{{translit_lang2_type5|}}}|mergedrow|mergedbottomrow}}
|label5 = • {{{translit_lang2_type4}}}
|data5 = {{#if:{{{translit_lang2_type4|}}}|{{{translit_lang2_info4|}}}}}
|rowclass6 = {{#if:{{{translit_lang2_type6|}}}|mergedrow|mergedbottomrow}}
|label6 = • {{{translit_lang2_type5}}}
|data6 = {{#if:{{{translit_lang2_type5|}}}|{{{translit_lang2_info5|}}}}}
|rowclass7 = mergedbottomrow
|label7 = • {{{translit_lang2_type6}}}
|data7 = {{#if:{{{translit_lang2_type6|}}}|{{{translit_lang2_info6|}}} }}
}} }}
}}<!-- end ** names, type, and transliterations ** -->
<!-- ***Skyline Image*** -->
| imagestyle = padding:0.7em 0.8em
| image = {{#if:{{{image_skyline|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_skyline}}}|size={{{imagesize|}}}|sizedefault=250px|alt={{{image_alt|}}}|title={{{image_caption|Kaki langit {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{image_caption|}}}|<br /><small>{{{image_caption}}}</small>}}}}
<!-- ***Other Image*** -->
| image2 = {{{image|}}}
<!-- ***Flag, Seal, Shield and Coat of arms*** -->
| rowclass1 = mergedtoprow
| class1 = maptable
| data1 = {{#if:{{{image_flag|}}}{{{image_seal|}}}{{{image_shield|}}}{{{image_blank_emblem|}}}{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}
|{{Infobox settlement/columns
| 1 = {{#if:{{{image_flag|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_flag}}}|size={{{flag_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|border={{yesno |{{{flag_border|}}}|yes=yes|blank=yes}}|alt={{{flag_alt|}}}|title=Bandera {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>'''{{Infobox settlement/link|type=Bendera|link={{{flag_link|}}}|name={{{official_name}}}}}'''</small>}}
| 2 = {{#if:{{{image_seal|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_seal|}}}|size={{{seal_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|alt={{{seal_alt|}}}|title=Lambang rasmi {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>'''{{Infobox settlement/link|type={{#if:{{{seal_type|}}}|{{{seal_type}}}|Lambang}}|link={{{seal_link|}}}|name={{{official_name}}}}}'''</small>}}
| 3 = {{#if:{{{image_shield|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_shield|}}}||size={{{shield_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|alt={{{shield_alt|}}}|title=Lambang {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>'''{{Infobox settlement/link|type=Lambang|link={{{shield_link|}}}|name={{{official_name}}}}}'''</small>}}
| 4 = {{#if:{{{image_blank_emblem|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_blank_emblem|}}}|size={{{blank_emblem_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|alt={{{blank_emblem_alt|}}}|title=Logo rasmi {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>'''{{Infobox settlement/link|type={{#if:{{{blank_emblem_type|}}}|{{{blank_emblem_type}}}|Logo}}|link={{{blank_emblem_link|}}}|name={{{official_name}}}}}'''</small>}}
| 5 = {{#if:{{{image_map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=100px|alt={{{map_alt|}}}|title={{{map_caption|Lokasi {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<br /><small>{{{map_caption}}}</small>}} }}
| 0 = {{#if:{{{pushpin_map_narrow|}}}|{{#if:{{both| {{{pushpin_map|}}} | {{both|{{{latd|}}}|{{{longd|}}}}} }}|
{{location map|{{{pushpin_map|}}}
|border = none
|alt = {{{pushpin_map_alt|}}}
|caption =
|float = center
|width = {{#if:{{{pushpin_mapsize|}}}|{{{pushpin_mapsize}}}|150}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|lat = {{#if:{{{latm|}}}{{{latNS|}}}| |{{{latd|}}} }}
|long = {{#if:{{{longm|}}}{{{longEW|}}}| |{{{longd|}}} }}
|lat_deg={{#if:{{{latm|}}}{{{latNS|}}}|{{{latd|}}} }}
|lat_min={{#if:{{{latm|}}}{{{latNS|}}}|{{{latm|}}} }}
|lat_sec={{#if:{{{lats|}}}{{{latNS|}}}|{{{lats|}}} }}
|lat_dir={{{latNS|}}}
|lon_deg={{#if:{{{longm|}}}{{{longEW|}}}|{{{longd|}}} }}
|lon_min={{#if:{{{longm|}}}{{{longEW|}}}|{{{longm|}}} }}
|lon_sec={{#if:{{{longs|}}}{{{longEW|}}}|{{{longs|}}} }}
|lon_dir={{{longEW|}}}
|marksize =6
|position = {{{pushpin_label_position|}}}
}}{{#if:{{{pushpin_map_caption|}}}|<small>{{{pushpin_map_caption}}}</small>|{{#if:{{{map_caption|}}}|<small>{{{map_caption}}}</small>}}}}
}} }}
}} }}
<!-- ***Nickname*** -->
| rowclass2 = mergedrow
| data2 = {{#if:{{{nickname|}}}|Julukan: <span class="nickname">{{{nickname}}}</span>}}
<!-- ***Motto*** -->
| rowclass3 = mergedrow
| data3 = {{#if:{{{motto|}}}|Semboyan: {{{motto}}} }}
<!-- ***Anthem*** -->
| rowclass4 = mergedrow
| data4 = {{#if:{{{anthem|}}}|Lagu: {{{anthem}}} }}
<!-- ***Map*** -->
| rowclass5 = mergedrow
| data5 = {{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}||{{#if:{{{image_map|}}}
|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=250px|alt={{{map_alt|}}}|title={{{map_caption|Lokasi {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<br /><small>{{{map_caption}}}</small>}}
}}}}
| rowclass6 = mergedrow
| data6 = {{#if:{{{image_map1|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map1}}}|size={{{mapsize1|}}}|sizedefault=250px|alt={{{map_alt1|}}}|title={{{map_caption1|Lokasi {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption1|}}}|<br /><small>{{{map_caption1}}}</small>}} }}
<!--***Dot Map*** -->
| rowclass7 = mergedrow
| data7 = {{#if:{{{image_dot_map|}}}
|<div class="center">{{superimpose
|base = {{{image_dot_map|}}}
|base_width = {{{{{|safesubst:}}}#if:{{{dot_mapsize|}}}
|{{{dot_mapsize}}}{{#iferror:{{#expr:{{{dot_mapsize}}}>0}}||px}}
|180px}}
|base_alt = {{{dot_map_base_alt|}}}
|base_caption = {{#if:{{{official_name|}}}|{{{official_name|}}}|{{{name}}}}}
|float = Red pog.svg
|float_width = 6px
|float_alt = {{{dot_map_alt|}}}
|float_caption = {{{dot_map_caption|}}}
|x = {{{dot_x|}}}
|y = {{{dot_y|}}}
}}{{#if:{{{dot_map_caption|}}}|<small>{{{dot_map_caption}}}</small>}}</div>
}}
<!-- ***Pushpin Map*** -->
| rowclass8 = mergedtoprow
| data8 = {{#if:{{{pushpin_map_narrow|}}}||{{#if:{{both| {{{pushpin_map|}}} | {{both|{{{latd|}}}|{{{longd|}}}}} }}|
{{location map|{{{pushpin_map|}}}
|border = none
|alt = {{{pushpin_map_alt|}}}
|caption =
|float = center
|width = {{{pushpin_mapsize|}}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|lat = {{#if:{{{latm|}}}{{{latNS|}}}| |{{{latd|}}} }}
|long = {{#if:{{{longm|}}}{{{longEW|}}}| |{{{longd|}}} }}
|lat_deg={{#if:{{{latm|}}}{{{latNS|}}}|{{{latd|}}} }}
|lat_min={{#if:{{{latm|}}}{{{latNS|}}}|{{{latm|}}} }}
|lat_sec={{#if:{{{lats|}}}{{{latNS|}}}|{{{lats|}}} }}
|lat_dir={{{latNS|}}}
|lon_deg={{#if:{{{longm|}}}{{{longEW|}}}|{{{longd|}}} }}
|lon_min={{#if:{{{longm|}}}{{{longEW|}}}|{{{longm|}}} }}
|lon_sec={{#if:{{{longs|}}}{{{longEW|}}}|{{{longs|}}} }}
|lon_dir={{{longEW|}}}
|marksize =6
|position = {{{pushpin_label_position|}}}
}}{{#if:{{{pushpin_map_caption|}}}|<small>{{{pushpin_map_caption}}}</small>|{{#if:{{{map_caption|}}}|<small>{{{map_caption}}}</small>}}}}
}} }}
| rowclass9 = mergedrow
| data9 = {{#if:{{both|{{{pushpin_map1|}}}|{{both|{{{latd|}}}|{{{longd|}}}}}}}|
{{location map|{{{pushpin_map1|}}}
|border = none
|alt = {{{pushpin_map_alt1|}}}
|caption =
|float = center
|width = {{{pushpin_mapsize1|}}}
|default_width = 250
|relief= {{{pushpin_relief1|}}}
|AlternativeMap = {{{pushpin_image1|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position1|}}} }} | none | | {{#if:{{{pushpin_label1|}}}|{{{pushpin_label1}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|lat = {{#if:{{{latm|}}}{{{latNS|}}}| |{{{latd|}}} }}
|long = {{#if:{{{longm|}}}{{{longEW|}}}| |{{{longd|}}} }}
|lat_deg={{#if:{{{latm|}}}{{{latNS|}}}|{{{latd|}}} }}
|lat_min={{#if:{{{latm|}}}{{{latNS|}}}|{{{latm|}}} }}
|lat_sec={{#if:{{{lats|}}}{{{latNS|}}}|{{{lats|}}} }}
|lat_dir={{{latNS|}}}
|lon_deg={{#if:{{{longm|}}}{{{longEW|}}}|{{{longd|}}} }}
|lon_min={{#if:{{{longm|}}}{{{longEW|}}}|{{{longm|}}} }}
|lon_sec={{#if:{{{longs|}}}{{{longEW|}}}|{{{longs|}}} }}
|lon_dir={{{longEW|}}}
|marksize =6
|position = {{{pushpin_label_position1|}}}
}}{{#if:{{{pushpin_map_caption1|}}}|<small>{{{pushpin_map_caption1|}}}</small>|{{#if:{{{map_caption|}}}|<small>{{{map_caption}}}</small>}}}}
}}
<!-- ***Coordinates*** -->
| rowclass10 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{image_dot_map|}}}{{{pushpin_map|}}}{{{pushpin_map1|}}}|mergedbottomrow}}
| data10 = {{#if:{{both|{{{latd|}}}|{{{longd|}}}}}
|Koordinat{{#if:{{{coor_pinpoint|{{{coor_type|}}}}}}| ({{{coor_pinpoint|{{{coor_type|}}}}}})|}}: {{Geobox coor|{{{latd|}}}|{{{latm|}}}|{{{lats|}}}|{{{latNS|}}}|{{{longd|}}}|{{{longm|}}}|{{{longs|}}}|{{{longEW|}}}|{{#if:{{{coordinates_type|}}}|{{{coordinates_type}}}|type:city{{#if:{{{population_total|}}}|{{#iferror:{{#expr:{{formatnum:{{{population_total}}}|R}}+1}}||({{formatnum:{{{population_total}}}|R}})}}|}}{{#if:{{{coordinates_region|}}}|_region:{{{coordinates_region}}}|{{#if:{{{subdivision_name|}}}|_region:{{CountryAbbr|{{{subdivision_name|}}}|{{{subdivision_name1|}}} }} }} }} }}|{{#ifeq:{{{coordinates_display|}}}|inline|{{#if:{{{coordinates_display|}}}|title|μ}}}}={{{coordinates_display|}}}|{{#if:{{{coordinates_format|}}}|format|μ}}={{{coordinates_format|}}}}}{{{coordinates_footnotes|}}}
}}
<!-- ***Subdivisions*** -->
| rowclass11 = mergedtoprow
| label11 = {{{subdivision_type}}}
| data11 = {{#if:{{{subdivision_type|}}}|{{{subdivision_name|}}} }}
| rowclass12 = mergedrow
| label12 = {{{subdivision_type1}}}
| data12 = {{#if:{{{subdivision_type1|}}}|{{{subdivision_name1|}}} }}
| rowclass13 = mergedrow
| label13 = {{{subdivision_type2}}}
| data13 = {{#if:{{{subdivision_type2|}}}|{{{subdivision_name2|}}} }}
| rowclass14 = mergedrow
| label14 = {{{subdivision_type3}}}
| data14 = {{#if:{{{subdivision_type3|}}}|{{{subdivision_name3|}}} }}
| rowclass15 = mergedrow
| label15 = {{{subdivision_type4}}}
| data15 = {{#if:{{{subdivision_type4|}}}|{{{subdivision_name4|}}} }}
| rowclass16 = mergedrow
| label16 = {{{subdivision_type5}}}
| data16 = {{#if:{{{subdivision_type5|}}}|{{{subdivision_name5|}}} }}
| rowclass17 = mergedrow
| label17 = {{{subdivision_type6}}}
| data17 = {{#if:{{{subdivision_type6|}}}|{{{subdivision_name6|}}} }}
<!--***Established*** -->
| rowclass18 = mergedtoprow
| label18 = {{{established_title}}}
| data18 = {{#if:{{{established_title|}}}|{{{established_date|}}} }}
| rowclass19 = mergedrow
| label19 = {{{established_title1}}}
| data19 = {{#if:{{{established_title1|}}}|{{{established_date1|}}} }}
| rowclass20 = mergedrow
| label20 = {{{established_title2}}}
| data20 = {{#if:{{{established_title2|}}}|{{{established_date2|}}} }}
| rowclass21 = mergedrow
| label21 = {{{established_title3}}}
| data21 = {{#if:{{{established_title3|}}}|{{{established_date3|}}} }}
| rowclass22 = mergedrow
| label22 = {{{established_title4}}}
| data22 = {{#if:{{{established_title4|}}}|{{{established_date4|}}} }}
| rowclass23 = mergedrow
| label23 = {{{extinct_title}}}
| data23 = {{#if:{{{extinct_title|}}}|{{{extinct_date|}}} }}
| rowclass24 = mergedrow
| label24 = Pandiri
| data24 = {{{founder|}}}
| rowclass25 = mergedrow
| label25 = [[Penyematan nama|Asal nama]]
| data25 = {{{named_for|}}}
<!-- ***Seat of government and subdivisions within the settlement*** -->
| rowclass26 = mergedtoprow
| label26 = {{#if:{{{seat_type|}}}|{{{seat_type}}}|Ibu kota}}
| data26 = {{{seat|}}}
| rowclass27 = mergedrow
| label27 = {{#if:{{{seat1_type|}}}|{{{seat1_type}}}|Bakeh ibu kota}}
| data27 = {{{seat1|}}}
| rowclass28 = {{#if:{{{seat|}}}{{{seat1|}}}|mergedrow|mergedtoprow}}
| label28 = {{#if:{{{parts_type|}}}|{{{parts_type}}}|[[Borough]]}}
| data28 = {{#if:{{{parts|}}}{{{p1|}}}
|{{#ifeq:{{{parts_style|}}}|para
|<b>{{{parts|}}}{{#if:{{both|{{{parts|}}}|{{{p1|}}}}}|: |}}</b>{{comma separated entries|{{{p1|}}}|{{{p2|}}}|{{{p3|}}}|{{{p4|}}}|{{{p5|}}}|{{{p6|}}}|{{{p7|}}}|{{{p8|}}}|{{{p9|}}}|{{{p10|}}}|{{{p11|}}}|{{{p12|}}}|{{{p13|}}}|{{{p14|}}}|{{{p15|}}}|{{{p16|}}}|{{{p17|}}}|{{{p18|}}}|{{{p19|}}}|{{{p20|}}}|{{{p21|}}}|{{{p22|}}}|{{{p23|}}}|{{{p24|}}}|{{{p25|}}}|{{{p26|}}}|{{{p27|}}}|{{{p28|}}}|{{{p29|}}}|{{{p30|}}}|{{{p31|}}}|{{{p32|}}}|{{{p33|}}}|{{{p34|}}}|{{{p35|}}}|{{{p36|}}}|{{{p37|}}}|{{{p38|}}}|{{{p39|}}}|{{{p40|}}}|{{{p41|}}}|{{{p42|}}}|{{{p43|}}}|{{{p44|}}}|{{{p45|}}}|{{{p46|}}}|{{{p47|}}}|{{{p48|}}}|{{{p49|}}}|{{{p50|}}}}}
|{{#if:{{{p1|}}}|{{Collapsible list|title={{{parts|}}}|expand={{#switch:{{{parts_style|}}}|coll=|list=y|{{#if:{{{p6|}}}||y}}}}|1={{{p1|}}}|2={{{p2|}}}|3={{{p3|}}}|4={{{p4|}}}|5={{{p5|}}}|6={{{p6|}}}|7={{{p7|}}}|8={{{p8|}}}|9={{{p9|}}}|10={{{p10|}}}|11={{{p11|}}}|12={{{p12|}}}|13={{{p13|}}}|14={{{p14|}}}|15={{{p15|}}}|16={{{p16|}}}|17={{{p17|}}}|18={{{p18|}}}|19={{{p19|}}}|20={{{p20|}}}|21={{{p21|}}}|22={{{p22|}}}|23={{{p23|}}}|24={{{p24|}}}|25={{{p25|}}}|26={{{p26|}}}|27={{{p27|}}}|28={{{p28|}}}|29={{{p29|}}}|30={{{p30|}}}|31={{{p31|}}}|32={{{p32|}}}|33={{{p33|}}}|34={{{p34|}}}|35={{{p35|}}}|36={{{p36|}}}|37={{{p37|}}}|38={{{p38|}}}|39={{{p39|}}}|40={{{p40|}}}|41={{{p41|}}}|42={{{p42|}}}|43={{{p43|}}}|44={{{p44|}}}|45={{{p45|}}}|46={{{p46|}}}|47={{{p47|}}}|48={{{p48|}}}|49={{{p49|}}}|50={{{p50|}}}}}
|{{{parts}}}
}}
}} }}
<!-- ***Government type and Leader*** -->
| rowclass29 = mergedtoprow
| header29 = {{#if:{{{government_type|}}}{{{governing_body|}}}{{{leader_name|}}}{{{leader_name1|}}}{{{leader_name2|}}}{{{leader_name3|}}}{{{leader_name4|}}}|Pamarintahan<span style="font-weight:normal">{{{government_footnotes|}}}</span>}}
<!-- ***Government*** -->
| rowclass30 = mergedrow
| label30 = • Jinih
| data30 = {{{government_type|}}}
| rowclass31 = mergedrow
| label31 = • Lembaga
| class31 = agent
| data31 = {{{governing_body|}}}
| rowclass32 = mergedrow
| label32 = • {{{leader_title}}}
| data32 = {{#if:{{{leader_title|}}}|{{{leader_name|}}} {{#if:{{{leader_party|}}}|({{Polparty|{{{subdivision_name}}}|{{{leader_party}}}}})}}}}
| rowclass33 = mergedrow
| label33 = • {{{leader_title1}}}
| data33 = {{#if:{{{leader_title1|}}}|{{{leader_name1|}}}}}
| rowclass34 = mergedrow
| label34 = • {{{leader_title2}}}
| data34 = {{#if:{{{leader_title2|}}}|{{{leader_name2|}}}}}
| rowclass35 = mergedrow
| label35 = • {{{leader_title3}}}
| data35 = {{#if:{{{leader_title3|}}}|{{{leader_name3|}}}}}
| rowclass36 = mergedrow
| label36 = • {{{leader_title4}}}
| data36 = {{#if:{{{leader_title4|}}}|{{{leader_name4|}}}}}
<!-- ***Geographical characteristics*** -->
<!-- ***Luas*** -->
| rowclass37 = mergedtoprow
| header37 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_rural_sq_mi|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_km2|}}}{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_metro_sq_mi|}}}{{{area_blank1_sq_mi|}}}
|{{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|<!-- displayed below -->
|Laweh<span style="font-weight:normal">{{{area_footnotes|}}}</span>
}}
}}
| rowclass38 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}|mergedtoprow|mergedrow}}
| label38 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|Luas<span style="font-weight:normal">{{{area_footnotes|}}}</span>
| • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|Kota}}|Total}}}}
}}
| data38 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_total_km2|}}}
|ha ={{{area_total_ha|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|dunam={{{area_total_dunam|}}}
|link ={{#switch:{{{dunam_link|}}}||on|total=on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
|mag ={{{area_magnitude|}}}
}}}}
| rowclass39 = mergedrow
| label39 = • Darek
| data39 = {{#if:{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_land_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_land_km2|}}}
|ha ={{{area_land_ha|}}}
|acre ={{{area_land_acre|}}}
|sqmi ={{{area_land_sq_mi|}}}
|dunam={{{area_land_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|land|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass40 = mergedrow
| label40 = • Aia
| data40 = {{#if:{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_water_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_water_km2|}}}
|ha ={{{area_water_ha|}}}
|acre ={{{area_water_acre|}}}
|sqmi ={{{area_water_sq_mi|}}}
|dunam={{{area_water_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|water|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}} {{#if:{{{area_water_percent|}}}| {{{area_water_percent}}}%}}}}
| rowclass41 = mergedrow
| label41 = • Kota<span style="font-weight:normal">{{{area_urban_footnotes|}}}</span>
| data41 = {{#if:{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_urban_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_urban_km2|}}}
|ha ={{{area_urban_ha|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|urban|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass42 = mergedrow
| label42 = • Desa<span style="font-weight:normal">{{{area_rural_footnotes|}}}</span>
| data42 = {{#if:{{{area_rural_km2|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_sq_mi|}}}{{{area_rural_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_rural_km2|}}}
|ha ={{{area_rural_ha|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|rural|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass43 = mergedrow
| label43 = • Metro<span style="font-weight:normal">{{{area_metro_footnotes|}}}</span>
| data43 = {{#if:{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_metro_sq_mi|}}}{{{area_metro_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_metro_km2|}}}
|ha ={{{area_metro_ha|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|metro|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Area rank*** -->
| rowclass44 = mergedrow
| label44 = Paringkek laweh
| data44 = {{{area_rank|}}}
| rowclass45 = mergedrow
| label45 = • {{{area_blank1_title}}}
| data45 = {{#if:{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_blank1_sq_mi|}}}{{{area_blank1_title|}}}{{{area_blank1_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank1_km2|}}}
|ha ={{{area_blank1_ha|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank1|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass46 = mergedrow
| label46 = • {{{area_blank2_title}}}
| data46 = {{#if:{{{area_blank2_km2|}}}{{{area_blank2_ha|}}}{{{area_blank2_acre|}}}{{{area_blank2_sq_mi|}}}{{{area_blank2_title|}}}{{{area_blank2_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank2_km2|}}}
|ha ={{{area_blank2_ha|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank2|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass47 = mergedrow
| label47 =
| data47 = {{#if:{{{area_note|}}}|<small>{{{area_note}}}</small>}}
<!-- ***Dimensi*** -->
| rowclass48 = mergedtoprow
| header48 = {{#if:{{{length_km|}}}{{{length_mi|}}}{{{width_km|}}}{{{width_mi|}}}|Dimensi<span style="font-weight:normal">{{{dimensions_footnotes|}}}</span>}}
| rowclass49 = mergedrow
| label49 = • Panjang
| data49 = {{#if:{{{length_km|}}}{{{length_mi|}}}
| {{infobox_settlement/lengthdisp
|km ={{{length_km|}}}
|mi ={{{length_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass50 = mergedrow
| label50 = • Lebar
| data50 = {{#if:{{{width_km|}}}{{{width_mi|}}}
|{{infobox_settlement/lengthdisp
|km ={{{width_km|}}}
|mi ={{{width_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Katinggian*** -->
| rowclass51 = mergedtoprow
| label51 = Katinggian<span style="font-weight:normal">{{{elevation_footnotes|}}}</span>
| data51 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_m|}}}
|ft ={{{elevation_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass52 = mergedtoprow
| label52 = Titiak tatinggi<span style="font-weight:normal">{{{elevation_max_footnotes|}}}</span>
| data52 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_max_m|}}}
|ft ={{{elevation_max_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation max rank*** -->
| rowclass53 = mergedrow
| label53 = • Paringkek
| data53 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}| {{{elevation_max_rank|}}} }}
| rowclass54 = {{#if:{{{elevation_min_rank|}}}|mergedrow|mergedbottomrow}}
| label54 = Titiak tarandah<span style="font-weight:normal">{{{elevation_min_footnotes|}}}</span>
| data54 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_min_m|}}}
|ft ={{{elevation_min_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation min rank*** -->
| rowclass55 = mergedrow
| label55 = • Paringkek
| data55 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}|{{{elevation_min_rank|}}}}}
<!-- ***Penduduk*** -->
| rowclass56 = mergedtoprow
| label56 = Panduduak <span style="font-weight:normal">{{#if:{{{population_as_of|}}}|({{{population_as_of}}})}}{{{population_footnotes|}}}</span>
| data56 = {{#if:{{{population|}}}
| {{formatnum:{{{population}}}}}
| {{#ifeq:{{{total_type}}}|
| {{#if:{{{population_total|}}}
| {{formatnum:{{{population_total}}}}}
}}
}}
}}
| rowclass57 = mergedtoprow
| header57 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}{{{population_urban|}}}{{{population_rural|}}}{{{population_metro|}}}{{{population_blank1|}}}{{{population_blank2|}}}{{{population_est|}}}
|Panduduak <span style="font-weight:normal">{{#if:{{{population_as_of|}}}|({{{population_as_of}}})}}{{{population_footnotes|}}}</span>
}}
}}
}}
| rowclass58 = mergedrow
| label58 = • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|Kota}}|Total}}}}
| data58 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}
| {{formatnum:{{{population_total}}}}}
}}
}}
}}
| rowclass59 = mergedrow
| label59 = • Pakiroan <span style="font-weight:normal">({{{pop_est_as_of}}}){{{pop_est_footnotes|}}}</span>
| data59 = {{#if:{{{population_est|}}}|{{formatnum:{{{population_est}}}}} }}
<!-- ***Population rank*** -->
| rowclass60 = mergedrow
| label60 = • Paringkek
| data60 = {{{population_rank|}}}
| rowclass61 = mergedrow
| label61 = • Kapadatan
| data61 = {{#if:{{{population_density_km2|}}}{{{population_density_sq_mi|}}}{{{population_total|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_km2|}}}
|/sqmi={{{population_density_sq_mi|}}}
|pop ={{{population_total|}}}
|dunam={{{area_total_dunam|}}}
|ha ={{{area_total_ha|}}}
|km2 ={{{area_total_km2|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Population density rank*** -->
| rowclass62 = mergedrow
| label62 = • Paringkek
| data62 = {{{population_density_rank|}}}
| rowclass63 = mergedrow
| label63 = • [[Wilayah pakotaan|Kota]]<span style="font-weight:normal">{{{population_urban_footnotes|}}}</span>
| data63 = {{#if:{{{population_urban|}}}| {{formatnum:{{{population_urban}}}}} }}
| rowclass64 = mergedrow
| label64 = • Kapadatan kota
| data64 = {{#if:{{{population_density_urban_km2|}}}{{{population_density_urban_sq_mi|}}}{{{population_urban|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_urban_km2|}}}
|/sqmi={{{population_density_urban_sq_mi|}}}
|pop ={{{population_urban|}}}
|ha ={{{area_urban_ha|}}}
|km2 ={{{area_urban_km2|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass65 = mergedrow
| label65 = • [[Wilayah pakampuangan|Kampuang]]<span style="font-weight:normal">{{{population_rural_footnotes|}}}</span>
| data65 = {{#if:{{{population_rural|}}}|{{formatnum:{{{population_rural}}}}}}}
| rowclass66 = mergedrow
| label66 = • Kapadatan kampuang
| data66 = {{#if:{{{population_density_rural_km2|}}}{{{population_density_rural_sq_mi|}}}{{{population_rural|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_rural_km2|}}}
|/sqmi={{{population_density_rural_sq_mi|}}}
|pop ={{{population_rural|}}}
|ha ={{{area_rural_ha|}}}
|km2 ={{{area_rural_km2|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass67 = mergedrow
| label67 = • [[Wilayah metropolitan|Metro]]<span style="font-weight:normal">{{{population_metro_footnotes|}}}</span>
| data67 = {{#if:{{{population_metro|}}}| {{formatnum:{{{population_metro}}}}} }}
| rowclass68 = mergedrow
| label68 = • Kapadatan metro
| data68 = {{#if:{{{population_density_metro_km2|}}}{{{population_density_metro_sq_mi|}}}{{{population_metro|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_metro_km2|}}}
|/sqmi={{{population_density_metro_sq_mi|}}}
|pop ={{{population_metro|}}}
|ha ={{{area_metro_ha|}}}
|km2 ={{{area_metro_km2|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass69 = mergedrow
| label69 = • {{{population_blank1_title|}}}<span style="font-weight:normal">{{{population_blank1_footnotes|}}}</span>
| data69 = {{#if:{{{population_blank1|}}}|{{formatnum:{{{population_blank1}}}}}}}
| rowclass70 = mergedrow
| label70 = • {{#if:{{{population_blank1_title|}}}|Kapadatan {{{population_blank1_title}}}|Kapadatan}}
| data70 = {{#if:{{{population_density_blank1_km2|}}}{{{population_density_blank1_sq_mi|}}}{{{population_blank1|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank1_km2|}}}
|/sqmi={{{population_density_blank1_sq_mi|}}}
|pop ={{{population_blank1|}}}
|ha ={{{area_blank1_ha|}}}
|km2 ={{{area_blank1_km2|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass71 = mergedrow
| label71 = • {{{population_blank2_title|}}}<span style="font-weight:normal">{{{population_blank2_footnotes|}}}</span>
| data71 = {{#if:{{{population_blank2|}}}|{{formatnum:{{{population_blank2}}}}}}}
| rowclass72 = mergedrow
| label72 = • {{#if:{{{population_blank2_title|}}}|Kepadatan {{{population_blank2_title}}}|Kepadatan}}
| data72 = {{#if:{{{population_density_blank2_km2|}}}{{{population_density_blank2_sq_mi|}}}{{{population_blank2|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank2_km2|}}}
|/sqmi={{{population_density_blank2_sq_mi|}}}
|pop ={{{population_blank2|}}}
|ha ={{{area_blank2_ha|}}}
|km2 ={{{area_blank2_km2|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass73 = mergedrow
| label73 =
| data73 = {{#if:{{{population_note|}}}|<small>{{{population_note}}}</small>}}
| rowclass74 = mergedtoprow
| label74 = [[Demonim]]
| data74 = {{{population_demonym|}}}
| rowclass75 = mergedtoprow
| header75 = {{#if:{{{demographics_type1|}}}
|{{{demographics_type1}}}<span style="font-weight:normal">{{{demographics1_footnotes|}}}</span><!--
***Demographics 1***
-->{{infobox|child=yes
| rowclass1 = mergedrow
| label1 = • {{{demographics1_title1}}}
| data1 = {{#if:{{{demographics1_title1|}}}|{{{demographics1_info1}}}}}
| rowclass2 = mergedrow
| label2 = • {{{demographics1_title2}}}
| data2 = {{#if:{{{demographics1_title2|}}}|{{{demographics1_info2}}}}}
| rowclass3 = mergedrow
| label3 = • {{{demographics1_title3}}}
| data3 = {{#if:{{{demographics1_title3|}}}|{{{demographics1_info3}}}}}
| rowclass4 = mergedrow
| label4 = • {{{demographics1_title4}}}
| data4 = {{#if:{{{demographics1_title4|}}}|{{{demographics1_info4}}}}}
| rowclass5 = mergedrow
| label5 = • {{{demographics1_title5}}}
| data5 = {{#if:{{{demographics1_title5|}}}|{{{demographics1_info5}}}}}
}}}}
| rowclass76 = mergedtoprow
| header76 = {{#if:{{{demographics_type2|}}}
|{{{demographics_type2}}}<span style="font-weight:normal">{{{demographics2_footnotes|}}}</span><!--
***Demographics 2***
-->{{infobox|child=yes
| rowclass1 = mergedrow
| label1 = • {{{demographics2_title1}}}
| data1 = {{#if:{{{demographics2_title1|}}}|{{{demographics2_info1}}}}}
| rowclass2 = mergedrow
| label2 = • {{{demographics2_title2}}}
| data2 = {{#if:{{{demographics2_title2|}}}|{{{demographics2_info2}}}}}
| rowclass3 = mergedrow
| label3 = • {{{demographics2_title3}}}
| data3 = {{#if:{{{demographics2_title3|}}}|{{{demographics2_info3}}}}}
| rowclass4 = mergedrow
| label4 = • {{{demographics2_title4}}}
| data4 = {{#if:{{{demographics2_title4|}}}|{{{demographics2_info4}}}}}
| rowclass5 = mergedrow
| label5 = • {{{demographics2_title5}}}
| data5 = {{#if:{{{demographics2_title5|}}}|{{{demographics2_info5}}}}}
}}}}
<!-- ***Time Zones*** -->
| rowclass77 = mergedtoprow
| label77 = {{#if:{{{timezone2|}}}|[[Zona wakatu]]|[[Zona wakatu]]}}
| data77 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{{timezone1|{{{timezone}}}}}} {{#if:{{{utc_offset1|{{{utc_offset|}}} }}}|([[UTC{{{utc_offset1|{{{utc_offset}}}}}}]])}} }}
| rowclass78 = mergedrow
| label78 = <nowiki />
| data78 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{#if:{{{timezone2|}}}|{{{timezone2}}} {{#if:{{{utc_offset2|{{{utc_offset2|}}} }}}|([[UTC{{{utc_offset2|{{{utc_offset2}}}}}}]])}} }} }}
| rowclass79 = mergedrow
| label79 = <span style="white-space:nowrap"> • Musim paneh ([[Wakatu musim paneh|DST]])</span>
| data79 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|{{{timezone1_DST|{{{timezone_DST|}}}}}} ([[UTC{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}]])}} }}
| rowclass80 = mergedrow
| label80 = <nowiki />
| data80 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|{{#if:{{{timezone2_DST|}}}|{{{timezone2_DST}}} ([[UTC{{{utc_offset2_DST|}}}]])}} }} }}
<!-- ***Postal Code(s)*** -->
| rowclass81 = mergedtoprow
| label81 = {{{postal_code_type}}}
| class81 = adr
| data81 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|<span class="postal-code">{{{postal_code}}}</span>}}}}
| rowclass82 = mergedbottomrow
| label82 = {{{postal2_code_type}}}
| class82 = adr
| data82 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|<span class="postal-code">{{{postal2_code}}}</span>}} }} }}
<!-- ***Area Code(s)*** -->
| rowclass83 = mergedrow
| label83 = {{#if:{{{area_code_type|}}}|{{{area_code_type}}}|[[Tata panomoran telepon|Kode wilayah]]}}
| data83 = {{{area_code|}}}
<!-- Geocode-->
| rowclass84 = mergedrow
| label84 = [[Geocode]]
| class84 = nickname
| data84 = {{{geocode|}}}
<!-- ISO Code-->
| rowclass85 = mergedrow
| label85 = [[ISO 3166]]
| class85 = nickname
| data85 = {{{iso_code|}}}
<!-- Other codes -->
| rowclass86 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|mergedrow|mergedtoprow}}
| label186 = {{{code1_name|}}}
| class186 = nickname
| data186 = {{#if:{{{code1_name|}}}|{{{code1_info|}}}}}
| rowclass87 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|{{{code1_name|}}}|mergedrow|mergedtoprow}}
| label87 = {{{code2_name|}}}
| class87 = nickname
| data87 = {{#if:{{{code2_name|}}}|{{{code2_info|}}}}}
| rowclass88 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|{{{code1_name|}}}|{{{code2_name|}}}|mergedrow|mergedtoprow}}
| label88 = {{{code3_name|}}}
| class88 = nickname
| data88 = {{#if:{{{code3_name|}}}|{{{code3_info|}}}}}
<!-- Vehicle registration plate-->
| rowclass89 = mergedrow
| label89 = [[Plat registrasi kandaraan|Plat kandaraan]]
| data89 = {{{registration_plate|}}}
| rowclass90 = mergedtoprow
| header90 = {{#if:{{{twin1|}}}
|[[Daftar kota kamba|Kota kamba]]<!--
***Twin Cities***
-->{{infobox|child=yes
| rowclass1 = mergedrow
| label1 = • {{{twin1}}}
| data1 = {{#if:{{{twin1|}}}|{{{twin1_country}}}}}
| rowclass2 = mergedrow
| label2 = • {{{twin2}}}
| data2 = {{#if:{{{twin2|}}}|{{{twin2_country}}}}}
| rowclass3 = mergedrow
| label3 = • {{{twin3}}}
| data3 = {{#if:{{{twin3|}}}|{{{twin3_country}}}}}
| rowclass4 = mergedrow
| label4 = • {{{twin4}}}
| data4 = {{#if:{{{twin4|}}}|{{{twin4_country}}}}}
| rowclass5 = mergedrow
| label5 = • {{{twin5}}}
| data5 = {{#if:{{{twin5|}}}|{{{twin5_country}}}}}
| rowclass6 = mergedrow
| label6 = • {{{twin6}}}
| data6 = {{#if:{{{twin6|}}}|{{{twin6_country}}}}}
| rowclass7 = mergedrow
| label7 = • {{{twin7}}}
| data7 = {{#if:{{{twin7|}}}|{{{twin7_country}}}}}
| rowclass8 = mergedrow
| label8 = • {{{twin8}}}
| data8 = {{#if:{{{twin8|}}}|{{{twin8_country}}}}}
| rowclass9 = mergedrow
| label9 = • {{{twin9}}}
| data9 = {{#if:{{{twin9|}}}|{{{twin9_country}}}}}
}} }}
<!-- ***Blank Fields (two sections)*** -->
| rowclass91 = mergedtoprow
| label91 = {{{blank_name_sec1|{{{blank_name|}}}}}}
| data91 = {{#if:{{{blank_name_sec1|{{{blank_name|}}}}}}|{{{blank_info_sec1|{{{blank_info|}}}}}}}}
| rowclass92 = mergedrow
| label92 = {{{blank1_name_sec1|{{{blank1_name|}}}}}}
| data92 = {{#if:{{{blank1_name_sec1|{{{blank1_name|}}}}}}|{{{blank1_info_sec1|{{{blank1_info|}}}}}}}}
| rowclass93 = mergedrow
| label93 = {{{blank2_name_sec1|{{{blank2_name|}}}}}}
| data93 = {{#if:{{{blank2_name_sec1|{{{blank2_name|}}}}}}|{{{blank2_info_sec1|{{{blank2_info|}}}}}}}}
| rowclass94 = mergedrow
| label94 = {{{blank3_name_sec1|{{{blank3_name|}}}}}}
| data94 = {{#if:{{{blank3_name_sec1|{{{blank3_name|}}}}}}|{{{blank3_info_sec1|{{{blank3_info|}}}}}}}}
| rowclass95 = mergedrow
| label95 = {{{blank4_name_sec1|{{{blank4_name|}}}}}}
| data95 = {{#if:{{{blank4_name_sec1|{{{blank4_name|}}}}}}|{{{blank4_info_sec1|{{{blank4_info|}}}}}}}}
| rowclass96 = mergedrow
| label96 = {{{blank5_name_sec1|{{{blank5_name|}}}}}}
| data96 = {{#if:{{{blank5_name_sec1|{{{blank5_name|}}}}}}|{{{blank5_info_sec1|{{{blank5_info|}}}}}}}}
| rowclass97 = mergedrow
| label97 = {{{blank6_name_sec1|{{{blank6_name|}}}}}}
| data97 = {{#if:{{{blank6_name_sec1|{{{blank6_name|}}}}}}|{{{blank6_info_sec1|{{{blank6_info|}}}}}}}}
| rowclass98 = mergedrow
| label98 = {{{blank7_name_sec1|{{{blank7_name|}}}}}}
| data98 = {{#if:{{{blank7_name_sec1|{{{blank7_name|}}}}}}|{{{blank7_info_sec1|{{{blank7_info|}}}}}}}}
| rowclass99 = mergedtoprow
| label99 = {{{blank_name_sec2}}}
| data99 = {{#if:{{{blank_name_sec2|}}}|{{{blank_info_sec2|}}}}}
| rowclass100 = mergedrow
| label100 = {{{blank1_name_sec2}}}
| data100 = {{#if:{{{blank1_name_sec2|}}}|{{{blank1_info_sec2|}}}}}
| rowclass101 = mergedrow
| label101 = {{{blank2_name_sec2}}}
| data101 = {{#if:{{{blank2_name_sec2|}}}|{{{blank2_info_sec2|}}}}}
| rowclass102 = mergedrow
| label102 = {{{blank3_name_sec2}}}
| data102 = {{#if:{{{blank3_name_sec2|}}}|{{{blank3_info_sec2|}}}}}
| rowclass103 = mergedrow
| label103 = {{{blank4_name_sec2}}}
| data103 = {{#if:{{{blank4_name_sec2|}}}|{{{blank4_info_sec2|}}}}}
| rowclass104 = mergedrow
| label104 = {{{blank5_name_sec2}}}
| data104 = {{#if:{{{blank5_name_sec2|}}}|{{{blank5_info_sec2|}}}}}
| rowclass105 = mergedrow
| label105 = {{{blank6_name_sec2}}}
| data105 = {{#if:{{{blank6_name_sec2|}}}|{{{blank6_info_sec2|}}}}}
| rowclass106 = mergedrow
| label106 = {{{blank7_name_sec2}}}
| data106 = {{#if:{{{blank7_name_sec2|}}}|{{{blank7_info_sec2|}}}}}
|rowclass157 = mergedtoprow
|label157 = {{{blank_name_sec3}}}
|data157 = {{#if:{{{blank_name_sec3|}}}|{{{blank_info_sec3|}}}}}
|rowclass158 = mergedrow
|label158 = {{{blank1_name_sec3}}}
|data158 = {{#if:{{{blank1_name_sec3|}}}|{{{blank1_info_sec3|}}}}}
|rowclass159 = mergedrow
|label159 = {{{blank2_name_sec3}}}
|data159 = {{#if:{{{blank2_name_sec3|}}}|{{{blank2_info_sec3|}}}}}
|rowclass160 = mergedrow
|label160 = {{{blank3_name_sec3}}}
|data160 = {{#if:{{{blank3_name_sec3|}}}|{{{blank3_info_sec3|}}}}}
|rowclass161 = mergedrow
|label161 = {{{blank4_name_sec3}}}
|data161 = {{#if:{{{blank4_name_sec3|}}}|{{{blank4_info_sec3|}}}}}
|rowclass162 = mergedrow
|label162 = {{{blank5_name_sec3}}}
|data162 = {{#if:{{{blank5_name_sec3|}}}|{{{blank5_info_sec3|}}}}}
|rowclass163 = mergedrow
|label163 = {{{blank6_name_sec3}}}
|data163 = {{#if:{{{blank6_name_sec3|}}}|{{{blank6_info_sec3|}}}}}
|rowclass164 = mergedrow
|label164 = {{{blank7_name_sec3}}}
|data164 = {{#if:{{{blank7_name_sec3|}}}|{{{blank7_info_sec3|}}}}}
<!-- ***Website*** -->
| rowclass200 = mergedtoprow
| label200 = Situs web
| data200 = {{#if:{{{website|}}}|{{{website}}}}}
<!-- ***Footnotes*** -->
| belowstyle = text-align:left; font-size:smaller
| belowrowclass = mergedtoprow
| below = {{{footnotes|}}}
}}<!--For deprecated parameter names--><includeonly>{{#ifeq:{{{coor_type|♠}}}{{{city_logo|♠}}}{{{area_total|♠}}}{{{area_land|♠}}}{{{area_water|♠}}}{{{TotalArea_sq_mi|♠}}}{{{LandArea_sq_mi|♠}}}{{{WaterArea_sq_mi|♠}}}{{{area_urban|♠}}}{{{UrbanArea_sq_mi|♠}}}{{{area_metro|♠}}}{{{MetroArea_sq_mi|♠}}}{{{elevation|♠}}}{{{population_density|♠}}}{{{population_density_mi2|♠}}}{{{population_density_metro_mi2|♠}}}{{{population_density_urban_mi2|♠}}}|♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠||}}{{#switch:{{{coordinates_region|}}}|CA-X|US-X|IN-X=}}{{#if:{{{image_dot_map|}}}{{{dot_mapsize|}}}{{{dot_map_base_alt|}}}{{{dot_map_alt|}}}{{{dot_map_caption|}}}{{{dot_x|}}}{{{dot_y|}}}
|
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
2xfth5p9aohu8o6gcu4je8c4dyhbpp4
2444343
2444342
2022-08-14T11:40:09Z
Fexpr
7716
wikitext
text/x-wiki
{{infobox
| bodyclass = geography vcard
| bodystyle = width:23em
| headerstyle = text-align:left
| abovestyle = font-size:1.25em; white-space:nowrap
| above = <span class="fn org">{{#if:{{{name|}}}|{{{name}}}|{{#if:{{{official_name|}}}|{{{official_name}}}|{{PAGENAME}}}}}}</span>{{#if:{{{native_name|}}}|<br /><span class="nickname" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</span>}}{{#if:{{{other_name|}}}|<br /><span class="nickname" style="font-size:78%">{{{other_name}}}</span>}}<!--
** names, type, and transliterations **
-->{{infobox|child=yes|decat=yes<!-- Remove from [[Category:Articles which use infobox templates with no data rows]] -->
| subheaderstyle = background-color:#cddeff; font-weight:bold;
| subheader = {{#if:{{{subheader|}}}|{{{subheader}}}|{{#if:{{both|{{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}{{#ifeq:{{yesno|{{{embed|}}}}}|yes|1}}|{{{settlement_type|{{{type|}}}}}}}}|<div class="category">{{{settlement_type|{{{type}}}}}}</div>}}}}
| rowclass1 = mergedtoprow
| header1 = {{#if:{{{name|}}}|{{{official_name|}}}}}
| rowclass2 = mergedtoprow
| header2 = {{#if:{{{translit_lang1|}}}|Transkripsi {{{translit_lang1}}}<!--
***Transliteration language 1***
-->{{infobox|child=yes
|rowclass1 = {{#if:{{{translit_lang1_type1|}}}|mergedrow|mergedbottomrow}}
|label1 = • {{{translit_lang1_type}}}
|data1 = {{#if:{{{translit_lang1_type|}}}|{{{translit_lang1_info|}}}}}
|rowclass2 = {{#if:{{{translit_lang1_type2|}}}|mergedrow|mergedbottomrow}}
|label2 = • {{{translit_lang1_type1}}}
|data2 = {{#if:{{{translit_lang1_type1|}}}|{{{translit_lang1_info1|}}}}}
|rowclass3 = {{#if:{{{translit_lang1_type3|}}}|mergedrow|mergedbottomrow}}
|label3 = • {{{translit_lang1_type2}}}
|data3 = {{#if:{{{translit_lang1_type2|}}}|{{{translit_lang1_info2|}}}}}
|rowclass4 = {{#if:{{{translit_lang1_type4|}}}|mergedrow|mergedbottomrow}}
|label4 = • {{{translit_lang1_type3}}}
|data4 = {{#if:{{{translit_lang1_type3|}}}|{{{translit_lang1_info3|}}}}}
|rowclass5 = {{#if:{{{translit_lang1_type5|}}}|mergedrow|mergedbottomrow}}
|label5 = • {{{translit_lang1_type4}}}
|data5 = {{#if:{{{translit_lang1_type4|}}}|{{{translit_lang1_info4|}}}}}
|rowclass6 = {{#if:{{{translit_lang1_type6|}}}|mergedrow|mergedbottomrow}}
|label6 = • {{{translit_lang1_type5}}}
|data6 = {{#if:{{{translit_lang1_type5|}}}|{{{translit_lang1_info5|}}}}}
|rowclass7 = mergedbottomrow
|label7 = • {{{translit_lang1_type6}}}
|data7 = {{#if:{{{translit_lang1_type6|}}}|{{{translit_lang1_info6|}}} }}
}} }}
| rowclass3 = mergedtoprow
| header3 = {{#if:{{{translit_lang2|}}}|Transkripsi {{{translit_lang2}}}<!--
***Transliteration language 2***
-->{{infobox|child=yes
|rowclass1 = {{#if:{{{translit_lang2_type1|}}}|mergedrow|mergedbottomrow}}
|label1 = • {{{translit_lang2_type}}}
|data1 = {{#if:{{{translit_lang2_type|}}}|{{{translit_lang2_info|}}}}}
|rowclass2 = {{#if:{{{translit_lang2_type2|}}}|mergedrow|mergedbottomrow}}
|label2 = • {{{translit_lang2_type1}}}
|data2 = {{#if:{{{translit_lang2_type1|}}}|{{{translit_lang2_info1|}}}}}
|rowclass3 = {{#if:{{{translit_lang2_type3|}}}|mergedrow|mergedbottomrow}}
|label3 = • {{{translit_lang2_type2}}}
|data3 = {{#if:{{{translit_lang2_type2|}}}|{{{translit_lang2_info2|}}}}}
|rowclass4 = {{#if:{{{translit_lang2_type4|}}}|mergedrow|mergedbottomrow}}
|label4 = • {{{translit_lang2_type3}}}
|data4 = {{#if:{{{translit_lang2_type3|}}}|{{{translit_lang2_info3|}}}}}
|rowclass5 = {{#if:{{{translit_lang2_type5|}}}|mergedrow|mergedbottomrow}}
|label5 = • {{{translit_lang2_type4}}}
|data5 = {{#if:{{{translit_lang2_type4|}}}|{{{translit_lang2_info4|}}}}}
|rowclass6 = {{#if:{{{translit_lang2_type6|}}}|mergedrow|mergedbottomrow}}
|label6 = • {{{translit_lang2_type5}}}
|data6 = {{#if:{{{translit_lang2_type5|}}}|{{{translit_lang2_info5|}}}}}
|rowclass7 = mergedbottomrow
|label7 = • {{{translit_lang2_type6}}}
|data7 = {{#if:{{{translit_lang2_type6|}}}|{{{translit_lang2_info6|}}} }}
}} }}
}}<!-- end ** names, type, and transliterations ** -->
<!-- ***Skyline Image*** -->
| imagestyle = padding:0.7em 0.8em
| image = {{#if:{{{image_skyline|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_skyline}}}|size={{{imagesize|}}}|sizedefault=250px|alt={{{image_alt|}}}|title={{{image_caption|Kaki langit {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{image_caption|}}}|<br /><small>{{{image_caption}}}</small>}}}}
<!-- ***Other Image*** -->
| image2 = {{{image|}}}
<!-- ***Flag, Seal, Shield and Coat of arms*** -->
| rowclass1 = mergedtoprow
| class1 = maptable
| data1 = {{#if:{{{image_flag|}}}{{{image_seal|}}}{{{image_shield|}}}{{{image_blank_emblem|}}}{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}
|{{Infobox settlement/columns
| 1 = {{#if:{{{image_flag|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_flag}}}|size={{{flag_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|border={{yesno |{{{flag_border|}}}|yes=yes|blank=yes}}|alt={{{flag_alt|}}}|title=Bandera {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>'''{{Infobox settlement/link|type=Bendera|link={{{flag_link|}}}|name={{{official_name}}}}}'''</small>}}
| 2 = {{#if:{{{image_seal|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_seal|}}}|size={{{seal_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|alt={{{seal_alt|}}}|title=Lambang rasmi {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>'''{{Infobox settlement/link|type={{#if:{{{seal_type|}}}|{{{seal_type}}}|Lambang}}|link={{{seal_link|}}}|name={{{official_name}}}}}'''</small>}}
| 3 = {{#if:{{{image_shield|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_shield|}}}||size={{{shield_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|alt={{{shield_alt|}}}|title=Lambang {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>'''{{Infobox settlement/link|type=Lambang|link={{{shield_link|}}}|name={{{official_name}}}}}'''</small>}}
| 4 = {{#if:{{{image_blank_emblem|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_blank_emblem|}}}|size={{{blank_emblem_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|alt={{{blank_emblem_alt|}}}|title=Logo rasmi {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>'''{{Infobox settlement/link|type={{#if:{{{blank_emblem_type|}}}|{{{blank_emblem_type}}}|Logo}}|link={{{blank_emblem_link|}}}|name={{{official_name}}}}}'''</small>}}
| 5 = {{#if:{{{image_map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=100x100px|alt={{{map_alt|}}}|title={{{map_caption|Lokasi {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<div class="ib-settlement-caption-link">{{{map_caption}}}</div>}}}}
| 0 = {{#if:{{{pushpin_map_narrow|}}}|{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|{{{pushpin_map_caption}}}|{{#if:{{{map_caption|}}}|{{{map_caption}}}}}}}}}
|float = center
|width = {{#if:{{{pushpin_mapsize|}}}|{{{pushpin_mapsize}}}|150}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
}} }}
<!-- ***Nickname*** -->
| rowclass2 = mergedrow
| data2 = {{#if:{{{nickname|}}}|Julukan: <span class="nickname">{{{nickname}}}</span>}}
<!-- ***Motto*** -->
| rowclass3 = mergedrow
| data3 = {{#if:{{{motto|}}}|Semboyan: {{{motto}}} }}
<!-- ***Anthem*** -->
| rowclass4 = mergedrow
| data4 = {{#if:{{{anthem|}}}|Lagu: {{{anthem}}} }}
<!-- ***Map*** -->
| rowclass5 = mergedrow
| data5 = {{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}||{{#if:{{{image_map|}}}
|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=250px|alt={{{map_alt|}}}|title={{{map_caption|Lokasi {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<br /><small>{{{map_caption}}}</small>}}
}}}}
| rowclass6 = mergedrow
| data6 = {{#if:{{{image_map1|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map1}}}|size={{{mapsize1|}}}|sizedefault=250px|alt={{{map_alt1|}}}|title={{{map_caption1|Lokasi {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption1|}}}|<br /><small>{{{map_caption1}}}</small>}} }}
<!--***Dot Map*** -->
| rowclass7 = mergedrow
| data7 = {{#if:{{{image_dot_map|}}}
|<div class="center">{{superimpose
|base = {{{image_dot_map|}}}
|base_width = {{{{{|safesubst:}}}#if:{{{dot_mapsize|}}}
|{{{dot_mapsize}}}{{#iferror:{{#expr:{{{dot_mapsize}}}>0}}||px}}
|180px}}
|base_alt = {{{dot_map_base_alt|}}}
|base_caption = {{#if:{{{official_name|}}}|{{{official_name|}}}|{{{name}}}}}
|float = Red pog.svg
|float_width = 6px
|float_alt = {{{dot_map_alt|}}}
|float_caption = {{{dot_map_caption|}}}
|x = {{{dot_x|}}}
|y = {{{dot_y|}}}
}}{{#if:{{{dot_map_caption|}}}|<small>{{{dot_map_caption}}}</small>}}</div>
}}
<!-- ***Pushpin Map*** -->
| rowclass8 = mergedtoprow
| data8 = {{#if:{{{pushpin_map_narrow|}}}||{{#if:{{both| {{{pushpin_map|}}} | {{both|{{{latd|}}}|{{{longd|}}}}} }}|
{{location map|{{{pushpin_map|}}}
|border = none
|alt = {{{pushpin_map_alt|}}}
|caption =
|float = center
|width = {{{pushpin_mapsize|}}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|lat = {{#if:{{{latm|}}}{{{latNS|}}}| |{{{latd|}}} }}
|long = {{#if:{{{longm|}}}{{{longEW|}}}| |{{{longd|}}} }}
|lat_deg={{#if:{{{latm|}}}{{{latNS|}}}|{{{latd|}}} }}
|lat_min={{#if:{{{latm|}}}{{{latNS|}}}|{{{latm|}}} }}
|lat_sec={{#if:{{{lats|}}}{{{latNS|}}}|{{{lats|}}} }}
|lat_dir={{{latNS|}}}
|lon_deg={{#if:{{{longm|}}}{{{longEW|}}}|{{{longd|}}} }}
|lon_min={{#if:{{{longm|}}}{{{longEW|}}}|{{{longm|}}} }}
|lon_sec={{#if:{{{longs|}}}{{{longEW|}}}|{{{longs|}}} }}
|lon_dir={{{longEW|}}}
|marksize =6
|position = {{{pushpin_label_position|}}}
}}{{#if:{{{pushpin_map_caption|}}}|<small>{{{pushpin_map_caption}}}</small>|{{#if:{{{map_caption|}}}|<small>{{{map_caption}}}</small>}}}}
}} }}
| rowclass9 = mergedrow
| data9 = {{#if:{{both|{{{pushpin_map1|}}}|{{both|{{{latd|}}}|{{{longd|}}}}}}}|
{{location map|{{{pushpin_map1|}}}
|border = none
|alt = {{{pushpin_map_alt1|}}}
|caption =
|float = center
|width = {{{pushpin_mapsize1|}}}
|default_width = 250
|relief= {{{pushpin_relief1|}}}
|AlternativeMap = {{{pushpin_image1|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position1|}}} }} | none | | {{#if:{{{pushpin_label1|}}}|{{{pushpin_label1}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|lat = {{#if:{{{latm|}}}{{{latNS|}}}| |{{{latd|}}} }}
|long = {{#if:{{{longm|}}}{{{longEW|}}}| |{{{longd|}}} }}
|lat_deg={{#if:{{{latm|}}}{{{latNS|}}}|{{{latd|}}} }}
|lat_min={{#if:{{{latm|}}}{{{latNS|}}}|{{{latm|}}} }}
|lat_sec={{#if:{{{lats|}}}{{{latNS|}}}|{{{lats|}}} }}
|lat_dir={{{latNS|}}}
|lon_deg={{#if:{{{longm|}}}{{{longEW|}}}|{{{longd|}}} }}
|lon_min={{#if:{{{longm|}}}{{{longEW|}}}|{{{longm|}}} }}
|lon_sec={{#if:{{{longs|}}}{{{longEW|}}}|{{{longs|}}} }}
|lon_dir={{{longEW|}}}
|marksize =6
|position = {{{pushpin_label_position1|}}}
}}{{#if:{{{pushpin_map_caption1|}}}|<small>{{{pushpin_map_caption1|}}}</small>|{{#if:{{{map_caption|}}}|<small>{{{map_caption}}}</small>}}}}
}}
<!-- ***Coordinates*** -->
| rowclass10 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{image_dot_map|}}}{{{pushpin_map|}}}{{{pushpin_map1|}}}|mergedbottomrow}}
| data10 = {{#if:{{both|{{{latd|}}}|{{{longd|}}}}}
|Koordinat{{#if:{{{coor_pinpoint|{{{coor_type|}}}}}}| ({{{coor_pinpoint|{{{coor_type|}}}}}})|}}: {{Geobox coor|{{{latd|}}}|{{{latm|}}}|{{{lats|}}}|{{{latNS|}}}|{{{longd|}}}|{{{longm|}}}|{{{longs|}}}|{{{longEW|}}}|{{#if:{{{coordinates_type|}}}|{{{coordinates_type}}}|type:city{{#if:{{{population_total|}}}|{{#iferror:{{#expr:{{formatnum:{{{population_total}}}|R}}+1}}||({{formatnum:{{{population_total}}}|R}})}}|}}{{#if:{{{coordinates_region|}}}|_region:{{{coordinates_region}}}|{{#if:{{{subdivision_name|}}}|_region:{{CountryAbbr|{{{subdivision_name|}}}|{{{subdivision_name1|}}} }} }} }} }}|{{#ifeq:{{{coordinates_display|}}}|inline|{{#if:{{{coordinates_display|}}}|title|μ}}}}={{{coordinates_display|}}}|{{#if:{{{coordinates_format|}}}|format|μ}}={{{coordinates_format|}}}}}{{{coordinates_footnotes|}}}
}}
<!-- ***Subdivisions*** -->
| rowclass11 = mergedtoprow
| label11 = {{{subdivision_type}}}
| data11 = {{#if:{{{subdivision_type|}}}|{{{subdivision_name|}}} }}
| rowclass12 = mergedrow
| label12 = {{{subdivision_type1}}}
| data12 = {{#if:{{{subdivision_type1|}}}|{{{subdivision_name1|}}} }}
| rowclass13 = mergedrow
| label13 = {{{subdivision_type2}}}
| data13 = {{#if:{{{subdivision_type2|}}}|{{{subdivision_name2|}}} }}
| rowclass14 = mergedrow
| label14 = {{{subdivision_type3}}}
| data14 = {{#if:{{{subdivision_type3|}}}|{{{subdivision_name3|}}} }}
| rowclass15 = mergedrow
| label15 = {{{subdivision_type4}}}
| data15 = {{#if:{{{subdivision_type4|}}}|{{{subdivision_name4|}}} }}
| rowclass16 = mergedrow
| label16 = {{{subdivision_type5}}}
| data16 = {{#if:{{{subdivision_type5|}}}|{{{subdivision_name5|}}} }}
| rowclass17 = mergedrow
| label17 = {{{subdivision_type6}}}
| data17 = {{#if:{{{subdivision_type6|}}}|{{{subdivision_name6|}}} }}
<!--***Established*** -->
| rowclass18 = mergedtoprow
| label18 = {{{established_title}}}
| data18 = {{#if:{{{established_title|}}}|{{{established_date|}}} }}
| rowclass19 = mergedrow
| label19 = {{{established_title1}}}
| data19 = {{#if:{{{established_title1|}}}|{{{established_date1|}}} }}
| rowclass20 = mergedrow
| label20 = {{{established_title2}}}
| data20 = {{#if:{{{established_title2|}}}|{{{established_date2|}}} }}
| rowclass21 = mergedrow
| label21 = {{{established_title3}}}
| data21 = {{#if:{{{established_title3|}}}|{{{established_date3|}}} }}
| rowclass22 = mergedrow
| label22 = {{{established_title4}}}
| data22 = {{#if:{{{established_title4|}}}|{{{established_date4|}}} }}
| rowclass23 = mergedrow
| label23 = {{{extinct_title}}}
| data23 = {{#if:{{{extinct_title|}}}|{{{extinct_date|}}} }}
| rowclass24 = mergedrow
| label24 = Pandiri
| data24 = {{{founder|}}}
| rowclass25 = mergedrow
| label25 = [[Penyematan nama|Asal nama]]
| data25 = {{{named_for|}}}
<!-- ***Seat of government and subdivisions within the settlement*** -->
| rowclass26 = mergedtoprow
| label26 = {{#if:{{{seat_type|}}}|{{{seat_type}}}|Ibu kota}}
| data26 = {{{seat|}}}
| rowclass27 = mergedrow
| label27 = {{#if:{{{seat1_type|}}}|{{{seat1_type}}}|Bakeh ibu kota}}
| data27 = {{{seat1|}}}
| rowclass28 = {{#if:{{{seat|}}}{{{seat1|}}}|mergedrow|mergedtoprow}}
| label28 = {{#if:{{{parts_type|}}}|{{{parts_type}}}|[[Borough]]}}
| data28 = {{#if:{{{parts|}}}{{{p1|}}}
|{{#ifeq:{{{parts_style|}}}|para
|<b>{{{parts|}}}{{#if:{{both|{{{parts|}}}|{{{p1|}}}}}|: |}}</b>{{comma separated entries|{{{p1|}}}|{{{p2|}}}|{{{p3|}}}|{{{p4|}}}|{{{p5|}}}|{{{p6|}}}|{{{p7|}}}|{{{p8|}}}|{{{p9|}}}|{{{p10|}}}|{{{p11|}}}|{{{p12|}}}|{{{p13|}}}|{{{p14|}}}|{{{p15|}}}|{{{p16|}}}|{{{p17|}}}|{{{p18|}}}|{{{p19|}}}|{{{p20|}}}|{{{p21|}}}|{{{p22|}}}|{{{p23|}}}|{{{p24|}}}|{{{p25|}}}|{{{p26|}}}|{{{p27|}}}|{{{p28|}}}|{{{p29|}}}|{{{p30|}}}|{{{p31|}}}|{{{p32|}}}|{{{p33|}}}|{{{p34|}}}|{{{p35|}}}|{{{p36|}}}|{{{p37|}}}|{{{p38|}}}|{{{p39|}}}|{{{p40|}}}|{{{p41|}}}|{{{p42|}}}|{{{p43|}}}|{{{p44|}}}|{{{p45|}}}|{{{p46|}}}|{{{p47|}}}|{{{p48|}}}|{{{p49|}}}|{{{p50|}}}}}
|{{#if:{{{p1|}}}|{{Collapsible list|title={{{parts|}}}|expand={{#switch:{{{parts_style|}}}|coll=|list=y|{{#if:{{{p6|}}}||y}}}}|1={{{p1|}}}|2={{{p2|}}}|3={{{p3|}}}|4={{{p4|}}}|5={{{p5|}}}|6={{{p6|}}}|7={{{p7|}}}|8={{{p8|}}}|9={{{p9|}}}|10={{{p10|}}}|11={{{p11|}}}|12={{{p12|}}}|13={{{p13|}}}|14={{{p14|}}}|15={{{p15|}}}|16={{{p16|}}}|17={{{p17|}}}|18={{{p18|}}}|19={{{p19|}}}|20={{{p20|}}}|21={{{p21|}}}|22={{{p22|}}}|23={{{p23|}}}|24={{{p24|}}}|25={{{p25|}}}|26={{{p26|}}}|27={{{p27|}}}|28={{{p28|}}}|29={{{p29|}}}|30={{{p30|}}}|31={{{p31|}}}|32={{{p32|}}}|33={{{p33|}}}|34={{{p34|}}}|35={{{p35|}}}|36={{{p36|}}}|37={{{p37|}}}|38={{{p38|}}}|39={{{p39|}}}|40={{{p40|}}}|41={{{p41|}}}|42={{{p42|}}}|43={{{p43|}}}|44={{{p44|}}}|45={{{p45|}}}|46={{{p46|}}}|47={{{p47|}}}|48={{{p48|}}}|49={{{p49|}}}|50={{{p50|}}}}}
|{{{parts}}}
}}
}} }}
<!-- ***Government type and Leader*** -->
| rowclass29 = mergedtoprow
| header29 = {{#if:{{{government_type|}}}{{{governing_body|}}}{{{leader_name|}}}{{{leader_name1|}}}{{{leader_name2|}}}{{{leader_name3|}}}{{{leader_name4|}}}|Pamarintahan<span style="font-weight:normal">{{{government_footnotes|}}}</span>}}
<!-- ***Government*** -->
| rowclass30 = mergedrow
| label30 = • Jinih
| data30 = {{{government_type|}}}
| rowclass31 = mergedrow
| label31 = • Lembaga
| class31 = agent
| data31 = {{{governing_body|}}}
| rowclass32 = mergedrow
| label32 = • {{{leader_title}}}
| data32 = {{#if:{{{leader_title|}}}|{{{leader_name|}}} {{#if:{{{leader_party|}}}|({{Polparty|{{{subdivision_name}}}|{{{leader_party}}}}})}}}}
| rowclass33 = mergedrow
| label33 = • {{{leader_title1}}}
| data33 = {{#if:{{{leader_title1|}}}|{{{leader_name1|}}}}}
| rowclass34 = mergedrow
| label34 = • {{{leader_title2}}}
| data34 = {{#if:{{{leader_title2|}}}|{{{leader_name2|}}}}}
| rowclass35 = mergedrow
| label35 = • {{{leader_title3}}}
| data35 = {{#if:{{{leader_title3|}}}|{{{leader_name3|}}}}}
| rowclass36 = mergedrow
| label36 = • {{{leader_title4}}}
| data36 = {{#if:{{{leader_title4|}}}|{{{leader_name4|}}}}}
<!-- ***Geographical characteristics*** -->
<!-- ***Luas*** -->
| rowclass37 = mergedtoprow
| header37 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_rural_sq_mi|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_km2|}}}{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_metro_sq_mi|}}}{{{area_blank1_sq_mi|}}}
|{{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|<!-- displayed below -->
|Laweh<span style="font-weight:normal">{{{area_footnotes|}}}</span>
}}
}}
| rowclass38 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}|mergedtoprow|mergedrow}}
| label38 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|Luas<span style="font-weight:normal">{{{area_footnotes|}}}</span>
| • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|Kota}}|Total}}}}
}}
| data38 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_total_km2|}}}
|ha ={{{area_total_ha|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|dunam={{{area_total_dunam|}}}
|link ={{#switch:{{{dunam_link|}}}||on|total=on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
|mag ={{{area_magnitude|}}}
}}}}
| rowclass39 = mergedrow
| label39 = • Darek
| data39 = {{#if:{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_land_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_land_km2|}}}
|ha ={{{area_land_ha|}}}
|acre ={{{area_land_acre|}}}
|sqmi ={{{area_land_sq_mi|}}}
|dunam={{{area_land_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|land|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass40 = mergedrow
| label40 = • Aia
| data40 = {{#if:{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_water_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_water_km2|}}}
|ha ={{{area_water_ha|}}}
|acre ={{{area_water_acre|}}}
|sqmi ={{{area_water_sq_mi|}}}
|dunam={{{area_water_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|water|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}} {{#if:{{{area_water_percent|}}}| {{{area_water_percent}}}%}}}}
| rowclass41 = mergedrow
| label41 = • Kota<span style="font-weight:normal">{{{area_urban_footnotes|}}}</span>
| data41 = {{#if:{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_urban_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_urban_km2|}}}
|ha ={{{area_urban_ha|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|urban|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass42 = mergedrow
| label42 = • Desa<span style="font-weight:normal">{{{area_rural_footnotes|}}}</span>
| data42 = {{#if:{{{area_rural_km2|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_sq_mi|}}}{{{area_rural_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_rural_km2|}}}
|ha ={{{area_rural_ha|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|rural|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass43 = mergedrow
| label43 = • Metro<span style="font-weight:normal">{{{area_metro_footnotes|}}}</span>
| data43 = {{#if:{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_metro_sq_mi|}}}{{{area_metro_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_metro_km2|}}}
|ha ={{{area_metro_ha|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|metro|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Area rank*** -->
| rowclass44 = mergedrow
| label44 = Paringkek laweh
| data44 = {{{area_rank|}}}
| rowclass45 = mergedrow
| label45 = • {{{area_blank1_title}}}
| data45 = {{#if:{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_blank1_sq_mi|}}}{{{area_blank1_title|}}}{{{area_blank1_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank1_km2|}}}
|ha ={{{area_blank1_ha|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank1|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass46 = mergedrow
| label46 = • {{{area_blank2_title}}}
| data46 = {{#if:{{{area_blank2_km2|}}}{{{area_blank2_ha|}}}{{{area_blank2_acre|}}}{{{area_blank2_sq_mi|}}}{{{area_blank2_title|}}}{{{area_blank2_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank2_km2|}}}
|ha ={{{area_blank2_ha|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank2|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass47 = mergedrow
| label47 =
| data47 = {{#if:{{{area_note|}}}|<small>{{{area_note}}}</small>}}
<!-- ***Dimensi*** -->
| rowclass48 = mergedtoprow
| header48 = {{#if:{{{length_km|}}}{{{length_mi|}}}{{{width_km|}}}{{{width_mi|}}}|Dimensi<span style="font-weight:normal">{{{dimensions_footnotes|}}}</span>}}
| rowclass49 = mergedrow
| label49 = • Panjang
| data49 = {{#if:{{{length_km|}}}{{{length_mi|}}}
| {{infobox_settlement/lengthdisp
|km ={{{length_km|}}}
|mi ={{{length_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass50 = mergedrow
| label50 = • Lebar
| data50 = {{#if:{{{width_km|}}}{{{width_mi|}}}
|{{infobox_settlement/lengthdisp
|km ={{{width_km|}}}
|mi ={{{width_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Katinggian*** -->
| rowclass51 = mergedtoprow
| label51 = Katinggian<span style="font-weight:normal">{{{elevation_footnotes|}}}</span>
| data51 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_m|}}}
|ft ={{{elevation_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass52 = mergedtoprow
| label52 = Titiak tatinggi<span style="font-weight:normal">{{{elevation_max_footnotes|}}}</span>
| data52 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_max_m|}}}
|ft ={{{elevation_max_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation max rank*** -->
| rowclass53 = mergedrow
| label53 = • Paringkek
| data53 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}| {{{elevation_max_rank|}}} }}
| rowclass54 = {{#if:{{{elevation_min_rank|}}}|mergedrow|mergedbottomrow}}
| label54 = Titiak tarandah<span style="font-weight:normal">{{{elevation_min_footnotes|}}}</span>
| data54 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_min_m|}}}
|ft ={{{elevation_min_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation min rank*** -->
| rowclass55 = mergedrow
| label55 = • Paringkek
| data55 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}|{{{elevation_min_rank|}}}}}
<!-- ***Penduduk*** -->
| rowclass56 = mergedtoprow
| label56 = Panduduak <span style="font-weight:normal">{{#if:{{{population_as_of|}}}|({{{population_as_of}}})}}{{{population_footnotes|}}}</span>
| data56 = {{#if:{{{population|}}}
| {{formatnum:{{{population}}}}}
| {{#ifeq:{{{total_type}}}|
| {{#if:{{{population_total|}}}
| {{formatnum:{{{population_total}}}}}
}}
}}
}}
| rowclass57 = mergedtoprow
| header57 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}{{{population_urban|}}}{{{population_rural|}}}{{{population_metro|}}}{{{population_blank1|}}}{{{population_blank2|}}}{{{population_est|}}}
|Panduduak <span style="font-weight:normal">{{#if:{{{population_as_of|}}}|({{{population_as_of}}})}}{{{population_footnotes|}}}</span>
}}
}}
}}
| rowclass58 = mergedrow
| label58 = • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|Kota}}|Total}}}}
| data58 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}
| {{formatnum:{{{population_total}}}}}
}}
}}
}}
| rowclass59 = mergedrow
| label59 = • Pakiroan <span style="font-weight:normal">({{{pop_est_as_of}}}){{{pop_est_footnotes|}}}</span>
| data59 = {{#if:{{{population_est|}}}|{{formatnum:{{{population_est}}}}} }}
<!-- ***Population rank*** -->
| rowclass60 = mergedrow
| label60 = • Paringkek
| data60 = {{{population_rank|}}}
| rowclass61 = mergedrow
| label61 = • Kapadatan
| data61 = {{#if:{{{population_density_km2|}}}{{{population_density_sq_mi|}}}{{{population_total|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_km2|}}}
|/sqmi={{{population_density_sq_mi|}}}
|pop ={{{population_total|}}}
|dunam={{{area_total_dunam|}}}
|ha ={{{area_total_ha|}}}
|km2 ={{{area_total_km2|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Population density rank*** -->
| rowclass62 = mergedrow
| label62 = • Paringkek
| data62 = {{{population_density_rank|}}}
| rowclass63 = mergedrow
| label63 = • [[Wilayah pakotaan|Kota]]<span style="font-weight:normal">{{{population_urban_footnotes|}}}</span>
| data63 = {{#if:{{{population_urban|}}}| {{formatnum:{{{population_urban}}}}} }}
| rowclass64 = mergedrow
| label64 = • Kapadatan kota
| data64 = {{#if:{{{population_density_urban_km2|}}}{{{population_density_urban_sq_mi|}}}{{{population_urban|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_urban_km2|}}}
|/sqmi={{{population_density_urban_sq_mi|}}}
|pop ={{{population_urban|}}}
|ha ={{{area_urban_ha|}}}
|km2 ={{{area_urban_km2|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass65 = mergedrow
| label65 = • [[Wilayah pakampuangan|Kampuang]]<span style="font-weight:normal">{{{population_rural_footnotes|}}}</span>
| data65 = {{#if:{{{population_rural|}}}|{{formatnum:{{{population_rural}}}}}}}
| rowclass66 = mergedrow
| label66 = • Kapadatan kampuang
| data66 = {{#if:{{{population_density_rural_km2|}}}{{{population_density_rural_sq_mi|}}}{{{population_rural|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_rural_km2|}}}
|/sqmi={{{population_density_rural_sq_mi|}}}
|pop ={{{population_rural|}}}
|ha ={{{area_rural_ha|}}}
|km2 ={{{area_rural_km2|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass67 = mergedrow
| label67 = • [[Wilayah metropolitan|Metro]]<span style="font-weight:normal">{{{population_metro_footnotes|}}}</span>
| data67 = {{#if:{{{population_metro|}}}| {{formatnum:{{{population_metro}}}}} }}
| rowclass68 = mergedrow
| label68 = • Kapadatan metro
| data68 = {{#if:{{{population_density_metro_km2|}}}{{{population_density_metro_sq_mi|}}}{{{population_metro|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_metro_km2|}}}
|/sqmi={{{population_density_metro_sq_mi|}}}
|pop ={{{population_metro|}}}
|ha ={{{area_metro_ha|}}}
|km2 ={{{area_metro_km2|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass69 = mergedrow
| label69 = • {{{population_blank1_title|}}}<span style="font-weight:normal">{{{population_blank1_footnotes|}}}</span>
| data69 = {{#if:{{{population_blank1|}}}|{{formatnum:{{{population_blank1}}}}}}}
| rowclass70 = mergedrow
| label70 = • {{#if:{{{population_blank1_title|}}}|Kapadatan {{{population_blank1_title}}}|Kapadatan}}
| data70 = {{#if:{{{population_density_blank1_km2|}}}{{{population_density_blank1_sq_mi|}}}{{{population_blank1|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank1_km2|}}}
|/sqmi={{{population_density_blank1_sq_mi|}}}
|pop ={{{population_blank1|}}}
|ha ={{{area_blank1_ha|}}}
|km2 ={{{area_blank1_km2|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass71 = mergedrow
| label71 = • {{{population_blank2_title|}}}<span style="font-weight:normal">{{{population_blank2_footnotes|}}}</span>
| data71 = {{#if:{{{population_blank2|}}}|{{formatnum:{{{population_blank2}}}}}}}
| rowclass72 = mergedrow
| label72 = • {{#if:{{{population_blank2_title|}}}|Kepadatan {{{population_blank2_title}}}|Kepadatan}}
| data72 = {{#if:{{{population_density_blank2_km2|}}}{{{population_density_blank2_sq_mi|}}}{{{population_blank2|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank2_km2|}}}
|/sqmi={{{population_density_blank2_sq_mi|}}}
|pop ={{{population_blank2|}}}
|ha ={{{area_blank2_ha|}}}
|km2 ={{{area_blank2_km2|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass73 = mergedrow
| label73 =
| data73 = {{#if:{{{population_note|}}}|<small>{{{population_note}}}</small>}}
| rowclass74 = mergedtoprow
| label74 = [[Demonim]]
| data74 = {{{population_demonym|}}}
| rowclass75 = mergedtoprow
| header75 = {{#if:{{{demographics_type1|}}}
|{{{demographics_type1}}}<span style="font-weight:normal">{{{demographics1_footnotes|}}}</span><!--
***Demographics 1***
-->{{infobox|child=yes
| rowclass1 = mergedrow
| label1 = • {{{demographics1_title1}}}
| data1 = {{#if:{{{demographics1_title1|}}}|{{{demographics1_info1}}}}}
| rowclass2 = mergedrow
| label2 = • {{{demographics1_title2}}}
| data2 = {{#if:{{{demographics1_title2|}}}|{{{demographics1_info2}}}}}
| rowclass3 = mergedrow
| label3 = • {{{demographics1_title3}}}
| data3 = {{#if:{{{demographics1_title3|}}}|{{{demographics1_info3}}}}}
| rowclass4 = mergedrow
| label4 = • {{{demographics1_title4}}}
| data4 = {{#if:{{{demographics1_title4|}}}|{{{demographics1_info4}}}}}
| rowclass5 = mergedrow
| label5 = • {{{demographics1_title5}}}
| data5 = {{#if:{{{demographics1_title5|}}}|{{{demographics1_info5}}}}}
}}}}
| rowclass76 = mergedtoprow
| header76 = {{#if:{{{demographics_type2|}}}
|{{{demographics_type2}}}<span style="font-weight:normal">{{{demographics2_footnotes|}}}</span><!--
***Demographics 2***
-->{{infobox|child=yes
| rowclass1 = mergedrow
| label1 = • {{{demographics2_title1}}}
| data1 = {{#if:{{{demographics2_title1|}}}|{{{demographics2_info1}}}}}
| rowclass2 = mergedrow
| label2 = • {{{demographics2_title2}}}
| data2 = {{#if:{{{demographics2_title2|}}}|{{{demographics2_info2}}}}}
| rowclass3 = mergedrow
| label3 = • {{{demographics2_title3}}}
| data3 = {{#if:{{{demographics2_title3|}}}|{{{demographics2_info3}}}}}
| rowclass4 = mergedrow
| label4 = • {{{demographics2_title4}}}
| data4 = {{#if:{{{demographics2_title4|}}}|{{{demographics2_info4}}}}}
| rowclass5 = mergedrow
| label5 = • {{{demographics2_title5}}}
| data5 = {{#if:{{{demographics2_title5|}}}|{{{demographics2_info5}}}}}
}}}}
<!-- ***Time Zones*** -->
| rowclass77 = mergedtoprow
| label77 = {{#if:{{{timezone2|}}}|[[Zona wakatu]]|[[Zona wakatu]]}}
| data77 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{{timezone1|{{{timezone}}}}}} {{#if:{{{utc_offset1|{{{utc_offset|}}} }}}|([[UTC{{{utc_offset1|{{{utc_offset}}}}}}]])}} }}
| rowclass78 = mergedrow
| label78 = <nowiki />
| data78 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{#if:{{{timezone2|}}}|{{{timezone2}}} {{#if:{{{utc_offset2|{{{utc_offset2|}}} }}}|([[UTC{{{utc_offset2|{{{utc_offset2}}}}}}]])}} }} }}
| rowclass79 = mergedrow
| label79 = <span style="white-space:nowrap"> • Musim paneh ([[Wakatu musim paneh|DST]])</span>
| data79 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|{{{timezone1_DST|{{{timezone_DST|}}}}}} ([[UTC{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}]])}} }}
| rowclass80 = mergedrow
| label80 = <nowiki />
| data80 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|{{#if:{{{timezone2_DST|}}}|{{{timezone2_DST}}} ([[UTC{{{utc_offset2_DST|}}}]])}} }} }}
<!-- ***Postal Code(s)*** -->
| rowclass81 = mergedtoprow
| label81 = {{{postal_code_type}}}
| class81 = adr
| data81 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|<span class="postal-code">{{{postal_code}}}</span>}}}}
| rowclass82 = mergedbottomrow
| label82 = {{{postal2_code_type}}}
| class82 = adr
| data82 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|<span class="postal-code">{{{postal2_code}}}</span>}} }} }}
<!-- ***Area Code(s)*** -->
| rowclass83 = mergedrow
| label83 = {{#if:{{{area_code_type|}}}|{{{area_code_type}}}|[[Tata panomoran telepon|Kode wilayah]]}}
| data83 = {{{area_code|}}}
<!-- Geocode-->
| rowclass84 = mergedrow
| label84 = [[Geocode]]
| class84 = nickname
| data84 = {{{geocode|}}}
<!-- ISO Code-->
| rowclass85 = mergedrow
| label85 = [[ISO 3166]]
| class85 = nickname
| data85 = {{{iso_code|}}}
<!-- Other codes -->
| rowclass86 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|mergedrow|mergedtoprow}}
| label186 = {{{code1_name|}}}
| class186 = nickname
| data186 = {{#if:{{{code1_name|}}}|{{{code1_info|}}}}}
| rowclass87 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|{{{code1_name|}}}|mergedrow|mergedtoprow}}
| label87 = {{{code2_name|}}}
| class87 = nickname
| data87 = {{#if:{{{code2_name|}}}|{{{code2_info|}}}}}
| rowclass88 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|{{{registration_plate|}}}|{{{code1_name|}}}|{{{code2_name|}}}|mergedrow|mergedtoprow}}
| label88 = {{{code3_name|}}}
| class88 = nickname
| data88 = {{#if:{{{code3_name|}}}|{{{code3_info|}}}}}
<!-- Vehicle registration plate-->
| rowclass89 = mergedrow
| label89 = [[Plat registrasi kandaraan|Plat kandaraan]]
| data89 = {{{registration_plate|}}}
| rowclass90 = mergedtoprow
| header90 = {{#if:{{{twin1|}}}
|[[Daftar kota kamba|Kota kamba]]<!--
***Twin Cities***
-->{{infobox|child=yes
| rowclass1 = mergedrow
| label1 = • {{{twin1}}}
| data1 = {{#if:{{{twin1|}}}|{{{twin1_country}}}}}
| rowclass2 = mergedrow
| label2 = • {{{twin2}}}
| data2 = {{#if:{{{twin2|}}}|{{{twin2_country}}}}}
| rowclass3 = mergedrow
| label3 = • {{{twin3}}}
| data3 = {{#if:{{{twin3|}}}|{{{twin3_country}}}}}
| rowclass4 = mergedrow
| label4 = • {{{twin4}}}
| data4 = {{#if:{{{twin4|}}}|{{{twin4_country}}}}}
| rowclass5 = mergedrow
| label5 = • {{{twin5}}}
| data5 = {{#if:{{{twin5|}}}|{{{twin5_country}}}}}
| rowclass6 = mergedrow
| label6 = • {{{twin6}}}
| data6 = {{#if:{{{twin6|}}}|{{{twin6_country}}}}}
| rowclass7 = mergedrow
| label7 = • {{{twin7}}}
| data7 = {{#if:{{{twin7|}}}|{{{twin7_country}}}}}
| rowclass8 = mergedrow
| label8 = • {{{twin8}}}
| data8 = {{#if:{{{twin8|}}}|{{{twin8_country}}}}}
| rowclass9 = mergedrow
| label9 = • {{{twin9}}}
| data9 = {{#if:{{{twin9|}}}|{{{twin9_country}}}}}
}} }}
<!-- ***Blank Fields (two sections)*** -->
| rowclass91 = mergedtoprow
| label91 = {{{blank_name_sec1|{{{blank_name|}}}}}}
| data91 = {{#if:{{{blank_name_sec1|{{{blank_name|}}}}}}|{{{blank_info_sec1|{{{blank_info|}}}}}}}}
| rowclass92 = mergedrow
| label92 = {{{blank1_name_sec1|{{{blank1_name|}}}}}}
| data92 = {{#if:{{{blank1_name_sec1|{{{blank1_name|}}}}}}|{{{blank1_info_sec1|{{{blank1_info|}}}}}}}}
| rowclass93 = mergedrow
| label93 = {{{blank2_name_sec1|{{{blank2_name|}}}}}}
| data93 = {{#if:{{{blank2_name_sec1|{{{blank2_name|}}}}}}|{{{blank2_info_sec1|{{{blank2_info|}}}}}}}}
| rowclass94 = mergedrow
| label94 = {{{blank3_name_sec1|{{{blank3_name|}}}}}}
| data94 = {{#if:{{{blank3_name_sec1|{{{blank3_name|}}}}}}|{{{blank3_info_sec1|{{{blank3_info|}}}}}}}}
| rowclass95 = mergedrow
| label95 = {{{blank4_name_sec1|{{{blank4_name|}}}}}}
| data95 = {{#if:{{{blank4_name_sec1|{{{blank4_name|}}}}}}|{{{blank4_info_sec1|{{{blank4_info|}}}}}}}}
| rowclass96 = mergedrow
| label96 = {{{blank5_name_sec1|{{{blank5_name|}}}}}}
| data96 = {{#if:{{{blank5_name_sec1|{{{blank5_name|}}}}}}|{{{blank5_info_sec1|{{{blank5_info|}}}}}}}}
| rowclass97 = mergedrow
| label97 = {{{blank6_name_sec1|{{{blank6_name|}}}}}}
| data97 = {{#if:{{{blank6_name_sec1|{{{blank6_name|}}}}}}|{{{blank6_info_sec1|{{{blank6_info|}}}}}}}}
| rowclass98 = mergedrow
| label98 = {{{blank7_name_sec1|{{{blank7_name|}}}}}}
| data98 = {{#if:{{{blank7_name_sec1|{{{blank7_name|}}}}}}|{{{blank7_info_sec1|{{{blank7_info|}}}}}}}}
| rowclass99 = mergedtoprow
| label99 = {{{blank_name_sec2}}}
| data99 = {{#if:{{{blank_name_sec2|}}}|{{{blank_info_sec2|}}}}}
| rowclass100 = mergedrow
| label100 = {{{blank1_name_sec2}}}
| data100 = {{#if:{{{blank1_name_sec2|}}}|{{{blank1_info_sec2|}}}}}
| rowclass101 = mergedrow
| label101 = {{{blank2_name_sec2}}}
| data101 = {{#if:{{{blank2_name_sec2|}}}|{{{blank2_info_sec2|}}}}}
| rowclass102 = mergedrow
| label102 = {{{blank3_name_sec2}}}
| data102 = {{#if:{{{blank3_name_sec2|}}}|{{{blank3_info_sec2|}}}}}
| rowclass103 = mergedrow
| label103 = {{{blank4_name_sec2}}}
| data103 = {{#if:{{{blank4_name_sec2|}}}|{{{blank4_info_sec2|}}}}}
| rowclass104 = mergedrow
| label104 = {{{blank5_name_sec2}}}
| data104 = {{#if:{{{blank5_name_sec2|}}}|{{{blank5_info_sec2|}}}}}
| rowclass105 = mergedrow
| label105 = {{{blank6_name_sec2}}}
| data105 = {{#if:{{{blank6_name_sec2|}}}|{{{blank6_info_sec2|}}}}}
| rowclass106 = mergedrow
| label106 = {{{blank7_name_sec2}}}
| data106 = {{#if:{{{blank7_name_sec2|}}}|{{{blank7_info_sec2|}}}}}
|rowclass157 = mergedtoprow
|label157 = {{{blank_name_sec3}}}
|data157 = {{#if:{{{blank_name_sec3|}}}|{{{blank_info_sec3|}}}}}
|rowclass158 = mergedrow
|label158 = {{{blank1_name_sec3}}}
|data158 = {{#if:{{{blank1_name_sec3|}}}|{{{blank1_info_sec3|}}}}}
|rowclass159 = mergedrow
|label159 = {{{blank2_name_sec3}}}
|data159 = {{#if:{{{blank2_name_sec3|}}}|{{{blank2_info_sec3|}}}}}
|rowclass160 = mergedrow
|label160 = {{{blank3_name_sec3}}}
|data160 = {{#if:{{{blank3_name_sec3|}}}|{{{blank3_info_sec3|}}}}}
|rowclass161 = mergedrow
|label161 = {{{blank4_name_sec3}}}
|data161 = {{#if:{{{blank4_name_sec3|}}}|{{{blank4_info_sec3|}}}}}
|rowclass162 = mergedrow
|label162 = {{{blank5_name_sec3}}}
|data162 = {{#if:{{{blank5_name_sec3|}}}|{{{blank5_info_sec3|}}}}}
|rowclass163 = mergedrow
|label163 = {{{blank6_name_sec3}}}
|data163 = {{#if:{{{blank6_name_sec3|}}}|{{{blank6_info_sec3|}}}}}
|rowclass164 = mergedrow
|label164 = {{{blank7_name_sec3}}}
|data164 = {{#if:{{{blank7_name_sec3|}}}|{{{blank7_info_sec3|}}}}}
<!-- ***Website*** -->
| rowclass200 = mergedtoprow
| label200 = Situs web
| data200 = {{#if:{{{website|}}}|{{{website}}}}}
<!-- ***Footnotes*** -->
| belowstyle = text-align:left; font-size:smaller
| belowrowclass = mergedtoprow
| below = {{{footnotes|}}}
}}<!--For deprecated parameter names--><includeonly>{{#ifeq:{{{coor_type|♠}}}{{{city_logo|♠}}}{{{area_total|♠}}}{{{area_land|♠}}}{{{area_water|♠}}}{{{TotalArea_sq_mi|♠}}}{{{LandArea_sq_mi|♠}}}{{{WaterArea_sq_mi|♠}}}{{{area_urban|♠}}}{{{UrbanArea_sq_mi|♠}}}{{{area_metro|♠}}}{{{MetroArea_sq_mi|♠}}}{{{elevation|♠}}}{{{population_density|♠}}}{{{population_density_mi2|♠}}}{{{population_density_metro_mi2|♠}}}{{{population_density_urban_mi2|♠}}}|♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠||}}{{#switch:{{{coordinates_region|}}}|CA-X|US-X|IN-X=}}{{#if:{{{image_dot_map|}}}{{{dot_mapsize|}}}{{{dot_map_base_alt|}}}{{{dot_map_alt|}}}{{{dot_map_caption|}}}{{{dot_x|}}}{{{dot_y|}}}
|
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
2nkba90ttx59jh62ek9c84lmf7vlizd
Modul:Wikidata
828
227297
2444305
2042880
2022-08-13T13:45:21Z
David Wadie Fisher-Freberg
51
b
Scribunto
text/plain
-- vim: set noexpandtab ft=lua ts=4 sw=4:
require('Module:No globals')
local p = {}
local debug = false
------------------------------------------------------------------------------
-- module local variables and functions
local wiki =
{
langcode = mw.language.getContentLanguage().code
}
-- internationalisation
local i18n =
{
["errors"] =
{
["property-not-found"] = "Property not found.",
["entity-not-found"] = "Wikidata entity not found.",
["unknown-claim-type"] = "Unknown claim type.",
["unknown-entity-type"] = "Unknown entity type.",
["qualifier-not-found"] = "Qualifier not found.",
["site-not-found"] = "Wikimedia project not found.",
["unknown-datetime-format"] = "Unknown datetime format.",
["local-article-not-found"] = "Article is not yet available in this wiki."
},
["datetime"] =
{
-- $1 is a placeholder for the actual number
[0] = "$1 billion years", -- precision: billion years
[1] = "$100 million years", -- precision: hundred million years
[2] = "$10 million years", -- precision: ten million years
[3] = "$1 million years", -- precision: million years
[4] = "$100,000 years", -- precision: hundred thousand years
[5] = "$10,000 years", -- precision: ten thousand years
[6] = "$1 millennium", -- precision: millennium
[7] = "$1 century", -- precision: century
[8] = "$1s", -- precision: decade
-- the following use the format of #time parser function
[9] = "Y", -- precision: year,
[10] = "F Y", -- precision: month
[11] = "F j, Y", -- precision: day
[12] = "F j, Y ga", -- precision: hour
[13] = "F j, Y g:ia", -- precision: minute
[14] = "F j, Y g:i:sa", -- precision: second
["beforenow"] = "$1 BCE", -- how to format negative numbers for precisions 0 to 5
["afternow"] = "$1 CE", -- how to format positive numbers for precisions 0 to 5
["bc"] = '$1 "BCE"', -- how print negative years
["ad"] = "$1", -- how print positive years
-- the following are for function getDateValue() and getQualifierDateValue()
["default-format"] = "dmy", -- default value of the #3 (getDateValue) or
-- #4 (getQualifierDateValue) argument
["default-addon"] = "BC", -- default value of the #4 (getDateValue) or
-- #5 (getQualifierDateValue) argument
["prefix-addon"] = false, -- set to true for languages put "BC" in front of the
-- datetime string; or the addon will be suffixed
["addon-sep"] = " ", -- separator between datetime string and addon (or inverse)
["format"] = -- options of the 3rd argument
{
["mdy"] = "F j, Y",
["my"] = "F Y",
["y"] = "Y",
["dmy"] = "j F Y",
["ymd"] = "Y-m-d",
["ym"] = "Y-m"
}
},
["monolingualtext"] = '<span lang="%language">%text</span>',
["warnDump"] = "[[Category:Called function 'Dump' from module Wikidata]]",
["ordinal"] =
{
[1] = "st",
[2] = "nd",
[3] = "rd",
["default"] = "th"
}
}
if wiki.langcode ~= "en" then
--require("Module:i18n").loadI18n("Module:Wikidata/i18n", i18n)
-- got idea from [[:w:Module:Wd]]
local module_title; if ... == nil then
module_title = mw.getCurrentFrame():getTitle()
else
module_title = ...
end
require('Module:i18n').loadI18n(module_title..'/i18n', i18n)
end
-- this function needs to be internationalised along with the above:
-- takes cardinal numer as a numeric and returns the ordinal as a string
-- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc.
local function makeOrdinal (cardinal)
local ordsuffix = i18n.ordinal.default
if cardinal % 10 == 1 then
ordsuffix = i18n.ordinal[1]
elseif cardinal % 10 == 2 then
ordsuffix = i18n.ordinal[2]
elseif cardinal % 10 == 3 then
ordsuffix = i18n.ordinal[3]
end
-- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th'
-- similarly for 12 and 13, etc.
if (cardinal % 100 == 11) or (cardinal % 100 == 12) or (cardinal % 100 == 13) then
ordsuffix = i18n.ordinal.default
end
return tostring(cardinal) .. ordsuffix
end
local function printError(code)
return '<span class="error">' .. (i18n.errors[code] or code) .. '</span>'
end
local function parseDateFormat(f, timestamp, addon, prefix_addon, addon_sep)
local year_suffix
local tstr = ""
local lang_obj = mw.language.new(wiki.langcode)
local f_parts = mw.text.split(f, 'Y', true)
for idx, f_part in pairs(f_parts) do
year_suffix = ''
if string.match(f_part, "x[mijkot]$") then
-- for non-Gregorian year
f_part = f_part .. 'Y'
elseif idx < #f_parts then
-- supress leading zeros in year
year_suffix = lang_obj:formatDate('Y', timestamp)
year_suffix = string.gsub(year_suffix, '^0+', '', 1)
end
tstr = tstr .. lang_obj:formatDate(f_part, timestamp) .. year_suffix
end
if addon ~= "" and prefix_addon then
return addon .. addon_sep .. tstr
elseif addon ~= "" then
return tstr .. addon_sep .. addon
else
return tstr
end
end
local function parseDateValue(timestamp, date_format, date_addon)
local prefix_addon = i18n["datetime"]["prefix-addon"]
local addon_sep = i18n["datetime"]["addon-sep"]
local addon = ""
-- check for negative date
if string.sub(timestamp, 1, 1) == '-' then
timestamp = '+' .. string.sub(timestamp, 2)
addon = date_addon
end
local _date_format = i18n["datetime"]["format"][date_format]
if _date_format ~= nil then
return parseDateFormat(_date_format, timestamp, addon, prefix_addon, addon_sep)
else
return printError("unknown-datetime-format")
end
end
-- This local function combines the year/month/day/BC/BCE handling of parseDateValue{}
-- with the millennium/century/decade handling of formatDate()
local function parseDateFull(timestamp, precision, date_format, date_addon)
local prefix_addon = i18n["datetime"]["prefix-addon"]
local addon_sep = i18n["datetime"]["addon-sep"]
local addon = ""
-- check for negative date
if string.sub(timestamp, 1, 1) == '-' then
timestamp = '+' .. string.sub(timestamp, 2)
addon = date_addon
end
-- get the next four characters after the + (should be the year now in all cases)
-- ok, so this is dirty, but let's get it working first
local intyear = tonumber(string.sub(timestamp, 2, 5))
if intyear == 0 and precision <= 9 then
return ""
end
-- precision is 10000 years or more
if precision <= 5 then
local factor = 10 ^ ((5 - precision) + 4)
local y2 = math.ceil(math.abs(intyear) / factor)
local relative = mw.ustring.gsub(i18n.datetime[precision], "$1", tostring(y2))
if addon ~= "" then
-- negative date
relative = mw.ustring.gsub(i18n.datetime.beforenow, "$1", relative)
else
relative = mw.ustring.gsub(i18n.datetime.afternow, "$1", relative)
end
return relative
end
-- precision is decades (8), centuries (7) and millennia (6)
local era, card
if precision == 6 then
card = math.floor((intyear - 1) / 1000) + 1
era = mw.ustring.gsub(i18n.datetime[6], "$1", makeOrdinal(card))
end
if precision == 7 then
card = math.floor((intyear - 1) / 100) + 1
era = mw.ustring.gsub(i18n.datetime[7], "$1", makeOrdinal(card))
end
if precision == 8 then
era = mw.ustring.gsub(i18n.datetime[8], "$1", tostring(math.floor(math.abs(intyear) / 10) * 10))
end
if era then
if addon ~= "" then
era = mw.ustring.gsub(mw.ustring.gsub(i18n.datetime.bc, '"', ""), "$1", era)
else
era = mw.ustring.gsub(mw.ustring.gsub(i18n.datetime.ad, '"', ""), "$1", era)
end
return era
end
local _date_format = i18n["datetime"]["format"][date_format]
if _date_format ~= nil then
-- check for precision is year and override supplied date_format
if precision == 9 then
_date_format = i18n["datetime"][9]
end
return parseDateFormat(_date_format, timestamp, addon, prefix_addon, addon_sep)
else
return printError("unknown-datetime-format")
end
end
-- the "qualifiers" and "snaks" field have a respective "qualifiers-order" and "snaks-order" field
-- use these as the second parameter and this function instead of the built-in "pairs" function
-- to iterate over all qualifiers and snaks in the intended order.
local function orderedpairs(array, order)
if not order then return pairs(array) end
-- return iterator function
local i = 0
return function()
i = i + 1
if order[i] then
return order[i], array[order[i]]
end
end
end
-- precision: 0 - billion years, 1 - hundred million years, ..., 6 - millennia, 7 - century, 8 - decade, 9 - year, 10 - month, 11 - day, 12 - hour, 13 - minute, 14 - second
local function normalizeDate(date)
date = mw.text.trim(date, "+")
-- extract year
local yearstr = mw.ustring.match(date, "^\-?%d+")
local year = tonumber(yearstr)
-- remove leading zeros of year
return year .. mw.ustring.sub(date, #yearstr + 1), year
end
local function formatDate(date, precision, timezone)
precision = precision or 11
local date, year = normalizeDate(date)
if year == 0 and precision <= 9 then return "" end
-- precision is 10000 years or more
if precision <= 5 then
local factor = 10 ^ ((5 - precision) + 4)
local y2 = math.ceil(math.abs(year) / factor)
local relative = mw.ustring.gsub(i18n.datetime[precision], "$1", tostring(y2))
if year < 0 then
relative = mw.ustring.gsub(i18n.datetime.beforenow, "$1", relative)
else
relative = mw.ustring.gsub(i18n.datetime.afternow, "$1", relative)
end
return relative
end
-- precision is decades, centuries and millennia
local era
if precision == 6 then era = mw.ustring.gsub(i18n.datetime[6], "$1", tostring(math.floor((math.abs(year) - 1) / 1000) + 1)) end
if precision == 7 then era = mw.ustring.gsub(i18n.datetime[7], "$1", tostring(math.floor((math.abs(year) - 1) / 100) + 1)) end
if precision == 8 then era = mw.ustring.gsub(i18n.datetime[8], "$1", tostring(math.floor(math.abs(year) / 10) * 10)) end
if era then
if year < 0 then era = mw.ustring.gsub(mw.ustring.gsub(i18n.datetime.bc, '"', ""), "$1", era)
elseif year > 0 then era = mw.ustring.gsub(mw.ustring.gsub(i18n.datetime.ad, '"', ""), "$1", era) end
return era
end
-- precision is year
if precision == 9 then
return year
end
-- precision is less than years
if precision > 9 then
--[[ the following code replaces the UTC suffix with the given negated timezone to convert the global time to the given local time
timezone = tonumber(timezone)
if timezone and timezone ~= 0 then
timezone = -timezone
timezone = string.format("%.2d%.2d", timezone / 60, timezone % 60)
if timezone[1] ~= '-' then timezone = "+" .. timezone end
date = mw.text.trim(date, "Z") .. " " .. timezone
end
]]--
local formatstr = i18n.datetime[precision]
if year == 0 then formatstr = mw.ustring.gsub(formatstr, i18n.datetime[9], "")
elseif year < 0 then
-- Mediawiki formatDate doesn't support negative years
date = mw.ustring.sub(date, 2)
formatstr = mw.ustring.gsub(formatstr, i18n.datetime[9], mw.ustring.gsub(i18n.datetime.bc, "$1", i18n.datetime[9]))
elseif year > 0 and i18n.datetime.ad ~= "$1" then
formatstr = mw.ustring.gsub(formatstr, i18n.datetime[9], mw.ustring.gsub(i18n.datetime.ad, "$1", i18n.datetime[9]))
end
return mw.language.new(wiki.langcode):formatDate(formatstr, date)
end
end
local function printDatavalueEntity(data, parameter)
-- data fields: entity-type [string], numeric-id [int, Wikidata id]
local id
if data["entity-type"] == "item" then id = "Q" .. data["numeric-id"]
elseif data["entity-type"] == "property" then id = "P" .. data["numeric-id"]
else return printError("unknown-entity-type")
end
if parameter then
if parameter == "link" then
local linkTarget = mw.wikibase.getSitelink(id)
local linkName = mw.wikibase.getLabel(id)
if linkTarget then
-- if there is a local Wikipedia article link to it using the label or the article title
return "[[" .. linkTarget .. "|" .. (linkName or linkTarget) .. "]]"
else
-- if there is no local Wikipedia article output the label or link to the Wikidata object to let the user input a proper label
if linkName then return linkName else return "[[:d:" .. id .. "|" .. id .. "]]" end
end
else
return data[parameter]
end
else
return mw.wikibase.getLabel(id) or id
end
end
local function printDatavalueTime(data, parameter)
-- data fields: time [ISO 8601 time], timezone [int in minutes], before [int], after [int], precision [int], calendarmodel [wikidata URI]
-- precision: 0 - billion years, 1 - hundred million years, ..., 6 - millennia, 7 - century, 8 - decade, 9 - year, 10 - month, 11 - day, 12 - hour, 13 - minute, 14 - second
-- calendarmodel: e.g. http://www.wikidata.org/entity/Q1985727 for the proleptic Gregorian calendar or http://www.wikidata.org/wiki/Q11184 for the Julian calendar]
if parameter then
if parameter == "calendarmodel" then data.calendarmodel = mw.ustring.match(data.calendarmodel, "Q%d+") -- extract entity id from the calendar model URI
elseif parameter == "time" then data.time = normalizeDate(data.time) end
return data[parameter]
else
return formatDate(data.time, data.precision, data.timezone)
end
end
local function printDatavalueMonolingualText(data, parameter)
-- data fields: language [string], text [string]
if parameter then
return data[parameter]
else
local result = mw.ustring.gsub(mw.ustring.gsub(i18n.monolingualtext, "%%language", data["language"]), "%%text", data["text"])
return result
end
end
local function findClaims(entity, property)
if not property or not entity or not entity.claims then return end
if mw.ustring.match(property, "^P%d+$") then
-- if the property is given by an id (P..) access the claim list by this id
return entity.claims[property]
else
property = mw.wikibase.resolvePropertyId(property)
if not property then return end
return entity.claims[property]
end
end
local function getSnakValue(snak, parameter)
if snak.snaktype == "value" then
-- call the respective snak parser
if snak.datavalue.type == "string" then return snak.datavalue.value
elseif snak.datavalue.type == "globecoordinate" then return printDatavalueCoordinate(snak.datavalue.value, parameter)
elseif snak.datavalue.type == "quantity" then return printDatavalueQuantity(snak.datavalue.value, parameter)
elseif snak.datavalue.type == "time" then return printDatavalueTime(snak.datavalue.value, parameter)
elseif snak.datavalue.type == "wikibase-entityid" then return printDatavalueEntity(snak.datavalue.value, parameter)
elseif snak.datavalue.type == "monolingualtext" then return printDatavalueMonolingualText(snak.datavalue.value, parameter)
end
end
return mw.wikibase.renderSnak(snak)
end
local function getQualifierSnak(claim, qualifierId)
-- a "snak" is Wikidata terminology for a typed key/value pair
-- a claim consists of a main snak holding the main information of this claim,
-- as well as a list of attribute snaks and a list of references snaks
if qualifierId then
-- search the attribute snak with the given qualifier as key
if claim.qualifiers then
local qualifier = claim.qualifiers[qualifierId]
if qualifier then return qualifier[1] end
end
return nil, printError("qualifier-not-found")
else
-- otherwise return the main snak
return claim.mainsnak
end
end
local function getValueOfClaim(claim, qualifierId, parameter)
local error
local snak
snak, error = getQualifierSnak(claim, qualifierId)
if snak then
return getSnakValue(snak, parameter)
else
return nil, error
end
end
local function getReferences(frame, claim)
local result = ""
-- traverse through all references
for ref in pairs(claim.references or {}) do
local refparts
-- traverse through all parts of the current reference
for snakkey, snakval in orderedpairs(claim.references[ref].snaks or {}, claim.references[ref]["snaks-order"]) do
if refparts then refparts = refparts .. ", " else refparts = "" end
-- output the label of the property of the reference part, e.g. "imported from" for P143
refparts = refparts .. tostring(mw.wikibase.getLabel(snakkey)) .. ": "
-- output all values of this reference part, e.g. "German Wikipedia" and "English Wikipedia" if the referenced claim was imported from both sites
for snakidx = 1, #snakval do
if snakidx > 1 then refparts = refparts .. ", " end
refparts = refparts .. getSnakValue(snakval[snakidx])
end
end
if refparts then result = result .. frame:extensionTag("ref", refparts) end
end
return result
end
local function parseInput(frame)
local qid = frame.args.qid
if qid and (#qid == 0) then qid = nil end
local propertyID = mw.text.trim(frame.args[1] or "")
local input_parm = mw.text.trim(frame.args[2] or "")
if input_parm ~= "FETCH_WIKIDATA" then
return false, input_parm, nil, nil
end
local entity = mw.wikibase.getEntity(qid)
local claims
if entity and entity.claims then
claims = entity.claims[propertyID]
if not claims then
return false, "", nil, nil
end
else
return false, "", nil, nil
end
return true, entity, claims, propertyID
end
local function isType(claims, type)
return claims[1] and claims[1].mainsnak.snaktype == "value" and claims[1].mainsnak.datavalue.type == type
end
local function getValue(entity, claims, propertyID, delim, labelHook)
if labelHook == nil then
labelHook = function (qnumber)
return nil;
end
end
if isType(claims, "wikibase-entityid") then
local out = {}
for k, v in pairs(claims) do
local qnumber = "Q" .. v.mainsnak.datavalue.value["numeric-id"]
local sitelink = mw.wikibase.getSitelink(qnumber)
local label = labelHook(qnumber) or mw.wikibase.getLabel(qnumber) or qnumber
if sitelink then
out[#out + 1] = "[[" .. sitelink .. "|" .. label .. "]]"
else
out[#out + 1] = "[[:d:" .. qnumber .. "|" .. label .. "]]<abbr title='" .. i18n["errors"]["local-article-not-found"] .. "'>[*]</abbr>"
end
end
return table.concat(out, delim)
else
-- just return best values
return entity:formatPropertyValues(propertyID).value
end
end
------------------------------------------------------------------------------
-- module global functions
if debug then
function p.inspectI18n(frame)
local val = i18n
for _, key in pairs(frame.args) do
key = mw.text.trim(key)
val = val[key]
end
return val
end
end
function p.descriptionIn(frame)
local langcode = frame.args[1]
local id = frame.args[2]
-- return description of a Wikidata entity in the given language or the default language of this Wikipedia site
return mw.wikibase.getEntity(id):getDescription(langcode or wiki.langcode)
end
function p.labelIn(frame)
local langcode = frame.args[1]
local id = frame.args[2]
-- return label of a Wikidata entity in the given language or the default language of this Wikipedia site
return mw.wikibase.getEntity(id):getLabel(langcode or wiki.langcode)
end
-- This is used to get a value, or a comma separated list of them if multiple values exist
p.getValue = function(frame)
local delimdefault = ", " -- **internationalise later**
local delim = frame.args.delimiter or ""
delim = string.gsub(delim, '"', '')
if #delim == 0 then
delim = delimdefault
end
local go, errorOrentity, claims, propertyID = parseInput(frame)
if not go then
return errorOrentity
end
return getValue(errorOrentity, claims, propertyID, delim)
end
-- Same as above, but uses the short name property for label if available.
p.getValueShortName = function(frame)
local go, errorOrentity, claims, propertyID = parseInput(frame)
if not go then
return errorOrentity
end
local entity = errorOrentity
-- if wiki-linked value output as link if possible
local function labelHook (qnumber)
local label
local claimEntity = mw.wikibase.getEntity(qnumber)
if claimEntity ~= nil then
if claimEntity.claims.P1813 then
for k2, v2 in pairs(claimEntity.claims.P1813) do
if v2.mainsnak.datavalue.value.language == "en" then
label = v2.mainsnak.datavalue.value.text
end
end
end
end
if label == nil or label == "" then return nil end
return label
end
return getValue(errorOrentity, claims, propertyID, ", ", labelHook);
end
-- This is used to get a value, or a comma separated list of them if multiple values exist
-- from an arbitrary entry by using its QID.
-- Use : {{#invoke:Wikidata|getValueFromID|<ID>|<Property>|FETCH_WIKIDATA}}
-- E.g.: {{#invoke:Wikidata|getValueFromID|Q151973|P26|FETCH_WIKIDATA}} - to fetch value of 'spouse' (P26) from 'Richard Burton' (Q151973)
-- Please use sparingly - this is an *expensive call*.
p.getValueFromID = function(frame)
local itemID = mw.text.trim(frame.args[1] or "")
local propertyID = mw.text.trim(frame.args[2] or "")
local input_parm = mw.text.trim(frame.args[3] or "")
if input_parm == "FETCH_WIKIDATA" then
local entity = mw.wikibase.getEntity(itemID)
local claims
if entity and entity.claims then
claims = entity.claims[propertyID]
end
if claims then
return getValue(entity, claims, propertyID, ", ")
else
return ""
end
else
return input_parm
end
end
local function getQualifier(frame, outputHook)
local propertyID = mw.text.trim(frame.args[1] or "")
local qualifierID = mw.text.trim(frame.args[2] or "")
local input_parm = mw.text.trim(frame.args[3] or "")
if input_parm == "FETCH_WIKIDATA" then
local entity = mw.wikibase.getEntity()
if entity.claims[propertyID] ~= nil then
local out = {}
for k, v in pairs(entity.claims[propertyID]) do
for k2, v2 in pairs(v.qualifiers[qualifierID]) do
if v2.snaktype == 'value' then
out[#out + 1] = outputHook(v2);
end
end
end
return table.concat(out, ", "), true
else
return "", false
end
else
return input_parm, false
end
end
p.getQualifierValue = function(frame)
local function outputValue(value)
local qnumber = "Q" .. value.datavalue.value["numeric-id"]
if (mw.wikibase.getSitelink(qnumber)) then
return "[[" .. mw.wikibase.getSitelink(qnumber) .. "]]"
else
return "[[:d:" .. qnumber .. "|" ..qnumber .. "]]<abbr title='" .. i18n["errors"]["local-article-not-found"] .. "'>[*]</abbr>"
end
end
return (getQualifier(frame, outputValue))
end
-- This is used to get a value like 'male' (for property p21) which won't be linked and numbers without the thousand separators
p.getRawValue = function(frame)
local go, errorOrentity, claims, propertyID = parseInput(frame)
if not go then
return errorOrentity
end
local entity = errorOrentity
local result = entity:formatPropertyValues(propertyID, mw.wikibase.entity.claimRanks).value
-- if number type: remove thousand separators, bounds and units
if isType(claims, "quantity") then
result = mw.ustring.gsub(result, "(%d),(%d)", "%1%2")
result = mw.ustring.gsub(result, "(%d)±.*", "%1")
end
return result
end
-- This is used to get the unit name for the numeric value returned by getRawValue
p.getUnits = function(frame)
local go, errorOrentity, claims, propertyID = parseInput(frame)
if not go then
return errorOrentity
end
local entity = errorOrentity
local result = entity:formatPropertyValues(propertyID, mw.wikibase.entity.claimRanks).value
if isType(claims, "quantity") then
result = mw.ustring.sub(result, mw.ustring.find(result, " ")+1, -1)
end
return result
end
-- This is used to get the unit's QID to use with the numeric value returned by getRawValue
p.getUnitID = function(frame)
local go, errorOrentity, claims = parseInput(frame)
if not go then
return errorOrentity
end
local entity = errorOrentity
local result
if isType(claims, "quantity") then
-- get the url for the unit entry on Wikidata:
result = claims[1].mainsnak.datavalue.value.unit
-- and just reurn the last bit from "Q" to the end (which is the QID):
result = mw.ustring.sub(result, mw.ustring.find(result, "Q"), -1)
end
return result
end
p.getRawQualifierValue = function(frame)
local function outputHook(value)
if value.datavalue.value["numeric-id"] then
return mw.wikibase.getLabel("Q" .. value.datavalue.value["numeric-id"])
else
return value.datavalue.value
end
end
local ret, gotData = getQualifier(frame, outputHook)
if gotData then
ret = string.upper(string.sub(ret, 1, 1)) .. string.sub(ret, 2)
end
return ret
end
-- This is used to get a date value for date_of_birth (P569), etc. which won't be linked
-- Dates and times are stored in ISO 8601 format (sort of).
-- At present the local formatDate(date, precision, timezone) function doesn't handle timezone
-- So I'll just supply "Z" in the call to formatDate below:
p.getDateValue = function(frame)
local date_format = mw.text.trim(frame.args[3] or i18n["datetime"]["default-format"])
local date_addon = mw.text.trim(frame.args[4] or i18n["datetime"]["default-addon"])
local go, errorOrentity, claims = parseInput(frame)
if not go then
return errorOrentity
end
local entity = errorOrentity
local out = {}
for k, v in pairs(claims) do
if v.mainsnak.datavalue.type == 'time' then
local timestamp = v.mainsnak.datavalue.value.time
local dateprecision = v.mainsnak.datavalue.value.precision
-- A year can be stored like this: "+1872-00-00T00:00:00Z",
-- which is processed here as if it were the day before "+1872-01-01T00:00:00Z",
-- and that's the last day of 1871, so the year is wrong.
-- So fix the month 0, day 0 timestamp to become 1 January instead:
timestamp = timestamp:gsub("%-00%-00T", "-01-01T")
out[#out + 1] = parseDateFull(timestamp, dateprecision, date_format, date_addon)
end
end
return table.concat(out, ", ")
end
p.getQualifierDateValue = function(frame)
local date_format = mw.text.trim(frame.args[4] or i18n["datetime"]["default-format"])
local date_addon = mw.text.trim(frame.args[5] or i18n["datetime"]["default-addon"])
local function outputHook(value)
local timestamp = value.datavalue.value.time
return parseDateValue(timestamp, date_format, date_addon)
end
return (getQualifier(frame, outputHook))
end
-- This is used to fetch all of the images with a particular property, e.g. image (P18), Gene Atlas Image (P692), etc.
-- Parameters are | propertyID | value / FETCH_WIKIDATA / nil | separator (default=space) | size (default=frameless)
-- It will return a standard wiki-markup [[File:Filename | size]] for each image with a selectable size and separator (which may be html)
-- e.g. {{#invoke:Wikidata|getImages|P18|FETCH_WIKIDATA}}
-- e.g. {{#invoke:Wikidata|getImages|P18|FETCH_WIKIDATA|<br>|250px}}
-- If a property is chosen that is not of type "commonsMedia", it will return empty text.
p.getImages = function(frame)
local sep = mw.text.trim(frame.args[3] or " ")
local imgsize = mw.text.trim(frame.args[4] or "frameless")
local go, errorOrentity, claims = parseInput(frame)
if not go then
return errorOrentity
end
local entity = errorOrentity
if (claims[1] and claims[1].mainsnak.datatype == "commonsMedia") then
local out = {}
for k, v in pairs(claims) do
local filename = v.mainsnak.datavalue.value
out[#out + 1] = "[[File:" .. filename .. "|" .. imgsize .. "]]"
end
return table.concat(out, sep)
else
return ""
end
end
-- This is used to get the TA98 (Terminologia Anatomica first edition 1998) values like 'A01.1.00.005' (property P1323)
-- which are then linked to http://www.unifr.ch/ifaa/Public/EntryPage/TA98%20Tree/Entity%20TA98%20EN/01.1.00.005%20Entity%20TA98%20EN.htm
-- uses the newer mw.wikibase calls instead of directly using the snaks
-- formatPropertyValues returns a table with the P1323 values concatenated with ", " so we have to split them out into a table in order to construct the return string
p.getTAValue = function(frame)
local ent = mw.wikibase.getEntity()
local props = ent:formatPropertyValues('P1323')
local out = {}
local t = {}
for k, v in pairs(props) do
if k == 'value' then
t = mw.text.split( v, ", ")
for k2, v2 in pairs(t) do
out[#out + 1] = "[http://www.unifr.ch/ifaa/Public/EntryPage/TA98%20Tree/Entity%20TA98%20EN/" .. string.sub(v2, 2) .. "%20Entity%20TA98%20EN.htm " .. v2 .. "]"
end
end
end
local ret = table.concat(out, "<br> ")
if #ret == 0 then
ret = "Invalid TA"
end
return ret
end
--[[
This is used to return an image legend from Wikidata
image is property P18
image legend is property P2096
Call as {{#invoke:Wikidata |getImageLegend | <PARAMETER> | lang=<ISO-639code> |id=<QID>}}
Returns PARAMETER, unless it is equal to "FETCH_WIKIDATA", from Item QID (expensive call)
If QID is omitted or blank, the current article is used (not an expensive call)
If lang is omitted, it uses the local wiki language, otherwise it uses the provided ISO-639 language code
ISO-639: https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html#wp1252447
Ranks are: 'preferred' > 'normal'
This returns the label from the first image with 'preferred' rank
Or the label from the first image with 'normal' rank if preferred returns nothing
Ranks: https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua
]]
p.getImageLegend = function(frame)
-- look for named parameter id; if it's blank make it nil
local id = frame.args.id
if id and (#id == 0) then
id = nil
end
-- look for named parameter lang
-- it should contain a two-character ISO-639 language code
-- if it's blank fetch the language of the local wiki
local lang = frame.args.lang
if (not lang) or (#lang < 2) then
lang = mw.language.getContentLanguage().code
end
-- first unnamed parameter is the local parameter, if supplied
local input_parm = mw.text.trim(frame.args[1] or "")
if input_parm == "FETCH_WIKIDATA" then
local ent = mw.wikibase.getEntity(id)
local imgs
if ent and ent.claims then
imgs = ent.claims.P18
end
local imglbl
if imgs then
-- look for an image with 'preferred' rank
for k1, v1 in pairs(imgs) do
if v1.rank == "preferred" and v1.qualifiers and v1.qualifiers.P2096 then
local imglbls = v1.qualifiers.P2096
for k2, v2 in pairs(imglbls) do
if v2.datavalue.value.language == lang then
imglbl = v2.datavalue.value.text
break
end
end
end
end
-- if we don't find one, look for an image with 'normal' rank
if (not imglbl) then
for k1, v1 in pairs(imgs) do
if v1.rank == "normal" and v1.qualifiers and v1.qualifiers.P2096 then
local imglbls = v1.qualifiers.P2096
for k2, v2 in pairs(imglbls) do
if v2.datavalue.value.language == lang then
imglbl = v2.datavalue.value.text
break
end
end
end
end
end
end
return imglbl
else
return input_parm
end
end
-- This is used to get the QIDs of all of the values of a property, as a comma separated list if multiple values exist
-- Usage: {{#invoke:Wikidata |getPropertyIDs |<PropertyID> |FETCH_WIKIDATA}}
-- Usage: {{#invoke:Wikidata |getPropertyIDs |<PropertyID> |<InputParameter> |qid=<QID>}}
p.getPropertyIDs = function(frame)
local go, errorOrentity, propclaims = parseInput(frame)
if not go then
return errorOrentity
end
local entity = errorOrentity
-- if wiki-linked value collect the QID in a table
if (propclaims[1] and propclaims[1].mainsnak.snaktype == "value" and propclaims[1].mainsnak.datavalue.type == "wikibase-entityid") then
local out = {}
for k, v in pairs(propclaims) do
out[#out + 1] = "Q" .. v.mainsnak.datavalue.value["numeric-id"]
end
return table.concat(out, ", ")
else
-- not a wikibase-entityid, so return empty
return ""
end
end
-- returns the page id (Q...) of the current page or nothing of the page is not connected to Wikidata
function p.pageId(frame)
return mw.wikibase.getEntityIdForCurrentPage()
end
function p.claim(frame)
local property = frame.args[1] or ""
local id = frame.args["id"]
local qualifierId = frame.args["qualifier"]
local parameter = frame.args["parameter"]
local list = frame.args["list"]
local references = frame.args["references"]
local showerrors = frame.args["showerrors"]
local default = frame.args["default"]
if default then showerrors = nil end
-- get wikidata entity
local entity = mw.wikibase.getEntity(id)
if not entity then
if showerrors then return printError("entity-not-found") else return default end
end
-- fetch the first claim of satisfying the given property
local claims = findClaims(entity, property)
if not claims or not claims[1] then
if showerrors then return printError("property-not-found") else return default end
end
-- get initial sort indices
local sortindices = {}
for idx in pairs(claims) do
sortindices[#sortindices + 1] = idx
end
-- sort by claim rank
local comparator = function(a, b)
local rankmap = { deprecated = 2, normal = 1, preferred = 0 }
local ranka = rankmap[claims[a].rank or "normal"] .. string.format("%08d", a)
local rankb = rankmap[claims[b].rank or "normal"] .. string.format("%08d", b)
return ranka < rankb
end
table.sort(sortindices, comparator)
local result
local error
if list then
local value
-- iterate over all elements and return their value (if existing)
result = {}
for idx in pairs(claims) do
local claim = claims[sortindices[idx]]
value, error = getValueOfClaim(claim, qualifierId, parameter)
if not value and showerrors then value = error end
if value and references then value = value .. getReferences(frame, claim) end
result[#result + 1] = value
end
result = table.concat(result, list)
else
-- return first element
local claim = claims[sortindices[1]]
result, error = getValueOfClaim(claim, qualifierId, parameter)
if result and references then result = result .. getReferences(frame, claim) end
end
if result then return result else
if showerrors then return error else return default end
end
end
-- look into entity object
function p.ViewSomething(frame)
local f = (frame.args[1] or frame.args.id) and frame or frame:getParent()
local id = f.args.id
if id and (#id == 0) then
id = nil
end
local data = mw.wikibase.getEntity(id)
if not data then
return nil
end
local i = 1
while true do
local index = f.args[i]
if not index then
if type(data) == "table" then
return mw.text.jsonEncode(data, mw.text.JSON_PRESERVE_KEYS + mw.text.JSON_PRETTY)
else
return tostring(data)
end
end
data = data[index] or data[tonumber(index)]
if not data then
return
end
i = i + 1
end
end
-- getting sitelink of a given wiki
-- get sitelink of current item if qid not supplied
function p.getSiteLink(frame)
local qid = frame.args.qid
if qid == "" then qid = nil end
local f = mw.text.trim( frame.args[1] or "")
local entity = mw.wikibase.getEntity(qid)
if not entity then
return
end
local link = entity:getSitelink( f )
if not link then
return
end
return link
end
function p.Dump(frame)
local f = (frame.args[1] or frame.args.id) and frame or frame:getParent()
local data = mw.wikibase.getEntity(f.args.id)
if not data then
return i18n.warnDump
end
local i = 1
while true do
local index = f.args[i]
if not index then
return "<pre>"..mw.dumpObject(data).."</pre>".. i18n.warnDump
end
data = data[index] or data[tonumber(index)]
if not data then
return i18n.warnDump
end
i = i + 1
end
end
return p
c22jj0e0fz2pf6664vq68mhx1eaeqw4
Templat:Flatlist
10
228719
2444325
484667
2022-08-13T14:55:06Z
David Wadie Fisher-Freberg
51
update
wikitext
text/x-wiki
<div class="hlist hlist-separated {{{class|}}}" {{#if:{{{style|}}}{{{indent|}}}|style="{{#if:{{{indent|}}}|margin-left: {{#expr:{{{indent}}}*1.6}}em;}} {{{style|}}}"}}>{{#if:{{{1|}}}|
{{{1}}}
</div>}}<noinclude></div>
{{documentation}}
</noinclude>
c8c9hiesbmhy95sd0yiemh58351exwt
Modul:WikidataIB
828
323401
2444283
1636271
2022-08-13T13:29:16Z
David Wadie Fisher-Freberg
51
update
Scribunto
text/plain
-- Version: 2021-02-06
-- Module to implement use of a blacklist and whitelist for infobox fields
-- Can take a named parameter |qid which is the Wikidata ID for the article
-- if not supplied, it will use the Wikidata ID associated with the current page.
-- Fields in blacklist are never to be displayed, i.e. module must return nil in all circumstances
-- Fields in whitelist return local value if it exists or the Wikidata value otherwise
-- The name of the field that this function is called from is passed in named parameter |name
-- The name is compulsory when blacklist or whitelist is used,
-- so the module returns nil if it is not supplied.
-- blacklist is passed in named parameter |suppressfields (or |spf)
-- whitelist is passed in named parameter |fetchwikidata (or |fwd)
local p = {}
local cdate -- initialise as nil and only load _complex_date function if needed
-- Module:Complex date is loaded lazily and has the following dependencies:
-- Module:Calendar
-- Module:ISOdate
-- Module:DateI18n
-- Module:No globals
-- Module:I18n/complex date
-- Module:Ordinal
-- Module:I18n/ordinal
-- Module:Yesno
-- Module:Formatnum
-- Module:Linguistic
--
-- The following, taken from https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times,
-- is needed to use Module:Complex date which seemingly requires date precision as a string.
-- It would work better if only the authors of the mediawiki page could spell 'millennium'.
local dp = {
[6] = "millennium",
[7] = "century",
[8] = "decade",
[9] = "year",
[10] = "month",
[11] = "day",
}
local i18n =
{
["errors"] =
{
["property-not-found"] = "Property not found.",
["No property supplied"] = "No property supplied",
["entity-not-found"] = "Wikidata entity not found.",
["unknown-claim-type"] = "Unknown claim type.",
["unknown-entity-type"] = "Unknown entity type.",
["qualifier-not-found"] = "Qualifier not found.",
["site-not-found"] = "Wikimedia project not found.",
["labels-not-found"] = "No labels found.",
["descriptions-not-found"] = "No descriptions found.",
["aliases-not-found"] = "No aliases found.",
["unknown-datetime-format"] = "Unknown datetime format.",
["local-article-not-found"] = "Article is available on Wikidata, but not on Wikipedia",
["dab-page"] = " (dab)",
},
["months"] =
{
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
},
["century"] = "century",
["BC"] = "BC",
["BCE"] = "BCE",
["ordinal"] =
{
[1] = "st",
[2] = "nd",
[3] = "rd",
["default"] = "th"
},
["filespace"] = "File",
["Unknown"] = "Unknown",
["NaN"] = "Not a number",
-- set the following to the name of a tracking category,
-- e.g. "[[Category:Articles with missing Wikidata information]]", or "" to disable:
["missinginfocat"] = "[[Category:Articles with missing Wikidata information]]",
["editonwikidata"] = "Edit this on Wikidata",
["latestdatequalifier"] = function (date) return "before " .. date end,
-- some languages, e.g. Bosnian use a period as a suffix after each number in a date
["datenumbersuffix"] = "",
["list separator"] = ", ",
["multipliers"] = {
[0] = "",
[3] = " thousand",
[6] = " million",
[9] = " billion",
[12] = " trillion",
}
}
-- This allows an internationisation module to override the above table
if 'en' ~= mw.getContentLanguage():getCode() then
require("Module:i18n").loadI18n("Module:WikidataIB/i18n", i18n)
end
-- This piece of html implements a collapsible container. Check the classes exist on your wiki.
local collapsediv = '<div class="mw-collapsible mw-collapsed" style="width:100%; overflow:auto;" data-expandtext="{{int:show}}" data-collapsetext="{{int:hide}}">'
-- Some items should not be linked.
-- Each wiki can create a list of those in Module:WikidataIB/nolinks
-- It should return a table called itemsindex, containing true for each item not to be linked
local donotlink = {}
local nolinks_exists, nolinks = pcall(mw.loadData, "Module:WikidataIB/nolinks")
if nolinks_exists then
donotlink = nolinks.itemsindex
end
-- To satisfy Wikipedia:Manual of Style/Titles, certain types of items are italicised, and others are quoted.
-- The submodule [[Module:WikidataIB/titleformats]] lists the entity-ids used in 'instance of' (P31),
-- which allows this module to identify the values that should be formatted.
-- WikidataIB/titleformats exports a table p.formats, which is indexed by entity-id, and contains the value " or ''
local formats = {}
local titleformats_exists, titleformats = pcall(mw.loadData, "Module:WikidataIB/titleformats")
if titleformats_exists then
formats = titleformats.formats
end
-------------------------------------------------------------------------------
-- Private functions
-------------------------------------------------------------------------------
--
-------------------------------------------------------------------------------
-- makeOrdinal needs to be internationalised along with the above:
-- takes cardinal number as a numeric and returns the ordinal as a string
-- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local makeOrdinal = function(cardinal)
local ordsuffix = i18n.ordinal.default
if cardinal % 10 == 1 then
ordsuffix = i18n.ordinal[1]
elseif cardinal % 10 == 2 then
ordsuffix = i18n.ordinal[2]
elseif cardinal % 10 == 3 then
ordsuffix = i18n.ordinal[3]
end
-- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th'
-- similarly for 12 and 13, etc.
if (cardinal % 100 == 11) or (cardinal % 100 == 12) or (cardinal % 100 == 13) then
ordsuffix = i18n.ordinal.default
end
return tostring(cardinal) .. ordsuffix
end
-------------------------------------------------------------------------------
-- findLang takes a "langcode" parameter if supplied and valid
-- otherwise it tries to create it from the user's set language ({{int:lang}})
-- failing that it uses the wiki's content language.
-- It returns a language object
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local findLang = function(langcode)
local langobj
langcode = mw.text.trim(langcode or "")
if mw.language.isKnownLanguageTag(langcode) then
langobj = mw.language.new( langcode )
else
langcode = mw.getCurrentFrame():preprocess( '{{int:lang}}' )
if mw.language.isKnownLanguageTag(langcode) then
langobj = mw.language.new( langcode )
else
langobj = mw.language.getContentLanguage()
end
end
return langobj
end
-------------------------------------------------------------------------------
-- _getItemLangCode takes a qid parameter (using the current page's qid if blank)
-- If the item for that qid has property country (P17) it looks at the first preferred value
-- If the country has an official language (P37), it looks at the first preferred value
-- If that official language has a language code (P424), it returns the first preferred value
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local _getItemLangCode = function(qid)
qid = mw.text.trim(qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return end
local prop17 = mw.wikibase.getBestStatements(qid, "P17")[1]
if not prop17 or prop17.mainsnak.snaktype ~= "value" then return end
local qid17 = prop17.mainsnak.datavalue.value.id
local prop37 = mw.wikibase.getBestStatements(qid17, "P37")[1]
if not prop37 or prop37.mainsnak.snaktype ~= "value" then return end
local qid37 = prop37.mainsnak.datavalue.value.id
local prop424 = mw.wikibase.getBestStatements(qid37, "P424")[1]
if not prop424 or prop424.mainsnak.snaktype ~= "value" then return end
return prop424.mainsnak.datavalue.value
end
-------------------------------------------------------------------------------
-- roundto takes a number (x)
-- and returns it rounded to (sf) significant figures
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local roundto = function(x, sf)
if x == 0 then return 0 end
local s = 1
if x < 0 then
x = -x
s = -1
end
if sf < 1 then sf = 1 end
local p = 10 ^ (math.floor(math.log10(x)) - sf + 1)
x = math.floor(x / p + 0.5) * p * s
-- if it's integral, cast to an integer:
if x == math.floor(x) then x = math.floor(x) end
return x
end
-------------------------------------------------------------------------------
-- decimalToDMS takes a decimal degrees (x) with precision (p)
-- and returns degrees/minutes/seconds according to the precision
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local decimalToDMS = function(x, p)
-- if p is not supplied, use a precision around 0.1 seconds
if not tonumber(p) then p = 1e-4 end
local d = math.floor(x)
local ms = (x - d) * 60
if p > 0.5 then -- precision is > 1/2 a degree
if ms > 30 then d = d + 1 end
ms = 0
end
local m = math.floor(ms)
local s = (ms - m) * 60
if p > 0.008 then -- precision is > 1/2 a minute
if s > 30 then m = m +1 end
s = 0
elseif p > 0.00014 then -- precision is > 1/2 a second
s = math.floor(s + 0.5)
elseif p > 0.000014 then -- precision is > 1/20 second
s = math.floor(10 * s + 0.5) / 10
elseif p > 0.0000014 then -- precision is > 1/200 second
s = math.floor(100 * s + 0.5) / 100
else -- cap it at 3 dec places for now
s = math.floor(1000 * s + 0.5) / 1000
end
return d, m, s
end
-------------------------------------------------------------------------------
-- decimalPrecision takes a decimal (x) with precision (p)
-- and returns x rounded approximately to the given precision
-- precision should be between 1 and 1e-6, preferably a power of 10.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local decimalPrecision = function(x, p)
local s = 1
if x < 0 then
x = -x
s = -1
end
-- if p is not supplied, pick an arbitrary precision
if not tonumber(p) then p = 1e-4
elseif p > 1 then p = 1
elseif p < 1e-6 then p = 1e-6
else p = 10 ^ math.floor(math.log10(p))
end
x = math.floor(x / p + 0.5) * p * s
-- if it's integral, cast to an integer:
if x == math.floor(x) then x = math.floor(x) end
-- if it's less than 1e-4, it will be in exponent form, so return a string with 6dp
-- 9e-5 becomes 0.000090
if math.abs(x) < 1e-4 then x = string.format("%f", x) end
return x
end
-------------------------------------------------------------------------------
-- formatDate takes a datetime of the usual format from mw.wikibase.entity:formatPropertyValues
-- like "1 August 30 BCE" as parameter 1
-- and formats it according to the df (date format) and bc parameters
-- df = ["dmy" / "mdy" / "y"] default will be "dmy"
-- bc = ["BC" / "BCE"] default will be "BCE"
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local format_Date = function(datetime, dateformat, bc)
local datetime = datetime or "1 August 30 BCE" -- in case of nil value
-- chop off multiple vales and/or any hours, mins, etc.
-- keep anything before punctuation - we just want a single date:
local dateval = string.match( datetime, "[%w ]+")
local dateformat = string.lower(dateformat or "dmy") -- default to dmy
local bc = string.upper(bc or "") -- can't use nil for bc
-- we only want to accept two possibilities: BC or default to BCE
if bc == "BC" then
bc = " " .. i18n["BC"] -- prepend a non-breaking space.
else
bc = " " .. i18n["BCE"]
end
local postchrist = true -- start by assuming no BCE
local dateparts = {}
for word in string.gmatch(dateval, "%w+") do
if word == "BCE" or word == "BC" then -- *** internationalise later ***
postchrist = false
else
-- we'll keep the parts that are not 'BCE' in a table
dateparts[#dateparts + 1] = word
end
end
if postchrist then bc = "" end -- set AD dates to no suffix *** internationalise later ***
local sep = " " -- separator is nbsp
local fdate = table.concat(dateparts, sep) -- set formatted date to same order as input
-- if we have day month year, check dateformat
if #dateparts == 3 then
if dateformat == "y" then
fdate = dateparts[3]
elseif dateformat == "mdy" then
fdate = dateparts[2] .. sep .. dateparts[1] .. "," .. sep .. dateparts[3]
end
elseif #dateparts == 2 and dateformat == "y" then
fdate = dateparts[2]
end
return fdate .. bc
end
-------------------------------------------------------------------------------
-- dateFormat is the handler for properties that are of type "time"
-- It takes timestamp, precision (6 to 11 per mediawiki), dateformat (y/dmy/mdy), BC format (BC/BCE),
-- a plaindate switch (yes/no/adj) to en/disable "sourcing circumstances"/use adjectival form,
-- any qualifiers for the property, the language, and any adjective to use like 'before'.
-- It passes the date through the "complex date" function
-- and returns a string with the internatonalised date formatted according to preferences.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); cdate(); dp[]
-------------------------------------------------------------------------------
local dateFormat = function(timestamp, dprec, df, bcf, pd, qualifiers, lang, adj, model)
-- output formatting according to preferences (y/dmy/mdy/ymd)
df = (df or ""):lower()
-- if ymd is required, return the part of the timestamp in YYYY-MM-DD form
-- but apply Year zero#Astronomers fix: 1 BC = 0000; 2 BC = -0001; etc.
if df == "ymd" then
if timestamp:sub(1,1) == "+" then
return timestamp:sub(2,11)
else
local yr = tonumber(timestamp:sub(2,5)) - 1
yr = ("000" .. yr):sub(-4)
if yr ~= "0000" then yr = "-" .. yr end
return yr .. timestamp:sub(6,11)
end
end
-- A year can be stored like this: "+1872-00-00T00:00:00Z",
-- which is processed here as if it were the day before "+1872-01-01T00:00:00Z",
-- and that's the last day of 1871, so the year is wrong.
-- So fix the month 0, day 0 timestamp to become 1 January instead:
timestamp = timestamp:gsub("%-00%-00T", "-01-01T")
-- just in case date precision is missing
dprec = dprec or 11
-- override more precise dates if required dateformat is year alone:
if df == "y" and dprec > 9 then dprec = 9 end
-- complex date only deals with precisions from 6 to 11, so clip range
dprec = dprec>11 and 11 or dprec
dprec = dprec<6 and 6 or dprec
-- BC format is "BC" or "BCE"
bcf = (bcf or ""):upper()
-- plaindate only needs the first letter (y/n/a)
pd = (pd or ""):sub(1,1):lower()
if pd == "" or pd == "n" or pd == "f" or pd == "0" then pd = false end
-- in case language isn't passed
lang = lang or findLang().code
-- set adj as empty if nil
adj = adj or ""
-- extract the day, month, year from the timestamp
local bc = timestamp:sub(1, 1)=="-" and "BC" or ""
local year, month, day = timestamp:match("[+-](%d*)-(%d*)-(%d*)T")
local iso = tonumber(year) -- if year is missing, let it throw an error
-- this will adjust the date format to be compatible with cdate
-- possible formats are Y, YY, YYY0, YYYY, YYYY-MM, YYYY-MM-DD
if dprec == 6 then iso = math.floor( (iso - 1) / 1000 ) + 1 end
if dprec == 7 then iso = math.floor( (iso - 1) / 100 ) + 1 end
if dprec == 8 then iso = math.floor( iso / 10 ) .. "0" end
if dprec == 10 then iso = year .. "-" .. month end
if dprec == 11 then iso = year .. "-" .. month .. "-" .. day end
-- add "circa" (Q5727902) from "sourcing circumstances" (P1480)
local sc = not pd and qualifiers and qualifiers.P1480
if sc then
for k1, v1 in pairs(sc) do
if v1.datavalue and v1.datavalue.value.id == "Q5727902" then
adj = "circa"
break
end
end
end
-- deal with Julian dates:
-- no point in saying that dates before 1582 are Julian - they are by default
-- doesn't make sense for dates less precise than year
-- we can suppress it by setting |plaindate, e.g. for use in constructing categories.
local calendarmodel = ""
if tonumber(year) > 1582
and dprec > 8
and not pd
and model == "http://www.wikidata.org/entity/Q1985786" then
calendarmodel = "julian"
end
if not cdate then
cdate = require("Module:Complex date")._complex_date
end
local fdate = cdate(calendarmodel, adj, tostring(iso), dp[dprec], bc, "", "", "", "", lang, 1)
-- this may have QuickStatements info appended to it in a div, so remove that
fdate = fdate:gsub(' <div style="display: none;">[^<]*</div>', '')
-- it may also be returned wrapped in a microformat, so remove that
fdate = fdate:gsub("<[^>]*>", "")
-- there may be leading zeros that we should remove
fdate = fdate:gsub("^0*", "")
-- if a plain date is required, then remove any links (like BC linked)
if pd then
fdate = fdate:gsub("%[%[.*|", ""):gsub("]]", "")
end
-- if 'circa', use the abbreviated form *** internationalise later ***
fdate = fdate:gsub('circa ', '<abbr title="circa">c.</abbr> ')
-- deal with BC/BCE
if bcf == "BCE" then
fdate = fdate:gsub('BC', 'BCE')
end
-- deal with mdy format
if df == "mdy" then
fdate = fdate:gsub("(%d+) (%w+) (%d+)", "%2 %1, %3")
end
-- deal with adjectival form *** internationalise later ***
if pd == "a" then
fdate = fdate:gsub(' century', '-century')
end
return fdate
end
-------------------------------------------------------------------------------
-- parseParam takes a (string) parameter, e.g. from the list of frame arguments,
-- and makes "false", "no", and "0" into the (boolean) false
-- it makes the empty string and nil into the (boolean) value passed as default
-- allowing the parameter to be true or false by default.
-- It returns a boolean.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local parseParam = function(param, default)
if type(param) == "boolean" then param = tostring(param) end
if param and param ~= "" then
param = param:lower()
if (param == "false") or (param:sub(1,1) == "n") or (param == "0") then
return false
else
return true
end
else
return default
end
end
-------------------------------------------------------------------------------
-- _getSitelink takes the qid of a Wikidata entity passed as |qid=
-- It takes an optional parameter |wiki= to determine which wiki is to be checked for a sitelink
-- If the parameter is blank, then it uses the local wiki.
-- If there is a sitelink to an article available, it returns the plain text link to the article
-- If there is no sitelink, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local _getSitelink = function(qid, wiki)
qid = (qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
wiki = wiki or ""
local sitelink
if wiki == "" then
sitelink = mw.wikibase.getSitelink(qid)
else
sitelink = mw.wikibase.getSitelink(qid, wiki)
end
return sitelink
end
-------------------------------------------------------------------------------
-- _getCommonslink takes an optional qid of a Wikidata entity passed as |qid=
-- It returns one of the following in order of preference:
-- the Commons sitelink of the Wikidata entity - but not if onlycat=true and it's not a category;
-- the Commons sitelink of the topic's main category of the Wikidata entity;
-- the Commons category of the Wikidata entity - unless fallback=false.
-------------------------------------------------------------------------------
-- Dependencies: _getSitelink(); parseParam()
-------------------------------------------------------------------------------
local _getCommonslink = function(qid, onlycat, fallback)
qid = (qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
onlycat = parseParam(onlycat, false)
if fallback == "" then fallback = nil end
local sitelink = _getSitelink(qid, "commonswiki")
if onlycat and sitelink and sitelink:sub(1,9) ~= "Category:" then sitelink = nil end
if not sitelink then
-- check for topic's main category
local prop910 = mw.wikibase.getBestStatements(qid, "P910")[1]
if prop910 then
local tmcid = prop910.mainsnak.datavalue and prop910.mainsnak.datavalue.value.id
sitelink = _getSitelink(tmcid, "commonswiki")
end
if not sitelink then
-- check for list's main category
local prop1754 = mw.wikibase.getBestStatements(qid, "P1754")[1]
if prop1754 then
local tmcid = prop1754.mainsnak.datavalue and prop1754.mainsnak.datavalue.value.id
sitelink = _getSitelink(tmcid, "commonswiki")
end
end
end
if not sitelink and fallback then
-- check for Commons category (string value)
local prop373 = mw.wikibase.getBestStatements(qid, "P373")[1]
if prop373 then
sitelink = prop373.mainsnak.datavalue and prop373.mainsnak.datavalue.value
if sitelink then sitelink = "Category:" .. sitelink end
end
end
return sitelink
end
-------------------------------------------------------------------------------
-- The label in a Wikidata item is subject to vulnerabilities
-- that an attacker might try to exploit.
-- It needs to be 'sanitised' by removing any wikitext before use.
-- If it doesn't exist, return the id for the item
-- a second (boolean) value is also returned, value is true when the label exists
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local labelOrId = function(id, lang)
if lang == "default" then lang = findLang().code end
local label
if lang then
label = mw.wikibase.getLabelByLang(id, lang)
else
label = mw.wikibase.getLabel(id)
end
if label then
return mw.text.nowiki(label), true
else
return id, false
end
end
-------------------------------------------------------------------------------
-- linkedItem takes an entity-id and returns a string, linked if possible.
-- This is the handler for "wikibase-item". Preferences:
-- 1. Display linked disambiguated sitelink if it exists
-- 2. Display linked label if it is a redirect
-- 3. TBA: Display an inter-language link for the label if it exists other than in default language
-- 4. Display unlinked label if it exists
-- 5. Display entity-id for now to indicate a label could be provided
-- dtxt is text to be used instead of label, or nil.
-- shortname is boolean switch to use P1813 (short name) instead of label if true.
-- lang is the current language code.
-- uselbl is boolean switch to force display of the label instead of the sitelink (default: false)
-- linkredir is boolean switch to allow linking to a redirect (default: false)
-- formatvalue is boolean switch to allow formatting as italics or quoted (default: false)
-------------------------------------------------------------------------------
-- Dependencies: labelOrId(); donotlink[]
-------------------------------------------------------------------------------
local linkedItem = function(id, args)
local lprefix = (args.lp or args.lprefix or args.linkprefix or ""):gsub('"', '') -- toughen against nil values passed
local lpostfix = (args.lpostfix or ""):gsub('"', '')
local prefix = (args.prefix or ""):gsub('"', '')
local postfix = (args.postfix or ""):gsub('"', '')
local dtxt = args.dtxt
local shortname = args.shortname
local lang = args.lang or "en" -- fallback to default if missing
local uselbl = args.uselabel or args.uselbl
uselbl = parseParam(uselbl, false)
local linkredir = args.linkredir
linkredir = parseParam(linkredir, false)
local formatvalue = args.formatvalue or args.fv
formatvalue = parseParam(formatvalue, false)
-- see if item might need italics or quotes
local fmt = ""
if next(formats) and formatvalue then
for k, v in ipairs( mw.wikibase.getBestStatements(id, "P31") ) do
if v.mainsnak.datavalue and formats[v.mainsnak.datavalue.value.id] then
fmt = formats[v.mainsnak.datavalue.value.id]
break -- pick the first match
end
end
end
local disp
local sitelink = mw.wikibase.getSitelink(id)
local label, islabel
if dtxt then
label, islabel = dtxt, true
elseif shortname then
-- see if there is a shortname in our language, and set label to it
for k, v in ipairs( mw.wikibase.getBestStatements(id, "P1813") ) do
if v.mainsnak.datavalue.value.language == lang then
label, islabel = v.mainsnak.datavalue.value.text, true
break
end -- test for language match
end -- loop through values of short name
-- if we have no label set, then there was no shortname available
if not islabel then
label, islabel = labelOrId(id)
shortname = false
end
else
label, islabel = labelOrId(id)
end
if mw.site.siteName ~= "Wikimedia Commons" then
if sitelink then
if not (dtxt or shortname) then
-- if sitelink and label are the same except for case, no need to process further
if sitelink:lower() ~= label:lower() then
-- strip any namespace or dab from the sitelink
local pos = sitelink:find(":") or 0
local slink = sitelink
if pos > 0 then
local pfx = sitelink:sub(1,pos-1)
if mw.site.namespaces[pfx] then -- that prefix is a valid namespace, so remove it
slink = sitelink:sub(pos+1)
end
end
-- remove stuff after commas or inside parentheses - ie. dabs
slink = slink:gsub("%s%(.+%)$", ""):gsub(",.+$", "")
-- if uselbl is false, use sitelink instead of label
if not uselbl then
-- use slink as display, preserving label case - find("^%u") is true for 1st char uppercase
if label:find("^%u") then
label = slink:gsub("^(%l)", string.upper)
else
label = slink:gsub("^(%u)", string.lower)
end
end
end
end
if donotlink[label] then
disp = prefix .. fmt .. label .. fmt .. postfix
else
disp = "[[" .. lprefix .. sitelink .. lpostfix .. "|" .. prefix .. fmt .. label .. fmt .. postfix .. "]]"
end
elseif islabel then
-- no sitelink, label exists, so check if a redirect with that title exists, if linkredir is true
-- display plain label by default
disp = prefix .. fmt .. label .. fmt .. postfix
if linkredir then
local artitle = mw.title.new(label, 0) -- only nil if label has invalid chars
if not donotlink[label] and artitle and artitle.redirectTarget then
-- there's a redirect with the same title as the label, so let's link to that
disp = "[[".. lprefix .. label .. lpostfix .. "|" .. prefix .. fmt .. label .. fmt .. postfix .. "]]"
end
end -- test if article title exists as redirect on current Wiki
else
-- no sitelink and no label, so return whatever was returned from labelOrId for now
-- add tracking category [[Category:Articles with missing Wikidata information]]
-- for enwiki, just return the tracking category
if mw.wikibase.getGlobalSiteId() == "enwiki" then
disp = i18n.missinginfocat
else
disp = prefix .. label .. postfix .. i18n.missinginfocat
end
end
else
local ccat = mw.wikibase.getBestStatements(id, "P373")[1]
if ccat and ccat.mainsnak.datavalue then
ccat = ccat.mainsnak.datavalue.value
disp = "[[" .. lprefix .. "Category:" .. ccat .. lpostfix .. "|" .. prefix .. label .. postfix .. "]]"
elseif sitelink then
-- this asumes that if a sitelink exists, then a label also exists
disp = "[[" .. lprefix .. sitelink .. lpostfix .. "|" .. prefix .. label .. postfix .. "]]"
else
-- no sitelink and no Commons cat, so return label from labelOrId for now
disp = prefix .. label .. postfix
end
end
return disp
end
-------------------------------------------------------------------------------
-- sourced takes a table representing a statement that may or may not have references
-- it looks for a reference sourced to something not containing the word "wikipedia"
-- it returns a boolean = true if it finds a sourced reference.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local sourced = function(claim)
if claim.references then
for kr, vr in pairs(claim.references) do
local ref = mw.wikibase.renderSnaks(vr.snaks)
if not ref:find("Wiki") then
return true
end
end
end
end
-------------------------------------------------------------------------------
-- setRanks takes a flag (parameter passed) that requests the values to return
-- "b[est]" returns preferred if available, otherwise normal
-- "p[referred]" returns preferred
-- "n[ormal]" returns normal
-- "d[eprecated]" returns deprecated
-- multiple values are allowed, e.g. "preferred normal" (which is the default)
-- "best" will override the other flags, and set p and n
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local setRanks = function(rank)
rank = (rank or ""):lower()
-- if nothing passed, return preferred and normal
-- if rank == "" then rank = "p n" end
local ranks = {}
for w in string.gmatch(rank, "%a+") do
w = w:sub(1,1)
if w == "b" or w == "p" or w == "n" or w == "d" then
ranks[w] = true
end
end
-- check if "best" is requested or no ranks requested; and if so, set preferred and normal
if ranks.b or not next(ranks) then
ranks.p = true
ranks.n = true
end
return ranks
end
-------------------------------------------------------------------------------
-- parseInput processes the Q-id , the blacklist and the whitelist
-- if an input parameter is supplied, it returns that and ends the call.
-- it returns (1) either the qid or nil indicating whether or not the call should continue
-- and (2) a table containing all of the statements for the propertyID and relevant Qid
-- if "best" ranks are requested, it returns those instead of all non-deprecated ranks
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local parseInput = function(frame, input_parm, property_id)
-- There may be a local parameter supplied, if it's blank, set it to nil
input_parm = mw.text.trim(input_parm or "")
if input_parm == "" then input_parm = nil end
-- return nil if Wikidata is not available
if not mw.wikibase then return false, input_parm end
local args = frame.args
-- can take a named parameter |qid which is the Wikidata ID for the article.
-- if it's not supplied, use the id for the current page
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
-- if there's no Wikidata item for the current page return nil
if not qid then return false, input_parm end
-- The blacklist is passed in named parameter |suppressfields
local blacklist = args.suppressfields or args.spf or ""
-- The whitelist is passed in named parameter |fetchwikidata
local whitelist = args.fetchwikidata or args.fwd or ""
if whitelist == "" then whitelist = "NONE" end
-- The name of the field that this function is called from is passed in named parameter |name
local fieldname = args.name or ""
if blacklist ~= "" then
-- The name is compulsory when blacklist is used, so return nil if it is not supplied
if fieldname == "" then return false, nil end
-- If this field is on the blacklist, then return nil
if blacklist:find(fieldname) then return false, nil end
end
-- If we got this far then we're not on the blacklist
-- The blacklist overrides any locally supplied parameter as well
-- If a non-blank input parameter was supplied return it
if input_parm then return false, input_parm end
-- We can filter out non-valid properties
if property_id:sub(1,1):upper() ~="P" or property_id == "P0" then return false, nil end
-- Otherwise see if this field is on the whitelist:
-- needs a bit more logic because find will return its second value = 0 if fieldname is ""
-- but nil if fieldname not found on whitelist
local _, found = whitelist:find(fieldname)
found = ((found or 0) > 0)
if whitelist ~= 'ALL' and (whitelist:upper() == "NONE" or not found) then
return false, nil
end
-- See what's on Wikidata (the call always returns a table, but it may be empty):
local props = {}
if args.reqranks.b then
props = mw.wikibase.getBestStatements(qid, property_id)
else
props = mw.wikibase.getAllStatements(qid, property_id)
end
if props[1] then
return qid, props
end
-- no property on Wikidata
return false, nil
end
-------------------------------------------------------------------------------
-- createicon assembles the "Edit at Wikidata" pen icon.
-- It returns a wikitext string inside a span class="penicon"
-- if entityID is nil or empty, the ID associated with current page is used
-- langcode and propertyID may be nil or empty
-------------------------------------------------------------------------------
-- Dependencies: i18n[];
-------------------------------------------------------------------------------
local createicon = function(langcode, entityID, propertyID)
langcode = langcode or ""
if not entityID or entityID == "" then entityID= mw.wikibase.getEntityIdForCurrentPage() end
propertyID = propertyID or ""
local icon = " <span class='penicon autoconfirmed-show'>[["
-- " <span data-bridge-edit-flow='overwrite' class='penicon'>[[" -> enable Wikidata Bridge
.. i18n["filespace"]
.. ":OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt="
.. i18n["editonwikidata"]
.. "|link=https://www.wikidata.org/wiki/" .. entityID
if langcode ~= "" then icon = icon .. "?uselang=" .. langcode end
if propertyID ~= "" then icon = icon .. "#" .. propertyID end
icon = icon .. "|" .. i18n["editonwikidata"] .. "]]</span>"
return icon
end
-------------------------------------------------------------------------------
-- assembleoutput takes the sequence table containing the property values
-- and formats it according to switches given. It returns a string or nil.
-- It uses the entityID (and optionally propertyID) to create a link in the pen icon.
-------------------------------------------------------------------------------
-- Dependencies: parseParam();
-------------------------------------------------------------------------------
local assembleoutput = function(out, args, entityID, propertyID)
-- sorted is a boolean passed to enable sorting of the values returned
-- if nothing or an empty string is passed set it false
-- if "false" or "no" or "0" is passed set it false
local sorted = parseParam(args.sorted, false)
-- noicon is a boolean passed to suppress the trailing "edit at Wikidata" icon
-- for use when the value is processed further by the infobox
-- if nothing or an empty string is passed set it false
-- if "false" or "no" or "0" is passed set it false
local noic = parseParam(args.noicon, false)
-- list is the name of a template that a list of multiple values is passed through
-- examples include "hlist" and "ubl"
-- setting it to "prose" produces something like "1, 2, 3, and 4"
local list = args.list or ""
-- sep is a string that is used to separate multiple returned values
-- if nothing or an empty string is passed set it to the default
-- any double-quotes " are stripped out, so that spaces may be passed
-- e.g. |sep=" - "
local sepdefault = i18n["list separator"]
local separator = args.sep or ""
separator = string.gsub(separator, '"', '')
if separator == "" then
separator = sepdefault
end
-- collapse is a number that determines the maximum number of returned values
-- before the output is collapsed.
-- Zero or not a number result in no collapsing (default becomes 0).
local collapse = tonumber(args.collapse) or 0
-- replacetext (rt) is a string that is returned instead of any non-empty Wikidata value
-- this is useful for tracking and debugging
local replacetext = mw.text.trim(args.rt or args.replacetext or "")
-- if there's anything to return, then return a list
-- comma-separated by default, but may be specified by the sep parameter
-- optionally specify a hlist or ubl or a prose list, etc.
local strout
if #out > 0 then
if sorted then table.sort(out) end
-- if there's something to display and a pen icon is wanted, add it the end of the last value
local hasdisplay = false
for i, v in ipairs(out) do
if v ~= i18n.missinginfocat then
hasdisplay = true
break
end
end
if not noic and hasdisplay then
out[#out] = out[#out] .. createicon(args.langobj.code, entityID, propertyID)
end
if list == "" then
strout = table.concat(out, separator)
elseif list:lower() == "prose" then
strout = mw.text.listToText( out )
else
strout = mw.getCurrentFrame():expandTemplate{title = list, args = out}
end
if collapse >0 and #out > collapse then
strout = collapsediv .. strout .. "</div>"
end
else
strout = nil -- no items had valid reference
end
if replacetext ~= "" and strout then strout = replacetext end
return strout
end
-------------------------------------------------------------------------------
-- rendersnak takes a table (propval) containing the information stored on one property value
-- and returns the value as a string and its language if monolingual text.
-- It handles data of type:
-- wikibase-item
-- time
-- string, url, commonsMedia, external-id
-- quantity
-- globe-coordinate
-- monolingualtext
-- It also requires linked, the link/pre/postfixes, uabbr, and the arguments passed from frame.
-- The optional filter parameter allows quantities to be be filtered by unit Qid.
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); labelOrId(); i18n[]; dateFormat();
-- roundto(); decimalPrecision(); decimalToDMS(); linkedItem();
-------------------------------------------------------------------------------
local rendersnak = function(propval, args, linked, lpre, lpost, pre, post, uabbr, filter)
lpre = lpre or ""
lpost = lpost or ""
pre = pre or ""
post = post or ""
args.lang = args.lang or findLang().code
-- allow values to display a fixed text instead of label
local dtxt = args.displaytext or args.dt
if dtxt == "" then dtxt = nil end
-- switch to use display of short name (P1813) instead of label
local shortname = args.shortname or args.sn
shortname = parseParam(shortname, false)
local snak = propval.mainsnak or propval
local dtype = snak.datatype
local dv = snak.datavalue
dv = dv and dv.value
-- value and monolingual text language code returned
local val, mlt
if propval.rank and not args.reqranks[propval.rank:sub(1, 1)] then
-- val is nil: value has a rank that isn't requested
------------------------------------
elseif snak.snaktype == "somevalue" then -- value is unknown
val = i18n["Unknown"]
------------------------------------
elseif snak.snaktype == "novalue" then -- value is none
-- val = "No value" -- don't return anything
------------------------------------
elseif dtype == "wikibase-item" then -- data type is a wikibase item:
-- it's wiki-linked value, so output as link if enabled and possible
local qnumber = dv.id
if linked then
val = linkedItem(qnumber, args)
else -- no link wanted so check for display-text, otherwise test for lang code
local label, islabel
if dtxt then
label = dtxt
else
label, islabel = labelOrId(qnumber)
local langlabel = mw.wikibase.getLabelByLang(qnumber, args.lang)
if langlabel then
label = mw.text.nowiki( langlabel )
end
end
val = pre .. label .. post
end -- test for link required
------------------------------------
elseif dtype == "time" then -- data type is time:
-- time is in timestamp format
-- date precision is integer per mediawiki
-- output formatting according to preferences (y/dmy/mdy)
-- BC format as BC or BCE
-- plaindate is passed to disable looking for "sourcing cirumstances"
-- or to set the adjectival form
-- qualifiers (if any) is a nested table or nil
-- lang is given, or user language, or site language
--
-- Here we can check whether args.df has a value
-- If not, use code from Module:Sandbox/RexxS/Getdateformat to set it from templates like {{Use mdy dates}}
val = dateFormat(dv.time, dv.precision, args.df, args.bc, args.pd, propval.qualifiers, args.lang, "", dv.calendarmodel)
------------------------------------
-- data types which are strings:
elseif dtype == "commonsMedia" or dtype == "external-id" or dtype == "string" or dtype == "url" then
-- commonsMedia or external-id or string or url
-- all have mainsnak.datavalue.value as string
if (lpre == "" or lpre == ":") and lpost == "" then
-- don't link if no linkpre/postfix or linkprefix is just ":"
val = pre .. dv .. post
elseif dtype == "external-id" then
val = "[" .. lpre .. dv .. lpost .. " " .. pre .. dv .. post .. "]"
else
val = "[[" .. lpre .. dv .. lpost .. "|" .. pre .. dv .. post .. "]]"
end -- check for link requested (i.e. either linkprefix or linkpostfix exists)
------------------------------------
-- data types which are quantities:
elseif dtype == "quantity" then
-- quantities have mainsnak.datavalue.value.amount and mainsnak.datavalue.value.unit
-- the unit is of the form http://www.wikidata.org/entity/Q829073
--
-- implement a switch to turn on/off numerical formatting later
local fnum = true
--
-- a switch to turn on/off conversions - only for en-wiki
local conv = parseParam(args.conv or args.convert, false)
-- if we have conversions, we won't have formatted numbers or scales
if conv then
uabbr = true
fnum = false
args.scale = "0"
end
--
-- a switch to turn on/off showing units, default is true
local showunits = parseParam(args.su or args.showunits, true)
--
-- convert amount to a number
local amount = tonumber(dv.amount) or i18n["NaN"]
--
-- scale factor for millions, billions, etc.
local sc = tostring(args.scale or ""):sub(1,1):lower()
local scale
if sc == "a" then
-- automatic scaling
if amount > 1e15 then
scale = 12
elseif amount > 1e12 then
scale = 9
elseif amount > 1e9 then
scale = 6
elseif amount > 1e6 then
scale = 3
else
scale = 0
end
else
scale = tonumber(args.scale) or 0
if scale < 0 or scale > 12 then scale = 0 end
scale = math.floor(scale/3) * 3
end
local factor = 10^scale
amount = amount / factor
-- ranges:
local range = ""
-- check if upper and/or lower bounds are given and significant
local upb = tonumber(dv.upperBound)
local lowb = tonumber(dv.lowerBound)
if upb and lowb then
-- differences rounded to 2 sig fig:
local posdif = roundto(upb - amount, 2) / factor
local negdif = roundto(amount - lowb, 2) / factor
upb, lowb = amount + posdif, amount - negdif
-- round scaled numbers to integers or 4 sig fig
if (scale > 0 or sc == "a") then
if amount < 1e4 then
amount = roundto(amount, 4)
else
amount = math.floor(amount + 0.5)
end
end
if fnum then amount = args.langobj:formatNum( amount ) end
if posdif ~= negdif then
-- non-symmetrical
range = " +" .. posdif .. " -" .. negdif
elseif posdif ~= 0 then
-- symmetrical and non-zero
range = " ±" .. posdif
else
-- otherwise range is zero, so leave it as ""
end
else
-- round scaled numbers to integers or 4 sig fig
if (scale > 0 or sc == "a") then
if amount < 1e4 then
amount = roundto(amount, 4)
else
amount = math.floor(amount + 0.5)
end
end
if fnum then amount = args.langobj:formatNum( amount ) end
end
-- unit names and symbols:
-- extract the qid in the form 'Qnnn' from the value.unit url
-- and then fetch the label from that - or symbol if unitabbr is true
local unit = ""
local usep = ""
local usym = ""
local unitqid = string.match( dv.unit, "(Q%d+)" )
if filter and unitqid ~= filter then return nil end
if unitqid and showunits then
local uname = mw.wikibase.getLabelByLang(unitqid, args.lang) or ""
if uname ~= "" then usep, unit = " ", uname end
if uabbr then
-- see if there's a unit symbol (P5061)
local unitsymbols = mw.wikibase.getBestStatements(unitqid, "P5061")
-- construct fallback table, add local lang and multiple languages
local fbtbl = mw.language.getFallbacksFor( args.lang )
table.insert( fbtbl, 1, args.lang )
table.insert( fbtbl, 1, "mul" )
local found = false
for idx1, us in ipairs(unitsymbols) do
for idx2, fblang in ipairs(fbtbl) do
if us.mainsnak.datavalue.value.language == fblang then
usym = us.mainsnak.datavalue.value.text
found = true
break
end
if found then break end
end -- loop through fallback table
end -- loop through values of P5061
if found then usep, unit = " ", usym end
end
end
-- format display:
if conv then
if range == "" then
val = mw.getCurrentFrame():expandTemplate{title = "cvt", args = {amount, unit}}
else
val = mw.getCurrentFrame():expandTemplate{title = "cvt", args = {lowb, "to", upb, unit}}
end
elseif unit == "$" or unit == "£" then
val = unit .. amount .. range .. i18n.multipliers[scale]
else
val = amount .. range .. i18n.multipliers[scale] .. usep .. unit
end
------------------------------------
-- datatypes which are global coordinates:
elseif dtype == "globe-coordinate" then
-- 'display' parameter defaults to "inline, title" *** unused for now ***
-- local disp = args.display or ""
-- if disp == "" then disp = "inline, title" end
--
-- format parameter switches from deg/min/sec to decimal degrees
-- default is deg/min/sec -- decimal degrees needs |format = dec
local form = (args.format or ""):lower():sub(1,3)
if form ~= "dec" then form = "dms" end -- not needed for now
--
-- show parameter allows just the latitude, or just the longitude, or both
-- to be returned as a signed decimal, ignoring the format parameter.
local show = (args.show or ""):lower()
if show ~= "longlat" then show = show:sub(1,3) end
--
local lat, long, prec = dv.latitude, dv.longitude, dv.precision
if show == "lat" then
val = decimalPrecision(lat, prec)
elseif show == "lon" then
val = decimalPrecision(long, prec)
elseif show == "longlat" then
val = decimalPrecision(long, prec) .. ", " .. decimalPrecision(lat, prec)
else
local ns = "N"
local ew = "E"
if lat < 0 then
ns = "S"
lat = - lat
end
if long < 0 then
ew = "W"
long = - long
end
if form == "dec" then
lat = decimalPrecision(lat, prec)
long = decimalPrecision(long, prec)
val = lat .. "°" .. ns .. " " .. long .. "°" .. ew
else
local latdeg, latmin, latsec = decimalToDMS(lat, prec)
local longdeg, longmin, longsec = decimalToDMS(long, prec)
if latsec == 0 and longsec == 0 then
if latmin == 0 and longmin == 0 then
val = latdeg .. "°" .. ns .. " " .. longdeg .. "°" .. ew
else
val = latdeg .. "°" .. latmin .. "′" .. ns .. " "
val = val .. longdeg .. "°".. longmin .. "′" .. ew
end
else
val = latdeg .. "°" .. latmin .. "′" .. latsec .. "″" .. ns .. " "
val = val .. longdeg .. "°" .. longmin .. "′" .. longsec .. "″" .. ew
end
end
end
------------------------------------
elseif dtype == "monolingualtext" then -- data type is Monolingual text:
-- has mainsnak.datavalue.value as a table containing language/text pairs
-- collect all the values in 'out' and languages in 'mlt' and process them later
val = pre .. dv.text .. post
mlt = dv.language
------------------------------------
else
-- some other data type so write a specific handler
val = "unknown data type: " .. dtype
end -- of datatype/unknown value/sourced check
return val, mlt
end
-------------------------------------------------------------------------------
-- propertyvalueandquals takes a property object, the arguments passed from frame,
-- and a qualifier propertyID.
-- It returns a sequence (table) of values representing the values of that property
-- and qualifiers that match the qualifierID if supplied.
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); sourced(); labelOrId(); i18n.latestdatequalifier(); format_Date();
-- makeOrdinal(); roundto(); decimalPrecision(); decimalToDMS(); assembleoutput();
-------------------------------------------------------------------------------
local function propertyvalueandquals(objproperty, args, qualID)
-- needs this style of declaration because it's re-entrant
-- onlysourced is a boolean passed to return only values sourced to other than Wikipedia
-- if nothing or an empty string is passed set it true
local onlysrc = parseParam(args.onlysourced or args.osd, true)
-- linked is a a boolean that enables the link to a local page via sitelink
-- if nothing or an empty string is passed set it true
local linked = parseParam(args.linked, true)
-- prefix is a string that may be nil, empty (""), or a string of characters
-- this is prefixed to each value
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local prefix = (args.prefix or ""):gsub('"', '')
-- postfix is a string that may be nil, empty (""), or a string of characters
-- this is postfixed to each value
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local postfix = (args.postfix or ""):gsub('"', '')
-- linkprefix is a string that may be nil, empty (""), or a string of characters
-- this creates a link and is then prefixed to each value
-- useful when when multiple values are returned and indirect links are needed
-- any double-quotes " are stripped out, so that spaces may be passed
local lprefix = (args.linkprefix or args.lp or ""):gsub('"', '')
-- linkpostfix is a string that may be nil, empty (""), or a string of characters
-- this is postfixed to each value when linking is enabled with lprefix
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local lpostfix = (args.linkpostfix or ""):gsub('"', '')
-- wdlinks is a boolean passed to enable links to Wikidata when no article exists
-- if nothing or an empty string is passed set it false
local wdl = parseParam(args.wdlinks or args.wdl, false)
-- unitabbr is a boolean passed to enable unit abbreviations for common units
-- if nothing or an empty string is passed set it false
local uabbr = parseParam(args.unitabbr or args.uabbr, false)
-- qualsonly is a boolean passed to return just the qualifiers
-- if nothing or an empty string is passed set it false
local qualsonly = parseParam(args.qualsonly or args.qo, false)
-- maxvals is a string that may be nil, empty (""), or a number
-- this determines how many items may be returned when multiple values are available
-- setting it = 1 is useful where the returned string is used within another call, e.g. image
local maxvals = tonumber(args.maxvals) or 0
-- pd (plain date) is a string: yes/true/1 | no/false/0 | adj
-- to disable/enable "sourcing cirumstances" or use adjectival form for the plain date
local pd = args.plaindate or args.pd or "no"
args.pd = pd
-- allow qualifiers to have a different date format; default to year unless qualsonly is set
args.qdf = args.qdf or args.qualifierdateformat or args.df or (not qualsonly and "y")
local lang = args.lang or findLang().code
-- qualID is a string list of wanted qualifiers or "ALL"
qualID = qualID or ""
-- capitalise list of wanted qualifiers and substitute "DATES"
qualID = qualID:upper():gsub("DATES", "P580, P582")
local allflag = (qualID == "ALL")
-- create table of wanted qualifiers as key
local qwanted = {}
-- create sequence of wanted qualifiers
local qorder = {}
for q in mw.text.gsplit(qualID, "%p") do -- split at punctuation and iterate
local qtrim = mw.text.trim(q)
if qtrim ~= "" then
qwanted[mw.text.trim(q)] = true
qorder[#qorder+1] = qtrim
end
end
-- qsep is the output separator for rendering qualifier list
local qsep = (args.qsep or ""):gsub('"', '')
-- qargs are the arguments to supply to assembleoutput()
local qargs = {
["osd"] = "false",
["linked"] = tostring(linked),
["prefix"] = args.qprefix,
["postfix"] = args.qpostfix,
["linkprefix"] = args.qlinkprefix or args.qlp,
["linkpostfix"] = args.qlinkpostfix,
["wdl"] = "false",
["unitabbr"] = tostring(uabbr),
["maxvals"] = 0,
["sorted"] = tostring(args.qsorted),
["noicon"] = "true",
["list"] = args.qlist,
["sep"] = qsep,
["langobj"] = args.langobj,
["lang"] = args.langobj.code,
["df"] = args.qdf,
["sn"] = parseParam(args.qsn or args.qshortname, false),
}
-- all proper values of a Wikidata property will be the same type as the first
-- qualifiers don't have a mainsnak, properties do
local datatype = objproperty[1].datatype or objproperty[1].mainsnak.datatype
-- out[] holds the a list of returned values for this property
-- mlt[] holds the language code if the datatype is monolingual text
local out = {}
local mlt = {}
for k, v in ipairs(objproperty) do
local hasvalue = true
if (onlysrc and not sourced(v)) then
-- no value: it isn't sourced when onlysourced=true
hasvalue = false
else
local val, lcode = rendersnak(v, args, linked, lprefix, lpostfix, prefix, postfix, uabbr)
if not val then
hasvalue = false -- rank doesn't match
elseif qualsonly and qualID then
-- suppress value returned: only qualifiers are requested
else
out[#out+1], mlt[#out+1] = val, lcode
end
end
-- See if qualifiers are to be returned:
local snak = v.mainsnak or v
if hasvalue and v.qualifiers and qualID ~= "" and snak.snaktype~="novalue" then
-- collect all wanted qualifier values returned in qlist, indexed by propertyID
local qlist = {}
local timestart, timeend = "", ""
-- loop through qualifiers
for k1, v1 in pairs(v.qualifiers) do
if allflag or qwanted[k1] then
if k1 == "P1326" then
local ts = v1[1].datavalue.value.time
local dp = v1[1].datavalue.value.precision
qlist[k1] = dateFormat(ts, dp, args.qdf, args.bc, pd, "", lang, "before")
elseif k1 == "P1319" then
local ts = v1[1].datavalue.value.time
local dp = v1[1].datavalue.value.precision
qlist[k1] = dateFormat(ts, dp, args.qdf, args.bc, pd, "", lang, "after")
elseif k1 == "P580" then
timestart = propertyvalueandquals(v1, qargs)[1] or "" -- treat only one start time as valid
elseif k1 == "P582" then
timeend = propertyvalueandquals(v1, qargs)[1] or "" -- treat only one end time as valid
else
local q = assembleoutput(propertyvalueandquals(v1, qargs), qargs)
-- we already deal with circa via 'sourcing circumstances' if the datatype was time
-- circa may be either linked or unlinked *** internationalise later ***
if datatype ~= "time" or q ~= "circa" and not (type(q) == "string" and q:find("circa]]")) then
qlist[k1] = q
end
end
end -- of test for wanted
end -- of loop through qualifiers
-- set date separator
local t = timestart .. timeend
-- *** internationalise date separators later ***
local dsep = "–"
if t:find("%s") or t:find(" ") then dsep = " – " end
-- set the order for the list of qualifiers returned; start time and end time go last
if next(qlist) then
local qlistout = {}
if allflag then
for k2, v2 in pairs(qlist) do
qlistout[#qlistout+1] = v2
end
else
for i2, v2 in ipairs(qorder) do
qlistout[#qlistout+1] = qlist[v2]
end
end
if t ~= "" then
qlistout[#qlistout+1] = timestart .. dsep .. timeend
end
local qstr = assembleoutput(qlistout, qargs)
if qualsonly then
out[#out+1] = qstr
else
out[#out] = out[#out] .. " (" .. qstr .. ")"
end
elseif t ~= "" then
if qualsonly then
if timestart == "" then
out[#out+1] = timeend
elseif timeend == "" then
out[#out+1] = timestart
else
out[#out+1] = timestart .. dsep .. timeend
end
else
out[#out] = out[#out] .. " (" .. timestart .. dsep .. timeend .. ")"
end
end
end -- of test for qualifiers wanted
if maxvals > 0 and #out >= maxvals then break end
end -- of for each value loop
-- we need to pick one value to return if the datatype was "monolingualtext"
-- if there's only one value, use that
-- otherwise look through the fallback languages for a match
if datatype == "monolingualtext" and #out >1 then
lang = mw.text.split( lang, '-', true )[1]
local fbtbl = mw.language.getFallbacksFor( lang )
table.insert( fbtbl, 1, lang )
local bestval = ""
local found = false
for idx1, lang1 in ipairs(fbtbl) do
for idx2, lang2 in ipairs(mlt) do
if (lang1 == lang2) and not found then
bestval = out[idx2]
found = true
break
end
end -- loop through values of property
end -- loop through fallback languages
if found then
-- replace output table with a table containing the best value
out = { bestval }
else
-- more than one value and none of them on the list of fallback languages
-- sod it, just give them the first one
out = { out[1] }
end
end
return out
end
-------------------------------------------------------------------------------
-- Common code for p.getValueByQual and p.getValueByLang
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
local _getvaluebyqual = function(frame, qualID, checkvalue)
-- The property ID that will have a qualifier is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or "")
if propertyID == "" then return "no property supplied" end
if qualID == "" then return "no qualifier supplied" end
-- onlysourced is a boolean passed to return property values
-- only when property values are sourced to something other than Wikipedia
-- if nothing or an empty string is passed set it true
-- if "false" or "no" or 0 is passed set it false
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- set a language object and code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
-- check for locally supplied parameter in second unnamed parameter
-- success means no local parameter and the property exists
local qid, props = parseInput(frame, args[2], propertyID)
local linked = parseParam(args.linked, true)
local lpre = (args.linkprefix or args.lp or ""):gsub('"', '')
local lpost = (args.linkpostfix or ""):gsub('"', '')
local pre = (args.prefix or ""):gsub('"', '')
local post = (args.postfix or ""):gsub('"', '')
local uabbr = parseParam(args.unitabbr or args.uabbr, false)
local filter = (args.unit or ""):upper()
local maxvals = tonumber(args.maxvals) or 0
if filter == "" then filter = nil end
if qid then
local out = {}
-- Scan through the values of the property
-- we want something like property is "pronunciation audio (P443)" in propertyID
-- with a qualifier like "language of work or name (P407)" in qualID
-- whose value has the required ID, like "British English (Q7979)", in qval
for k1, v1 in ipairs(props) do
if v1.mainsnak.snaktype == "value" then
-- check if it has the right qualifier
local v1q = v1.qualifiers
if v1q and v1q[qualID] then
if onlysrc == false or sourced(v1) then
-- if we've got this far, we have a (sourced) claim with qualifiers
-- so see if matches the required value
-- We'll only deal with wikibase-items and strings for now
if v1q[qualID][1].datatype == "wikibase-item" then
if checkvalue(v1q[qualID][1].datavalue.value.id) then
out[#out + 1] = rendersnak(v1, args, linked, lpre, lpost, pre, post, uabbr, filter)
end
elseif v1q[qualID][1].datatype == "string" then
if checkvalue(v1q[qualID][1].datavalue.value) then
out[#out + 1] = rendersnak(v1, args, linked, lpre, lpost, pre, post, uabbr, filter)
end
end
end -- of check for sourced
end -- of check for matching required value and has qualifiers
else
return nil
end -- of check for string
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of propertyID
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- either local parameter or nothing
end -- of test for success
return nil
end
-------------------------------------------------------------------------------
-- _location takes Q-id and follows P276 (location)
-- or P131 (located in the administrative territorial entity) or P706 (located on terrain feature)
-- from the initial item to higher level territories/locations until it reaches the highest.
-- An optional boolean, 'first', determines whether the first item is returned (default: false).
-- An optional boolean 'skip' toggles the display to skip to the last item (default: false).
-- It returns a table containing the locations - linked where possible, except for the highest.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); labelOrId(); linkedItem
-------------------------------------------------------------------------------
local _location = function(qid, first, skip)
first = parseParam(first, false)
skip = parseParam(skip, false)
local locs = {"P276", "P131", "P706"}
local out = {}
local langcode = findLang():getCode()
local finished = false
local count = 0
local prevqid = "Q0"
repeat
local prop
for i1, v1 in ipairs(locs) do
local proptbl = mw.wikibase.getBestStatements(qid, v1)
if #proptbl > 1 then
-- there is more than one higher location
local prevP131, prevP131id
if prevqid ~= "Q0" then
prevP131 = mw.wikibase.getBestStatements(prevqid, "P131")[1]
prevP131id = prevP131
and prevP131.mainsnak.datavalue
and prevP131.mainsnak.datavalue.value.id
end
for i2, v2 in ipairs(proptbl) do
local parttbl = v2.qualifiers and v2.qualifiers.P518
if parttbl then
-- this higher location has qualifier 'applies to part' (P518)
for i3, v3 in ipairs(parttbl) do
if v3.snaktype == "value" and v3.datavalue.value.id == prevqid then
-- it has a value equal to the previous location
prop = proptbl[i2]
break
end -- of test for matching last location
end -- of loop through values of 'applies to part'
else
-- there's no qualifier 'applies to part' (P518)
-- so check if the previous location had a P131 that matches this alternate
if qid == prevP131id then
prop = proptbl[i2]
break
end -- of test for matching previous P131
end
end -- of loop through parent locations
-- fallback to second value if match not found
prop = prop or proptbl[2]
elseif #proptbl > 0 then
prop = proptbl[1]
end
if prop then break end
end
-- check if it's an instance of (P31) a country (Q6256) or sovereign state (Q3624078)
-- and terminate the chain if it is
local inst = mw.wikibase.getAllStatements(qid, "P31")
if #inst > 0 then
for k, v in ipairs(inst) do
local instid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
-- stop if it's a country (or a country within the United Kingdom if skip is true)
if instid == "Q6256" or instid == "Q3624078" or (skip and instid == "Q3336843") then
prop = nil -- this will ensure this is treated as top-level location
break
end
end
end
-- get the name of this location and update qid to point to the parent location
if prop and prop.mainsnak.datavalue then
if not skip or count == 0 then
local args = { lprefix = ":" }
out[#out+1] = linkedItem(qid, args) -- get a linked value if we can
end
qid, prevqid = prop.mainsnak.datavalue.value.id, qid
else
-- This is top-level location, so get short name except when this is the first item
-- Use full label if there's no short name or this is the first item
local prop1813 = mw.wikibase.getAllStatements(qid, "P1813")
-- if there's a short name and this isn't the only item
if prop1813[1] and (#out > 0)then
local shortname
-- short name is monolingual text, so look for match to the local language
-- choose the shortest 'short name' in that language
for k, v in pairs(prop1813) do
if v.mainsnak.datavalue.value.language == langcode then
local name = v.mainsnak.datavalue.value.text
if (not shortname) or (#name < #shortname) then
shortname = name
end
end
end
-- add the shortname if one is found, fallback to the label
-- but skip it if it's "USA"
if shortname ~= "USA" then
out[#out+1] = shortname or labelOrId(qid)
else
if skip then out[#out+1] = "US" end
end
else
-- no shortname, so just add the label
local loc = labelOrId(qid)
-- exceptions go here:
if loc == "United States of America" then
out[#out+1] = "United States"
else
out[#out+1] = loc
end
end
finished = true
end
count = count + 1
until finished or count >= 10 -- limit to 10 levels to avoid infinite loops
-- remove the first location if not required
if not first then table.remove(out, 1) end
-- we might have duplicate text for consecutive locations, so remove them
if #out > 2 then
local plain = {}
for i, v in ipairs(out) do
-- strip any links
plain[i] = v:gsub("^%[%[[^|]*|", ""):gsub("]]$", "")
end
local idx = 2
repeat
if plain[idx] == plain[idx-1] then
-- duplicate found
local removeidx = 0
if (plain[idx] ~= out[idx]) and (plain[idx-1] == out[idx-1]) then
-- only second one is linked, so drop the first
removeidx = idx - 1
elseif (plain[idx] == out[idx]) and (plain[idx-1] ~= out[idx-1]) then
-- only first one is linked, so drop the second
removeidx = idx
else
-- pick one
removeidx = idx - (os.time()%2)
end
table.remove(out, removeidx)
table.remove(plain, removeidx)
else
idx = idx +1
end
until idx >= #out
end
return out
end
-------------------------------------------------------------------------------
-- _getsumofparts scans the property 'has part' (P527) for values matching a list.
-- The list (args.vlist) consists of a string of Qids separated by spaces or any usual punctuation.
-- If the matched values have a qualifer 'quantity' (P1114), those quantites are summed.
-- The sum is returned as a number (i.e. 0 if none)
-- a table of arguments is supplied implementing the usual parameters.
-------------------------------------------------------------------------------
-- Dependencies: setRanks; parseParam; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
local _getsumofparts = function(args)
local vallist = (args.vlist or ""):upper()
if vallist == "" then return end
args.reqranks = setRanks(args.rank)
local f = {}
f.args = args
local qid, props = parseInput(f, "", "P527")
if not qid then return 0 end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local sum = 0
for k1, v1 in ipairs(props) do
if (onlysrc == false or sourced(v1))
and v1.mainsnak.snaktype == "value"
and v1.mainsnak.datavalue.type == "wikibase-entityid"
and vallist:match( v1.mainsnak.datavalue.value.id )
and v1.qualifiers
then
local quals = v1.qualifiers["P1114"]
if quals then
for k2, v2 in ipairs(quals) do
sum = sum + v2.datavalue.value.amount
end
end
end
end
return sum
end
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Public functions
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- _getValue makes the functionality of getValue available to other modules
-------------------------------------------------------------------------------
-- Dependencies: setRanks; parseInput; propertyvalueandquals; assembleoutput; parseParam; sourced;
-- labelOrId; i18n.latestdatequalifier; format_Date; makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p._getValue = function(args)
-- parameter sets for commonly used groups of parameters
local paraset = tonumber(args.ps or args.parameterset or 0)
if paraset == 1 then
-- a common setting
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
elseif paraset == 2 then
-- equivalent to raw
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
args.linked = "no"
args.pd = "true"
elseif paraset == 3 then
-- third set goes here
end
-- implement eid parameter
local eid = args.eid
if eid == "" then
return nil
elseif eid then
args.qid = eid
end
local propertyID = mw.text.trim(args[1] or "")
args.reqranks = setRanks(args.rank)
-- replacetext (rt) is a string that is returned instead of any non-empty Wikidata value
-- this is useful for tracking and debugging, so we set fetchwikidata=ALL to fill the whitelist
local replacetext = mw.text.trim(args.rt or args.replacetext or "")
if replacetext ~= "" then
args.fetchwikidata = "ALL"
end
local f = {}
f.args = args
local entityid, props = parseInput(f, f.args[2], propertyID)
if not entityid then
return props -- either the input parameter or nothing
end
-- qual is a string containing the property ID of the qualifier(s) to be returned
-- if qual == "ALL" then all qualifiers returned
-- if qual == "DATES" then qualifiers P580 (start time) and P582 (end time) returned
-- if nothing or an empty string is passed set it nil -> no qualifiers returned
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
-- set a language object and code in the args table
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- table 'out' stores the return value(s):
local out = propertyvalueandquals(props, args, qualID)
-- format the table of values and return it as a string:
return assembleoutput(out, args, entityid, propertyID)
end
-------------------------------------------------------------------------------
-- getValue is used to get the value(s) of a property
-- The property ID is passed as the first unnamed parameter and is required.
-- A locally supplied parameter may optionaly be supplied as the second unnamed parameter.
-- The function will now also return qualifiers if parameter qual is supplied
-------------------------------------------------------------------------------
-- Dependencies: _getValue; setRanks; parseInput; propertyvalueandquals; assembleoutput; parseParam; sourced;
-- labelOrId; i18n.latestdatequalifier; format_Date; makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p.getValue = function(frame)
local args= frame.args
if not args[1] then
args = frame:getParent().args
if not args[1] then return i18n.errors["No property supplied"] end
end
return p._getValue(args)
end
-------------------------------------------------------------------------------
-- getPreferredValue is used to get a value,
-- (or a comma separated list of them if multiple values exist).
-- If preferred ranks are set, it will return those values, otherwise values with normal ranks
-- now redundant to getValue with |rank=best
-------------------------------------------------------------------------------
-- Dependencies: p.getValue; setRanks; parseInput; propertyvalueandquals; assembleoutput;
-- parseParam; sourced; labelOrId; i18n.latestdatequalifier; format_Date;
-- makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p.getPreferredValue = function(frame)
frame.args.rank = "best"
return p.getValue(frame)
end
-------------------------------------------------------------------------------
-- getCoords is used to get coordinates for display in an infobox
-- whitelist and blacklist are implemented
-- optional 'display' parameter is allowed, defaults to nil - was "inline, title"
-------------------------------------------------------------------------------
-- Dependencies: setRanks(); parseInput(); decimalPrecision();
-------------------------------------------------------------------------------
p.getCoords = function(frame)
local propertyID = "P625"
-- if there is a 'display' parameter supplied, use it
-- otherwise default to nothing
local disp = frame.args.display or ""
if disp == "" then
disp = nil -- default to not supplying display parameter, was "inline, title"
end
-- there may be a format parameter to switch from deg/min/sec to decimal degrees
-- default is deg/min/sec
-- decimal degrees needs |format = dec
local form = (frame.args.format or ""):lower():sub(1,3)
if form ~= "dec" then
form = "dms"
end
-- just deal with best values
frame.args.reqranks = setRanks("best")
local qid, props = parseInput(frame, frame.args[1], propertyID)
if not qid then
return props -- either local parameter or nothing
else
local dv = props[1].mainsnak.datavalue.value
local lat, long, prec = dv.latitude, dv.longitude, dv.precision
lat = decimalPrecision(lat, prec)
long = decimalPrecision(long, prec)
local lat_long = { lat, long }
lat_long["display"] = disp
lat_long["format"] = form
-- invoke template Coord with the values stored in the table
return frame:expandTemplate{title = 'coord', args = lat_long}
end
end
-------------------------------------------------------------------------------
-- getQualifierValue is used to get a formatted value of a qualifier
--
-- The call needs: a property (the unnamed parameter or 1=)
-- a target value for that property (pval=)
-- a qualifier for that target value (qual=)
-- The usual whitelisting and blacklisting of the property is implemented
-- The boolean onlysourced= parameter can be set to return nothing
-- when the property is unsourced (or only sourced to Wikipedia)
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); setRanks(); parseInput(); sourced();
-- propertyvalueandquals(); assembleoutput();
-- labelOrId(); i18n.latestdatequalifier(); format_Date();
-- findLang(); makeOrdinal(); roundto(); decimalPrecision(); decimalToDMS();
-------------------------------------------------------------------------------
p.getQualifierValue = function(frame)
-- The property ID that will have a qualifier is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or "")
-- The value of the property we want to match whose qualifier value is to be returned
-- is passed in named parameter |pval=
local propvalue = frame.args.pval
-- The property ID of the qualifier
-- whose value is to be returned is passed in named parameter |qual=
local qualifierID = frame.args.qual
-- A filter can be set like this: filter=P642==Q22674854
local filter, fprop, fval
local ftable = mw.text.split(frame.args.filter or "", "==")
if ftable[2] then
fprop = mw.text.trim(ftable[1])
fval = mw.text.trim(ftable[2])
filter = true
end
-- onlysourced is a boolean passed to return qualifiers
-- only when property values are sourced to something other than Wikipedia
-- if nothing or an empty string is passed set it true
-- if "false" or "no" or 0 is passed set it false
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set a language object and language code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- check for locally supplied parameter in second unnamed parameter
-- success means no local parameter and the property exists
local qid, props = parseInput(frame, frame.args[2], propertyID)
if qid then
local out = {}
-- Scan through the values of the property
-- we want something like property is P793, significant event (in propertyID)
-- whose value is something like Q385378, construction (in propvalue)
-- then we can return the value(s) of a qualifier such as P580, start time (in qualifierID)
for k1, v1 in pairs(props) do
if v1.mainsnak.snaktype == "value" and v1.mainsnak.datavalue.type == "wikibase-entityid" then
-- It's a wiki-linked value, so check if it's the target (in propvalue) and if it has qualifiers
if v1.mainsnak.datavalue.value.id == propvalue and v1.qualifiers then
if onlysrc == false or sourced(v1) then
-- if we've got this far, we have a (sourced) claim with qualifiers
-- which matches the target, so apply the filter and find the value(s) of the qualifier we want
if not filter or (v1.qualifiers[fprop] and v1.qualifiers[fprop][1].datavalue.value.id == fval) then
local quals = v1.qualifiers[qualifierID]
if quals then
-- can't reference qualifer, so set onlysourced = "no" (args are strings, not boolean)
local qargs = frame.args
qargs.onlysourced = "no"
local vals = propertyvalueandquals(quals, qargs, qid)
for k, v in ipairs(vals) do
out[#out + 1] = v
end
end
end
end -- of check for sourced
end -- of check for matching required value and has qualifiers
end -- of check for wikibase entity
end -- of loop through values of propertyID
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- either local parameter or nothing
end -- of test for success
return nil
end
-------------------------------------------------------------------------------
-- getSumOfParts scans the property 'has part' (P527) for values matching a list.
-- The list is passed in parameter vlist.
-- It consists of a string of Qids separated by spaces or any usual punctuation.
-- If the matched values have a qualifier 'quantity' (P1114), those quantities are summed.
-- The sum is returned as a number or nothing if zero.
-------------------------------------------------------------------------------
-- Dependencies: _getsumofparts;
-------------------------------------------------------------------------------
p.getSumOfParts = function(frame)
local sum = _getsumofparts(frame.args)
if sum == 0 then return end
return sum
end
-------------------------------------------------------------------------------
-- getValueByQual gets the value of a property which has a qualifier with a given entity value
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the ID of a qualifier for that property (qualID=Pyyy)
-- either the Wikibase-entity ID of a value for that qualifier (qvalue=Qzzz)
-- or a string value for that qualifier (qvalue=abc123)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: _getvaluebyqual; parseParam; setRanks; parseInput; sourced;
-- assembleoutput;
-------------------------------------------------------------------------------
p.getValueByQual = function(frame)
local qualID = frame.args.qualID
-- The Q-id of the value for the qualifier we want to match is in named parameter |qvalue=
local qval = frame.args.qvalue or ""
if qval == "" then return "no qualifier value supplied" end
local function checkQID(id)
return id == qval
end
return _getvaluebyqual(frame, qualID, checkQID)
end
-------------------------------------------------------------------------------
-- getValueByLang gets the value of a property which has a qualifier P407
-- ("language of work or name") whose value has the given language code
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the MediaWiki language code to match the language (lang=xx[-yy])
-- (if no code is supplied, it uses the default language)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: _getvaluebyqual; parseParam; setRanks; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
p.getValueByLang = function(frame)
-- The language code for the qualifier we want to match is in named parameter |lang=
local langcode = findLang(frame.args.lang).code
local function checkLanguage(id)
-- id should represent a language like "British English (Q7979)"
-- it should have string property "Wikimedia language code (P424)"
-- qlcode will be a table:
local qlcode = mw.wikibase.getBestStatements(id, "P424")
if (#qlcode > 0) and (qlcode[1].mainsnak.datavalue.value == langcode) then
return true
end
end
return _getvaluebyqual(frame, "P407", checkLanguage)
end
-------------------------------------------------------------------------------
-- getValueByRefSource gets the value of a property which has a reference "stated in" (P248)
-- whose value has the given entity-ID.
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the entity ID of a value to match where the reference is stated in (match=Qzzz)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getValueByRefSource = function(frame)
-- The property ID that we want to check is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or ""):upper()
if propertyID == "" then return "no property supplied" end
-- The Q-id of the value we want to match is in named parameter |qvalue=
local qval = (frame.args.match or ""):upper()
if qval == "" then qval = "Q21540096" end
local unit = (frame.args.unit or ""):upper()
if unit == "" then unit = "Q4917" end
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- set a language object and code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local linked = parseParam(frame.args.linked, true)
local uabbr = parseParam(frame.args.uabbr or frame.args.unitabbr, false)
-- qid not nil means no local parameter and the property exists
local qid, props = parseInput(frame, frame.args[2], propertyID)
if qid then
local out = {}
local mlt= {}
for k1, v1 in ipairs(props) do
if onlysrc == false or sourced(v1) then
if v1.references then
for k2, v2 in ipairs(v1.references) do
if v2.snaks.P248 then
for k3, v3 in ipairs(v2.snaks.P248) do
if v3.datavalue.value.id == qval then
out[#out+1], mlt[#out+1] = rendersnak(v1, frame.args, linked, "", "", "", "", uabbr, unit)
if not mlt[#out] then
-- we only need one match per property value
-- unless datatype was monolingual text
break
end
end -- of test for match
end -- of loop through values "stated in"
end -- of test that "stated in" exists
end -- of loop through references
end -- of test that references exist
end -- of test for sourced
end -- of loop through values of propertyID
if #mlt > 0 then
local langcode = frame.args.lang
langcode = mw.text.split( langcode, '-', true )[1]
local fbtbl = mw.language.getFallbacksFor( langcode )
table.insert( fbtbl, 1, langcode )
local bestval = ""
local found = false
for idx1, lang1 in ipairs(fbtbl) do
for idx2, lang2 in ipairs(mlt) do
if (lang1 == lang2) and not found then
bestval = out[idx2]
found = true
break
end
end -- loop through values of property
end -- loop through fallback languages
if found then
-- replace output table with a table containing the best value
out = { bestval }
else
-- more than one value and none of them on the list of fallback languages
-- sod it, just give them the first one
out = { out[1] }
end
end
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- no property or local parameter supplied
end -- of test for success
end
-------------------------------------------------------------------------------
-- getPropertyIDs takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- It returns the Entity-IDs (Qids) of the values of a property if it is a Wikibase-Entity.
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p._getPropertyIDs = function(args)
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- change default for noicon to true
args.noicon = tostring(parseParam(args.noicon or "", true))
local f = {}
f.args = args
local pid = mw.text.trim(args[1] or ""):upper()
-- get the qid and table of claims for the property, or nothing and the local value passed
local qid, props = parseInput(f, args[2], pid)
if not qid then return props end
if not props[1] then return nil end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local out = {}
for i, v in ipairs(props) do
local snak = v.mainsnak
if ( snak.datatype == "wikibase-item" )
and ( v.rank and args.reqranks[v.rank:sub(1, 1)] )
and ( snak.snaktype == "value" )
and ( sourced(v) or not onlysrc )
then
out[#out+1] = snak.datavalue.value.id
end
if maxvals > 0 and #out >= maxvals then break end
end
return assembleoutput(out, args, qid, pid)
end
p.getPropertyIDs = function(frame)
local args = frame.args
return p._getPropertyIDs(args)
end
-------------------------------------------------------------------------------
-- getQualifierIDs takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- It takes a property-id as the first unnamed parameter, and an optional parameter qlist
-- which is a list of qualifier property-ids to search for (default is "ALL")
-- It returns the Entity-IDs (Qids) of the values of a property if it is a Wikibase-Entity.
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getQualifierIDs = function(frame)
local args = frame.args
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- change default for noicon to true
args.noicon = tostring(parseParam(args.noicon or "", true))
local f = {}
f.args = args
local pid = mw.text.trim(args[1] or ""):upper()
-- get the qid and table of claims for the property, or nothing and the local value passed
local qid, props = parseInput(f, args[2], pid)
if not qid then return props end
if not props[1] then return nil end
-- get the other parameters
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qlist = args.qlist or ""
if qlist == "" then qlist = "ALL" end
qlist = qlist:gsub("[%p%s]+", " ") .. " "
local out = {}
for i, v in ipairs(props) do
local snak = v.mainsnak
if ( v.rank and args.reqranks[v.rank:sub(1, 1)] )
and ( snak.snaktype == "value" )
and ( sourced(v) or not onlysrc )
then
if v.qualifiers then
for k1, v1 in pairs(v.qualifiers) do
if qlist == "ALL " or qlist:match(k1 .. " ") then
for i2, v2 in ipairs(v1) do
if v2.datatype == "wikibase-item" and v2.snaktype == "value" then
out[#out+1] = v2.datavalue.value.id
end -- of test that id exists
end -- of loop through qualifier values
end -- of test for kq in qlist
end -- of loop through qualifiers
end -- of test for qualifiers
end -- of test for rank value, sourced, and value exists
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through property values
return assembleoutput(out, args, qid, pid)
end
-------------------------------------------------------------------------------
-- getPropOfProp takes two propertyIDs: prop1 and prop2 (as well as the usual parameters)
-- If the value(s) of prop1 are of type "wikibase-item" then it returns the value(s) of prop2
-- of each of those wikibase-items.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p._getPropOfProp = function(args)
-- parameter sets for commonly used groups of parameters
local paraset = tonumber(args.ps or args.parameterset or 0)
if paraset == 1 then
-- a common setting
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
elseif paraset == 2 then
-- equivalent to raw
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
args.linked = "no"
args.pd = "true"
elseif paraset == 3 then
-- third set goes here
end
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
local pid1 = args.prop1 or args.pid1 or ""
local pid2 = args.prop2 or args.pid2 or ""
if pid1 == "" or pid2 == "" then return nil end
local f = {}
f.args = args
local qid1, statements1 = parseInput(f, args[1], pid1)
-- parseInput nulls empty args[1] and returns args[1] if nothing on Wikidata
if not qid1 then return statements1 end
-- otherwise it returns the qid and a table for the statement
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
local out = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
local snak = v.mainsnak
if snak.datatype == "wikibase-item" and snak.snaktype == "value" then
local qid2 = snak.datavalue.value.id
local statements2 = {}
if args.reqranks.b then
statements2 = mw.wikibase.getBestStatements(qid2, pid2)
else
statements2 = mw.wikibase.getAllStatements(qid2, pid2)
end
if statements2[1] then
local out2 = propertyvalueandquals(statements2, args, qualID)
out[#out+1] = assembleoutput(out2, args, qid2, pid2)
end
end -- of test for valid property1 value
end -- of test for sourced
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of property1
return assembleoutput(out, args, qid1, pid1)
end
p.getPropOfProp = function(frame)
local args= frame.args
if not args.prop1 and not args.pid1 then
args = frame:getParent().args
if not args.prop1 and not args.pid1 then return i18n.errors["No property supplied"] end
end
return p._getPropOfProp(args)
end
-------------------------------------------------------------------------------
-- getAwardCat takes most of the usual parameters. If the item has values of P166 (award received),
-- then it examines each of those awards for P2517 (category for recipients of this award).
-- If it exists, it returns the corresponding category,
-- with the item's P734 (family name) as sort key, or no sort key if there is no family name.
-- The sort key may be overridden by the parameter |sortkey (alias |sk).
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getAwardCat = function(frame)
frame.args.reqranks = setRanks(frame.args.rank)
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
args.sep = " "
local pid1 = args.prop1 or "P166"
local pid2 = args.prop2 or "P2517"
if pid1 == "" or pid2 == "" then return nil end
-- locally supplied value:
local localval = mw.text.trim(args[1] or "")
local qid1, statements1 = parseInput(frame, localval, pid1)
if not qid1 then return localval end
-- linkprefix (strip quotes)
local lp = (args.linkprefix or args.lp or ""):gsub('"', '')
-- sort key (strip quotes, hyphens and periods):
local sk = (args.sortkey or args.sk or ""):gsub('["-.]', '')
-- family name:
local famname = ""
if sk == "" then
local p734 = mw.wikibase.getBestStatements(qid1, "P734")[1]
local p734id = p734 and p734.mainsnak.snaktype == "value" and p734.mainsnak.datavalue.value.id or ""
famname = mw.wikibase.getSitelink(p734id) or ""
-- strip namespace and disambigation
local pos = famname:find(":") or 0
famname = famname:sub(pos+1):gsub("%s%(.+%)$", "")
if famname == "" then
local lbl = mw.wikibase.getLabel(p734id)
famname = lbl and mw.text.nowiki(lbl) or ""
end
end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
local out = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
local snak = v.mainsnak
if snak.datatype == "wikibase-item" and snak.snaktype == "value" then
local qid2 = snak.datavalue.value.id
local statements2 = {}
if args.reqranks.b then
statements2 = mw.wikibase.getBestStatements(qid2, pid2)
else
statements2 = mw.wikibase.getAllStatements(qid2, pid2)
end
if statements2[1] and statements2[1].mainsnak.snaktype == "value" then
local qid3 = statements2[1].mainsnak.datavalue.value.id
local sitelink = mw.wikibase.getSitelink(qid3)
-- if there's no local sitelink, create the sitelink from English label
if not sitelink then
local lbl = mw.wikibase.getLabelByLang(qid3, "en")
if lbl then
if lbl:sub(1,9) == "Category:" then
sitelink = mw.text.nowiki(lbl)
else
sitelink = "Category:" .. mw.text.nowiki(lbl)
end
end
end
if sitelink then
if sk ~= "" then
out[#out+1] = "[[" .. lp .. sitelink .. "|" .. sk .. "]]"
elseif famname ~= "" then
out[#out+1] = "[[" .. lp .. sitelink .. "|" .. famname .. "]]"
else
out[#out+1] = "[[" .. lp .. sitelink .. "]]"
end -- of check for sort keys
end -- of test for sitelink
end -- of test for category
end -- of test for wikibase item has a value
end -- of test for sourced
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of property1
return assembleoutput(out, args, qid1, pid1)
end
-------------------------------------------------------------------------------
-- getIntersectCat takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-- It takes two properties, |prop1 and |prop2 (e.g. occupation and country of citizenship)
-- Each property's value is a wiki-base entity
-- For each value of the first parameter (ranks implemented) it fetches the value's main category
-- and then each value of the second parameter (possibly substituting a simpler description)
-- then it returns all of the categories representing the intersection of those properties,
-- (e.g. Category:Actors from Canada). A joining term may be supplied (e.g. |join=from).
-- The item's P734 (family name) is the sort key, or no sort key if there is no family name.
-- The sort key may be overridden by the parameter |sortkey (alias |sk).
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getIntersectCat = function(frame)
frame.args.reqranks = setRanks(frame.args.rank)
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
args.sep = " "
args.linked = "no"
local pid1 = args.prop1 or "P106"
local pid2 = args.prop2 or "P27"
if pid1 == "" or pid2 == "" then return nil end
local qid, statements1 = parseInput(frame, "", pid1)
if not qid then return nil end
local qid, statements2 = parseInput(frame, "", pid2)
if not qid then return nil end
-- topics like countries may have different names in categories from their label in Wikidata
local subs_exists, subs = pcall(mw.loadData, "Module:WikidataIB/subs")
local join = args.join or ""
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
-- linkprefix (strip quotes)
local lp = (args.linkprefix or args.lp or ""):gsub('"', '')
-- sort key (strip quotes, hyphens and periods):
local sk = (args.sortkey or args.sk or ""):gsub('["-.]', '')
-- family name:
local famname = ""
if sk == "" then
local p734 = mw.wikibase.getBestStatements(qid, "P734")[1]
local p734id = p734 and p734.mainsnak.snaktype == "value" and p734.mainsnak.datavalue.value.id or ""
famname = mw.wikibase.getSitelink(p734id) or ""
-- strip namespace and disambigation
local pos = famname:find(":") or 0
famname = famname:sub(pos+1):gsub("%s%(.+%)$", "")
if famname == "" then
local lbl = mw.wikibase.getLabel(p734id)
famname = lbl and mw.text.nowiki(lbl) or ""
end
end
local cat1 = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
-- get the ID representing the value of the property
local pvalID = (v.mainsnak.snaktype == "value") and v.mainsnak.datavalue.value.id
if pvalID then
-- get the topic's main category (P910) for that entity
local p910 = mw.wikibase.getBestStatements(pvalID, "P910")[1]
if p910 and p910.mainsnak.snaktype == "value" then
local tmcID = p910.mainsnak.datavalue.value.id
-- use sitelink or the English label for the cat
local cat = mw.wikibase.getSitelink(tmcID)
if not cat then
local lbl = mw.wikibase.getLabelByLang(tmcID, "en")
if lbl then
if lbl:sub(1,9) == "Category:" then
cat = mw.text.nowiki(lbl)
else
cat = "Category:" .. mw.text.nowiki(lbl)
end
end
end
cat1[#cat1+1] = cat
end -- of test for topic's main category exists
end -- of test for property has vaild value
end -- of test for sourced
if maxvals > 0 and #cat1 >= maxvals then break end
end
local cat2 = {}
for k, v in ipairs(statements2) do
if not onlysrc or sourced(v) then
local cat = rendersnak(v, args)
if subs[cat] then cat = subs[cat] end
cat2[#cat2+1] = cat
end
if maxvals > 0 and #cat2 >= maxvals then break end
end
local out = {}
for k1, v1 in ipairs(cat1) do
for k2, v2 in ipairs(cat2) do
if sk ~= "" then
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "|" .. sk .. "]]"
elseif famname ~= "" then
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "|" .. famname .. "]]"
else
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "]]"
end -- of check for sort keys
end
end
args.noicon = "true"
return assembleoutput(out, args, qid, pid1)
end
-------------------------------------------------------------------------------
-- qualsToTable takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- A qid may be given, and the first unnamed parameter is the property ID, which is of type wikibase item.
-- It takes a list of qualifier property IDs as |quals=
-- For a given qid and property, it creates the rows of an html table,
-- each row being a value of the property (optionally only if the property matches the value in |pval= )
-- each cell being the first value of the qualifier corresponding to the list in |quals
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced;
-------------------------------------------------------------------------------
p.qualsToTable = function(frame)
local args = frame.args
local quals = args.quals or ""
if quals == "" then return "" end
args.reqranks = setRanks(args.rank)
local propertyID = mw.text.trim(args[1] or "")
local f = {}
f.args = args
local entityid, props = parseInput(f, "", propertyID)
if not entityid then return "" end
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
local pval = args.pval or ""
local qplist = mw.text.split(quals, "%p") -- split at punctuation and make a sequential table
for i, v in ipairs(qplist) do
qplist[i] = mw.text.trim(v):upper() -- remove whitespace and capitalise
end
local col1 = args.firstcol or ""
if col1 ~= "" then
col1 = col1 .. "</td><td>"
end
local emptycell = args.emptycell or " "
-- construct a 2-D array of qualifier values in qvals
local qvals = {}
for i, v in ipairs(props) do
local skip = false
if pval ~= "" then
local pid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
if pid ~= pval then skip = true end
end
if not skip then
local qval = {}
local vqualifiers = v.qualifiers or {}
-- go through list of wanted qualifier properties
for i1, v1 in ipairs(qplist) do
-- check for that property ID in the statement's qualifiers
local qv, qtype
if vqualifiers[v1] then
qtype = vqualifiers[v1][1].datatype
if qtype == "time" then
if vqualifiers[v1][1].snaktype == "value" then
qv = mw.wikibase.renderSnak(vqualifiers[v1][1])
qv = frame:expandTemplate{title="dts", args={qv}}
else
qv = "?"
end
elseif qtype == "url" then
if vqualifiers[v1][1].snaktype == "value" then
qv = mw.wikibase.renderSnak(vqualifiers[v1][1])
local display = mw.ustring.match( mw.uri.decode(qv, "WIKI"), "([%w ]+)$" )
if display then
qv = "[" .. qv .. " " .. display .. "]"
end
end
else
qv = mw.wikibase.formatValue(vqualifiers[v1][1])
end
end
-- record either the value or a placeholder
qval[i1] = qv or emptycell
end -- of loop through list of qualifiers
-- add the list of qualifier values as a "row" in the main list
qvals[#qvals+1] = qval
end
end -- of for each value loop
local out = {}
for i, v in ipairs(qvals) do
out[i] = "<tr><td>" .. col1 .. table.concat(qvals[i], "</td><td>") .. "</td></tr>"
end
return table.concat(out, "\n")
end
-------------------------------------------------------------------------------
-- getGlobe takes an optional qid of a Wikidata entity passed as |qid=
-- otherwise it uses the linked item for the current page.
-- If returns the Qid of the globe used in P625 (coordinate location),
-- or nil if there isn't one.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getGlobe = function(frame)
local qid = frame.args.qid or frame.args[1] or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
local coords = mw.wikibase.getBestStatements(qid, "P625")[1]
local globeid
if coords and coords.mainsnak.snaktype == "value" then
globeid = coords.mainsnak.datavalue.value.globe:match("(Q%d+)")
end
return globeid
end
-------------------------------------------------------------------------------
-- getCommonsLink takes an optional qid of a Wikidata entity passed as |qid=
-- It returns one of the following in order of preference:
-- the Commons sitelink of the linked Wikidata item;
-- the Commons sitelink of the topic's main category of the linked Wikidata item;
-------------------------------------------------------------------------------
-- Dependencies: _getCommonslink(); _getSitelink(); parseParam()
-------------------------------------------------------------------------------
p.getCommonsLink = function(frame)
local oc = frame.args.onlycat or frame.args.onlycategories
local fb = parseParam(frame.args.fallback or frame.args.fb, true)
return _getCommonslink(frame.args.qid, oc, fb)
end
-------------------------------------------------------------------------------
-- getSitelink takes the qid of a Wikidata entity passed as |qid=
-- It takes an optional parameter |wiki= to determine which wiki is to be checked for a sitelink
-- If the parameter is blank, then it uses the local wiki.
-- If there is a sitelink to an article available, it returns the plain text link to the article
-- If there is no sitelink, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getSiteLink = function(frame)
return _getSitelink(frame.args.qid, frame.args.wiki or mw.text.trim(frame.args[1] or ""))
end
-------------------------------------------------------------------------------
-- getLink has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- If there is a sitelink to an article on the local Wiki, it returns a link to the article
-- with the Wikidata label as the displayed text.
-- If there is no sitelink, it returns the label as plain text.
-- If there is no label in the local language, it displays the qid instead.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLink = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
local sitelink = mw.wikibase.getSitelink(itemID)
local label = labelOrId(itemID)
if sitelink then
return "[[:" .. sitelink .. "|" .. label .. "]]"
else
return label
end
end
-------------------------------------------------------------------------------
-- getLabel has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- It returns the Wikidata label for the local language as plain text.
-- If there is no label in the local language, it displays the qid instead.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLabel = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
local lang = frame.args.lang or ""
if lang == "" then lang = nil end
local label = labelOrId(itemID, lang)
return label
end
-------------------------------------------------------------------------------
-- label has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- if no qid is supplied, it uses the qid associated with the current page.
-- It returns the Wikidata label for the local language as plain text.
-- If there is no label in the local language, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.label = function(frame)
local qid = mw.text.trim(frame.args[1] or frame.args.qid or "")
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return end
local lang = frame.args.lang or ""
if lang == "" then lang = nil end
local label, success = labelOrId(qid, lang)
if success then return label end
end
-------------------------------------------------------------------------------
-- getAT (Article Title)
-- has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- If there is a sitelink to an article on the local Wiki, it returns the sitelink as plain text.
-- If there is no sitelink or qid supplied, it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAT = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
return mw.wikibase.getSitelink(itemID)
end
-------------------------------------------------------------------------------
-- getDescription has the qid of a Wikidata entity passed as |qid=
-- (it defaults to the associated qid of the current article if omitted)
-- and a local parameter passed as the first unnamed parameter.
-- Any local parameter passed (other than "Wikidata" or "none") becomes the return value.
-- It returns the article description for the Wikidata entity if the local parameter is "Wikidata".
-- Nothing is returned if the description doesn't exist or "none" is passed as the local parameter.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getDescription = function(frame)
local desc = mw.text.trim(frame.args[1] or "")
local itemID = mw.text.trim(frame.args.qid or "")
if itemID == "" then itemID = nil end
if desc:lower() == 'wikidata' then
return mw.wikibase.getDescription(itemID)
elseif desc:lower() == 'none' then
return nil
else
return desc
end
end
-------------------------------------------------------------------------------
-- getAliases has the qid of a Wikidata entity passed as |qid=
-- (it defaults to the associated qid of the current article if omitted)
-- and a local parameter passed as the first unnamed parameter.
-- It implements blacklisting and whitelisting with a field name of "alias" by default.
-- Any local parameter passed becomes the return value.
-- Otherwise it returns the aliases for the Wikidata entity with the usual list options.
-- Nothing is returned if the aliases do not exist.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); assembleoutput()
-------------------------------------------------------------------------------
p.getAliases = function(frame)
local args = frame.args
local fieldname = args.name or ""
if fieldname == "" then fieldname = "alias" end
local blacklist = args.suppressfields or args.spf or ""
if blacklist:find(fieldname) then return nil end
local localval = mw.text.trim(args[1] or "")
if localval ~= "" then return localval end
local whitelist = args.fetchwikidata or args.fwd or ""
if whitelist == "" then whitelist = "NONE" end
if not (whitelist == 'ALL' or whitelist:find(fieldname)) then return nil end
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return nil end
local aliases = mw.wikibase.getEntity(qid).aliases
if not aliases then return nil end
args.langobj = findLang(args.lang)
local langcode = args.langobj.code
args.lang = langcode
local out = {}
for k1, v1 in pairs(aliases) do
if v1[1].language == langcode then
for k1, v2 in ipairs(v1) do
out[#out+1] = v2.value
end
break
end
end
return assembleoutput(out, args, qid)
end
-------------------------------------------------------------------------------
-- pageId returns the page id (entity ID, Qnnn) of the current page
-- returns nothing if the page is not connected to Wikidata
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.pageId = function(frame)
return mw.wikibase.getEntityIdForCurrentPage()
end
-------------------------------------------------------------------------------
-- formatDate is a wrapper to export the private function format_Date
-------------------------------------------------------------------------------
-- Dependencies: format_Date();
-------------------------------------------------------------------------------
p.formatDate = function(frame)
return format_Date(frame.args[1], frame.args.df, frame.args.bc)
end
-------------------------------------------------------------------------------
-- location is a wrapper to export the private function _location
-- it takes the entity-id as qid or the first unnamed parameter
-- optional boolean parameter first toggles the display of the first item
-- optional boolean parameter skip toggles the display to skip to the last item
-- parameter debug=<y/n> (default 'n') adds error msg if not a location
-------------------------------------------------------------------------------
-- Dependencies: _location();
-------------------------------------------------------------------------------
p.location = function(frame)
local debug = (frame.args.debug or ""):sub(1, 1):lower()
if debug == "" then debug = "n" end
local qid = mw.text.trim(frame.args.qid or frame.args[1] or ""):upper()
if qid == "" then qid=mw.wikibase.getEntityIdForCurrentPage() end
if not qid then
if debug ~= "n" then
return i18n.errors["entity-not-found"]
else
return nil
end
end
local first = mw.text.trim(frame.args.first or "")
local skip = mw.text.trim(frame.args.skip or "")
return table.concat( _location(qid, first, skip), ", " )
end
-------------------------------------------------------------------------------
-- checkBlacklist implements a test to check whether a named field is allowed
-- returns true if the field is not blacklisted (i.e. allowed)
-- returns false if the field is blacklisted (i.e. disallowed)
-- {{#if:{{#invoke:WikidataIB |checkBlacklist |name=Joe |suppressfields=Dave; Joe; Fred}} | not blacklisted | blacklisted}}
-- displays "blacklisted"
-- {{#if:{{#invoke:WikidataIB |checkBlacklist |name=Jim |suppressfields=Dave; Joe; Fred}} | not blacklisted | blacklisted}}
-- displays "not blacklisted"
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.checkBlacklist = function(frame)
local blacklist = frame.args.suppressfields or frame.args.spf or ""
local fieldname = frame.args.name or ""
if blacklist ~= "" and fieldname ~= "" then
if blacklist:find(fieldname) then
return false
else
return true
end
else
-- one of the fields is missing: let's call that "not on the list"
return true
end
end
-------------------------------------------------------------------------------
-- emptyor returns nil if its first unnamed argument is just punctuation, whitespace or html tags
-- otherwise it returns the argument unchanged (including leading/trailing space).
-- If the argument may contain "=", then it must be called explicitly:
-- |1=arg
-- (In that case, leading and trailing spaces are trimmed)
-- It finds use in infoboxes where it can replace tests like:
-- {{#if: {{#invoke:WikidatIB |getvalue |P99 |fwd=ALL}} | <span class="xxx">{{#invoke:WikidatIB |getvalue |P99 |fwd=ALL}}</span> | }}
-- with a form that uses just a single call to Wikidata:
-- {{#invoke |WikidataIB |emptyor |1= <span class="xxx">{{#invoke:WikidataIB |getvalue |P99 |fwd=ALL}}</span> }}
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.emptyor = function(frame)
local s = frame.args[1] or ""
if s == "" then return nil end
local sx = s:gsub("%s", ""):gsub("<[^>]*>", ""):gsub("%p", "")
if sx == "" then
return nil
else
return s
end
end
-------------------------------------------------------------------------------
-- labelorid is a public function to expose the output of labelOrId()
-- Pass the Q-number as |qid= or as an unnamed parameter.
-- It returns the Wikidata label for that entity or the qid if no label exists.
-------------------------------------------------------------------------------
-- Dependencies: labelOrId
-------------------------------------------------------------------------------
p.labelorid = function(frame)
return (labelOrId(frame.args.qid or frame.args[1]))
end
-------------------------------------------------------------------------------
-- getLang returns the MediaWiki language code of the current content.
-- If optional parameter |style=full, it returns the language name.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLang = function(frame)
local style = (frame.args.style or ""):lower()
local langcode = mw.language.getContentLanguage().code
if style == "full" then
return mw.language.fetchLanguageName( langcode )
end
return langcode
end
-------------------------------------------------------------------------------
-- getItemLangCode takes a qid parameter (using the current page's qid if blank)
-- If the item for that qid has property country (P17) it looks at the first preferred value
-- If the country has an official language (P37), it looks at the first preferred value
-- If that official language has a language code (P424), it returns the first preferred value
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: _getItemLangCode()
-------------------------------------------------------------------------------
p.getItemLangCode = function(frame)
return _getItemLangCode(frame.args.qid or frame.args[1])
end
-------------------------------------------------------------------------------
-- findLanguage exports the local findLang() function
-- It takes an optional language code and returns, in order of preference:
-- the code if a known language;
-- the user's language, if set;
-- the server's content language.
-------------------------------------------------------------------------------
-- Dependencies: findLang
-------------------------------------------------------------------------------
p.findLanguage = function(frame)
return findLang(frame.args.lang or frame.args[1]).code
end
-------------------------------------------------------------------------------
-- getQid returns the qid, if supplied
-- failing that, the Wikidata entity ID of the "category's main topic (P301)", if it exists
-- failing that, the Wikidata entity ID associated with the current page, if it exists
-- otherwise, nothing
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getQid = function(frame)
local qid = (frame.args.qid or ""):upper()
-- check if a qid was passed; if so, return it:
if qid ~= "" then return qid end
-- check if there's a "category's main topic (P301)":
qid = mw.wikibase.getEntityIdForCurrentPage()
if qid then
local prop301 = mw.wikibase.getBestStatements(qid, "P301")
if prop301[1] then
local mctid = prop301[1].mainsnak.datavalue.value.id
if mctid then return mctid end
end
end
-- otherwise return the page qid (if any)
return qid
end
-------------------------------------------------------------------------------
-- followQid takes four optional parameters: qid, props, list and all.
-- If qid is not given, it uses the qid for the connected page
-- or returns nil if there isn't one.
-- props is a list of properties, separated by punctuation.
-- If props is given, the Wikidata item for the qid is examined for each property in turn.
-- If that property contains a value that is another Wikibase-item, that item's qid is returned,
-- and the search terminates, unless |all=y when all of the qids are returned, separated by spaces.
-- If |list= is set to a template, the qids are passed as arguments to the template.
-- If props is not given, the qid is returned.
-------------------------------------------------------------------------------
-- Dependencies: parseParam()
-------------------------------------------------------------------------------
p._followQid = function(args)
local qid = (args.qid or ""):upper()
local all = parseParam(args.all, false)
local list = args.list or ""
if list == "" then list = nil end
if qid == "" then
qid = mw.wikibase.getEntityIdForCurrentPage()
end
if not qid then return nil end
local out = {}
local props = (args.props or ""):upper()
if props ~= "" then
for p in mw.text.gsplit(props, "%p") do -- split at punctuation and iterate
p = mw.text.trim(p)
for i, v in ipairs( mw.wikibase.getBestStatements(qid, p) ) do
local linkedid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
if linkedid then
if all then
out[#out+1] = linkedid
else
return linkedid
end -- test for all or just the first one found
end -- test for value exists for that property
end -- loop through values of property to follow
end -- loop through list of properties to follow
end
if #out > 0 then
local ret = ""
if list then
ret = mw.getCurrentFrame():expandTemplate{title = list, args = out}
else
ret = table.concat(out, " ")
end
return ret
else
return qid
end
end
p.followQid = function(frame)
return p._followQid(frame.args)
end
-------------------------------------------------------------------------------
-- globalSiteID returns the globalSiteID for the current wiki
-- e.g. returns "enwiki" for the English Wikipedia, "enwikisource" for English Wikisource, etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.globalSiteID = function(frame)
return mw.wikibase.getGlobalSiteId()
end
-------------------------------------------------------------------------------
-- siteID returns the root of the globalSiteID
-- e.g. "en" for "enwiki", "enwikisource", etc.
-- treats "en-gb" as "en", etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.siteID = function(frame)
local txtlang = frame:preprocess( "{{int:lang}}" ) or ""
-- This deals with specific exceptions: be-tarask -> be-x-old
if txtlang == "be-tarask" then
return "be_x_old"
end
local pos = txtlang:find("-")
local ret = ""
if pos then
ret = txtlang:sub(1, pos-1)
else
ret = txtlang
end
return ret
end
-------------------------------------------------------------------------------
-- projID returns the code used to link to the reader's language's project
-- e.g "en" for [[:en:WikidataIB]]
-- treats "en-gb" as "en", etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.projID = function(frame)
local txtlang = frame:preprocess( "{{int:lang}}" ) or ""
-- This deals with specific exceptions: be-tarask -> be-x-old
if txtlang == "be-tarask" then
return "be-x-old"
end
local pos = txtlang:find("-")
local ret = ""
if pos then
ret = txtlang:sub(1, pos-1)
else
ret = txtlang
end
return ret
end
-------------------------------------------------------------------------------
-- formatNumber formats a number according to the the supplied language code ("|lang=")
-- or the default language if not supplied.
-- The number is the first unnamed parameter or "|num="
-------------------------------------------------------------------------------
-- Dependencies: findLang()
-------------------------------------------------------------------------------
p.formatNumber = function(frame)
local lang
local num = tonumber(frame.args[1] or frame.args.num) or 0
lang = findLang(frame.args.lang)
return lang:formatNum( num )
end
-------------------------------------------------------------------------------
-- examine dumps the property (the unnamed parameter or pid)
-- from the item given by the parameter 'qid' (or the other unnamed parameter)
-- or from the item corresponding to the current page if qid is not supplied.
-- e.g. {{#invoke:WikidataIB |examine |pid=P26 |qid=Q42}}
-- or {{#invoke:WikidataIB |examine |P26 |Q42}} or any combination of these
-- or {{#invoke:WikidataIB |examine |P26}} for the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.examine = function( frame )
local args
if frame.args[1] or frame.args.pid or frame.args.qid then
args = frame.args
else
args = frame:getParent().args
end
local par = {}
local pid = (args.pid or ""):upper()
local qid = (args.qid or ""):upper()
par[1] = mw.text.trim( args[1] or "" ):upper()
par[2] = mw.text.trim( args[2] or "" ):upper()
table.sort(par)
if par[2]:sub(1,1) == "P" then par[1], par[2] = par[2], par[1] end
if pid == "" then pid = par[1] end
if qid == "" then qid = par[2] end
local q1 = qid:sub(1,1)
if pid:sub(1,1) ~= "P" then return "No property supplied" end
if q1 ~= "Q" and q1 ~= "M" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return "No item for this page" end
return "<pre>" .. mw.dumpObject( mw.wikibase.getAllStatements( qid, pid ) ) .. "</pre>"
end
-------------------------------------------------------------------------------
-- checkvalue looks for 'val' as a wikibase-item value of a property (the unnamed parameter or pid)
-- from the item given by the parameter 'qid'
-- or from the Wikidata item associated with the current page if qid is not supplied.
-- It only checks ranks that are requested (preferred and normal by default)
-- If property is not supplied, then P31 (instance of) is assumed.
-- It returns val if found or nothing if not found.
-- e.g. {{#invoke:WikidataIB |checkvalue |val=Q5 |pid=P31 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |P31 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |P31}} for the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.checkvalue = function( frame )
local args
if frame.args.val then
args = frame.args
else
args = frame:getParent().args
end
local val = args.val
if not val then return nil end
local pid = mw.text.trim(args.pid or args[1] or "P31"):upper()
local qid = (args.qid or ""):upper()
if pid:sub(1,1) ~= "P" then return nil end
if qid:sub(1,1) ~= "Q" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
local ranks = setRanks(args.rank)
local stats = {}
if ranks.b then
stats = mw.wikibase.getBestStatements(qid, pid)
else
stats = mw.wikibase.getAllStatements( qid, pid )
end
if not stats[1] then return nil end
if stats[1].mainsnak.datatype == "wikibase-item" then
for k, v in pairs( stats ) do
local ms = v.mainsnak
if ranks[v.rank:sub(1,1)] and ms.snaktype == "value" and ms.datavalue.value.id == val then
return val
end
end
end
return nil
end
-------------------------------------------------------------------------------
-- url2 takes a parameter url= that is a proper url and formats it for use in an infobox.
-- If no parameter is supplied, it returns nothing.
-- This is the equivalent of Template:URL
-- but it keeps the "edit at Wikidata" pen icon out of the microformat.
-- Usually it will take its url parameter directly from a Wikidata call:
-- e.g. {{#invoke:WikidataIB |url2 |url={{wdib |P856 |qid=Q23317 |fwd=ALL |osd=no}} }}
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.url2 = function(frame)
local txt = frame.args.url or ""
if txt == "" then return nil end
-- extract any icon
local url, icon = txt:match("(.+) (.+)")
-- make sure there's at least a space at the end
url = (url or txt) .. " "
icon = icon or ""
-- extract any protocol like https://
local prot = url:match("(https*://).+[ \"\']")
-- extract address
local addr = ""
if prot then
addr = url:match("https*://(.+)[ \"\']") or " "
else
prot = "//"
addr = url:match("[^%p%s]+%.(.+)[ \"\']") or " "
end
-- strip trailing / from end of domain-only url and add <wbr/> before . and /
local disp, n = addr:gsub( "^([^/]+)/$", "%1" ):gsub("%/", "<wbr/>/"):gsub("%.", "<wbr/>.")
return '<span class="url">[' .. prot .. addr .. " " .. disp .. "]</span> " .. icon
end
-------------------------------------------------------------------------------
-- getWebsite fetches the Official website (P856) and formats it for use in an infobox.
-- This is similar to Template:Official website but with a url displayed,
-- and it adds the "edit at Wikidata" pen icon beyond the microformat if enabled.
-- A local value will override the Wikidata value. "NONE" returns nothing.
-- e.g. {{#invoke:WikidataIB |getWebsite |qid= |noicon= |lang= |url= }}
-------------------------------------------------------------------------------
-- Dependencies: findLang(); parseParam();
-------------------------------------------------------------------------------
p.getWebsite = function(frame)
local url = frame.args.url or ""
if url:upper() == "NONE" then return nil end
local qid = frame.args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
local urls = {}
local quals = {}
if url == "" then
local prop856 = mw.wikibase.getBestStatements(qid, "P856")
for k, v in pairs(prop856) do
if v.mainsnak.snaktype == "value" then
urls[#urls+1] = v.mainsnak.datavalue.value
if v.qualifiers and v.qualifiers["P1065"] then
-- just take the first archive url (P1065)
local au = v.qualifiers["P1065"][1]
if au.snaktype == "value" then
quals[#urls] = au.datavalue.value
end -- test for archive url having a value
end -- test for qualifers
end -- test for website having a value
end -- loop through website(s)
else
urls[1] = url
end
if #urls == 0 then return nil end
local out = {}
for i, u in ipairs(urls) do
local link = quals[i] or u
local prot, addr = u:match("(http[s]*://)(.+)")
addr = addr or u
local disp, n = addr:gsub("%.", "<wbr/>%.")
out[#out+1] = '<span class="url">[' .. link .. " " .. disp .. "]</span>"
end
local langcode = findLang(frame.args.lang).code
local noicon = parseParam(frame.args.noicon, false)
if url == "" and not noicon then
out[#out] = out[#out] .. createicon(langcode, qid, "P856")
end
local ret = ""
if #out > 1 then
ret = mw.getCurrentFrame():expandTemplate{title = "ubl", args = out}
else
ret = out[1]
end
return ret
end
-------------------------------------------------------------------------------
-- getAllLabels fetches the set of labels and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllLabels = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local labels = mw.wikibase.getEntity(qid).labels
if not labels then return i18n["labels-not-found"] end
local out = {}
for k, v in pairs(labels) do
out[#out+1] = v.value .. " (" .. v.language .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- getAllDescriptions fetches the set of descriptions and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllDescriptions = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local descriptions = mw.wikibase.getEntity(qid).descriptions
if not descriptions then return i18n["descriptions-not-found"] end
local out = {}
for k, v in pairs(descriptions) do
out[#out+1] = v.value .. " (" .. v.language .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- getAllAliases fetches the set of aliases and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllAliases = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local aliases = mw.wikibase.getEntity(qid).aliases
if not aliases then return i18n["aliases-not-found"] end
local out = {}
for k1, v1 in pairs(aliases) do
local lang = v1[1].language
local val = {}
for k1, v2 in ipairs(v1) do
val[#val+1] = v2.value
end
out[#out+1] = table.concat(val, ", ") .. " (" .. lang .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- showNoLinks displays the article titles that should not be linked.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.showNoLinks = function(frame)
local out = {}
for k, v in pairs(donotlink) do
out[#out+1] = k
end
table.sort( out )
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- checkValidity checks whether the first unnamed parameter represents a valid entity-id,
-- that is, something like Q1235 or P123.
-- It returns the strings "true" or "false".
-- Change false to nil to return "true" or "" (easier to test with #if:).
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
function p.checkValidity(frame)
local id = mw.text.trim(frame.args[1] or "")
if mw.wikibase.isValidEntityId(id) then
return true
else
return false
end
end
-------------------------------------------------------------------------------
-- getEntityFromTitle returns the Entity-ID (Q-number) for a given title.
-- Modification of Module:ResolveEntityId
-- The title is the first unnamed parameter.
-- The site parameter determines the site/language for the title. Defaults to current wiki.
-- The showdab parameter determines whether dab pages should return the Q-number or nil. Defaults to true.
-- Returns the Q-number or nil if it does not exist.
-------------------------------------------------------------------------------
-- Dependencies: parseParam
-------------------------------------------------------------------------------
function p.getEntityFromTitle(frame)
local args=frame.args
if not args[1] then args=frame:getParent().args end
if not args[1] then return nil end
local title = mw.text.trim(args[1])
local site = args.site or ""
local showdab = parseParam(args.showdab, true)
local qid = mw.wikibase.getEntityIdForTitle(title, site)
if qid then
local prop31 = mw.wikibase.getBestStatements(qid, "P31")[1]
if not showdab and prop31 and prop31.mainsnak.datavalue.value.id == "Q4167410" then
return nil
else
return qid
end
end
end
-------------------------------------------------------------------------------
-- getDatePrecision returns the number representing the precision of the first best date value
-- for the given property.
-- It takes the qid and property ID
-- The meanings are given at https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times
-- 0 = 1 billion years .. 6 = millennium, 7 = century, 8 = decade, 9 = year, 10 = month, 11 = day
-- Returns 0 (or the second unnamed parameter) if the Wikidata does not exist.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; sourced;
-------------------------------------------------------------------------------
function p.getDatePrecision(frame)
local args=frame.args
if not args[1] then args=frame:getParent().args end
local default = tonumber(args[2] or args.default) or 0
local prop = mw.text.trim(args[1] or "")
if prop == "" then return default end
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return default end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local stat = mw.wikibase.getBestStatements(qid, prop)
for i, v in ipairs(stat) do
local prec = (onlysrc == false or sourced(v))
and v.mainsnak.datavalue
and v.mainsnak.datavalue.value
and v.mainsnak.datavalue.value.precision
if prec then return prec end
end
return default
end
return p
-------------------------------------------------------------------------------
-- List of exported functions
-------------------------------------------------------------------------------
--[[
_getValue
getValue
getPreferredValue
getCoords
getQualifierValue
getSumOfParts
getValueByQual
getValueByLang
getValueByRefSource
getPropertyIDs
getQualifierIDs
getPropOfProp
getAwardCat
getIntersectCat
getGlobe
getCommonsLink
getSiteLink
getLink
getLabel
label
getAT
getDescription
getAliases
pageId
formatDate
location
checkBlacklist
emptyor
labelorid
getLang
getItemLangCode
findLanguage
getQID
followQid
globalSiteID
siteID
projID
formatNumber
examine
checkvalue
url2
getWebsite
getAllLabels
getAllDescriptions
getAllAliases
showNoLinks
checkValidity
getEntityFromTitle
getDatePrecision
--]]
-------------------------------------------------------------------------------
1tf16iuqygh0n4np9zsd8j2smqcumrr
2444285
2444283
2022-08-13T13:30:32Z
David Wadie Fisher-Freberg
51
Melindungi "[[Modul:WikidataIB]]": Templat baresiko tinggi ([Suntiang=Untuak panguruih sajo] (sataruihnyo) [Pindah=Untuak panguruih sajo] (sataruihnyo))
Scribunto
text/plain
-- Version: 2021-02-06
-- Module to implement use of a blacklist and whitelist for infobox fields
-- Can take a named parameter |qid which is the Wikidata ID for the article
-- if not supplied, it will use the Wikidata ID associated with the current page.
-- Fields in blacklist are never to be displayed, i.e. module must return nil in all circumstances
-- Fields in whitelist return local value if it exists or the Wikidata value otherwise
-- The name of the field that this function is called from is passed in named parameter |name
-- The name is compulsory when blacklist or whitelist is used,
-- so the module returns nil if it is not supplied.
-- blacklist is passed in named parameter |suppressfields (or |spf)
-- whitelist is passed in named parameter |fetchwikidata (or |fwd)
local p = {}
local cdate -- initialise as nil and only load _complex_date function if needed
-- Module:Complex date is loaded lazily and has the following dependencies:
-- Module:Calendar
-- Module:ISOdate
-- Module:DateI18n
-- Module:No globals
-- Module:I18n/complex date
-- Module:Ordinal
-- Module:I18n/ordinal
-- Module:Yesno
-- Module:Formatnum
-- Module:Linguistic
--
-- The following, taken from https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times,
-- is needed to use Module:Complex date which seemingly requires date precision as a string.
-- It would work better if only the authors of the mediawiki page could spell 'millennium'.
local dp = {
[6] = "millennium",
[7] = "century",
[8] = "decade",
[9] = "year",
[10] = "month",
[11] = "day",
}
local i18n =
{
["errors"] =
{
["property-not-found"] = "Property not found.",
["No property supplied"] = "No property supplied",
["entity-not-found"] = "Wikidata entity not found.",
["unknown-claim-type"] = "Unknown claim type.",
["unknown-entity-type"] = "Unknown entity type.",
["qualifier-not-found"] = "Qualifier not found.",
["site-not-found"] = "Wikimedia project not found.",
["labels-not-found"] = "No labels found.",
["descriptions-not-found"] = "No descriptions found.",
["aliases-not-found"] = "No aliases found.",
["unknown-datetime-format"] = "Unknown datetime format.",
["local-article-not-found"] = "Article is available on Wikidata, but not on Wikipedia",
["dab-page"] = " (dab)",
},
["months"] =
{
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
},
["century"] = "century",
["BC"] = "BC",
["BCE"] = "BCE",
["ordinal"] =
{
[1] = "st",
[2] = "nd",
[3] = "rd",
["default"] = "th"
},
["filespace"] = "File",
["Unknown"] = "Unknown",
["NaN"] = "Not a number",
-- set the following to the name of a tracking category,
-- e.g. "[[Category:Articles with missing Wikidata information]]", or "" to disable:
["missinginfocat"] = "[[Category:Articles with missing Wikidata information]]",
["editonwikidata"] = "Edit this on Wikidata",
["latestdatequalifier"] = function (date) return "before " .. date end,
-- some languages, e.g. Bosnian use a period as a suffix after each number in a date
["datenumbersuffix"] = "",
["list separator"] = ", ",
["multipliers"] = {
[0] = "",
[3] = " thousand",
[6] = " million",
[9] = " billion",
[12] = " trillion",
}
}
-- This allows an internationisation module to override the above table
if 'en' ~= mw.getContentLanguage():getCode() then
require("Module:i18n").loadI18n("Module:WikidataIB/i18n", i18n)
end
-- This piece of html implements a collapsible container. Check the classes exist on your wiki.
local collapsediv = '<div class="mw-collapsible mw-collapsed" style="width:100%; overflow:auto;" data-expandtext="{{int:show}}" data-collapsetext="{{int:hide}}">'
-- Some items should not be linked.
-- Each wiki can create a list of those in Module:WikidataIB/nolinks
-- It should return a table called itemsindex, containing true for each item not to be linked
local donotlink = {}
local nolinks_exists, nolinks = pcall(mw.loadData, "Module:WikidataIB/nolinks")
if nolinks_exists then
donotlink = nolinks.itemsindex
end
-- To satisfy Wikipedia:Manual of Style/Titles, certain types of items are italicised, and others are quoted.
-- The submodule [[Module:WikidataIB/titleformats]] lists the entity-ids used in 'instance of' (P31),
-- which allows this module to identify the values that should be formatted.
-- WikidataIB/titleformats exports a table p.formats, which is indexed by entity-id, and contains the value " or ''
local formats = {}
local titleformats_exists, titleformats = pcall(mw.loadData, "Module:WikidataIB/titleformats")
if titleformats_exists then
formats = titleformats.formats
end
-------------------------------------------------------------------------------
-- Private functions
-------------------------------------------------------------------------------
--
-------------------------------------------------------------------------------
-- makeOrdinal needs to be internationalised along with the above:
-- takes cardinal number as a numeric and returns the ordinal as a string
-- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local makeOrdinal = function(cardinal)
local ordsuffix = i18n.ordinal.default
if cardinal % 10 == 1 then
ordsuffix = i18n.ordinal[1]
elseif cardinal % 10 == 2 then
ordsuffix = i18n.ordinal[2]
elseif cardinal % 10 == 3 then
ordsuffix = i18n.ordinal[3]
end
-- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th'
-- similarly for 12 and 13, etc.
if (cardinal % 100 == 11) or (cardinal % 100 == 12) or (cardinal % 100 == 13) then
ordsuffix = i18n.ordinal.default
end
return tostring(cardinal) .. ordsuffix
end
-------------------------------------------------------------------------------
-- findLang takes a "langcode" parameter if supplied and valid
-- otherwise it tries to create it from the user's set language ({{int:lang}})
-- failing that it uses the wiki's content language.
-- It returns a language object
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local findLang = function(langcode)
local langobj
langcode = mw.text.trim(langcode or "")
if mw.language.isKnownLanguageTag(langcode) then
langobj = mw.language.new( langcode )
else
langcode = mw.getCurrentFrame():preprocess( '{{int:lang}}' )
if mw.language.isKnownLanguageTag(langcode) then
langobj = mw.language.new( langcode )
else
langobj = mw.language.getContentLanguage()
end
end
return langobj
end
-------------------------------------------------------------------------------
-- _getItemLangCode takes a qid parameter (using the current page's qid if blank)
-- If the item for that qid has property country (P17) it looks at the first preferred value
-- If the country has an official language (P37), it looks at the first preferred value
-- If that official language has a language code (P424), it returns the first preferred value
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local _getItemLangCode = function(qid)
qid = mw.text.trim(qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return end
local prop17 = mw.wikibase.getBestStatements(qid, "P17")[1]
if not prop17 or prop17.mainsnak.snaktype ~= "value" then return end
local qid17 = prop17.mainsnak.datavalue.value.id
local prop37 = mw.wikibase.getBestStatements(qid17, "P37")[1]
if not prop37 or prop37.mainsnak.snaktype ~= "value" then return end
local qid37 = prop37.mainsnak.datavalue.value.id
local prop424 = mw.wikibase.getBestStatements(qid37, "P424")[1]
if not prop424 or prop424.mainsnak.snaktype ~= "value" then return end
return prop424.mainsnak.datavalue.value
end
-------------------------------------------------------------------------------
-- roundto takes a number (x)
-- and returns it rounded to (sf) significant figures
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local roundto = function(x, sf)
if x == 0 then return 0 end
local s = 1
if x < 0 then
x = -x
s = -1
end
if sf < 1 then sf = 1 end
local p = 10 ^ (math.floor(math.log10(x)) - sf + 1)
x = math.floor(x / p + 0.5) * p * s
-- if it's integral, cast to an integer:
if x == math.floor(x) then x = math.floor(x) end
return x
end
-------------------------------------------------------------------------------
-- decimalToDMS takes a decimal degrees (x) with precision (p)
-- and returns degrees/minutes/seconds according to the precision
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local decimalToDMS = function(x, p)
-- if p is not supplied, use a precision around 0.1 seconds
if not tonumber(p) then p = 1e-4 end
local d = math.floor(x)
local ms = (x - d) * 60
if p > 0.5 then -- precision is > 1/2 a degree
if ms > 30 then d = d + 1 end
ms = 0
end
local m = math.floor(ms)
local s = (ms - m) * 60
if p > 0.008 then -- precision is > 1/2 a minute
if s > 30 then m = m +1 end
s = 0
elseif p > 0.00014 then -- precision is > 1/2 a second
s = math.floor(s + 0.5)
elseif p > 0.000014 then -- precision is > 1/20 second
s = math.floor(10 * s + 0.5) / 10
elseif p > 0.0000014 then -- precision is > 1/200 second
s = math.floor(100 * s + 0.5) / 100
else -- cap it at 3 dec places for now
s = math.floor(1000 * s + 0.5) / 1000
end
return d, m, s
end
-------------------------------------------------------------------------------
-- decimalPrecision takes a decimal (x) with precision (p)
-- and returns x rounded approximately to the given precision
-- precision should be between 1 and 1e-6, preferably a power of 10.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local decimalPrecision = function(x, p)
local s = 1
if x < 0 then
x = -x
s = -1
end
-- if p is not supplied, pick an arbitrary precision
if not tonumber(p) then p = 1e-4
elseif p > 1 then p = 1
elseif p < 1e-6 then p = 1e-6
else p = 10 ^ math.floor(math.log10(p))
end
x = math.floor(x / p + 0.5) * p * s
-- if it's integral, cast to an integer:
if x == math.floor(x) then x = math.floor(x) end
-- if it's less than 1e-4, it will be in exponent form, so return a string with 6dp
-- 9e-5 becomes 0.000090
if math.abs(x) < 1e-4 then x = string.format("%f", x) end
return x
end
-------------------------------------------------------------------------------
-- formatDate takes a datetime of the usual format from mw.wikibase.entity:formatPropertyValues
-- like "1 August 30 BCE" as parameter 1
-- and formats it according to the df (date format) and bc parameters
-- df = ["dmy" / "mdy" / "y"] default will be "dmy"
-- bc = ["BC" / "BCE"] default will be "BCE"
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local format_Date = function(datetime, dateformat, bc)
local datetime = datetime or "1 August 30 BCE" -- in case of nil value
-- chop off multiple vales and/or any hours, mins, etc.
-- keep anything before punctuation - we just want a single date:
local dateval = string.match( datetime, "[%w ]+")
local dateformat = string.lower(dateformat or "dmy") -- default to dmy
local bc = string.upper(bc or "") -- can't use nil for bc
-- we only want to accept two possibilities: BC or default to BCE
if bc == "BC" then
bc = " " .. i18n["BC"] -- prepend a non-breaking space.
else
bc = " " .. i18n["BCE"]
end
local postchrist = true -- start by assuming no BCE
local dateparts = {}
for word in string.gmatch(dateval, "%w+") do
if word == "BCE" or word == "BC" then -- *** internationalise later ***
postchrist = false
else
-- we'll keep the parts that are not 'BCE' in a table
dateparts[#dateparts + 1] = word
end
end
if postchrist then bc = "" end -- set AD dates to no suffix *** internationalise later ***
local sep = " " -- separator is nbsp
local fdate = table.concat(dateparts, sep) -- set formatted date to same order as input
-- if we have day month year, check dateformat
if #dateparts == 3 then
if dateformat == "y" then
fdate = dateparts[3]
elseif dateformat == "mdy" then
fdate = dateparts[2] .. sep .. dateparts[1] .. "," .. sep .. dateparts[3]
end
elseif #dateparts == 2 and dateformat == "y" then
fdate = dateparts[2]
end
return fdate .. bc
end
-------------------------------------------------------------------------------
-- dateFormat is the handler for properties that are of type "time"
-- It takes timestamp, precision (6 to 11 per mediawiki), dateformat (y/dmy/mdy), BC format (BC/BCE),
-- a plaindate switch (yes/no/adj) to en/disable "sourcing circumstances"/use adjectival form,
-- any qualifiers for the property, the language, and any adjective to use like 'before'.
-- It passes the date through the "complex date" function
-- and returns a string with the internatonalised date formatted according to preferences.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); cdate(); dp[]
-------------------------------------------------------------------------------
local dateFormat = function(timestamp, dprec, df, bcf, pd, qualifiers, lang, adj, model)
-- output formatting according to preferences (y/dmy/mdy/ymd)
df = (df or ""):lower()
-- if ymd is required, return the part of the timestamp in YYYY-MM-DD form
-- but apply Year zero#Astronomers fix: 1 BC = 0000; 2 BC = -0001; etc.
if df == "ymd" then
if timestamp:sub(1,1) == "+" then
return timestamp:sub(2,11)
else
local yr = tonumber(timestamp:sub(2,5)) - 1
yr = ("000" .. yr):sub(-4)
if yr ~= "0000" then yr = "-" .. yr end
return yr .. timestamp:sub(6,11)
end
end
-- A year can be stored like this: "+1872-00-00T00:00:00Z",
-- which is processed here as if it were the day before "+1872-01-01T00:00:00Z",
-- and that's the last day of 1871, so the year is wrong.
-- So fix the month 0, day 0 timestamp to become 1 January instead:
timestamp = timestamp:gsub("%-00%-00T", "-01-01T")
-- just in case date precision is missing
dprec = dprec or 11
-- override more precise dates if required dateformat is year alone:
if df == "y" and dprec > 9 then dprec = 9 end
-- complex date only deals with precisions from 6 to 11, so clip range
dprec = dprec>11 and 11 or dprec
dprec = dprec<6 and 6 or dprec
-- BC format is "BC" or "BCE"
bcf = (bcf or ""):upper()
-- plaindate only needs the first letter (y/n/a)
pd = (pd or ""):sub(1,1):lower()
if pd == "" or pd == "n" or pd == "f" or pd == "0" then pd = false end
-- in case language isn't passed
lang = lang or findLang().code
-- set adj as empty if nil
adj = adj or ""
-- extract the day, month, year from the timestamp
local bc = timestamp:sub(1, 1)=="-" and "BC" or ""
local year, month, day = timestamp:match("[+-](%d*)-(%d*)-(%d*)T")
local iso = tonumber(year) -- if year is missing, let it throw an error
-- this will adjust the date format to be compatible with cdate
-- possible formats are Y, YY, YYY0, YYYY, YYYY-MM, YYYY-MM-DD
if dprec == 6 then iso = math.floor( (iso - 1) / 1000 ) + 1 end
if dprec == 7 then iso = math.floor( (iso - 1) / 100 ) + 1 end
if dprec == 8 then iso = math.floor( iso / 10 ) .. "0" end
if dprec == 10 then iso = year .. "-" .. month end
if dprec == 11 then iso = year .. "-" .. month .. "-" .. day end
-- add "circa" (Q5727902) from "sourcing circumstances" (P1480)
local sc = not pd and qualifiers and qualifiers.P1480
if sc then
for k1, v1 in pairs(sc) do
if v1.datavalue and v1.datavalue.value.id == "Q5727902" then
adj = "circa"
break
end
end
end
-- deal with Julian dates:
-- no point in saying that dates before 1582 are Julian - they are by default
-- doesn't make sense for dates less precise than year
-- we can suppress it by setting |plaindate, e.g. for use in constructing categories.
local calendarmodel = ""
if tonumber(year) > 1582
and dprec > 8
and not pd
and model == "http://www.wikidata.org/entity/Q1985786" then
calendarmodel = "julian"
end
if not cdate then
cdate = require("Module:Complex date")._complex_date
end
local fdate = cdate(calendarmodel, adj, tostring(iso), dp[dprec], bc, "", "", "", "", lang, 1)
-- this may have QuickStatements info appended to it in a div, so remove that
fdate = fdate:gsub(' <div style="display: none;">[^<]*</div>', '')
-- it may also be returned wrapped in a microformat, so remove that
fdate = fdate:gsub("<[^>]*>", "")
-- there may be leading zeros that we should remove
fdate = fdate:gsub("^0*", "")
-- if a plain date is required, then remove any links (like BC linked)
if pd then
fdate = fdate:gsub("%[%[.*|", ""):gsub("]]", "")
end
-- if 'circa', use the abbreviated form *** internationalise later ***
fdate = fdate:gsub('circa ', '<abbr title="circa">c.</abbr> ')
-- deal with BC/BCE
if bcf == "BCE" then
fdate = fdate:gsub('BC', 'BCE')
end
-- deal with mdy format
if df == "mdy" then
fdate = fdate:gsub("(%d+) (%w+) (%d+)", "%2 %1, %3")
end
-- deal with adjectival form *** internationalise later ***
if pd == "a" then
fdate = fdate:gsub(' century', '-century')
end
return fdate
end
-------------------------------------------------------------------------------
-- parseParam takes a (string) parameter, e.g. from the list of frame arguments,
-- and makes "false", "no", and "0" into the (boolean) false
-- it makes the empty string and nil into the (boolean) value passed as default
-- allowing the parameter to be true or false by default.
-- It returns a boolean.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local parseParam = function(param, default)
if type(param) == "boolean" then param = tostring(param) end
if param and param ~= "" then
param = param:lower()
if (param == "false") or (param:sub(1,1) == "n") or (param == "0") then
return false
else
return true
end
else
return default
end
end
-------------------------------------------------------------------------------
-- _getSitelink takes the qid of a Wikidata entity passed as |qid=
-- It takes an optional parameter |wiki= to determine which wiki is to be checked for a sitelink
-- If the parameter is blank, then it uses the local wiki.
-- If there is a sitelink to an article available, it returns the plain text link to the article
-- If there is no sitelink, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local _getSitelink = function(qid, wiki)
qid = (qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
wiki = wiki or ""
local sitelink
if wiki == "" then
sitelink = mw.wikibase.getSitelink(qid)
else
sitelink = mw.wikibase.getSitelink(qid, wiki)
end
return sitelink
end
-------------------------------------------------------------------------------
-- _getCommonslink takes an optional qid of a Wikidata entity passed as |qid=
-- It returns one of the following in order of preference:
-- the Commons sitelink of the Wikidata entity - but not if onlycat=true and it's not a category;
-- the Commons sitelink of the topic's main category of the Wikidata entity;
-- the Commons category of the Wikidata entity - unless fallback=false.
-------------------------------------------------------------------------------
-- Dependencies: _getSitelink(); parseParam()
-------------------------------------------------------------------------------
local _getCommonslink = function(qid, onlycat, fallback)
qid = (qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
onlycat = parseParam(onlycat, false)
if fallback == "" then fallback = nil end
local sitelink = _getSitelink(qid, "commonswiki")
if onlycat and sitelink and sitelink:sub(1,9) ~= "Category:" then sitelink = nil end
if not sitelink then
-- check for topic's main category
local prop910 = mw.wikibase.getBestStatements(qid, "P910")[1]
if prop910 then
local tmcid = prop910.mainsnak.datavalue and prop910.mainsnak.datavalue.value.id
sitelink = _getSitelink(tmcid, "commonswiki")
end
if not sitelink then
-- check for list's main category
local prop1754 = mw.wikibase.getBestStatements(qid, "P1754")[1]
if prop1754 then
local tmcid = prop1754.mainsnak.datavalue and prop1754.mainsnak.datavalue.value.id
sitelink = _getSitelink(tmcid, "commonswiki")
end
end
end
if not sitelink and fallback then
-- check for Commons category (string value)
local prop373 = mw.wikibase.getBestStatements(qid, "P373")[1]
if prop373 then
sitelink = prop373.mainsnak.datavalue and prop373.mainsnak.datavalue.value
if sitelink then sitelink = "Category:" .. sitelink end
end
end
return sitelink
end
-------------------------------------------------------------------------------
-- The label in a Wikidata item is subject to vulnerabilities
-- that an attacker might try to exploit.
-- It needs to be 'sanitised' by removing any wikitext before use.
-- If it doesn't exist, return the id for the item
-- a second (boolean) value is also returned, value is true when the label exists
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local labelOrId = function(id, lang)
if lang == "default" then lang = findLang().code end
local label
if lang then
label = mw.wikibase.getLabelByLang(id, lang)
else
label = mw.wikibase.getLabel(id)
end
if label then
return mw.text.nowiki(label), true
else
return id, false
end
end
-------------------------------------------------------------------------------
-- linkedItem takes an entity-id and returns a string, linked if possible.
-- This is the handler for "wikibase-item". Preferences:
-- 1. Display linked disambiguated sitelink if it exists
-- 2. Display linked label if it is a redirect
-- 3. TBA: Display an inter-language link for the label if it exists other than in default language
-- 4. Display unlinked label if it exists
-- 5. Display entity-id for now to indicate a label could be provided
-- dtxt is text to be used instead of label, or nil.
-- shortname is boolean switch to use P1813 (short name) instead of label if true.
-- lang is the current language code.
-- uselbl is boolean switch to force display of the label instead of the sitelink (default: false)
-- linkredir is boolean switch to allow linking to a redirect (default: false)
-- formatvalue is boolean switch to allow formatting as italics or quoted (default: false)
-------------------------------------------------------------------------------
-- Dependencies: labelOrId(); donotlink[]
-------------------------------------------------------------------------------
local linkedItem = function(id, args)
local lprefix = (args.lp or args.lprefix or args.linkprefix or ""):gsub('"', '') -- toughen against nil values passed
local lpostfix = (args.lpostfix or ""):gsub('"', '')
local prefix = (args.prefix or ""):gsub('"', '')
local postfix = (args.postfix or ""):gsub('"', '')
local dtxt = args.dtxt
local shortname = args.shortname
local lang = args.lang or "en" -- fallback to default if missing
local uselbl = args.uselabel or args.uselbl
uselbl = parseParam(uselbl, false)
local linkredir = args.linkredir
linkredir = parseParam(linkredir, false)
local formatvalue = args.formatvalue or args.fv
formatvalue = parseParam(formatvalue, false)
-- see if item might need italics or quotes
local fmt = ""
if next(formats) and formatvalue then
for k, v in ipairs( mw.wikibase.getBestStatements(id, "P31") ) do
if v.mainsnak.datavalue and formats[v.mainsnak.datavalue.value.id] then
fmt = formats[v.mainsnak.datavalue.value.id]
break -- pick the first match
end
end
end
local disp
local sitelink = mw.wikibase.getSitelink(id)
local label, islabel
if dtxt then
label, islabel = dtxt, true
elseif shortname then
-- see if there is a shortname in our language, and set label to it
for k, v in ipairs( mw.wikibase.getBestStatements(id, "P1813") ) do
if v.mainsnak.datavalue.value.language == lang then
label, islabel = v.mainsnak.datavalue.value.text, true
break
end -- test for language match
end -- loop through values of short name
-- if we have no label set, then there was no shortname available
if not islabel then
label, islabel = labelOrId(id)
shortname = false
end
else
label, islabel = labelOrId(id)
end
if mw.site.siteName ~= "Wikimedia Commons" then
if sitelink then
if not (dtxt or shortname) then
-- if sitelink and label are the same except for case, no need to process further
if sitelink:lower() ~= label:lower() then
-- strip any namespace or dab from the sitelink
local pos = sitelink:find(":") or 0
local slink = sitelink
if pos > 0 then
local pfx = sitelink:sub(1,pos-1)
if mw.site.namespaces[pfx] then -- that prefix is a valid namespace, so remove it
slink = sitelink:sub(pos+1)
end
end
-- remove stuff after commas or inside parentheses - ie. dabs
slink = slink:gsub("%s%(.+%)$", ""):gsub(",.+$", "")
-- if uselbl is false, use sitelink instead of label
if not uselbl then
-- use slink as display, preserving label case - find("^%u") is true for 1st char uppercase
if label:find("^%u") then
label = slink:gsub("^(%l)", string.upper)
else
label = slink:gsub("^(%u)", string.lower)
end
end
end
end
if donotlink[label] then
disp = prefix .. fmt .. label .. fmt .. postfix
else
disp = "[[" .. lprefix .. sitelink .. lpostfix .. "|" .. prefix .. fmt .. label .. fmt .. postfix .. "]]"
end
elseif islabel then
-- no sitelink, label exists, so check if a redirect with that title exists, if linkredir is true
-- display plain label by default
disp = prefix .. fmt .. label .. fmt .. postfix
if linkredir then
local artitle = mw.title.new(label, 0) -- only nil if label has invalid chars
if not donotlink[label] and artitle and artitle.redirectTarget then
-- there's a redirect with the same title as the label, so let's link to that
disp = "[[".. lprefix .. label .. lpostfix .. "|" .. prefix .. fmt .. label .. fmt .. postfix .. "]]"
end
end -- test if article title exists as redirect on current Wiki
else
-- no sitelink and no label, so return whatever was returned from labelOrId for now
-- add tracking category [[Category:Articles with missing Wikidata information]]
-- for enwiki, just return the tracking category
if mw.wikibase.getGlobalSiteId() == "enwiki" then
disp = i18n.missinginfocat
else
disp = prefix .. label .. postfix .. i18n.missinginfocat
end
end
else
local ccat = mw.wikibase.getBestStatements(id, "P373")[1]
if ccat and ccat.mainsnak.datavalue then
ccat = ccat.mainsnak.datavalue.value
disp = "[[" .. lprefix .. "Category:" .. ccat .. lpostfix .. "|" .. prefix .. label .. postfix .. "]]"
elseif sitelink then
-- this asumes that if a sitelink exists, then a label also exists
disp = "[[" .. lprefix .. sitelink .. lpostfix .. "|" .. prefix .. label .. postfix .. "]]"
else
-- no sitelink and no Commons cat, so return label from labelOrId for now
disp = prefix .. label .. postfix
end
end
return disp
end
-------------------------------------------------------------------------------
-- sourced takes a table representing a statement that may or may not have references
-- it looks for a reference sourced to something not containing the word "wikipedia"
-- it returns a boolean = true if it finds a sourced reference.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local sourced = function(claim)
if claim.references then
for kr, vr in pairs(claim.references) do
local ref = mw.wikibase.renderSnaks(vr.snaks)
if not ref:find("Wiki") then
return true
end
end
end
end
-------------------------------------------------------------------------------
-- setRanks takes a flag (parameter passed) that requests the values to return
-- "b[est]" returns preferred if available, otherwise normal
-- "p[referred]" returns preferred
-- "n[ormal]" returns normal
-- "d[eprecated]" returns deprecated
-- multiple values are allowed, e.g. "preferred normal" (which is the default)
-- "best" will override the other flags, and set p and n
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local setRanks = function(rank)
rank = (rank or ""):lower()
-- if nothing passed, return preferred and normal
-- if rank == "" then rank = "p n" end
local ranks = {}
for w in string.gmatch(rank, "%a+") do
w = w:sub(1,1)
if w == "b" or w == "p" or w == "n" or w == "d" then
ranks[w] = true
end
end
-- check if "best" is requested or no ranks requested; and if so, set preferred and normal
if ranks.b or not next(ranks) then
ranks.p = true
ranks.n = true
end
return ranks
end
-------------------------------------------------------------------------------
-- parseInput processes the Q-id , the blacklist and the whitelist
-- if an input parameter is supplied, it returns that and ends the call.
-- it returns (1) either the qid or nil indicating whether or not the call should continue
-- and (2) a table containing all of the statements for the propertyID and relevant Qid
-- if "best" ranks are requested, it returns those instead of all non-deprecated ranks
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local parseInput = function(frame, input_parm, property_id)
-- There may be a local parameter supplied, if it's blank, set it to nil
input_parm = mw.text.trim(input_parm or "")
if input_parm == "" then input_parm = nil end
-- return nil if Wikidata is not available
if not mw.wikibase then return false, input_parm end
local args = frame.args
-- can take a named parameter |qid which is the Wikidata ID for the article.
-- if it's not supplied, use the id for the current page
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
-- if there's no Wikidata item for the current page return nil
if not qid then return false, input_parm end
-- The blacklist is passed in named parameter |suppressfields
local blacklist = args.suppressfields or args.spf or ""
-- The whitelist is passed in named parameter |fetchwikidata
local whitelist = args.fetchwikidata or args.fwd or ""
if whitelist == "" then whitelist = "NONE" end
-- The name of the field that this function is called from is passed in named parameter |name
local fieldname = args.name or ""
if blacklist ~= "" then
-- The name is compulsory when blacklist is used, so return nil if it is not supplied
if fieldname == "" then return false, nil end
-- If this field is on the blacklist, then return nil
if blacklist:find(fieldname) then return false, nil end
end
-- If we got this far then we're not on the blacklist
-- The blacklist overrides any locally supplied parameter as well
-- If a non-blank input parameter was supplied return it
if input_parm then return false, input_parm end
-- We can filter out non-valid properties
if property_id:sub(1,1):upper() ~="P" or property_id == "P0" then return false, nil end
-- Otherwise see if this field is on the whitelist:
-- needs a bit more logic because find will return its second value = 0 if fieldname is ""
-- but nil if fieldname not found on whitelist
local _, found = whitelist:find(fieldname)
found = ((found or 0) > 0)
if whitelist ~= 'ALL' and (whitelist:upper() == "NONE" or not found) then
return false, nil
end
-- See what's on Wikidata (the call always returns a table, but it may be empty):
local props = {}
if args.reqranks.b then
props = mw.wikibase.getBestStatements(qid, property_id)
else
props = mw.wikibase.getAllStatements(qid, property_id)
end
if props[1] then
return qid, props
end
-- no property on Wikidata
return false, nil
end
-------------------------------------------------------------------------------
-- createicon assembles the "Edit at Wikidata" pen icon.
-- It returns a wikitext string inside a span class="penicon"
-- if entityID is nil or empty, the ID associated with current page is used
-- langcode and propertyID may be nil or empty
-------------------------------------------------------------------------------
-- Dependencies: i18n[];
-------------------------------------------------------------------------------
local createicon = function(langcode, entityID, propertyID)
langcode = langcode or ""
if not entityID or entityID == "" then entityID= mw.wikibase.getEntityIdForCurrentPage() end
propertyID = propertyID or ""
local icon = " <span class='penicon autoconfirmed-show'>[["
-- " <span data-bridge-edit-flow='overwrite' class='penicon'>[[" -> enable Wikidata Bridge
.. i18n["filespace"]
.. ":OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt="
.. i18n["editonwikidata"]
.. "|link=https://www.wikidata.org/wiki/" .. entityID
if langcode ~= "" then icon = icon .. "?uselang=" .. langcode end
if propertyID ~= "" then icon = icon .. "#" .. propertyID end
icon = icon .. "|" .. i18n["editonwikidata"] .. "]]</span>"
return icon
end
-------------------------------------------------------------------------------
-- assembleoutput takes the sequence table containing the property values
-- and formats it according to switches given. It returns a string or nil.
-- It uses the entityID (and optionally propertyID) to create a link in the pen icon.
-------------------------------------------------------------------------------
-- Dependencies: parseParam();
-------------------------------------------------------------------------------
local assembleoutput = function(out, args, entityID, propertyID)
-- sorted is a boolean passed to enable sorting of the values returned
-- if nothing or an empty string is passed set it false
-- if "false" or "no" or "0" is passed set it false
local sorted = parseParam(args.sorted, false)
-- noicon is a boolean passed to suppress the trailing "edit at Wikidata" icon
-- for use when the value is processed further by the infobox
-- if nothing or an empty string is passed set it false
-- if "false" or "no" or "0" is passed set it false
local noic = parseParam(args.noicon, false)
-- list is the name of a template that a list of multiple values is passed through
-- examples include "hlist" and "ubl"
-- setting it to "prose" produces something like "1, 2, 3, and 4"
local list = args.list or ""
-- sep is a string that is used to separate multiple returned values
-- if nothing or an empty string is passed set it to the default
-- any double-quotes " are stripped out, so that spaces may be passed
-- e.g. |sep=" - "
local sepdefault = i18n["list separator"]
local separator = args.sep or ""
separator = string.gsub(separator, '"', '')
if separator == "" then
separator = sepdefault
end
-- collapse is a number that determines the maximum number of returned values
-- before the output is collapsed.
-- Zero or not a number result in no collapsing (default becomes 0).
local collapse = tonumber(args.collapse) or 0
-- replacetext (rt) is a string that is returned instead of any non-empty Wikidata value
-- this is useful for tracking and debugging
local replacetext = mw.text.trim(args.rt or args.replacetext or "")
-- if there's anything to return, then return a list
-- comma-separated by default, but may be specified by the sep parameter
-- optionally specify a hlist or ubl or a prose list, etc.
local strout
if #out > 0 then
if sorted then table.sort(out) end
-- if there's something to display and a pen icon is wanted, add it the end of the last value
local hasdisplay = false
for i, v in ipairs(out) do
if v ~= i18n.missinginfocat then
hasdisplay = true
break
end
end
if not noic and hasdisplay then
out[#out] = out[#out] .. createicon(args.langobj.code, entityID, propertyID)
end
if list == "" then
strout = table.concat(out, separator)
elseif list:lower() == "prose" then
strout = mw.text.listToText( out )
else
strout = mw.getCurrentFrame():expandTemplate{title = list, args = out}
end
if collapse >0 and #out > collapse then
strout = collapsediv .. strout .. "</div>"
end
else
strout = nil -- no items had valid reference
end
if replacetext ~= "" and strout then strout = replacetext end
return strout
end
-------------------------------------------------------------------------------
-- rendersnak takes a table (propval) containing the information stored on one property value
-- and returns the value as a string and its language if monolingual text.
-- It handles data of type:
-- wikibase-item
-- time
-- string, url, commonsMedia, external-id
-- quantity
-- globe-coordinate
-- monolingualtext
-- It also requires linked, the link/pre/postfixes, uabbr, and the arguments passed from frame.
-- The optional filter parameter allows quantities to be be filtered by unit Qid.
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); labelOrId(); i18n[]; dateFormat();
-- roundto(); decimalPrecision(); decimalToDMS(); linkedItem();
-------------------------------------------------------------------------------
local rendersnak = function(propval, args, linked, lpre, lpost, pre, post, uabbr, filter)
lpre = lpre or ""
lpost = lpost or ""
pre = pre or ""
post = post or ""
args.lang = args.lang or findLang().code
-- allow values to display a fixed text instead of label
local dtxt = args.displaytext or args.dt
if dtxt == "" then dtxt = nil end
-- switch to use display of short name (P1813) instead of label
local shortname = args.shortname or args.sn
shortname = parseParam(shortname, false)
local snak = propval.mainsnak or propval
local dtype = snak.datatype
local dv = snak.datavalue
dv = dv and dv.value
-- value and monolingual text language code returned
local val, mlt
if propval.rank and not args.reqranks[propval.rank:sub(1, 1)] then
-- val is nil: value has a rank that isn't requested
------------------------------------
elseif snak.snaktype == "somevalue" then -- value is unknown
val = i18n["Unknown"]
------------------------------------
elseif snak.snaktype == "novalue" then -- value is none
-- val = "No value" -- don't return anything
------------------------------------
elseif dtype == "wikibase-item" then -- data type is a wikibase item:
-- it's wiki-linked value, so output as link if enabled and possible
local qnumber = dv.id
if linked then
val = linkedItem(qnumber, args)
else -- no link wanted so check for display-text, otherwise test for lang code
local label, islabel
if dtxt then
label = dtxt
else
label, islabel = labelOrId(qnumber)
local langlabel = mw.wikibase.getLabelByLang(qnumber, args.lang)
if langlabel then
label = mw.text.nowiki( langlabel )
end
end
val = pre .. label .. post
end -- test for link required
------------------------------------
elseif dtype == "time" then -- data type is time:
-- time is in timestamp format
-- date precision is integer per mediawiki
-- output formatting according to preferences (y/dmy/mdy)
-- BC format as BC or BCE
-- plaindate is passed to disable looking for "sourcing cirumstances"
-- or to set the adjectival form
-- qualifiers (if any) is a nested table or nil
-- lang is given, or user language, or site language
--
-- Here we can check whether args.df has a value
-- If not, use code from Module:Sandbox/RexxS/Getdateformat to set it from templates like {{Use mdy dates}}
val = dateFormat(dv.time, dv.precision, args.df, args.bc, args.pd, propval.qualifiers, args.lang, "", dv.calendarmodel)
------------------------------------
-- data types which are strings:
elseif dtype == "commonsMedia" or dtype == "external-id" or dtype == "string" or dtype == "url" then
-- commonsMedia or external-id or string or url
-- all have mainsnak.datavalue.value as string
if (lpre == "" or lpre == ":") and lpost == "" then
-- don't link if no linkpre/postfix or linkprefix is just ":"
val = pre .. dv .. post
elseif dtype == "external-id" then
val = "[" .. lpre .. dv .. lpost .. " " .. pre .. dv .. post .. "]"
else
val = "[[" .. lpre .. dv .. lpost .. "|" .. pre .. dv .. post .. "]]"
end -- check for link requested (i.e. either linkprefix or linkpostfix exists)
------------------------------------
-- data types which are quantities:
elseif dtype == "quantity" then
-- quantities have mainsnak.datavalue.value.amount and mainsnak.datavalue.value.unit
-- the unit is of the form http://www.wikidata.org/entity/Q829073
--
-- implement a switch to turn on/off numerical formatting later
local fnum = true
--
-- a switch to turn on/off conversions - only for en-wiki
local conv = parseParam(args.conv or args.convert, false)
-- if we have conversions, we won't have formatted numbers or scales
if conv then
uabbr = true
fnum = false
args.scale = "0"
end
--
-- a switch to turn on/off showing units, default is true
local showunits = parseParam(args.su or args.showunits, true)
--
-- convert amount to a number
local amount = tonumber(dv.amount) or i18n["NaN"]
--
-- scale factor for millions, billions, etc.
local sc = tostring(args.scale or ""):sub(1,1):lower()
local scale
if sc == "a" then
-- automatic scaling
if amount > 1e15 then
scale = 12
elseif amount > 1e12 then
scale = 9
elseif amount > 1e9 then
scale = 6
elseif amount > 1e6 then
scale = 3
else
scale = 0
end
else
scale = tonumber(args.scale) or 0
if scale < 0 or scale > 12 then scale = 0 end
scale = math.floor(scale/3) * 3
end
local factor = 10^scale
amount = amount / factor
-- ranges:
local range = ""
-- check if upper and/or lower bounds are given and significant
local upb = tonumber(dv.upperBound)
local lowb = tonumber(dv.lowerBound)
if upb and lowb then
-- differences rounded to 2 sig fig:
local posdif = roundto(upb - amount, 2) / factor
local negdif = roundto(amount - lowb, 2) / factor
upb, lowb = amount + posdif, amount - negdif
-- round scaled numbers to integers or 4 sig fig
if (scale > 0 or sc == "a") then
if amount < 1e4 then
amount = roundto(amount, 4)
else
amount = math.floor(amount + 0.5)
end
end
if fnum then amount = args.langobj:formatNum( amount ) end
if posdif ~= negdif then
-- non-symmetrical
range = " +" .. posdif .. " -" .. negdif
elseif posdif ~= 0 then
-- symmetrical and non-zero
range = " ±" .. posdif
else
-- otherwise range is zero, so leave it as ""
end
else
-- round scaled numbers to integers or 4 sig fig
if (scale > 0 or sc == "a") then
if amount < 1e4 then
amount = roundto(amount, 4)
else
amount = math.floor(amount + 0.5)
end
end
if fnum then amount = args.langobj:formatNum( amount ) end
end
-- unit names and symbols:
-- extract the qid in the form 'Qnnn' from the value.unit url
-- and then fetch the label from that - or symbol if unitabbr is true
local unit = ""
local usep = ""
local usym = ""
local unitqid = string.match( dv.unit, "(Q%d+)" )
if filter and unitqid ~= filter then return nil end
if unitqid and showunits then
local uname = mw.wikibase.getLabelByLang(unitqid, args.lang) or ""
if uname ~= "" then usep, unit = " ", uname end
if uabbr then
-- see if there's a unit symbol (P5061)
local unitsymbols = mw.wikibase.getBestStatements(unitqid, "P5061")
-- construct fallback table, add local lang and multiple languages
local fbtbl = mw.language.getFallbacksFor( args.lang )
table.insert( fbtbl, 1, args.lang )
table.insert( fbtbl, 1, "mul" )
local found = false
for idx1, us in ipairs(unitsymbols) do
for idx2, fblang in ipairs(fbtbl) do
if us.mainsnak.datavalue.value.language == fblang then
usym = us.mainsnak.datavalue.value.text
found = true
break
end
if found then break end
end -- loop through fallback table
end -- loop through values of P5061
if found then usep, unit = " ", usym end
end
end
-- format display:
if conv then
if range == "" then
val = mw.getCurrentFrame():expandTemplate{title = "cvt", args = {amount, unit}}
else
val = mw.getCurrentFrame():expandTemplate{title = "cvt", args = {lowb, "to", upb, unit}}
end
elseif unit == "$" or unit == "£" then
val = unit .. amount .. range .. i18n.multipliers[scale]
else
val = amount .. range .. i18n.multipliers[scale] .. usep .. unit
end
------------------------------------
-- datatypes which are global coordinates:
elseif dtype == "globe-coordinate" then
-- 'display' parameter defaults to "inline, title" *** unused for now ***
-- local disp = args.display or ""
-- if disp == "" then disp = "inline, title" end
--
-- format parameter switches from deg/min/sec to decimal degrees
-- default is deg/min/sec -- decimal degrees needs |format = dec
local form = (args.format or ""):lower():sub(1,3)
if form ~= "dec" then form = "dms" end -- not needed for now
--
-- show parameter allows just the latitude, or just the longitude, or both
-- to be returned as a signed decimal, ignoring the format parameter.
local show = (args.show or ""):lower()
if show ~= "longlat" then show = show:sub(1,3) end
--
local lat, long, prec = dv.latitude, dv.longitude, dv.precision
if show == "lat" then
val = decimalPrecision(lat, prec)
elseif show == "lon" then
val = decimalPrecision(long, prec)
elseif show == "longlat" then
val = decimalPrecision(long, prec) .. ", " .. decimalPrecision(lat, prec)
else
local ns = "N"
local ew = "E"
if lat < 0 then
ns = "S"
lat = - lat
end
if long < 0 then
ew = "W"
long = - long
end
if form == "dec" then
lat = decimalPrecision(lat, prec)
long = decimalPrecision(long, prec)
val = lat .. "°" .. ns .. " " .. long .. "°" .. ew
else
local latdeg, latmin, latsec = decimalToDMS(lat, prec)
local longdeg, longmin, longsec = decimalToDMS(long, prec)
if latsec == 0 and longsec == 0 then
if latmin == 0 and longmin == 0 then
val = latdeg .. "°" .. ns .. " " .. longdeg .. "°" .. ew
else
val = latdeg .. "°" .. latmin .. "′" .. ns .. " "
val = val .. longdeg .. "°".. longmin .. "′" .. ew
end
else
val = latdeg .. "°" .. latmin .. "′" .. latsec .. "″" .. ns .. " "
val = val .. longdeg .. "°" .. longmin .. "′" .. longsec .. "″" .. ew
end
end
end
------------------------------------
elseif dtype == "monolingualtext" then -- data type is Monolingual text:
-- has mainsnak.datavalue.value as a table containing language/text pairs
-- collect all the values in 'out' and languages in 'mlt' and process them later
val = pre .. dv.text .. post
mlt = dv.language
------------------------------------
else
-- some other data type so write a specific handler
val = "unknown data type: " .. dtype
end -- of datatype/unknown value/sourced check
return val, mlt
end
-------------------------------------------------------------------------------
-- propertyvalueandquals takes a property object, the arguments passed from frame,
-- and a qualifier propertyID.
-- It returns a sequence (table) of values representing the values of that property
-- and qualifiers that match the qualifierID if supplied.
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); sourced(); labelOrId(); i18n.latestdatequalifier(); format_Date();
-- makeOrdinal(); roundto(); decimalPrecision(); decimalToDMS(); assembleoutput();
-------------------------------------------------------------------------------
local function propertyvalueandquals(objproperty, args, qualID)
-- needs this style of declaration because it's re-entrant
-- onlysourced is a boolean passed to return only values sourced to other than Wikipedia
-- if nothing or an empty string is passed set it true
local onlysrc = parseParam(args.onlysourced or args.osd, true)
-- linked is a a boolean that enables the link to a local page via sitelink
-- if nothing or an empty string is passed set it true
local linked = parseParam(args.linked, true)
-- prefix is a string that may be nil, empty (""), or a string of characters
-- this is prefixed to each value
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local prefix = (args.prefix or ""):gsub('"', '')
-- postfix is a string that may be nil, empty (""), or a string of characters
-- this is postfixed to each value
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local postfix = (args.postfix or ""):gsub('"', '')
-- linkprefix is a string that may be nil, empty (""), or a string of characters
-- this creates a link and is then prefixed to each value
-- useful when when multiple values are returned and indirect links are needed
-- any double-quotes " are stripped out, so that spaces may be passed
local lprefix = (args.linkprefix or args.lp or ""):gsub('"', '')
-- linkpostfix is a string that may be nil, empty (""), or a string of characters
-- this is postfixed to each value when linking is enabled with lprefix
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local lpostfix = (args.linkpostfix or ""):gsub('"', '')
-- wdlinks is a boolean passed to enable links to Wikidata when no article exists
-- if nothing or an empty string is passed set it false
local wdl = parseParam(args.wdlinks or args.wdl, false)
-- unitabbr is a boolean passed to enable unit abbreviations for common units
-- if nothing or an empty string is passed set it false
local uabbr = parseParam(args.unitabbr or args.uabbr, false)
-- qualsonly is a boolean passed to return just the qualifiers
-- if nothing or an empty string is passed set it false
local qualsonly = parseParam(args.qualsonly or args.qo, false)
-- maxvals is a string that may be nil, empty (""), or a number
-- this determines how many items may be returned when multiple values are available
-- setting it = 1 is useful where the returned string is used within another call, e.g. image
local maxvals = tonumber(args.maxvals) or 0
-- pd (plain date) is a string: yes/true/1 | no/false/0 | adj
-- to disable/enable "sourcing cirumstances" or use adjectival form for the plain date
local pd = args.plaindate or args.pd or "no"
args.pd = pd
-- allow qualifiers to have a different date format; default to year unless qualsonly is set
args.qdf = args.qdf or args.qualifierdateformat or args.df or (not qualsonly and "y")
local lang = args.lang or findLang().code
-- qualID is a string list of wanted qualifiers or "ALL"
qualID = qualID or ""
-- capitalise list of wanted qualifiers and substitute "DATES"
qualID = qualID:upper():gsub("DATES", "P580, P582")
local allflag = (qualID == "ALL")
-- create table of wanted qualifiers as key
local qwanted = {}
-- create sequence of wanted qualifiers
local qorder = {}
for q in mw.text.gsplit(qualID, "%p") do -- split at punctuation and iterate
local qtrim = mw.text.trim(q)
if qtrim ~= "" then
qwanted[mw.text.trim(q)] = true
qorder[#qorder+1] = qtrim
end
end
-- qsep is the output separator for rendering qualifier list
local qsep = (args.qsep or ""):gsub('"', '')
-- qargs are the arguments to supply to assembleoutput()
local qargs = {
["osd"] = "false",
["linked"] = tostring(linked),
["prefix"] = args.qprefix,
["postfix"] = args.qpostfix,
["linkprefix"] = args.qlinkprefix or args.qlp,
["linkpostfix"] = args.qlinkpostfix,
["wdl"] = "false",
["unitabbr"] = tostring(uabbr),
["maxvals"] = 0,
["sorted"] = tostring(args.qsorted),
["noicon"] = "true",
["list"] = args.qlist,
["sep"] = qsep,
["langobj"] = args.langobj,
["lang"] = args.langobj.code,
["df"] = args.qdf,
["sn"] = parseParam(args.qsn or args.qshortname, false),
}
-- all proper values of a Wikidata property will be the same type as the first
-- qualifiers don't have a mainsnak, properties do
local datatype = objproperty[1].datatype or objproperty[1].mainsnak.datatype
-- out[] holds the a list of returned values for this property
-- mlt[] holds the language code if the datatype is monolingual text
local out = {}
local mlt = {}
for k, v in ipairs(objproperty) do
local hasvalue = true
if (onlysrc and not sourced(v)) then
-- no value: it isn't sourced when onlysourced=true
hasvalue = false
else
local val, lcode = rendersnak(v, args, linked, lprefix, lpostfix, prefix, postfix, uabbr)
if not val then
hasvalue = false -- rank doesn't match
elseif qualsonly and qualID then
-- suppress value returned: only qualifiers are requested
else
out[#out+1], mlt[#out+1] = val, lcode
end
end
-- See if qualifiers are to be returned:
local snak = v.mainsnak or v
if hasvalue and v.qualifiers and qualID ~= "" and snak.snaktype~="novalue" then
-- collect all wanted qualifier values returned in qlist, indexed by propertyID
local qlist = {}
local timestart, timeend = "", ""
-- loop through qualifiers
for k1, v1 in pairs(v.qualifiers) do
if allflag or qwanted[k1] then
if k1 == "P1326" then
local ts = v1[1].datavalue.value.time
local dp = v1[1].datavalue.value.precision
qlist[k1] = dateFormat(ts, dp, args.qdf, args.bc, pd, "", lang, "before")
elseif k1 == "P1319" then
local ts = v1[1].datavalue.value.time
local dp = v1[1].datavalue.value.precision
qlist[k1] = dateFormat(ts, dp, args.qdf, args.bc, pd, "", lang, "after")
elseif k1 == "P580" then
timestart = propertyvalueandquals(v1, qargs)[1] or "" -- treat only one start time as valid
elseif k1 == "P582" then
timeend = propertyvalueandquals(v1, qargs)[1] or "" -- treat only one end time as valid
else
local q = assembleoutput(propertyvalueandquals(v1, qargs), qargs)
-- we already deal with circa via 'sourcing circumstances' if the datatype was time
-- circa may be either linked or unlinked *** internationalise later ***
if datatype ~= "time" or q ~= "circa" and not (type(q) == "string" and q:find("circa]]")) then
qlist[k1] = q
end
end
end -- of test for wanted
end -- of loop through qualifiers
-- set date separator
local t = timestart .. timeend
-- *** internationalise date separators later ***
local dsep = "–"
if t:find("%s") or t:find(" ") then dsep = " – " end
-- set the order for the list of qualifiers returned; start time and end time go last
if next(qlist) then
local qlistout = {}
if allflag then
for k2, v2 in pairs(qlist) do
qlistout[#qlistout+1] = v2
end
else
for i2, v2 in ipairs(qorder) do
qlistout[#qlistout+1] = qlist[v2]
end
end
if t ~= "" then
qlistout[#qlistout+1] = timestart .. dsep .. timeend
end
local qstr = assembleoutput(qlistout, qargs)
if qualsonly then
out[#out+1] = qstr
else
out[#out] = out[#out] .. " (" .. qstr .. ")"
end
elseif t ~= "" then
if qualsonly then
if timestart == "" then
out[#out+1] = timeend
elseif timeend == "" then
out[#out+1] = timestart
else
out[#out+1] = timestart .. dsep .. timeend
end
else
out[#out] = out[#out] .. " (" .. timestart .. dsep .. timeend .. ")"
end
end
end -- of test for qualifiers wanted
if maxvals > 0 and #out >= maxvals then break end
end -- of for each value loop
-- we need to pick one value to return if the datatype was "monolingualtext"
-- if there's only one value, use that
-- otherwise look through the fallback languages for a match
if datatype == "monolingualtext" and #out >1 then
lang = mw.text.split( lang, '-', true )[1]
local fbtbl = mw.language.getFallbacksFor( lang )
table.insert( fbtbl, 1, lang )
local bestval = ""
local found = false
for idx1, lang1 in ipairs(fbtbl) do
for idx2, lang2 in ipairs(mlt) do
if (lang1 == lang2) and not found then
bestval = out[idx2]
found = true
break
end
end -- loop through values of property
end -- loop through fallback languages
if found then
-- replace output table with a table containing the best value
out = { bestval }
else
-- more than one value and none of them on the list of fallback languages
-- sod it, just give them the first one
out = { out[1] }
end
end
return out
end
-------------------------------------------------------------------------------
-- Common code for p.getValueByQual and p.getValueByLang
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
local _getvaluebyqual = function(frame, qualID, checkvalue)
-- The property ID that will have a qualifier is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or "")
if propertyID == "" then return "no property supplied" end
if qualID == "" then return "no qualifier supplied" end
-- onlysourced is a boolean passed to return property values
-- only when property values are sourced to something other than Wikipedia
-- if nothing or an empty string is passed set it true
-- if "false" or "no" or 0 is passed set it false
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- set a language object and code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
-- check for locally supplied parameter in second unnamed parameter
-- success means no local parameter and the property exists
local qid, props = parseInput(frame, args[2], propertyID)
local linked = parseParam(args.linked, true)
local lpre = (args.linkprefix or args.lp or ""):gsub('"', '')
local lpost = (args.linkpostfix or ""):gsub('"', '')
local pre = (args.prefix or ""):gsub('"', '')
local post = (args.postfix or ""):gsub('"', '')
local uabbr = parseParam(args.unitabbr or args.uabbr, false)
local filter = (args.unit or ""):upper()
local maxvals = tonumber(args.maxvals) or 0
if filter == "" then filter = nil end
if qid then
local out = {}
-- Scan through the values of the property
-- we want something like property is "pronunciation audio (P443)" in propertyID
-- with a qualifier like "language of work or name (P407)" in qualID
-- whose value has the required ID, like "British English (Q7979)", in qval
for k1, v1 in ipairs(props) do
if v1.mainsnak.snaktype == "value" then
-- check if it has the right qualifier
local v1q = v1.qualifiers
if v1q and v1q[qualID] then
if onlysrc == false or sourced(v1) then
-- if we've got this far, we have a (sourced) claim with qualifiers
-- so see if matches the required value
-- We'll only deal with wikibase-items and strings for now
if v1q[qualID][1].datatype == "wikibase-item" then
if checkvalue(v1q[qualID][1].datavalue.value.id) then
out[#out + 1] = rendersnak(v1, args, linked, lpre, lpost, pre, post, uabbr, filter)
end
elseif v1q[qualID][1].datatype == "string" then
if checkvalue(v1q[qualID][1].datavalue.value) then
out[#out + 1] = rendersnak(v1, args, linked, lpre, lpost, pre, post, uabbr, filter)
end
end
end -- of check for sourced
end -- of check for matching required value and has qualifiers
else
return nil
end -- of check for string
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of propertyID
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- either local parameter or nothing
end -- of test for success
return nil
end
-------------------------------------------------------------------------------
-- _location takes Q-id and follows P276 (location)
-- or P131 (located in the administrative territorial entity) or P706 (located on terrain feature)
-- from the initial item to higher level territories/locations until it reaches the highest.
-- An optional boolean, 'first', determines whether the first item is returned (default: false).
-- An optional boolean 'skip' toggles the display to skip to the last item (default: false).
-- It returns a table containing the locations - linked where possible, except for the highest.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); labelOrId(); linkedItem
-------------------------------------------------------------------------------
local _location = function(qid, first, skip)
first = parseParam(first, false)
skip = parseParam(skip, false)
local locs = {"P276", "P131", "P706"}
local out = {}
local langcode = findLang():getCode()
local finished = false
local count = 0
local prevqid = "Q0"
repeat
local prop
for i1, v1 in ipairs(locs) do
local proptbl = mw.wikibase.getBestStatements(qid, v1)
if #proptbl > 1 then
-- there is more than one higher location
local prevP131, prevP131id
if prevqid ~= "Q0" then
prevP131 = mw.wikibase.getBestStatements(prevqid, "P131")[1]
prevP131id = prevP131
and prevP131.mainsnak.datavalue
and prevP131.mainsnak.datavalue.value.id
end
for i2, v2 in ipairs(proptbl) do
local parttbl = v2.qualifiers and v2.qualifiers.P518
if parttbl then
-- this higher location has qualifier 'applies to part' (P518)
for i3, v3 in ipairs(parttbl) do
if v3.snaktype == "value" and v3.datavalue.value.id == prevqid then
-- it has a value equal to the previous location
prop = proptbl[i2]
break
end -- of test for matching last location
end -- of loop through values of 'applies to part'
else
-- there's no qualifier 'applies to part' (P518)
-- so check if the previous location had a P131 that matches this alternate
if qid == prevP131id then
prop = proptbl[i2]
break
end -- of test for matching previous P131
end
end -- of loop through parent locations
-- fallback to second value if match not found
prop = prop or proptbl[2]
elseif #proptbl > 0 then
prop = proptbl[1]
end
if prop then break end
end
-- check if it's an instance of (P31) a country (Q6256) or sovereign state (Q3624078)
-- and terminate the chain if it is
local inst = mw.wikibase.getAllStatements(qid, "P31")
if #inst > 0 then
for k, v in ipairs(inst) do
local instid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
-- stop if it's a country (or a country within the United Kingdom if skip is true)
if instid == "Q6256" or instid == "Q3624078" or (skip and instid == "Q3336843") then
prop = nil -- this will ensure this is treated as top-level location
break
end
end
end
-- get the name of this location and update qid to point to the parent location
if prop and prop.mainsnak.datavalue then
if not skip or count == 0 then
local args = { lprefix = ":" }
out[#out+1] = linkedItem(qid, args) -- get a linked value if we can
end
qid, prevqid = prop.mainsnak.datavalue.value.id, qid
else
-- This is top-level location, so get short name except when this is the first item
-- Use full label if there's no short name or this is the first item
local prop1813 = mw.wikibase.getAllStatements(qid, "P1813")
-- if there's a short name and this isn't the only item
if prop1813[1] and (#out > 0)then
local shortname
-- short name is monolingual text, so look for match to the local language
-- choose the shortest 'short name' in that language
for k, v in pairs(prop1813) do
if v.mainsnak.datavalue.value.language == langcode then
local name = v.mainsnak.datavalue.value.text
if (not shortname) or (#name < #shortname) then
shortname = name
end
end
end
-- add the shortname if one is found, fallback to the label
-- but skip it if it's "USA"
if shortname ~= "USA" then
out[#out+1] = shortname or labelOrId(qid)
else
if skip then out[#out+1] = "US" end
end
else
-- no shortname, so just add the label
local loc = labelOrId(qid)
-- exceptions go here:
if loc == "United States of America" then
out[#out+1] = "United States"
else
out[#out+1] = loc
end
end
finished = true
end
count = count + 1
until finished or count >= 10 -- limit to 10 levels to avoid infinite loops
-- remove the first location if not required
if not first then table.remove(out, 1) end
-- we might have duplicate text for consecutive locations, so remove them
if #out > 2 then
local plain = {}
for i, v in ipairs(out) do
-- strip any links
plain[i] = v:gsub("^%[%[[^|]*|", ""):gsub("]]$", "")
end
local idx = 2
repeat
if plain[idx] == plain[idx-1] then
-- duplicate found
local removeidx = 0
if (plain[idx] ~= out[idx]) and (plain[idx-1] == out[idx-1]) then
-- only second one is linked, so drop the first
removeidx = idx - 1
elseif (plain[idx] == out[idx]) and (plain[idx-1] ~= out[idx-1]) then
-- only first one is linked, so drop the second
removeidx = idx
else
-- pick one
removeidx = idx - (os.time()%2)
end
table.remove(out, removeidx)
table.remove(plain, removeidx)
else
idx = idx +1
end
until idx >= #out
end
return out
end
-------------------------------------------------------------------------------
-- _getsumofparts scans the property 'has part' (P527) for values matching a list.
-- The list (args.vlist) consists of a string of Qids separated by spaces or any usual punctuation.
-- If the matched values have a qualifer 'quantity' (P1114), those quantites are summed.
-- The sum is returned as a number (i.e. 0 if none)
-- a table of arguments is supplied implementing the usual parameters.
-------------------------------------------------------------------------------
-- Dependencies: setRanks; parseParam; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
local _getsumofparts = function(args)
local vallist = (args.vlist or ""):upper()
if vallist == "" then return end
args.reqranks = setRanks(args.rank)
local f = {}
f.args = args
local qid, props = parseInput(f, "", "P527")
if not qid then return 0 end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local sum = 0
for k1, v1 in ipairs(props) do
if (onlysrc == false or sourced(v1))
and v1.mainsnak.snaktype == "value"
and v1.mainsnak.datavalue.type == "wikibase-entityid"
and vallist:match( v1.mainsnak.datavalue.value.id )
and v1.qualifiers
then
local quals = v1.qualifiers["P1114"]
if quals then
for k2, v2 in ipairs(quals) do
sum = sum + v2.datavalue.value.amount
end
end
end
end
return sum
end
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Public functions
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- _getValue makes the functionality of getValue available to other modules
-------------------------------------------------------------------------------
-- Dependencies: setRanks; parseInput; propertyvalueandquals; assembleoutput; parseParam; sourced;
-- labelOrId; i18n.latestdatequalifier; format_Date; makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p._getValue = function(args)
-- parameter sets for commonly used groups of parameters
local paraset = tonumber(args.ps or args.parameterset or 0)
if paraset == 1 then
-- a common setting
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
elseif paraset == 2 then
-- equivalent to raw
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
args.linked = "no"
args.pd = "true"
elseif paraset == 3 then
-- third set goes here
end
-- implement eid parameter
local eid = args.eid
if eid == "" then
return nil
elseif eid then
args.qid = eid
end
local propertyID = mw.text.trim(args[1] or "")
args.reqranks = setRanks(args.rank)
-- replacetext (rt) is a string that is returned instead of any non-empty Wikidata value
-- this is useful for tracking and debugging, so we set fetchwikidata=ALL to fill the whitelist
local replacetext = mw.text.trim(args.rt or args.replacetext or "")
if replacetext ~= "" then
args.fetchwikidata = "ALL"
end
local f = {}
f.args = args
local entityid, props = parseInput(f, f.args[2], propertyID)
if not entityid then
return props -- either the input parameter or nothing
end
-- qual is a string containing the property ID of the qualifier(s) to be returned
-- if qual == "ALL" then all qualifiers returned
-- if qual == "DATES" then qualifiers P580 (start time) and P582 (end time) returned
-- if nothing or an empty string is passed set it nil -> no qualifiers returned
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
-- set a language object and code in the args table
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- table 'out' stores the return value(s):
local out = propertyvalueandquals(props, args, qualID)
-- format the table of values and return it as a string:
return assembleoutput(out, args, entityid, propertyID)
end
-------------------------------------------------------------------------------
-- getValue is used to get the value(s) of a property
-- The property ID is passed as the first unnamed parameter and is required.
-- A locally supplied parameter may optionaly be supplied as the second unnamed parameter.
-- The function will now also return qualifiers if parameter qual is supplied
-------------------------------------------------------------------------------
-- Dependencies: _getValue; setRanks; parseInput; propertyvalueandquals; assembleoutput; parseParam; sourced;
-- labelOrId; i18n.latestdatequalifier; format_Date; makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p.getValue = function(frame)
local args= frame.args
if not args[1] then
args = frame:getParent().args
if not args[1] then return i18n.errors["No property supplied"] end
end
return p._getValue(args)
end
-------------------------------------------------------------------------------
-- getPreferredValue is used to get a value,
-- (or a comma separated list of them if multiple values exist).
-- If preferred ranks are set, it will return those values, otherwise values with normal ranks
-- now redundant to getValue with |rank=best
-------------------------------------------------------------------------------
-- Dependencies: p.getValue; setRanks; parseInput; propertyvalueandquals; assembleoutput;
-- parseParam; sourced; labelOrId; i18n.latestdatequalifier; format_Date;
-- makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p.getPreferredValue = function(frame)
frame.args.rank = "best"
return p.getValue(frame)
end
-------------------------------------------------------------------------------
-- getCoords is used to get coordinates for display in an infobox
-- whitelist and blacklist are implemented
-- optional 'display' parameter is allowed, defaults to nil - was "inline, title"
-------------------------------------------------------------------------------
-- Dependencies: setRanks(); parseInput(); decimalPrecision();
-------------------------------------------------------------------------------
p.getCoords = function(frame)
local propertyID = "P625"
-- if there is a 'display' parameter supplied, use it
-- otherwise default to nothing
local disp = frame.args.display or ""
if disp == "" then
disp = nil -- default to not supplying display parameter, was "inline, title"
end
-- there may be a format parameter to switch from deg/min/sec to decimal degrees
-- default is deg/min/sec
-- decimal degrees needs |format = dec
local form = (frame.args.format or ""):lower():sub(1,3)
if form ~= "dec" then
form = "dms"
end
-- just deal with best values
frame.args.reqranks = setRanks("best")
local qid, props = parseInput(frame, frame.args[1], propertyID)
if not qid then
return props -- either local parameter or nothing
else
local dv = props[1].mainsnak.datavalue.value
local lat, long, prec = dv.latitude, dv.longitude, dv.precision
lat = decimalPrecision(lat, prec)
long = decimalPrecision(long, prec)
local lat_long = { lat, long }
lat_long["display"] = disp
lat_long["format"] = form
-- invoke template Coord with the values stored in the table
return frame:expandTemplate{title = 'coord', args = lat_long}
end
end
-------------------------------------------------------------------------------
-- getQualifierValue is used to get a formatted value of a qualifier
--
-- The call needs: a property (the unnamed parameter or 1=)
-- a target value for that property (pval=)
-- a qualifier for that target value (qual=)
-- The usual whitelisting and blacklisting of the property is implemented
-- The boolean onlysourced= parameter can be set to return nothing
-- when the property is unsourced (or only sourced to Wikipedia)
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); setRanks(); parseInput(); sourced();
-- propertyvalueandquals(); assembleoutput();
-- labelOrId(); i18n.latestdatequalifier(); format_Date();
-- findLang(); makeOrdinal(); roundto(); decimalPrecision(); decimalToDMS();
-------------------------------------------------------------------------------
p.getQualifierValue = function(frame)
-- The property ID that will have a qualifier is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or "")
-- The value of the property we want to match whose qualifier value is to be returned
-- is passed in named parameter |pval=
local propvalue = frame.args.pval
-- The property ID of the qualifier
-- whose value is to be returned is passed in named parameter |qual=
local qualifierID = frame.args.qual
-- A filter can be set like this: filter=P642==Q22674854
local filter, fprop, fval
local ftable = mw.text.split(frame.args.filter or "", "==")
if ftable[2] then
fprop = mw.text.trim(ftable[1])
fval = mw.text.trim(ftable[2])
filter = true
end
-- onlysourced is a boolean passed to return qualifiers
-- only when property values are sourced to something other than Wikipedia
-- if nothing or an empty string is passed set it true
-- if "false" or "no" or 0 is passed set it false
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set a language object and language code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- check for locally supplied parameter in second unnamed parameter
-- success means no local parameter and the property exists
local qid, props = parseInput(frame, frame.args[2], propertyID)
if qid then
local out = {}
-- Scan through the values of the property
-- we want something like property is P793, significant event (in propertyID)
-- whose value is something like Q385378, construction (in propvalue)
-- then we can return the value(s) of a qualifier such as P580, start time (in qualifierID)
for k1, v1 in pairs(props) do
if v1.mainsnak.snaktype == "value" and v1.mainsnak.datavalue.type == "wikibase-entityid" then
-- It's a wiki-linked value, so check if it's the target (in propvalue) and if it has qualifiers
if v1.mainsnak.datavalue.value.id == propvalue and v1.qualifiers then
if onlysrc == false or sourced(v1) then
-- if we've got this far, we have a (sourced) claim with qualifiers
-- which matches the target, so apply the filter and find the value(s) of the qualifier we want
if not filter or (v1.qualifiers[fprop] and v1.qualifiers[fprop][1].datavalue.value.id == fval) then
local quals = v1.qualifiers[qualifierID]
if quals then
-- can't reference qualifer, so set onlysourced = "no" (args are strings, not boolean)
local qargs = frame.args
qargs.onlysourced = "no"
local vals = propertyvalueandquals(quals, qargs, qid)
for k, v in ipairs(vals) do
out[#out + 1] = v
end
end
end
end -- of check for sourced
end -- of check for matching required value and has qualifiers
end -- of check for wikibase entity
end -- of loop through values of propertyID
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- either local parameter or nothing
end -- of test for success
return nil
end
-------------------------------------------------------------------------------
-- getSumOfParts scans the property 'has part' (P527) for values matching a list.
-- The list is passed in parameter vlist.
-- It consists of a string of Qids separated by spaces or any usual punctuation.
-- If the matched values have a qualifier 'quantity' (P1114), those quantities are summed.
-- The sum is returned as a number or nothing if zero.
-------------------------------------------------------------------------------
-- Dependencies: _getsumofparts;
-------------------------------------------------------------------------------
p.getSumOfParts = function(frame)
local sum = _getsumofparts(frame.args)
if sum == 0 then return end
return sum
end
-------------------------------------------------------------------------------
-- getValueByQual gets the value of a property which has a qualifier with a given entity value
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the ID of a qualifier for that property (qualID=Pyyy)
-- either the Wikibase-entity ID of a value for that qualifier (qvalue=Qzzz)
-- or a string value for that qualifier (qvalue=abc123)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: _getvaluebyqual; parseParam; setRanks; parseInput; sourced;
-- assembleoutput;
-------------------------------------------------------------------------------
p.getValueByQual = function(frame)
local qualID = frame.args.qualID
-- The Q-id of the value for the qualifier we want to match is in named parameter |qvalue=
local qval = frame.args.qvalue or ""
if qval == "" then return "no qualifier value supplied" end
local function checkQID(id)
return id == qval
end
return _getvaluebyqual(frame, qualID, checkQID)
end
-------------------------------------------------------------------------------
-- getValueByLang gets the value of a property which has a qualifier P407
-- ("language of work or name") whose value has the given language code
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the MediaWiki language code to match the language (lang=xx[-yy])
-- (if no code is supplied, it uses the default language)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: _getvaluebyqual; parseParam; setRanks; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
p.getValueByLang = function(frame)
-- The language code for the qualifier we want to match is in named parameter |lang=
local langcode = findLang(frame.args.lang).code
local function checkLanguage(id)
-- id should represent a language like "British English (Q7979)"
-- it should have string property "Wikimedia language code (P424)"
-- qlcode will be a table:
local qlcode = mw.wikibase.getBestStatements(id, "P424")
if (#qlcode > 0) and (qlcode[1].mainsnak.datavalue.value == langcode) then
return true
end
end
return _getvaluebyqual(frame, "P407", checkLanguage)
end
-------------------------------------------------------------------------------
-- getValueByRefSource gets the value of a property which has a reference "stated in" (P248)
-- whose value has the given entity-ID.
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the entity ID of a value to match where the reference is stated in (match=Qzzz)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getValueByRefSource = function(frame)
-- The property ID that we want to check is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or ""):upper()
if propertyID == "" then return "no property supplied" end
-- The Q-id of the value we want to match is in named parameter |qvalue=
local qval = (frame.args.match or ""):upper()
if qval == "" then qval = "Q21540096" end
local unit = (frame.args.unit or ""):upper()
if unit == "" then unit = "Q4917" end
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- set a language object and code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local linked = parseParam(frame.args.linked, true)
local uabbr = parseParam(frame.args.uabbr or frame.args.unitabbr, false)
-- qid not nil means no local parameter and the property exists
local qid, props = parseInput(frame, frame.args[2], propertyID)
if qid then
local out = {}
local mlt= {}
for k1, v1 in ipairs(props) do
if onlysrc == false or sourced(v1) then
if v1.references then
for k2, v2 in ipairs(v1.references) do
if v2.snaks.P248 then
for k3, v3 in ipairs(v2.snaks.P248) do
if v3.datavalue.value.id == qval then
out[#out+1], mlt[#out+1] = rendersnak(v1, frame.args, linked, "", "", "", "", uabbr, unit)
if not mlt[#out] then
-- we only need one match per property value
-- unless datatype was monolingual text
break
end
end -- of test for match
end -- of loop through values "stated in"
end -- of test that "stated in" exists
end -- of loop through references
end -- of test that references exist
end -- of test for sourced
end -- of loop through values of propertyID
if #mlt > 0 then
local langcode = frame.args.lang
langcode = mw.text.split( langcode, '-', true )[1]
local fbtbl = mw.language.getFallbacksFor( langcode )
table.insert( fbtbl, 1, langcode )
local bestval = ""
local found = false
for idx1, lang1 in ipairs(fbtbl) do
for idx2, lang2 in ipairs(mlt) do
if (lang1 == lang2) and not found then
bestval = out[idx2]
found = true
break
end
end -- loop through values of property
end -- loop through fallback languages
if found then
-- replace output table with a table containing the best value
out = { bestval }
else
-- more than one value and none of them on the list of fallback languages
-- sod it, just give them the first one
out = { out[1] }
end
end
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- no property or local parameter supplied
end -- of test for success
end
-------------------------------------------------------------------------------
-- getPropertyIDs takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- It returns the Entity-IDs (Qids) of the values of a property if it is a Wikibase-Entity.
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p._getPropertyIDs = function(args)
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- change default for noicon to true
args.noicon = tostring(parseParam(args.noicon or "", true))
local f = {}
f.args = args
local pid = mw.text.trim(args[1] or ""):upper()
-- get the qid and table of claims for the property, or nothing and the local value passed
local qid, props = parseInput(f, args[2], pid)
if not qid then return props end
if not props[1] then return nil end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local out = {}
for i, v in ipairs(props) do
local snak = v.mainsnak
if ( snak.datatype == "wikibase-item" )
and ( v.rank and args.reqranks[v.rank:sub(1, 1)] )
and ( snak.snaktype == "value" )
and ( sourced(v) or not onlysrc )
then
out[#out+1] = snak.datavalue.value.id
end
if maxvals > 0 and #out >= maxvals then break end
end
return assembleoutput(out, args, qid, pid)
end
p.getPropertyIDs = function(frame)
local args = frame.args
return p._getPropertyIDs(args)
end
-------------------------------------------------------------------------------
-- getQualifierIDs takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- It takes a property-id as the first unnamed parameter, and an optional parameter qlist
-- which is a list of qualifier property-ids to search for (default is "ALL")
-- It returns the Entity-IDs (Qids) of the values of a property if it is a Wikibase-Entity.
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getQualifierIDs = function(frame)
local args = frame.args
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- change default for noicon to true
args.noicon = tostring(parseParam(args.noicon or "", true))
local f = {}
f.args = args
local pid = mw.text.trim(args[1] or ""):upper()
-- get the qid and table of claims for the property, or nothing and the local value passed
local qid, props = parseInput(f, args[2], pid)
if not qid then return props end
if not props[1] then return nil end
-- get the other parameters
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qlist = args.qlist or ""
if qlist == "" then qlist = "ALL" end
qlist = qlist:gsub("[%p%s]+", " ") .. " "
local out = {}
for i, v in ipairs(props) do
local snak = v.mainsnak
if ( v.rank and args.reqranks[v.rank:sub(1, 1)] )
and ( snak.snaktype == "value" )
and ( sourced(v) or not onlysrc )
then
if v.qualifiers then
for k1, v1 in pairs(v.qualifiers) do
if qlist == "ALL " or qlist:match(k1 .. " ") then
for i2, v2 in ipairs(v1) do
if v2.datatype == "wikibase-item" and v2.snaktype == "value" then
out[#out+1] = v2.datavalue.value.id
end -- of test that id exists
end -- of loop through qualifier values
end -- of test for kq in qlist
end -- of loop through qualifiers
end -- of test for qualifiers
end -- of test for rank value, sourced, and value exists
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through property values
return assembleoutput(out, args, qid, pid)
end
-------------------------------------------------------------------------------
-- getPropOfProp takes two propertyIDs: prop1 and prop2 (as well as the usual parameters)
-- If the value(s) of prop1 are of type "wikibase-item" then it returns the value(s) of prop2
-- of each of those wikibase-items.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p._getPropOfProp = function(args)
-- parameter sets for commonly used groups of parameters
local paraset = tonumber(args.ps or args.parameterset or 0)
if paraset == 1 then
-- a common setting
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
elseif paraset == 2 then
-- equivalent to raw
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
args.linked = "no"
args.pd = "true"
elseif paraset == 3 then
-- third set goes here
end
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
local pid1 = args.prop1 or args.pid1 or ""
local pid2 = args.prop2 or args.pid2 or ""
if pid1 == "" or pid2 == "" then return nil end
local f = {}
f.args = args
local qid1, statements1 = parseInput(f, args[1], pid1)
-- parseInput nulls empty args[1] and returns args[1] if nothing on Wikidata
if not qid1 then return statements1 end
-- otherwise it returns the qid and a table for the statement
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
local out = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
local snak = v.mainsnak
if snak.datatype == "wikibase-item" and snak.snaktype == "value" then
local qid2 = snak.datavalue.value.id
local statements2 = {}
if args.reqranks.b then
statements2 = mw.wikibase.getBestStatements(qid2, pid2)
else
statements2 = mw.wikibase.getAllStatements(qid2, pid2)
end
if statements2[1] then
local out2 = propertyvalueandquals(statements2, args, qualID)
out[#out+1] = assembleoutput(out2, args, qid2, pid2)
end
end -- of test for valid property1 value
end -- of test for sourced
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of property1
return assembleoutput(out, args, qid1, pid1)
end
p.getPropOfProp = function(frame)
local args= frame.args
if not args.prop1 and not args.pid1 then
args = frame:getParent().args
if not args.prop1 and not args.pid1 then return i18n.errors["No property supplied"] end
end
return p._getPropOfProp(args)
end
-------------------------------------------------------------------------------
-- getAwardCat takes most of the usual parameters. If the item has values of P166 (award received),
-- then it examines each of those awards for P2517 (category for recipients of this award).
-- If it exists, it returns the corresponding category,
-- with the item's P734 (family name) as sort key, or no sort key if there is no family name.
-- The sort key may be overridden by the parameter |sortkey (alias |sk).
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getAwardCat = function(frame)
frame.args.reqranks = setRanks(frame.args.rank)
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
args.sep = " "
local pid1 = args.prop1 or "P166"
local pid2 = args.prop2 or "P2517"
if pid1 == "" or pid2 == "" then return nil end
-- locally supplied value:
local localval = mw.text.trim(args[1] or "")
local qid1, statements1 = parseInput(frame, localval, pid1)
if not qid1 then return localval end
-- linkprefix (strip quotes)
local lp = (args.linkprefix or args.lp or ""):gsub('"', '')
-- sort key (strip quotes, hyphens and periods):
local sk = (args.sortkey or args.sk or ""):gsub('["-.]', '')
-- family name:
local famname = ""
if sk == "" then
local p734 = mw.wikibase.getBestStatements(qid1, "P734")[1]
local p734id = p734 and p734.mainsnak.snaktype == "value" and p734.mainsnak.datavalue.value.id or ""
famname = mw.wikibase.getSitelink(p734id) or ""
-- strip namespace and disambigation
local pos = famname:find(":") or 0
famname = famname:sub(pos+1):gsub("%s%(.+%)$", "")
if famname == "" then
local lbl = mw.wikibase.getLabel(p734id)
famname = lbl and mw.text.nowiki(lbl) or ""
end
end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
local out = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
local snak = v.mainsnak
if snak.datatype == "wikibase-item" and snak.snaktype == "value" then
local qid2 = snak.datavalue.value.id
local statements2 = {}
if args.reqranks.b then
statements2 = mw.wikibase.getBestStatements(qid2, pid2)
else
statements2 = mw.wikibase.getAllStatements(qid2, pid2)
end
if statements2[1] and statements2[1].mainsnak.snaktype == "value" then
local qid3 = statements2[1].mainsnak.datavalue.value.id
local sitelink = mw.wikibase.getSitelink(qid3)
-- if there's no local sitelink, create the sitelink from English label
if not sitelink then
local lbl = mw.wikibase.getLabelByLang(qid3, "en")
if lbl then
if lbl:sub(1,9) == "Category:" then
sitelink = mw.text.nowiki(lbl)
else
sitelink = "Category:" .. mw.text.nowiki(lbl)
end
end
end
if sitelink then
if sk ~= "" then
out[#out+1] = "[[" .. lp .. sitelink .. "|" .. sk .. "]]"
elseif famname ~= "" then
out[#out+1] = "[[" .. lp .. sitelink .. "|" .. famname .. "]]"
else
out[#out+1] = "[[" .. lp .. sitelink .. "]]"
end -- of check for sort keys
end -- of test for sitelink
end -- of test for category
end -- of test for wikibase item has a value
end -- of test for sourced
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of property1
return assembleoutput(out, args, qid1, pid1)
end
-------------------------------------------------------------------------------
-- getIntersectCat takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-- It takes two properties, |prop1 and |prop2 (e.g. occupation and country of citizenship)
-- Each property's value is a wiki-base entity
-- For each value of the first parameter (ranks implemented) it fetches the value's main category
-- and then each value of the second parameter (possibly substituting a simpler description)
-- then it returns all of the categories representing the intersection of those properties,
-- (e.g. Category:Actors from Canada). A joining term may be supplied (e.g. |join=from).
-- The item's P734 (family name) is the sort key, or no sort key if there is no family name.
-- The sort key may be overridden by the parameter |sortkey (alias |sk).
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getIntersectCat = function(frame)
frame.args.reqranks = setRanks(frame.args.rank)
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
args.sep = " "
args.linked = "no"
local pid1 = args.prop1 or "P106"
local pid2 = args.prop2 or "P27"
if pid1 == "" or pid2 == "" then return nil end
local qid, statements1 = parseInput(frame, "", pid1)
if not qid then return nil end
local qid, statements2 = parseInput(frame, "", pid2)
if not qid then return nil end
-- topics like countries may have different names in categories from their label in Wikidata
local subs_exists, subs = pcall(mw.loadData, "Module:WikidataIB/subs")
local join = args.join or ""
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
-- linkprefix (strip quotes)
local lp = (args.linkprefix or args.lp or ""):gsub('"', '')
-- sort key (strip quotes, hyphens and periods):
local sk = (args.sortkey or args.sk or ""):gsub('["-.]', '')
-- family name:
local famname = ""
if sk == "" then
local p734 = mw.wikibase.getBestStatements(qid, "P734")[1]
local p734id = p734 and p734.mainsnak.snaktype == "value" and p734.mainsnak.datavalue.value.id or ""
famname = mw.wikibase.getSitelink(p734id) or ""
-- strip namespace and disambigation
local pos = famname:find(":") or 0
famname = famname:sub(pos+1):gsub("%s%(.+%)$", "")
if famname == "" then
local lbl = mw.wikibase.getLabel(p734id)
famname = lbl and mw.text.nowiki(lbl) or ""
end
end
local cat1 = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
-- get the ID representing the value of the property
local pvalID = (v.mainsnak.snaktype == "value") and v.mainsnak.datavalue.value.id
if pvalID then
-- get the topic's main category (P910) for that entity
local p910 = mw.wikibase.getBestStatements(pvalID, "P910")[1]
if p910 and p910.mainsnak.snaktype == "value" then
local tmcID = p910.mainsnak.datavalue.value.id
-- use sitelink or the English label for the cat
local cat = mw.wikibase.getSitelink(tmcID)
if not cat then
local lbl = mw.wikibase.getLabelByLang(tmcID, "en")
if lbl then
if lbl:sub(1,9) == "Category:" then
cat = mw.text.nowiki(lbl)
else
cat = "Category:" .. mw.text.nowiki(lbl)
end
end
end
cat1[#cat1+1] = cat
end -- of test for topic's main category exists
end -- of test for property has vaild value
end -- of test for sourced
if maxvals > 0 and #cat1 >= maxvals then break end
end
local cat2 = {}
for k, v in ipairs(statements2) do
if not onlysrc or sourced(v) then
local cat = rendersnak(v, args)
if subs[cat] then cat = subs[cat] end
cat2[#cat2+1] = cat
end
if maxvals > 0 and #cat2 >= maxvals then break end
end
local out = {}
for k1, v1 in ipairs(cat1) do
for k2, v2 in ipairs(cat2) do
if sk ~= "" then
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "|" .. sk .. "]]"
elseif famname ~= "" then
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "|" .. famname .. "]]"
else
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "]]"
end -- of check for sort keys
end
end
args.noicon = "true"
return assembleoutput(out, args, qid, pid1)
end
-------------------------------------------------------------------------------
-- qualsToTable takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- A qid may be given, and the first unnamed parameter is the property ID, which is of type wikibase item.
-- It takes a list of qualifier property IDs as |quals=
-- For a given qid and property, it creates the rows of an html table,
-- each row being a value of the property (optionally only if the property matches the value in |pval= )
-- each cell being the first value of the qualifier corresponding to the list in |quals
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced;
-------------------------------------------------------------------------------
p.qualsToTable = function(frame)
local args = frame.args
local quals = args.quals or ""
if quals == "" then return "" end
args.reqranks = setRanks(args.rank)
local propertyID = mw.text.trim(args[1] or "")
local f = {}
f.args = args
local entityid, props = parseInput(f, "", propertyID)
if not entityid then return "" end
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
local pval = args.pval or ""
local qplist = mw.text.split(quals, "%p") -- split at punctuation and make a sequential table
for i, v in ipairs(qplist) do
qplist[i] = mw.text.trim(v):upper() -- remove whitespace and capitalise
end
local col1 = args.firstcol or ""
if col1 ~= "" then
col1 = col1 .. "</td><td>"
end
local emptycell = args.emptycell or " "
-- construct a 2-D array of qualifier values in qvals
local qvals = {}
for i, v in ipairs(props) do
local skip = false
if pval ~= "" then
local pid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
if pid ~= pval then skip = true end
end
if not skip then
local qval = {}
local vqualifiers = v.qualifiers or {}
-- go through list of wanted qualifier properties
for i1, v1 in ipairs(qplist) do
-- check for that property ID in the statement's qualifiers
local qv, qtype
if vqualifiers[v1] then
qtype = vqualifiers[v1][1].datatype
if qtype == "time" then
if vqualifiers[v1][1].snaktype == "value" then
qv = mw.wikibase.renderSnak(vqualifiers[v1][1])
qv = frame:expandTemplate{title="dts", args={qv}}
else
qv = "?"
end
elseif qtype == "url" then
if vqualifiers[v1][1].snaktype == "value" then
qv = mw.wikibase.renderSnak(vqualifiers[v1][1])
local display = mw.ustring.match( mw.uri.decode(qv, "WIKI"), "([%w ]+)$" )
if display then
qv = "[" .. qv .. " " .. display .. "]"
end
end
else
qv = mw.wikibase.formatValue(vqualifiers[v1][1])
end
end
-- record either the value or a placeholder
qval[i1] = qv or emptycell
end -- of loop through list of qualifiers
-- add the list of qualifier values as a "row" in the main list
qvals[#qvals+1] = qval
end
end -- of for each value loop
local out = {}
for i, v in ipairs(qvals) do
out[i] = "<tr><td>" .. col1 .. table.concat(qvals[i], "</td><td>") .. "</td></tr>"
end
return table.concat(out, "\n")
end
-------------------------------------------------------------------------------
-- getGlobe takes an optional qid of a Wikidata entity passed as |qid=
-- otherwise it uses the linked item for the current page.
-- If returns the Qid of the globe used in P625 (coordinate location),
-- or nil if there isn't one.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getGlobe = function(frame)
local qid = frame.args.qid or frame.args[1] or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
local coords = mw.wikibase.getBestStatements(qid, "P625")[1]
local globeid
if coords and coords.mainsnak.snaktype == "value" then
globeid = coords.mainsnak.datavalue.value.globe:match("(Q%d+)")
end
return globeid
end
-------------------------------------------------------------------------------
-- getCommonsLink takes an optional qid of a Wikidata entity passed as |qid=
-- It returns one of the following in order of preference:
-- the Commons sitelink of the linked Wikidata item;
-- the Commons sitelink of the topic's main category of the linked Wikidata item;
-------------------------------------------------------------------------------
-- Dependencies: _getCommonslink(); _getSitelink(); parseParam()
-------------------------------------------------------------------------------
p.getCommonsLink = function(frame)
local oc = frame.args.onlycat or frame.args.onlycategories
local fb = parseParam(frame.args.fallback or frame.args.fb, true)
return _getCommonslink(frame.args.qid, oc, fb)
end
-------------------------------------------------------------------------------
-- getSitelink takes the qid of a Wikidata entity passed as |qid=
-- It takes an optional parameter |wiki= to determine which wiki is to be checked for a sitelink
-- If the parameter is blank, then it uses the local wiki.
-- If there is a sitelink to an article available, it returns the plain text link to the article
-- If there is no sitelink, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getSiteLink = function(frame)
return _getSitelink(frame.args.qid, frame.args.wiki or mw.text.trim(frame.args[1] or ""))
end
-------------------------------------------------------------------------------
-- getLink has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- If there is a sitelink to an article on the local Wiki, it returns a link to the article
-- with the Wikidata label as the displayed text.
-- If there is no sitelink, it returns the label as plain text.
-- If there is no label in the local language, it displays the qid instead.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLink = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
local sitelink = mw.wikibase.getSitelink(itemID)
local label = labelOrId(itemID)
if sitelink then
return "[[:" .. sitelink .. "|" .. label .. "]]"
else
return label
end
end
-------------------------------------------------------------------------------
-- getLabel has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- It returns the Wikidata label for the local language as plain text.
-- If there is no label in the local language, it displays the qid instead.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLabel = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
local lang = frame.args.lang or ""
if lang == "" then lang = nil end
local label = labelOrId(itemID, lang)
return label
end
-------------------------------------------------------------------------------
-- label has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- if no qid is supplied, it uses the qid associated with the current page.
-- It returns the Wikidata label for the local language as plain text.
-- If there is no label in the local language, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.label = function(frame)
local qid = mw.text.trim(frame.args[1] or frame.args.qid or "")
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return end
local lang = frame.args.lang or ""
if lang == "" then lang = nil end
local label, success = labelOrId(qid, lang)
if success then return label end
end
-------------------------------------------------------------------------------
-- getAT (Article Title)
-- has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- If there is a sitelink to an article on the local Wiki, it returns the sitelink as plain text.
-- If there is no sitelink or qid supplied, it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAT = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
return mw.wikibase.getSitelink(itemID)
end
-------------------------------------------------------------------------------
-- getDescription has the qid of a Wikidata entity passed as |qid=
-- (it defaults to the associated qid of the current article if omitted)
-- and a local parameter passed as the first unnamed parameter.
-- Any local parameter passed (other than "Wikidata" or "none") becomes the return value.
-- It returns the article description for the Wikidata entity if the local parameter is "Wikidata".
-- Nothing is returned if the description doesn't exist or "none" is passed as the local parameter.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getDescription = function(frame)
local desc = mw.text.trim(frame.args[1] or "")
local itemID = mw.text.trim(frame.args.qid or "")
if itemID == "" then itemID = nil end
if desc:lower() == 'wikidata' then
return mw.wikibase.getDescription(itemID)
elseif desc:lower() == 'none' then
return nil
else
return desc
end
end
-------------------------------------------------------------------------------
-- getAliases has the qid of a Wikidata entity passed as |qid=
-- (it defaults to the associated qid of the current article if omitted)
-- and a local parameter passed as the first unnamed parameter.
-- It implements blacklisting and whitelisting with a field name of "alias" by default.
-- Any local parameter passed becomes the return value.
-- Otherwise it returns the aliases for the Wikidata entity with the usual list options.
-- Nothing is returned if the aliases do not exist.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); assembleoutput()
-------------------------------------------------------------------------------
p.getAliases = function(frame)
local args = frame.args
local fieldname = args.name or ""
if fieldname == "" then fieldname = "alias" end
local blacklist = args.suppressfields or args.spf or ""
if blacklist:find(fieldname) then return nil end
local localval = mw.text.trim(args[1] or "")
if localval ~= "" then return localval end
local whitelist = args.fetchwikidata or args.fwd or ""
if whitelist == "" then whitelist = "NONE" end
if not (whitelist == 'ALL' or whitelist:find(fieldname)) then return nil end
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return nil end
local aliases = mw.wikibase.getEntity(qid).aliases
if not aliases then return nil end
args.langobj = findLang(args.lang)
local langcode = args.langobj.code
args.lang = langcode
local out = {}
for k1, v1 in pairs(aliases) do
if v1[1].language == langcode then
for k1, v2 in ipairs(v1) do
out[#out+1] = v2.value
end
break
end
end
return assembleoutput(out, args, qid)
end
-------------------------------------------------------------------------------
-- pageId returns the page id (entity ID, Qnnn) of the current page
-- returns nothing if the page is not connected to Wikidata
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.pageId = function(frame)
return mw.wikibase.getEntityIdForCurrentPage()
end
-------------------------------------------------------------------------------
-- formatDate is a wrapper to export the private function format_Date
-------------------------------------------------------------------------------
-- Dependencies: format_Date();
-------------------------------------------------------------------------------
p.formatDate = function(frame)
return format_Date(frame.args[1], frame.args.df, frame.args.bc)
end
-------------------------------------------------------------------------------
-- location is a wrapper to export the private function _location
-- it takes the entity-id as qid or the first unnamed parameter
-- optional boolean parameter first toggles the display of the first item
-- optional boolean parameter skip toggles the display to skip to the last item
-- parameter debug=<y/n> (default 'n') adds error msg if not a location
-------------------------------------------------------------------------------
-- Dependencies: _location();
-------------------------------------------------------------------------------
p.location = function(frame)
local debug = (frame.args.debug or ""):sub(1, 1):lower()
if debug == "" then debug = "n" end
local qid = mw.text.trim(frame.args.qid or frame.args[1] or ""):upper()
if qid == "" then qid=mw.wikibase.getEntityIdForCurrentPage() end
if not qid then
if debug ~= "n" then
return i18n.errors["entity-not-found"]
else
return nil
end
end
local first = mw.text.trim(frame.args.first or "")
local skip = mw.text.trim(frame.args.skip or "")
return table.concat( _location(qid, first, skip), ", " )
end
-------------------------------------------------------------------------------
-- checkBlacklist implements a test to check whether a named field is allowed
-- returns true if the field is not blacklisted (i.e. allowed)
-- returns false if the field is blacklisted (i.e. disallowed)
-- {{#if:{{#invoke:WikidataIB |checkBlacklist |name=Joe |suppressfields=Dave; Joe; Fred}} | not blacklisted | blacklisted}}
-- displays "blacklisted"
-- {{#if:{{#invoke:WikidataIB |checkBlacklist |name=Jim |suppressfields=Dave; Joe; Fred}} | not blacklisted | blacklisted}}
-- displays "not blacklisted"
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.checkBlacklist = function(frame)
local blacklist = frame.args.suppressfields or frame.args.spf or ""
local fieldname = frame.args.name or ""
if blacklist ~= "" and fieldname ~= "" then
if blacklist:find(fieldname) then
return false
else
return true
end
else
-- one of the fields is missing: let's call that "not on the list"
return true
end
end
-------------------------------------------------------------------------------
-- emptyor returns nil if its first unnamed argument is just punctuation, whitespace or html tags
-- otherwise it returns the argument unchanged (including leading/trailing space).
-- If the argument may contain "=", then it must be called explicitly:
-- |1=arg
-- (In that case, leading and trailing spaces are trimmed)
-- It finds use in infoboxes where it can replace tests like:
-- {{#if: {{#invoke:WikidatIB |getvalue |P99 |fwd=ALL}} | <span class="xxx">{{#invoke:WikidatIB |getvalue |P99 |fwd=ALL}}</span> | }}
-- with a form that uses just a single call to Wikidata:
-- {{#invoke |WikidataIB |emptyor |1= <span class="xxx">{{#invoke:WikidataIB |getvalue |P99 |fwd=ALL}}</span> }}
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.emptyor = function(frame)
local s = frame.args[1] or ""
if s == "" then return nil end
local sx = s:gsub("%s", ""):gsub("<[^>]*>", ""):gsub("%p", "")
if sx == "" then
return nil
else
return s
end
end
-------------------------------------------------------------------------------
-- labelorid is a public function to expose the output of labelOrId()
-- Pass the Q-number as |qid= or as an unnamed parameter.
-- It returns the Wikidata label for that entity or the qid if no label exists.
-------------------------------------------------------------------------------
-- Dependencies: labelOrId
-------------------------------------------------------------------------------
p.labelorid = function(frame)
return (labelOrId(frame.args.qid or frame.args[1]))
end
-------------------------------------------------------------------------------
-- getLang returns the MediaWiki language code of the current content.
-- If optional parameter |style=full, it returns the language name.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLang = function(frame)
local style = (frame.args.style or ""):lower()
local langcode = mw.language.getContentLanguage().code
if style == "full" then
return mw.language.fetchLanguageName( langcode )
end
return langcode
end
-------------------------------------------------------------------------------
-- getItemLangCode takes a qid parameter (using the current page's qid if blank)
-- If the item for that qid has property country (P17) it looks at the first preferred value
-- If the country has an official language (P37), it looks at the first preferred value
-- If that official language has a language code (P424), it returns the first preferred value
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: _getItemLangCode()
-------------------------------------------------------------------------------
p.getItemLangCode = function(frame)
return _getItemLangCode(frame.args.qid or frame.args[1])
end
-------------------------------------------------------------------------------
-- findLanguage exports the local findLang() function
-- It takes an optional language code and returns, in order of preference:
-- the code if a known language;
-- the user's language, if set;
-- the server's content language.
-------------------------------------------------------------------------------
-- Dependencies: findLang
-------------------------------------------------------------------------------
p.findLanguage = function(frame)
return findLang(frame.args.lang or frame.args[1]).code
end
-------------------------------------------------------------------------------
-- getQid returns the qid, if supplied
-- failing that, the Wikidata entity ID of the "category's main topic (P301)", if it exists
-- failing that, the Wikidata entity ID associated with the current page, if it exists
-- otherwise, nothing
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getQid = function(frame)
local qid = (frame.args.qid or ""):upper()
-- check if a qid was passed; if so, return it:
if qid ~= "" then return qid end
-- check if there's a "category's main topic (P301)":
qid = mw.wikibase.getEntityIdForCurrentPage()
if qid then
local prop301 = mw.wikibase.getBestStatements(qid, "P301")
if prop301[1] then
local mctid = prop301[1].mainsnak.datavalue.value.id
if mctid then return mctid end
end
end
-- otherwise return the page qid (if any)
return qid
end
-------------------------------------------------------------------------------
-- followQid takes four optional parameters: qid, props, list and all.
-- If qid is not given, it uses the qid for the connected page
-- or returns nil if there isn't one.
-- props is a list of properties, separated by punctuation.
-- If props is given, the Wikidata item for the qid is examined for each property in turn.
-- If that property contains a value that is another Wikibase-item, that item's qid is returned,
-- and the search terminates, unless |all=y when all of the qids are returned, separated by spaces.
-- If |list= is set to a template, the qids are passed as arguments to the template.
-- If props is not given, the qid is returned.
-------------------------------------------------------------------------------
-- Dependencies: parseParam()
-------------------------------------------------------------------------------
p._followQid = function(args)
local qid = (args.qid or ""):upper()
local all = parseParam(args.all, false)
local list = args.list or ""
if list == "" then list = nil end
if qid == "" then
qid = mw.wikibase.getEntityIdForCurrentPage()
end
if not qid then return nil end
local out = {}
local props = (args.props or ""):upper()
if props ~= "" then
for p in mw.text.gsplit(props, "%p") do -- split at punctuation and iterate
p = mw.text.trim(p)
for i, v in ipairs( mw.wikibase.getBestStatements(qid, p) ) do
local linkedid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
if linkedid then
if all then
out[#out+1] = linkedid
else
return linkedid
end -- test for all or just the first one found
end -- test for value exists for that property
end -- loop through values of property to follow
end -- loop through list of properties to follow
end
if #out > 0 then
local ret = ""
if list then
ret = mw.getCurrentFrame():expandTemplate{title = list, args = out}
else
ret = table.concat(out, " ")
end
return ret
else
return qid
end
end
p.followQid = function(frame)
return p._followQid(frame.args)
end
-------------------------------------------------------------------------------
-- globalSiteID returns the globalSiteID for the current wiki
-- e.g. returns "enwiki" for the English Wikipedia, "enwikisource" for English Wikisource, etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.globalSiteID = function(frame)
return mw.wikibase.getGlobalSiteId()
end
-------------------------------------------------------------------------------
-- siteID returns the root of the globalSiteID
-- e.g. "en" for "enwiki", "enwikisource", etc.
-- treats "en-gb" as "en", etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.siteID = function(frame)
local txtlang = frame:preprocess( "{{int:lang}}" ) or ""
-- This deals with specific exceptions: be-tarask -> be-x-old
if txtlang == "be-tarask" then
return "be_x_old"
end
local pos = txtlang:find("-")
local ret = ""
if pos then
ret = txtlang:sub(1, pos-1)
else
ret = txtlang
end
return ret
end
-------------------------------------------------------------------------------
-- projID returns the code used to link to the reader's language's project
-- e.g "en" for [[:en:WikidataIB]]
-- treats "en-gb" as "en", etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.projID = function(frame)
local txtlang = frame:preprocess( "{{int:lang}}" ) or ""
-- This deals with specific exceptions: be-tarask -> be-x-old
if txtlang == "be-tarask" then
return "be-x-old"
end
local pos = txtlang:find("-")
local ret = ""
if pos then
ret = txtlang:sub(1, pos-1)
else
ret = txtlang
end
return ret
end
-------------------------------------------------------------------------------
-- formatNumber formats a number according to the the supplied language code ("|lang=")
-- or the default language if not supplied.
-- The number is the first unnamed parameter or "|num="
-------------------------------------------------------------------------------
-- Dependencies: findLang()
-------------------------------------------------------------------------------
p.formatNumber = function(frame)
local lang
local num = tonumber(frame.args[1] or frame.args.num) or 0
lang = findLang(frame.args.lang)
return lang:formatNum( num )
end
-------------------------------------------------------------------------------
-- examine dumps the property (the unnamed parameter or pid)
-- from the item given by the parameter 'qid' (or the other unnamed parameter)
-- or from the item corresponding to the current page if qid is not supplied.
-- e.g. {{#invoke:WikidataIB |examine |pid=P26 |qid=Q42}}
-- or {{#invoke:WikidataIB |examine |P26 |Q42}} or any combination of these
-- or {{#invoke:WikidataIB |examine |P26}} for the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.examine = function( frame )
local args
if frame.args[1] or frame.args.pid or frame.args.qid then
args = frame.args
else
args = frame:getParent().args
end
local par = {}
local pid = (args.pid or ""):upper()
local qid = (args.qid or ""):upper()
par[1] = mw.text.trim( args[1] or "" ):upper()
par[2] = mw.text.trim( args[2] or "" ):upper()
table.sort(par)
if par[2]:sub(1,1) == "P" then par[1], par[2] = par[2], par[1] end
if pid == "" then pid = par[1] end
if qid == "" then qid = par[2] end
local q1 = qid:sub(1,1)
if pid:sub(1,1) ~= "P" then return "No property supplied" end
if q1 ~= "Q" and q1 ~= "M" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return "No item for this page" end
return "<pre>" .. mw.dumpObject( mw.wikibase.getAllStatements( qid, pid ) ) .. "</pre>"
end
-------------------------------------------------------------------------------
-- checkvalue looks for 'val' as a wikibase-item value of a property (the unnamed parameter or pid)
-- from the item given by the parameter 'qid'
-- or from the Wikidata item associated with the current page if qid is not supplied.
-- It only checks ranks that are requested (preferred and normal by default)
-- If property is not supplied, then P31 (instance of) is assumed.
-- It returns val if found or nothing if not found.
-- e.g. {{#invoke:WikidataIB |checkvalue |val=Q5 |pid=P31 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |P31 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |P31}} for the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.checkvalue = function( frame )
local args
if frame.args.val then
args = frame.args
else
args = frame:getParent().args
end
local val = args.val
if not val then return nil end
local pid = mw.text.trim(args.pid or args[1] or "P31"):upper()
local qid = (args.qid or ""):upper()
if pid:sub(1,1) ~= "P" then return nil end
if qid:sub(1,1) ~= "Q" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
local ranks = setRanks(args.rank)
local stats = {}
if ranks.b then
stats = mw.wikibase.getBestStatements(qid, pid)
else
stats = mw.wikibase.getAllStatements( qid, pid )
end
if not stats[1] then return nil end
if stats[1].mainsnak.datatype == "wikibase-item" then
for k, v in pairs( stats ) do
local ms = v.mainsnak
if ranks[v.rank:sub(1,1)] and ms.snaktype == "value" and ms.datavalue.value.id == val then
return val
end
end
end
return nil
end
-------------------------------------------------------------------------------
-- url2 takes a parameter url= that is a proper url and formats it for use in an infobox.
-- If no parameter is supplied, it returns nothing.
-- This is the equivalent of Template:URL
-- but it keeps the "edit at Wikidata" pen icon out of the microformat.
-- Usually it will take its url parameter directly from a Wikidata call:
-- e.g. {{#invoke:WikidataIB |url2 |url={{wdib |P856 |qid=Q23317 |fwd=ALL |osd=no}} }}
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.url2 = function(frame)
local txt = frame.args.url or ""
if txt == "" then return nil end
-- extract any icon
local url, icon = txt:match("(.+) (.+)")
-- make sure there's at least a space at the end
url = (url or txt) .. " "
icon = icon or ""
-- extract any protocol like https://
local prot = url:match("(https*://).+[ \"\']")
-- extract address
local addr = ""
if prot then
addr = url:match("https*://(.+)[ \"\']") or " "
else
prot = "//"
addr = url:match("[^%p%s]+%.(.+)[ \"\']") or " "
end
-- strip trailing / from end of domain-only url and add <wbr/> before . and /
local disp, n = addr:gsub( "^([^/]+)/$", "%1" ):gsub("%/", "<wbr/>/"):gsub("%.", "<wbr/>.")
return '<span class="url">[' .. prot .. addr .. " " .. disp .. "]</span> " .. icon
end
-------------------------------------------------------------------------------
-- getWebsite fetches the Official website (P856) and formats it for use in an infobox.
-- This is similar to Template:Official website but with a url displayed,
-- and it adds the "edit at Wikidata" pen icon beyond the microformat if enabled.
-- A local value will override the Wikidata value. "NONE" returns nothing.
-- e.g. {{#invoke:WikidataIB |getWebsite |qid= |noicon= |lang= |url= }}
-------------------------------------------------------------------------------
-- Dependencies: findLang(); parseParam();
-------------------------------------------------------------------------------
p.getWebsite = function(frame)
local url = frame.args.url or ""
if url:upper() == "NONE" then return nil end
local qid = frame.args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
local urls = {}
local quals = {}
if url == "" then
local prop856 = mw.wikibase.getBestStatements(qid, "P856")
for k, v in pairs(prop856) do
if v.mainsnak.snaktype == "value" then
urls[#urls+1] = v.mainsnak.datavalue.value
if v.qualifiers and v.qualifiers["P1065"] then
-- just take the first archive url (P1065)
local au = v.qualifiers["P1065"][1]
if au.snaktype == "value" then
quals[#urls] = au.datavalue.value
end -- test for archive url having a value
end -- test for qualifers
end -- test for website having a value
end -- loop through website(s)
else
urls[1] = url
end
if #urls == 0 then return nil end
local out = {}
for i, u in ipairs(urls) do
local link = quals[i] or u
local prot, addr = u:match("(http[s]*://)(.+)")
addr = addr or u
local disp, n = addr:gsub("%.", "<wbr/>%.")
out[#out+1] = '<span class="url">[' .. link .. " " .. disp .. "]</span>"
end
local langcode = findLang(frame.args.lang).code
local noicon = parseParam(frame.args.noicon, false)
if url == "" and not noicon then
out[#out] = out[#out] .. createicon(langcode, qid, "P856")
end
local ret = ""
if #out > 1 then
ret = mw.getCurrentFrame():expandTemplate{title = "ubl", args = out}
else
ret = out[1]
end
return ret
end
-------------------------------------------------------------------------------
-- getAllLabels fetches the set of labels and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllLabels = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local labels = mw.wikibase.getEntity(qid).labels
if not labels then return i18n["labels-not-found"] end
local out = {}
for k, v in pairs(labels) do
out[#out+1] = v.value .. " (" .. v.language .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- getAllDescriptions fetches the set of descriptions and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllDescriptions = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local descriptions = mw.wikibase.getEntity(qid).descriptions
if not descriptions then return i18n["descriptions-not-found"] end
local out = {}
for k, v in pairs(descriptions) do
out[#out+1] = v.value .. " (" .. v.language .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- getAllAliases fetches the set of aliases and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllAliases = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local aliases = mw.wikibase.getEntity(qid).aliases
if not aliases then return i18n["aliases-not-found"] end
local out = {}
for k1, v1 in pairs(aliases) do
local lang = v1[1].language
local val = {}
for k1, v2 in ipairs(v1) do
val[#val+1] = v2.value
end
out[#out+1] = table.concat(val, ", ") .. " (" .. lang .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- showNoLinks displays the article titles that should not be linked.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.showNoLinks = function(frame)
local out = {}
for k, v in pairs(donotlink) do
out[#out+1] = k
end
table.sort( out )
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- checkValidity checks whether the first unnamed parameter represents a valid entity-id,
-- that is, something like Q1235 or P123.
-- It returns the strings "true" or "false".
-- Change false to nil to return "true" or "" (easier to test with #if:).
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
function p.checkValidity(frame)
local id = mw.text.trim(frame.args[1] or "")
if mw.wikibase.isValidEntityId(id) then
return true
else
return false
end
end
-------------------------------------------------------------------------------
-- getEntityFromTitle returns the Entity-ID (Q-number) for a given title.
-- Modification of Module:ResolveEntityId
-- The title is the first unnamed parameter.
-- The site parameter determines the site/language for the title. Defaults to current wiki.
-- The showdab parameter determines whether dab pages should return the Q-number or nil. Defaults to true.
-- Returns the Q-number or nil if it does not exist.
-------------------------------------------------------------------------------
-- Dependencies: parseParam
-------------------------------------------------------------------------------
function p.getEntityFromTitle(frame)
local args=frame.args
if not args[1] then args=frame:getParent().args end
if not args[1] then return nil end
local title = mw.text.trim(args[1])
local site = args.site or ""
local showdab = parseParam(args.showdab, true)
local qid = mw.wikibase.getEntityIdForTitle(title, site)
if qid then
local prop31 = mw.wikibase.getBestStatements(qid, "P31")[1]
if not showdab and prop31 and prop31.mainsnak.datavalue.value.id == "Q4167410" then
return nil
else
return qid
end
end
end
-------------------------------------------------------------------------------
-- getDatePrecision returns the number representing the precision of the first best date value
-- for the given property.
-- It takes the qid and property ID
-- The meanings are given at https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times
-- 0 = 1 billion years .. 6 = millennium, 7 = century, 8 = decade, 9 = year, 10 = month, 11 = day
-- Returns 0 (or the second unnamed parameter) if the Wikidata does not exist.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; sourced;
-------------------------------------------------------------------------------
function p.getDatePrecision(frame)
local args=frame.args
if not args[1] then args=frame:getParent().args end
local default = tonumber(args[2] or args.default) or 0
local prop = mw.text.trim(args[1] or "")
if prop == "" then return default end
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return default end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local stat = mw.wikibase.getBestStatements(qid, prop)
for i, v in ipairs(stat) do
local prec = (onlysrc == false or sourced(v))
and v.mainsnak.datavalue
and v.mainsnak.datavalue.value
and v.mainsnak.datavalue.value.precision
if prec then return prec end
end
return default
end
return p
-------------------------------------------------------------------------------
-- List of exported functions
-------------------------------------------------------------------------------
--[[
_getValue
getValue
getPreferredValue
getCoords
getQualifierValue
getSumOfParts
getValueByQual
getValueByLang
getValueByRefSource
getPropertyIDs
getQualifierIDs
getPropOfProp
getAwardCat
getIntersectCat
getGlobe
getCommonsLink
getSiteLink
getLink
getLabel
label
getAT
getDescription
getAliases
pageId
formatDate
location
checkBlacklist
emptyor
labelorid
getLang
getItemLangCode
findLanguage
getQID
followQid
globalSiteID
siteID
projID
formatNumber
examine
checkvalue
url2
getWebsite
getAllLabels
getAllDescriptions
getAllAliases
showNoLinks
checkValidity
getEntityFromTitle
getDatePrecision
--]]
-------------------------------------------------------------------------------
1tf16iuqygh0n4np9zsd8j2smqcumrr
Templat:Maplink
10
323935
2444339
1643981
2022-08-14T11:16:48Z
Fexpr
7716
←Mengganti halaman dengan '<includeonly>{{#invoke:Mapframe|main}}</includeonly><noinclude> {{documentation}} </noinclude>'
wikitext
text/x-wiki
<includeonly>{{#invoke:Mapframe|main}}</includeonly><noinclude>
{{documentation}}
</noinclude>
3p4lr8w2j72xg6rz94bb9jx0ee5zkmg
Modul:Wd
828
325278
2444306
1693208
2022-08-13T13:45:54Z
David Wadie Fisher-Freberg
51
b
Scribunto
text/plain
-- Original module located at [[:en:Module:Wd]] and [[:en:Module:Wd/i18n]].
local p = {}
local arg = ...
local i18n
local function loadI18n(aliasesP, frame)
local title
if frame then
-- current module invoked by page/template, get its title from frame
title = frame:getTitle()
else
-- current module included by other module, get its title from ...
title = arg
end
if not i18n then
i18n = require(title .. "/i18n").init(aliasesP)
end
end
p.claimCommands = {
property = "property",
properties = "properties",
qualifier = "qualifier",
qualifiers = "qualifiers",
reference = "reference",
references = "references"
}
p.generalCommands = {
label = "label",
title = "title",
description = "description",
alias = "alias",
aliases = "aliases",
badge = "badge",
badges = "badges"
}
p.flags = {
linked = "linked",
short = "short",
raw = "raw",
multilanguage = "multilanguage",
unit = "unit",
-------------
preferred = "preferred",
normal = "normal",
deprecated = "deprecated",
best = "best",
future = "future",
current = "current",
former = "former",
edit = "edit",
editAtEnd = "edit@end",
mdy = "mdy",
single = "single",
sourced = "sourced"
}
p.args = {
eid = "eid",
page = "page",
date = "date"
}
local aliasesP = {
coord = "P625",
-----------------------
image = "P18",
author = "P50",
publisher = "P123",
importedFrom = "P143",
statedIn = "P248",
pages = "P304",
language = "P407",
hasPart = "P527",
publicationDate = "P577",
startTime = "P580",
endTime = "P582",
chapter = "P792",
retrieved = "P813",
referenceURL = "P854",
sectionVerseOrParagraph = "P958",
archiveURL = "P1065",
title = "P1476",
formatterURL = "P1630",
quote = "P1683",
shortName = "P1813",
definingFormula = "P2534",
archiveDate = "P2960",
inferredFrom = "P3452",
typeOfReference = "P3865",
column = "P3903"
}
local aliasesQ = {
percentage = "Q11229",
prolepticJulianCalendar = "Q1985786",
citeWeb = "Q5637226",
citeQ = "Q22321052"
}
local parameters = {
property = "%p",
qualifier = "%q",
reference = "%r",
alias = "%a",
badge = "%b",
separator = "%s",
general = "%x"
}
local formats = {
property = "%p[%s][%r]",
qualifier = "%q[%s][%r]",
reference = "%r",
propertyWithQualifier = "%p[ <span style=\"font-size:85\\%\">(%q)</span>][%s][%r]",
alias = "%a[%s]",
badge = "%b[%s]"
}
local hookNames = { -- {level_1, level_2}
[parameters.property] = {"getProperty"},
[parameters.reference] = {"getReferences", "getReference"},
[parameters.qualifier] = {"getAllQualifiers"},
[parameters.qualifier.."\\d"] = {"getQualifiers", "getQualifier"},
[parameters.alias] = {"getAlias"},
[parameters.badge] = {"getBadge"}
}
-- default value objects, should NOT be mutated but instead copied
local defaultSeparators = {
["sep"] = {" "},
["sep%s"] = {","},
["sep%q"] = {"; "},
["sep%q\\d"] = {", "},
["sep%r"] = nil, -- none
["punc"] = nil -- none
}
local rankTable = {
["preferred"] = 1,
["normal"] = 2,
["deprecated"] = 3
}
local Config = {}
-- allows for recursive calls
function Config:new()
local cfg = {}
setmetatable(cfg, self)
self.__index = self
cfg.separators = {
-- single value objects wrapped in arrays so that we can pass by reference
["sep"] = {copyTable(defaultSeparators["sep"])},
["sep%s"] = {copyTable(defaultSeparators["sep%s"])},
["sep%q"] = {copyTable(defaultSeparators["sep%q"])},
["sep%r"] = {copyTable(defaultSeparators["sep%r"])},
["punc"] = {copyTable(defaultSeparators["punc"])}
}
cfg.entity = nil
cfg.entityID = nil
cfg.propertyID = nil
cfg.propertyValue = nil
cfg.qualifierIDs = {}
cfg.qualifierIDsAndValues = {}
cfg.bestRank = true
cfg.ranks = {true, true, false} -- preferred = true, normal = true, deprecated = false
cfg.foundRank = #cfg.ranks
cfg.flagBest = false
cfg.flagRank = false
cfg.periods = {true, true, true} -- future = true, current = true, former = true
cfg.flagPeriod = false
cfg.atDate = {parseDate(os.date('!%Y-%m-%d'))} -- today as {year, month, day}
cfg.mdyDate = false
cfg.singleClaim = false
cfg.sourcedOnly = false
cfg.editable = false
cfg.editAtEnd = false
cfg.inSitelinks = false
cfg.langCode = mw.language.getContentLanguage().code
cfg.langName = mw.language.fetchLanguageName(cfg.langCode, cfg.langCode)
cfg.langObj = mw.language.new(cfg.langCode)
cfg.siteID = mw.wikibase.getGlobalSiteId()
cfg.states = {}
cfg.states.qualifiersCount = 0
cfg.curState = nil
cfg.prefetchedRefs = nil
return cfg
end
local State = {}
function State:new(cfg, type)
local stt = {}
setmetatable(stt, self)
self.__index = self
stt.conf = cfg
stt.type = type
stt.results = {}
stt.parsedFormat = {}
stt.separator = {}
stt.movSeparator = {}
stt.puncMark = {}
stt.linked = false
stt.rawValue = false
stt.shortName = false
stt.anyLanguage = false
stt.unitOnly = false
stt.singleValue = false
return stt
end
local function replaceAlias(id)
if aliasesP[id] then
id = aliasesP[id]
end
return id
end
local function errorText(code, param)
local text = i18n["errors"][code]
if param then text = mw.ustring.gsub(text, "$1", param) end
return text
end
local function throwError(errorMessage, param)
error(errorText(errorMessage, param))
end
local function replaceDecimalMark(num)
return mw.ustring.gsub(num, "[.]", i18n['numeric']['decimal-mark'], 1)
end
local function padZeros(num, numDigits)
local numZeros
local negative = false
if num < 0 then
negative = true
num = num * -1
end
num = tostring(num)
numZeros = numDigits - num:len()
for _ = 1, numZeros do
num = "0"..num
end
if negative then
num = "-"..num
end
return num
end
local function replaceSpecialChar(chr)
if chr == '_' then
-- replace underscores with spaces
return ' '
else
return chr
end
end
local function replaceSpecialChars(str)
local chr
local esc = false
local strOut = ""
for i = 1, #str do
chr = str:sub(i,i)
if not esc then
if chr == '\\' then
esc = true
else
strOut = strOut .. replaceSpecialChar(chr)
end
else
strOut = strOut .. chr
esc = false
end
end
return strOut
end
local function buildWikilink(target, label)
if not label or target == label then
return "[[" .. target .. "]]"
else
return "[[" .. target .. "|" .. label .. "]]"
end
end
-- used to make frame.args mutable, to replace #frame.args (which is always 0)
-- with the actual amount and to simply copy tables
function copyTable(tIn)
if not tIn then
return nil
end
local tOut = {}
for i, v in pairs(tIn) do
tOut[i] = v
end
return tOut
end
-- used to merge output arrays together;
-- note that it currently mutates the first input array
local function mergeArrays(a1, a2)
for i = 1, #a2 do
a1[#a1 + 1] = a2[i]
end
return a1
end
local function split(str, del)
local out = {}
local i, j = str:find(del)
if i and j then
out[1] = str:sub(1, i - 1)
out[2] = str:sub(j + 1)
else
out[1] = str
end
return out
end
local function parseWikidataURL(url)
local id
if url:match('^http[s]?://') then
id = split(url, "Q")
if id[2] then
return "Q" .. id[2]
end
end
return nil
end
function parseDate(dateStr, precision)
precision = precision or "d"
local i, j, index, ptr
local parts = {nil, nil, nil}
if dateStr == nil then
return parts[1], parts[2], parts[3] -- year, month, day
end
-- 'T' for snak values, '/' for outputs with '/Julian' attached
i, j = dateStr:find("[T/]")
if i then
dateStr = dateStr:sub(1, i-1)
end
local from = 1
if dateStr:sub(1,1) == "-" then
-- this is a negative number, look further ahead
from = 2
end
index = 1
ptr = 1
i, j = dateStr:find("-", from)
if i then
-- year
parts[index] = tonumber(mw.ustring.gsub(dateStr:sub(ptr, i-1), "^\+(.+)$", "%1"), 10) -- remove '+' sign (explicitly give base 10 to prevent error)
if parts[index] == -0 then
parts[index] = tonumber("0") -- for some reason, 'parts[index] = 0' may actually store '-0', so parse from string instead
end
if precision == "y" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
i, j = dateStr:find("-", ptr)
if i then
-- month
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10)
if precision == "m" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
end
end
if dateStr:sub(ptr) ~= "" then
-- day if we have month, month if we have year, or year
parts[index] = tonumber(dateStr:sub(ptr), 10)
end
return parts[1], parts[2], parts[3] -- year, month, day
end
local function datePrecedesDate(aY, aM, aD, bY, bM, bD)
if aY == nil or bY == nil then
return nil
end
aM = aM or 1
aD = aD or 1
bM = bM or 1
bD = bD or 1
if aY < bY then
return true
end
if aY > bY then
return false
end
if aM < bM then
return true
end
if aM > bM then
return false
end
if aD < bD then
return true
end
return false
end
local function getHookName(param, index)
if hookNames[param] then
return hookNames[param][index]
elseif param:len() > 2 then
return hookNames[param:sub(1, 2).."\\d"][index]
else
return nil
end
end
local function alwaysTrue()
return true
end
-- The following function parses a format string.
--
-- The example below shows how a parsed string is structured in memory.
-- Variables other than 'str' and 'child' are left out for clarity's sake.
--
-- Example:
-- "A %p B [%s[%q1]] C [%r] D"
--
-- Structure:
-- [
-- {
-- str = "A "
-- },
-- {
-- str = "%p"
-- },
-- {
-- str = " B ",
-- child =
-- [
-- {
-- str = "%s",
-- child =
-- [
-- {
-- str = "%q1"
-- }
-- ]
-- }
-- ]
-- },
-- {
-- str = " C ",
-- child =
-- [
-- {
-- str = "%r"
-- }
-- ]
-- },
-- {
-- str = " D"
-- }
-- ]
--
local function parseFormat(str)
local chr, esc, param, root, cur, prev, new
local params = {}
local function newObject(array)
local obj = {} -- new object
obj.str = ""
array[#array + 1] = obj -- array{object}
obj.parent = array
return obj
end
local function endParam()
if param > 0 then
if cur.str ~= "" then
cur.str = "%"..cur.str
cur.param = true
params[cur.str] = true
cur.parent.req[cur.str] = true
prev = cur
cur = newObject(cur.parent)
end
param = 0
end
end
root = {} -- array
root.req = {}
cur = newObject(root)
prev = nil
esc = false
param = 0
for i = 1, #str do
chr = str:sub(i,i)
if not esc then
if chr == '\\' then
endParam()
esc = true
elseif chr == '%' then
endParam()
if cur.str ~= "" then
cur = newObject(cur.parent)
end
param = 2
elseif chr == '[' then
endParam()
if prev and cur.str == "" then
table.remove(cur.parent)
cur = prev
end
cur.child = {} -- new array
cur.child.req = {}
cur.child.parent = cur
cur = newObject(cur.child)
elseif chr == ']' then
endParam()
if cur.parent.parent then
new = newObject(cur.parent.parent.parent)
if cur.str == "" then
table.remove(cur.parent)
end
cur = new
end
else
if param > 1 then
param = param - 1
elseif param == 1 then
if not chr:match('%d') then
endParam()
end
end
cur.str = cur.str .. replaceSpecialChar(chr)
end
else
cur.str = cur.str .. chr
esc = false
end
prev = nil
end
endParam()
-- make sure that at least one required parameter has been defined
if not next(root.req) then
throwError("missing-required-parameter")
end
-- make sure that the separator parameter "%s" is not amongst the required parameters
if root.req[parameters.separator] then
throwError("extra-required-parameter", parameters.separator)
end
return root, params
end
local function sortOnRank(claims)
local rankPos
local ranks = {{}, {}, {}, {}} -- preferred, normal, deprecated, (default)
local sorted = {}
for _, v in ipairs(claims) do
rankPos = rankTable[v.rank] or 4
ranks[rankPos][#ranks[rankPos] + 1] = v
end
sorted = ranks[1]
sorted = mergeArrays(sorted, ranks[2])
sorted = mergeArrays(sorted, ranks[3])
return sorted
end
-- if id == nil then item connected to current page is used
function Config:getLabel(id, raw, link, short)
local label = nil
local prefix, title= "", nil
if not id then
id = mw.wikibase.getEntityIdForCurrentPage()
if not id then
return ""
end
end
id = id:upper() -- just to be sure
if raw then
-- check if given id actually exists
if mw.wikibase.isValidEntityId(id) and mw.wikibase.entityExists(id) then
label = id
end
prefix, title = "d:Special:EntityPage/", label -- may be nil
else
-- try short name first if requested
if short then
label = p._property{aliasesP.shortName, [p.args.eid] = id} -- get short name
if label == "" then
label = nil
end
end
-- get label
if not label then
label = mw.wikibase.getLabelByLang(id, self.langCode) -- XXX: should use fallback labels?
end
end
if not label then
label = ""
elseif link then
-- build a link if requested
if not title then
if id:sub(1,1) == "Q" then
title = mw.wikibase.getSitelink(id)
elseif id:sub(1,1) == "P" then
-- properties have no sitelink, link to Wikidata instead
prefix, title = "d:Special:EntityPage/", id
end
end
label = mw.text.nowiki(label) -- escape raw label text so it cannot be wikitext markup
if title then
label = buildWikilink(prefix .. title, label)
end
end
return label
end
function Config:getEditIcon()
local value = ""
local prefix = ""
local front = " "
local back = ""
if self.entityID:sub(1,1) == "P" then
prefix = "Property:"
end
if self.editAtEnd then
front = '<span style="float:'
if self.langObj:isRTL() then
front = front .. 'left'
else
front = front .. 'right'
end
front = front .. '">'
back = '</span>'
end
value = "[[File:OOjs UI icon edit-ltr-progressive.svg|frameless|text-top|10px|alt=" .. i18n['info']['edit-on-wikidata'] .. "|link=https://www.wikidata.org/wiki/" .. prefix .. self.entityID .. "?uselang=" .. self.langCode
if self.propertyID then
value = value .. "#" .. self.propertyID
elseif self.inSitelinks then
value = value .. "#sitelinks-wikipedia"
end
value = value .. "|" .. i18n['info']['edit-on-wikidata'] .. "]]"
return front .. value .. back
end
-- used to create the final output string when it's all done, so that for references the
-- function extensionTag("ref", ...) is only called when they really ended up in the final output
function Config:concatValues(valuesArray)
local outString = ""
local j, skip
for i = 1, #valuesArray do
-- check if this is a reference
if valuesArray[i].refHash then
j = i - 1
skip = false
-- skip this reference if it is part of a continuous row of references that already contains the exact same reference
while valuesArray[j] and valuesArray[j].refHash do
if valuesArray[i].refHash == valuesArray[j].refHash then
skip = true
break
end
j = j - 1
end
if not skip then
-- add <ref> tag with the reference's hash as its name (to deduplicate references)
outString = outString .. mw.getCurrentFrame():extensionTag("ref", valuesArray[i][1], {name = valuesArray[i].refHash})
end
else
outString = outString .. valuesArray[i][1]
end
end
return outString
end
function Config:convertUnit(unit, raw, link, short, unitOnly)
local space = " "
local label = ""
local itemID
if unit == "" or unit == "1" then
return nil
end
if unitOnly then
space = ""
end
itemID = parseWikidataURL(unit)
if itemID then
if itemID == aliasesQ.percentage then
return "%"
else
label = self:getLabel(itemID, raw, link, short)
if label ~= "" then
return space .. label
end
end
end
return ""
end
function State:getValue(snak)
return self.conf:getValue(snak, self.rawValue, self.linked, self.shortName, self.anyLanguage, self.unitOnly, false, self.type:sub(1,2))
end
function Config:getValue(snak, raw, link, short, anyLang, unitOnly, noSpecial, type)
if snak.snaktype == 'value' then
local datatype = snak.datavalue.type
local subtype = snak.datatype
local datavalue = snak.datavalue.value
if datatype == 'string' then
if subtype == 'url' and link then
-- create link explicitly
if raw then
-- will render as a linked number like [1]
return "[" .. datavalue .. "]"
else
return "[" .. datavalue .. " " .. datavalue .. "]"
end
elseif subtype == 'commonsMedia' then
if link then
return buildWikilink("c:File:" .. datavalue, datavalue)
elseif not raw then
return "[[File:" .. datavalue .. "]]"
else
return datavalue
end
elseif subtype == 'geo-shape' and link then
return buildWikilink("c:" .. datavalue, datavalue)
elseif subtype == 'math' and not raw then
local attribute = nil
if (type == parameters.property or (type == parameters.qualifier and self.propertyID == aliasesP.hasPart)) and snak.property == aliasesP.definingFormula then
attribute = {qid = self.entityID}
end
return mw.getCurrentFrame():extensionTag("math", datavalue, attribute)
elseif subtype == 'external-id' and link then
local url = p._property{aliasesP.formatterURL, [p.args.eid] = snak.property} -- get formatter URL
if url ~= "" then
url = mw.ustring.gsub(url, "$1", datavalue)
return "[" .. url .. " " .. datavalue .. "]"
else
return datavalue
end
else
return datavalue
end
elseif datatype == 'monolingualtext' then
if anyLang or datavalue['language'] == self.langCode then
return datavalue['text']
else
return nil
end
elseif datatype == 'quantity' then
local value = ""
local unit
if not unitOnly then
-- get value and strip + signs from front
value = mw.ustring.gsub(datavalue['amount'], "^\+(.+)$", "%1")
if raw then
return value
end
-- replace decimal mark based on locale
value = replaceDecimalMark(value)
-- add delimiters for readability
value = i18n.addDelimiters(value)
end
unit = self:convertUnit(datavalue['unit'], raw, link, short, unitOnly)
if unit then
value = value .. unit
end
return value
elseif datatype == 'time' then
local y, m, d, p, yDiv, yRound, yFull, value, calendarID, dateStr
local yFactor = 1
local sign = 1
local prefix = ""
local suffix = ""
local mayAddCalendar = false
local calendar = ""
local precision = datavalue['precision']
if precision == 11 then
p = "d"
elseif precision == 10 then
p = "m"
else
p = "y"
yFactor = 10^(9-precision)
end
y, m, d = parseDate(datavalue['time'], p)
if y < 0 then
sign = -1
y = y * sign
end
-- if precision is tens/hundreds/thousands/millions/billions of years
if precision <= 8 then
yDiv = y / yFactor
-- if precision is tens/hundreds/thousands of years
if precision >= 6 then
mayAddCalendar = true
if precision <= 7 then
-- round centuries/millenniums up (e.g. 20th century or 3rd millennium)
yRound = math.ceil(yDiv)
if not raw then
if precision == 6 then
suffix = i18n['datetime']['suffixes']['millennium']
else
suffix = i18n['datetime']['suffixes']['century']
end
suffix = i18n.getOrdinalSuffix(yRound) .. suffix
else
-- if not verbose, take the first year of the century/millennium
-- (e.g. 1901 for 20th century or 2001 for 3rd millennium)
yRound = (yRound - 1) * yFactor + 1
end
else
-- precision == 8
-- round decades down (e.g. 2010s)
yRound = math.floor(yDiv) * yFactor
if not raw then
prefix = i18n['datetime']['prefixes']['decade-period']
suffix = i18n['datetime']['suffixes']['decade-period']
end
end
if raw and sign < 0 then
-- if BCE then compensate for "counting backwards"
-- (e.g. -2019 for 2010s BCE, -2000 for 20th century BCE or -3000 for 3rd millennium BCE)
yRound = yRound + yFactor - 1
end
else
local yReFactor, yReDiv, yReRound
-- round to nearest for tens of thousands of years or more
yRound = math.floor(yDiv + 0.5)
if yRound == 0 then
if precision <= 2 and y ~= 0 then
yReFactor = 1e6
yReDiv = y / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to millions of years only if we have a whole number of them
precision = 3
yFactor = yReFactor
yRound = yReRound
end
end
if yRound == 0 then
-- otherwise, take the unrounded (original) number of years
precision = 5
yFactor = 1
yRound = y
mayAddCalendar = true
end
end
if precision >= 1 and y ~= 0 then
yFull = yRound * yFactor
yReFactor = 1e9
yReDiv = yFull / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to billions of years if we're in that range
precision = 0
yFactor = yReFactor
yRound = yReRound
else
yReFactor = 1e6
yReDiv = yFull / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to millions of years if we're in that range
precision = 3
yFactor = yReFactor
yRound = yReRound
end
end
end
if not raw then
if precision == 3 then
suffix = i18n['datetime']['suffixes']['million-years']
elseif precision == 0 then
suffix = i18n['datetime']['suffixes']['billion-years']
else
yRound = yRound * yFactor
if yRound == 1 then
suffix = i18n['datetime']['suffixes']['year']
else
suffix = i18n['datetime']['suffixes']['years']
end
end
else
yRound = yRound * yFactor
end
end
else
yRound = y
mayAddCalendar = true
end
if mayAddCalendar then
calendarID = parseWikidataURL(datavalue['calendarmodel'])
if calendarID and calendarID == aliasesQ.prolepticJulianCalendar then
if not raw then
if link then
calendar = " ("..buildWikilink(i18n['datetime']['julian-calendar'], i18n['datetime']['julian'])..")"
else
calendar = " ("..i18n['datetime']['julian']..")"
end
else
calendar = "/"..i18n['datetime']['julian']
end
end
end
if not raw then
local ce = nil
if sign < 0 then
ce = i18n['datetime']['BCE']
elseif precision <= 5 then
ce = i18n['datetime']['CE']
end
if ce then
if link then
ce = buildWikilink(i18n['datetime']['common-era'], ce)
end
suffix = suffix .. " " .. ce
end
value = tostring(yRound)
if m then
dateStr = self.langObj:formatDate("F", "1-"..m.."-1")
if d then
if self.mdyDate then
dateStr = dateStr .. " " .. d .. ","
else
dateStr = d .. " " .. dateStr
end
end
value = dateStr .. " " .. value
end
value = prefix .. value .. suffix .. calendar
else
value = padZeros(yRound * sign, 4)
if m then
value = value .. "-" .. padZeros(m, 2)
if d then
value = value .. "-" .. padZeros(d, 2)
end
end
value = value .. calendar
end
return value
elseif datatype == 'globecoordinate' then
-- logic from https://github.com/DataValues/Geo (v4.0.1)
local precision, unitsPerDegree, numDigits, strFormat, value, globe
local latitude, latConv, latValue, latLink
local longitude, lonConv, lonValue, lonLink
local latDirection, latDirectionN, latDirectionS, latDirectionEN
local lonDirection, lonDirectionE, lonDirectionW, lonDirectionEN
local degSymbol, minSymbol, secSymbol, separator
local latDegrees = nil
local latMinutes = nil
local latSeconds = nil
local lonDegrees = nil
local lonMinutes = nil
local lonSeconds = nil
local latDegSym = ""
local latMinSym = ""
local latSecSym = ""
local lonDegSym = ""
local lonMinSym = ""
local lonSecSym = ""
local latDirectionEN_N = "N"
local latDirectionEN_S = "S"
local lonDirectionEN_E = "E"
local lonDirectionEN_W = "W"
if not raw then
latDirectionN = i18n['coord']['latitude-north']
latDirectionS = i18n['coord']['latitude-south']
lonDirectionE = i18n['coord']['longitude-east']
lonDirectionW = i18n['coord']['longitude-west']
degSymbol = i18n['coord']['degrees']
minSymbol = i18n['coord']['minutes']
secSymbol = i18n['coord']['seconds']
separator = i18n['coord']['separator']
else
latDirectionN = latDirectionEN_N
latDirectionS = latDirectionEN_S
lonDirectionE = lonDirectionEN_E
lonDirectionW = lonDirectionEN_W
degSymbol = "/"
minSymbol = "/"
secSymbol = "/"
separator = "/"
end
latitude = datavalue['latitude']
longitude = datavalue['longitude']
if latitude < 0 then
latDirection = latDirectionS
latDirectionEN = latDirectionEN_S
latitude = math.abs(latitude)
else
latDirection = latDirectionN
latDirectionEN = latDirectionEN_N
end
if longitude < 0 then
lonDirection = lonDirectionW
lonDirectionEN = lonDirectionEN_W
longitude = math.abs(longitude)
else
lonDirection = lonDirectionE
lonDirectionEN = lonDirectionEN_E
end
precision = datavalue['precision']
if not precision or precision <= 0 then
precision = 1 / 3600 -- precision not set (correctly), set to arcsecond
end
-- remove insignificant detail
latitude = math.floor(latitude / precision + 0.5) * precision
longitude = math.floor(longitude / precision + 0.5) * precision
if precision >= 1 - (1 / 60) and precision < 1 then
precision = 1
elseif precision >= (1 / 60) - (1 / 3600) and precision < (1 / 60) then
precision = 1 / 60
end
if precision >= 1 then
unitsPerDegree = 1
elseif precision >= (1 / 60) then
unitsPerDegree = 60
else
unitsPerDegree = 3600
end
numDigits = math.ceil(-math.log10(unitsPerDegree * precision))
if numDigits <= 0 then
numDigits = tonumber("0") -- for some reason, 'numDigits = 0' may actually store '-0', so parse from string instead
end
strFormat = "%." .. numDigits .. "f"
if precision >= 1 then
latDegrees = strFormat:format(latitude)
lonDegrees = strFormat:format(longitude)
if not raw then
latDegSym = replaceDecimalMark(latDegrees) .. degSymbol
lonDegSym = replaceDecimalMark(lonDegrees) .. degSymbol
else
latDegSym = latDegrees .. degSymbol
lonDegSym = lonDegrees .. degSymbol
end
else
latConv = math.floor(latitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits
lonConv = math.floor(longitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits
if precision >= (1 / 60) then
latMinutes = latConv
lonMinutes = lonConv
else
latSeconds = latConv
lonSeconds = lonConv
latMinutes = math.floor(latSeconds / 60)
lonMinutes = math.floor(lonSeconds / 60)
latSeconds = strFormat:format(latSeconds - (latMinutes * 60))
lonSeconds = strFormat:format(lonSeconds - (lonMinutes * 60))
if not raw then
latSecSym = replaceDecimalMark(latSeconds) .. secSymbol
lonSecSym = replaceDecimalMark(lonSeconds) .. secSymbol
else
latSecSym = latSeconds .. secSymbol
lonSecSym = lonSeconds .. secSymbol
end
end
latDegrees = math.floor(latMinutes / 60)
lonDegrees = math.floor(lonMinutes / 60)
latDegSym = latDegrees .. degSymbol
lonDegSym = lonDegrees .. degSymbol
latMinutes = latMinutes - (latDegrees * 60)
lonMinutes = lonMinutes - (lonDegrees * 60)
if precision >= (1 / 60) then
latMinutes = strFormat:format(latMinutes)
lonMinutes = strFormat:format(lonMinutes)
if not raw then
latMinSym = replaceDecimalMark(latMinutes) .. minSymbol
lonMinSym = replaceDecimalMark(lonMinutes) .. minSymbol
else
latMinSym = latMinutes .. minSymbol
lonMinSym = lonMinutes .. minSymbol
end
else
latMinSym = latMinutes .. minSymbol
lonMinSym = lonMinutes .. minSymbol
end
end
latValue = latDegSym .. latMinSym .. latSecSym .. latDirection
lonValue = lonDegSym .. lonMinSym .. lonSecSym .. lonDirection
value = latValue .. separator .. lonValue
if link then
globe = parseWikidataURL(datavalue['globe'])
if globe then
globe = mw.wikibase.getLabelByLang(globe, "en"):lower()
else
globe = "earth"
end
latLink = table.concat({latDegrees, latMinutes, latSeconds}, "_")
lonLink = table.concat({lonDegrees, lonMinutes, lonSeconds}, "_")
value = "[https://tools.wmflabs.org/geohack/geohack.php?language="..self.langCode.."¶ms="..latLink.."_"..latDirectionEN.."_"..lonLink.."_"..lonDirectionEN.."_globe:"..globe.." "..value.."]"
end
return value
elseif datatype == 'wikibase-entityid' then
local label
local itemID = datavalue['numeric-id']
if subtype == 'wikibase-item' then
itemID = "Q" .. itemID
elseif subtype == 'wikibase-property' then
itemID = "P" .. itemID
else
return '<strong class="error">' .. errorText('unknown-data-type', subtype) .. '</strong>'
end
label = self:getLabel(itemID, raw, link, short)
if label == "" then
label = nil
end
return label
else
return '<strong class="error">' .. errorText('unknown-data-type', datatype) .. '</strong>'
end
elseif snak.snaktype == 'somevalue' and not noSpecial then
if raw then
return " " -- single space represents 'somevalue'
else
return i18n['values']['unknown']
end
elseif snak.snaktype == 'novalue' and not noSpecial then
if raw then
return "" -- empty string represents 'novalue'
else
return i18n['values']['none']
end
else
return nil
end
end
function Config:getSingleRawQualifier(claim, qualifierID)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[qualifierID] end
if qualifiers and qualifiers[1] then
return self:getValue(qualifiers[1], true) -- raw = true
else
return nil
end
end
function Config:snakEqualsValue(snak, value)
local snakValue = self:getValue(snak, true) -- raw = true
if snakValue and snak.snaktype == 'value' and snak.datavalue.type == 'wikibase-entityid' then value = value:upper() end
return snakValue == value
end
function Config:setRank(rank)
local rankPos
if rank == p.flags.best then
self.bestRank = true
self.flagBest = true -- mark that 'best' flag was given
return
end
if rank:sub(1,9) == p.flags.preferred then
rankPos = 1
elseif rank:sub(1,6) == p.flags.normal then
rankPos = 2
elseif rank:sub(1,10) == p.flags.deprecated then
rankPos = 3
else
return
end
-- one of the rank flags was given, check if another one was given before
if not self.flagRank then
self.ranks = {false, false, false} -- no other rank flag given before, so unset ranks
self.bestRank = self.flagBest -- unsets bestRank only if 'best' flag was not given before
self.flagRank = true -- mark that a rank flag was given
end
if rank:sub(-1) == "+" then
for i = rankPos, 1, -1 do
self.ranks[i] = true
end
elseif rank:sub(-1) == "-" then
for i = rankPos, #self.ranks do
self.ranks[i] = true
end
else
self.ranks[rankPos] = true
end
end
function Config:setPeriod(period)
local periodPos
if period == p.flags.future then
periodPos = 1
elseif period == p.flags.current then
periodPos = 2
elseif period == p.flags.former then
periodPos = 3
else
return
end
-- one of the period flags was given, check if another one was given before
if not self.flagPeriod then
self.periods = {false, false, false} -- no other period flag given before, so unset periods
self.flagPeriod = true -- mark that a period flag was given
end
self.periods[periodPos] = true
end
function Config:qualifierMatches(claim, id, value)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[id] end
if qualifiers then
for _, v in pairs(qualifiers) do
if self:snakEqualsValue(v, value) then
return true
end
end
elseif value == "" then
-- if the qualifier is not present then treat it the same as the special value 'novalue'
return true
end
return false
end
function Config:rankMatches(rankPos)
if self.bestRank then
return (self.ranks[rankPos] and self.foundRank >= rankPos)
else
return self.ranks[rankPos]
end
end
function Config:timeMatches(claim)
local startTime = nil
local startTimeY = nil
local startTimeM = nil
local startTimeD = nil
local endTime = nil
local endTimeY = nil
local endTimeM = nil
local endTimeD = nil
if self.periods[1] and self.periods[2] and self.periods[3] then
-- any time
return true
end
startTime = self:getSingleRawQualifier(claim, aliasesP.startTime)
if startTime and startTime ~= "" and startTime ~= " " then
startTimeY, startTimeM, startTimeD = parseDate(startTime)
end
endTime = self:getSingleRawQualifier(claim, aliasesP.endTime)
if endTime and endTime ~= "" and endTime ~= " " then
endTimeY, endTimeM, endTimeD = parseDate(endTime)
end
if startTimeY ~= nil and endTimeY ~= nil and datePrecedesDate(endTimeY, endTimeM, endTimeD, startTimeY, startTimeM, startTimeD) then
-- invalidate end time if it precedes start time
endTimeY = nil
endTimeM = nil
endTimeD = nil
end
if self.periods[1] then
-- future
if startTimeY and datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD) then
return true
end
end
if self.periods[2] then
-- current
if (startTimeY == nil or not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD)) and
(endTimeY == nil or datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD)) then
return true
end
end
if self.periods[3] then
-- former
if endTimeY and not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD) then
return true
end
end
return false
end
function Config:processFlag(flag)
if not flag then
return false
end
if flag == p.flags.linked then
self.curState.linked = true
return true
elseif flag == p.flags.raw then
self.curState.rawValue = true
if self.curState == self.states[parameters.reference] then
-- raw reference values end with periods and require a separator (other than none)
self.separators["sep%r"][1] = {" "}
end
return true
elseif flag == p.flags.short then
self.curState.shortName = true
return true
elseif flag == p.flags.multilanguage then
self.curState.anyLanguage = true
return true
elseif flag == p.flags.unit then
self.curState.unitOnly = true
return true
elseif flag == p.flags.mdy then
self.mdyDate = true
return true
elseif flag == p.flags.single then
self.singleClaim = true
return true
elseif flag == p.flags.sourced then
self.sourcedOnly = true
return true
elseif flag == p.flags.edit then
self.editable = true
return true
elseif flag == p.flags.editAtEnd then
self.editable = true
self.editAtEnd = true
return true
elseif flag == p.flags.best or flag:match('^'..p.flags.preferred..'[+-]?$') or flag:match('^'..p.flags.normal..'[+-]?$') or flag:match('^'..p.flags.deprecated..'[+-]?$') then
self:setRank(flag)
return true
elseif flag == p.flags.future or flag == p.flags.current or flag == p.flags.former then
self:setPeriod(flag)
return true
elseif flag == "" then
-- ignore empty flags and carry on
return true
else
return false
end
end
function Config:processFlagOrCommand(flag)
local param = ""
if not flag then
return false
end
if flag == p.claimCommands.property or flag == p.claimCommands.properties then
param = parameters.property
elseif flag == p.claimCommands.qualifier or flag == p.claimCommands.qualifiers then
self.states.qualifiersCount = self.states.qualifiersCount + 1
param = parameters.qualifier .. self.states.qualifiersCount
self.separators["sep"..param] = {copyTable(defaultSeparators["sep%q\\d"])}
elseif flag == p.claimCommands.reference or flag == p.claimCommands.references then
param = parameters.reference
else
return self:processFlag(flag)
end
if self.states[param] then
return false
end
-- create a new state for each command
self.states[param] = State:new(self, param)
-- use "%x" as the general parameter name
self.states[param].parsedFormat = parseFormat(parameters.general) -- will be overwritten for param=="%p"
-- set the separator
self.states[param].separator = self.separators["sep"..param] -- will be nil for param=="%p", which will be set separately
if flag == p.claimCommands.property or flag == p.claimCommands.qualifier or flag == p.claimCommands.reference then
self.states[param].singleValue = true
end
self.curState = self.states[param]
return true
end
function Config:processSeparators(args)
local sep
for i, v in pairs(self.separators) do
if args[i] then
sep = replaceSpecialChars(args[i])
if sep ~= "" then
self.separators[i][1] = {sep}
else
self.separators[i][1] = nil
end
end
end
end
function Config:setFormatAndSeparators(state, parsedFormat)
state.parsedFormat = parsedFormat
state.separator = self.separators["sep"]
state.movSeparator = self.separators["sep"..parameters.separator]
state.puncMark = self.separators["punc"]
end
-- determines if a claim has references by prefetching them from the claim using getReferences,
-- which applies some filtering that determines if a reference is actually returned,
-- and caches the references for later use
function State:isSourced(claim)
self.conf.prefetchedRefs = self:getReferences(claim)
return (#self.conf.prefetchedRefs > 0)
end
function State:resetCaches()
-- any prefetched references of the previous claim must not be used
self.conf.prefetchedRefs = nil
end
function State:claimMatches(claim)
local matches, rankPos
-- first of all, reset any cached values used for the previous claim
self:resetCaches()
-- if a property value was given, check if it matches the claim's property value
if self.conf.propertyValue then
matches = self.conf:snakEqualsValue(claim.mainsnak, self.conf.propertyValue)
else
matches = true
end
-- if any qualifier values were given, check if each matches one of the claim's qualifier values
for i, v in pairs(self.conf.qualifierIDsAndValues) do
matches = (matches and self.conf:qualifierMatches(claim, i, v))
end
-- check if the claim's rank and time period match
rankPos = rankTable[claim.rank] or 4
matches = (matches and self.conf:rankMatches(rankPos) and self.conf:timeMatches(claim))
-- if only claims with references must be returned, check if this one has any
if self.conf.sourcedOnly then
matches = (matches and self:isSourced(claim)) -- prefetches and caches references
end
return matches, rankPos
end
function State:out()
local result -- collection of arrays with value objects
local valuesArray -- array with value objects
local sep = nil -- value object
local out = {} -- array with value objects
local function walk(formatTable, result)
local valuesArray = {} -- array with value objects
for i, v in pairs(formatTable.req) do
if not result[i] or not result[i][1] then
-- we've got no result for a parameter that is required on this level,
-- so skip this level (and its children) by returning an empty result
return {}
end
end
for _, v in ipairs(formatTable) do
if v.param then
valuesArray = mergeArrays(valuesArray, result[v.str])
elseif v.str ~= "" then
valuesArray[#valuesArray + 1] = {v.str}
end
if v.child then
valuesArray = mergeArrays(valuesArray, walk(v.child, result))
end
end
return valuesArray
end
-- iterate through the results from back to front, so that we know when to add separators
for i = #self.results, 1, -1 do
result = self.results[i]
-- if there is already some output, then add the separators
if #out > 0 then
sep = self.separator[1] -- fixed separator
result[parameters.separator] = {self.movSeparator[1]} -- movable separator
else
sep = nil
result[parameters.separator] = {self.puncMark[1]} -- optional punctuation mark
end
valuesArray = walk(self.parsedFormat, result)
if #valuesArray > 0 then
if sep then
valuesArray[#valuesArray + 1] = sep
end
out = mergeArrays(valuesArray, out)
end
end
-- reset state before next iteration
self.results = {}
return out
end
-- level 1 hook
function State:getProperty(claim)
local value = {self:getValue(claim.mainsnak)} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getQualifiers(claim, param)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[self.conf.qualifierIDs[param]] end
if qualifiers then
-- iterate through claim's qualifier statements to collect their values;
-- return array with multiple value objects
return self.conf.states[param]:iterate(qualifiers, {[parameters.general] = hookNames[parameters.qualifier.."\\d"][2], count = 1}) -- pass qualifier state with level 2 hook
else
return {} -- return empty array
end
end
-- level 2 hook
function State:getQualifier(snak)
local value = {self:getValue(snak)} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getAllQualifiers(claim, param, result, hooks)
local out = {} -- array with value objects
local sep = self.conf.separators["sep"..parameters.qualifier][1] -- value object
-- iterate through the output of the separate "qualifier(s)" commands
for i = 1, self.conf.states.qualifiersCount do
-- if a hook has not been called yet, call it now
if not result[parameters.qualifier..i] then
self:callHook(parameters.qualifier..i, hooks, claim, result)
end
-- if there is output for this particular "qualifier(s)" command, then add it
if result[parameters.qualifier..i] and result[parameters.qualifier..i][1] then
-- if there is already some output, then add the separator
if #out > 0 and sep then
out[#out + 1] = sep
end
out = mergeArrays(out, result[parameters.qualifier..i])
end
end
return out
end
-- level 1 hook
function State:getReferences(claim)
if self.conf.prefetchedRefs then
-- return references that have been prefetched by isSourced
return self.conf.prefetchedRefs
end
if claim.references then
-- iterate through claim's reference statements to collect their values;
-- return array with multiple value objects
return self.conf.states[parameters.reference]:iterate(claim.references, {[parameters.general] = hookNames[parameters.reference][2], count = 1}) -- pass reference state with level 2 hook
else
return {} -- return empty array
end
end
-- level 2 hook
function State:getReference(statement)
local key, citeWeb, citeQ, label
local params = {}
local citeParams = {['web'] = {}, ['q'] = {}}
local citeMismatch = {}
local useCite = nil
local useParams = nil
local value = ""
local ref = {}
local version = 1 -- increment this each time the below logic is changed to avoid conflict errors
if statement.snaks then
-- don't include "imported from", which is added by a bot
if statement.snaks[aliasesP.importedFrom] then
statement.snaks[aliasesP.importedFrom] = nil
end
-- don't include "inferred from", which is added by a bot
if statement.snaks[aliasesP.inferredFrom] then
statement.snaks[aliasesP.inferredFrom] = nil
end
-- don't include "type of reference"
if statement.snaks[aliasesP.typeOfReference] then
statement.snaks[aliasesP.typeOfReference] = nil
end
-- don't include "image" to prevent littering
if statement.snaks[aliasesP.image] then
statement.snaks[aliasesP.image] = nil
end
-- don't include "language" if it is equal to the local one
if self:getReferenceDetail(statement.snaks, aliasesP.language) == self.conf.langName then
statement.snaks[aliasesP.language] = nil
end
-- retrieve all the parameters
for i in pairs(statement.snaks) do
label = ""
-- multiple authors may be given
if i == aliasesP.author then
params[i] = self:getReferenceDetails(statement.snaks, i, false, self.linked, true) -- link = true/false, anyLang = true
else
params[i] = {self:getReferenceDetail(statement.snaks, i, false, (self.linked or (i == aliasesP.statedIn)) and (statement.snaks[i][1].datatype ~= 'url'), true)} -- link = true/false, anyLang = true
end
if #params[i] == 0 then
params[i] = nil
else
if statement.snaks[i][1].datatype == 'external-id' then
key = "external-id"
label = self.conf:getLabel(i)
if label ~= "" then
label = label .. " "
end
else
key = i
end
-- add the parameter to each matching type of citation
for j in pairs(citeParams) do
-- do so if there was no mismatch with a previous parameter
if not citeMismatch[j] then
-- check if this parameter is not mismatching itself
if i18n['cite'][j][key] then
-- continue if an option is available in the corresponding cite template
if i18n['cite'][j][key] ~= "" then
citeParams[j][i18n['cite'][j][key]] = label .. params[i][1]
-- if there are multiple parameter values (authors), add those too
for k=2, #params[i] do
citeParams[j][i18n['cite'][j][key]..k] = label .. params[i][k]
end
end
else
citeMismatch[j] = true
end
end
end
end
end
-- get title of general template for citing web references
citeWeb = split(mw.wikibase.getSitelink(aliasesQ.citeWeb) or "", ":")[2] -- split off namespace from front
-- get title of template that expands stated-in references into citations
citeQ = split(mw.wikibase.getSitelink(aliasesQ.citeQ) or "", ":")[2] -- split off namespace from front
-- (1) use the general template for citing web references if there is a match and if at least both "reference URL" and "title" are present
if citeWeb and not citeMismatch['web'] and citeParams['web'][i18n['cite']['web'][aliasesP.referenceURL]] and citeParams['web'][i18n['cite']['web'][aliasesP.title]] then
useCite = citeWeb
useParams = citeParams['web']
-- (2) use the template that expands stated-in references into citations if there is a match and if at least "stated in" is present
elseif citeQ and not citeMismatch['q'] and citeParams['q'][i18n['cite']['q'][aliasesP.statedIn]] then
-- we need the raw "stated in" Q-identifier for the this template
citeParams['q'][i18n['cite']['q'][aliasesP.statedIn]] = self:getReferenceDetail(statement.snaks, aliasesP.statedIn, true) -- raw = true
useCite = citeQ
useParams = citeParams['q']
end
if useCite and useParams then
-- if this module is being substituted then build a regular template call, otherwise expand the template
if mw.isSubsting() then
for i, v in pairs(useParams) do
value = value .. "|" .. i .. "=" .. v
end
value = "{{" .. useCite .. value .. "}}"
else
value = mw.getCurrentFrame():expandTemplate{title=useCite, args=useParams}
end
-- (3) else, do some default rendering of name-value pairs, but only if at least "stated in", "reference URL" or "title" is present
elseif params[aliasesP.statedIn] or params[aliasesP.referenceURL] or params[aliasesP.title] then
citeParams['default'] = {}
-- start by adding authors up front
if params[aliasesP.author] and #params[aliasesP.author] > 0 then
citeParams['default'][#citeParams['default'] + 1] = table.concat(params[aliasesP.author], " & ")
end
-- combine "reference URL" and "title" into one link if both are present
if params[aliasesP.referenceURL] and params[aliasesP.title] then
citeParams['default'][#citeParams['default'] + 1] = '[' .. params[aliasesP.referenceURL][1] .. ' "' .. params[aliasesP.title][1] .. '"]'
elseif params[aliasesP.referenceURL] then
citeParams['default'][#citeParams['default'] + 1] = params[aliasesP.referenceURL][1]
elseif params[aliasesP.title] then
citeParams['default'][#citeParams['default'] + 1] = '"' .. params[aliasesP.title][1] .. '"'
end
-- then add "stated in"
if params[aliasesP.statedIn] then
citeParams['default'][#citeParams['default'] + 1] = "''" .. params[aliasesP.statedIn][1] .. "''"
end
-- remove previously added parameters so that they won't be added a second time
params[aliasesP.author] = nil
params[aliasesP.referenceURL] = nil
params[aliasesP.title] = nil
params[aliasesP.statedIn] = nil
-- add the rest of the parameters
for i, v in pairs(params) do
i = self.conf:getLabel(i)
if i ~= "" then
citeParams['default'][#citeParams['default'] + 1] = i .. ": " .. v[1]
end
end
value = table.concat(citeParams['default'], "; ")
if value ~= "" then
value = value .. "."
end
end
if value ~= "" then
value = {value} -- create one value object
if not self.rawValue then
-- this should become a <ref> tag, so save the reference's hash for later
value.refHash = "wikidata-" .. statement.hash .. "-v" .. (tonumber(i18n['cite']['version']) + version)
end
ref = {value} -- wrap the value object in an array
end
end
return ref
end
-- gets a detail of one particular type for a reference
function State:getReferenceDetail(snaks, dType, raw, link, anyLang)
local switchLang = anyLang
local value = nil
if not snaks[dType] then
return nil
end
-- if anyLang, first try the local language and otherwise any language
repeat
for _, v in ipairs(snaks[dType]) do
value = self.conf:getValue(v, raw, link, false, anyLang and not switchLang, false, true) -- noSpecial = true
if value then
break
end
end
if value or not anyLang then
break
end
switchLang = not switchLang
until anyLang and switchLang
return value
end
-- gets the details of one particular type for a reference
function State:getReferenceDetails(snaks, dType, raw, link, anyLang)
local values = {}
if not snaks[dType] then
return {}
end
for _, v in ipairs(snaks[dType]) do
-- if nil is returned then it will not be added to the table
values[#values + 1] = self.conf:getValue(v, raw, link, false, anyLang, false, true) -- noSpecial = true
end
return values
end
-- level 1 hook
function State:getAlias(object)
local value = object.value
local title = nil
if value and self.linked then
if self.conf.entityID:sub(1,1) == "Q" then
title = mw.wikibase.getSitelink(self.conf.entityID)
elseif self.conf.entityID:sub(1,1) == "P" then
title = "d:Property:" .. self.conf.entityID
end
if title then
value = buildWikilink(title, value)
end
end
value = {value} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getBadge(value)
value = self.conf:getLabel(value, self.rawValue, self.linked, self.shortName)
if value == "" then
value = nil
end
value = {value} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
function State:callHook(param, hooks, statement, result)
local valuesArray, refHash
-- call a parameter's hook if it has been defined and if it has not been called before
if not result[param] and hooks[param] then
valuesArray = self[hooks[param]](self, statement, param, result, hooks) -- array with value objects
-- add to the result
if #valuesArray > 0 then
result[param] = valuesArray
result.count = result.count + 1
else
result[param] = {} -- an empty array to indicate that we've tried this hook already
return true -- miss == true
end
end
return false
end
-- iterate through claims, claim's qualifiers or claim's references to collect values
function State:iterate(statements, hooks, matchHook)
matchHook = matchHook or alwaysTrue
local matches = false
local rankPos = nil
local result, gotRequired
for _, v in ipairs(statements) do
-- rankPos will be nil for non-claim statements (e.g. qualifiers, references, etc.)
matches, rankPos = matchHook(self, v)
if matches then
result = {count = 0} -- collection of arrays with value objects
local function walk(formatTable)
local miss
for i2, v2 in pairs(formatTable.req) do
-- call a hook, adding its return value to the result
miss = self:callHook(i2, hooks, v, result)
if miss then
-- we miss a required value for this level, so return false
return false
end
if result.count == hooks.count then
-- we're done if all hooks have been called;
-- returning at this point breaks the loop
return true
end
end
for _, v2 in ipairs(formatTable) do
if result.count == hooks.count then
-- we're done if all hooks have been called;
-- returning at this point prevents further childs from being processed
return true
end
if v2.child then
walk(v2.child)
end
end
return true
end
gotRequired = walk(self.parsedFormat)
-- only append the result if we got values for all required parameters on the root level
if gotRequired then
-- if we have a rankPos (only with matchHook() for complete claims), then update the foundRank
if rankPos and self.conf.foundRank > rankPos then
self.conf.foundRank = rankPos
end
-- append the result
self.results[#self.results + 1] = result
-- break if we only need a single value
if self.singleValue then
break
end
end
end
end
return self:out()
end
local function getEntityId(arg, eid, page, allowOmitPropPrefix)
local id = nil
local prop = nil
if arg then
if arg:sub(1,1) == ":" then
page = arg
eid = nil
elseif arg:sub(1,1):upper() == "Q" or arg:sub(1,9):lower() == "property:" or allowOmitPropPrefix then
eid = arg
page = nil
else
prop = arg
end
end
if eid then
if eid:sub(1,9):lower() == "property:" then
id = replaceAlias(mw.text.trim(eid:sub(10)))
if id:sub(1,1):upper() ~= "P" then
id = ""
end
else
id = replaceAlias(eid)
end
elseif page then
if page:sub(1,1) == ":" then
page = mw.text.trim(page:sub(2))
end
id = mw.wikibase.getEntityIdForTitle(page) or ""
end
if not id then
id = mw.wikibase.getEntityIdForCurrentPage() or ""
end
id = id:upper()
if not mw.wikibase.isValidEntityId(id) then
id = ""
end
return id, prop
end
local function nextArg(args)
local arg = args[args.pointer]
if arg then
args.pointer = args.pointer + 1
return mw.text.trim(arg)
else
return nil
end
end
local function claimCommand(args, funcName)
local cfg = Config:new()
cfg:processFlagOrCommand(funcName) -- process first command (== function name)
local lastArg, parsedFormat, formatParams, claims, value
local hooks = {count = 0}
-- set the date if given;
-- must come BEFORE processing the flags
if args[p.args.date] then
cfg.atDate = {parseDate(args[p.args.date])}
cfg.periods = {false, true, false} -- change default time constraint to 'current'
end
-- process flags and commands
repeat
lastArg = nextArg(args)
until not cfg:processFlagOrCommand(lastArg)
-- get the entity ID from either the positional argument, the eid argument or the page argument
cfg.entityID, cfg.propertyID = getEntityId(lastArg, args[p.args.eid], args[p.args.page])
if cfg.entityID == "" then
return "" -- we cannot continue without a valid entity ID
end
cfg.entity = mw.wikibase.getEntity(cfg.entityID)
if not cfg.propertyID then
cfg.propertyID = nextArg(args)
end
cfg.propertyID = replaceAlias(cfg.propertyID)
if not cfg.entity or not cfg.propertyID then
return "" -- we cannot continue without an entity or a property ID
end
cfg.propertyID = cfg.propertyID:upper()
if not cfg.entity.claims or not cfg.entity.claims[cfg.propertyID] then
return "" -- there is no use to continue without any claims
end
claims = cfg.entity.claims[cfg.propertyID]
if cfg.states.qualifiersCount > 0 then
-- do further processing if "qualifier(s)" command was given
if #args - args.pointer + 1 > cfg.states.qualifiersCount then
-- claim ID or literal value has been given
cfg.propertyValue = nextArg(args)
end
for i = 1, cfg.states.qualifiersCount do
-- check if given qualifier ID is an alias and add it
cfg.qualifierIDs[parameters.qualifier..i] = replaceAlias(nextArg(args) or ""):upper()
end
elseif cfg.states[parameters.reference] then
-- do further processing if "reference(s)" command was given
cfg.propertyValue = nextArg(args)
end
-- check for special property value 'somevalue' or 'novalue'
if cfg.propertyValue then
cfg.propertyValue = replaceSpecialChars(cfg.propertyValue)
if cfg.propertyValue ~= "" and mw.text.trim(cfg.propertyValue) == "" then
cfg.propertyValue = " " -- single space represents 'somevalue', whereas empty string represents 'novalue'
else
cfg.propertyValue = mw.text.trim(cfg.propertyValue)
end
end
-- parse the desired format, or choose an appropriate format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
elseif cfg.states.qualifiersCount > 0 then -- "qualifier(s)" command given
if cfg.states[parameters.property] then -- "propert(y|ies)" command given
parsedFormat, formatParams = parseFormat(formats.propertyWithQualifier)
else
parsedFormat, formatParams = parseFormat(formats.qualifier)
end
elseif cfg.states[parameters.property] then -- "propert(y|ies)" command given
parsedFormat, formatParams = parseFormat(formats.property)
else -- "reference(s)" command given
parsedFormat, formatParams = parseFormat(formats.reference)
end
-- if a "qualifier(s)" command and no "propert(y|ies)" command has been given, make the movable separator a semicolon
if cfg.states.qualifiersCount > 0 and not cfg.states[parameters.property] then
cfg.separators["sep"..parameters.separator][1] = {";"}
end
-- if only "reference(s)" has been given, set the default separator to none (except when raw)
if cfg.states[parameters.reference] and not cfg.states[parameters.property] and cfg.states.qualifiersCount == 0
and not cfg.states[parameters.reference].rawValue then
cfg.separators["sep"][1] = nil
end
-- if exactly one "qualifier(s)" command has been given, make "sep%q" point to "sep%q1" to make them equivalent
if cfg.states.qualifiersCount == 1 then
cfg.separators["sep"..parameters.qualifier] = cfg.separators["sep"..parameters.qualifier.."1"]
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hooks that should be called (getProperty, getQualifiers, getReferences);
-- only define a hook if both its command ("propert(y|ies)", "reference(s)", "qualifier(s)") and its parameter ("%p", "%r", "%q1", "%q2", "%q3") have been given
for i, v in pairs(cfg.states) do
-- e.g. 'formatParams["%q1"] or formatParams["%q"]' to define hook even if "%q1" was not defined to be able to build a complete value for "%q"
if formatParams[i] or formatParams[i:sub(1, 2)] then
hooks[i] = getHookName(i, 1)
hooks.count = hooks.count + 1
end
end
-- the "%q" parameter is not attached to a state, but is a collection of the results of multiple states (attached to "%q1", "%q2", "%q3", ...);
-- so if this parameter is given then this hook must be defined separately, but only if at least one "qualifier(s)" command has been given
if formatParams[parameters.qualifier] and cfg.states.qualifiersCount > 0 then
hooks[parameters.qualifier] = getHookName(parameters.qualifier, 1)
hooks.count = hooks.count + 1
end
-- create a state for "properties" if it doesn't exist yet, which will be used as a base configuration for each claim iteration;
-- must come AFTER defining the hooks
if not cfg.states[parameters.property] then
cfg.states[parameters.property] = State:new(cfg, parameters.property)
-- if the "single" flag has been given then this state should be equivalent to "property" (singular)
if cfg.singleClaim then
cfg.states[parameters.property].singleValue = true
end
end
-- if the "sourced" flag has been given then create a state for "reference" if it doesn't exist yet, using default values,
-- which must exist in order to be able to determine if a claim has any references;
-- must come AFTER defining the hooks
if cfg.sourcedOnly and not cfg.states[parameters.reference] then
cfg:processFlagOrCommand(p.claimCommands.reference) -- use singular "reference" to minimize overhead
end
-- set the parsed format and the separators (and optional punctuation mark);
-- must come AFTER creating the additonal states
cfg:setFormatAndSeparators(cfg.states[parameters.property], parsedFormat)
-- process qualifier matching values, analogous to cfg.propertyValue
for i, v in pairs(args) do
i = tostring(i)
if i:match('^[Pp]%d+$') or aliasesP[i] then
v = replaceSpecialChars(v)
-- check for special qualifier value 'somevalue'
if v ~= "" and mw.text.trim(v) == "" then
v = " " -- single space represents 'somevalue'
end
cfg.qualifierIDsAndValues[replaceAlias(i):upper()] = v
end
end
-- first sort the claims on rank to pre-define the order of output (preferred first, then normal, then deprecated)
claims = sortOnRank(claims)
-- then iterate through the claims to collect values
value = cfg:concatValues(cfg.states[parameters.property]:iterate(claims, hooks, State.claimMatches)) -- pass property state with level 1 hooks and matchHook
-- if desired, add a clickable icon that may be used to edit the returned values on Wikidata
if cfg.editable and value ~= "" then
value = value .. cfg:getEditIcon()
end
return value
end
local function generalCommand(args, funcName)
local cfg = Config:new()
cfg.curState = State:new(cfg)
local lastArg
local value = nil
repeat
lastArg = nextArg(args)
until not cfg:processFlag(lastArg)
-- get the entity ID from either the positional argument, the eid argument or the page argument
cfg.entityID = getEntityId(lastArg, args[p.args.eid], args[p.args.page], true)
if cfg.entityID == "" or not mw.wikibase.entityExists(cfg.entityID) then
return "" -- we cannot continue without an entity
end
-- serve according to the given command
if funcName == p.generalCommands.label then
value = cfg:getLabel(cfg.entityID, cfg.curState.rawValue, cfg.curState.linked, cfg.curState.shortName)
elseif funcName == p.generalCommands.title then
cfg.inSitelinks = true
if cfg.entityID:sub(1,1) == "Q" then
value = mw.wikibase.getSitelink(cfg.entityID)
end
if cfg.curState.linked and value then
value = buildWikilink(value)
end
elseif funcName == p.generalCommands.description then
value = mw.wikibase.getDescription(cfg.entityID)
else
local parsedFormat, formatParams
local hooks = {count = 0}
cfg.entity = mw.wikibase.getEntity(cfg.entityID)
if funcName == p.generalCommands.alias or funcName == p.generalCommands.badge then
cfg.curState.singleValue = true
end
if funcName == p.generalCommands.alias or funcName == p.generalCommands.aliases then
if not cfg.entity.aliases or not cfg.entity.aliases[cfg.langCode] then
return "" -- there is no use to continue without any aliasses
end
local aliases = cfg.entity.aliases[cfg.langCode]
-- parse the desired format, or parse the default aliases format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
else
parsedFormat, formatParams = parseFormat(formats.alias)
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hook that should be called (getAlias);
-- only define the hook if the parameter ("%a") has been given
if formatParams[parameters.alias] then
hooks[parameters.alias] = getHookName(parameters.alias, 1)
hooks.count = hooks.count + 1
end
-- set the parsed format and the separators (and optional punctuation mark)
cfg:setFormatAndSeparators(cfg.curState, parsedFormat)
-- iterate to collect values
value = cfg:concatValues(cfg.curState:iterate(aliases, hooks))
elseif funcName == p.generalCommands.badge or funcName == p.generalCommands.badges then
if not cfg.entity.sitelinks or not cfg.entity.sitelinks[cfg.siteID] or not cfg.entity.sitelinks[cfg.siteID].badges then
return "" -- there is no use to continue without any badges
end
local badges = cfg.entity.sitelinks[cfg.siteID].badges
cfg.inSitelinks = true
-- parse the desired format, or parse the default aliases format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
else
parsedFormat, formatParams = parseFormat(formats.badge)
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hook that should be called (getBadge);
-- only define the hook if the parameter ("%b") has been given
if formatParams[parameters.badge] then
hooks[parameters.badge] = getHookName(parameters.badge, 1)
hooks.count = hooks.count + 1
end
-- set the parsed format and the separators (and optional punctuation mark)
cfg:setFormatAndSeparators(cfg.curState, parsedFormat)
-- iterate to collect values
value = cfg:concatValues(cfg.curState:iterate(badges, hooks))
end
end
value = value or ""
if cfg.editable and value ~= "" then
-- if desired, add a clickable icon that may be used to edit the returned value on Wikidata
value = value .. cfg:getEditIcon()
end
return value
end
-- modules that include this module should call the functions with an underscore prepended, e.g.: p._property(args)
local function establishCommands(commandList, commandFunc)
for _, commandName in pairs(commandList) do
local function wikitextWrapper(frame)
local args = copyTable(frame.args)
args.pointer = 1
loadI18n(aliasesP, frame)
return commandFunc(args, commandName)
end
p[commandName] = wikitextWrapper
local function luaWrapper(args)
args = copyTable(args)
args.pointer = 1
loadI18n(aliasesP)
return commandFunc(args, commandName)
end
p["_" .. commandName] = luaWrapper
end
end
establishCommands(p.claimCommands, claimCommand)
establishCommands(p.generalCommands, generalCommand)
-- main function that is supposed to be used by wrapper templates
function p.main(frame)
if not mw.wikibase then return nil end
local f, args
loadI18n(aliasesP, frame)
-- get the parent frame to take the arguments that were passed to the wrapper template
frame = frame:getParent() or frame
if not frame.args[1] then
throwError("no-function-specified")
end
f = mw.text.trim(frame.args[1])
if f == "main" then
throwError("main-called-twice")
end
assert(p["_"..f], errorText('no-such-function', f))
-- copy arguments from immutable to mutable table
args = copyTable(frame.args)
-- remove the function name from the list
table.remove(args, 1)
return p["_"..f](args)
end
return p
9scru16s5146chaxiyatugrhsfa43zn
Modul:Mapframe
828
325282
2444338
1693212
2022-08-14T11:15:29Z
Fexpr
7716
Scribunto
text/plain
-- Note: Originally written on English Wikipedia at https://en.wikipedia.org/wiki/Module:Mapframe
--[[----------------------------------------------------------------------------
##### Localisation (L10n) settings #####
Replace values in quotes ("") with localised values
----------------------------------------------------------------------------]]--
local L10n = {}
-- Modue dependencies
local transcluder -- local copy of https://www.mediawiki.org/wiki/Module:Transcluder loaded lazily
-- "Module:No globals" should not be used, at least until all other modules which require this module are not using globals.
-- Template parameter names (unnumbered versions only)
-- Specify each as either a single string, or a table of strings (aliases)
-- Aliases are checked left-to-right, i.e. `{ "one", "two" }` is equivalent to using `{{{one| {{{two|}}} }}}` in a template
L10n.para = {
display = "display",
type = "type",
id = { "id", "ids" },
from = "from",
raw = "raw",
title = "title",
description = "description",
strokeColor = { "stroke-color", "stroke-colour" },
strokeWidth = "stroke-width",
strokeOpacity = "stroke-opacity",
fill = "fill",
fillOpacity = "fill-opacity",
coord = "coord",
marker = "marker",
markerColor = { "marker-color", "marker-colour" },
markerSize = "marker-size",
radius = { "radius", "radius_m" },
radiusKm = "radius_km",
radiusFt = "radius_ft",
radiusMi = "radius_mi",
edges = "edges",
text = "text",
icon = "icon",
zoom = "zoom",
frame = "frame",
plain = "plain",
frameWidth = "frame-width",
frameHeight = "frame-height",
frameCoordinates = { "frame-coordinates", "frame-coord" },
frameLatitude = { "frame-lat", "frame-latitude" },
frameLongitude = { "frame-long", "frame-longitude" },
frameAlign = "frame-align",
switch = "switch",
overlay = "overlay",
overlayBorder = "overlay-border",
overlayHorizontalAlignment = "overlay-horizontal-alignment",
overlayVerticalAlignment = "overlay-vertical-alignment",
overlayHorizontalOffset = "overlay-horizontal-offset",
overlayVerticalOffset = "overlay-vertical-offset"
}
-- Names of other templates this module can extract coordinates from
L10n.template = {
coord = { -- The coord template, as well as templates with output that contains {{coord}}
"Coord", "Coord/sandbox",
"NRHP row", "NRHP row/sandbox",
"WikidataCoord", "WikidataCoord/sandbox", "Wikidatacoord", "Wikidata coord"
}
}
-- Error messages
L10n.error = {
badDisplayPara = "Invalid display parameter",
noCoords = "Coordinates must be specified on Wikidata or in |" .. ( type(L10n.para.coord)== 'table' and L10n.para.coord[1] or L10n.para.coord ) .. "=",
wikidataCoords = "Coordinates not found on Wikidata",
noCircleCoords = "Circle centre coordinates must be specified, or available via Wikidata",
negativeRadius = "Circle radius must be a positive number",
noRadius = "Circle radius must be specified",
negativeEdges = "Circle edges must be a positive number",
noSwitchPara = "Found only one switch value in |" .. ( type(L10n.para.switch)== 'table' and L10n.para.switch[1] or L10n.para.switch ) .. "=",
oneSwitchLabel = "Found only one label in |" .. ( type(L10n.para.switch)== 'table' and L10n.para.switch[1] or L10n.para.switch ) .. "=",
noSwitchLists = "At least one parameter must have a SWITCH: list",
switchMismatches = "All SWITCH: lists must have the same number of values",
-- "%s" and "%d" tokens will be replaced with strings and numbers when used
oneSwitchValue = "Found only one switch value in |%s=",
fewerSwitchLabels = "Found %d switch values but only %d labels in |" .. ( type(L10n.para.switch)== 'table' and L10n.para.switch[1] or L10n.para.switch ) .. "=",
noNamedCoords = "No named coordinates found in %s"
}
-- Other strings
L10n.str = {
-- valid values for display parameter, e.g. (|display=inline) or (|display=title) or (|display=inline,title) or (|display=title,inline)
inline = "inline",
title = "title",
dsep = ",", -- separator between inline and title (comma in the example above)
-- valid values for type paramter
line = "line", -- geoline feature (e.g. a road)
shape = "shape", -- geoshape feature (e.g. a state or province)
shapeInverse = "shape-inverse", -- geomask feature (the inverse of a geoshape)
data = "data", -- geoJSON data page on Commons
point = "point", -- single point feature (coordinates)
circle = "circle", -- circular area around a point
named = "named", -- all named coordinates in an article or section
-- Keyword to indicate a switch list. Must NOT use the special characters ^$()%.[]*+-?
switch = "SWITCH",
-- valid values for icon, frame, and plain parameters
affirmedWords = ' '..table.concat({
"add",
"added",
"affirm",
"affirmed",
"include",
"included",
"on",
"true",
"yes",
"y"
}, ' ')..' ',
declinedWords = ' '..table.concat({
"decline",
"declined",
"exclude",
"excluded",
"false",
"none",
"not",
"no",
"n",
"off",
"omit",
"omitted",
"remove",
"removed"
}, ' ')..' '
}
-- Default values for parameters
L10n.defaults = {
display = L10n.str.inline,
text = "Map",
frameWidth = "300",
frameHeight = "200",
frameAlign = "right",
markerColor = "5E74F3",
markerSize = nil,
strokeColor = "#ff0000",
strokeWidth = 6,
edges = 32, -- number of edges used to approximate a circle
overlayBorder = "1px solid white",
overlayHorizontalAlignment = "right",
overlayHorizontalOffset = "0",
overlayVerticalAlignment = "bottom",
overlayVerticalOffset = "0"
}
-- #### End of L10n settings ####
--[[----------------------------------------------------------------------------
Utility methods
----------------------------------------------------------------------------]]--
local util = {}
--[[
Looks up a parameter value based on the id (a key from the L10n.para table) and
optionally a suffix, for parameters that can be suffixed (e.g. type2 is type
with suffix 2).
@param {table} args key-value pairs of parameter names and their values
@param {string} param_id id for parameter name (key from the L10n.para table)
@param {string} [suffix] suffix for parameter name
@returns {string|nil} parameter value if found, or nil if not found
]]--
function util.getParameterValue(args, param_id, suffix)
suffix = suffix or ''
if type( L10n.para[param_id] ) ~= 'table' then
return args[L10n.para[param_id]..suffix]
end
for _i, paramAlias in ipairs(L10n.para[param_id]) do
if args[paramAlias..suffix] then
return args[paramAlias..suffix]
end
end
return nil
end
--[[
Trim whitespace from args, and remove empty args. Also fix control characters.
@param {table} argsTable
@returns {table} trimmed args table
]]--
function util.trimArgs(argsTable)
local cleanArgs = {}
for key, val in pairs(argsTable) do
if type(key) == 'string' and type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val ~= '' then
-- control characters inside json need to be escaped, but stripping them is simpler
-- See also T214984
-- However, *don't* strip control characters from wikitext (text or description parameters) or you'll break strip markers
-- Alternatively it might be better to only strip control char from raw parameter content
if util.matchesParam('text', key) or util.matchesParam('description', key, key:gsub('^%D+(%d+)$', '%1') ) then
cleanArgs[key] = val
else
cleanArgs[key] = val:gsub('%c',' ')
end
end
else
cleanArgs[key] = val
end
end
return cleanArgs
end
--[[
Check if a parameter name matches an unlocalized parameter key
@param {string} key - the unlocalized parameter name to search through
@param {string} name - the localized parameter name to check
@param {string|nil} - an optional suffix to apply to the value(s) from the localization key
@returns {boolean} true if the name matches the parameter, false otherwise
]]--
function util.matchesParam(key, name, suffix)
local param = L10n.para[key]
suffix = suffix or ''
if type(param) == 'table' then
for _, v in pairs(param) do
if (v .. suffix) == name then return true end
end
return false
end
return ((param .. suffix) == name)
end
--[[
Check if a value is affirmed (one of the values in L10n.str.affirmedWords)
@param {string} val Value to be checked
@returns {boolean} true if affirmed, false otherwise
]]--
function util.isAffirmed(val)
if not(val) then return false end
return string.find(L10n.str.affirmedWords, ' '..val..' ', 1, true ) and true or false
end
--[[
Check if a value is declined (one of the values in L10n.str.declinedWords)
@param {string} val Value to be checked
@returns {boolean} true if declined, false otherwise
]]--
function util.isDeclined(val)
if not(val) then return false end
return string.find(L10n.str.declinedWords , ' '..val..' ', 1, true ) and true or false
end
--[[
Check if the name of a template matches the known coord templates or wrappers
(in L10n.template.coord). The name is normalised when checked, so e.g. the names
"Coord", "coord", and " Coord" all return true.
@param {string} name
@returns {boolean} true if it is a coord template or wrapper, false otherwise
]]--
function util.isCoordTemplateOrWrapper(name)
name = mw.text.trim(name)
local inputTitle = mw.title.new(name, 'Template')
if not inputTitle then
return false
end
-- Create (or reuse) mw.title objects for each known coord template/wrapper.
-- Stored in L10n.template.title so that they don't need to be recreated
-- each time this function is called
if not L10n.template.titles then
L10n.template.titles = {}
for _, v in pairs(L10n.template.coord) do
table.insert(L10n.template.titles, mw.title.new(v, 'Template'))
end
end
for _, templateTitle in pairs(L10n.template.titles) do
if mw.title.equals(inputTitle, templateTitle) then
return true
end
end
return false
end
--[[
Recursively extract coord templates which have a name parameter.
@param {string} wikitext
@returns {table} table sequence of coord templates
]]--
function util.extractCoordTemplates(wikitext)
local output = {}
local templates = mw.ustring.gmatch(wikitext, '{%b{}}')
local subtemplates = {}
for template in templates do
local templateName = mw.ustring.match(template, '{{([^}|]+)')
local nameParam = mw.ustring.match(template, "|%s*name%s*=%s*[^}|]+")
if util.isCoordTemplateOrWrapper(templateName) then
if nameParam then table.insert(output, template) end
elseif mw.ustring.find(mw.ustring.sub(template, 2), "{{") then
local subOutput = util.extractCoordTemplates(mw.ustring.sub(template, 2))
for _, t in pairs(subOutput) do
table.insert(output, t)
end
end
end
-- ensure coords are not using title display
for k, v in pairs(output) do
output[k] = mw.ustring.gsub(v, "|%s*display%s*=[^|}]+", "|display=inline")
end
return output
end
--[[
Gets all named coordiates from a page or a section of a page.
@param {string|nil} page Page name, or name#section, to get named coordinates
from. If the name is omitted, i.e. #section or nil or empty string, then
the current page will be used.
@returns {table} sequence of {coord, name, description} tables where coord is
the coordinates in a format suitable for #util.parseCoords, name is a string,
and description is a string (coordinates in a format suitable for displaying
to the reader). If for some reason the name can't be found, the description
is nil and the name contains display-format coordinates.
@throws {L10n.error.noNamedCoords} if no named coordinates are found.
]]--
function util.getNamedCoords(page)
if transcluder == nil then
-- load [[Module:Transcluder]] lazily so it is only transcluded on pages that
-- actually use named coordinates
transcluder = require("Module:Transcluder")
end
local parts = mw.text.split(page or "", "#", true)
local name = parts[1] == "" and mw.title.getCurrentTitle().prefixedText or parts[1]
local section = parts[2]
local pageWikitext = transcluder.get(section and name.."#"..section or name)
local coordTemplates = util.extractCoordTemplates(pageWikitext)
if #coordTemplates == 0 then error(string.format(L10n.error.noNamedCoords, page or name), 0) end
local frame = mw.getCurrentFrame()
local sep = "________"
local expandedContent = frame:preprocess(table.concat(coordTemplates, sep))
local expandedTemplates = mw.text.split(expandedContent, sep)
local namedCoords = {}
for _, expandedTemplate in pairs(expandedTemplates) do
local coord = mw.ustring.match(expandedTemplate, "<span class=\"geo%-dec\".->(.-)</span>")
if coord then
local name = (
-- name specified by a wrapper template, e.g [[Article|Name]]
mw.ustring.match(expandedTemplate, "<span class=\"mapframe%-coord%-name\">(.-)</span>") or
-- name passed into coord template
mw.ustring.match(expandedTemplate, "<span class=\"fn org\">(.-)</span>") or
-- default to the coordinates if the name can't be retrieved
coord
)
local description = name ~= coord and coord
local coord = mw.ustring.gsub(coord, "[° ]", "_")
table.insert(namedCoords, {coord=coord, name=name, description=description})
end
end
if #namedCoords == 0 then error(string.format(L10n.error.noNamedCoords, page or name), 0) end
return namedCoords
end
--[[
Parse coordinate values from the params passed in a GeoHack url (such as
//tools.wmflabs.org/geohack/geohack.php?pagename=Example¶ms=1_2_N_3_4_W_ or
//tools.wmflabs.org/geohack/geohack.php?pagename=Example¶ms=1.23_S_4.56_E_ )
or non-url string in the same format (such as `1_2_N_3_4_W_` or `1.23_S_4.56_E_`)
@param {string} coords string containing coordinates
@returns {number, number} latitude, longitude
]]--
function util.parseCoords(coords)
local coordsPatt
if mw.ustring.find(coords, "params=", 1, true) then
-- prevent false matches from page name, e.g. ?pagename=Lorem_S._Ipsum
coordsPatt = 'params=([_%.%d]+[NS][_%.%d]+[EW])'
else
-- not actually a geohack url, just the same format
coordsPatt = '[_%.%d]+[NS][_%.%d]+[EW]'
end
local parts = mw.text.split((mw.ustring.match(coords, coordsPatt) or ''), '_')
local lat_d = tonumber(parts[1])
local lat_m = tonumber(parts[2]) -- nil if coords are in decimal format
local lat_s = lat_m and tonumber(parts[3]) -- nil if coords are either in decimal format or degrees and minutes only
local lat = lat_d + (lat_m or 0)/60 + (lat_s or 0)/3600
if parts[#parts/2] == 'S' then
lat = lat * -1
end
local long_d = tonumber(parts[1+#parts/2])
local long_m = tonumber(parts[2+#parts/2]) -- nil if coords are in decimal format
local long_s = long_m and tonumber(parts[3+#parts/2]) -- nil if coords are either in decimal format or degrees and minutes only
local long = long_d + (long_m or 0)/60 + (long_s or 0)/3600
if parts[#parts] == 'W' then
long = long * -1
end
return lat, long
end
--[[
Get coordinates from a Wikidata item
@param {string} item_id Wikidata item id (Q number)
@returns {number, number} latitude, longitude
@throws {L10n.error.noCoords} if item_id is invalid or the item does not exist
@throws {L10n.error.wikidataCoords} if the the item does not have a P625
statement (coordinates), or it is set to "no value"
]]--
function util.wikidataCoords(item_id)
if not (item_id and mw.wikibase.isValidEntityId(item_id) and mw.wikibase.entityExists(item_id)) then
error(L10n.error.noCoords, 0)
end
local coordStatements = mw.wikibase.getBestStatements(item_id, 'P625')
if not coordStatements or #coordStatements == 0 then
error(L10n.error.wikidataCoords, 0)
end
local hasNoValue = ( coordStatements[1].mainsnak and (coordStatements[1].mainsnak.snaktype == 'novalue' or coordStatements[1].mainsnak.snaktype == 'somevalue') )
if hasNoValue then
error(L10n.error.wikidataCoords, 0)
end
local wdCoords = coordStatements[1]['mainsnak']['datavalue']['value']
return tonumber(wdCoords['latitude']), tonumber(wdCoords['longitude'])
end
--[[
Creates a polygon that approximates a circle
@param {number} lat Latitude
@param {number} long Longitude
@param {number} radius Radius in metres
@param {number} n Number of edges for the polygon
@returns {table} sequence of {latitude, longitude} table sequences, where
latitude and longitude are both numbers
]]--
function util.circleToPolygon(lat, long, radius, n) -- n is number of edges
-- Based on https://github.com/gabzim/circle-to-polygon, ISC licence
local function offset(cLat, cLon, distance, bearing)
local lat1 = math.rad(cLat)
local lon1 = math.rad(cLon)
local dByR = distance / 6378137 -- distance divided by 6378137 (radius of the earth) wgs84
local lat = math.asin(
math.sin(lat1) * math.cos(dByR) +
math.cos(lat1) * math.sin(dByR) * math.cos(bearing)
)
local lon = lon1 + math.atan2(
math.sin(bearing) * math.sin(dByR) * math.cos(lat1),
math.cos(dByR) - math.sin(lat1) * math.sin(lat)
)
return {math.deg(lon), math.deg(lat)}
end
local coordinates = {};
local i = 0;
while i < n do
table.insert(coordinates,
offset(lat, long, radius, (2*math.pi*i*-1)/n)
)
i = i + 1
end
table.insert(coordinates, offset(lat, long, radius, 0))
return coordinates
end
--[[
Get the number of key-value pairs in a table, which might not be a sequence.
@param {table} t
@returns {number} count of key-value pairs
]]--
function util.tableCount(t)
local count = 0
for k, v in pairs(t) do
count = count + 1
end
return count
end
--[[
For a table where the values are all tables, returns either the util.tableCount
of the subtables if they are all the same, or nil if they are not all the same.
@param {table} t
@returns {number|nil} count of key-value pairs of subtable, or nil if subtables
have different counts
]]--
function util.subTablesCount(t)
local count = nil
for k, v in pairs(t) do
if count == nil then
count = util.tableCount(v)
elseif count ~= util.tableCount(v) then
return nil
end
end
return count
end
--[[
Splits a list into a table sequence. The items in the list may be separated by
commas, or by semicolons (if items may contain commas), or by "###" (if items
may contain semicolons).
@param {string} listString
@returns {table} sequence of list items
]]--
function util.tableFromList(listString)
if type(listString) ~= "string" or listString == "" then return nil end
local separator = (mw.ustring.find(listString, "###", 0, true ) and "###") or
(mw.ustring.find(listString, ";", 0, true ) and ";") or ","
local pattern = "%s*"..separator.."%s*"
return mw.text.split(listString, pattern)
end
-- Boolean in outer scope indicating if Kartographer should be able to
-- automatically calculate coordinates (see phab:T227402)
local coordsDerivedFromFeatures = false;
--[[----------------------------------------------------------------------------
Make methods: These take in a table of arguments, and return either a string
or a table to be used in the eventual output.
----------------------------------------------------------------------------]]--
local make = {}
--[[
Makes content to go inside the maplink or mapframe tag.
@param {table} args
@returns {string} tag content
]]--
function make.content(args)
if util.getParameterValue(args, 'raw') then
coordsDerivedFromFeatures = true -- Kartographer should be able to automatically calculate coords from raw geoJSON
return util.getParameterValue(args, 'raw')
end
local content = {}
local argsExpanded = {}
for k, v in pairs(args) do
local index = string.match( k, '^[^0-9]+([0-9]*)$' )
if index ~= nil then
local indexNumber = ''
if index ~= '' then
indexNumber = tonumber(index)
else
indexNumber = 1
end
if argsExpanded[indexNumber] == nil then
argsExpanded[indexNumber] = {}
end
argsExpanded[indexNumber][ string.gsub(k, index, '') ] = v
end
end
for contentIndex, contentArgs in pairs(argsExpanded) do
local argType = util.getParameterValue(contentArgs, "type")
-- Kartographer automatically calculates coords if geolines/shapes are used (T227402)
if not coordsDerivedFromFeatures then
coordsDerivedFromFeatures = ( argType == L10n.str.line or argType == L10n.str.shape ) and true or false
end
if argType == L10n.str.named then
local namedCoords = util.getNamedCoords(util.getParameterValue(contentArgs, "from"))
local typeKey = type(L10n.para.type) == "table" and L10n.para.type[1] or L10n.para.type
local coordKey = type(L10n.para.coord) == "table" and L10n.para.coord[1] or L10n.para.coord
local titleKey = type(L10n.para.title) == "table" and L10n.para.title[1] or L10n.para.title
local descKey = type(L10n.para.description) == "table" and L10n.para.description[1] or L10n.para.description
for _, namedCoord in pairs(namedCoords) do
contentArgs[typeKey] = "point"
contentArgs[coordKey] = namedCoord.coord
contentArgs[titleKey] = namedCoord.name
contentArgs[descKey] = namedCoord.description
content[#content+1] = make.contentJson(contentArgs)
end
else
content[#content + 1] = make.contentJson(contentArgs)
end
end
--Single item, no array needed
if #content==1 then return content[1] end
--Multiple items get placed in a FeatureCollection
local contentArray = '[\n' .. table.concat( content, ',\n') .. '\n]'
return contentArray
end
--[[
Make coordinates from the coord arg, or the id arg, or the current page's
Wikidata item.
@param {table} args
@param {boolean} [plainOutput]
@returns {Mixed} Either:
{number, number} latitude, longitude if plainOutput is true; or
{table} table sequence of longitude, then latitude (gives the required format
for GeoJSON when encoded)
]]--
function make.coords(args, plainOutput)
local coords, lat, long
local frame = mw.getCurrentFrame()
if util.getParameterValue(args, 'coord') then
coords = frame:preprocess( util.getParameterValue(args, 'coord') )
lat, long = util.parseCoords(coords)
else
lat, long = util.wikidataCoords(util.getParameterValue(args, 'id') or mw.wikibase.getEntityIdForCurrentPage())
end
if plainOutput then
return lat, long
end
return {[0] = long, [1] = lat}
end
--[[
Makes a table of coordinates that approximate a circle.
@param {table} args
@returns {table} sequence of {latitude, longitude} table sequences, where
latitude and longitude are both numbers
@throws {L10n.error.noCircleCoords} if centre coordinates are not specified
@throws {L10n.error.noRadius} if radius is not specified
@throws {L10n.error.negativeRadius} if radius is negative or zero
@throws {L10n.error.negativeEdges} if edges is negative or zero
]]--
function make.circleCoords(args)
local lat, long = make.coords(args, true)
local radius = util.getParameterValue(args, 'radius')
if not radius then
radius = util.getParameterValue(args, 'radiusKm') and tonumber(util.getParameterValue(args, 'radiusKm'))*1000
if not radius then
radius = util.getParameterValue(args, 'radiusMi') and tonumber(util.getParameterValue(args, 'radiusMi'))*1609.344
if not radius then
radius = util.getParameterValue(args, 'radiusFt') and tonumber(util.getParameterValue(args, 'radiusFt'))*0.3048
end
end
end
local edges = util.getParameterValue(args, 'edges') or L10n.defaults.edges
if not lat or not long then
error(L10n.error.noCircleCoords, 0)
elseif not radius then
error(L10n.error.noRadius, 0)
elseif tonumber(radius) <= 0 then
error(L10n.error.negativeRadius, 0)
elseif tonumber(edges) <= 0 then
error(L10n.error.negativeEdges, 0)
end
return util.circleToPolygon(lat, long, radius, tonumber(edges))
end
--[[
Makes JSON data for a feature
@param contentArgs args for this feature. Keys must be the non-suffixed version
of the parameter names, i.e. use type, stroke, fill,... rather than type3,
stroke3, fill3,...
@returns {string} JSON encoded data
]]--
function make.contentJson(contentArgs)
local data = {}
if util.getParameterValue(contentArgs, 'type') == L10n.str.point or util.getParameterValue(contentArgs, 'type') == L10n.str.circle then
local isCircle = util.getParameterValue(contentArgs, 'type') == L10n.str.circle
data.type = "Feature"
data.geometry = {
type = isCircle and "LineString" or "Point",
coordinates = isCircle and make.circleCoords(contentArgs) or make.coords(contentArgs)
}
data.properties = {
title = util.getParameterValue(contentArgs, 'title') or mw.getCurrentFrame():getParent():getTitle()
}
if isCircle then
-- TODO: This is very similar to below, should be extracted into a function
data.properties.stroke = util.getParameterValue(contentArgs, 'strokeColor') or L10n.defaults.strokeColor
data.properties["stroke-width"] = tonumber(util.getParameterValue(contentArgs, 'strokeWidth')) or L10n.defaults.strokeWidth
local strokeOpacity = util.getParameterValue(contentArgs, 'strokeOpacity')
if strokeOpacity then
data.properties['stroke-opacity'] = tonumber(strokeOpacity)
end
local fill = util.getParameterValue(contentArgs, 'fill')
if fill then
data.properties.fill = fill
local fillOpacity = util.getParameterValue(contentArgs, 'fillOpacity')
data.properties['fill-opacity'] = fillOpacity and tonumber(fillOpacity) or 0.6
end
else -- is a point
local markerSymbol = util.getParameterValue(contentArgs, 'marker') or L10n.defaults.marker
-- allow blank to be explicitly specified, for overriding infoboxes or other templates with a default value
if markerSymbol ~= "blank" then
data.properties["marker-symbol"] = markerSymbol
end
data.properties["marker-color"] = util.getParameterValue(contentArgs, 'markerColor') or L10n.defaults.markerColor
data.properties["marker-size"] = util.getParameterValue(contentArgs, 'markerSize') or L10n.defaults.markerSize
end
else
data.type = "ExternalData"
if util.getParameterValue(contentArgs, 'type') == L10n.str.data or util.getParameterValue(contentArgs, 'from') then
data.service = "page"
elseif util.getParameterValue(contentArgs, 'type') == L10n.str.line then
data.service = "geoline"
elseif util.getParameterValue(contentArgs, 'type') == L10n.str.shape then
data.service = "geoshape"
elseif util.getParameterValue(contentArgs, 'type') == L10n.str.shapeInverse then
data.service = "geomask"
end
if util.getParameterValue(contentArgs, 'id') or (not (util.getParameterValue(contentArgs, 'from')) and mw.wikibase.getEntityIdForCurrentPage()) then
data.ids = util.getParameterValue(contentArgs, 'id') or mw.wikibase.getEntityIdForCurrentPage()
else
data.title = util.getParameterValue(contentArgs, 'from')
end
data.properties = {
stroke = util.getParameterValue(contentArgs, 'strokeColor') or L10n.defaults.strokeColor,
["stroke-width"] = tonumber(util.getParameterValue(contentArgs, 'strokeWidth')) or L10n.defaults.strokeWidth
}
local strokeOpacity = util.getParameterValue(contentArgs, 'strokeOpacity')
if strokeOpacity then
data.properties['stroke-opacity'] = tonumber(strokeOpacity)
end
local fill = util.getParameterValue(contentArgs, 'fill')
if fill and (data.service == "geoshape" or data.service == "geomask") then
data.properties.fill = fill
local fillOpacity = util.getParameterValue(contentArgs, 'fillOpacity')
if fillOpacity then
data.properties['fill-opacity'] = tonumber(fillOpacity)
end
end
end
data.properties.title = util.getParameterValue(contentArgs, 'title') or mw.title.getCurrentTitle().text
if util.getParameterValue(contentArgs, 'description') then
data.properties.description = util.getParameterValue(contentArgs, 'description')
end
return mw.text.jsonEncode(data)
end
--[[
Makes attributes for the maplink or mapframe tag.
@param {table} args
@param {boolean} [isTitle] Tag is to be displayed in the title of page rather
than inline
@returns {table<string,string>} key-value pairs of attribute names and values
]]--
function make.tagAttribs(args, isTitle)
local attribs = {}
if util.getParameterValue(args, 'zoom') then
attribs.zoom = util.getParameterValue(args, 'zoom')
end
if util.isDeclined(util.getParameterValue(args, 'icon')) then
attribs.class = "no-icon"
end
if util.getParameterValue(args, 'type') == L10n.str.point and not coordsDerivedFromFeatures then
local lat, long = make.coords(args, 'plainOutput')
attribs.latitude = tostring(lat)
attribs.longitude = tostring(long)
end
if util.isAffirmed(util.getParameterValue(args, 'frame')) and not(isTitle) then
attribs.width = util.getParameterValue(args, 'frameWidth') or L10n.defaults.frameWidth
attribs.height = util.getParameterValue(args, 'frameHeight') or L10n.defaults.frameHeight
if util.getParameterValue(args, 'frameCoordinates') then
local frameLat, frameLong = util.parseCoords(util.getParameterValue(args, 'frameCoordinates'))
attribs.latitude = frameLat
attribs.longitude = frameLong
else
if util.getParameterValue(args, 'frameLatitude') then
attribs.latitude = util.getParameterValue(args, 'frameLatitude')
end
if util.getParameterValue(args, 'frameLongitude') then
attribs.longitude = util.getParameterValue(args, 'frameLongitude')
end
end
if not attribs.latitude and not attribs.longitude and not coordsDerivedFromFeatures then
local success, lat, long = pcall(util.wikidataCoords, util.getParameterValue(args, 'id') or mw.wikibase.getEntityIdForCurrentPage())
if success then
attribs.latitude = tostring(lat)
attribs.longitude = tostring(long)
end
end
if util.getParameterValue(args, 'frameAlign') then
attribs.align = util.getParameterValue(args, 'frameAlign')
end
if util.isAffirmed(util.getParameterValue(args, 'plain')) then
attribs.frameless = "1"
else
attribs.text = util.getParameterValue(args, 'text') or L10n.defaults.text
end
else
attribs.text = util.getParameterValue(args, 'text') or L10n.defaults.text
end
return attribs
end
--[[
Makes maplink wikitext that will be located in the top-right of the title of the
page (the same place where coords with |display=title are positioned).
@param {table} args
@param {string} tagContent Content for the maplink tag
@returns {string}
]]--
function make.titleOutput(args, tagContent)
local titleTag = mw.text.tag('maplink', make.tagAttribs(args, true), tagContent)
local spanAttribs = {
style = "font-size: small;",
id = "coordinates"
}
return mw.text.tag('span', spanAttribs, titleTag)
end
--[[
Makes maplink or mapframe wikitext that will be located inline.
@param {table} args
@param {string} tagContent Content for the maplink tag
@returns {string}
]]--
function make.inlineOutput(args, tagContent)
local tagName = 'maplink'
if util.getParameterValue(args, 'frame') then
tagName = 'mapframe'
end
return mw.text.tag(tagName, make.tagAttribs(args), tagContent)
end
--[[
Makes the HTML required for the swicther to work, including the templatestyles
tag.
@param {table} params table sequence of {map, label} tables
@param {string} params{}.map Wikitext for mapframe map
@param {string} params{}.label Label text for swicther option
@param {table} options
@param {string} options.alignment "left" or "center" or "right"
@param {boolean} options.isThumbnail Display in a thumbnail
@param {string} options.width Width of frame, e.g. "200"
@param {string} [options.caption] Caption wikitext for thumnail
@retruns {string} swicther HTML
]]--
function make.switcherHtml(params, options)
options = options or {}
local frame = mw.getCurrentFrame()
local styles = frame:extensionTag{
name = "templatestyles",
args = {src = "Template:Maplink/styles-multi.css"}
}
local container = mw.html.create("div")
:addClass("switcher-container")
:addClass("mapframe-multi-container")
if options.alignment == "left" or options.alignment == "right" then
container:addClass("float"..options.alignment)
else -- alignment is "center"
container:addClass("center")
end
for i = 1, #params do
container
:tag("div")
:wikitext(params[i].map)
:tag("span")
:addClass("switcher-label")
:css("display", "none")
:wikitext(mw.text.trim(params[i].label))
end
if not options.isThumbnail then
return styles .. tostring(container)
end
local classlist = container:getAttr("class")
classlist = mw.ustring.gsub(classlist, "%a*"..options.alignment, "")
container:attr("class", classlist)
local outerCountainer = mw.html.create("div")
:addClass("mapframe-multi-outer-container")
:addClass("mw-kartographer-container")
:addClass("thumb")
if options.alignment == "left" or options.alignment == "right" then
outerCountainer:addClass("t"..options.alignment)
else -- alignment is "center"
outerCountainer
:addClass("tnone")
:addClass("center")
end
outerCountainer
:tag("div")
:addClass("thumbinner")
:css("width", options.width.."px")
:node(container)
:node(options.caption and mw.html.create("div")
:addClass("thumbcaption")
:wikitext(options.caption)
)
return styles .. tostring(outerCountainer)
end
--[[
Makes the HTML required for an overlay map to work
tag.
@param {string} overlayMap wikitext for the overlay map
@param {string} baseMap wikitext for the base map
@param {table} options various styling/display options
@param {string} options.align "left" or "center" or "right"
@param {string|number} options.width Width of the base map, e.g. "300"
@param {string|number} options.width Height of the base map, e.g. "200"
@param {string} options.border Border style for the overlayed map, e.g. "1px solid white"
@param {string} options.horizontalAlignment Horizontal alignment for overlay map, "left" or "right"
@param {string|number} options.horizontalOffset Horizontal offset in pixels from the alignment edge, e.g "10"
@param {string} options.verticalAlignment Vertical alignment for overlay map, "top" or "bottom"
@param {string|number} options.verticalOffset Vertical offset in pixels from the alignment edge, e.g. is "10"
@param {boolean} options.isThumbnail Display in a thumbnail
@param {string} [options.caption] Caption wikitext for thumnail
@retruns {string} HTML for basemap with overlay
]]--
function make.overlayHtml(overlayMap, baseMap, options)
options = options or {}
local containerFloatClass = "float"..(options.align or "none")
if options.align == "center" then
containerFloatClass = "center"
end
local containerStyle = {
position = "relative",
width = options.width .. "px",
height = options.height .. "px",
overflow = "hidden" -- mobile/minerva tends to add scrollbars for a couple of pixels
}
if options.align == "center" then
containerStyle["margin-left"] = "auto"
containerStyle["margin-right"] = "auto"
end
local container = mw.html.create("div")
:addClass("mapframe-withOverlay-container")
:addClass(containerFloatClass)
:addClass("noresize")
:css(containerStyle)
local overlayStyle = {
position = "absolute",
["z-index"] = "1",
border = options.border or "1px solid white"
}
if options.horizontalAlignment == "right" then
overlayStyle.right = options.horizontalOffset .. "px"
else
overlayStyle.left = options.horizontalOffset .. "px"
end
if options.verticalAlignment == "bottom" then
overlayStyle.bottom = options.verticalOffset .. "px"
else
overlayStyle.top = options.verticalOffset .. "px"
end
local overlayDiv = mw.html.create("div")
:css(overlayStyle)
:wikitext(overlayMap)
container
:node(overlayDiv)
:wikitext(baseMap)
if not options.isThumbnail then
return tostring(container)
end
local classlist = container:getAttr("class")
classlist = mw.ustring.gsub(classlist, "%a*"..options.align, "")
container:attr("class", classlist)
local outerCountainer = mw.html.create("div")
:addClass("mapframe-withOverlay-outerContainer")
:addClass("mw-kartographer-container")
:addClass("thumb")
if options.align == "left" or options.align == "right" then
outerCountainer:addClass("t"..options.align)
else -- alignment is "center"
outerCountainer
:addClass("tnone")
:addClass("center")
end
outerCountainer
:tag("div")
:addClass("thumbinner")
:css("width", options.width.."px")
:node(container)
:node(options.caption and mw.html.create("div")
:addClass("thumbcaption")
:wikitext(options.caption)
)
return tostring(outerCountainer)
end
--[[----------------------------------------------------------------------------
Package to be exported, i.e. methods which will available to templates and
other modules.
----------------------------------------------------------------------------]]--
local p = {}
-- Entry point for templates
function p.main(frame)
local parent = frame.getParent(frame)
-- Check for overlay option
local overlay = util.getParameterValue(parent.args, 'overlay')
local hasOverlay = overlay and mw.text.trim(overlay) ~= ""
-- Check for switch option
local switch = util.getParameterValue(parent.args, 'switch')
local isMulti = switch and mw.text.trim(switch) ~= ""
-- Create output by choosing method to suit options
local output
if hasOverlay then
output = p.withOverlay(parent.args)
elseif isMulti then
output = p.multi(parent.args)
else
output = p._main(parent.args)
end
-- Preprocess output before returning it
return frame:preprocess(output)
end
-- Entry points for modules
function p._main(_args)
local args = util.trimArgs(_args)
local tagContent = make.content(args)
local display = mw.text.split(util.getParameterValue(args, 'display') or L10n.defaults.display, '%s*' .. L10n.str.dsep .. '%s*')
local displayInTitle = display[1] == L10n.str.title or display[2] == L10n.str.title
local displayInline = display[1] == L10n.str.inline or display[2] == L10n.str.inline
local output
if displayInTitle and displayInline then
output = make.titleOutput(args, tagContent) .. make.inlineOutput(args, tagContent)
elseif displayInTitle then
output = make.titleOutput(args, tagContent)
elseif displayInline then
output = make.inlineOutput(args, tagContent)
else
error(L10n.error.badDisplayPara)
end
return output
end
function p.multi(_args)
local args = util.trimArgs(_args)
if not args[L10n.para.switch] then error(L10n.error.noSwitchPara, 0) end
local switchParamValue = util.getParameterValue(args, 'switch')
local switchLabels = util.tableFromList(switchParamValue)
if #switchLabels == 1 then error(L10n.error.oneSwitchLabel, 0) end
local mapframeArgs = {}
local switchParams = {}
for name, val in pairs(args) do
-- Copy to mapframeArgs, if not the switch labels or a switch parameter
if val ~= switchParamValue and not string.match(val, "^"..L10n.str.switch..":") then
mapframeArgs[name] = val
end
-- Check if this is a param to switch. If so, store the name and switch
-- values in switchParams table.
local switchList = string.match(val, "^"..L10n.str.switch..":(.+)")
if switchList ~= nil then
local values = util.tableFromList(switchList)
if #values == 1 then
error(string.format(L10n.error.oneSwitchValue, name), 0)
end
switchParams[name] = values
end
end
if util.tableCount(switchParams) == 0 then
error(L10n.error.noSwitchLists, 0)
end
local switchCount = util.subTablesCount(switchParams)
if not switchCount then
error(L10n.error.switchMismatches, 0)
elseif switchCount > #switchLabels then
error(string.format(L10n.error.fewerSwitchLabels, switchCount, #switchLabels), 0)
end
-- Ensure a plain frame will be used (thumbnail will be built by the
-- make.switcherHtml function if required, so that switcher options are
-- inside the thumnail)
mapframeArgs.plain = "yes"
local switcher = {}
for i = 1, switchCount do
local label = switchLabels[i]
for name, values in pairs(switchParams) do
mapframeArgs[name] = values[i]
end
table.insert(switcher, {
map = p._main(mapframeArgs),
label = "Show "..label
})
end
return make.switcherHtml(switcher, {
alignment = args["frame-align"] or "right",
isThumbnail = (args.frame and not args.plain) and true or false,
width = args["frame-width"] or L10n.defaults.frameWidth,
caption = args.text
})
end
function p.withOverlay(_args)
-- Get and trim wikitext for overlay map
local overlayMap = _args.overlay
if type(overlayMap) == 'string' then
overlayMap = overlayMap:match('^%s*(.-)%s*$')
end
local isThumbnail = (util.getParameterValue(_args, "frame") and not util.getParameterValue(_args, "plain")) and true or false
-- Get base map using the _main function, as a plain map
local args = util.trimArgs(_args)
args.plain = "yes"
local basemap = p._main(args)
-- Extract overlay options from args
local overlayOptions = {
width = util.getParameterValue(args, "frameWidth") or L10n.defaults.frameWidth,
height = util.getParameterValue(args, "frameHeight") or L10n.defaults.frameHeight,
align = util.getParameterValue(args, "frameAlign") or L10n.defaults.frameAlign,
border = util.getParameterValue(args, "overlayBorder") or L10n.defaults.overlayBorder,
horizontalAlignment = util.getParameterValue(args, "overlayHorizontalAlignment") or L10n.defaults.overlayHorizontalAlignment,
horizontalOffset = util.getParameterValue(args, "overlayHorizontalOffset") or L10n.defaults.overlayHorizontalOffset,
verticalAlignment = util.getParameterValue(args, "overlayVerticalAlignment") or L10n.defaults.overlayVerticalAlignment,
verticalOffset = util.getParameterValue(args, "overlayVerticalOffset") or L10n.defaults.overlayVerticalOffset,
isThumbnail = isThumbnail,
caption = util.getParameterValue(args, "text") or L10n.defaults.text
}
-- Make the HTML for the overlaying maps
return make.overlayHtml(overlayMap, basemap, overlayOptions)
end
return p
rv637rmyvte5ph666dfcujq2jx73r0k
Modul:Wd/i18n
828
325283
2444309
1693213
2022-08-13T13:51:50Z
David Wadie Fisher-Freberg
51
Scribunto
text/plain
-- The values and functions in this submodule should be localized per wiki.
local p = {}
function p.init(aliasesP)
p = {
["errors"] = {
["unknown-data-type"] = "Unknown or unsupported datatype '$1'.",
["missing-required-parameter"] = "No required parameters defined, needing at least one",
["extra-required-parameter"] = "Parameter '$1' must be defined as optional",
["no-function-specified"] = "You must specify a function to call", -- equal to the standard module error message
["main-called-twice"] = 'The function "main" cannot be called twice',
["no-such-function"] = 'The function "$1" does not exist' -- equal to the standard module error message
},
["info"] = {
["edit-on-wikidata"] = "Edit this on Wikidata"
},
["numeric"] = {
["decimal-mark"] = ".",
["delimiter"] = ","
},
["datetime"] = {
["prefixes"] = {
["decade-period"] = ""
},
["suffixes"] = {
["decade-period"] = "s",
["millennium"] = " millennium",
["century"] = " century",
["million-years"] = " million years",
["billion-years"] = " billion years",
["year"] = " year",
["years"] = " years"
},
["julian-calendar"] = "Julian calendar", -- linked page title
["julian"] = "Julian",
["BCE"] = "BCE",
["CE"] = "CE",
["common-era"] = "Common Era" -- linked page title
},
["coord"] = {
["latitude-north"] = "N",
["latitude-south"] = "S",
["longitude-east"] = "E",
["longitude-west"] = "W",
["degrees"] = "°",
["minutes"] = "'",
["seconds"] = '"',
["separator"] = ", "
},
["values"] = {
["unknown"] = "unknown",
["none"] = "none"
},
["cite"] = {
["version"] = "2", -- increment this each time the below parameters are changed to avoid conflict errors
["web"] = {
-- <= left side: all allowed reference properties for *web page sources* per https://www.wikidata.org/wiki/Help:Sources
-- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite web]] (if non-existent, keep empty i.e. "")
[aliasesP.statedIn] = "website",
[aliasesP.referenceURL] = "url",
[aliasesP.publicationDate] = "date",
[aliasesP.retrieved] = "access-date",
[aliasesP.title] = "title",
[aliasesP.archiveURL] = "archive-url",
[aliasesP.archiveDate] = "archive-date",
[aliasesP.language] = "language",
[aliasesP.author] = "author", -- existence of author1, author2, author3, etc. is assumed
[aliasesP.publisher] = "publisher",
[aliasesP.quote] = "quote",
[aliasesP.pages] = "pages" -- extra option
},
["q"] = {
-- <= left side: all allowed reference properties for *sources other than web pages* per https://www.wikidata.org/wiki/Help:Sources
-- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite Q]] (if non-existent, keep empty i.e. "")
[aliasesP.statedIn] = "1",
[aliasesP.pages] = "pages",
[aliasesP.column] = "at",
[aliasesP.chapter] = "chapter",
[aliasesP.sectionVerseOrParagraph] = "section",
["external-id"] = "id", -- used for any type of database property ID
[aliasesP.title] = "title",
[aliasesP.publicationDate] = "date",
[aliasesP.retrieved] = "access-date"
}
}
}
p.getOrdinalSuffix = function(num)
if tostring(num):sub(-2,-2) == '1' then
return "th" -- 10th, 11th, 12th, 13th, ... 19th
end
num = tostring(num):sub(-1)
if num == '1' then
return "st"
elseif num == '2' then
return "nd"
elseif num == '3' then
return "rd"
else
return "th"
end
end
p.addDelimiters = function(n)
local left, num, right = string.match(n, "^([^%d]*%d)(%d*)(.-)$")
if left and num and right then
return left .. (num:reverse():gsub("(%d%d%d)", "%1" .. p['numeric']['delimiter']):reverse()) .. right
else
return n
end
end
return p
end
return p
h70ieb0uxswts38nevjbf8jjyt60l0l
Templat:Infobox person/height
10
326848
2444327
2008831
2022-08-13T14:56:44Z
David Wadie Fisher-Freberg
51
update
wikitext
text/x-wiki
{{#invoke:person height|main}}<noinclude>
{{Documentation}}
</noinclude>
er0y8xmwd91jl83h0g23bm3e8psjplm
Templat:Infobox recurring event
10
327996
2444333
2023541
2022-08-13T18:30:26Z
182.0.139.174
wikitext
text/x-wiki
{{Infobox
| above = {{br separated entries<!--
-->|{{#if:{{{name|}}}|{{{name}}}|<includeonly>{{PAGENAMEBASE}}</includeonly>}}<!--
-->|{{#if:{{{native_name|}}}|<div style="display:inline;" class="nickname" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</div>}}<!--
-->}}
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{logo|}}}|size={{{logo_size|{{{logosize|}}}}}}|sizedefault=frameless|alt={{{logo_alt|}}}}}
| caption = {{{logo_caption|}}}
| image2 = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|{{{imagesize|}}}}}}|sizedefault=frameless|alt={{{alt|}}}}}
| caption2 = {{{caption|}}}
| label1 = Status
| data1 = {{{status|}}}
| label2 = Kategori acaro
| data2 = {{{genre|}}}
| label3 = {{#if:{{{dates|}}}|Dates|Date(s)}}
| data3 = {{#if:{{{dates|}}}|{{{dates}}}|{{{date|}}}}}
| label4 = Buko
| data4 = {{{begins|}}}
| label5 = Tutuik
| data5 = {{{ends|}}}
| label6 = Frekuensi
| data6 = {{{frequency|}}}
| label7 = Tampek
| data7 = {{{venue|}}}
| label8 = Alamaik
| data8 = {{{location|}}}
| label9 = Koordinat
| data9 = {{{coordinates|}}}
| label10 = Nagara
| data10 = {{{country|}}}
| label11 = Taun aktif
| data11 = {{{years_active|}}}
| label12 = {{#if:{{{established|}}}|Ado sojak|{{#if:{{{founded|}}}|Panomu|Inaugurated}}}}
| data12 = {{#if:{{{established|}}}|{{{established|}}}|{{#if:{{{founded|}}}|{{{founded|}}}|{{{first|}}}}}}}
| label13 = {{#if:{{{founders|}}}|Panomu|{{#if:{{{founder_title|}}}|{{{founder_title|}}}|Founder}}}}
| data13 = {{#if:{{{founders|}}}|{{{founders|}}}|{{{founder_name|}}}}}
| label14 = Tabaru
| data14 = {{{last|}}}
| label15 = Acaro sabalunnyo
| data15 = {{{prev|}}}
| label16 = Acaro esuak
| data16 = {{{next|}}}
| label17 = {{#if:{{{participants_title|}}}|{{{participants_title|}}}|Participants}}
| data17 = {{{participants|}}}
| label18 = Tamu
| data18 = {{{attendance|}}}
| label19 = Kapasitas
| data19 = {{{capacity|}}}
| label20 = Area
| data20 = {{{area|}}}
| label21 = Budget
| data21 = {{{budget|}}}
| label22 = {{#if:{{{events|}}}|Major events|Activity}}
| data22 = {{#if:{{{events|}}}|{{{events|}}}|{{{activity|}}}}}
| label23 = {{#if:{{{leader_title|}}}|{{{leader_title}}}|Leader}}
| data23 = {{{leader_name|}}}
| label24 = {{#if:{{{patrons|}}}|Patrons|Patron(s)}}
| data24 = {{#if:{{{patrons|}}}|{{{patrons}}}|{{{patron|}}}}}
| label25 = {{#if:{{{organizer|{{{organized|}}}}}}|Organized|Organised}} by
| data25 = {{#if:{{{organizer|{{{organized|}}}}}}|{{{organizer|{{{organized}}}}}}|{{{organiser|{{{organised|}}}}}}}}
| label26 = Filing status
| data26 = {{{filing|}}}
| label27 = People
| data27 = {{{people|}}}
| label28 = {{#if:{{{members|}}}|Members|Member}}
| data28 = {{#if:{{{members|}}}|{{{members|}}}|{{{member|}}}}}
| label29 = {{#if:{{{sponsors|}}}|Sponsors|Sponsor}}
| data29 = {{#if:{{{sponsors|}}}|{{{sponsors|}}}|{{{sponsor|}}}}}
| label30 = Harogo
| data30 = {{{prize_money|}}}
| label31 = {{{free_label}}}
| data31 = {{#if:{{{free_label|}}}|{{{free_text|}}}}}
| label32 = Website
| data32 = {{#if:{{{homepage|{{{URL|}}}}}}|{{{homepage|{{{URL}}}}}}|{{{website|}}}}}
| data33 = {{#if:{{{current|}}}{{{current_season|}}}|[[File:Current event clock.svg|15px|alt=|link=]] ''{{#if:{{{current|}}}|{{{current}}}|[[{{{current_season}}}]]}}''}}
| below = {{{footnotes|}}}
}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox recurring event with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox recurring event]] with unknown parameter "_VALUE_"|ignoreblank=y| activity | alt | area | attendance | begins | budget | capacity | caption | coordinates | country | current | current_season | date | dates | ends | established | events | filing | first | footnotes | founded | founder_name | founder_title | founders | free_label | free_text | frequency | genre | homepage | image | image_size | imagesize | last | leader_name | leader_title | location | logo | logo_alt | logo_caption | logo_size | logosize | member | members | name | native_name | native_name_lang | next | organised | organiser | organized | organizer | participants | participants_title | patron | patrons | people | prev | prize_money | sponsor | sponsors | status | URL | venue | website | years_active }}<noinclude>
{{documentation}}
</noinclude>
n7bo8u1q3fe7lbfojb8n3epemlir2ly
2444334
2444333
2022-08-13T18:33:01Z
182.0.139.174
wikitext
text/x-wiki
{{Infobox
| above = {{br separated entries<!--
-->|{{#if:{{{name|}}}|{{{name}}}|<includeonly>{{PAGENAMEBASE}}</includeonly>}}<!--
-->|{{#if:{{{native_name|}}}|<div style="display:inline;" class="nickname" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</div>}}<!--
-->}}
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{logo|}}}|size={{{logo_size|{{{logosize|}}}}}}|sizedefault=frameless|alt={{{logo_alt|}}}}}
| caption = {{{logo_caption|}}}
| image2 = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|{{{imagesize|}}}}}}|sizedefault=frameless|alt={{{alt|}}}}}
| caption2 = {{{caption|}}}
| label1 = Status
| data1 = {{{status|}}}
| label2 = Kategori acaro
| data2 = {{{genre|}}}
| label3 = {{#if:{{{dates|}}}|Dates|Date(s)}}
| data3 = {{#if:{{{dates|}}}|{{{dates}}}|{{{date|}}}}}
| label4 = Buko
| data4 = {{{begins|}}}
| label5 = Tutuik
| data5 = {{{ends|}}}
| label6 = Frekuensi
| data6 = {{{frequency|}}}
| label7 = Tampek
| data7 = {{{venue|}}}
| label8 = Alamaik
| data8 = {{{location|}}}
| label9 = Koordinat
| data9 = {{{coordinates|}}}
| label10 = Nagara
| data10 = {{{country|}}}
| label11 = Taun aktif
| data11 = {{{years_active|}}}
| label12 = {{#if:{{{established|}}}|Ado sojak|{{#if:{{{founded|}}}|Panomu|Barasmian}}}}
| data12 = {{#if:{{{established|}}}|{{{established|}}}|{{#if:{{{founded|}}}|{{{founded|}}}|{{{first|}}}}}}}
| label13 = {{#if:{{{founders|}}}|Panomu|{{#if:{{{founder_title|}}}|{{{founder_title|}}}|Founder}}}}
| data13 = {{#if:{{{founders|}}}|{{{founders|}}}|{{{founder_name|}}}}}
| label14 = Tabaru
| data14 = {{{last|}}}
| label15 = Acaro sabalunnyo
| data15 = {{{prev|}}}
| label16 = Acaro esuak
| data16 = {{{next|}}}
| label17 = {{#if:{{{participants_title|}}}|{{{participants_title|}}}|Participants}}
| data17 = {{{participants|}}}
| label18 = Banyak tamu
| data18 = {{{attendance|}}}
| label19 = Kapasitas
| data19 = {{{capacity|}}}
| label20 = Area
| data20 = {{{area|}}}
| label21 = Budget
| data21 = {{{budget|}}}
| label22 = {{#if:{{{events|}}}|Major events|Activity}}
| data22 = {{#if:{{{events|}}}|{{{events|}}}|{{{activity|}}}}}
| label23 = {{#if:{{{leader_title|}}}|{{{leader_title}}}|Leader}}
| data23 = {{{leader_name|}}}
| label24 = {{#if:{{{patrons|}}}|Patrons|Patron(s)}}
| data24 = {{#if:{{{patrons|}}}|{{{patrons}}}|{{{patron|}}}}}
| label25 = {{#if:{{{organizer|{{{organized|}}}}}}|Organized|Organised}} by
| data25 = {{#if:{{{organizer|{{{organized|}}}}}}|{{{organizer|{{{organized}}}}}}|{{{organiser|{{{organised|}}}}}}}}
| label26 = Filing status
| data26 = {{{filing|}}}
| label27 = People
| data27 = {{{people|}}}
| label28 = {{#if:{{{members|}}}|Members|Member}}
| data28 = {{#if:{{{members|}}}|{{{members|}}}|{{{member|}}}}}
| label29 = {{#if:{{{sponsors|}}}|Sponsors|Sponsor}}
| data29 = {{#if:{{{sponsors|}}}|{{{sponsors|}}}|{{{sponsor|}}}}}
| label30 = Harogo
| data30 = {{{prize_money|}}}
| label31 = {{{free_label}}}
| data31 = {{#if:{{{free_label|}}}|{{{free_text|}}}}}
| label32 = Website
| data32 = {{#if:{{{homepage|{{{URL|}}}}}}|{{{homepage|{{{URL}}}}}}|{{{website|}}}}}
| data33 = {{#if:{{{current|}}}{{{current_season|}}}|[[File:Current event clock.svg|15px|alt=|link=]] ''{{#if:{{{current|}}}|{{{current}}}|[[{{{current_season}}}]]}}''}}
| below = {{{footnotes|}}}
}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox recurring event with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox recurring event]] with unknown parameter "_VALUE_"|ignoreblank=y| activity | alt | area | attendance | begins | budget | capacity | caption | coordinates | country | current | current_season | date | dates | ends | established | events | filing | first | footnotes | founded | founder_name | founder_title | founders | free_label | free_text | frequency | genre | homepage | image | image_size | imagesize | last | leader_name | leader_title | location | logo | logo_alt | logo_caption | logo_size | logosize | member | members | name | native_name | native_name_lang | next | organised | organiser | organized | organizer | participants | participants_title | patron | patrons | people | prev | prize_money | sponsor | sponsors | status | URL | venue | website | years_active }}<noinclude>
{{documentation}}
</noinclude>
hkrx3alajfrco953cvv19lypatktsqm
2444335
2444334
2022-08-13T18:34:40Z
182.0.139.174
wikitext
text/x-wiki
{{Infobox
| above = {{br separated entries<!--
-->|{{#if:{{{name|}}}|{{{name}}}|<includeonly>{{PAGENAMEBASE}}</includeonly>}}<!--
-->|{{#if:{{{native_name|}}}|<div style="display:inline;" class="nickname" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</div>}}<!--
-->}}
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{logo|}}}|size={{{logo_size|{{{logosize|}}}}}}|sizedefault=frameless|alt={{{logo_alt|}}}}}
| caption = {{{logo_caption|}}}
| image2 = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|{{{imagesize|}}}}}}|sizedefault=frameless|alt={{{alt|}}}}}
| caption2 = {{{caption|}}}
| label1 = Status
| data1 = {{{status|}}}
| label2 = Kategori acaro
| data2 = {{{genre|}}}
| label3 = {{#if:{{{dates|}}}|Dates|Date(s)}}
| data3 = {{#if:{{{dates|}}}|{{{dates}}}|{{{date|}}}}}
| label4 = Buko
| data4 = {{{begins|}}}
| label5 = Tutuik
| data5 = {{{ends|}}}
| label6 = Frekuensi
| data6 = {{{frequency|}}}
| label7 = Tampek
| data7 = {{{venue|}}}
| label8 = Alamaik
| data8 = {{{location|}}}
| label9 = Koordinat
| data9 = {{{coordinates|}}}
| label10 = Nagara
| data10 = {{{country|}}}
| label11 = Taun aktif
| data11 = {{{years_active|}}}
| label12 = {{#if:{{{established|}}}|Ado sojak|{{#if:{{{founded|}}}|Panomu|Barasmian}}}}
| data12 = {{#if:{{{established|}}}|{{{established|}}}|{{#if:{{{founded|}}}|{{{founded|}}}|{{{first|}}}}}}}
| label13 = {{#if:{{{founders|}}}|Panomu|{{#if:{{{founder_title|}}}|{{{founder_title|}}}|Founder}}}}
| data13 = {{#if:{{{founders|}}}|{{{founders|}}}|{{{founder_name|}}}}}
| label14 = Tabaru
| data14 = {{{last|}}}
| label15 = Acaro sabalunnyo
| data15 = {{{prev|}}}
| label16 = Acaro esuak
| data16 = {{{next|}}}
| label17 = {{#if:{{{participants_title|}}}|{{{participants_title|}}}|Participants}}
| data17 = {{{participants|}}}
| label18 = Banyak tamu
| data18 = {{{attendance|}}}
| label19 = Kapasitas
| data19 = {{{capacity|}}}
| label20 = Area
| data20 = {{{area|}}}
| label21 = Budget
| data21 = {{{budget|}}}
| label22 = {{#if:{{{events|}}}|Major events|Activity}}
| data22 = {{#if:{{{events|}}}|{{{events|}}}|{{{activity|}}}}}
| label23 = {{#if:{{{leader_title|}}}|{{{leader_title}}}|Leader}}
| data23 = {{{leader_name|}}}
| label24 = {{#if:{{{patrons|}}}|Patrons|Patron(s)}}
| data24 = {{#if:{{{patrons|}}}|{{{patrons}}}|{{{patron|}}}}}
| label25 = {{#if:{{{organizer|{{{organized|}}}}}}|Organized|Organised}} by
| data25 = {{#if:{{{organizer|{{{organized|}}}}}}|{{{organizer|{{{organized}}}}}}|{{{organiser|{{{organised|}}}}}}}}
| label26 = Filing status
| data26 = {{{filing|}}}
| label27 = People
| data27 = {{{people|}}}
| label28 = {{#if:{{{members|}}}|Members|Member}}
| data28 = {{#if:{{{members|}}}|{{{members|}}}|{{{member|}}}}}
| label29 = {{#if:{{{sponsors|}}}|Sponsor|Sponsor}}
| data29 = {{#if:{{{sponsors|}}}|{{{sponsors|}}}|{{{sponsor|}}}}}
| label30 = Harogo
| data30 = {{{prize_money|}}}
| label31 = {{{free_label}}}
| data31 = {{#if:{{{free_label|}}}|{{{free_text|}}}}}
| label32 = Website
| data32 = {{#if:{{{homepage|{{{URL|}}}}}}|{{{homepage|{{{URL}}}}}}|{{{website|}}}}}
| data33 = {{#if:{{{current|}}}{{{current_season|}}}|[[File:Current event clock.svg|15px|alt=|link=]] ''{{#if:{{{current|}}}|{{{current}}}|[[{{{current_season}}}]]}}''}}
| below = {{{footnotes|}}}
}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox recurring event with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox recurring event]] with unknown parameter "_VALUE_"|ignoreblank=y| activity | alt | area | attendance | begins | budget | capacity | caption | coordinates | country | current | current_season | date | dates | ends | established | events | filing | first | footnotes | founded | founder_name | founder_title | founders | free_label | free_text | frequency | genre | homepage | image | image_size | imagesize | last | leader_name | leader_title | location | logo | logo_alt | logo_caption | logo_size | logosize | member | members | name | native_name | native_name_lang | next | organised | organiser | organized | organizer | participants | participants_title | patron | patrons | people | prev | prize_money | sponsor | sponsors | status | URL | venue | website | years_active }}<noinclude>
{{documentation}}
</noinclude>
qppcwphp15s7an5iwb0jvp35db28uen
Satelit
0
338724
2444332
2063899
2022-08-13T17:53:12Z
182.0.139.174
wikitext
text/x-wiki
[[Berkas:ConstellationGPS.gif|jmpl|Contoh satelit [[GPS]] dangan simulasi babagai [[orbit]].]]
[[Berkas:TerraSAR-X and TanDEM-X satellites in formation flight over Europa.jpg|jmpl|Satelit TerraSAR-X dan TanDEM-X dalam formasi tabang di ateg banua Eropa.]]
[[Berkas:SAR-Lupe.jpg|jmpl]]
Pado konteks [[panabangan angkaso lua]], '''satelit''' adolah benda nan sangaja ditampekkan atau ditaruah di [[orbit]].<ref>{{Cite book|title=Satellites|url=http://worldcat.org/oclc/918586046|isbn=978-1-62588-079-6|oclc=918586046|first=Parker, Steve, 1952-|last=author.}}</ref> Objek-objek iko disabuik '''satelit buatan''' untuak mambedakannyo dari satelit alami saparti [[Bulan]] nan mangorbit [[Bumi]]. Satelit buatan [[manusia]] partamo adolah [[Sputnik 1]].
== Rujuakan ==
{{reflist}}
== Pautan lua ==
{{commonscat|Satellites}}
aob34yrtokgf084qabjcp3x3ycoa4ha
Abe Shinzo
0
386202
2444300
2442675
2022-08-13T13:41:45Z
David Wadie Fisher-Freberg
51
test
wikitext
text/x-wiki
{{Infobox person/Wikidata}}
'''Abe Shinzo''' ({{nihongo2|安倍 晋三}}, {{transl|ja|Abe Shinzō}}, {{IPA-ja|abe ɕindzoː|pron}}; 21 September 1954 – 8 Juli 2022) adolah surang politisi [[Japang]] nan manjabaik sabagai [[Pardano Mantari Japang]] dan Presiden [[Partai Demokratik Liberal (Japang)|Partai Demokratik Liberal]] dari tahun 2006 inggo 2007 dan dari 2012 inggo 2020. Inyo adolah pardano mantari nan paliang lamo manjabaik dalam sajarah Japang.<ref>{{Cite web|url=https://foreignpolicy.com/2019/12/24/japan-shinzo-abe-2020-prime-minister-rest-laurels/|title=Shinzo Abe Can't Afford to Rest on His Laurels|first=William|last=Sposato}}</ref><ref>{{Cite news|url=https://www.bbc.com/news/world-asia-53943758|title=Japanese PM Shinzo Abe resigns for health reasons|work=BBC News|date=28 August 2020|access-date=28 August 2020}}</ref> Abe juo manjabaik sabagai Kapalo Sekretaris Kabinet dari tahun 2005 inggo 2006 di bawah Pardano Mantari [[Junichiro Koizumi]].
[[Pambunuahan Abe Shinzo|Abe dibunuah]] pado tanggal 8 Juli 2022 kiro-kiro jam 11:30 pagi wakatu Japang katiko sadang bapidato dalam kampanye [[pamiliahan legislatif Japang 2022|pamiliahan Diet]] di [[Nara]].<ref name="abedeath">{{cite news |url=https://www3.nhk.or.jp/news/html/20220708/k10013707681000.html |title=安倍晋三元首相死亡 奈良県で演説中に銃で撃たれる |language=Japanese |work=NHK |location=Tokyo, Japan |date=2022-07-08 |accessdate=2022-07-08 }}</ref><ref name="abedeath_eng">{{cite news |last1=Takahara |first1=Kanako |last2=Otake |first2=Tomoko |last3=Martin |first3=Alex K. T. |title=Former Prime Minister Shinzo Abe dies after being shot in Nara |url=https://www.japantimes.co.jp/news/2022/07/08/national/shinzo-abe-dead-nara-shooting/ |access-date=8 July 2022 |work=The Japan Times |date=8 July 2022}}</ref>
== Rujuakan ==
{{reflist}}
jx1ltc22m6yl3pt0udez9o5taaw9847
Kaisar Japang
0
386718
2444337
2444187
2022-08-14T08:45:22Z
114.10.71.195
wikitext
text/x-wiki
'''Kaisar Japang''' ([[abjad Kanji|Kanji]]: 天皇; [[Romaji]]: ''Tennō'') adolah pamimpin kaluargo kakaisaran dan [[kapalo nagara|kapalo]] seremonial nagara dari sistem [[monarki konstitusional]] Jopang. Badasarkan [[Konstitusi Japang|konstitusi taun 1947]], kaisar iyolah "lambang Nagara dan kasatuan bangsa". Manuruik sajarah, kaisar marupoan pamogang kawanangan tatenggi agamo [[Shinto]] basobok inyo dan kaluargonyo dipandang sabagai katurunan dari dewi matoari [[Amaterasu]]<ref>[http://www2u.biglobe.ne.jp/%257egln/77/7750/775004.htm 役員、総代としての基礎知識 全国神社総代会編集発行「改訂神社役員、総代必携」]{{jp icon}}</ref> maupun [[Kaisar Uda|nan babini]] ka [[Anak Daro|anak daro]] [[padusi|batino]] opak ò kaisar Jopang kudian ditarimo jo masyakaik [[Japang|Jopang]], dan kapantingannyo juo manangani urusan kaàgamoan, tamasuak ritual Shinto dan ritual saluruah bangsa.
[[Kaisar Uda]] sandiri marupokan jawaban atas [[doa]] [[urang Japang|urang Jopang]] nan katiko itu kasulitan ba[[parang|porang]] jo anak rajo [[cino]]. Nan dikana dek urang Jopang sabagai urang Tang nan jaek basobok tega mangirim cucu dari kaisar Jopang ka medan [[parang|porang]].
{{japang-stub}}
5rhn1jwyzdw06m0mmgajw21rq31h4u3
Berlin
0
386803
2444340
2444277
2022-08-14T11:26:48Z
Fexpr
7716
wikitext
text/x-wiki
{{Infobox settlement
| name = Berlin
| native_name =
| settlement_type = Ibu kota, negara bagian, jo munisipalitas
| image_skyline = {{Photomontage|position=center
| photo1a = Siegessaeule Aussicht 10-13 img4 Tiergarten.jpg
| photo2a = Brandenburger Tor abends.jpg
| photo2b = Berliner Dom, Westfassade, Nacht, 160309, ako.jpg
| photo3a = Schloss Charlottenburg (233558373).jpeg
| photo3b = Berlin_Museumsinsel_Fernsehturm.jpg
| photo4a = Siegessäule-Berlin-Tiergarten.jpg
| photo4b = Hochhäuser am Potsdamer Platz, Berlin, 160606, ako.jpg
| photo5a = Reichstag Berlin Germany.jpg
| color_border = white
| color = white
| spacing = 2
| size = 270
| foot_montage = '''Dari ateh, kida ka suok''': Panorama [[Tiergarten, Berlin|Tiergarten]]; [[Gerbang Brandenburg]]; [[Katedral Berlin]]; [[Istano Charlottenburg]]; [[Museum Island]] jo [[Minaro Berlin TV]]; [[Berlin Victory Column|Victory Column]]; [[Potsdam Square]]; jo [[Gaduang Reichstag]]
}}
| image_caption =
| nickname =
| image_flag = Flag_of_Berlin.svg
| flag_size = 125px
| image_blank_emblem = Coat of arms of Berlin.svg
| blank_emblem_type = Lambang
| blank_emblem_size = 100px
| pushpin_map = Germany#Europe
| pushpin_relief = yes
| pushpin_map_caption = Lokasi di [[Jerman]]
| coordinates = {{coord|52|31|12|N|13|24|18|E|format=dms|display=inline,title}}
| image_map = {{maplink|frame=y|plain=yes|frame-align=center|type=shape<!--line-->|fill=#ffffff|fill-opacity=0|stroke-color=|stroke-width=2|frame-width=250|frame-height=300}}
| subdivision_type = Nagara
| subdivision_name = Jerman
| subdivision_type1 = Nagara bagian
| subdivision_name1 = Berlin
| established_title1 =
| established_date1 =
| established_title2 =
| established_date2 =
| total_type = Kota/Nagara bagian
| area_total_km2 = 891,7
| area_footnotes = <ref name="statoffice">{{cite web |access-date=2 May 2019 |title=Amt für Statistik Berlin Brandenburg – Statistiken |url=https://www.statistik-berlin-brandenburg.de/Statistiken/inhalt-statistiken.asp |website=[[Amt für Statistik Berlin-Brandenburg]] |language=de |archive-date=8 March 2021 |archive-url=https://web.archive.org/web/20210308125331/https://www.statistik-berlin-brandenburg.de/Statistiken/inhalt-statistiken.asp |url-status=dead }}</ref>
| population_total = 3.769.495
| population_footnotes = <ref name="pop-detail">{{cite web|url=https://www.statistik-berlin-brandenburg.de/publikationen/stat_berichte/2020/SB_A01-05-00_2019h02_BE.pdf|title=Statistischer Bericht: Einwohnerinnen und Einwohner im Land Berlin am 31. Dezember 2019|trans-title=Statistical Report: Residents in the state of Berlin on 31 December 2019|pages=4, 10, 13, 18–22|website=[[Amt für Statistik Berlin-Brandenburg]]|access-date=8 April 2020|language=de|archive-date=23 February 2020|archive-url=https://web.archive.org/web/20200223110544/https://www.statistik-berlin-brandenburg.de/publikationen/stat_berichte/2020/SB_A01-05-00_2019h02_BE.pdf|url-status=live}}</ref>
| population_as_of = 31 Desember 2020
| population_urban = 4.473.101
| population_urban_footnotes = <ref name="citypopulation_urban">{{cite web|url=https://citypopulation.de/en/germany/urbanareas/|author=citypopulation.de quoting Federal Statistics Office|title=Germany: Urban Areas|access-date=2021-01-28|archive-url=https://web.archive.org/web/20200603133151/https://citypopulation.de/en/germany/urbanareas/|archive-date=2020-06-03|url-status=live}}</ref>
| population_metro = 6.144.600
| population_metro_footnotes = <ref>{{cite web |url=https://www.statistik-berlin-brandenburg.de/pms/2019/19-02-08.pdf |archive-url=https://web.archive.org/web/20210827224549/https://www.statistik-berlin-brandenburg.de/pms/2019/19-02-08.pdf |url-status=dead |archive-date=27 August 2021 |title=Bevölkerungsanstieg in Berlin und Brandenburg mit nachlassender Dynamik |date=8 February 2019 |website=statistik-berlin-brandenburg.de |publisher=Amt für Statistik Berlin-Brandenburg |access-date=24 November 2019}}</ref>
| elevation_m = 34
| population_demonyms = Berliner(s) (Bahaso Inggirih)<br/>Berliner (m), Berlinerin (f) (Bahaso Jerman)
| blank_name_sec1 = [[Gross regional product|GRP (nominal)]]
| blank_info_sec1 = €155 billion (2020)<ref>{{cite web|url = https://www.statistikportal.de/en/node/649|title = Bruttoinlandsprodukt – in jeweiligen Preisen – 1991 bis 2020|website = www.statistikportal.de|access-date = 1 April 2021|archive-date = 1 April 2021|archive-url = https://web.archive.org/web/20210401011816/https://www.statistikportal.de/en/node/649|url-status = live}}</ref>
| blank1_name_sec1 = GRP per kapita
| blank1_info_sec1 = €41,000 (2020)
| blank2_name_sec2 = [[Indeks Pambangunan Manusia|IPM]] (2018)
| blank2_info_sec2 = 0.964<ref name="GlobalDataLab">{{Cite web|url=https://hdi.globaldatalab.org/areadata/shdi/|title=Sub-national HDI – Area Database – Global Data Lab|website=hdi.globaldatalab.org|language=en|access-date=13 September 2018|archive-date=23 September 2018|archive-url=https://web.archive.org/web/20180923120638/https://hdi.globaldatalab.org/areadata/shdi/|url-status=live}}</ref><br/>{{color|green|very high}} · [[List of German states by Human Development Index|Kaduo dari 16]]
| timezone1 = [[Central European Time|CET]]
| utc_offset1 = +01:00
| timezone1_DST = [[Central European Summer Time|CEST]]
| utc_offset1_DST = +02:00
| blank_name_sec2 = [[GeoTLD]]
| blank_info_sec2 = [[.berlin]]
| website = {{URL|www.berlin.de/en/}}
| governing_body = [[Abgeordnetenhaus Berlin]]
| leader_title = [[Daftar Walikota Berlin|Walikota]]
| leader_party = SPD
| leader_title2 = [[Bundesrat of Germany|Bundesrat votes]]
| leader_name2 = 4 (dari 69)
| leader_title3 = [[Bundestag|Bundestag]]
| leader_name3 = [[Hasia pamiliahan umum German|29 (dari 736)]]
| leader_name = [[Franziska Giffey]]
| geocode = [[Nomenclature of Territorial Units for Statistics|NUTS Region]]: DE3
| area_code = [[Daftar kode telepon Jerman#030 – Berlin|030]]
| registration_plate = B
| iso_code = DE-BE
| official_name = Berlin
}}
'''Berlin''' ({{IPAc-en|b|əɹ|ˈ|l|ɪ|n}}; {{IPA-de|bɛɐ̯ˈliːn|-|de-Berlin.ogg}}) adolah [[ibu kota]] [[Republik Federal Jerman]] sajak taun [[1994]]. Sabalunnyo [[Berlin Timur|bagian timur kota iko]] adolah ibu kota [[Jerman Timur|Republik Demokratis Jerman]] dari taun [[1949]] - [[1990]] dan ibu kota dari nagara Jerman basatu dari taun [[1871]] - [[1945]]. Kota iko ([[2007]]) mamiliki panduduak sakitar 3,3 juta jiwa,<ref name="Population12">{{cite web|url=http://www.stadtentwicklung.berlin.de/planen/bevoelkerungsprognose/download/bevprog_2011_2030_kurzfassung.pdf |title=Bevölkerungsprognose für Berlin und die Bezirke 2011-2030 |publisher= Senate Department for Urban Development and the Environment, Berlin |date=October 2012 |accessdate=5 December 2012 |language=German}}</ref> sainggo manjadikannyo kota paliang gadang di Jerman dan kota paliang gadang kaduo di [[Uni Eropa]] salapeh [[London]].<ref name="Insee - -" >{{cite web|url=http://www.insee.fr/fr/themes/tableau.asp?ref_id=cmptef01103&id=18|title=Population des villes et unités urbaines de plus de 1 million d'habitants de l'Union européenne|author=[[INSEE]]|accessdate=17 August 2008|language=French}}</ref> Talatak di bagian timur laut Jerman dan dialiri Sungai [[Spree]], kota iko marupokan pusek dari [[Kawasan Metropolitan Berlin-Brandenburg]], nan bapanduduak sakitar 4,5 juta urang nan barasa labiah dari 180 nagara.<ref>{{cite web |url=http://www.berlin-brandenburg.de/daten-fakten/ |title=Daten und Fakten Hauptstadtregion |publisher=Berlin-Brandenburg.de |date= |accessdate=2013-02-10 |archive-date=2012-10-29 |archive-url=https://web.archive.org/web/20121029000000/http://www.berlin-brandenburg.de/daten-fakten/ |dead-url=yes }}</ref><ref>{{cite web|url=http://www.deutsche-metropolregionen.org/mitglieder/berlin-brandenburg/ |title=Initiativkreis Europäische Metropolregionen in Deutschland: Berlin-Brandenburg |publisher=Deutsche-metropolregionen.org |date= |accessdate=2013-02-10}}</ref><ref>{{cite web |url=http://www.eurometrex.org/Docs/Moscow/BerlinBrandenburg_planning_metropolitan_region_DE.pdf |title=PowerPoint-Präsentation |format=PDF |date= |accessdate=2013-03-12 |archive-date=2012-09-09 |archive-url=https://web.archive.org/web/20120909000224/http://www.eurometrex.org/Docs/Moscow/BerlinBrandenburg_planning_metropolitan_region_DE.pdf |dead-url=yes }}</ref><ref name=LUZ>{{cite web|url=http://www.urbanaudit.org/CityProfiles.aspx|title=City Profiles Berlin|work=Urban Audit|accessdate=20 August 2008|archive-date=2007-12-17|archive-url=https://web.archive.org/web/20071217141925/http://www.urbanaudit.org/CityProfiles.aspx|dead-url=yes}}</ref> Sakitar sapatigo kota iko tadiri dari utan jo taman kota, sarato danau, jo sungai.<ref>{{Cite book|url=http://books.google.de/books?id=94LP4xCb-KcC&pg=PA23&lpg=PA23&dq=%22Berlin+%22+rivers+lakes+foreests+%22one+third%22&source=bl&ots=OoT9TA0ZWR&sig=ZN0MSyam43OC5321qPitypjubUg&hl=en&ei=VWTPStrdKabEmwPdx9yEAw&sa=X&oi=book_result&ct=result&resnum=1#v=onepage&q=&f=false|title=Gren Berlin|work=[[Lonely Planet]]|accessdate=9 October 2009}}</ref>
Partamo kali tadokumentasi pado abaik ka-13, Berlin marupokan ibu kota [[Karajaan Prusia]] (1701–1918), [[Kakaisaran Jerman]] (1871–1918), [[Republik Weimar]] (1919–33) jo [[Jerman Nazi]] (1933–45).<ref>{{cite web|url=http://www.fordham.edu/halsall/mod/germanunification.html|title=Documents of German Unification, 1848–1871|work=Modern History Sourcebook|accessdate=18 August 2008}}</ref> [[Berlin pado taun 1920-an]] marupokan munisipalitas paliang gadang katigo di dunia.<ref>{{cite web|url=http://www.h-net.org/reviews/showrev.php?id=23505|title=Topographies of Class: Modern Architecture and Mass Society in Weimar Berlin (Social History, Popular Culture, and Politics in Germany).|work=www.h-net.org|accessdate=9 October 2009}}</ref> Salapeh [[Parang Dunia II]], kota iko tapacah manjadi [[Berlin Timur]]-ibu kota [[Jerman Timur]] jo [[Berlin Barat]], sabuah [[eksklav]] (dikaliliangi dek [[Tembok Berlin]] pado taun 1961-1989)<ref>{{cite web|url=http://www.britannica.com/EBchecked/topic/62202/Berlin-Wall|title=Berlin Wall|work=[[Encyclopædia Britannica]]|accessdate=18 August 2008}}</ref> dari [[nagara bagian federal]] [[Republik Federal Jerman]].<ref>{{cite book|url=http://books.google.de/books?id=r4al47QG2uYC&pg=PT95&dq=west+berlin+federal+state+federal+republic+of+germany&hl=de&sa=X&ei=h61-UfD8BITssgaE4IDACA&ved=0CDkQ6AEwATgK|title=Germany: The Long Road West: Volume 2: 1933-1990, Oxford University Press, 2007}}</ref> Setelah [[Reunifikasi Jerman]] pado taun 1990, kota iko baliak manjadi ibu kota nagara Jerman dan manauangi 147 [[misi diplomatik|kadutaan nagara asiang]].<ref>{{cite web|url=http://www.germany.info/Vertretung/usa/en/04__W__t__G/03/01/03/Feature__3.html|title=Berlin{{spaced ndash}} Capital of Germany|work=German Embassy in Washington|accessdate=18 August 2008|archiveurl=https://web.archive.org/web/20120112204045/http://www.germany.info/Vertretung/usa/en/04__W__t__G/03/01/03/Feature__3.html|archivedate=2012-01-12|dead-url=yes}}</ref><ref>{{cite web|url=http://www.magazine-deutschland.de/en/artikel-en/article/article/das-diplomatische-berlin.html|title=Diplomatic Berlin|work=Deutschland Online|accessdate=7 March 2009}}{{Pranala mati|date=Februari 2021 |bot=InternetArchiveBot |fix-attempted=yes }}</ref>
Salain sabuah kota, Berlin juo marupokan satu dari 16 [[Daftar Nagara Bagian Jerman|nagara bagian Jerman]], nan bafungsi sabagai pusek kagiatan politik Uni Eropa, sarato sabagai [[metropolitan]] paliang sibuk di [[Eropa]]. Kota iko juo dijadikan sabagai pusek lalu linteh kagiatan ekonomi, budayo, pandidikan, politik, jo sains di Jerman.<ref>{{Cite news|url=http://edition.cnn.com/2010/BUSINESS/04/10/cities.dominate.world/?hpt=C2|title=Revealed: Cities that rule the world – and those on the rise|first=Catriona|last=Davies|publisher=CNN|date=10 April 2010|accessdate=11 April 2010}}</ref><ref>{{cite news|url=http://www.nytimes.com/2008/06/22/travel/22iht-22berlin.13882912.html?_r=1|title=Berlin, the big canvas|first=Sam|last=Sifton|work=The New York Times|accessdate=18 August 2008|date=31 December 1969}} Caliak juo: {{cite web|url=http://www.lboro.ac.uk/gawc/rb/rb146.html#t5|title=Sites and situations of leading cities in cultural globalisations/Media|work=GaWC Research Bulletin 146|accessdate=18 August 2008}}</ref><ref>
{{Cite journal|title=Global Power City Index 2009|work=Institute for Urban Strategies at The Mori Memorial Foundation|location=Tokyo, Japan|date=22 October 2009|url=http://www.mori-m-foundation.or.jp/english/research/project/6/pdf/GPCI2009_English.pdf|accessdate=29 October 2009}}</ref> Ekonomi kota iko babasis [[industri teknologi tinggi]] dan sektor jaso, ditambah babarapo sektor [[industri kreatif]], media, jo arena konvensi. Berlin juo bafungsi sabagai pangubuang utamo kareta jo transportasi udaro di Eropa<ref name=congress>{{cite web|url=http://www.iccaworld.com/npps/story.cfm?ID=1577|title=ICCA publishes top 20 country and city rankings 2007|work=ICCA|accessdate=18 August 2008}}</ref><ref name=Cityofdesign>{{cite web|url=http://portal.unesco.org/culture/en/ev.php-URL_ID=29376&URL_DO=DO_TOPIC&URL_SECTION=201.html|title=Berlin City of Design Press Release|work=[[UNESCO]]|accessdate=18 August 2008}}</ref> dan tampek destinasi wisata tanamo.<ref name=third>{{cite web|url=http://www.statistik-berlin-brandenburg.de/pms/2011/11-02-18.pdf|title=Berlin-Tourismus 2010 mit neuem Rekord|work=Amt für Statistik|accessdate=19 February 2011|language=German}}</ref> Babagai macam industri ado di kota iko: [[teknologi informasi]], ubek-ubek, [[bioteknologi]], elektronik, [[energi tabaharui]], jo lain-lain.
Babarapo institusi sarupo [[universitas]], [[riset|lembaga panalitian]], [[teater]], dan [[museum]] ado di kota iko.<ref name=UNESCO>{{cite web|url=http://whc.unesco.org/en/list/896|title=World Heritage Site Museumsinsel|work=[[UNESCO]]|accessdate=18 August 2008}}</ref> Banyaknyo tampek basijarah di kota iko manjadikannyo tanamo sabagai tampek [[produksi film]] internasional.<ref>{{cite web|url=http://www.dw-world.de/dw/article/0,2144,3549403,00.html|title=Hollywood Helps Revive Berlin's Former Movie Glory|work=[[Deutsche Welle]]|date=9 August 2008|accessdate=18 August 2008}}</ref> Kota iko juo tanamo mamiliki kualitas iduik panduduaknyo nan rancak.<ref>{{Cite news|url=http://travel2.nytimes.com/2004/12/12/travel/12surf.html?ex=1150862400&en=f2c1cc6c507fea18&ei=5070|title=The Club Scene, on the Edge|work=The New York Times|accessdate=18 August 2008|first=Sunshine|last=Flint|date=12 December 2004}} Caliak ko: {{cite web|url=http://www.citymayors.com/features/quality_survey.html|title=Ranking of best cities in the world|work=City mayors|accessdate=18 August 2008}} jo {{cite web|url=http://www.denmark.dk/NR/rdonlyres/60B9101D-B656-438E-A755-E441D41E0AA7/0/top_20_cities.pdf|format=PDF|title=The Monocle Quality Of Life Survey|work=www.denmark.dk|accessdate=18 August 2008|archive-date=2011-07-28|archive-url=https://web.archive.org/web/20110728092453/http://www.denmark.dk/nr/rdonlyres/60b9101d-b656-438e-a755-e441d41e0aa7/0/top_20_cities.pdf|dead-url=yes}}</ref>
Klub [[sipak bola]] nan bamarkas di kota iko iolah [[Hertha BSC Berlin]].
== Rujuakan ==
{{reflist}}
{{Geo-stub}}
[[Kategori:Kota di Jerman]]
[[Kategori:Eropa]]
m1jw7xfpe0rlt6kmqdhvfgtr3o92a7r
Cornelis de Houtman
0
386804
2444299
2444163
2022-08-13T13:38:44Z
Yusuf123abcxyz
12678
Pajalanan
wikitext
text/x-wiki
{{Infobox person
| name = Cornelis de Houtman
| image = Cornelis de Houtman.jpg
| image_size = 175px
| caption =
| birth_date = {{Birth date|1565|04|02|df=yes}}
| birth_place = {{flagicon image|Flag of the Low Countries.svg}} [[Gouda, South Holland|Gouda]], [[Holandia]], [[Tujuah Baleh Provinsi]]
| death_date = {{death date and age|1599|9|1|1565|4|2}}
| death_place = {{flagicon|Kasultanan Aceh}} [[Kasultanan Aceh]]
| other_names =
| known_for =
| occupation = [[Panjalajah]]
| nationality = [[Republik Balando|Balando]]
}}
'''Cornelis de Houtman''' (lahia di [[Gouda]], [[Holland Selatan]], [[Balando]], [[2 April]] [[1565]] – maningga di [[Kasultanan Aceh|Aceh]], [[11 September]] [[1599]] pado umua 34 taun)<ref name=":0">{{Cite web|url=https://tirto.id/cornelis-de-houtman--mozaik-tirto-cM3U|title=Cornelis de Houtman - Mozaik Tirto - Tirto.ID|website=tirto.id|language=id|access-date=2018-07-30}}</ref> adolah saurang panjalajah [[Balando]] nan manamukan jalua palayaran dari [[Eropa]] ka [[Nusantara]] dan barasia mamulai padagangan [[rampah-rampah]] untuak Balando. Cornelis de Houtman basamo armadanyo tibo pado [[27 Juni]] [[1596]] di parairan [[Banten]],<ref name=":0" /> lalu baliak pulang pado [[14 Agustus]] [[1597]] mambaok 240 kantuang [[marica]], 45 ton [[palo]], dan 30 bal bungalo pal.<ref>{{Cite web|url=https://historia.id/kuno/articles/melipat-laba-di-pelayaran-kedua-P0olW|title=Melipat Laba di Pelayaran Kedua|website=Historia - Obrolan Perempuan Urban|language=id-ID|access-date=2018-07-30}}</ref> Kabarasilannyo mambukak jalan untuak ekspedisi-ekspedisi salanjuiknyo nan barujuang pado praktik [[kolonialisme]] di [[Nusantara]].
==Panjalajahan ka Nusantara==
Pada taun [[1592]] Cornelis de Houtman dikirim dek padagang Balando ka [[Lisbon]] untuak mangumpuakan informasi manganaii informasi tantang kapulauan [[rampah rampah]] sabanyak mungkin.
Wakatu pulang ka Balando nan basamoan jo kapulangan [[Jan Huygen van Linschoten]] dari [[India]], De Houtman jo padagang Balando lainnyo mamastian kalau [[Banten]] manjadi tampek nan paliang tapek untuak mambali rampah rampah, dan pado taun 1594 para padagang Balando ko mandirikan [[Compagnie van Verre]] (Parusahaan jarak jauah).
===Pajalanan ka Nusantara===
Pado [[2 April]] [[1595]] De Houtman mamulai pajalanan ka [[Nusantara]] manggunoan sabanyak ampek kapa. De Houtman mamulai pajalanan dari [[Amsterdam]], dari Amsterdam mareka balaya manuju pantai barat [[Afrika]] taruih ka [[Tanjuang Harapan]] di [[Afrika Selatan]], dari Tanjuang Harapan rombongan De Houtman balaya mangaruingi [[Samudera Hindia]] hinggo sampai di [[Banten]] pado [[27 Juni]] [[1596]].
===Sasampai di Nusantara===
Sasampai di Banten Cornelis de Houtman jo rombongan di tarimo dek masyarakaik satampek. Tapi dek kalakuan nan kasa jo pangaruh [[Portugis]], rombongan De Houtman diusia dek Sultan Banten.
Satalah diusia De Houtman malanjuikkan pajalanan manyurusuri lauik utara Jawa hinggo sampai ka [[Bali]]. Di Bali De Houtman batamu Rajo Bali dan mandapekkan marica.
==Rujuakan==
{{Reflist}}
h3its8qqqxm2v99mec2yoyy6tggo4db
2444304
2444299
2022-08-13T13:44:47Z
Yusuf123abcxyz
12678
/* Panjalajahan ka Nusantara */
wikitext
text/x-wiki
{{Infobox person
| name = Cornelis de Houtman
| image = Cornelis de Houtman.jpg
| image_size = 175px
| caption =
| birth_date = {{Birth date|1565|04|02|df=yes}}
| birth_place = {{flagicon image|Flag of the Low Countries.svg}} [[Gouda, South Holland|Gouda]], [[Holandia]], [[Tujuah Baleh Provinsi]]
| death_date = {{death date and age|1599|9|1|1565|4|2}}
| death_place = {{flagicon|Kasultanan Aceh}} [[Kasultanan Aceh]]
| other_names =
| known_for =
| occupation = [[Panjalajah]]
| nationality = [[Republik Balando|Balando]]
}}
'''Cornelis de Houtman''' (lahia di [[Gouda]], [[Holland Selatan]], [[Balando]], [[2 April]] [[1565]] – maningga di [[Kasultanan Aceh|Aceh]], [[11 September]] [[1599]] pado umua 34 taun)<ref name=":0">{{Cite web|url=https://tirto.id/cornelis-de-houtman--mozaik-tirto-cM3U|title=Cornelis de Houtman - Mozaik Tirto - Tirto.ID|website=tirto.id|language=id|access-date=2018-07-30}}</ref> adolah saurang panjalajah [[Balando]] nan manamukan jalua palayaran dari [[Eropa]] ka [[Nusantara]] dan barasia mamulai padagangan [[rampah-rampah]] untuak Balando. Cornelis de Houtman basamo armadanyo tibo pado [[27 Juni]] [[1596]] di parairan [[Banten]],<ref name=":0" /> lalu baliak pulang pado [[14 Agustus]] [[1597]] mambaok 240 kantuang [[marica]], 45 ton [[palo]], dan 30 bal bungalo pal.<ref>{{Cite web|url=https://historia.id/kuno/articles/melipat-laba-di-pelayaran-kedua-P0olW|title=Melipat Laba di Pelayaran Kedua|website=Historia - Obrolan Perempuan Urban|language=id-ID|access-date=2018-07-30}}</ref> Kabarasilannyo mambukak jalan untuak ekspedisi-ekspedisi salanjuiknyo nan barujuang pado praktik [[kolonialisme]] di [[Nusantara]].
==Panjalajahan ka Nusantara==
Pada taun [[1592]] Cornelis de Houtman dikirim dek padagang Balando ka [[Lisboa]] untuak mangumpuakan informasi manganaii informasi tantang kapulauan [[rampah rampah]] sabanyak mungkin.
Wakatu pulang ka Balando nan basamoan jo kapulangan [[Jan Huygen van Linschoten]] dari [[India]], De Houtman jo padagang Balando lainnyo mamastian kalau [[Banten]] manjadi tampek nan paliang tapek untuak mambali rampah rampah, dan pado taun 1594 para padagang Balando ko mandirikan [[Compagnie van Verre]] (Parusahaan jarak jauah).<ref>{{Cite web|url=https://www.kompas.com/stori/read/2022/06/27/143000779/arti-penting-pendaratan-cornelis-de-houtman-di-banten|title=Arti Penting Pendaratan Cornelis de Houtman di Banten Halaman all|last=Media|first=Kompas Cyber|date=2022-06-27|website=KOMPAS.com|language=id|access-date=2022-08-13}}</ref>
===Pajalanan ka Nusantara===
Pado [[2 April]] [[1595]] De Houtman mamulai pajalanan ka [[Nusantara]] manggunoan sabanyak ampek kapa. De Houtman mamulai pajalanan dari [[Amsterdam]], dari Amsterdam mareka balaya manuju pantai barat [[Afrika]] taruih ka [[Tanjuang Harapan]] di [[Afrika Selatan]], dari Tanjuang Harapan rombongan De Houtman balaya mangaruingi [[Samudera Hindia]] hinggo sampai di [[Banten]] pado [[27 Juni]] [[1596]].<ref>{{Cite web|url=https://roboguru.ruangguru.com/question/buatlah-peta-penjelajahan-samudera-yang-dilakukan-oleh-cornelis-de-houtman_QU-9Y91Y7J6|title=Buatlah peta penjelajahan samudera yang dilakukan ...|last=Team|first=Ruangguru Tech|website=roboguru.ruangguru.com|language=id-ID|access-date=2022-08-13}}</ref>
===Sasampai di Nusantara===
Sasampai di Banten Cornelis de Houtman jo rombongan di tarimo dek masyarakaik satampek. Tapi dek kalakuan nan kasa jo pangaruh [[Portugis]], rombongan De Houtman diusia dek Sultan Banten.
Satalah diusia De Houtman malanjuikkan pajalanan manyurusuri lauik utara Jawa hinggo sampai ka [[Bali]]. Di Bali De Houtman batamu Rajo Bali dan mandapekkan marica.<ref>{{Cite web|url=https://www.kompas.com/stori/read/2021/05/02/171550579/cornelis-de-houtman-jalur-pelayaran-dan-akhir-hidupnya|title=Cornelis de Houtman: Jalur Pelayaran dan Akhir Hidupnya Halaman all|last=Media|first=Kompas Cyber|date=2021-05-02|website=KOMPAS.com|language=id|access-date=2022-08-13}}</ref>
==Rujuakan==
{{Reflist}}
iqaa7vzzd3hae05ums81vwvea04g8yw
Modul:WikidataIB/doc
828
386863
2444284
2022-08-13T13:30:07Z
David Wadie Fisher-Freberg
51
add
wikitext
text/x-wiki
{{Module rating |protected}}
{{#ifeq:{{SUBPAGENAME}}|sandbox||{{High-use}}}}
{{ombox|text=For a more user-friendly wrapper of this module see {{t|wdib}}.}}
This module is intended to be used inside {{t|infobox}} (letters Wikidata'''IB''' stand for ''Info Box'', hence the name) or other templates and designed specifically to allow editors of an article (as opposed to editors of the infobox the article uses) to control whether Wikidata values are displayed.
One of the two sandboxes should be used for testing anything other than trivial amendments.
Test examples for the main module and the two sandboxes are available.
{| class="wikitable plainrowheaders
|+ Modules and test cases
|-
!
! scope="col" | Module
! scope="col" | Test cases
|-
! scope="row" | Main
| [[Module:WikidataIB]]
| [[Module talk:WikidataIB/testing]]
|-
! scope="row" | sandbox
| [[Module:WikidataIB/sandbox]] ({{Compare pages|Module:WikidataIB|Module:WikidataIB/sandbox|diff}})
| [[Module talk:WikidataIB/sandbox/testing]] ({{Compare pages|Module talk:WikidataIB/testing|Module talk:WikidataIB/sandbox/testing|diff}})
|-
! scope="row" | sandbox1
| [[Module:WikidataIB/sandbox1]] ({{Compare pages|Module:WikidataIB|Module:WikidataIB/sandbox1|diff}})
| [[Module talk:WikidataIB/sandbox1/testing]] ({{Compare pages|Module talk:WikidataIB/testing|Module talk:WikidataIB/sandbox1/testing|diff}})
|}
== Overview ==
The module provides these calls specifically for use in infoboxes at present:
# <code>getValue</code> - main call, used to get the value(s) of a given property
# <code>getQualifierValue</code> - given: (1) a property; (2) its value; (3) a qualifier's propertyID, returns values which match
# <code>getValueByQual</code> gets the value of a property which has a qualifier with a given entity value
# <code>getValueByLang</code> gets the value of a property which has a qualifier P407("language of work or name") whose value has the given language code
# <code>getValueByRefSource</code> gets the value of a property which has a reference "stated in" (P248) whose value has the given entity-ID
# <code>getPropOfProp</code> if the value(s) of prop1 are of type "wikibase-item" then it returns the value(s) of prop2 of each of those wikibase-items
# <code>getAwardCat</code> if the item has values of P166 (award received), then it examines each of those awards for P2517 (category for recipients of this award) and it returns the corresponding category, with the item's P734 (family name) as sort key, or no sort key if there is no family name
# <code>getIntersectCat</code> for each value of the prop1 it fetches the value's main category and then each value of prop2, then it returns all of the categories representing the intersection of those properties
# <code>getSumOfParts</code> scans the property 'has part' (P527) for values matching a list, If the matched values have a qualifier 'quantity' (P1114), those quantities are summed and returned (but zero returns nil)
# <code>getCoords</code> - gets coordinates and passes them through {{t|Coord}}
# <code>getPreferredValue</code> - {{color|red|'''Deprecated'''}} but retained for backward compatibility. Use the <code>|getValue|rank=best</code> parameters instead.
The obsolete call getSourcedValue has now been removed as it is redundant to getValue which can do the same job using the {{para|onlysourced|true}} parameter (which is set by default).
===Utilities functions===
# <code>getLink</code> if there is a sitelink to an article on the local Wiki, it returns a link to the article with the Wikidata label as the displayed text. If there is no sitelink, it returns the label as plain text. If there is no label in the local language, it returns the entity-ID
# <code>getAT</code> (Article Title) If there is a sitelink to an article on the local Wiki, it returns the sitelink as plain text, otherwise nothing
# <code>getSiteLink</code> gets the plain text link to an article on a given wiki
# <code>getLabel</code> returns the Wikidata label for the local language as plain text. If there is no label in the local language, it returns the entity-ID
# <code>getAllLabels</code> fetches the set of labels and formats it for display as wikitext
# <code>labelorid</code> returns the label with all wikitext removed, or the entity-ID if no label
# <code>getDescription</code> returns the article description for the Wikidata entity if the local parameter is "Wikidata".
# <code>getAllDescriptions</code> fetches the set of descriptions and formats it for display as wikitext
# <code>getAliases</code> returns the aliases for the entity in the current or given language
# <code>getAllAliases</code> fetches the set of aliases and formats it for display as wikitext
# <code>pageId</code> returns the connected Wikidata page id (entity-ID, Q-number) of the current page
# <code>formatDate</code> takes a datetime of the usual format from mw.wikibase.entity:formatPropertyValues and formats it according to the df (date format) and bc parameters
# <code>formatNumber</code> formats a number according to the supplied language code
# <code>checkBlacklist</code> returns true if the field is ''not'' blacklisted (i.e. allowed)
# <code>emptyor</code> returns nil if the parameter is just punctuation, whitespace or html tags, otherwise returns the argument unchanged
# <code>getLang</code> returns the MediaWiki language code or the full language name of the current content
# <code>getItemLangCode</code> looks for country (P17), then for that country's official language (P37), and returns its language code (P424)
# <code>findLanguage</code> returns (1) supplied language if valid; or (2) the user's set language; or (3) the language of the current wiki
# <code>getQid</code> returns (1) the entity-ID, if supplied; or (2) the entity ID of the "category's main topic (P301)"; or (3) the entity ID associated with the current page; or (4) nothing
# <code>followQid</code> given a list of properties, looks for each property in turn and returns the entity-ID of the first value that matches (optionally, returns all entity-IDs that match)
# <code>getGlobe</code> returns the entity-ID of the globe used in P625 (coordinate location), or nil if there isn't one
# <code>getCommonsLink</code> returns one of the following in order of preference: the Commons sitelink of the linked Wikidata item; the Commons sitelink of the topic's main category of the linked Wikidata item;
# <code>siteID</code> returns the root of the globalSiteID, e.g. "en" for "enwiki", "enwikisource", "en-gb", etc.
# <code>projID</code> same as siteID
# <code>location</code> scans from the current location upwards along the chain of higher-level locations, returning each one until it reaches a country
# <code>examine</code> returns a formatted dump of the given property
# <code>url2</code> takes a parameter that is a proper url and formats it for use in an infobox; it accepts its own output as input
# <code>getWebsite</code> fetches the Official website (P856) and formats it for use in an infobox
# <code>checkvalue</code> looks through a property for a given entity-ID as its value and returns that entity-ID if found; otherwise nil
# <code>checkValidity</code> returns whether the first unnamed parameter represents a valid entity-id
# <code>showNoLinks</code> displays the article titles that should not be linked
===Examples of calls===
<nowiki>{{#invoke:WikidataIB |getValue |<PropertyID> |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |onlysourced=<yes/no> |noicon=<yes/no> |df=<dmy/mdy/y> |bc=<BC/BCE> |qual=<ALL/DATES/P999> |list=<ubl/hlist/prose> |linked=<yes/no> |<local parameter>}}</nowiki>
<nowiki>{{#invoke:WikidataIB |getCoords |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |<local parameter>}}</nowiki>
<nowiki>{{#invoke:WikidataIB |getQualifierValue |<PropertyID> |pval=<ID of target value for the property> |qual=<qualifier ID for that target value> |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |onlysourced=<yes/no>}}</nowiki>
<nowiki>{{#invoke:WikidataIB |getValueByQual |<PropertyID> |qualID=<qualifier property ID to match> |qvalue=<QID of target value for the qualifier property> |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |onlysourced=<yes/no>}}</nowiki>
<nowiki>{{#invoke:WikidataIB |getValueByLang |<PropertyID> |lang=<language code to match> |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |onlysourced=<yes/no>}}</nowiki>
== Function getValue ==
=== Parameters to getValue ===
{| class ="wikitable sortable"
|-
! scope="col" | Name
! scope="col" | Alias
! scope="col" | Function
! scope="col" | Default
|-
| (first unnamed)
| 1
| The property-ID whose values are returned. Required.
|
|-
|-
| (second unnamed)
| 2
| A locally supplied value that, if it is not empty, will be returned in preference to the value on Wikidata.
| empty
|-
| qid
|
| The Q-number (entity-ID) of the entity that the property belongs to. If not supplied or empty, defaults to the associated Wikidata entry of the current page – uses [[:mw:Extension:Wikibase Client/Lua #mw.wikibase.getEntityIdForCurrentPage|mw.wikibase.getEntityIdForCurrentPage()]].
| Item id for current page
|-
| eid
|
| An alternative to qid. Except for <code>eid</code>, all parameters to getValue treat nil and the empty string the same. So, setting {{para|x}} gives the same result as omitting the parameter. However, to provide some compatibility with other modules, using {{para|eid}} always returns an empty string, while omitting <code>eid</code> allows <code>qid</code> to work as normal.
| Item id for current page
|-
| rank
|
| [Case insensitive] When set to <code>best</code>, returns preferred values if present, otherwise returns normal values. When set to <code>preferred</code> returns preferred values. When set to <code>normal</code>, returns normal values. When set to <code>deprecated</code> returns deprecated values. Any parameter value beginning with "b" is "best"; beginning with "p" is "preferred"; beginning with "n" is "normal"; beginning with "d" is deprecated. Multiple values are allowed: "p n d" would return all ranks. "Best" overrides the other flags. Other values are ignored and if no ranks are requested, preferred and normal are returned.
| preferred and normal
|-
| qual
|
| A punctuation-separated list of property-IDs of qualifiers that are to be returned in parentheses after the property. Setting <code>qual=ALL</code> returns all qualifiers. Setting <code>qual=DATES</code> returns {{q|P580}} and {{q|P582}} with a date separator.
| none
|-
| qualsonly
| qo
| A boolean which enables the display of just the qualifier(s), without the property value or parentheses. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true.
| false
|-
| fetchwikidata
| fwd
| List of fields to fetch values from. <code>ALL</code> fetches all fields. A value of <code>NONE</code> or blank or omitting the parameter fetches no fields.
| none
|-
| suppressfields
| spf
| List of fields which will never display. This will even force a local value in the field not to display.
| none
|-
| name
|
| Name of the field. When encoding an infobox, this is the name that fetchwikidata and suppressfields will recognise. Required if fetchwikidata or suppressfields is specified (except when <code>fetchwikidata=ALL</code>).
| nil
|-
| onlysourced
| osd
| A boolean which will filter out Wikidata values that are unsourced or only sourced to Wikipedia. [[Wikipedia:Wikidata/2018_Infobox_RfC#Discussion|This 2018 RFC]] requires that Wikidata values displayed in article infoboxes must be sourced. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true.
| true
|-
| df
|
| Date format: may be <code>dmy</code> (day before month) or <code>mdy</code> (month before day) or <code>y</code> (year alone).
| dmy
|-
| qdf
|
| Date format of qualifiers. If omitted, defaults to parameter <code>df</code>, or "y" if <code>df</code> is also omitted.
| value of df or "y"
|-
| bc
|
| Format of the BC/BCE suffix for dates.
| BCE
|-
| plaindate
| pd
| String to modify formatting of dates. Setting "true"/"yes"/"1" disables adding "sourcing cirumstances" (P1480) and any links. Setting "adj" does the same but uses the adjectival form of the date.
| false
|-
| linked
|
| A boolean that enables the link to a local page via its sitelink on Wikidata. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true.
| true
|-
| displaytext
| dt
| A string that overrides the displayed text of a linked item if it is non-empty.
| empty
|-
| shortname
| sn
| A boolean that enables the use of shortname (P1813) instead of label for a linked item. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true.
| false
|-
| uselabel
| uselbl
| A boolean that forces the display of the label instead of the disambiguated sitelink for a linked item. Labels are much more prone to vandalism that sitelinks. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true.
| false
|-
| wdlinks
| wdl
| A boolean that enables the display of links to Wikidata when no local article exists. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true.
| false
|-
| unitabbr
| uabbr
| A boolean that enables unit abbreviations for common units. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true.
| false
|-
| convert
| conv
| A boolean that enables passing of quantities to Template:Cvt. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true.
| false
|-
| showunits
| su
| A boolean that enables showing units for quantities. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true.
| true
|-
| scale
|
| A string that sets scaling for format of quantities. Values are: "a"=automatic; "0"=no scaling; "3"=thousand; "6"=million; "9"=billion; "12"=trillion.
| 0
|-
| maxvals
|
| Sets the maximum number of values to be returned when multiple values are available. Setting it to 1 is useful where the returned string is used within another call, e.g. image. Values <code>0</code> and empty return all values.
| 0 (all)
|-
| collapse
|
| Sets the maximum number of values to be returned before the content is auto-collapsed. Values <code>0</code> and empty allow all content to be displayed uncollapsed.
| 0 (all)
|-
| linkprefix
| lp
| A link prefix that is prepended to the linked value when linked. Applies only to items that have articles and to strings (e.g. url). It triggers linking of strings. Any double-quotes " are stripped out, so that spaces may be passed.
| empty
|-
| linkpostfix
|
| A link postfix that is appended to the linked value when linked. Applies only to items that have articles and to strings (e.g. url). It triggers linking of strings. Any double-quotes " are stripped out, so that spaces may be passed.
| empty
|-
| prefix
|
| A prefix that is prepended to the displayed value of strings (e.g. url). Any double-quotes " are stripped out, so that spaces may be passed.
| empty
|-
| postfix
|
| A postfix that is appended to the displayed value of strings (e.g. url). Any double-quotes " are stripped out, so that spaces may be passed.
| empty
|-
| qlinkprefix
| qlp
| Qualifier link prefix (see linkprefix).
| empty
|-
| qlinkpostfix
|
| Qualifier link postfix (see linkpostfix).
| empty
|-
| qprefix
|
| Qualifier prefix (see prefix).
| empty
|-
| qpostfix
|
| Qualifier postfix (see postfix).
| empty
|-
| sorted
|
| A boolean which enables sorting of the values returned. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true.
| false
|-
| qsorted
|
| A boolean which enables sorting of the qualifier values within each item returned. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true.
| false
|-
| noicon
|
| A boolean which will suppress the trailing "edit at Wikidata" pen-icon. Useful for when the returned value is to be further processed. Values <code>no</code>, <code>false</code> and <code>0</code> are all false (i.e. shows the icon); anything else is true (i.e. suppresses the icon).
| false
|-
| list
|
| The name of a template that the list of multiple values is then passed through. Examples include "cslist", "hlist", "ubl", "blist", "olist", "p-1". A special value, <code>prose</code>, produces "1, 2, 3 and 4".
| none
|-
| sep
|
| Customises the string that is used to separate multiple returned values. Any double-quotes " are stripped out, so that spaces may be passed. If nothing or an empty string is passed it is set to the default list separator (", " in English).
| ", "
|-
| qsep
|
| Customises the string that is used to separate multiple returned qualifier values. Any double-quotes " are stripped out, so that spaces may be passed. If nothing or an empty string is passed it is set to the default list separator (", " in English).
| ", "
|-
| format
|
| Determines whether global coordinates should be rendered as degree/minute/second or as decimal degrees. Any value beginning "dec" (case insensitive) will render as decimal. Anything else will render as DMS.
| dms
|-
| show
|
| Determines how global coordinates should be returned. The value "longlat" will return <code>longitude, latitude</code>. Any other value beginning "lon" (case insensitive) will return just longitude. Any value beginning "lat" (case insensitive) will return just latitude. When used with {{para|noicon|true}}, all of these will be pure numbers in decimal degrees (signed: N and E as positive), which are intended for use in mapping templates, etc. Anything other value (or nothing) will render the usual coordinate values as DMS or decimal with "NSEW" qualifiers, etc.
| empty
|-
| lang
|
| Allows an unlinked value to be returned in the chosen language. Takes a standard ISO language code recognised by MediaWiki. If not supplied or blank, the local language (or set language for multi-lingual wikis) is used as normal.
| local language
|-
| parameterset
| ps
| Convenience parameter to allow commonly used sets of parameters to be specified with a single parameter: ps=1 gets a simple linked value wherever possible; ps=2 represents a plain text value. See [[#Parameter sets|Parameter sets]]
|
|-
| linkredir
|
| Boolean to switch on or off the check for a redirect with the same name as the label when there is no sitelink on Wikidata for the value. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true.
| false
|}
=== Base parameters ===
* getValue can also take a named parameter {{para|qid}} which is the Wikidata ID for an article. This will not normally be used as omitting it defaults to the current article.
* The property whose value is to be returned is passed in the first unnamed property and is required.
* The second unnamed parameter, if supplied, will become the returned value and no call to Wikidata will be made.
=== Whitelist and blacklist ===
* The name of the field that this function is called from is passed in the named parameter {{para|name}}, which is first checked against a blacklist of fields that are never to be displayed, (i.e. the call must return nil in all circumstances). If the field is not on the blacklist, it is then checked against a whitelist. If the name of the field matches, the call will return any locally supplied value if it is supplied as the second unnamed parameter, or the Wikidata value otherwise.
* Specifying {{para|fetchwikidata|ALL}} is a shortcut to return all fields that are not blacklisted.
* The name is compulsory when the blacklist or whitelist is used, so the module returns nil if it is not supplied, other than when {{para|fetchwikidata|ALL}}.
* The blacklist is passed in the named parameter {{para|suppressfields}}
* The whitelist is passed in the named parameter {{para|fetchwikidata}}
=== Sourcing ===
The getValue function will accept a boolean parameter <code>onlysourced</code> which will suppress return of Wikidata values that are unsourced or only sourced to a Wikimedia project. The absence of the parameter, an empty parameter ({{para|onlysourced}}) and the empty string (<code>""</code>) all default to true (i.e. only referenced values are returned). The values <code>no</code>, <code>false</code> and <code>0</code> are treated as false (i.e. all values are returned); any other value is true (although {{para|onlysourced|yes/no}} is recommended for readability).
=== Link to Wikidata ===
The getValue function will accept a boolean parameter <code>noicon</code> which will suppress the trailing "edit at Wikidata" icon and link for cases when the returned value is to be further processed by the infobox (e.g. a url). The absence of the parameter or an empty parameter ({{para|noicon}}) default to false (i.e. the icon is added). The empty string (<code>""</code>) and the values <code>no</code>, <code>false</code> and <code>0</code> are treated as false; any other value is true (although {{para|noicon|true}} is recommended for readability).
Following a discussion at [[Module talk:WikidataIB #Visibility of pen icon]], the pen icon is hidden from users who are not autoconfirmed. This means that most readers don't see the pen icon, and represents a balance between aesthetics and vandalism at Wikidata on the one hand, and the desire to encourage editing Wikidata on the other.
=== Dates ===
In order to handle the requirement for dates in mdy, dmy or just year formats, getValue accepts a named parameter {{para|df}} that may take the values "dmy", "mdy", or "y" - default is "dmy".
As an article may require either of suffixes BC and BCE, getValue accepts a named parameter {{para|bc}} that may take the values "BC", or "BCE" - default is "BCE". Some test cases are shown at [[Module talk:WikidataIB/testing #Calls to getValue for dates]].
=== Ranks ===
The {{para|rank}} parameter, when set to preferred, returns only preferred values; when set to normal, returns only normal values; when set to deprecated, returns only deprecated values. If the parameter is set to best, it returns preferred values if present, otherwise normal values. Any parameter value beginning with "p" is "preferred"; any parameter value beginning with "n" is "normal"; any parameter value beginning with "d" is "deprecated"; any parameter value beginning with "b" is "best". Combinations of values are allowed, e.g. {{para|rank|p n}} returns all the preferred and normal values (which is the default), although "best" overrides any other parameters.
==== Specific value-type handlers ====
The module has specific handlers for the following data types:
# Items that correspond to an article in some Wikipedia, called "wikibase-items". These will be linked to the corresponding (and disambiguated) article on English Wikipedia where possible.
# Items that represent dates. These may be centuries, years, years and months, or years, months and days.
# Items that represent Commons media, urls, external ids, or other sorts of plain text.
# Items that represent quantities. All of these may have an associated unit, or be dimensionless, and may have a range.
# Items that represent global coordinates. These will be in degrees of latitude and longitude and will have an associated precision.
Items that represent other types of data are not handled at present.
The third class of data types may be used with the parameters:
* {{para|prefix}}, {{para|postfix}}, {{para|linkprefix}}, {{para|linkpostfix}}
If you don't supply at least one of {{para|linkprefix}} or {{para|linkpostfix}}, then just {{para|prefix}} and {{para|postfix}} are used. For example, when getting the {{Q|P717}} in {{Q|Q532127|}}:
* <code><nowiki>{{#invoke:WikidataIB/sandbox|getValue|P717|fetchwikidata=ALL|onlysourced=no |prefix="before " |postfix=" after" |qid=Q532127}}</nowiki></code> → {{#invoke:WikidataIB/sandbox |getValue |P717 |fetchwikidata=ALL|onlysourced=no |prefix="before " |postfix=" after" |qid=Q532127}}
Use double-quotes to enclose the parameter value if it has leading or trailing spaces (otherwise they are stripped out). If you supply {{para|linkprefix}} or {{para|linkpostfix}}, then all four parameters are used and a link is made for each value like this:
* <code><nowiki>[[ linkprefix WikidataValue1 linkpostfix | prefix WikidataValue1 postfix]], [[ linkprefix WikidataValue2 linkpostfix | prefix WikidataValue2 postfix]], etc.</nowiki></code>
That allows multiple links to be made to different sections of a list article, such as [[List of observatory codes]]. For example, when getting the {{Q|P717}} in {{Q|Q532127|}} we can make the links:
*<code><nowiki>{{#invoke:WikidataIB/sandbox|getValue|P717|fetchwikidata=ALL|onlysourced=no |prefix= |postfix= |linkprefix="List of observatory codes#" |linkpostfix= |qid=Q532127}}</nowiki></code> → {{#invoke:WikidataIB/sandbox|getValue|P717|fetchwikidata=ALL|onlysourced=no |prefix= |postfix= |linkprefix="List of observatory codes#" |linkpostfix= |qid=Q532127}}
The parameters {{para|prefix}}, {{para|postfix}}, {{para|linkprefix}}, {{para|linkpostfix}} are also applied to wikibase-items if they are linked.
==== Formatting multiple returned values ====
* {{para|sorted|<yes{{!}}no>}} is a boolean passed to enable sorting of the values returned. No parameter, or an empty string, or "false", or "no", or "0" disables sorting. It's only a very dumb alphabetical sort and sorts linked values as "[[ ..."
* {{para|sep|<separator characters>}} allows the separator between multiple returned values to be defined. The default is <code>", "</code> (comma plus normal space). If the separator has leading or trailing spaces, enclose it in double quotes (e.g. {{para|sep|" - "}}). Any double quotes are stripped from the separator. The pipe character (<code>|</code>) must be escaped as <code><nowiki>{{!}}</nowiki></code>. For reasons of accessibility (see [[MOS:PLIST]]), do not use {{para|sep|<br>}} for vertical unbulleted lists; use {{para|list|ubl}} instead.
* {{para|list|<prose{{!}}cslist{{!}}hlist{{!}}ubl{{!}}blist{{!}}olist>}} allows multiple returned values to be displayed as a sentence with last two values separated by "and" ({{para|list|prose}}), a horizontal comma-separated list ({{para|list|cslist}}, not to be used in prose), a horizontal list ({{para|list|hlist}}), a vertical unbulleted list ({{para|list|ubl}}), a vertical bulleted list ({{para|list|blist}}), or a vertical ordered list ({{para|list|olist}}). These override the separator and do not display the 'pen icon' linked to "Edit at Wikidata".
* {{para|list|p-1}} displays the last value. Combine with {{para|maxvals|''n''}} to display the ''n''th value.
=== Limiting the returned values ===
Sometimes a property is expected to have a single value, such as {{q|P18}}, but may have multiple values on Wikidata. Setting {{para|maxvals|1}} will limit the number of values returned to 1. Any other value is possible and functions as expected, but zero is treated as "no limit".
=== Unlinking ===
A returned value that represents an article on the local wiki will be linked by default. This includes redirects, but not dab pages. Sometimes there is a need not to link that returned values and this may be accomplished by setting {{para|linked|no}}.
=== Unit abbreviations ===
When the returned value is a quantity, the name of the units in which it is expressed is appended. Infoboxes may wish to use abbreviations instead for common units. This can be done by setting {{para|unitabbr|true}}.
=== Qualifiers ===
A parameter {{para|qual}} may be supplied, which will return qualifiers of the required property, if they exist. If the value is set to a punctuation-separated list of property-IDs (e.g. P123, P456), then only the values of qualifiers with that property will be returned. If the value is set to {{para|qual|ALL}}, then all of the qualifier values are returned. If the value is set to {{para|qual|DATES}} then the {{q|P580}} and the {{q|P582}} of the property are returned with a date separator. In each case, any qualifier values returned follow the property value, and are enclosed in parentheses. If multiple qualifier values are returned, they will be separated by commas by default, although the separator can be changed by specifying {{para|qsep}} (which may be enclosed in double-quotes, which are stripped out, so that spaces can be included). Setting the parameter {{para|qsorted|yes}} will sort the returned qualifier values alphanumerically.
=== Short form of parameters ===
Some of the longer parameters may be abbreviated to make infobox designs more compact:
* <code>fwd → fetchwikidata</code>
* <code>osd → onlysourced</code>
* <code>spf → suppressfields</code>
* <code>wdl → wdlinks</code>
=== Parameter sets ===
Generally, <code>getValue</code> has a set of defaults for its parameters that represent consensus decisions by editors. For example, {{para|onlysourced}} defaults to <code>true</code> so only Wikidata values that are sourced to something better than "Wikipedia" will be returned, and {{para|fetchwikidata}} defaults to <code>none</code> so nothing is returned until it is enabled by setting some field names or "ALL". This represents the fail-safe condition and allows infoboxes to be made Wikidata-capable without changing any article until enabled ''for that article''.
To simplify the use of <code>getValue</code> in other circumstances, common combinations of parameters can be specified with {{para|parameterset}} or its alias {{para|ps}} for convenience. Two combinations are implemented at present and these are:
;ps=1 : a common set of overrides to get a simple value, linked where possible:
<pre>
|rank ="best"
|fetchwikidata="ALL"
|onlysourced ="no"
|noicon ="true"
</pre>
;ps=2 : a sort of raw value in plain text:
<pre>
|rank = "best"
|fetchwikidata = "ALL"
|onlysourced = "no"
|noicon = "true"
|linked = "no"
|plaindate = "true"
</pre>
Other sets could be created if there is a demand.
=== Wrapper template ===
The template {{tl|wdib}} can be used as a convenient wrapper for <code><nowiki>{{#invoke:WikidataIB |getValue}}</nowiki></code>.
== Other main functions ==
=== Function getPreferredValue ===
The getPreferredValue function works exactly like getValue, taking the same parameters, but if any values for a property have the preferred rank set, it will only return those values. This is now deprecated in favour of <code>getValue|rank=best</code>.
=== Function getCoords ===
* getCoords can also take a named parameter {{para|qid}} which is the Wikidata ID for an article. This will not normally be used as omitting it defaults to the current article.
* The first unnamed parameter, if supplied, will become the returned value and no call to Wikidata will be made.
* The coordinates from Wikidata are parsed and passed to [[Template:Coord]] which returns the display as if it were called manually.
* The blacklist of fields that are never to be displayed, and the whitelist are implemented in the same way as for getValue using {{para|suppressfields}} and {{para|fetchwikidata}}
* The <code>format</code> parameter sets the display format to decimal or dms. Any value beginning with "dec" sets decimal; anything else sets dms.
* The <code>display</code> parameter sets the display position to "inline", "title" or "inline, title". Default is nothing (so uses default for {{tl|Coord}}, currently "inline").
=== Function getQualifierValue ===
The getQualifierValue function is for use when we want to fetch the value of a qualifier. We need to know the property and the value of the property that the qualifier relates to. The parameters are:
* The property ID passed in the unnamed parameter (or {{para|1}})
* The target value for that property in {{para|pval}}
* The qualifier ID for that target value in {{para|qual}}
* The same parameters to implement whitelisting and blacklisting of the property as in getValue
* Optional boolean to specify whether only sourced values of the property are returned (defaults to "no") in {{para|onlysourced}}
* Optional item ID for arbitrary access in {{para|qid}}
* The same parameters to format output as in getValue
==== Example of getQualifierValue ====
In {{Q|Q1513315}} there is a property {{Q|P793}}, which has a value {{Q|Q385378}}. That has two qualifiers, {{Q|P580}} and {{Q|P582}}. To get the start date:
* <code><nowiki>{{#invoke:WikidataIB |getQualifierValue |qid=Q1513315 |P793 |pval=Q385378 |qual=P580 |name=xyz |fetchwikidata=ALL }}</nowiki></code>
In [[South Pole Telescope]] it returns:
* {{#invoke:WikidataIB |getQualifierValue |P793 |pval=Q385378 |qual=P580 |name=xyz |fetchwikidata=ALL |qid=Q1513315}}
=== Function getValueByQual ===
The getValueByQual function returns the value of a property which has a qualifier with a given entity value. The parameters are:
* The property ID passed in the unnamed parameter (or {{para|1}})
* The property ID for a qualifier (or "ALL" or "DATES") in {{para|qualID}}
* The Wikibase-entity ID of a value for that qualifier in {{para|qvalue}}
* The same parameters to implement whitelisting and blacklisting of the property as in getValue
* Optional boolean to specify whether only sourced values of the property are returned (defaults to "no") in {{para|onlysourced}}
* Optional item ID for arbitrary access in {{para|qid}}
* The same parameters to format output as in getValue
==== Example of getValueByQual ====
In {{Q|Q10990}} there is a property {{Q|P443}} that has multiple values, each of which has a qualifier {{Q|P407}}. We can return the property value whose qualifier has the value {{Q|Q7979}}
* <code><nowiki>{{#invoke:WikidataIB |getValueByQual |qid=Q10990 |P443 |qualID=P407 |qvalue=Q7979 |fwd=ALL |osd=no |noicon=true}}</nowiki></code> → {{#invoke:WikidataIB/sandbox |getValueByQual |qid=Q10990 |P443 |qualID=P407 |qvalue=Q7979 |fwd=ALL |osd=no |noicon=true}}
=== Function getValueByLang ===
The getValueByLang function returns the value of a property which has a qualifier {{Q|P407}} whose value has the given language code. The parameters are:
* The property ID passed in the unnamed parameter (or {{para|1}})
* The {{Q|P424}} to match the language whose code is given by {{para|lang|xx[-yy]}}. If no code is supplied, it uses the default language.
* The same parameters to implement whitelisting and blacklisting of the property as in getValue
* Optional boolean to specify whether only sourced values of the property are returned (defaults to "no") in {{para|onlysourced}}
* Optional item ID for arbitrary access in {{para|qid}}
* The same parameters to format output as in getValue
==== Example of getValueByLang ====
In {{Q|Q7565108}} there is a property {{Q|P856}} that has multiple values, each of which has a qualifier {{Q|P407}}. We can return the property value whose {{Q|P407}} qualifier value (a WD item) itself has the {{Q|P424}} property that is "ja", i.e, {{Q|Q5287}}
* <code><nowiki>{{#invoke:WikidataIB |getValueByLang |qid=Q7565108 |P856 |lang=ja |fwd=ALL |osd=no |noicon=true}}</nowiki></code> → {{#invoke:WikidataIB |getValueByLang |qid=Q7565108 |P856 |lang=ja |fwd=ALL |osd=no |noicon=true}}
If {{para|lang}} is unspecified, we can obtain the same value with the default language (here that is the {{Q|Q1860}} and its {{Q|P424}} is "en")
* <code><nowiki>{{#invoke:WikidataIB |getValueByLang |qid=Q7565108 |P856 |fwd=ALL |osd=no |noicon=true}}</nowiki></code> → {{#invoke:WikidataIB |getValueByLang |qid=Q7565108 |P856 |fwd=ALL |osd=no |noicon=true}}
== Utility functions ==
=== Function getLink ===
getLink has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
If there is a sitelink to an article on the local Wiki, it returns a link to the article with the Wikidata label as the displayed text.
If there is no sitelink, it returns the label as plain text.
If there is no label in the local language, it displays the qid instead.
: Wikidata: {{q|Q29016906}} and {{q|Q3621491}}
* <code><nowiki>{{#invoke:WikidataIB |getLink |Q29016906}}</nowiki></code> → {{#invoke:WikidataIB |getLink |Q29016906}}
* <code><nowiki>{{#invoke:WikidataIB |getLink |Q3621491}}</nowiki></code> → {{#invoke:WikidataIB |getLink |Q3621491}}
=== Function getLabel ===
getLabel has the qid of a Wikidata entity passed as the first unnamed parameter or as {{para|qid}}
It returns the Wikidata label in the local language for an item by the given qid.
If there is no label in the local language, it returns the qid instead.
Note that this is the label given to the Wikidata entry in the same language as the current Wiki, if the label exists.
: Wikidata: {{q|Q29016906}} and {{q|Q3621491}}
* <code><nowiki>{{#invoke:WikidataIB |getLabel |Q29016906}}</nowiki></code> → {{#invoke:WikidataIB |getLabel |Q29016906}}
* <code><nowiki>{{#invoke:WikidataIB |getLabel |Q3621491}}</nowiki></code> → {{#invoke:WikidataIB |getLabel |Q3621491}}
* <code><nowiki>{{#invoke:WikidataIB |getLabel |Q19805408}}</nowiki></code> → {{#invoke:WikidataIB |getLabel |Q19805408}}
=== Function label ===
label has the qid of a Wikidata entity passed as the first unnamed parameter or as {{para|qid}}
It returns the Wikidata label in the local language for an item by the given qid or linked to the current page.
If there is no label in the local language, it returns an empty string.
Note that this is the label given to the Wikidata entry in the same language as the current Wiki, if the label exists.
: Wikidata: {{q|Q29016906}} and {{q|Q3621491}}
* <code><nowiki>{{#invoke:WikidataIB |label |Q29016906}}</nowiki></code> → {{#invoke:WikidataIB |label |Q29016906}}
* <code><nowiki>{{#invoke:WikidataIB |label |Q3621491}}</nowiki></code> → {{#invoke:WikidataIB |label |Q3621491}}
* <code><nowiki>{{#invoke:WikidataIB |label |Q19805408}}</nowiki></code> → {{#invoke:WikidataIB |label |Q19805408}}
=== Function getAT ===
getAT has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
If there is a sitelink to an article on the local Wiki, it returns the sitelink as plain text, i.e. the article title.
If there is no sitelink, it returns nothing.
Note that this is the title of the article in the current Wikipedia, if the interlanguage link exists in the Wikidata entry.
: Wikidata: {{q|Q29016906}} and {{q|Q3621491}}
* <code><nowiki>{{#invoke:WikidataIB |getAT |Q29016906}}</nowiki></code> → {{#invoke:WikidataIB |getAT |Q29016906}}
* <code><nowiki>{{#invoke:WikidataIB |getAT |Q3621491}}</nowiki></code> → {{#invoke:WikidataIB |getAT |Q3621491}}
=== Function getDescription ===
getDescription has the qid of a Wikidata entity passed as |qid= (it defaults to the associated qid of the current article if omitted).
It has a local parameter passed as the first unnamed parameter.
Any local parameter passed (other than "Wikidata" or "none") becomes the return value.
It returns the article description for the Wikidata entity in plain text if the local parameter is "Wikidata".
Nothing is returned if the description doesn't exist or "none" is passed as the local parameter.
: Wikidata: {{q|Q29016906}} and {{q|Q3621491}}
* <code><nowiki>{{#invoke:WikidataIB |getDescription |qid=Q29016906 |wikidata}}</nowiki></code> → {{#invoke:WikidataIB |getDescription |qid=Q29016906 |wikidata}}
* <code><nowiki>{{#invoke:WikidataIB |getDescription |qid=Q29016906 |A painting}}</nowiki></code> → {{#invoke:WikidataIB |getDescription |qid=Q29016906 |A painting}}
* <code><nowiki>{{#invoke:WikidataIB |getDescription |qid=Q29016906 |none}}</nowiki></code> → {{#invoke:WikidataIB |getDescription |qid=Q29016906 |none}}
* <code><nowiki>{{#invoke:WikidataIB |getDescription |qid=Q3621491 |wikidata}}</nowiki></code> → {{#invoke:WikidataIB |getDescription |qid=Q3621491 |wikidata}}
* <code><nowiki>{{#invoke:WikidataIB |getDescription |qid=Q3621491 |A profession}}</nowiki></code> → {{#invoke:WikidataIB |getDescription |qid=Q3621491 |A profession}}
* <code><nowiki>{{#invoke:WikidataIB |getDescription |qid=Q3621491 |none}}</nowiki></code> → {{#invoke:WikidataIB |getDescription |qid=Q3621491 |none}}
=== Function formatDate ===
formatDate accepts a datetime of the usual format from mw.wikibase.entity:formatPropertyValues, like "1 August 30 BCE" as parameter 1 and formats it according to the df (date format) and bc parameters.
* <code><nowiki>{{#invoke:WikidataIB |formatDate | 1 August 30 BCE |bc=BCE |df=dmy}}</nowiki></code> → {{#invoke:WikidataIB |formatDate | 1 August 30 BCE |bc=BCE |df=dmy}}
* <code><nowiki>{{#invoke:WikidataIB |formatDate | 1 August 30 BCE |bc=BC |df=mdy}}</nowiki></code> → {{#invoke:WikidataIB |formatDate | 1 August 30 BCE |bc=BC |df=mdy}}
* df = "dmy" / "mdy" / "y" - default is "dmy"
* bc = "BC" / "BCE" - default is "BCE"
=== Function checkBlacklist ===
checkBlacklist allows a test to check whether a named field is allowed.
It returns true if the field is not blacklisted (i.e. allowed)
It returns false if the field is blacklisted (i.e. disallowed)
Example:
* <code><nowiki>{{#if:{{#invoke:WikidataIB |checkBlacklist |name=nationality |suppressfields=residence; nationality; citizenship}} | not blacklisted | blacklisted}}</nowiki></code> → {{#if:{{#invoke:WikidataIB |checkBlacklist |name=nationality |suppressfields=residence; nationality; citizenship}} | not blacklisted | blacklisted}}
* <code><nowiki>{{#if:{{#invoke:WikidataIB |checkBlacklist |name=birth_place |suppressfields=residence; nationality; citizenship}} | not blacklisted | blacklisted}}</nowiki></code> → {{#if:{{#invoke:WikidataIB |checkBlacklist |name=birth_place |suppressfields=residence; nationality; citizenship}} | not blacklisted | blacklisted}}
=== Function emptyor ===
emptyor returns nil if its first unnamed argument is just punctuation, whitespace or html tags otherwise it returns the argument unchanged (including leading/trailing space).
If the argument could contain "=", then it must be called explicitly:
* <code><nowiki>| 1 = whatever-the-argument-is</nowiki></code>
In that case, leading and trailing spaces are trimmed.
It finds use in infoboxes where it can replace tests like:
* <code><nowiki>{{#if: {{#invoke:WikidataIB |getvalue |P99 |fwd=ALL}} | <span class="xxx">{{#invoke:WikidataIB |getvalue |P99 |fwd=ALL}}</span> | }}</nowiki></code>
with a form that uses just a single call to Wikidata:
* <code><nowiki>{{#invoke |WikidataIB |emptyor |1= <span class="xxx">{{#invoke:WikidataIB |getvalue |P99 |fwd=ALL}}</span> }}</nowiki></code>
=== Function labelorid ===
labelorid is a public function to expose the output of labelOrId().
The Q-number (entity ID) is passed as |qid= or as an unnamed parameter.
It returns the Wikidata label for that entity or the qid if no label exists.
=== Function getQid ===
* getQid works with the current page and its associated Wikidata entry.
* It returns qid, if supplied as the first unnamed parameter or as {{para|qid}};
* failing that, the Wikidata entity ID of the "category's main topic (P301)", if it exists;
* failing that, the Wikidata entity ID associated with the current page, if it exists;
* otherwise, nothing
=== Function examine ===
examine provides a dump of the entire property given in the first unnamed parameter (or in {{para|pid}} as a named alias) from the item given by the parameter 'qid', or from the item corresponding to the current page if qid is not supplied. Both parameters may be unnamed and given in any order.
It works in a similar manner to the [[Module:Wikidata|Dump]] function, but only loads a single claim, rather than the whole Wikidata entry.
* Example: <code><nowiki>{{#invoke:WikidataIB |examine |qid=Q1396889 |P50}}</nowiki></code>
There is a [[Template:Examine]] which acts as a wrapper for the call.
* Example: <code><nowiki>{{examine |Q4048254 |P31}}</nowiki></code> →
{{examine |Q4048254 |P31}}
=== Function url2 ===
url2 takes a parameter url= that is a proper url and formats it for use in an infobox.
Examples:
{{nowiki template demo|prefix=#|format=inline|output=nowiki+|code=<nowiki>{{#invoke:WikidataIB |url2 |url= http://www.example.com/ }}</nowiki>
}}{{nowiki template demo|prefix=#|format=inline|output=nowiki+|code=<nowiki>{{#invoke:WikidataIB |url2 |url= http://www.example.com/path/ }}</nowiki>
}}{{nowiki template demo|prefix=#|format=inline|output=nowiki+|code=<nowiki>{{#invoke:WikidataIB |url2 |url= {{wdib |P856 |qid=Q23317 |fwd=ALL |osd=no}} }}</nowiki>
}}{{nowiki template demo|prefix=#:|format=inline|output=nowiki+|code=<nowiki>{{wdib |P856 |qid=Q23317 |fwd=ALL |osd=no}}</nowiki>
}}{{nowiki template demo|prefix=#|format=inline|output=nowiki+|code=<nowiki>{{#invoke:WikidataIB |url2 |url= {{url|http://www.example.com/}} }}</nowiki>
}}
Comparison with output of {{tl|URL}}:
{{nowiki template demo|prefix=#|format=inline|output=nowiki+|code=<nowiki>{{URL | http://www.example.com/ }}</nowiki>
}}{{nowiki template demo|prefix=#|format=inline|output=nowiki+|code=<nowiki>{{URL | http://www.example.com/path/ }}</nowiki>
}}{{nowiki template demo|prefix=#|format=inline|output=nowiki+|code=<nowiki>{{URL | {{wikidata|property|Q23317|P856}} }}</nowiki>
}}{{nowiki template demo|prefix=#:|format=inline|output=nowiki+|code=<nowiki>{{wikidata|property|Q23317|P856}}</nowiki>}}
==== See also ====
* {{ml|URL|url}} & {{ml|URL|url2}}
== Coding into an infobox ==
Typically, the getValue call will be invoked in an infobox definition, using appropriate template parameters. One simple implementation is given as an example in [[:Template:Infobox book/Wikidata/Sandbox]]. As an illustration, the 'author' field in the infobox is coded like this:
<pre style="line-height:1.2em;">
| label2 = Author{{#if:{{{authors|}}}|s}}
| data2 = {{#invoke:WikidataIB |getValue |P50 |name=author |fetchwikidata={{{fetchwikidata|}}} |suppressfields={{{suppressfields|}}} |{{{authors|{{{author|}}}}}} }}
</pre>
The property to be fetched is the first unnamed parameter. In this case it is {{Q|P50}}.
The name of the field is passed in {{para|name}} and that name is checked against the blacklist and the whitelist. To always suppress the author field in a particular article, an editor will set {{para|suppressfields|author}} in the infobox. The author field will then never be displayed.
If the field is not blacklisted, then the infobox can be set to display a locally supplied value for author simply by setting {{para|author|[[George Orwell]]}}, for example, in the infobox. It also accepts {{para|authors}}. If the name of the field is on the whitelist, e.g. {{para|fetchwikidata|author; genre; pub_date; pages; dewey; congress}}, ''and'' the local value is not supplied, then the infobox will display the value retrieved from Wikidata. Any separators can be used, except | and {}.
As a shorthand, {{para|fetchwikidata|ALL}} will fetch all of the fields that are not blacklisted, as long as no local value is already provided in the article for a given field.
Since Wikidata labels are normally lower case, the ucfirst function from [[Module:String2]] can be used to capitalise the first letter of the returned text, e.g.
* <code><nowiki>{{#invoke:String2 | ucfirst | {{#invoke:WikidataIB |getValue |P136 |name=genre |fetchwikidata=ALL |onlysourced=false}} }}</nowiki></code> in {{Q|Q1396889}} produces:
* {{#invoke:String2 | ucfirst | {{#invoke:WikidataIB |getValue |P136 |name=genre |fetchwikidata=ALL |onlysourced=false |qid=Q1396889}} }}
=== Example of calls in an infobox ===
Basic use of getValue:
*<code><nowiki>{{#invoke:WikidataIB |getValue |P000 |name=fieldname |qid={{{qid|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced={{{onlysourced|}}} |{{{localparameter|}}} }}</nowiki></code>
Full collection of parameters:
*<code><nowiki>{{#invoke:WikidataIB |getValue |P000 |name=fieldname |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced={{{onlysourced|}}} |noicon={{{noicon|}}} |wdl={{{wikidatalink|}}} |df={{dateformat|}} |bc={{{bc|}}} |prefix= |postfix= |linkprefix= |linkpostfix= |sorted={{{sorted|}}} |sep={{{separator|}}} |list={{listtype|}}} |{{{localparameter|}}} }}</nowiki></code>
Any of the parameters can, of course, be fixed for a given field in an infobox, rather than taking the parameter supplied to the infobox, which will affect all fields. For example, one field may set {{para|list|hlist}} where a series of short words is expected; whereas another field could use {{para|list|ubl}} where an unbulleted vertical list of several words on each line is required.
=== Coordinates ===
The getCoords call will display the output of [[Template:Coord]] when supplied with the coordinates returned from Wikidata. It can be coded like this:
<pre style="line-height:1.2em;">
|label20 = Coordinates
| data20 = {{#invoke:WikidataIB |getCoords |name=coordinates |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{coordinates|}}} }}
</pre>
An example is [[Template:Infobox biosphere reserve]]
<pre style="line-height:1.2em;">
{{Infobox biosphere reserve
| fetchwikidata = ALL
}}
</pre>
Displays coordinates in the usual positions when used in an article where Wikidata has coordinates.
=== Upgrading existing infoboxes ===
Since the parameter {{para|fetchwikidata}} is needed for any Wikidata functionality, an existing infobox may be replaced by an infobox incorporating these calls without any change whatsoever to any article. Each article using the new infobox can later be enabled by supplying {{para|fetchwikidata|ALL}}, or a list of required fields for that article. At that point, the onus is on the editor enabling the functionality to check that no unwanted fields are now being displayed. If so, they can be added to a blacklist for the article by setting {{para|suppressfields}} to the list of unwanted fields.
=== Verifiability ===
Where it will always be essential for a particular field to only contain values that are referenced, use <code>getValue</code>, making sure that {{para|onlysourced}} is ''not'' set to 'false', '0' or 'no'. By default it will exclude values that are unsourced or only sourced to a Wikipedia, thus making the job of checking easier at the article level. If unsourced data is acceptable (!), set {{para|onlysourced|no}}. As it is beyond my wit to produce an automated mechanism that knows whether an existing source is reliable or not in a given context, that job must still be performed at the article level by an editor familiar with the subject. It should always be done when first enabling Wikidata for that article.
=== Helper templates ===
; [[Template:If then show]] : tests whether the first unnamed parameter is not an empty string and returns it if it isn't. Otherwise it returns the second unnamed parameter. Optional third and fourth unnamed parameters provide a prefix and a suffix for the first parameter when returned. Useful when the first parameter is a call to Wikidata.
; [[Template:Ifnoteq then show]] : tests whether the first unnamed parameter is equal to the second unnamed parameter and returns the third unnamed parameter if it does. Otherwise it returns the first unnamed parameter. This is useful when the first parameter is a <code><nowiki>{{#invoke:</nowiki></code> of a Lua module that returns a value for which a specific exception is required.
; [[Template:If then wikilink]] : tests whether the first unnamed parameter is not an empty string and if it isn't, it returns the parameter formatted as piped wiki-link using an optional namespace prefix.
; [[Template:Formatter link]] : takes an external identifier code as {{para|code}} and uses a formatter url as {{para|url}} to construct a link to the external resource, which uses the code as display.
; [[Template:Emptyor]] : tests a piece of text to ascertain whether it's effectively empty or contains some text. If the unnamed parameter consists only of html tags, punctuation (e.g. wiki markup) and whitespace, then Emptyor returns nothing; otherwise it returns the parameter unchanged. Wrapper for p.emptyor function.
== Example of use: Infobox book ==
This section is taken from [[Template:Infobox book/Wikidata/Sandbox/doc]].
=== No Wikidata ===
<pre style="line-height:1.2em;">
{{Infobox book/Wikidata/Sandbox
| suppressfields =
| fetchwikidata =
| name = Animal Farm
| title_orig = Animal Farm: A Fairy Story
| image = Animal Farm - 1st edition.jpg
| image_size = 200px
| caption = First edition cover
| author = [[George Orwell]]
| country = United Kingdom
| language = English
| genre = Political satire
}}
</pre>
Works as a non-aware infobox: only locally supplied parameters are displayed.
<pre style="line-height:1.2em;">
{{Infobox book/Wikidata/Sandbox
| name = Animal Farm
| title_orig = Animal Farm: A Fairy Story
| image = Animal Farm - 1st edition.jpg
| image_size = 200px
| caption = First edition cover
| author = [[George Orwell]]
| country = United Kingdom
| language = English
| genre = Political satire
}}
</pre>
The blacklist and whitelist can be omitted if unused
=== All Wikidata ===
<pre style="line-height:1.2em;">
{{Infobox book/Wikidata/Sandbox
| fetchwikidata = author; genre; pub_date; pages; dewey; congress
}}
</pre>
Fetches the author, publication date, number of pages, Dewey index, and Library of Congress catalogue number values from Wikidata.
<pre style="line-height:1.2em;">
{{Infobox book/Wikidata/Sandbox
| fetchwikidata = ALL
}}
</pre>
As shorthand, the {{para|fetchwikidata}} parameter can be set to ALL to fetch all available fields.
Any field can be suppressed by naming it in {{para|suppressfields}}, or overridden by supplying a local value.
=== Never display genre ===
<pre style="line-height:1.2em;">
{{Infobox book/Wikidata/Sandbox
| suppressfields = genre
| fetchwikidata = author; genre; pub_date; pages; dewey; congress
}}
</pre>
The genre field will always be suppressed, even if a local value is supplied.
<pre style="line-height:1.2em;">
{{Infobox book/Wikidata/Sandbox
| suppressfields = genre
| fetchwikidata = author; genre; pub_date; pages; dewey; congress
| genre = Political satire
}}
</pre>
=== Local override ===
<pre style="line-height:1.2em;">
{{Infobox book/Wikidata/Sandbox
| fetchwikidata = author; genre; pub_date; pages; dewey; congress
| genre = Political satire
}}
</pre>
The genre field is set to display "Political satire", no matter what is stored in Wikidata.
<pre style="line-height:1.2em;">
{{Infobox book/Wikidata/Sandbox
| fetchwikidata = ALL
| genre = Novel
}}
</pre>
The genre field is set to display "Novel", no matter what is stored in Wikidata.
=== Don't fetch genre ===
<pre style="line-height:1.2em;">
{{Infobox book/Wikidata/Sandbox
| suppressfields =
| fetchwikidata = author; pub_date; pages; dewey; congress
}}
</pre>
The genre field will not be fetched from Wikidata. Only the author, publication date, number of pages, Dewey index, and Library of Congress catalogue number are imported. A local value for genre will display.
== Exporting the module ==
WikidataIB has been developed to run on any language wiki (or Wikimedia project) with a minimum of modification. An optional sub-module [[Module:WikidataIB/i18n]] may be created to replace the values for error messages, ordinal suffixes etc. as shown in the local i18n definitions in the module. Although the same result can be arrived at by directly editing those values in WikidataIB, using the sub-module will allow an updated version of WikidataIB to directly replace the older module without having to re-edit the i18n definitions.
=== Linked items ===
If the target Wiki has a convention that certain items are not normally linked (see [[:en:Wikipedia:Manual of Style/Linking #What generally should not be linked]] for an example), then a sub-module [[Module:WikidataIB/nolinks]] can be created to list items that should not be linked, using the English Wikipedia sub-module as an exemplar.
=== Italic titles ===
If the target Wiki has a convention that certain works should be italicised or quoted (see [[:en:Wikipedia:Manual of Style/Text formatting #Names and titles]] for an example), then a sub-module [[Module:WikidataIB/titleformats]] can be created to list items that should be italicised or quoted, using the English Wikipedia sub-module as an exemplar.
=== Complex date ===
Most of the output from the module will use the local language (or any user-specified one on multi-lingual wikis) where the sitelink or label exists on Wikidata. However, dates are more complicated and not handled perfectly in all languages. To solve this, WikidataIB uses [[Module:Complex date]] – developed on Commons by {{u|Jarekt}} – which allows expansion to support a wider variety of languages. As a result, it is necessary to install Complex date and its dependencies alongside WikidataIB when installing on another Wikimedia project.
==== Complex date dependencies ====
[[Module:Complex_date]] relies on the following modules:
* [[Module:Calendar]] (lazy loading with no dependencies)
* [[Module:ISOdate]]
** [[Module:DateI18n]] (no dependencies)
*** [[Module:No globals]] (from en.wikipedia)
* [[Module:i18n/complex date]]
** [[Module:Ordinal]] (lazy loading)
*** [[Module:I18n/ordinal]] (no dependencies)
*** [[Module:Yesno]] (from en.wikipedia) (no dependencies)
*** [[Module:Formatnum]] (no dependencies)
** [[Module:Roman]] (lazy loading with no dependencies)
** [[Module:Linguistic]] (lazy loading with no dependencies)
*** [[Module:No globals]] (from en.wikipedia)
Unless otherwise noted, the authoritative version of each module can be found on [https://commons.wikimedia.org/ Commons] although the versions on English Wikipedia are usually kept in sync.
==See also==
* [[Module:Wikidata]], handling Wikidata more basically
* [[Template:WikidataOI]], a template that uses [[Module:Wd]] but also has and "opt-in" options {{para|fetch}} and {{para|ifeq}} similar to this module's {{para|fetchwikidata}} or {{para|fwd}}
==Tracking categories==
* {{clc|Articles with missing Wikidata information}}
{{Wikidata infoboxes}}
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Wikidata modules]]
}}</includeonly>
p668r3ztbv9cnzq3zu401uo6ilbi54s
Modul:Wikidata Infobox
828
386864
2444286
2022-08-13T13:31:08Z
David Wadie Fisher-Freberg
51
new
Scribunto
text/plain
local p = {}
local WikidataIB = require("Module:WikidataIB")
-- Code from 'Module:No globals'
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
if k ~= 'arg' then
error('Tried to read nil global ' .. tostring(k), 2)
end
return nil
end
function mt.__newindex(t, k, v)
if k ~= 'arg' then
error('Tried to write global ' .. tostring(k), 2)
end
rawset(t, k, v)
end
setmetatable(_G, mt)
-- End of code from 'Module:No globals'
function p.getMID()
return "M" .. mw.title.getCurrentTitle().id
end
function p.getFilename()
return mw.title.getCurrentTitle().nsText .. ':' .. mw.title.getCurrentTitle().text
end
function p.getP180vals(frame)
local mid = frame.args[1]
local prefix = frame.args[2] or ''
local postfix = frame.args[3] or ' '
local text = ''
local tablevals = mw.wikibase.getBestStatements( mid, 'P180')
for i, v in ipairs(tablevals) do
text = text .. prefix .. v.mainsnak.datavalue.value.id .. postfix
end
return text
end
-- Get a list of all properties in the current item
function p.preloadWikidataProperties(frame)
local qid = frame.args[1] or ''
local proplist = ''
if mw.text.trim(qid or '') ~= '' then
local entity = mw.wikibase.getEntity(qid)
local properties = entity:getProperties()
for i, v in ipairs(properties) do
proplist = proplist .. v .. ", "
end
end
if proplist == '' then
proplist = 'None'
end
return proplist
end
-- check if it is on the list, fork of WikidataIB's checkBlacklist function
function p.checkProplist(frame)
local proplist = frame.args.fetchwikidata or frame.args.fwd or ""
local fieldname = frame.args.name or ""
if proplist ~= "" and fieldname ~= "" then
if proplist:find(fieldname .. ",") then
return true
else
return ''
end
else
-- one of the fields is missing: let's call that "on the list"
return true
end
end
function p.getCombinedWikidataTemplates(frame)
local qid = frame.args[1] or ''
local outputcode = ''
if mw.text.trim(qid or '') ~= '' then
local tablevals = mw.wikibase.getBestStatements( qid, 'P971')
local count = 0
local mapqid = 0
for i, v in ipairs(tablevals) do
count = count + 1
end
if count < 3 then
for i, v in ipairs(tablevals) do
local skip = 0
-- Skip building interiors (Q30062422), maps (Q4006) and ship names (Q56351075), atlantic ocean (Q97), US state (Q35657)
if v.mainsnak.datavalue.value.id == 'Q30062422' or v.mainsnak.datavalue.value.id == 'Q56351075' or v.mainsnak.datavalue.value.id == 'Q4006' or v.mainsnak.datavalue.value.id == 'Q97' or v.mainsnak.datavalue.value.id == 'Q35657' then
skip = 1
else
local p279check = mw.wikibase.getBestStatements( v.mainsnak.datavalue.value.id, 'P279')
for j, w in ipairs(p279check) do
skip = 1
end
local p31check = mw.wikibase.getBestStatements( v.mainsnak.datavalue.value.id, 'P31')
for j, w in ipairs(p31check) do
-- Skip countries (Q6256), continents (Q5107), sovereign states (Q3624078), oceans (Q9430)
if w.mainsnak.datavalue.value.id == 'Q6256' or w.mainsnak.datavalue.value.id == 'Q5107' or w.mainsnak.datavalue.value.id == 'Q3624078' or w.mainsnak.datavalue.value.id == 'Q9430' then
skip = 1
mapqid = v.mainsnak.datavalue.value.id
end
end
end
if skip == 0 then
local newframe = {}
newframe.args = {}
newframe.args[0] = ''
newframe.args[1] = v.mainsnak.datavalue.value.id
outputcode = outputcode .. frame:expandTemplate{ title = 'Wikidata Infobox/core', args = { qid=v.mainsnak.datavalue.value.id, embed='Yes', conf_authoritycontrol='yes', fwd=p.preloadWikidataProperties(newframe) } }
end
end
end
if mapqid ~= 0 then
outputcode = outputcode .. frame:expandTemplate{ title = 'Wikidata Infobox/countrymap', args={qid=mapqid}}
end
end
return outputcode
end
function p.ifThenShow(frame)
if mw.text.trim(frame.args[1] or '') ~= '' then
return (frame.args[3] or '') .. (frame.args[1] or '') .. (frame.args[4] or '')
else
return (frame.args[2] or '')
end
end
function p.addCat(frame)
if mw.text.trim(frame.args[1] or '') ~= '' then
return '[[' .. frame.args[1] .. ']]'
end
end
-- Given an input area, return a map zoom level to use with mw:Extension:Kartographer in {{Wikidata Infobox}}. Defaults to mapzoom=15.
function p.autoMapZoom(frame)
local sizestr,null = frame.args[1]:gsub("%D+%.?%D+", ""):gsub(",","")
local size = tonumber(sizestr) or 0
local LUT = { 5000000, 1000000, 100000, 50000, 10000, 2000, 150, 50, 19, 14, 5, 1, 0.5 }
for zoom, scale in ipairs(LUT) do
if size > scale then
return zoom+1
end
end
return 15
end
function p.formatLine(frame)
local part2 = mw.text.trim(frame.args[2] or '')
local returnstr = ''
if part2 ~= '' then
returnstr = '<tr '
if (frame.args.mobile or 'n') == 'y' then
returnstr = returnstr .. 'class="wdinfo_nomobile"'
end
local newframe = {}
newframe.args = {}
newframe.args.qid = frame.args[1]
returnstr = returnstr .. '><th class="wikidatainfobox-lcell">' .. mw.getContentLanguage():ucfirst(WikidataIB.getLabel(newframe))
returnstr = returnstr .. '</th><td '
if (frame.args.wrap or 'n') == 'y' then
returnstr = returnstr .. 'style="white-space: nowrap"'
end
returnstr = returnstr .. '>' .. part2 .. '</td></tr>'
end
return returnstr
end
function p.hasValue (tab, val)
for index, value in ipairs(tab) do
if value == val then
return true
end
end
return false
end
-- baseLang is a utility function that returns the base language in use
-- so for example, both English (en) and British English (en-gb) return 'en'
-- from https://commons.wikimedia.org/wiki/Module:Wikidata2
function p.baseLang(frame)
local txtlang = frame:callParserFunction( "int", "lang" ) or ""
-- This deals with specific exceptions: be-tarask -> be_x_old
if txtlang == "be-tarask" then
return "be_x_old"
end
local pos = txtlang:find("-")
local ret = ""
if pos then
ret = txtlang:sub(1, pos-1)
else
ret = txtlang
end
return ret
end
function p.langDirection(frame)
local lang = mw.text.trim(frame.args[1] or '')
if (not mw.language.isSupportedLanguage(lang)) then
lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language
end
return mw.getLanguage(lang):getDir()
end
--[[
convertChar returns the non-diacritic version of the supplied character.
stripDiacrits replaces words with diacritical characters with their non-diacritic equivalent.
strip_diacrits is available for export to other modules.
stringIsLike tests two words, returning true if they only differ in diacritics, false otherwise.
stringIs_like is available for export to other modules.
--]]
local function characterMap()
-- table with characters with diacrits and their equivalent basic latin characters
local charMap_from, charMap_to
charMap_from = 'ÁÀÂÄǍĂĀÃÅĄƏĆĊĈČÇĎĐḌÐÉÈĖÊËĚĔĒẼĘẸĠĜĞĢĤĦḤİÍÌÎÏǏĬĪĨĮỊĴĶĹĿĽĻŁḶḸṂŃŇÑŅṆŊÓÒÔÖǑŎŌÕǪỌŐØŔŘŖṚṜŚŜŠŞȘṢŤŢȚṬÚÙÛÜǓŬŪŨŮŲỤŰǗǛǙǕŴÝŶŸỸȲŹŻŽ'..
'áàâäǎăāãåąəćċĉčçďđḍðéèėêëěĕēẽęẹġĝğģĥħḥıíìîïǐĭīĩįịĵķĺŀľļłḷḹṃńňñņṇŋóòôöǒŏōõǫọőøŕřŗṛṝśŝšşșṣťţțṭúùûüǔŭūũůųụűǘǜǚǖŵýŷÿỹȳźżž'
charMap_to = 'AAAAAAAAAAACCCCCDDDDEEEEEEEEEEEGGGGHHHIIIIIIIIIIIJKLLLLLLLMNNNNNNOOOOOOOOOOOORRRRRSSSSSSTTTTUUUUUUUUUUUUUUUUWYYYYYZZZ'..
'aaaaaaaaaaacccccddddeeeeeeeeeeegggghhhiiiiiiiiiiijklllllllmnnnnnnoooooooooooorrrrrssssssttttuuuuuuuuuuuuuuuuwyyyyyzzz'
local charMap = {}
for i = 1,mw.ustring.len(charMap_from) do
charMap[mw.ustring.sub(charMap_from, i, i)] = mw.ustring.sub(charMap_to, i, i)
end
charMap['ß'] = 'ss'
return charMap
end
function p.convertChar(frame)
local ch = frame.args.char or mw.text.trim(frame.args[1]) or ""
local charMap = characterMap()
return charMap[ch] or ch
end
function p.strip_diacrits(wrd)
if wrd then
local charMap = characterMap()
wrd = string.gsub(wrd, "[^\128-\191][\128-\191]*", charMap )
end
return wrd
end
function p.stripDiacrits(frame)
return p.strip_diacrits(frame.args.word or mw.text.trim(frame.args[1]))
end
function p.stringIs_like(wrd1, wrd2)
return p.strip_diacrits(wrd1) == p.strip_diacrits(wrd2)
end
function p.stringIsLike(frame)
local wrd1 = frame.args.word1 or frame.args[1]
local wrd2 = frame.args.word2 or frame.args[2]
if p.strip_diacrits(wrd1) == p.strip_diacrits(wrd2) then
return true
else
return nil
end
end
function p.expandhiero(frame, hiero)
-- added by Jura1
-- for string values in Wikihiero syntax
-- inline recommended by https://meta.wikimedia.org/wiki/Help_talk:WikiHiero_syntax#Unwanted_newlines https://en.wikipedia.org/wiki/Help:WikiHiero_syntax
-- maybe not needed in all contexts
return frame:preprocess('<div style="text-align:center;display:inline;"> <hiero> ' .. hiero .. ' </hiero> </div>')
end
local function format2rowline(cell1, cell2)
-- added by Jura1
local tr = ""
tr = '<tr><th class="wikidatainfobox-lcell" style="text-align: left; vertical-align: text-top;" colspan="2">' .. cell1 .. '</th></tr>'
tr = tr .. '<tr><td valign="top" colspan="2">' .. cell2 .. '</td></tr>'
return tr
end
local function format1rowline(trqid, cell1, cell2)
-- added by Jura1
local tr = ""
tr = '<tr id="' .. trqid .. '"><th class="wikidatainfobox-lcell" style="vertical-align: top">' .. cell1 .. '</th>'
tr = tr .. '<td valign="top" style="vertical-align: top">' .. cell2 .. '</td></tr>'
return tr
end
function p.hieroP7383(frame)
-- added by Jura1
-- expand P7383 value in <hiero></hiero> tags
local qid = mw.text.trim(frame.args.qid or "")
local rows = ""
local checkentry = mw.wikibase.isValidEntityId(qid)
if not checkentry then
return ''
end
local entity = mw.wikibase.getEntityObject(qid)
if not entity then
return ''
end
local mylang = frame:preprocess('{{int:lang}}')
if entity.claims and entity.claims.P7383 then
for _, v in ipairs(entity.claims.P7383) do
local idv = v.mainsnak.datavalue.value
if v.qualifiers and v.qualifiers.P3831 then
for _, w in ipairs(v.qualifiers.P3831) do
if w.snaktype == "value" then
local qualid = w.datavalue.value["id"]
local encod = mw.wikibase.getEntityObject(qualid)
rows = rows .. format2rowline(encod:getLabel(mylang), p.expandhiero(frame, idv))
end
end
else
rows = rows .. format2rowline("Name", p.expandhiero(frame, idv))
end
end
end
return rows
end
function p.urn(frame)
local qid = mw.text.trim(frame.args.qid or "")
local mylang = frame:preprocess('{{int:lang}}')
local entity = mw.wikibase.getEntityObject(qid)
if not entity then
return ''
end
local urn = ""
return urn
--- return "<div style='display:none'>" .. urn .. "</span>"
end
function p.numberInfo(frame)
-- from additions by Jura1
-- tests at Category:987_(number) Category:8_(number)
local qid = mw.text.trim(frame.args.qid or "")
local mylang = frame:preprocess('{{int:lang}}')
local rows = ""
local checkentry = mw.wikibase.isValidEntityId(qid)
if not checkentry then
return ''
end
local entity = mw.wikibase.getEntityObject(qid)
if not entity then
return ''
end
if entity.claims.P487 then
for _, v in ipairs(entity.claims.P487) do
local idv = v.mainsnak.datavalue.value
if v.qualifiers and v.qualifiers.P3831 then
for _, w in ipairs(v.qualifiers.P3831) do
if w.snaktype == "value" then
local qualid = w.datavalue.value["id"]
local encod = mw.wikibase.getEntityObject(qualid)
rows = rows .. format1rowline(qualid, encod:getLabel(mylang) , idv)
end
end
end
end
end
-- use code/encoding and render as encoding/code
if entity.claims.P3295 then
for _, v in ipairs(entity.claims.P3295) do
local idv = v.mainsnak.datavalue.value
local commonsc = ""
if v.qualifiers and v.qualifiers.P805 then
for _, t in ipairs(v.qualifiers.P805) do
if t.snaktype == "value" then
local subjectframe = {}
subjectframe.args = {}
subjectframe.args.qid = t.datavalue.value["id"]
commonsc = WikidataIB.getCommonsLink( subjectframe )
end
end
end
if v.qualifiers and v.qualifiers.P3294 then
for _, w in ipairs(v.qualifiers.P3294) do
if w.snaktype == "value" then
local qualid = w.datavalue.value["id"]
local encod = mw.wikibase.getEntityObject(qualid)
local encodeframe = {}
local encodecommons = ""
encodeframe.args = {}
encodeframe.args.qid = qualid
encodecommons = WikidataIB.getCommonsLink( encodeframe ) or ""
if encodecommons == "" then
encodecommons = encod:getLabel(mylang)
else
encodecommons = "[[:" .. encodecommons .. "|" .. encod:getLabel(mylang) .. "]]"
end
if qualid == "Q68101340" then
idv = p.expandhiero(frame, idv)
elseif commonsc ~= "" then
idv = "[[:" .. commonsc .. "|" .. idv .. "]]"
end
rows = rows .. format1rowline(qualid, encodecommons , idv)
end
end
end
end
end
if entity.claims.P7415 then
for _, v in ipairs(entity.claims.P7415) do
local idv = v.mainsnak.datavalue.value
if v.qualifiers and v.qualifiers.P3294 then
for _, w in ipairs(v.qualifiers.P3294) do
if w.snaktype == "value" then
local qualid = w.datavalue.value["id"]
local encod = mw.wikibase.getEntityObject(qualid)
rows = rows .. format1rowline(qualid, encod:getLabel(mylang) , '[[File:' .. idv .. '|none|35px|'.. entity:getLabel(mylang) .. ' (' .. encod:getLabel(mylang) ..')]]')
end
end
end
end
end
return rows
-- return '<table class="wikitable"><tr><th>Encoding </th><td>code</td></tr>' .. rows ..'</table>'
end
return p
t7zerk4w8lnyj93rsjuigo6oux26j4o
2444288
2444286
2022-08-13T13:31:48Z
David Wadie Fisher-Freberg
51
Melindungi "[[Modul:Wikidata Infobox]]": Templat baresiko tinggi ([Suntiang=Untuak panguruih sajo] (sataruihnyo) [Pindah=Untuak panguruih sajo] (sataruihnyo))
Scribunto
text/plain
local p = {}
local WikidataIB = require("Module:WikidataIB")
-- Code from 'Module:No globals'
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
if k ~= 'arg' then
error('Tried to read nil global ' .. tostring(k), 2)
end
return nil
end
function mt.__newindex(t, k, v)
if k ~= 'arg' then
error('Tried to write global ' .. tostring(k), 2)
end
rawset(t, k, v)
end
setmetatable(_G, mt)
-- End of code from 'Module:No globals'
function p.getMID()
return "M" .. mw.title.getCurrentTitle().id
end
function p.getFilename()
return mw.title.getCurrentTitle().nsText .. ':' .. mw.title.getCurrentTitle().text
end
function p.getP180vals(frame)
local mid = frame.args[1]
local prefix = frame.args[2] or ''
local postfix = frame.args[3] or ' '
local text = ''
local tablevals = mw.wikibase.getBestStatements( mid, 'P180')
for i, v in ipairs(tablevals) do
text = text .. prefix .. v.mainsnak.datavalue.value.id .. postfix
end
return text
end
-- Get a list of all properties in the current item
function p.preloadWikidataProperties(frame)
local qid = frame.args[1] or ''
local proplist = ''
if mw.text.trim(qid or '') ~= '' then
local entity = mw.wikibase.getEntity(qid)
local properties = entity:getProperties()
for i, v in ipairs(properties) do
proplist = proplist .. v .. ", "
end
end
if proplist == '' then
proplist = 'None'
end
return proplist
end
-- check if it is on the list, fork of WikidataIB's checkBlacklist function
function p.checkProplist(frame)
local proplist = frame.args.fetchwikidata or frame.args.fwd or ""
local fieldname = frame.args.name or ""
if proplist ~= "" and fieldname ~= "" then
if proplist:find(fieldname .. ",") then
return true
else
return ''
end
else
-- one of the fields is missing: let's call that "on the list"
return true
end
end
function p.getCombinedWikidataTemplates(frame)
local qid = frame.args[1] or ''
local outputcode = ''
if mw.text.trim(qid or '') ~= '' then
local tablevals = mw.wikibase.getBestStatements( qid, 'P971')
local count = 0
local mapqid = 0
for i, v in ipairs(tablevals) do
count = count + 1
end
if count < 3 then
for i, v in ipairs(tablevals) do
local skip = 0
-- Skip building interiors (Q30062422), maps (Q4006) and ship names (Q56351075), atlantic ocean (Q97), US state (Q35657)
if v.mainsnak.datavalue.value.id == 'Q30062422' or v.mainsnak.datavalue.value.id == 'Q56351075' or v.mainsnak.datavalue.value.id == 'Q4006' or v.mainsnak.datavalue.value.id == 'Q97' or v.mainsnak.datavalue.value.id == 'Q35657' then
skip = 1
else
local p279check = mw.wikibase.getBestStatements( v.mainsnak.datavalue.value.id, 'P279')
for j, w in ipairs(p279check) do
skip = 1
end
local p31check = mw.wikibase.getBestStatements( v.mainsnak.datavalue.value.id, 'P31')
for j, w in ipairs(p31check) do
-- Skip countries (Q6256), continents (Q5107), sovereign states (Q3624078), oceans (Q9430)
if w.mainsnak.datavalue.value.id == 'Q6256' or w.mainsnak.datavalue.value.id == 'Q5107' or w.mainsnak.datavalue.value.id == 'Q3624078' or w.mainsnak.datavalue.value.id == 'Q9430' then
skip = 1
mapqid = v.mainsnak.datavalue.value.id
end
end
end
if skip == 0 then
local newframe = {}
newframe.args = {}
newframe.args[0] = ''
newframe.args[1] = v.mainsnak.datavalue.value.id
outputcode = outputcode .. frame:expandTemplate{ title = 'Wikidata Infobox/core', args = { qid=v.mainsnak.datavalue.value.id, embed='Yes', conf_authoritycontrol='yes', fwd=p.preloadWikidataProperties(newframe) } }
end
end
end
if mapqid ~= 0 then
outputcode = outputcode .. frame:expandTemplate{ title = 'Wikidata Infobox/countrymap', args={qid=mapqid}}
end
end
return outputcode
end
function p.ifThenShow(frame)
if mw.text.trim(frame.args[1] or '') ~= '' then
return (frame.args[3] or '') .. (frame.args[1] or '') .. (frame.args[4] or '')
else
return (frame.args[2] or '')
end
end
function p.addCat(frame)
if mw.text.trim(frame.args[1] or '') ~= '' then
return '[[' .. frame.args[1] .. ']]'
end
end
-- Given an input area, return a map zoom level to use with mw:Extension:Kartographer in {{Wikidata Infobox}}. Defaults to mapzoom=15.
function p.autoMapZoom(frame)
local sizestr,null = frame.args[1]:gsub("%D+%.?%D+", ""):gsub(",","")
local size = tonumber(sizestr) or 0
local LUT = { 5000000, 1000000, 100000, 50000, 10000, 2000, 150, 50, 19, 14, 5, 1, 0.5 }
for zoom, scale in ipairs(LUT) do
if size > scale then
return zoom+1
end
end
return 15
end
function p.formatLine(frame)
local part2 = mw.text.trim(frame.args[2] or '')
local returnstr = ''
if part2 ~= '' then
returnstr = '<tr '
if (frame.args.mobile or 'n') == 'y' then
returnstr = returnstr .. 'class="wdinfo_nomobile"'
end
local newframe = {}
newframe.args = {}
newframe.args.qid = frame.args[1]
returnstr = returnstr .. '><th class="wikidatainfobox-lcell">' .. mw.getContentLanguage():ucfirst(WikidataIB.getLabel(newframe))
returnstr = returnstr .. '</th><td '
if (frame.args.wrap or 'n') == 'y' then
returnstr = returnstr .. 'style="white-space: nowrap"'
end
returnstr = returnstr .. '>' .. part2 .. '</td></tr>'
end
return returnstr
end
function p.hasValue (tab, val)
for index, value in ipairs(tab) do
if value == val then
return true
end
end
return false
end
-- baseLang is a utility function that returns the base language in use
-- so for example, both English (en) and British English (en-gb) return 'en'
-- from https://commons.wikimedia.org/wiki/Module:Wikidata2
function p.baseLang(frame)
local txtlang = frame:callParserFunction( "int", "lang" ) or ""
-- This deals with specific exceptions: be-tarask -> be_x_old
if txtlang == "be-tarask" then
return "be_x_old"
end
local pos = txtlang:find("-")
local ret = ""
if pos then
ret = txtlang:sub(1, pos-1)
else
ret = txtlang
end
return ret
end
function p.langDirection(frame)
local lang = mw.text.trim(frame.args[1] or '')
if (not mw.language.isSupportedLanguage(lang)) then
lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language
end
return mw.getLanguage(lang):getDir()
end
--[[
convertChar returns the non-diacritic version of the supplied character.
stripDiacrits replaces words with diacritical characters with their non-diacritic equivalent.
strip_diacrits is available for export to other modules.
stringIsLike tests two words, returning true if they only differ in diacritics, false otherwise.
stringIs_like is available for export to other modules.
--]]
local function characterMap()
-- table with characters with diacrits and their equivalent basic latin characters
local charMap_from, charMap_to
charMap_from = 'ÁÀÂÄǍĂĀÃÅĄƏĆĊĈČÇĎĐḌÐÉÈĖÊËĚĔĒẼĘẸĠĜĞĢĤĦḤİÍÌÎÏǏĬĪĨĮỊĴĶĹĿĽĻŁḶḸṂŃŇÑŅṆŊÓÒÔÖǑŎŌÕǪỌŐØŔŘŖṚṜŚŜŠŞȘṢŤŢȚṬÚÙÛÜǓŬŪŨŮŲỤŰǗǛǙǕŴÝŶŸỸȲŹŻŽ'..
'áàâäǎăāãåąəćċĉčçďđḍðéèėêëěĕēẽęẹġĝğģĥħḥıíìîïǐĭīĩįịĵķĺŀľļłḷḹṃńňñņṇŋóòôöǒŏōõǫọőøŕřŗṛṝśŝšşșṣťţțṭúùûüǔŭūũůųụűǘǜǚǖŵýŷÿỹȳźżž'
charMap_to = 'AAAAAAAAAAACCCCCDDDDEEEEEEEEEEEGGGGHHHIIIIIIIIIIIJKLLLLLLLMNNNNNNOOOOOOOOOOOORRRRRSSSSSSTTTTUUUUUUUUUUUUUUUUWYYYYYZZZ'..
'aaaaaaaaaaacccccddddeeeeeeeeeeegggghhhiiiiiiiiiiijklllllllmnnnnnnoooooooooooorrrrrssssssttttuuuuuuuuuuuuuuuuwyyyyyzzz'
local charMap = {}
for i = 1,mw.ustring.len(charMap_from) do
charMap[mw.ustring.sub(charMap_from, i, i)] = mw.ustring.sub(charMap_to, i, i)
end
charMap['ß'] = 'ss'
return charMap
end
function p.convertChar(frame)
local ch = frame.args.char or mw.text.trim(frame.args[1]) or ""
local charMap = characterMap()
return charMap[ch] or ch
end
function p.strip_diacrits(wrd)
if wrd then
local charMap = characterMap()
wrd = string.gsub(wrd, "[^\128-\191][\128-\191]*", charMap )
end
return wrd
end
function p.stripDiacrits(frame)
return p.strip_diacrits(frame.args.word or mw.text.trim(frame.args[1]))
end
function p.stringIs_like(wrd1, wrd2)
return p.strip_diacrits(wrd1) == p.strip_diacrits(wrd2)
end
function p.stringIsLike(frame)
local wrd1 = frame.args.word1 or frame.args[1]
local wrd2 = frame.args.word2 or frame.args[2]
if p.strip_diacrits(wrd1) == p.strip_diacrits(wrd2) then
return true
else
return nil
end
end
function p.expandhiero(frame, hiero)
-- added by Jura1
-- for string values in Wikihiero syntax
-- inline recommended by https://meta.wikimedia.org/wiki/Help_talk:WikiHiero_syntax#Unwanted_newlines https://en.wikipedia.org/wiki/Help:WikiHiero_syntax
-- maybe not needed in all contexts
return frame:preprocess('<div style="text-align:center;display:inline;"> <hiero> ' .. hiero .. ' </hiero> </div>')
end
local function format2rowline(cell1, cell2)
-- added by Jura1
local tr = ""
tr = '<tr><th class="wikidatainfobox-lcell" style="text-align: left; vertical-align: text-top;" colspan="2">' .. cell1 .. '</th></tr>'
tr = tr .. '<tr><td valign="top" colspan="2">' .. cell2 .. '</td></tr>'
return tr
end
local function format1rowline(trqid, cell1, cell2)
-- added by Jura1
local tr = ""
tr = '<tr id="' .. trqid .. '"><th class="wikidatainfobox-lcell" style="vertical-align: top">' .. cell1 .. '</th>'
tr = tr .. '<td valign="top" style="vertical-align: top">' .. cell2 .. '</td></tr>'
return tr
end
function p.hieroP7383(frame)
-- added by Jura1
-- expand P7383 value in <hiero></hiero> tags
local qid = mw.text.trim(frame.args.qid or "")
local rows = ""
local checkentry = mw.wikibase.isValidEntityId(qid)
if not checkentry then
return ''
end
local entity = mw.wikibase.getEntityObject(qid)
if not entity then
return ''
end
local mylang = frame:preprocess('{{int:lang}}')
if entity.claims and entity.claims.P7383 then
for _, v in ipairs(entity.claims.P7383) do
local idv = v.mainsnak.datavalue.value
if v.qualifiers and v.qualifiers.P3831 then
for _, w in ipairs(v.qualifiers.P3831) do
if w.snaktype == "value" then
local qualid = w.datavalue.value["id"]
local encod = mw.wikibase.getEntityObject(qualid)
rows = rows .. format2rowline(encod:getLabel(mylang), p.expandhiero(frame, idv))
end
end
else
rows = rows .. format2rowline("Name", p.expandhiero(frame, idv))
end
end
end
return rows
end
function p.urn(frame)
local qid = mw.text.trim(frame.args.qid or "")
local mylang = frame:preprocess('{{int:lang}}')
local entity = mw.wikibase.getEntityObject(qid)
if not entity then
return ''
end
local urn = ""
return urn
--- return "<div style='display:none'>" .. urn .. "</span>"
end
function p.numberInfo(frame)
-- from additions by Jura1
-- tests at Category:987_(number) Category:8_(number)
local qid = mw.text.trim(frame.args.qid or "")
local mylang = frame:preprocess('{{int:lang}}')
local rows = ""
local checkentry = mw.wikibase.isValidEntityId(qid)
if not checkentry then
return ''
end
local entity = mw.wikibase.getEntityObject(qid)
if not entity then
return ''
end
if entity.claims.P487 then
for _, v in ipairs(entity.claims.P487) do
local idv = v.mainsnak.datavalue.value
if v.qualifiers and v.qualifiers.P3831 then
for _, w in ipairs(v.qualifiers.P3831) do
if w.snaktype == "value" then
local qualid = w.datavalue.value["id"]
local encod = mw.wikibase.getEntityObject(qualid)
rows = rows .. format1rowline(qualid, encod:getLabel(mylang) , idv)
end
end
end
end
end
-- use code/encoding and render as encoding/code
if entity.claims.P3295 then
for _, v in ipairs(entity.claims.P3295) do
local idv = v.mainsnak.datavalue.value
local commonsc = ""
if v.qualifiers and v.qualifiers.P805 then
for _, t in ipairs(v.qualifiers.P805) do
if t.snaktype == "value" then
local subjectframe = {}
subjectframe.args = {}
subjectframe.args.qid = t.datavalue.value["id"]
commonsc = WikidataIB.getCommonsLink( subjectframe )
end
end
end
if v.qualifiers and v.qualifiers.P3294 then
for _, w in ipairs(v.qualifiers.P3294) do
if w.snaktype == "value" then
local qualid = w.datavalue.value["id"]
local encod = mw.wikibase.getEntityObject(qualid)
local encodeframe = {}
local encodecommons = ""
encodeframe.args = {}
encodeframe.args.qid = qualid
encodecommons = WikidataIB.getCommonsLink( encodeframe ) or ""
if encodecommons == "" then
encodecommons = encod:getLabel(mylang)
else
encodecommons = "[[:" .. encodecommons .. "|" .. encod:getLabel(mylang) .. "]]"
end
if qualid == "Q68101340" then
idv = p.expandhiero(frame, idv)
elseif commonsc ~= "" then
idv = "[[:" .. commonsc .. "|" .. idv .. "]]"
end
rows = rows .. format1rowline(qualid, encodecommons , idv)
end
end
end
end
end
if entity.claims.P7415 then
for _, v in ipairs(entity.claims.P7415) do
local idv = v.mainsnak.datavalue.value
if v.qualifiers and v.qualifiers.P3294 then
for _, w in ipairs(v.qualifiers.P3294) do
if w.snaktype == "value" then
local qualid = w.datavalue.value["id"]
local encod = mw.wikibase.getEntityObject(qualid)
rows = rows .. format1rowline(qualid, encod:getLabel(mylang) , '[[File:' .. idv .. '|none|35px|'.. entity:getLabel(mylang) .. ' (' .. encod:getLabel(mylang) ..')]]')
end
end
end
end
end
return rows
-- return '<table class="wikitable"><tr><th>Encoding </th><td>code</td></tr>' .. rows ..'</table>'
end
return p
t7zerk4w8lnyj93rsjuigo6oux26j4o
Modul:Wikidata Infobox/doc
828
386865
2444287
2022-08-13T13:31:32Z
David Wadie Fisher-Freberg
51
new
wikitext
text/x-wiki
Implements {{tl|Wikidata Infobox}}
igfysr6lteib889gzcvei9e2h3976ec
Templat:Wikidata infoboxes
10
386866
2444289
2022-08-13T13:32:28Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
{{Navbox
| name = Wikidata infoboxes
| title = Infoboxes using Wikidata
| listclass = hlist
| state = {{{state|}}}
| group1 = Using [[Module:WikidataIB]]
| list1 =
* {{t|Infobox deity/Wikidata}}
* {{t|Infobox historic site/Wikidata}}
* {{t|Infobox journal/wikidata}}
* {{tl|Ordination}}
* {{t|Infobox person/Wikidata}}
* {{t|Infobox power station}}
* {{t|Infobox product}}
* {{t|Infobox recurring event/Wikidata}}
* {{t|Infobox religious biography/Wikidata}}
* {{t|Infobox royalty/Wikidata}}
* {{t|Infobox noble/Wikidata}}
* {{t|Infobox organization/Wikidata}}
* {{t|Infobox scientist/Wikidata}}
* {{t|Infobox telescope}}
| group2 = Using [[Module:Wikidata Infobox]]
| list2 =
* {{t|Infobox telescope}}
}}
h23tkbr8b6qksqoqz72jypvw1zysgq3
Templat:Infobox person/Wikidata
10
386867
2444290
2022-08-13T13:32:55Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
{{Infobox|child={{{child|}}}
| bodyclass = biography vcard
| above = {{Br separated entries
| 1 = {{#if:{{{honorific prefix|{{{honorific_prefix|{{{honorific-prefix|{{{pre-nominals|}}}}}}}}}}}}|<div class="honorific-prefix" style="font-size: 77%; font-weight: normal; display:inline;">{{{honorific prefix|{{{honorific_prefix|{{{honorific-prefix|{{{pre-nominals|}}}}}}}}}}}}</div>}}
| 2 = <div class="fn" style="display:inline">{{#if:{{{name|}}}|{{{name}}}|{{PAGENAMEBASE}}}}</div>
| 3 = {{#if:{{{honorific suffix|{{{honorific_suffix|{{{honorific-suffix|{{{post-nominals|}}}}}}}}}}}}|<div class="honorific-suffix" style="font-size: 77%; font-weight: normal; display:inline;">{{{honorific suffix|{{{honorific_suffix|{{{honorific-suffix|{{{post-nominals|}}}}}}}}}}}}</div>}}
}}
| abovestyle = font-size:125%; {{{abovestyle|}}}
| image = {{#invoke:InfoboxImage |InfoboxImage |image={{#invoke:WikidataIB | getValue | rank=best |P18 |name=image |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced=no |noicon=yes | maxvals=1 |{{{image|}}}}} |size={{{image size|{{{image_size|{{{imagesize|}}}}}}}}} |sizedefault=frameless |upright={{{image_upright|1}}} |alt={{{alt|}}} |suppressplaceholder=yes}}
| caption = {{#if:{{{image|}}}|{{{caption|}}}|{{#invoke:WikidataIB |getValue | rank=best |P18 |qid={{#invoke:WikidataIB |getQid |qid={{{qid|}}} }} |fwd={{{fwd|ALL}}} |osd=no |noicon=y |qual=P2096 |qualsonly=yes | maxvals=1|{{{caption|}}}}}}}
| label1 =
| data1 = {{#ifeq:{{{name|{{PAGENAMEBASE}}}}}|{{#invoke:WikidataIB | getValue | rank=best |P1559 |name=native_name |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |noicon=yes | fetchwikidata={{{fetchwikidata|}}} |{{{native_name|{{{native name|}}}}}} }}||<span class="nativename" colspan="2" style="text-align:center;font-size:125%; font-weight:bold">{{#invoke:WikidataIB | getValue | rank=best |P1559 |name=native_name |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{native_name|{{{native name|}}}}}} }}</span>}}
<!-- non-wikidata version:
{{#if:{{{native_name|}}}|<span class="nativename" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</span>}}
-->
| label2 = Pronunciation
| data2 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=pronunciation |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{pronunciation|}}} }}
| label10 = Born
| data10 = {{br separated entries
|1={{#invoke:WikidataIB | getValue | rank=best |P1477 |name=birth_name |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}}|{{{birth_name|}}}}}
|2={{#if:{{{birth_date|}}}|{{{birth_date|}}}|{{#invoke:WikidataIB | getValue | rank=best |P569 |name=birth_date |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}}|{{{birth_date|}}} |df={{{dateformat|dmy}}} }} {{#if:{{{birth_date|}}}||{{#if:{{#invoke:WikidataIB | getValue | rank=best |P570 |name=death_date |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |{{{death_date|}}} | df={{{dateformat|dmy}}} }}|| {{#if:{{#invoke:WikidataIB | getValue | rank=best |P569 |name=death_date |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |{{{death_date|}}} | df={{{dateformat|dmy}}} }}|{{#ifexpr:{{#invoke:WikidataIB|getDatePrecision|P569|qid={{{qid|}}}}}>8|(age {{#expr: trunc ({{#time: Y.md}}-{{#time: Y.md|{{#titleparts:{{wikidata|property|raw|{{{qid|}}}|P569}}|1}}}})}})}}}}}}{{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P569}} }} }} }}
|3={{if then show |1={{#invoke:WikidataIB | getValue | rank=best |P19 |qual=P17 |name=birth_place |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} | {{{birth_place|}}} }} |2=|3=<span class="birthplace"> |4=</span>}}
}}
| label11 = Baptised
| data11 = {{#invoke:WikidataIB | getValue | rank=best |P1636 |name=baptised |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |{{{baptised|}}} }}
| label12 = Disappeared
| data12 = {{Br separated entries|1={{#invoke:WikidataIB | getValue | rank=best |P0 |name=disappeared_date |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{disappeared_date|}}} }}|2={{#invoke:WikidataIB | getValue | rank=best |P0 |name=disappeared_place |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{disappeared_place|}}} }}}}
| label13 = Status
| data13 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=status |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{status|{{{disappeared_status|}}}}}} }}
| label14 = Died
| data14 = {{br separated entries
|1={{#if:{{#invoke:WikidataIB | getValue | rank=best |P570 |name=death_date |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |{{{death_date|}}} | df={{{dateformat|dmy}}} }}|{{#if:{{{death_date|}}}|{{{death_date|}}}|{{#invoke:WikidataIB | getValue | rank=best |P570 |name=death_date |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |{{{death_date|}}} | df={{{dateformat|}}} }} {{#if:{{{death_date|}}}||{{#if:{{#invoke:WikidataIB | getValue | rank=best |P569 |name=birth_date |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |{{{birth_date|}}} | df={{{dateformat|dmy}}} }}|{{#ifexpr: {{#invoke:WikidataIB |getDatePrecision |P569 |qid={{{qid|}}}}} >= 11 and {{#invoke:WikidataIB |getDatePrecision |P570 |qid={{{qid|}}}}} >= 11 | (aged {{age in years|{{#invoke:WikidataIB | getValue | rank=best |P569 |name=birth_date| maxvals=1 |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon=yes | df=ymd |{{{birth_date|}}}}}|{{#invoke:WikidataIB | getValue | rank=best |P570 |name=death_date| maxvals=1 |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon=yes| df=ymd |{{{death_date|}}}}}}})|{{#ifexpr: {{#invoke:WikidataIB |getDatePrecision |P569 |qid={{{qid|}}}}} >= 9 and {{#invoke:WikidataIB |getDatePrecision |P570 |qid={{{qid|}}}}} >= 9| (aged {{age in years|{{#invoke:WikidataIB | getValue | rank=best |P569 |name=birth_date| maxvals=1 |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon=yes | df=y |{{{birth_date|}}}}}|{{#invoke:WikidataIB | getValue | rank=best |P570 |name=death_date| maxvals=1 |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon=yes| df=y |{{{death_date|}}}}}}})|}}}}}}}}}} {{#ifeq:{{{refs|no}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P570}} }}}}
|2=<!--{{#if:{{#invoke:WikidataIB | getValue | rank=best |P509 |name=death_cause |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |{{{death_cause|}}} }}|<span class="deathcause">From {{#invoke:WikidataIB | getValue | rank=best |P509 |name=death_cause |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |{{{death_cause|}}} }}</span>}}-->
|3={{if then show |1={{#invoke:WikidataIB | getValue | rank=best |P20 |qual=P17 |name=death_place |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} | {{{death_place|}}} }} |2=|3=<span class="deathplace"> |4=</span>}}
}}
| label16 = Body discovered
| data16 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=discovered |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{body discovered|{{{body_discovered|}}}}}} }}
| label17 = {{#if:{{{burial_place|}}}|Burial place|Resting place}}
| data17 = {{#if:{{{burial_place|}}}|{{Br separated entries|1={{{burial_place|}}}|2={{{burial_coordinates|}}}}}|{{Br separated entries|1={{#invoke:WikidataIB | getValue | rank=best |P119 |name=restingplace |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} | {{{resting place|{{{resting_place|{{{restingplace|}}}}}}}}}}}|2={{{resting place coordinates|{{{resting_place_coordinates|{{{restingplacecoordinates|}}}}}}}}}}}}}
| class17 = label
| label18 = Monuments
| data18 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=monuments |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{monuments|}}} }}
| label19 = Residence
| data19 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=residence |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{residence|}}} }}
| class19 = {{#if:{{{death_date|}}}{{{death_place|}}}||label}}
| label20 = Nationality
| data20 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=nationality |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{nationality|}}} }}
| class20 = category
| label21 = Other names
| data21 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=othername |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{other names|{{{other_names|{{{othername|{{{alias|}}}}}}}}}}}} }}
| class21 = nickname
| label23 = Citizenship
| data23 = {{{citizenship|}}}
<!-- | data23 = {{#invoke:WikidataIB | getValue | rank=best |P27 |name=citizenship |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} | {{{citizenship|}}} }} see talk ("Please remove citizenship") for problems with linking -->
| class23 = category
| label24 = Education
| data24 = {{#invoke:WikidataIB | getValue | rank=best |P512 |name=education |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |{{{education|}}} }}
| label25 = Alma mater
| data25 = {{#invoke:WikidataIB | getValue | rank=best |P69 |name=alma |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |list={{{list|ubl}}}| {{{alma mater|{{{alma_mater|}}}}}} }}
| label26 = Occupation
| data26 = {{#invoke:String2 | ucfirst | {{#invoke:WikidataIB | getValue | rank=best |P106 |name=occupation |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |list={{{list|}}} |qual=DATES |{{{occupation|}}} }} }}
| class26 = role
| label27 = Years active
| data27 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=years active |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{years active|{{{years_active|{{{yearsactive|}}}}}}}}} }}
| label28 = Era
| data28 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=era |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{era|}}} }}
| class28 = category
| label29 = Employer
| data29 = {{#invoke:WikidataIB | getValue | rank=best |P108 |name=employer |qid={{{qid|}}} |qual=DATES |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |list={{{list|ubl}}} | sorted=yes | {{{employer|}}} }}
| class29 = org
| label30 = {{#if:{{{organisation|}}}|Organisation|Organization}}
| data30 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=organization |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{organisation|{{{organization|{{{organizations|}}}}}}}}} }}
| class30 = org
| label31 = Agent
| data31 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=agent |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{agent|}}} }}
| class31 = agent
| label32 = Known for
| data32 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=known |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{known for|{{{known_for|{{{known|}}}}}}}}} }}
| label33 = Works
| data33 = {{br separated entries
|1={{#invoke:WikidataIB | getValue | rank=best |P800 |name=works |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |list={{{list|}}} |sorted=yes|noicon={{{noicon|}}} |{{{works|{{{credits|{{{notable works|{{{notable_works|}}}}}}}}}}}} }}
|2={{#if:{{#invoke:WikidataIB | getValue | rank=best |P1455 |name=list of works |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced={{{onlysourced|no}}} |noicon={{{noicon|}}} |{{{list of works|{{{list_of_works|}}}}}} }}|See {{#invoke:WikidataIB | getValue | rank=best |P1455 |name=list of works |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced={{{onlysourced|no}}} |list={{{list|}}} |sorted=yes|noicon={{{noicon|}}} |{{{list of works|{{{list_of_works|}}}}}} }}}}}}
| label34 = Style
| data34 = {{#invoke:WikidataIB | getValue | rank=best |P136 |name=style |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} | {{{style|}}} }}
| class34 = category
| label37 = Home town
| data37 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=home town |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{home town|{{{home_town|}}}}}} }}
| label38 = Salary
| data38 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=salary |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{salary|}}} }}{{{salary|}}}
| label39 = Net worth
| data39 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=worth |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{net worth|{{{net_worth|{{{networth|}}}}}}}}} }}
| label40 = Height
| data40 = {{#if:{{{height_m|{{{height_cm|}}}}}}{{{height_ft|}}}{{{height_in|}}} | {{convinfobox|{{{height_m|{{{height_cm|}}}}}}|{{#if:{{{height_m|}}}|m|cm}}|{{{height_ft|}}}|ft|{{{height_in|}}}|in}}}}{{#if:{{{height|}}} | {{infobox person/height|{{{height|}}}}}}}
| label41 = Weight
| data41 = {{#if:{{{weight_kg|}}}{{{weight_st|}}}{{{weight_lb|}}} | {{convinfobox|{{{weight_kg|}}}|kg|{{{weight_st|}}}|st|{{{weight_lb|}}}|lb}}}}{{#if:{{{weight|}}} | {{infobox person/weight|{{{weight|}}}}}}}
| label42 = Television
| data42 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=television |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{television|}}} }}
| label43 = Title
| data43 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=title |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{title|}}} }}
| class43 = title
| label44 = Term
| data44 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=term |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{term|}}} }}
| label45 = Predecessor
| data45 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=predecessor |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{predecessor|}}} }}
| label46 = Successor
| data46 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=successor |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{successor|}}} }}
| label47 = Political party
| data47 = {{#invoke:WikidataIB | getValue | rank=best |P102 |name=party |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{party|}}} }}
| class47 = org
| label48 = Movement
| data48 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=movement |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{movement|}}} }}
| class48 = category
| label49 = Opponent(s)
| data49 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=opponents |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{opponents|}}} }}
| label50 = Board member of
| data50 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=boards |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{boards|}}} }}
| label53 = Criminal charge
| data53 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=criminal charge |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{criminal charge|{{{criminal_charge|}}}}}} }}
| label54 = Criminal penalty
| data54 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=criminal penalty |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{criminal penalty|{{{criminal_penalty|}}}}}} }}
| label55 = {{#if:{{{judicial_status|{{{judicial status|}}}}}}|Judicial status|Criminal status}}
| data55 = {{#if:{{{judicial status|{{{judicial_status|}}}}}} | {{#invoke:WikidataIB | getValue | rank=best |P0 |name=judicial |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{judicial status|{{{judicial_status}}}}}} }} | {{#invoke:WikidataIB | getValue | rank=best |P0 |name=criminal status |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{criminal status|{{{criminal_status|}}}}}}}} }}
| class55 = category
| label56 = Spouse(s)
| data56 = {{#invoke:WikidataIB | getValue | rank=best |P26 |name=spouse |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} | {{{spouse|}}} }}
| label57 = Partner(s)
| data57 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=partner |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{partner|{{{domesticpartner|{{{domestic_partner|}}}}}}}}} }}
| label58 = Children
| data58 = {{#invoke:WikidataIB | getValue | rank=best |P40 |name=children |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} | {{{children|}}} }}
| label59 = Parent(s)
| data59 = {{#if:{{{parents|}}}| {{{parents}}} | {{Unbulleted list | {{#invoke:WikidataIB | getValue | rank=best |P22 |name=father |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{father|}}} }} | {{#invoke:WikidataIB | getValue | rank=best |P25 |name=mother |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{mother|}}} }} }} }}
| label60 = Relatives
| data60 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=relatives |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{relations|{{{relatives|}}}}}} }}
| label61 = Family
| data61 = {{#invoke:WikidataIB | getValue | rank=best |P3373 |name=family |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |{{{family|}}} }}
| label62 = Dynasty
| data62 = {{#invoke:WikidataIB | getValue | rank=best|P53||name=dynasty |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |{{{dynasty|}}} }}
| label63 = Call-sign
| data63 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=callsign |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{callsign|}}} }}
| label64 = Awards
| data64 = {{#invoke:WikidataIB | getValue | rank=best |P166 |name=awards |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |noicon={{{noicon|}}} |list={{{list|ubl}}} |qual=ALL | {{{awards|}}} }}
| label65 = {{#if:{{{honours|}}}|Honours|Honors}}
| data65 = {{#invoke:WikidataIB | getValue | rank=best |P0 |name=honours |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{honours|{{{honors|}}}}}} }}
| label66 = Website
| data66 = {{if empty | {{#invoke:WikidataIB | getValue | rank=best |P856 |name=website |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced=no |noicon={{{noicon|}}} | {{{website|{{{homepage|}}}}}} }} | {{#invoke:WikidataIB | getValue | rank=best |P1581 |name=blog |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced={{{onlysourced|no}}} |noicon={{{noicon|}}} }} }}
| label77 = Position held
| data77 = {{#invoke:WikidataIB | getValue | rank=best |P39 |name=position |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |qual=P642,P580,P582 |{{{position_held|}}} }}
| class77 = category
| label78 = Rank
| data78 = {{#invoke:WikidataIB | getValue | rank=best |P410 |name=military rank |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |qual=DATES |{{{military_rank|}}} }}
| label79 = Branch
| data79 = {{#invoke:WikidataIB | getValue | rank=best |P241 | name=military branch |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |qual=DATES |{{{military_branch|}}} }}
| label80 = Titles
| data80 = {{#invoke:WikidataIB | getValue | rank=best |P97 |name=noble title |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |qual=ALL |{{{noble_title|}}} }}
| data67 = {{{misc|{{{module|}}}}}}
| data68 = {{{misc2|{{{module2|}}}}}}
| data69 = {{{misc3|{{{module3|}}}}}}
| data70 = {{{misc4|{{{module4|}}}}}}
| data71 = {{{misc5|{{{module5|}}}}}}
| data72 = {{{misc6|{{{module6|}}}}}}
| header73 = {{#if:{{#invoke:WikidataIB | getValue | rank=best |P109 |name=signature |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced=no |noicon=yes|{{{signature|}}}}}|Signature}}
| data74 = {{#invoke:InfoboxImage |InfoboxImage |image={{#invoke:WikidataIB | getValue | rank=best |P109 |name=signature |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced=no |noicon=yes |{{{signature|}}}}} |size={{{signature_size|}}} |sizedefault=150px |alt={{{signature alt|{{{signature_alt|}}}}}}}}
| header75 = {{#if:{{{footnotes|}}}|Notes}}
| data76 = {{#if:{{{footnotes|}}}|<div style="text-align: left;">
{{{footnotes}}}</div>}}
| below = {{EditOnWikidata|noicon={{{noicon|false}}}}}
}}<!--
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox person with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview = Page using [[Template:Infobox person]] with unknown parameter "_VALUE_"|ignoreblank=y
|qid |suppressfields |fetchwikidata |onlysourced |noicon | abovestyle | agent | alias | alma mater | alma_mater | alt | awards | baptised | birth_date | birth_name | birth_place | birthname | boards | body discovered | body_discovered | burial_coordinates | burial_place | callsign | caption | child | children | citizenship | credits | criminal charge | criminal penalty | criminal status | criminal_charge | criminal_penalty | criminal_status | dateformat | death cause | death_cause | death_date | death_place | denomination | disappeared_date | disappeared_place | disappeared_status | domestic_partner | domesticpartner | education | employer | era | ethnicity | family | father | footnotes | height | height_cm | height_ft | height_in | height_m | home town | home_town | homepage | honorific prefix | honorific suffix | honorific_prefix | honorific_suffix | honors | honours | image | image caption | image size | image_caption | image_size | image_upright | imagesize | judicial status | judicial_status | known | known for | known_for | list | misc | misc2 | misc3 | misc4 | misc5 | misc6 | module | module2 | module3 | module4 | module5 | module6 | monuments | mother | movement | name | nationality | native_name | native_name_lang | net worth | net_worth | networth | notable works | notable_works | occupation | opponents | organisation | organization | organizations | other names | other_names | othername | parents | partner | party | position_held | predecessor | pronunciation | refs | relations | relatives | religion | residence | resting place | resting place coordinates | resting_place | resting_place_coordinates | restingplace | restingplacecoordinates | salary | signature | signature alt | signature_alt | signature_size | spouse | status | style | successor | television | term | title | URL | website | weight | weight_kg | weight_lb | weight_st | works | years active | years_active | yearsactive | noble_title | military_rank | military_branch }}<!--
-->{{Main other|
{{#if:{{{1|}}}{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}|[[Category:Infobox person using numbered parameter]]}}<!--
-->{{#if:{{{box_width|}}}|[[Category:Infobox person using boxwidth parameter]]}}<!--
-->{{#if:{{{death_date|}}}{{{death_place|}}}|{{#if:{{{salary|}}}{{{net worth|{{{net_worth|{{{networth|}}}}}}}}}|[[Category:Infobox person using certain parameters when dead]]}}}}<!--
-->{{#if:{{{influences|}}}{{{influenced|}}}|[[Category:Infobox person using influence]]}}<!--
-->{{#if:{{{pronunciation|}}}|[[Category:Biography template using pronunciation]]}}<!--
-->{{#if:{{{signature|}}}|[[Category:Biography with signature]]}}[[Category:Articles with hCards]]
}}<includeonly>{{main other|{{#if:{{safesubst:#invoke:Check for unknown parameters|check|unknown=1|preview=1|fetchwikidata|onlysourced|dateformat|noicon|list|suppressfields}}|<!-- Check for locally-defined parameters could go here-->|[[Category:Articles with infoboxes completely from Wikidata]]}}}}</includeonly>
<includeonly>{{main other |[[Category:Articles using Template Infobox person Wikidata]]}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
husp5v8uqn8e98hpbeicis8n3nbiic1
Templat:Infobox person/Wikidata/doc
10
386868
2444291
2022-08-13T13:33:15Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
{{Documentation subpage}}
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
{{Person infobox header}}
{{warning|When adding an infobox using data from Wikidata, please '''check for consistency''' with the article and its references, and to '''address the inconsistencies observed''', which can be done by amending the article or the Wikidata entry, or by supplying a better value to the infobox as a local parameter if this is what emerges from the sources.}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Wikidata|Module:WikidataIB|Module:Check for unknown parameters}}
{{Uses Wikidata|P18|P119|P136|P2096|P1455|P1477|P569|P19|P570|P109|P856|P1581|P3373|P800|P69|P1636|P20|P69|P106|P108|P26|P22|P25|P166|P410|P241|P97}}
This version of {{tl|Infobox person}} retrieves various parameter values from Wikidata if enabled ("opt-in") as long as '''that information is sourced on Wikidata to a source other than Wikipedia'''. Editors can provide a local value at the article level to override or prevent specific fields from displaying, i.e., to indicate that those fields are unsuitable for inclusion in that article's infobox. This template has no option/parameter to display unsourced values.
The template calls [[Module:Wikidata]] and [[Module:WikidataIB]].
== Usage ==
=== Basic ===
{{Infobox person/Wikidata
| qid=Q20733
| name=Georges Duhamel
| fetchwikidata=ALL
}}
{{Infobox person/Wikidata
| qid=Q7243
| name=Leo Tolstoy
| fetchwikidata=ALL
|noicon=on
}}
Just use:
<pre>
{{Infobox person/Wikidata | fetchwikidata=ALL}}
</pre>
and you should get a Wikidata-filled infobox! (Providing the article is linked to a Wikidata entry containing relevant information!) This will by default '''only fetch information that is sourced''' on Wikidata. This is an important safeguard for BLPs. The subject's current age (or age at death) will be calculated automatically provided that the dates are sourced and full (i.e. 12 January 1958 not 1958).
=== General example ===
<pre>
{{Infobox person/Wikidata
| suppressfields=occupation children
| dateformat = dmy
| noicon=on
...
}}
</pre>
This will prevent the infobox from displaying the fields for occupation or children. {{para|noicon|on}} will suppress the pencil icons in favour of a single "edit on Wikidata" link at the bottom (see Tolstoy, right).
=== Specific example ===
{{Infobox person/Wikidata
| qid=Q255
| name=Ludwig van Beethoven
| suppressfields=birth_date
| fetchwikidata=ALL
| dateformat = dmy
}}
In {{Q|Q255}}
<pre>
{{Infobox person/Wikidata
| suppressfields=birth_date
| fetchwikidata=ALL
| dateformat = dmy
}}
</pre>
This fetches information on place of birth, baptism, death, citizenship, etc. - but not date of birth as that is not known.
== Parameters ==
{| class="wikitable"
|+ Wikidata-specific parameters
! scope= column | Parameter
! scope= column | Effect
|-
| fetchwikidata || allows a whitelist of fields that may be imported from Wikidata; set to "ALL" for all fields; defaults to none
|-
| suppressfields || allows a blacklist of fields that may be displayed in this infobox; overrides whitelist; defaults to none
|}
{| class="wikitable"
|+ Subject-specific parameters
! scope= column | Parameter
! scope= column | Wikidata property
|-
| honorific_prefix ||
|-
| name ||
|-
| honorific_suffix ||
|-
| image || {{Wikidata entity link|P18}}
|-
| image_upright ||
|-
| image_size ||
|-
| alt ||
|-
| caption || {{Wikidata entity link|P2096}}
|-
| native_name ||
|-
| native_name_lang ||
|-
| pronunciation ||
|-
| birth_name || {{Wikidata entity link|P1477}}
|-
| birth_date || {{Wikidata entity link|P569}} (can use qualifier {{Wikidata entity link|P1480}} -> {{Q|Q5727902}} if needed)
|-
| birth_place || {{Wikidata entity link|P19}}
|-
| baptised || {{Wikidata entity link|P1636}}
|-
| disappeared_date ||
|-
| disappeared_place ||
|-
| disappeared_status ||
|-
| death_date || {{wikidata entity link|P570}} (can use qualifier {{Wikidata entity link|P1480}} -> {{Q|Q5727902}} if needed)
|-
| death_place || {{wikidata entity link|P20}}
|-
| death_cause ||
|-
| body_discovered ||
|-
| resting_place || {{Wikidata entity link|P119}}
|-
| resting_place_coordinates ||
|-
| burial_place ||
|-
| burial_coordinates ||
|-
| monuments ||
|-
| residence ||
|-
| nationality || {{wikidata entity link|P27}}
|-
| other_names ||
|-
| citizenship || {{wikidata entity link|P27}}
|-
| education || {{Wikidata entity link|P512}}
|-
| alma_mater || {{wikidata entity link|P69}}
|-
| occupation || {{wikidata entity link|P106}}
|-
| years_active ||
|-
| era ||
|-
| employer || {{wikidata entity link|P108}}
|-
| organization ||
|-
| agent ||
|-
| known_for ||
|-
| notable_works || {{wikidata entity link|P800}}
|-
| style || {{wikidata entity link|P136}}
|-
| home_town ||
|-
| salary ||
|-
| net_worth ||
|-
| height ||
|-
| weight ||
|-
| television ||
|-
| title ||
|-
| term ||
|-
| predecessor ||
|-
| successor ||
|-
| party || {{wikidata entity link|P102}}
|-
| movement ||
|-
| opponents ||
|-
| boards ||
|-
| criminal_charge ||
|-
| criminal_penalty ||
|-
| criminal_status ||
|-
| spouse || {{wikidata entity link|P26}}
|-
| partner ||
|-
| children || {{wikidata entity link|P40}}
|-
| parents || {{wikidata entity link|P22}}, {{wikidata entity link|P25}}
|-
| mother ||
|-
| father ||
|-
| relatives ||
|-
| family || {{wikidata entity link|P3373}}
|-
| callsign ||
|-
| awards || {{wikidata entity link|P166}}
|-
| website || {{wikidata entity link|P856}}
|-
| military_rank || {{wikidata entity link|P410}}
|-
| military_branch || {{wikidata entity link|P241}}
|-
| noble_title || {{wikidata entity link|P97}}
|-
| module ||
|-
| module2 ||
|-
| module3 ||
|-
| module4 ||
|-
| module5 ||
|-
| module6 ||
|-
| signature || {{wikidata entity link|P109}}
|-
| signature_size ||
|-
| signature_alt ||
|-
| footnotes ||
|}
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"params": {
"fetchwikidata": {}
}
}
</templatedata>
== See also ==
* {{tl|Infobox person}}
{{Wikidata infoboxes}}
<includeonly>{{sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:People and person infobox templates]]
[[Category:Biographical templates usable as a module|Person/Wikidata]]
[[Category:Infobox templates using Wikidata]]
}}</includeonly>
7myx4w35p2xu566r50tu33yxgsxwewu
Modul:Check for clobbered parameters
828
386869
2444293
2022-08-13T13:35:13Z
David Wadie Fisher-Freberg
51
b
Scribunto
text/plain
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and s:match('%S')
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
local checknested = isnotempty(args['nested'])
local delimiter = isnotempty(args['delimiter']) and args['delimiter'] or ';'
local argpairs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
local plist = mw.text.split(v, delimiter)
local pfound = {}
local count = 0
for ii, vv in ipairs(plist) do
vv = trim(vv)
if checknested and pargs[vv] or isnotempty(pargs[vv]) then
count = count + 1
table.insert(pfound, vv)
end
end
if count > 1 then
table.insert(argpairs, pfound)
end
end
end
local warnmsg = {}
local res = ''
local cat = ''
if args['cat'] and mw.ustring.match(args['cat'],'^[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]:') then
cat = args['cat']
end
local template = args['template'] and ' in ' .. args['template'] or ''
if #argpairs > 0 then
for i, v in ipairs( argpairs ) do
table.insert(
warnmsg,
mw.ustring.format(
'Using more than one of the following parameters%s: <code>%s</code>.',
template,
table.concat(v, '</code>, <code>')
)
)
if cat ~= '' then
res = res .. '[[' .. cat .. '|' .. (v[1] == '' and ' ' or '') .. v[1] .. ']]'
end
end
end
if #warnmsg > 0 then
res = require('Module:If preview')._warning({
table.concat(warnmsg, '<br>')
}) .. res
end
return res
end
return p
59n770hna40q9pw4oa0dsp86euaks0u
Templat:Infobox person/doc
10
386870
2444294
2022-08-13T13:35:40Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
<noinclude>{{pp-template|small=yes}}{{pp-move-indef}}</noinclude>{{for|an infobox for fictional characters|Template:Infobox character}}
{{Template shortcut|Personbox}}
{{documentation subpage}}
{{Person infobox header}}
{{High-risk| 431249 |info=About [https://en.wikipedia.org/w/index.php?search=hastemplate%3Ainfobox_person&title=Special:Search&profile=default&fulltext=1&searchToken=sghud1bktha375psef8ybmm3 385,000] of them (90%) are in mainspace.}}
{{Notice|Please note that in 2016, the {{para|religion}} and {{para|ethnicity}} parameters were removed from Infobox person as a result of [[Wikipedia:Village pump (policy)/Archive 126#RfC: Religion in biographical infoboxes|the RfC: Religion in biographical infoboxes]] and [[Wikipedia:Village pump (policy)/Archive 127#RfC: Ethnicity in infoboxes|the RfC: Ethnicity in infoboxes]] as clarified by [[Template talk:Infobox person/Archive 31#Ethnicity? Religion?|this discussion]].}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
{{Tracks Wikidata|P18|cat=No local image but image on Wikidata}}
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
{{tl|Infobox person}} may be used to summarize information about a particular person, usually at the top of an article.
== Redirects and calls ==
At least {{PAGESINCATEGORY:Templates calling Infobox person}} other [[:Category:Templates calling Infobox person|templates call this one]] and many templates [{{fullurl:Special:WhatLinksHere/Template:Infobox_person|namespace=10&hidetrans=1&hidelinks=1}} redirect here].
== Modules ==
The following templates are suitable for use as a "module" in this one:
* Templates in [[:Category:Biographical templates usable as a module]]
* {{tl|Listen}}
* {{tl|Infobox Chinese}}
== Usage ==
The infobox may be added by pasting the template as shown below into an article and then filling in the desired fields. Any parameters left blank or omitted will not be displayed.
=== Blank template with basic parameters ===
{{Infobox person
| name = ''name''
| image = example-serious.jpg
| alt = alt
| caption = ''caption''
| birth_name = ''birth_name''
| birth_date = ''birth_date''
| birth_place = ''birth_place''
| death_date = ''death_date''
| death_place = ''death_place''
| nationality = ''nationality''
| other_names = ''other_names''
| occupation = ''occupation''
| years_active = ''years_active''
| known_for = ''known_for''
| notable_works = ''notable_works''
}}
<syntaxhighlight lang="html" style="overflow:auto; line-height:1.2em;">
{{Infobox person
| name = <!-- defaults to article title when left blank -->
| image = <!-- filename only, no "File:" or "Image:" prefix, and no enclosing [[brackets]] -->
| alt = <!-- descriptive text for use by speech synthesis (text-to-speech) software -->
| caption =
| birth_name = <!-- only use if different from name -->
| birth_date = <!-- {{Birth date and age|YYYY|MM|DD}} for living people supply only the year with {{Birth year and age|YYYY}} unless the exact date is already widely published, as per [[WP:DOB]]. For people who have died, use {{Birth date|YYYY|MM|DD}}. -->
| birth_place =
| death_date = <!-- {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} (DEATH date then BIRTH date) -->
| death_place =
| nationality = <!-- use only when necessary per [[WP:INFONAT]] -->
| other_names =
| occupation =
| years_active =
| known_for =
| notable_works =
}}
</syntaxhighlight>
{{clear}}
=== Blank template with all parameters ===
Only the most pertinent information should be included. Please {{em|remove}} unused parameters, and refrain from inserting dubious trivia in an attempt to fill all parameters.
{{Parameter names example | _display=italics
| honorific_prefix | name | honorific_suffix
| image=example-serious.jpg | image_upright | landscape | alt | caption <!--shows placement of parameters, see examples for image-->
| native_name | native_name_lang | pronunciation
| birth_name | birth_date | birth_place | baptised <!--does not display due to birth date displayed-->
| disappeared_date | disappeared_place | disappeared_status | death_date | death_place | death_cause <!--should only be included when the cause of death has significance for the subject's notability-->
| body_discovered | resting_place | resting_place_coordinates | monuments
| nationality | other_names | siglum | citizenship | education | alma_mater
| occupation | years_active | era | employer | organization | agent | known_for | notable_works
| style | height | television
| title | term | predecessor | successor | party | otherparty | movement | opponents | boards
| criminal_charges | criminal_penalty | criminal_status
| spouse | partner | children | parents | relatives | family | callsign | awards | website
| module | module2 | module3 | module4 | module5 | module6 <!--removed the ... which only saved two lines from being shown-->
| signature=<nowiki>signature.jpg</nowiki> | signature_size | signature_alt
| footnotes
}}
<syntaxhighlight lang="html" style="overflow:auto; line-height:1.2em">
{{Infobox person
| honorific_prefix =
| name = <!-- defaults to article title when left blank -->
| honorific_suffix =
| image = <!-- filename only, no "File:" or "Image:" prefix, and no enclosing [[brackets]] -->
| image_upright =
| landscape = <!-- yes, if wide image, otherwise leave blank -->
| alt = <!-- descriptive text for use by speech synthesis (text-to-speech) software -->
| caption =
| native_name =
| native_name_lang =
| pronunciation =
| birth_name = <!-- only use if different from name -->
| birth_date = <!-- {{Birth date and age|YYYY|MM|DD}} for living people supply only the year with {{Birth year and age|YYYY}} unless the exact date is already widely published, as per [[WP:DOB]]. For people who have died, use {{Birth date|YYYY|MM|DD}}. -->
| birth_place =
| baptised = <!-- will not display if birth_date is entered -->
| disappeared_date = <!-- {{Disappeared date and age|YYYY|MM|DD|YYYY|MM|DD}} (disappeared date then birth date) -->
| disappeared_place =
| disappeared_status =
| death_date = <!-- {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} (enter DEATH date then BIRTH date (e.g., ...|1967|8|31|1908|2|28}} use both this parameter and |birth_date to display the person's date of birth, date of death, and age at death) -->
| death_place =
| death_cause = <!--should only be included when the cause of death has significance for the subject's notability-->
| body_discovered =
| resting_place =
| resting_place_coordinates = <!-- {{coord|LAT|LONG|type:landmark|display=inline}} -->
| burial_place = <!-- may be used instead of resting_place and resting_place_coordinates (displays "Burial place" as label) -->
| burial_coordinates = <!-- {{coord|LAT|LONG|type:landmark|display=inline}} -->
| monuments =
| nationality = <!-- use only when necessary per [[WP:INFONAT]] -->
| other_names =
| siglum =
| citizenship = <!-- use only when necessary per [[WP:INFONAT]] -->
| education =
| alma_mater =
| occupation =
| years_active =
| era =
| employer =
| organization =
| agent = <!-- Discouraged in most cases, specifically when promotional, and requiring a reliable source -->
| known_for =
| notable_works = <!-- produces label "Notable work"; may be overridden by |credits=, which produces label "Notable credit(s)"; or by |works=, which produces label "Works"; or by |label_name=, which produces label "Label(s)" -->
| style =
| height = <!-- "X cm", "X m" or "X ft Y in" plus optional reference (conversions are automatic) -->
| television =
| title = <!-- Formal/awarded/job title. The parameter |office=may be used as an alternative when the label is better rendered as "Office" (e.g. public office or appointments) -->
| term =
| predecessor =
| successor =
| party =
| otherparty =
| movement =
| opponents =
| boards =
| criminal_charges = <!-- Criminality parameters should be supported with citations from reliable sources -->
| criminal_penalty =
| criminal_status =
| spouse = <!-- Use article title or common name -->
| partner = <!-- (unmarried long-term partner) -->
| children =
| parents = <!-- overrides mother and father parameters -->
| mother = <!-- may be used (optionally with father parameter) in place of parents parameter (displays "Parent(s)" as label) -->
| father = <!-- may be used (optionally with mother parameter) in place of parents parameter (displays "Parent(s)" as label) -->
| relatives =
| family =
| callsign =
| awards =
| website = <!-- {{URL|example.com}} -->
| module =
| module2 =
| module3 =
| module4 =
| module5 =
| module6 =
| signature =
| signature_size =
| signature_alt =
| footnotes =
}}
</syntaxhighlight>
{{clear}}
== Parameters ==
<big>Do not use all these parameters for any one person. The list is long to cover a wide range of people. Only use those parameters that convey essential or notable information about the subject, and ensure that this information is sourced in the article or (if present only in the infobox) in the infobox itself.</big>
Any parameters left blank or omitted will not be displayed. Many parameters have alternative names, implemented for compatibility with other templates (especially to aid merging). The preferred names are shown in the table below.
{| class="wikitable"
! style="text-align: left" | Parameter
! style="text-align: left" | Explanation
|-
| '''<code>honorific_prefix</code>'''
| To appear on the line above the person's name. This is for things like <code><nowiki>|honorific_prefix=Sir</nowiki></code> – honorifics of serious significance that are attached to the name in formal address, such as knighthoods and titles of nobility; do not use it for routine things like "{{!mxt|[[Dr.]]}}" or "{{!mxt|[[Ms.]]}}"
|-
| '''<code>name</code>'''
| Common name of person (defaults to article name if left blank; provide {{para|birth_name}} (below) if different from {{para|name}}). If middle initials are specified (or implied) by the lead of the article, and are not specified separately in the {{para|birth_name}} parameter, include them here. ''Do not put honorifics or alternative names in this parameter.'' There are separate parameters for these things, covered below.
|-
| '''<code>honorific_suffix</code>'''
| To appear on the line below the person's name. This is for things like <code><nowiki>|honorific_suffix=[[Officer of the Order of the British Empire|OBE]]</nowiki></code> – honorifics of serious significance that are attached to the name in formal address, such as national orders and non-honorary doctorates; do not use it for routine things like "{{!mxt|[[Bachelor of arts|BA]]}}". It is permissible but not required to use the {{tlx|post-nominals}} template inside this parameter; doing so requires {{tlx|post-nominals|size{{=}}100%|...}}.
|-
| '''<code>image</code>'''
| Image name: {{kbd|abc.jpg}}, {{kbd|xpz.png}}, {{kbd|123.gif}}, etc., without the {{samp|File:}} or {{samp|Image:}} prefix. If an image is desired but not available, one may add {{kbd|yes}} to the {{para|needs-photo}} parameter of the {{tlx|WikiProject Biography}} template on the talk page. If no image is available yet, [[Wikipedia:Centralized discussion/Image placeholders|do not use an image placeholder]].
|-
| '''<code>image_upright</code>'''
| Scales the image thumbnail from its default size by the given factor. Values less than 1 scale the image down (0.9 = 90%) and values greater than 1 scale the image up (1.15 = 115%).
|-
| '''<code>landscape</code>'''
| Set to <code>yes</code> when using wide, short images. The image height (rather than width) will be limited to 200 pixels.
|-
| '''<code>alt</code>'''
| Descriptive [[Wikipedia:Manual of Style/Accessibility/Alternative text for images|<code>alt</code> text for the image]], for visually impaired readers. One word (such as {{kbd|photograph}}) is rarely sufficient. Do not copy-paste the value of {{para|caption}} (below) into this parameter. Example of the difference: "Willie Nelson at a concert in Dallas, 1989" is good as {{para|caption}} value; "Nelson in western-wear with an acoustic guitar, on stage in a daytime show with band in background" is an {{para|alt}} description. If nothing meaningful can be said that isn't already in the caption, use the [[Wikipedia:Manual of Style/Accessibility/Alternative text for images#Captions and nearby text|stock text]] {{para|alt|refer to caption}}.
|-
| '''<code>caption</code>'''
| Caption for image, if needed. Try to include the date of photo, some context (check the <code>File:</code> or [[Wikimedia Commons|Commons]] page for the image). Image credit should generally not be included per [[MOS:CREDITS]].
|-
| '''<code>native_name</code>'''
| The person's name in their own language, if different.
|-
| '''<code>native_name_lang</code>'''
| [[ISO 639-1]] code, e.g., "{{kbd|fr}}" for French. If more than one, use {{tlx|lang}} around each name in {{para|native_name}} instead.
|-
| '''<code>pronunciation</code>'''
| Details of how to pronounce the individual's native name. <!--copied from TemplateData description, if changed please update there also-->
|-
| '''<code>birth_name</code>'''
| Name at birth; only use if different from {{para|name}}.
|-
| '''<code>birth_date</code>'''
| Date of birth: Use {{tlx|birth date and age}} (if living) or {{tlx|birth date}} (if dead). {{crossref|See template's page for details on usage.}} If only a year of birth is known, or age as of a certain date, consider using {{tlx|birth year and age}} or {{tlx|birth based on age as of date}}. For living people [[Wikipedia:Biographies of living persons#Privacy of personal information and using primary sources|supply only the year unless the exact date is already widely published]]. Treat such cases as if only the year is known, so use {{tlx|birth year and age}} or a similar option. The templates mentioned in this paragraph emit metadata indicating the date is in the Gregorian calendar; if the date is in the Julian calendar, do not use these templates, just write the date.
|-
| {{anchor|birth_place}}'''<code>birth_place</code>'''
| Place of birth: {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}.
* Use the name of the birthplace at the time of birth, e.g.: {{kbd|Saigon}} (prior to 1976) or {{kbd|Ho Chi Minh City}} (post-1976).
* [[Wikipedia:Manual of Style/Icons#Do not use flags to indicate locations of birth, residence, or death|Do not use a flag template]], coat of arms, or other icon.
* [[Wikipedia:Manual of Style/Infoboxes#Purpose|Omit unnecessary or redundant details]]. For example, it is not necessary to state: {{!xt|{{kbd|New York City, [[New York (state)|New York]], United States}}}} when {{xt|{{kbd|New York City, U.S.}}}} conveys essentially the same information more concisely.
* Countries should [[Wikipedia:Manual of Style/Linking#What generally should not be linked|generally not be linked]].
* For modern subjects, the country should generally be a sovereign state; for United Kingdom locations, the constituent [[Countries of the United Kingdom|countries of the UK]] are sometimes used instead, when more appropriate in the context.
* For historical subjects, use the place name most appropriate for the context and our readership. What the place may correspond to on a modern map is a matter for an article's main text.
* For subsequent places (of death, etc.) it is not necessary to repeat jurisdictional details or links for the same place name.
|-
| '''<code>baptised</code>'''
| Date of baptism: {{em|Only}} for use when birth date is not known (e.g., for [[Ludwig van Beethoven]]). Will not display if a birth date is entered. Do not use subtemplates. Parameter <code>baptized</code> can be used for articles that use American English spelling.
|-
| '''<code>disappeared_date</code>'''
| (For missing people) Date of disappearance: Use {{tlx|disappeared date and age}} (if birth date is known) or {{tlx|disappeared date}} (if birth date unknown).
|-
| '''<code>disappeared_place</code>'''
| (For missing people) Place of disappearance: {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. <!--This space is needed for readability, due to quirk of these templated elements being in proximity.--> ({{crossref|See {{para|birth_place}}, [[#birth place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>disappeared_status</code>'''
| (For missing people) Current status for the person, e.g., if the person is still regarded as missing (using {{tlx|missing for}} to calculate the time since disappearance), or if the person has been [[Declared death in absentia|declared dead ''{{lang|la|in absentia}}'']], with a date for such a ruling.
|-
| '''<code>death_date</code>'''
| Date of death: Use {{tlx|death date and age}} (if birth date is known) or {{tlx|death date}} (if birth date unknown). {{crossref|See template's page for details on usage.}} If exact dates are unknown, consider using {{tlx|death year and age}}. The templates mentioned in this paragraph emit metadata indicating the date is in the Gregorian calendar; if the date is in the Julian calendar, do not use these templates, just write the date.
|-
| '''<code>death_place</code>'''
| Place of death: {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>death_cause</code>'''
| Cause of death. Should be clearly defined and sourced, and should only be included when the cause of death has significance for the subject's notability, e.g. [[James Dean]], [[John Lennon]]. It should not be filled in for unremarkable deaths such as those from old age or routine illness, e.g. [[Bruce Forsyth]], [[Eduard Khil]].
|-
| '''<code>body_discovered</code>'''
| Place where the body was discovered (if different from place of death). {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>burial_place</code>'''
| Place of burial {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc. {{crossref|See {{para|resting_place}} for non-burials}}.)
|-
| '''<code>burial_coordinates</code>'''
| Coordinates for place of burial, to accompany {{para|burial_place}}. Use {{tlx|coord}} template.
|-
| '''<code>resting_place</code>'''
| Location of columbarium, ash-scattering, etc. If no location, leave blank. {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>resting_place_coordinates</code>'''
| Coordinates for location of columbarium, ash-scattering etc. Use {{tlx|coord}} template.
|-
| '''<code>monuments</code>'''
| Significant monuments erected, buildings named, etc., in honour of the subject. If many, link to an appropriate section of the article instead.
|-
| '''<code>nationality</code>'''
| {{anchor|nationality}}May be used instead of {{para|citizenship}} (below) or vice versa in cases where any confusion could result. Should only be used {{em|with}} {{para|citizenship}} when they differ per [[WP:INFONAT]]. ({{crossref|See {{para|birth_place}}, [[#birth place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, anachronisms, "country" definitions, etc.)
|-
| '''<code>other_names</code>'''
| Other notable names for the person, if different from {{para|name}} and {{para|birth_name}}. [[Wikipedia:Manual of Style/Biographies#Pseudonyms|This can include]] stage names, maiden/married names, nicknames, criminal aliases, etc.
|-
| '''<code>siglum</code>'''
| [[Siglum]] or monogram, a text shortcut (often formed from the initials of the name, with variations) used to sign work, if relevant.
|-
| '''<code>citizenship</code>'''
| Country of legal citizenship, if different from nationality. Rarely needed. See usage notes for {{para|nationality}}, above. Should only be used if citizenship differs from the value in {{para|nationality}} and cannot be inferred from the birthplace. Note that many countries do not automatically grant citizenship to people born within their borders. ({{crossref|See {{para|birth_place}}, [[#birth place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, anachronisms, "country" definitions, etc.)
|-
| '''<code>education</code>'''
| Education, e.g., degree, institution and graduation year, if relevant. If very little information is available or relevant, the {{para|alma_mater}} parameter may be more appropriate.
|-
| '''<code>alma_mater</code>'''
| ''[[Alma mater]]''. This parameter is a more concise alternative to (not addition to) {{para|education}}, and will often consist of the linked name of the last-attended institution of higher education (not secondary schools). It is usually not relevant to include either parameter for non-graduates, but article talk page consensus may conclude otherwise, as perhaps at [[Bill Gates]].
|-
| '''<code>occupation</code>'''
| Occupation(s) as given in the lead. Use list markup for three or more entries, e.g. with {{tlx|flatlist}}. Please observe [[sentence case]] and capitalise only the first letter of the first item; e.g.:
{{block indent|1={{Flatlist|
* Musician
* singer-songwriter
* actor
}}}}
|-
| '''<code>years_active</code>'''
| Date range in years during which the subject was active in their principal occupation(s) and/or other activity for which they are notable. Use the format <code>1950–2000</code>, or <code>1970–present</code> if still active. [[Wikipedia:Manual of Style/Dates and numbers#Ranges|Date ranges]] always use an [[Wikipedia:Manual of Style#En dashes|en dash]], not hyphen. If no dates of birth and/or death are known for the subject, only a ''[[floruit]]'' date range, as is common with ancient subjects, this parameter can be used for it. If approximate (''[[wikt:circa#English|circa]]'') dates are known for either or both, put them in the {{para|birth_date}} and {{para|death_date}} parameters. Helpful templates: {{tlx|floruit}}, {{tlx|circa}}.
|-
| '''<code>era</code>'''
| Era (e.g., {{kbd|Medieval}}) in which the person lived; less specific than {{para|years_active}}. Should not be used if dates are available.
|-
| '''<code>employer</code>'''
| Employer(s), if relevant.
|-
| '''<code>organization</code>''' or '''<code>organisation</code>'''
| Non-employing organization(s), if relevant.
|-
| '''<code>agent</code>'''
| The subject's agent (individual and/or agency), discouraged in most cases, specifically when promotional, and requiring a [[Wikipedia:Identifying reliable sources|reliable source]].
|-
| '''<code>known_for</code>'''
| A brief description of why the person is notable.
|-
| {{unbulleted list|'''<code>notable_works</code>''';<br /> <small>alternatives:</small>
|'''<code>credits</code>'''
|'''<code>label_name</code>'''
|'''<code>works</code>'''
}}
| Title(s) of notable work(s) (publications, compositions, sculptures, films, etc.) by the subject, if any. Produces the label '''Notable work'''. May be overridden by {{para|credits}}, which produces '''Notable credit(s)'''; or by {{para|works}}, which produces '''Works'''; or by {{para|label_name}}, which produces '''Label(s)'''.
* The {{para|notable_works}}, {{para|credits}}, and {{para|label_name}} parameters are intended to be (at most) short [[#Inline lists|inline lists]].
* The {{para|label_name}} variant is used for one or more record labels with which a performer is associated, or a fashion label in which a designer has been heavily involved or for which they are well known. Remember that this parameter is an alternative to the others mentioned here and is not used along with them.
* The {{para|works}} variant is intended to link to {{em|a specific list article}} for a larger body of work (not all of which may be individually notable).
|-
| '''<code>style</code>'''
| The style of the subject's works, if applicable. {{crossref|This parameter is not for [[Style (manner of address)|styles of address or office]]; see {{para|honorific_prefix}}.}}
|-
| '''<code>height</code>'''
| If person was notable for their height, or if height is relevant. If used, this should also include the year of the measurement if the person had not reached full adulthood when this stat was published. {{crossref|See documentation of this parameter at [[Template:Infobox sportsperson#height|Template:Infobox sportsperson]] for more information.}}
|-
| '''<code>television</code>'''
| Television programmes presented by or {{em|closely}} associated with the subject. For multiple entries, use an [[#Inline lists|inline list]].
|-
| '''<code>title</code>'''
| Multiple uses:
* Formal title, such as {{kbd|First Lady of Japan}} for [[Akie Abe]].
* Awarded title, such as {{kbd|Mr. Olympia}} for [[Arnold Schwarzenegger]].
* Job title, such as {{kbd|President of Calvin College}} for [[Anthony Diekema]].
* A combination of the above, such as {{kbd|Professor of Mathematics}} and {{kbd|[[Fellow of the Royal Society]]}} for [[Bill Parry (mathematician)|Bill Parry]]
For multiple entries, use an [[#Inline lists|inline list]].
Use the {{para|awards}} parameter, below, for awarded honors that are not really titles. A single award should not use both parameters.
|-
| '''<code>office</code>'''
| May be used as an alternative to {{para|title}} when the label is better displayed as '''Office''' (e.g. public office or appointments). Using this parameter will override {{para|title}}.
|-
| '''<code>term</code>'''
| Years the person held the {{para|title}} or {{para|office}} listed above. Helpful template: {{tlx|reign}} (also used for civil offices).
|-
| '''<code>predecessor</code>'''
| Person who previously held the {{para|title}} or {{para|office}} listed above.
|-
| '''<code>successor</code>'''
| Person who subsequently held the {{para|title}} or {{para|office}} listed above.
|-
| '''<code>party</code>'''
| If relevant. Field labelled '''Political party'''.
|-
| '''<code>otherparty</code>'''
| If relevant. Field labelled '''Other political affiliations'''.
|-
| '''<code>movement</code>'''
| If relevant. Can be [[Social movement|social]], [[Political movement|political]] (non-party), [[Art movement|artistic]], [[Philosophical movement|philosophical]], [[List of literary movements|literary]], [[Cultural movement|cultural]], etc.
|-
| '''<code>opponents</code>'''
| Notable relevant opponents (e.g., for major political office).
|-
| '''<code>boards</code>'''
| For [[board of directors]] membership(s), if relevant. Field labeled '''Board member of'''.
|-
| {{ubl|'''<code>criminal_charges</code>'''|'''<code>criminal_penalty</code>'''|'''<code>criminal_status</code>'''}}
| For convicted criminals only. Please be certain to support these parameters with citations from reliable sources, in the article body.
|-
| '''<code>spouse</code>'''
| Name of spouse(s), followed by years of marriage. Use the format ''Name (married 1950–present)'' for a current spouse, and ''Name (married 1970–99)'' for former spouse(s). Use article title (if linking) or [[Wikipedia:Article titles#Use commonly recognizable names|common name]]. For multiple entries, use an [[#Inline lists|inline list]]. For deceased persons still married at time of death, do not include the end year.
|-
| '''<code>partner</code>'''
| If particularly relevant, or if the partner is notable; "partner" here means unmarried life partners in a [[domestic partnership]] (of any gender or sexual orientation), not business partner. Use the format ''Name (1950–present)'' for current partner and ''Name (1970–1999)'' for former partner(s).
|-
| '''<code>children</code>'''
| Typically the number of children (e.g., {{kbd|3}}); only list names of independently notable or particularly relevant children. Names may be preceded by a number to show total children and avoid implying that named children are the only offspring. For multiple entries, use an [[#Inline lists|inline list]]. {{em|For [[Wikipedia:Biographies of living persons#Privacy of names|privacy reasons]], consider omitting the names of living children, unless notable.}}
|-
| '''<code>parents</code>'''
| Names of parents; include only if they are independently notable or particularly relevant. For multiple entries, use an [[#Inline lists|inline list]]. If subject has only one notable mother and/or only one notable father, {{para|mother}} and {{para|father}} parameters may be used instead. These parameters may be used for biological, adoptive, foster, or step-parents.
|-
| '''<code>mother</code>'''
| Name of mother; include only if subject has one mother who is independently notable or particularly relevant. Displays '''Parent(s)''' as label, and is overridden by the {{para|parents}} parameter.
|-
| '''<code>father</code>'''
| Name of father; include only if subject has one father who is independently notable or particularly relevant. Displays '''Parent(s)''' as label, and is overridden by the {{para|parents}} parameter.
|-
| '''<code>relatives</code>'''
| Names of siblings or other relatives; include only if independently notable and particularly relevant. Include the relationship in parentheses after the name (sister, uncle, etc.). For multiple entries, use an [[#Inline lists|inline list]].
|-
| '''<code>callsign</code>'''
| Amateur radio [[call sign]], if relevant.
|-
| '''<code>awards</code>'''
| Notable awards. If many, link to an appropriate section of the article instead. Use {{para|title}} parameter, above, for awarded titles; A single award should not use both parameters.
|-
| '''<code>website</code>'''
| Official website only. Unofficial websites should be placed under <code><nowiki>==External links==</nowiki></code> in the body of the article. Use {{tlx|URL}} as in {{tnull|URL|Example.com}}. Do not display the {{samp|www.}} part unless the site requires it.
|-
| {{ubl | '''<code>module</code>''' | '''<code>module2</code>''' | '''<code>module3</code>''' | '''<code>module4</code>''' | '''<code>module5</code>''' | '''<code>module6</code>''' }}
| Used for embedding other infoboxes into this one. Example:
<syntaxhighlight lang="html">
{{Infobox person
| name = Paul McCartney
...
| module =
{{Infobox musical artist
| embed = yes
| instrument = piano
...
}} <!-- end of Infobox musical artist -->
...
}} <!-- end of Infobox person -->
</syntaxhighlight>
{{crossref|For more detailed information, see [[Wikipedia:WikiProject Infoboxes/embed]].}}
|-
| '''<code>signature</code>'''
| An image of the person's signature. Please use image name: {{kbd|abc.jpg}}, {{kbd|xpz.png}}, {{kbd|123.gif}}, etc., without the {{samp|File:}} or {{samp|Image:}} prefix
|-
| '''<code>signature_size</code>'''
| Default is {{samp|150px}}. If necessary, a signature can be resized manually as per the {{para|image_size}} parameter.
|-
| '''<code>signature_alt</code>'''
| Alt text for the signature image. For example, for {{samp|[[:File:Thomas Jefferson Signature.svg]]}}, the alt text might be <code><nowiki>|signature_alt= Th: Jefferson</nowiki></code>, spelling out the signature exactly as it appears in the image.
|-
| '''<code>footnotes</code>'''
| Textual notes about any of the infobox data. This is not for reference citations. If an infobox parameter's value needs a citation, [[Wikipedia:Citing sources|cite inline]] at the end of the value. Citations will appear in the article's references section along with the other citations in the article.
|-
| '''<code>image_size</code>'''
| {{strongbad|Deprecated}}. Size to display image: {{kbd|200px}} (set width), {{kbd|x300px}} (set height), or {{kbd|200x300px}} (max width & max height). If empty or omitted, this defaults to {{samp|frameless}} (default is {{samp|220px}}, but logged-in users can change this by clicking on "my preferences" and adjusting thumbnail size). [[Wikipedia:Image use policy#Displayed image size|Use of this parameter is discouraged]]. Use image_upright instead. Do not use "{{!mxt|×}}" or capital "{{!mxt|X}}"
|}
=== Inline lists ===
{{Main|WP:Manual of Style/Lists#Horizontal lists|WP:Manual of Style/Lists#Unbulleted lists}}
Parameters with multiple values should be formatted with inline-list templates.
'''Horizontal''' ones include {{tlx|hlist}} or {{tlx|flatlist}}. In [[Wikipedia:Manual of Style/Lists#Horizontal lists|horizontal style]], only the first item is capitalized (aside from [[Wikipedia:Manual of Style/Capital letters#Proper names|proper names]]).
This style is best for short items, and few of them. Mid-dots, commas or semicolons are available as separators (use semicolons or mid-dots if any items contain their own commas). For example:
* <code><nowiki>|parameter_name={{hlist |Foo |bar |baz}}</nowiki></code> → {{hlist |Foo |bar |baz}}
* <code><nowiki>|parameter_name={{cslist |Foo |bar |baz}}</nowiki></code> → {{cslist |Foo |bar |baz}}
* <code><nowiki>|parameter_name={{cslist |Foo, fee |bar, bor |baz, biz |semi=true}}</nowiki></code> → {{cslist |Foo, fee |bar, bor |baz, biz |semi=true}}
Horizontal list example with {{tlx|hlist|Item one|item two|item three}}: {{hlist|Item one|item two|item three}}
'''Vertical''' templates are {{tlx|plainlist}} and {{tlx|unbulleted list}} (vertical), use [[Wikipedia:Manual of Style/Lists#Unbulleted lists|unbulleted, non-indented lists]] for clean display in infoboxes. Entries may be all [[sentence case]], or all lowercase (aside from proper names) after the first.
This style is best for long items, and longer lists. For long lists of information that may not be of immediate interest but retained for reference, the {{tlx|collapsible list}} template can be used; this is not a universally accessible option, so should not be used for key information.
''[[Wikipedia:Manual of Style/Lists#Line breaks|Do not use {{tag|br|s}} markup]]'' to create fake lists, as in: <code>{{!mxt|<nowiki>Item one<br />item two<br />item three</nowiki>}}</code>.
Vertical list example:, using {{tlx|unbulleted list|Item one|item two|item three}}:
{{unbulleted list|Item one|item two|item three}}
== Example ==
{{Infobox person{{#ifeq:{{SUBPAGENAME}}|sandbox |/sandbox}}
| name = Bill Gates
| post-nominals =
| image = Bill Gates 2017 (cropped).jpg
| alt = Head and shoulders photo of Bill Gates
| caption = Gates in 2017
| birth_name = William Henry Gates III
| birth_date = {{birth date and age|1955|10|28}}
| birth_place = [[Seattle, Washington]], U.S.
| known_for = Co-founder of [[Microsoft]] and [[Bill & Melinda Gates Foundation]]
| education = [[Harvard University]] (dropped out)
| occupation = {{hlist|Software developer|investor|entrepreneur}}
| years_active = 1972–present
| title = {{indented plainlist|
* Co-[[chairperson]] of the Bill & Melinda Gates Foundation
* Chairman and founder of [[Branded Entertainment Network]]
* Chairman and founder of [[Cascade Investment]]
* Chairman and co-founder of [[TerraPower]]
* Founder of [[Breakthrough Energy]]
* Technology advisor of Microsoft}}
| boards = [[Berkshire Hathaway]]<br />Microsoft (former, both)
| spouse = {{marriage|[[Melinda French]]|January 1, 1994|August 2, 2021|reason=divorce}}
| children = 3
| father = [[Bill Gates Sr.]]
| mother = [[Mary Maxwell Gates|Mary Maxwell]]
| website = {{URL|https://www.gatesnotes.com}}
| awards = {{ubl|[[Presidential Medal of Freedom]] (2016)|[[Hilal-e-Pakistan]] (2022)}}
| signature = Bill Gates signature.svg
| signature_alt = William H. Gates III
}}
<syntaxhighlight lang="moin" style="overflow: auto">
{{Infobox person
| name = Bill Gates
| post-nominals =
| image = Bill Gates 2017 (cropped).jpg
| alt = Head and shoulders photo of Bill Gates
| caption = Gates in 2017
| birth_name = William Henry Gates III
| birth_date = {{birth date and age|1955|10|28}}
| birth_place = [[Seattle, Washington]], U.S.
| known_for = Co-founder of [[Microsoft]] and [[Bill & Melinda Gates Foundation]]
| education = [[Harvard University]] (dropped out)
| occupation = {{hlist|Software developer|investor|entrepreneur}}
| years_active = 1972–present
| title = {{indented plainlist|
* Co-[[chairperson]] of the Bill & Melinda Gates Foundation
* Chairman and founder of [[Branded Entertainment Network]]
* Chairman and founder of [[Cascade Investment]]
* Chairman and co-founder of [[TerraPower]]
* Founder of [[Breakthrough Energy]]
* Technology advisor of Microsoft}}
| boards = [[Berkshire Hathaway]]<br />Microsoft (former, both)
| spouse = {{marriage|[[Melinda French]]|January 1, 1994|August 2, 2021|reason=divorce}}
| children = 3
| father = [[Bill Gates Sr.]]
| mother = [[Mary Maxwell Gates|Mary Maxwell]]
| website = {{URL|https://www.gatesnotes.com}}
| awards = {{ubl|[[Presidential Medal of Freedom]] (2016)|[[Hilal-e-Pakistan]] (2022)}}
| signature = Bill Gates signature.svg
| signature_alt = William H. Gates III
}}
</syntaxhighlight>
== Microformat ==
{{UF-hcard-person}}
{{clear}}
== TemplateData ==
{{TemplateData header}}
<div style="width:auto; overflow:scroll">
<templatedata>
{
"description": "An infobox for articles about people",
"format": "{{_\n| __________________ = _\n}}\n",
"params": {
"honorific_prefix": {
"description": "Honorific prefix(es), to appear on the line above the person's name",
"label": "Honorific prefix",
"aliases": [
"honorific-prefix",
"honorific prefix",
"pre-nominals"
]
},
"name": {
"description": "Common name of person (defaults to article name if left blank; provide birth_name (below) if different from name). If middle initials are specified (or implied) by the lead of the article, and are not specified separately in the birth_name field, include them here.",
"label": "Name",
"required": true,
"type": "string"
},
"honorific_suffix": {
"description": "Honorific suffix(es), to appear on the line below the person's name",
"label": "Post-nominals",
"aliases": [
"honorific-suffix",
"honorific suffix",
"post-nominals"
]
},
"image": {
"description": "Image name: abc.jpg, xpz.png, 123.gif, etc. If an image is desired but not available, one may add \"yes\" to the \"needs-photo\" section of the :Template:WPBiography on the talkpage. If no image is available yet, do not use an image placeholder.",
"label": "Image",
"example": "abc.jpg, xpz.png, 123.gif",
"type": "wiki-file-name"
},
"image_size": {
"description": "DEPRECATED/DISCOURAGED. Size to display image: 200px (set width), x300px (set height), or 200x300px (max width & max height). This defaults to frameless (default is 220px, but logged in users can change this by clicking on \"my preferences\" and adjusting thumbnail size) if empty or omitted. Use of this parameter is discouraged as per WP:IMGSIZE. Use image_upright instead.",
"label": "DEPRECATED: Image size",
"aliases": [
"image size",
"imagesize"
],
"example": "200px",
"default": "220px",
"deprecated": "DEPRECATED: Use of this parameter is discouraged as per WP:IMGSIZE. Delete it when encountered and use image_upright instead."
},
"alt": {
"description": "Alt text for image, for visually impaired readers. One word (such as \"photograph\") is rarely sufficient. See WP:ALT.",
"label": "Alt",
"type": "string"
},
"caption": {
"description": "Caption for image, if needed. Try to include date of photo and the photographer.",
"label": "Caption",
"aliases": [
"image caption",
"image_caption"
],
"type": "string"
},
"native_name": {
"description": "The person's name in their own language, if different.",
"label": "Native name",
"type": "string"
},
"native_name_lang": {
"description": "ISO 639-1 code, e.g., \"fr\" for French. If more than one, use Template:lang in `native_name` instead.",
"label": "Native name language"
},
"pronunciation": {
"description": "Details of how to pronounce the individual's native name.",
"label": "Native name pronunciation"
},
"birth_name": {
"description": "Name at birth; only use if different from name.",
"label": "Birth name",
"aliases": [
"birthname"
],
"type": "string"
},
"birth_date": {
"description": "Date of birth: {{Birth date and age|YYYY|MM|DD}} for living people. For people who have died, use {{Birth date|YYYY|MM|DD}}. If only a year of birth is known, or age as of a certain date, consider using Template:birth year and age or Template:birth based on age as of date.",
"label": "Birth date",
"type": "content"
},
"birth_place": {
"description": "Place of birth: city, administrative region, sovereign state. Use the name of the birthplace at the time of birth, e.g.: Saigon (prior to 1976), Ho Chi Minh City (post 1976). Do not use a flag template.",
"label": "Birth place",
"type": "string"
},
"baptised": {
"description": "Date of baptism: ONLY for use when birth date is not known (e.g., Beethoven). Will not display if a birth date is entered. Do not use subtemplates. Parameter 'baptized' can be used for articles that use American english spelling.",
"label": "Baptised",
"aliases": [
"baptized"
],
"type": "date"
},
"disappeared_date": {
"description": "(For missing people) Date of disappearance: Template:disappeared date and age (if birth date is known) or Template:disappeared date (if birth date unknown).",
"label": "Disappeared date"
},
"disappeared_place": {
"description": "(For missing people) Place of disappearance: city, administrative region, sovereign state. Do not use a flag template.",
"label": "Disappeared place"
},
"disappeared_status": {
"description": "(For missing people) Current status for the person, e.g., if the person is still regarded as missing (using Template:missing for to calculate the time since disappearance), or if the person has been declared dead in absentia, with a date for such a ruling.",
"label": "Disappeared status",
"aliases": [
"status"
]
},
"death_date": {
"description": "Date of death: {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} (if birth date is known) or Template:death date (if birth date unknown). See Template:Death date/doc for details on usage. If exact dates are unknown, consider using Template:death year and age.",
"label": "Death date"
},
"death_place": {
"description": "Place of death: city, administrative region, sovereign state. Note: Do not use a flag template. Use the name of the deathplace at the time of death, e.g.: Saigon (prior to 1976), Ho Chi Minh City (post 1976)",
"label": "Death place",
"type": "string"
},
"death_cause": {
"description": "Cause of death. This should only be included when the cause of death has significance for the subject's notability.",
"label": "Death cause",
"aliases": [
"death cause"
]
},
"body_discovered": {
"description": "Place where the body was discovered (if different from place of death). Do not use a flag template.",
"label": "Body discovered",
"aliases": [
"body discovered"
]
},
"resting_place": {
"description": "Place of burial, ash-scattering, etc. Do not use a flag template.",
"label": "Resting place",
"aliases": [
"resting place",
"restingplace"
]
},
"resting_place_coordinates": {
"description": "Coordinates for place of burial, ash-scattering etc. Use Template:coord template.",
"label": "Resting place coordinates",
"aliases": [
"resting place coordinates",
"restingplacecoordinates"
]
},
"monuments": {
"description": "Significant monuments erected, buildings named, etc., in honour of the subject. If many, link to an appropriate section of the article instead.",
"label": "Monuments"
},
"nationality": {
"description": "Nationality. May be used instead of citizenship (below) or vice versa in cases where any confusion could result. Should only be used 'with' citizenship when they somehow differ. Should only be used if nationality cannot be inferred from the birthplace per [[WP:INFONAT]]. Do not use a flag template.",
"label": "Nationality",
"type": "string"
},
"other_names": {
"description": "Other notable names for the person, if different from name and birth_name.",
"label": "Other names",
"aliases": [
"other names",
"othername",
"alias"
]
},
"siglum": {
"description": "Siglum, monogram, shortcut, if relevant.",
"label": "Siglum"
},
"citizenship": {
"description": "Country of legal citizenship, if different from nationality. Rarely needed. See usage notes for nationality above. Should only be used if citizenship cannot be inferred from the birthplace. Do not use a flag template.",
"label": "Citizenship",
"type": "string"
},
"education": {
"description": "Education, e.g., degree, institution and graduation year, if relevant. If very little information is available or relevant, the `alma_mater` parameter may be more appropriate.",
"label": "Education"
},
"alma_mater": {
"description": "Alma mater. This parameter is a more concise alternative to `education`, and will most often simply consist of the linked name of the last-attended higher education institution. It is usually not relevant to include either parameter for non-graduates, but article talk page consensus may conclude otherwise, as at Bill Gates.",
"label": "Alma mater",
"aliases": [
"alma mater"
]
},
"occupation": {
"description": "Occupation(s) as given in the lead.",
"label": "Occupation"
},
"years_active": {
"description": "Date range in years during which the subject was active in their principal occupation(s) and/or other activity for which they are notable. Use the format 1950–2000, or 1970–present if still active (note the use of an en dash, not hyphen). If no dates of birth and/or death are known for the subject, only a floruit date range, as is common with ancient subjects, this parameter can be used for it. If approximate (circa) dates are known for either or both, put them in the birth_date and death_date parameters.",
"label": "Years active",
"aliases": [
"years active",
"yearsactive"
]
},
"era": {
"description": "Era during which the subject lived or was active. Less specific than 'years active'.",
"label": "Era"
},
"employer": {
"description": "Employer(s), if relevant.",
"label": "Employer"
},
"organization": {
"description": "Non-employing organization(s), if relevant.",
"label": "Organization",
"aliases": [
"organizations"
]
},
"agent": {
"description": "The subject's agent (individual and/or agency), discouraged in most cases, specifically when promotional, and requiring a reliable source.",
"label": "Agent"
},
"known_for": {
"description": "A brief description of what the person is notable for.",
"label": "Known For",
"aliases": [
"known for",
"known"
],
"example": "Environmental activism"
},
"notable_works": {
"description": "Title(s) of notable work(s) (publications, compositions, sculptures, films, etc.) by the subject, if any.",
"label": "Notable works",
"aliases": [
"works",
"credits",
"notable works"
]
},
"style": {
"description": "The style in which the subject works, if applicable.",
"label": "Style"
},
"net_worth": {
"deprecated": "DEPRECATED: Use of this parameter is discouraged. Delete it when encountered.",
"description": "Current estimated net worth, if relevant. Please be sure to support with a citation from a reliable source, in the article body.",
"label": "DEPRECATED: Net worth",
"aliases": [
"net worth",
"networth"
]
},
"height": {
"description": "If person was notable for their height, or if height is relevant. If used, this should also include the year of the measurement if the person had not reached full adulthood when this stat was published. See documentation of this parameter at Template:Infobox sportsperson for more information.",
"label": "Height"
},
"height_m": {
"description": "If person was notable for their height, or if height is relevant, their height in metres (it will be automatically converted to Imperial).",
"label": "Height in metres",
"type": "number"
},
"height_cm": {
"description": "If person was notable for their height, or if height is relevant, their height in centimetres (it will be automatically converted to Imperial).",
"label": "Height in centimetres",
"type": "number"
},
"height_ft": {
"description": "If person was notable for their height, or if height is relevant, their height in whole feet (it will be automatically converted to SI). Use with height_in.",
"label": "Height in feet",
"type": "number"
},
"height_in": {
"description": "If person was notable for their height, or if height is relevant, their height in remaining inches (it will be automatically converted to SI). Use with height_ft.",
"label": "Remaining height in inches",
"type": "number"
},
"weight": {
"deprecated": "DEPRECATED: Use of this parameter is discouraged. Delete it when encountered.",
"label": "DEPRECATED: Weight"
},
"weight_kg": {
"deprecated": "DEPRECATED: Use of this parameter is discouraged. Delete it when encountered.",
"description": "If person was notable for their weight, or if weight is relevant, their weight in kilogrammes (it will be automatically converted to Imperial).",
"label": "DEPRECATED: Weight in kilogrammes"
},
"weight_lb": {
"deprecated": "DEPRECATED: Use of this parameter is discouraged. Delete it when encountered.",
"description": "If person was notable for their weight, or if weight is relevant, their weight in pounds, or their weight in remaining pounds if weight in whole stones is specified (it will be automatically converted to SI).",
"label": "DEPRECATED: Weight in pounds"
},
"weight_st": {
"deprecated": "DEPRECATED: Use of this parameter is discouraged. Delete it when encountered.",
"description": "If person was notable for their weight, or if weight is relevant, their weight in whole stones (it will be automatically converted to SI).",
"label": "DEPRECATED: Weight in stones"
},
"television": {
"description": "Television programmes presented by or closely associated with the subject.",
"label": "Television"
},
"title": {
"description": "Multiple uses: Formal title, such as First Lady of Japan for Akie Abe.; Awarded title, such as Mr. Olympia for Arnold Schwarzenegger.; Job title, such as President of Calvin College for Anthony Diekema.; A combination of the above, such as Professor of Mathematics and Fellow of the Royal Society for Bill Parry See also \"awards\" parameter, below, for awarded honors that are not really titles. A single award should not use both parameters.",
"label": "Title"
},
"term": {
"description": "Years the person held the title listed above.",
"label": "Term"
},
"predecessor": {
"description": "Person who previously held the title listed above.",
"label": "Predecessor"
},
"successor": {
"description": "Person who subsequently held the title listed above.",
"label": "Successor"
},
"party": {
"description": "If relevant. Field labelled Political party.",
"label": "Party"
},
"otherparty": {
"description": "If relevant. Field labelled Other political affiliations.",
"label": "Other party"
},
"movement": {
"description": "If relevant. '''Movement''' can be social, political (non-party), artistic, philosophical, literary, cultural, etc.",
"label": "Movement"
},
"opponents": {
"description": "Notable relevant opponents (e.g., for major political office).",
"label": "Opponents"
},
"boards": {
"description": "For board of directors membership(s), if relevant. Field labeled Board member of.",
"label": "Boards"
},
"criminal_charges": {
"description": "For convicted criminals only. Please be certain to support these parameters with citations from reliable sources in the article body.",
"label": "Criminal charge(s)",
"aliases": [
"criminal_charge",
"criminal charge"
]
},
"criminal_penalty": {
"label": "Criminal penalty",
"description": "For convicted criminals only. Please be certain to support these parameters with citations from reliable sources, in the article body.",
"aliases": [
"criminal penalty"
]
},
"criminal_status": {
"label": "Criminal status",
"description": "For convicted criminals only. Please be certain to support these parameters with citations from reliable sources, in the article body.",
"aliases": [
"judicial_status",
"judicial status",
"criminal status"
]
},
"spouse": {
"description": "Name of spouse(s), followed by years of marriage. Use the format Name (married 1950–present) for a current spouse, and Name (married 1970–99) for former spouse(s). Separate entries using Template:Plainlist or Template:Unbulleted list. For deceased persons still married at time of death, do not include an end year. {{Marriage}} may be used.",
"label": "Spouse(s)",
"aliases": [
"spouses",
"spouse(s)"
]
},
"partner": {
"description": "For unmarried life partners in a domestic partnership (of any gender or sexual orientation), not business partners. Use the format Name (1950–present) for current partner and Name (1970–99) for former partner(s).",
"label": "Partner(s)",
"aliases": [
"partners",
"partner(s)",
"domestic_partner",
"domesticpartner"
]
},
"children": {
"description": "Number of children (e.g., 3), or list of independently notable names, in which case, separate entries using Template:Plainlist or Template:Unbulleted list. Names may be preceded by a number to show total children and avoid implying that named children are the only offspring. For privacy reasons, consider omitting the names of children of living persons, unless notable.",
"label": "Children"
},
"parents": {
"description": "Names of parents. Separate entries using Template:Plainlist or Template:Unbulleted list. If subject has only one notable mother and/or father, 'mother' and 'father' parameters may be used instead",
"label": "Parent(s)"
},
"mother": {
"description": "Name of mother; include only if subject has one mother who is independently notable or particularly relevant. Overwritten by 'parents' parameter.",
"label": "Mother",
"type": "wiki-page-name"
},
"father": {
"description": "Name of father; include only if subject has one father who is independently notable or particularly relevant. Overwritten by 'parents' parameter.",
"label": "Father",
"type": "wiki-page-name"
},
"relatives": {
"description": "Names of siblings or other relatives. Include the relationship in parentheses after the name (sister, uncle, etc). Separate entries using Template:Plainlist or Template:Unbulleted list.",
"label": "Relatives",
"aliases": [
"relations"
]
},
"family": {
"description": "Family or house of the individual, if notable.",
"label": "Family"
},
"callsign": {
"description": "Amateur radio call sign, if relevant.",
"label": "Callsign"
},
"awards": {
"description": "Notable awards. If many, link to an appropriate section of the article instead. See also \"title\" parameter, above, for awarded titles. A single award should not use both parameters.",
"label": "Awards"
},
"honours": {
"description": "Honours the individual has been awarded, if notable.",
"label": "Honours",
"aliases": [
"honors"
]
},
"website": {
"description": "Official website only. Unofficial websites should be placed under ==External links== in the body of the article. Use Template:URL as in Example.com . Do not include the www. part unless the server requires it. Use camel case capitalization to make multiword domain names easier to read.",
"label": "Website",
"aliases": [
"homepage",
"URL",
"url"
],
"type": "content"
},
"module": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module",
"aliases": [
"misc"
]
},
"module2": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module two",
"aliases": [
"misc2"
]
},
"module3": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module three",
"aliases": [
"misc3"
]
},
"module4": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module four",
"aliases": [
"misc4"
]
},
"module5": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module five",
"aliases": [
"misc5"
]
},
"module6": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module six",
"aliases": [
"misc6"
]
},
"child": {
"label": "DEPRECATED: Use as an embedded infobox",
"description": "DEPRECATED: Use this infobox within another one. For experts only.",
"example": "yes",
"deprecated": true,
"aliases": [
"embed"
]
},
"signature": {
"description": "An image of the person's signature. Please use image name: abc.jpg, xpz.png, 123.gif, etc.",
"label": "Signature",
"type": "wiki-file-name"
},
"signature_size": {
"description": "Default is 150px. If necessary, a signature can be resized manually as per the \"image_size\" parameter.",
"label": "Signature size"
},
"signature_alt": {
"description": "Alt text for the signature image. For example, for :File:Thomas Jefferson Signature.svg, the alt text might be |signature_alt= Th: Jefferson, spelling out the signature exactly as it appears in the image.",
"label": "Signature alt",
"aliases": [
"signature alt"
],
"type": "string"
},
"footnotes": {
"description": "Notes about any of the infobox data.",
"label": "Footnotes"
},
"abovestyle": {
"description": "DEPRECATED: A CSS style to use for the individual's name, over-riding the community norm. Only use in exception circumstances.",
"label": "DEPRECATED: Name CSS over-ride",
"deprecated": true
},
"image_upright": {
"label": "Image upright",
"description": "Scales the image thumbnail from its default size by the given factor. Values less than 1 scale the image down (0.9 = 90%) and values greater than 1 scale the image up (1.15 = 115%).",
"example": "1.15",
"default": "1",
"type": "number"
},
"landscape": {
"label": "Landscape",
"description": "Set to yes when using wide, short images. The image height (rather than width) will be limited to 200 pixels.",
"type": "boolean"
},
"burial_place": {
"label": "Burial place",
"description": "Place of burial, alternative to 'Resting place' Displays the label 'Burial place'.",
"type": "content"
},
"burial_coordinates": {
"label": "Burial place coordinates",
"description": "Coordinates for place of burial, to accompany 'Burial place'. Use {{coord}} template."
},
"influences": {
"label": "DEPRECATED: Influences",
"description": "DEPRECATED and unused in the infobox. Do not use.",
"deprecated": "Deprecated. Unused in the infobox. Do not use."
},
"influenced": {
"label": "DEPRECATED: Influenced",
"description": "DEPRECATED and unused in the infobox. Do not use.",
"deprecated": "Deprecated. Unused in the infobox. Do not use."
},
"home_town": {
"aliases": [
"home town"
],
"label": "DEPRECATED: home_town",
"description": "The place where the person was raised and matured, if different from birth place.",
"deprecated": "DEPRECATED and now unused in the infobox. Do not use."
}
},
"paramOrder": [
"honorific_prefix",
"name",
"honorific_suffix",
"image",
"image_upright",
"landscape",
"image_size",
"alt",
"caption",
"native_name",
"native_name_lang",
"pronunciation",
"other_names",
"siglum",
"birth_name",
"birth_date",
"birth_place",
"baptised",
"disappeared_date",
"disappeared_place",
"disappeared_status",
"death_date",
"death_place",
"death_cause",
"body_discovered",
"resting_place",
"resting_place_coordinates",
"burial_place",
"burial_coordinates",
"monuments",
"nationality",
"citizenship",
"education",
"alma_mater",
"occupation",
"years_active",
"era",
"employer",
"organization",
"agent",
"known_for",
"notable_works",
"style",
"net_worth",
"height",
"height_m",
"height_cm",
"height_ft",
"height_in",
"weight",
"weight_kg",
"weight_lb",
"weight_st",
"television",
"title",
"term",
"predecessor",
"successor",
"party",
"otherparty",
"movement",
"opponents",
"boards",
"criminal_charges",
"criminal_penalty",
"criminal_status",
"spouse",
"partner",
"children",
"parents",
"mother",
"father",
"relatives",
"family",
"callsign",
"awards",
"honours",
"website",
"module",
"module2",
"module3",
"module4",
"module5",
"module6",
"signature",
"signature_size",
"signature_alt",
"footnotes",
"abovestyle",
"child",
"influences",
"influenced",
"home_town"
]
}
</templatedata>
</div>
== Tracking categories ==
* {{clc|Pages using infobox person with unknown parameters}}
* {{clc|Pages using infobox person with unknown empty parameters}}
* {{clc|Pages using infobox person with conflicting parameters}}
* {{clc|Pages using infobox person with deprecated net worth parameter}}
* {{clc|Pages using infobox person with multiple employers}}
* {{clc|Pages using infobox person with multiple organizations}}
* {{clc|Pages using infobox person with multiple agents}}
* {{clc|Pages using infobox person with multiple labels}}
* {{clc|Pages using infobox person with multiple opponents}}
* {{clc|Pages using infobox person with multiple criminal charges}}
* {{clc|Pages using infobox person with multiple spouses}}
* {{clc|Pages using infobox person with multiple partners}}
* {{clc|Pages using infobox person with multiple parents}}
* {{clc|Infobox person using numbered parameter}} (a subset of the "unknown parameters" category)
* {{clc|Infobox person using certain parameters when dead}}
* {{clc|Biography template using pronunciation}}
* {{clc|Biography with signature}}
* {{clc|No local image but image on Wikidata}} – Used by [[Template:Wikidata image]] to track articles where an infobox has no image but [[Wikidata]] has an image name. To exclude articles from this category, add an image or {{para|nocat_wdimage|yes}} to the infobox.
== See also ==
Variations of this template which use [[Wikidata]]:
* {{tl|Infobox person/Wikidata}}
Alternative templates are listed at [[Wikipedia:WikiProject Biography/Infoboxes|WikiProject Biography/Infoboxes]] and within the [[:Category:People and person infobox templates|people and person infobox templates category]].
<div style="display: none">{{reflist}}</div>
{{Film- and television-related infobox templates}}
<includeonly>
{{Basepage subpage|
[[Category:People and person infobox templates| ]]
[[Category:Biographical templates usable as a module|Person]]
[[Category:Infobox templates with module parameter|Person]]
[[Category:Templates that add a tracking category]]
}}
</includeonly>
so4a7my6m2k6b14yrs3ms41b1va5rn9
Templat:Age in years
10
386871
2444295
2022-08-13T13:36:20Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
{{#invoke:age|age_generic|template=age_in_years}}<noinclude>
{{Documentation}}
</noinclude>
t5ppv7foxwcj4h7eez5qo7s5kj6256f
Templat:Q
10
386872
2444297
2022-08-13T13:37:02Z
David Wadie Fisher-Freberg
51
←Mengalihkan ke [[Templat:Wikidata entity link]]
wikitext
text/x-wiki
#ALIH [[Templat:Wikidata entity link]]
9ln4ymh1zb0zle9iilz3xf806ruk4x0
Templat:Wikidata entity link
10
386873
2444298
2022-08-13T13:37:14Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}
| {{#switch:{{padleft:|1|{{uc:{{{1}}}}}}}
| Q | P = [[d:Special:EntityPage/{{uc:{{{1}}}}}|{{#invoke:wd|label|{{uc:{{{1}}}}}}} <small>({{uc:{{{1}}}}})</small>]]
| #default = [[d:Special:EntityPage/Q{{uc:{{{1}}}}}|{{#invoke:wd|label|Q{{uc:{{{1}}}}}}} <small>(Q{{uc:{{{1|}}}}})</small>]]
}}
| {{#if:{{#invoke:wd|label|raw}}
| [[d:Special:EntityPage/{{#invoke:wd|label|raw}}|{{#invoke:wd|label}} <small>({{#invoke:wd|label|raw}})</small>]]
| <small>(no entity)</small>
}}
}}</includeonly><noinclude>{{Documentation}}</noinclude>
7blupfawedlkav9rkt891x7ri892zm0
Templat:Uses Wikidata
10
386874
2444301
2022-08-13T13:42:58Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
{{Sister project
| position = {{{position|}}}
| project = data
| text = This {{module other|module|template}} uses {{#if:{{{section|}}} | one or more [[Wikidata]] properties; see [[#{{{section}}}|§ {{{section}}}]] for details. | the [[Wikidata]] propert{{#if:{{{2|}}}|ies|y}}:
{{#invoke:Uses Wikidata|usesProperty}}
}}}}{{#switch:{{SUBPAGENAME}}
|sandbox |testcases |doc= <!--no category-->
|#default={{#ifeq:{{PAGENAME}} |Uses Wikidata ||{{module other |[[Category:Modules using data from Wikidata]] |{{template other |[[Category:Templates using data from Wikidata]]}} }} }}
}}<!--
--><noinclude>{{documentation}}</noinclude>
8t7xwe3iop3f14jub3825lfnq96ztj3
Templat:Warning
10
386875
2444302
2022-08-13T13:43:27Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
{{Mbox
| name = Warning
| demospace = {{{demospace|}}}
| style = {{#if:{{{style|}}} |{{{style}}} }}
| subst = <includeonly>{{subst:substcheck}}</includeonly>
| type = content
| image = {{#if:{{{image|}}}| [[File:{{{image}}}|{{{imagesize|40px}}}|Warning]] }}
| small = {{{small|}}}
| smallimage = {{#if:{{{image|}}}| [[File:{{{image}}}|30px|Warning]]}}
| imageright = {{#if:{{{imageright|}}} |{{{imageright}}} |{{#if:{{{shortcut|{{{shortcut1|}}}}}} |{{Ombox/shortcut|{{{shortcut|{{{shortcut1|}}}}}}|{{{shortcut2|}}}|{{{shortcut3|}}}|{{{shortcut4|}}}|{{{shortcut5|}}}}}}} }}
| textstyle = {{{textstyle|text-align: {{#if:{{{center|}}}|center|{{{align|left}}}}};}}}
| text = {{#if:{{{header|{{{heading|{{{title|}}}}}}}}} |<div style="{{{headstyle|text-align: {{#if:{{{center|}}}|center|left}};}}}">'''{{{header|{{{heading|{{{title|}}}}}}}}}'''</div>}}<!--
-->{{{text|{{{content|{{{reason|{{{1}}}}}}}}}}}}
}}<noinclude>
<!-- Add categories to the /doc subpage; interwikis go to Wikidata. -->
{{Documentation}}
</noinclude>
6vzaqvd2g0rpbfp6wqapmrxa5l2mdjy
Modul:Uses Wikidata
828
386876
2444303
2022-08-13T13:44:10Z
David Wadie Fisher-Freberg
51
b
Scribunto
text/plain
local p = {}
function p.usesProperty(frame)
local args = frame.getParent(frame).args or nil
if mw.text.trim(args[1] or '') == '' then
args = frame.args
end
local result = '<ul>'
local ii = 1
while true do
local p_num = mw.text.trim(args[ii] or '')
if p_num ~= '' then
local label = mw.wikibase.getLabel(p_num) or "NO LABEL"
result = result .. "<li>[[File:Disc Plain blue dark.svg|middle|4px|link=|alt=]] <b><i>[[d:Property talk:" .. p_num .. "|" .. label .. " (" .. string.upper(p_num) .. ")]]</i></b> (see <span class='plainlinks'>[https://query.wikidata.org/embed.html#SELECT%20%3FWikidata_item_%20%3FWikidata_item_Label%20%3Fvalue%20%3FvalueLabel%20%3FEnglish_Wikipedia_article%20%23Show%20data%20in%20this%20order%0A%7B%0A%09%3FWikidata_item_%20wdt%3A" .. p_num .. "%20%3Fvalue%20.%20%23Collecting%20all%20items%20which%20have%20" .. p_num .. "%20data%2C%20from%20whole%20Wikidata%20item%20pages%0A%09OPTIONAL%20%7B%3FEnglish_Wikipedia_article%20schema%3Aabout%20%3FWikidata_item_%3B%20schema%3AisPartOf%20%3Chttps%3A%2F%2Fen.wikipedia.org%2F%3E%20.%7D%20%23If%20collected%20item%20has%20link%20to%20English%20Wikipedia%2C%20show%20that%0A%09SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20%20%7D%20%23Show%20label%20in%20this%20language.%20%22en%22%20is%20English.%20%20%20%0A%7D%0ALIMIT%201000 uses]</span>)</li>"
ii = ii + 1
else break
end
end
result = result.."</ul>"
return result
end
function p.tuProperty(frame)
local parent = frame.getParent(frame)
local result = '<ul>'
local ii = 1
while true do
local p_num = mw.text.trim(parent.args[ii] or '')
if p_num ~= '' then
local label = mw.wikibase.getLabel(p_num) or "NO LABEL"
result = result .. "<li><span style='font-size:90%;line-height:1;'>●</span> <b>[[d:Property:" .. p_num .. "|" .. label .. "]]</b> <span style='font-size:90%;'>([[d:Property talk:" .. string.upper(p_num) .. "|" .. p_num .. "]])</span></li>"
ii = ii + 1
else break
end
end
result = result.."</ul>"
return result
end
return p
gad8tmz2g178xujb54f023qxaos8yw9
Modul:Wd/doc
828
386877
2444307
2022-08-13T13:46:58Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
{{Module rating|protected}}
{{High-use|risk}}
{{ombox|text=You might want to use one of the user-friendly wrapper templates {{t|Wikidata}} and {{t|WikidataOI}} instead of invoking this module directly.}}
{{Wikidata/doc|prename=<nowiki/>#invoke:|prename_code=#invoke:|section==== Main class ===
The <code>main</code> command is always used alone and does not take any flags or arguments. It allows parent templates to pass on their parameters in the form of commands to this module.
<table class="wikitable">
<tr>
<th>Command</th>
<th>Basic usage</th>
<th>Description</th>
</tr>
<tr>
<th style="text-align:left;"><code>main</code></th>
<td>{{nowrap|{{tnull|<nowiki/>#invoke:{{lc:{{ROOTPAGENAME}}}}|main}}}}</td>
<td>Intended for use by wrapper templates (around this module) to invoke one or more of the above commands, returning their respective output.
<p>The parameters passed to the wrapper template are the ones that will be used by the module, e.g. {{tnull|wikidata|'''property'''|'''P1549'''}} → {{tnull|<nowiki/>#invoke:wd|main}} → {{tnull|<nowiki/>#invoke:wd|main|'''property'''|'''P1549'''}}.</p>
<p>Therefore, any parameters set by the wrapper template itself will be discarded, e.g. {{tnull|wikidata|'''property'''|'''P1549'''}} → {{tnull|<nowiki/>#invoke:wd|main|{{color|red|qualifier}}|{{color|red|P1082}}|{{color|red|P585}}}} → {{tnull|<nowiki/>#invoke:wd|main|'''property'''|'''P1549'''}}.</p>
</td>
</tr>
</table>}}
i6bty7pyt5iewk0jmh7kmt8ataf4g58
Templat:WikidataOI
10
386878
2444308
2022-08-13T13:48:03Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
<includeonly>{{safesubst:#if:{{{ifeq|}}}|{{safesubst:#ifeq:{{{fetch|}}}|{{{ifeq}}}|{{safesubst:#invoke:Wd|main}}}}|{{safesubst:#if:{{{fetch|}}}|{{safesubst:#invoke:Wd|main}}}}}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
gsa8ls1ose31mmuesud6h881anp0lum
Templat:Birth-date and age
10
386879
2444312
2022-08-13T14:49:41Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
<includeonly>{{birth-date|dt={{{dt|}}}|{{{gregorian|{{{1|}}}}}}|{{{2|{{{1|}}}}}}}} (age {{age|{{#ifeq:"{{lc:{{{1|0009-11}}}}}"|"{{padleft:{{#expr:{{{1|0009-11}}}}}|4|0}}"|<!--Here if it is a 4 digit year only-Test1 satisfied: see talk -->{{{1|0009-11}}}|{{#expr: {{#iferror:{{#ifexpr:((abs({{{1|0009-11}}}))< 1900) and ({{#time:Y|{{{1|0009-11}}}}} >1900) | {{#ifexpr:({{#time:Y|{{{1|0009-11}}}}}) <2000|{{#expr:{{#time:Y|{{{1|0009-11}}}}}-1900}}|{{#expr:{{#time:Y|{{{1|0009-11}}}}}-2000}} }} |{{#time:Y|{{{1|0009-11}}}}} }}|{{#time:Y|{{{1|0009-11}}}}} }}{{#switch:{{{bce|}}}|b|bd|d|db=*(-1) +1}}}} }}|{{#time:m|{{{1|}}}}}|{{#time:d|{{{1|}}}}} }}){{#invoke:check for unknown parameters|check|unknown={{#ifeq:{{NAMESPACENUMBER}}|0|[[Category:Birth-date and age transclusions with invalid parameters|_VALUE_]]}}|preview=unknown parameter "_VALUE_"|1|2|dt|gregorian|bce}}</includeonly><noinclude>
{{documentation}}
</noinclude>
a1yrh3ppg5f3ko24cbo9jfihmbbyn20
Templat:Collapse bottom
10
386880
2444313
2022-08-13T14:50:03Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
<includeonly>|}</div></includeonly><noinclude>
{{Documentation|Template:Collapse top/doc}}
<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
brg0xxydzz07jqyt62vdk8nb02zd0ob
Templat:Collapse top
10
386881
2444314
2022-08-13T14:50:18Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
<div style="margin-left:{{{indent|0}}}"><!-- NOTE: width renders incorrectly if added to main STYLE section -->
{| <!-- Template:Collapse top --> class="mw-collapsible {{<includeonly>safesubst:</includeonly>#if:{{{expand|{{{collapse|}}}}}}||mw-collapsed}} {{{class|}}}" style="background: {{{bg1|transparent}}}; text-align: left; border: {{{border|1px}}} solid {{{b-color|Silver}}}; margin: 0.2em auto auto; width:{{<includeonly>safesubst:</includeonly>#if:{{{width|}}}|{{{width}}}|100%}}; clear: {{{clear|both}}}; padding: 1px;"
|-
! style="background: {{{bg|#{{main other|F0F2F5|CCFFCC}}}}}; font-size:87%; padding:0.2em 0.3em; text-align:{{<includeonly>safesubst:</includeonly>#if:{{{left|}}}|left|{{<includeonly>safesubst:</includeonly>#if:{{{align|}}}|left|center}}}}; {{<includeonly>safesubst:</includeonly>#if:{{{fc|}}}|color: {{{fc}}};|}}" | <div style="font-size:115%;{{<includeonly>safesubst:</includeonly>#if:{{{left|}}}||margin:0 4em}}">{{{1|{{{title|{{{reason|{{{header|{{{heading|{{{result|Extended content}}}}}}}}}}}}}}}}}}</div>
{{<includeonly>safesubst:</includeonly>#if:{{{warning|{{{2|}}}}}}
|{{<includeonly>safesubst:</includeonly>!}}-
{{<includeonly>safesubst:</includeonly>!}} style="text-align:center; font-style:italic;" {{<includeonly>safesubst:</includeonly>!}} {{{2|The following is a closed discussion. {{strongbad|Please do not modify it.}} }}} }}
|-
| style="border: solid {{{border2|1px Silver}}}; padding: {{{padding|0.6em}}}; background: {{{bg2|White}}};" {{<includeonly>safesubst:</includeonly>!}}<noinclude>
{{lorem ipsum|3}}
{{Collapse bottom}}
{{Documentation}}
</noinclude>
7r1tuthlxr6p6uk1quv9ajwsic05cc1
Templat:Lorem ipsum
10
386882
2444315
2022-08-13T14:50:39Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
{{#ifexpr:{{{1|1}}}>0|{{Lorem ipsum/p-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P1|link={{{link|{{{4|no}}}}}}}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>1|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P2}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>2|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P3}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>3|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P4}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>4|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P5}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>5|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P6}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>6|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P7}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>7|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P8}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>8|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P9}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>9|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P10}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>10|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P11}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>11|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P12}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>12|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P13}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>13|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P14}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>14|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P15}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>15|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P16}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>16|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P17}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>17|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P18}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>18|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P19}}{{{3|}}}
|}}{{#ifexpr:{{{1|1}}}>19|{{Lorem ipsum/pb-cond|{{{2|}}}|{{{join|}}}}}{{{2|}}}{{Lorem ipsum/P20}}{{{3|}}}}}{{Lorem ipsum/p-end-cond|{{{2|}}}|{{{join|}}}}}<includeonly>{{#ifeq:{{{cat|}}}|no||{{Template:Main other|[[Category:Wikipedia articles containing placeholders]]}}}}</includeonly><noinclude>
{{Documentation}}
<!-- PLEASE ADD CATEGORIES TO THE /doc SUBPAGE, AND INTERWIKIS TO WIKIDATA, THANKS -->
</noinclude>
h1d3n629kxkdbp81g31sos11tuyqcyk
Templat:Infobox person module documentation
10
386883
2444316
2022-08-13T14:51:08Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
This infobox may be used to create a genre-specific section within {{tl|Infobox person}} (or similar [[:Category:People and person infobox templates|biographical infobox templates]]) for cases where a person may be notable in more than one field; a generic example is shown below. For guidance on usage, see [[Wikipedia:Infobox modules]]. Also see the [[Template:Infobox]] documentation which explains [[Template:Infobox/doc#Embedding|embedding]] and [[Template:Infobox/doc#Subboxes|subboxes]].
<nowiki>{{</nowiki>Infobox person
| name =
| image =
| caption =
| birth_date =
| birth_place =
| <nowiki><!--</nowiki> ''[[et cetera|etc.]]'' <nowiki>--></nowiki>
| module =
<nowiki>{{</nowiki>{{{1|{{{template|<includeonly>{{BASEPAGENAME}}</includeonly><noinclude>EMBEDDED TEMPLATE NAME</noinclude>}}}}}} | {{#if:{{{parameter|}}} | {{{parameter}}}=yes | child=yes <nowiki><!--</nowiki> ''or'' embed=yes ''or'' subbox=yes <nowiki>--></nowiki>}}
| {{{2|{{{example_parameter1|parameter-1}}}}}} =
| {{{3|{{{example_parameter2|parameter-2}}}}}} =
| {{{4|{{{example_parameter3|parameter-3}}}}}} =
| {{{5|{{{example_parameter4|parameter-4}}}}}} =
| <nowiki><!--</nowiki> ''etc.'' <nowiki>--></nowiki>
}}
}}<noinclude>
[[Category:Template namespace templates]]
[[Category:Documentation shared content templates]]
</noinclude>
cc9zuiwvyr54xdybqpjjmcx0g01ngkt
Templat:Infobox rugby biography
10
386884
2444317
2022-08-13T14:51:40Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
<includeonly>{{short description|Rugby player|noreplace}}{{Infobox
| child = {{Yesno|{{{embed|no}}}}}
| bodyclass = vcard
| title = {{#ifeq:{{Yesno|{{{embed|no}}}}}|yes
|<div style="background: #b0c4de; width:100%;font-weight:bold;">Rugby career</div>
|<div class="fn">{{{name|{{PAGENAMEBASE}}}}}</div>{{#if:{{{honorific_suffix|}}}|<div class="honorific-suffix" style="font-size: 77%; font-weight: normal; display:inline;">{{{honorific_suffix|}}}</div>}}
}}
| headerstyle = background-color: #b0c4de;
| labelstyle = white-space:nowrap;
| autoheaders = y
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|}}}|sizefault=frameless|upright=1|alt={{{alt|}}}}}
| caption = {{{caption|}}}
| label1 = {{#if:{{{birth_name|}}}|Birth name|Full name}}
| data1 = {{if empty|{{{birth_name|}}}|{{{full_name|{{{fullname|}}}}}}}}
| label3 = Date of birth
| data3 = {{{birth_date|}}}
| label4 = Place of birth
| data4 = {{{birth_place|}}}
| label5 = Date of death
| data5 = {{{death_date|}}}
| label6 = Place of death
| data6 = {{{death_place|}}}
| label7 = Height
| data7 = {{#if:{{{height|}}}{{{height_cm|}}}{{{height_ft|}}}{{{height_in|}}}|{{convinfobox|{{{height_cm|}}}|cm|{{{height_ft|}}}|ft|{{{height_in|}}}|in|{{#if:{{{height_ft|}}}{{{height_in|}}}|0}}}} {{#if: {{{height|}}} | {{Infobox person/height|{{{height}}}}}}}}}
| label8 = Weight
| data8 = {{#if:{{{weight|}}}{{{weight_kg|}}}{{{weight_st|}}}{{{weight_lb|}}}|{{convinfobox|{{{weight_kg|}}}|kg|{{{weight_st|}}}|st|{{{weight_lb|}}}|lb|{{#if:{{{weight_kg|}}}{{{weight_lb|}}}|0}}}} {{#if: {{{weight|}}} | {{Infobox person/weight|{{{weight}}}}}}}}}
| label9 = School
| data9 = {{{school|}}}
| label10 = University
| data10 = {{{university|}}}
| label11 = Notable relative(s)
| data11 = {{{relatives|}}}
| label12 = Spouse
| data12 = {{{spouse|}}}
| label13 = Children
| data13 = {{{children|}}}
| label14 = Occupation(s)
| data14 = {{{occupation|}}}
| data15 = {{Infobox rugby biography/correct date|{{{weight_update|}}}|pretext= Height and weight}}
<!--
***Rugby League***
-->
| header20 = Rugby league career
| data21 = {{#if:{{{rl_currentposition|{{{rl_position|}}}}}}{{{rl_currentteam|}}}{{{rl_youthclubs1|}}}{{{rl_amateurclubs1|}}}{{{rl_proclubs1|}}}{{{sooteam1|}}}{{{rl_nationalteam1|}}}{{{rl_coachteams1|}}}{{{rl_refereecomps1|}}}|{{Infobox3cols
| child = yes
| headerstyle = background-color: #e0ffff;
| labelstyle = white-space:nowrap; font-weight: normal;
| datastyle = white-space: nowrap; vertical-align: baseline
| datastylea = white-space: nowrap; vertical-align: baseline
| datastyleb = white-space: nowrap; vertical-align: baseline; text-align: right
| datastylec = white-space: nowrap; vertical-align: baseline; text-align: right
| label4 = '''Position(s)'''
| class4 = role
| data4 = {{Use first nonempty | {{{rl_currentposition|}}} | {{{rl_position|}}} }}
| label5 = '''Current team'''
| class5 = org
| data5 = {{{rl_currentteam|}}}
<!--
*****RL YOUTH*****
-->
| header10 = {{#if:{{{rl_youthclubs1|}}}|Youth career}}
| label11 = {{#if:{{{rl_youthclubs1|}}}|{{{rl_youthyears1|–}}}}}
| data11 = {{{rl_youthclubs1|}}}
| label12 = {{#if:{{{rl_youthclubs2|}}}|{{{rl_youthyears2|–}}}}}
| data12 = {{{rl_youthclubs2|}}}
| label13 = {{#if:{{{rl_youthclubs3|}}}|{{{rl_youthyears3|–}}}}}
| data13 = {{{rl_youthclubs3|}}}
| label14 = {{#if:{{{rl_youthclubs4|}}}|{{{rl_youthyears4|–}}}}}
| data14 = {{{rl_youthclubs4|}}}
| label15 = {{#if:{{{rl_youthclubs5|}}}|{{{rl_youthyears5|–}}}}}
| data15 = {{{rl_youthclubs5|}}}
<!--
*****RL AMATEUR*****
-->
| header20 = {{#if:{{{rl_amateurclubs1|}}}|Amateur team(s)}}
| label21 = {{#if:{{{rl_amateurclubs1|}}}|'''Years'''}}
| data21a = {{#if:{{{rl_amateurclubs1|}}}|'''Team'''}}
| data21b = {{#if:{{{rl_amateurclubs1|}}}|'''Apps'''}}
| data21c = {{#if:{{{rl_amateurclubs1|}}}|'''(Points)'''}}
| label22 = {{#if:{{{rl_amateurclubs1|}}}|<nowiki />{{{rl_amateuryears1|–}}}}}
| data22a = {{{rl_amateurclubs1|}}}
| data22b = {{{rl_amateurapps1|}}}
| data22c = ({{{rl_amateurpoints1|}}})
| label23 = {{#if:{{{rl_amateurclubs2|}}}|<nowiki />{{{rl_amateuryears2|–}}}}}
| data23a = {{{rl_amateurclubs2|}}}
| data23b = {{{rl_amateurapps2|}}}
| data23c = ({{{rl_amateurpoints2|}}})
| label24 = {{#if:{{{rl_amateurclubs3|}}}|<nowiki />{{{rl_amateuryears3|–}}}}}
| data24a = {{{rl_amateurclubs3|}}}
| data24b = {{{rl_amateurapps3|}}}
| data24c = ({{{rl_amateurpoints3|}}})
| label25 = {{#if:{{{rl_amateurclubs4|}}}|<nowiki />{{{rl_amateuryears4|–}}}}}
| data25a = {{{rl_amateurclubs4|}}}
| data25b = {{{rl_amateurapps4|}}}
| data25c = ({{{rl_amateurpoints4|}}})
| label26 = {{#if:{{{rl_amateurclubs5|}}}|<nowiki />{{{rl_amateuryears5|–}}}}}
| data26a = {{{rl_amateurclubs5|}}}
| data26b = {{{rl_amateurapps5|}}}
| data26c = ({{{rl_amateurpoints5|}}})
| label27 = {{#if:{{{rl_amateurclubs6|}}}|<nowiki />{{{rl_amateuryears6|–}}}}}
| data27a = {{{rl_amateurclubs6|}}}
| data27b = {{{rl_amateurapps6|}}}
| data27c = ({{{rl_amateurpoints6|}}})
| label28 = {{#if:{{{rl_amateurclubs7|}}}|<nowiki />{{{rl_amateuryears7|–}}}}}
| data28a = {{{rl_amateurclubs7|}}}
| data28b = {{{rl_amateurapps7|}}}
| data28c = ({{{rl_amateurpoints7|}}})
| label29 = {{#if:{{{rl_amateurclubs8|}}}|<nowiki />{{{rl_amateuryears8|–}}}}}
| data29a = {{{rl_amateurclubs8|}}}
| data29b = {{{rl_amateurapps8|}}}
| data29c = ({{{rl_amateurpoints8|}}})
| label30 = {{#if:{{{rl_amateurclubs9|}}}|<nowiki />{{{rl_amateuryears9|–}}}}}
| data30a = {{{rl_amateurclubs9|}}}
| data30b = {{{rl_amateurapps9|}}}
| data30c = ({{{rl_amateurpoints9|}}})
| label31 = {{#if:{{{rl_amateurclubs10|}}}|<nowiki />{{{rl_amateuryears10|–}}}}}
| data31a = {{{rl_amateurclubs10|}}}
| data31b = {{{rl_amateurapps10|}}}
| data31c = ({{{rl_amateurpoints10|}}})
| data32 = {{#if:{{{rl_amupdate|}}}|{{Infobox rugby biography/correct date|{{{rl_amupdate|}}}}}}}
<!--
*****RL SENIOR*****
-->
| header40 = {{#if:{{{rl_proclubs1|}}}|Senior career}}
| label41 = {{#if:{{{rl_proclubs1|}}}|'''Years'''}}
| data41a = {{#if:{{{rl_proclubs1|}}}|'''Team'''}}
| data41b = {{#if:{{{rl_proclubs1|}}}|'''Apps'''}}
| data41c = {{#if:{{{rl_proclubs1|}}}|'''(Points)'''}}
| label42 = {{#if:{{{rl_proclubs1|}}}|<nowiki />{{{rl_clubyears1|–}}}}}
| data42a = {{{rl_proclubs1|}}}
| data42b = {{{rl_clubapps1|}}}
| data42c = ({{{rl_clubpoints1|}}})
| label43 = {{#if:{{{rl_proclubs2|}}}|<nowiki />{{{rl_clubyears2|–}}}}}
| data43a = {{{rl_proclubs2|}}}
| data43b = {{{rl_clubapps2|}}}
| data43c = ({{{rl_clubpoints2|}}})
| label44 = {{#if:{{{rl_proclubs3|}}}|<nowiki />{{{rl_clubyears3|–}}}}}
| data44a = {{{rl_proclubs3|}}}
| data44b = {{{rl_clubapps3|}}}
| data44c = ({{{rl_clubpoints3|}}})
| label45 = {{#if:{{{rl_proclubs4|}}}|<nowiki />{{{rl_clubyears4|–}}}}}
| data45a = {{{rl_proclubs4|}}}
| data45b = {{{rl_clubapps4|}}}
| data45c = ({{{rl_clubpoints4|}}})
| label46 = {{#if:{{{rl_proclubs5|}}}|<nowiki />{{{rl_clubyears5|–}}}}}
| data46a = {{{rl_proclubs5|}}}
| data46b = {{{rl_clubapps5|}}}
| data46c = ({{{rl_clubpoints5|}}})
| label47 = {{#if:{{{rl_proclubs6|}}}|<nowiki />{{{rl_clubyears6|–}}}}}
| data47a = {{{rl_proclubs6|}}}
| data47b = {{{rl_clubapps6|}}}
| data47c = ({{{rl_clubpoints6|}}})
| label48 = {{#if:{{{rl_proclubs7|}}}|<nowiki />{{{rl_clubyears7|–}}}}}
| data48a = {{{rl_proclubs7|}}}
| data48b = {{{rl_clubapps7|}}}
| data48c = ({{{rl_clubpoints7|}}})
| label49 = {{#if:{{{rl_proclubs8|}}}|<nowiki />{{{rl_clubyears8|–}}}}}
| data49a = {{{rl_proclubs8|}}}
| data49b = {{{rl_clubapps8|}}}
| data49c = ({{{rl_clubpoints8|}}})
| label50 = {{#if:{{{rl_proclubs9|}}}|<nowiki />{{{rl_clubyears9|–}}}}}
| data50a = {{{rl_proclubs9|}}}
| data50b = {{{rl_clubapps9|}}}
| data50c = ({{{rl_clubpoints9|}}})
| label51 = {{#if:{{{rl_proclubs10|}}}|<nowiki />{{{rl_clubyears10|–}}}}}
| data51a = {{{rl_proclubs10|}}}
| data51b = {{{rl_clubapps10|}}}
| data51c = ({{{rl_clubpoints10|}}})
| label52 = {{#if:{{{rl_proclubs11|}}}|<nowiki />{{{rl_clubyears11|–}}}}}
| data52a = {{{rl_proclubs11|}}}
| data52b = {{{rl_clubapps11|}}}
| data52c = ({{{rl_clubpoints11|}}})
| label53 = {{#if:{{{rl_proclubs12|}}}|<nowiki />{{{rl_clubyears12|–}}}}}
| data53a = {{{rl_proclubs12|}}}
| data53b = {{{rl_clubapps12|}}}
| data53c = ({{{rl_clubpoints12|}}})
| label54 = {{#if:{{{rl_proclubs13|}}}|<nowiki />{{{rl_clubyears13|–}}}}}
| data54a = {{{rl_proclubs13|}}}
| data54b = {{{rl_clubapps13|}}}
| data54c = ({{{rl_clubpoints13|}}})
| label55 = {{#if:{{{rl_proclubs14|}}}|<nowiki />{{{rl_clubyears14|–}}}}}
| data55a = {{{rl_proclubs14|}}}
| data55b = {{{rl_clubapps14|}}}
| data55c = ({{{rl_clubpoints14|}}})
| label56 = {{#if:{{{rl_proclubs15|}}}|<nowiki />{{{rl_clubyears15|–}}}}}
| data56a = {{{rl_proclubs15|}}}
| data56b = {{{rl_clubapps15|}}}
| data56c = ({{{rl_clubpoints15|}}})
| label57 = {{#if:{{{rl_proclubs16|}}}|<nowiki />{{{rl_clubyears16|–}}}}}
| data57a = {{{rl_proclubs16|}}}
| data57b = {{{rl_clubapps16|}}}
| data57c = ({{{rl_clubpoints16|}}})
| label58 = {{#if:{{{rl_proclubs17|}}}|<nowiki />{{{rl_clubyears17|–}}}}}
| data58a = {{{rl_proclubs17|}}}
| data58b = {{{rl_clubapps17|}}}
| data58c = ({{{rl_clubpoints17|}}})
| label59 = {{#if:{{{rl_proclubs18|}}}|<nowiki />{{{rl_clubyears18|–}}}}}
| data59a = {{{rl_proclubs18|}}}
| data59b = {{{rl_clubapps18|}}}
| data59c = ({{{rl_clubpoints18|}}})
| label60 = {{#if:{{{rl_proclubs19|}}}|<nowiki />{{{rl_clubyears19|–}}}}}
| data60a = {{{rl_proclubs19|}}}
| data60b = {{{rl_clubapps19|}}}
| data60c = ({{{rl_clubpoints19|}}})
| label61 = {{#if:{{{rl_proclubs20|}}}|<nowiki />{{{rl_clubyears20|–}}}}}
| data61a = {{{rl_proclubs20|}}}
| data61b = {{{rl_clubapps20|}}}
| data61c = ({{{rl_clubpoints20|}}})
| label62 = {{#if:{{{rl_totalyears|}}}|'''{{{rl_totalyears}}}'''|{{#if:{{{rl_totalapps|}}}|'''Total'''}}}}
| data62a = {{#if:{{{rl_totalyears|}}}|{{#if:{{{rl_totalapps|}}}|'''Total'''}}}}
| data62b = {{#if:{{{rl_totalapps|}}}|'''{{{rl_totalapps|}}}'''}}
| data62c = {{#if:{{{rl_totalpoints|}}}|'''({{{rl_totalpoints}}})'''}}
| data63 = {{#if:{{{rl_clubupdate|}}}|{{Infobox rugby biography/correct date|{{{rl_clubupdate|}}}}}}}
<!--
*****RL STATE OF ORIGIN*****
-->
| header90 = {{#if:{{{sooteam1|}}}|State of Origin}}
| label91 = {{#if:{{{sooteam1|}}}|'''Years'''}}
| data91a = {{#if:{{{sooteam1|}}}|'''Team'''}}
| data91b = {{#if:{{{sooteam1|}}}|'''Apps'''}}
| data91c = {{#if:{{{sooteam1|}}}|'''(Points)'''}}
| label92 = {{#if:{{{sooteam1|}}}|<nowiki />{{{sooyears1|–}}}}}
| data92a = {{{sooteam1|}}}
| data92b = {{{sooapps1|}}}
| data92c = ({{{soopoints1|}}})
| label93 = {{#if:{{{sooteam2|}}}|<nowiki />{{{sooyears2|–}}}}}
| data93a = {{{sooteam2|}}}
| data93b = {{{sooapps2|}}}
| data93c = ({{{soopoints2|}}})
| label94 = {{#if:{{{sooteam3|}}}|<nowiki />{{{sooyears3|–}}}}}
| data94a = {{{sooteam3|}}}
| data94b = {{{sooapps3|}}}
| data94c = ({{{soopoints3|}}})
| label95 = {{#if:{{{sooteam4|}}}|<nowiki />{{{sooyears4|–}}}}}
| data95a = {{{sooteam4|}}}
| data95b = {{{sooapps4|}}}
| data95c = ({{{soopoints4|}}})
| label96 = {{#if:{{{sooteam5|}}}|<nowiki />{{{sooyears5|–}}}}}
| data96a = {{{sooteam5|}}}
| data96b = {{{sooapps5|}}}
| data96c = ({{{soopoints5|}}})
| label97 = {{#if:{{{sooteam6|}}}|<nowiki />{{{sooyears6|–}}}}}
| data97a = {{{sooteam6|}}}
| data97b = {{{sooapps6|}}}
| data97c = ({{{soopoints6|}}})
| label98 = {{#if:{{{sooteam7|}}}|<nowiki />{{{sooyears7|–}}}}}
| data98a = {{{sooteam7|}}}
| data98b = {{{sooapps7|}}}
| data98c = ({{{soopoints7|}}})
| label99 = {{#if:{{{sooteam8|}}}|<nowiki />{{{sooyears8|–}}}}}
| data99a = {{{sooteam8|}}}
| data99b = {{{sooapps8|}}}
| data99c = ({{{soopoints8|}}})
| label100 = {{#if:{{{sooteam9|}}}|<nowiki />{{{sooyears9|–}}}}}
| data100a = {{{sooteam9|}}}
| data100b = {{{sooapps9|}}}
| data100c = ({{{soopoints9|}}})
| label101 = {{#if:{{{sooteam10|}}}|<nowiki />{{{sooyears10|–}}}}}
| data101a = {{{sooteam10|}}}
| data101b = {{{sooapps10|}}}
| data101c = ({{{soopoints10|}}})
| data102 = {{#if:{{{sooupdate|}}}|{{Infobox rugby biography/correct date|{{{sooupdate|}}}}}}}
<!--
*****RL NATIONAL TEAM*****
-->
| header110 = {{#if:{{{rl_nationalteam1|}}}|National team(s)}}
| label111 = {{#if:{{{rl_nationalteam1|}}}|'''Years'''}}
| data111a = {{#if:{{{rl_nationalteam1|}}}|'''Team'''}}
| data111b = {{#if:{{{rl_nationalteam1|}}}|'''Apps'''}}
| data111c = {{#if:{{{rl_nationalteam1|}}}|'''(Points)'''}}
| label112 = {{#if:{{{rl_nationalteam1|}}}|<nowiki />{{{rl_nationalyears1|–}}}}}
| data112a = {{{rl_nationalteam1|}}}
| data112b = {{{rl_nationalapps1|}}}
| data112c = ({{{rl_nationalpoints1|}}})
| label113 = {{#if:{{{rl_nationalteam2|}}}|<nowiki />{{{rl_nationalyears2|–}}}}}
| data113a = {{{rl_nationalteam2|}}}
| data113b = {{{rl_nationalapps2|}}}
| data113c = ({{{rl_nationalpoints2|}}})
| label114 = {{#if:{{{rl_nationalteam3|}}}|<nowiki />{{{rl_nationalyears3|–}}}}}
| data114a = {{{rl_nationalteam3|}}}
| data114b = {{{rl_nationalapps3|}}}
| data114c = ({{{rl_nationalpoints3|}}})
| label115 = {{#if:{{{rl_nationalteam4|}}}|<nowiki />{{{rl_nationalyears4|–}}}}}
| data115a = {{{rl_nationalteam4|}}}
| data115b = {{{rl_nationalapps4|}}}
| data115c = ({{{rl_nationalpoints4|}}})
| label116 = {{#if:{{{rl_nationalteam5|}}}|<nowiki />{{{rl_nationalyears5|–}}}}}
| data116a = {{{rl_nationalteam5|}}}
| data116b = {{{rl_nationalapps5|}}}
| data116c = ({{{rl_nationalpoints5|}}})
| label117 = {{#if:{{{rl_nationalteam6|}}}|<nowiki />{{{rl_nationalyears6|–}}}}}
| data117a = {{{rl_nationalteam6|}}}
| data117b = {{{rl_nationalapps6|}}}
| data117c = ({{{rl_nationalpoints6|}}})
| label118 = {{#if:{{{rl_nationalteam7|}}}|<nowiki />{{{rl_nationalyears7|–}}}}}
| data118a = {{{rl_nationalteam7|}}}
| data118b = {{{rl_nationalapps7|}}}
| data118c = ({{{rl_nationalpoints7|}}})
| label119 = {{#if:{{{rl_nationalteam8|}}}|<nowiki />{{{rl_nationalyears8|–}}}}}
| data119a = {{{rl_nationalteam8|}}}
| data119b = {{{rl_nationalapps8|}}}
| data119c = ({{{rl_nationalpoints8|}}})
| label120 = {{#if:{{{rl_nationalteam9|}}}|<nowiki />{{{rl_nationalyears9|–}}}}}
| data120a = {{{rl_nationalteam9|}}}
| data120b = {{{rl_nationalapps9|}}}
| data120c = ({{{rl_nationalpoints9|}}})
| label121 = {{#if:{{{rl_nationalteam10|}}}|<nowiki />{{{rl_nationalyears10|–}}}}}
| data121a = {{{rl_nationalteam10|}}}
| data121b = {{{rl_nationalapps10|}}}
| data121c = ({{{rl_nationalpoints10|}}})
| data122 = {{#if:{{{rl_ntupdate|}}}|{{Infobox rugby biography/correct date|{{{rl_ntupdate|}}}}}}}
<!--
*****RL COACH*****
-->
| header130 = {{#if:{{{rl_coachteams1|}}}|Teams coached}}
| label131 = {{#if:{{{rl_coachteams1|}}}|'''Years'''}}
| data131 = {{#if:{{{rl_coachteams1|}}}|'''Team'''}}
| label132 = {{#if:{{{rl_coachteams1|}}}|{{{rl_coachyears1|–}}}}}
| data132 = {{{rl_coachteams1|}}}
| label133 = {{#if:{{{rl_coachteams2|}}}|{{{rl_coachyears2|–}}}}}
| data133 = {{{rl_coachteams2|}}}
| label134 = {{#if:{{{rl_coachteams3|}}}|{{{rl_coachyears3|–}}}}}
| data134 = {{{rl_coachteams3|}}}
| label135 = {{#if:{{{rl_coachteams4|}}}|{{{rl_coachyears4|–}}}}}
| data135 = {{{rl_coachteams4|}}}
| label136 = {{#if:{{{rl_coachteams5|}}}|{{{rl_coachyears5|–}}}}}
| data136 = {{{rl_coachteams5|}}}
| label137 = {{#if:{{{rl_coachteams6|}}}|{{{rl_coachyears6|–}}}}}
| data137 = {{{rl_coachteams6|}}}
| label138 = {{#if:{{{rl_coachteams7|}}}|{{{rl_coachyears7|–}}}}}
| data138 = {{{rl_coachteams7|}}}
| label139 = {{#if:{{{rl_coachteams8|}}}|{{{rl_coachyears8|–}}}}}
| data139 = {{{rl_coachteams8|}}}
| label140 = {{#if:{{{rl_coachteams9|}}}|{{{rl_coachyears9|–}}}}}
| data140 = {{{rl_coachteams9|}}}
| label141 = {{#if:{{{rl_coachteams10|}}}|{{{rl_coachyears10|–}}}}}
| data141 = {{{rl_coachteams10|}}}
| label142 = {{#if:{{{rl_coachteams11|}}}|{{{rl_coachyears11|–}}}}}
| data142 = {{{rl_coachteams11|}}}
| label143 = {{#if:{{{rl_coachteams12|}}}|{{{rl_coachyears12|–}}}}}
| data143 = {{{rl_coachteams12|}}}
| label144 = {{#if:{{{rl_coachteams13|}}}|{{{rl_coachyears13|–}}}}}
| data144 = {{{rl_coachteams13|}}}
| label145 = {{#if:{{{rl_coachteams14|}}}|{{{rl_coachyears14|–}}}}}
| data145 = {{{rl_coachteams14|}}}
| label146 = {{#if:{{{rl_coachteams15|}}}|{{{rl_coachyears15|–}}}}}
| data146 = {{{rl_coachteams15|}}}
| label147 = {{#if:{{{rl_coachteams16|}}}|{{{rl_coachyears16|–}}}}}
| data147 = {{{rl_coachteams16|}}}
| label148 = {{#if:{{{rl_coachteams17|}}}|{{{rl_coachyears17|–}}}}}
| data148 = {{{rl_coachteams17|}}}
| label149 = {{#if:{{{rl_coachteams18|}}}|{{{rl_coachyears18|–}}}}}
| data149 = {{{rl_coachteams18|}}}
| label150 = {{#if:{{{rl_coachteams19|}}}|{{{rl_coachyears19|–}}}}}
| data150 = {{{rl_coachteams19|}}}
| label151 = {{#if:{{{rl_coachteams20|}}}|{{{rl_coachyears20|–}}}}}
| data151 = {{{rl_coachteams20|}}}
| data152 = {{#if:{{{rl_coachupdate|}}}|{{Infobox rugby biography/correct date|{{{rl_coachupdate|}}}}}}}
<!--
*****RL REFEREE*****
-->
| header160 = {{#if:{{{rl_refereecomps1|}}}|Refereeing career}}
| label161 = {{#if:{{{rl_refereecomps1|}}}|'''Years'''}}
| data161a = {{#if:{{{rl_refereecomps1|}}}|'''Competition'''}}
| data161c = {{#if:{{{rl_refereecomps1|}}}|'''Apps'''}}
| label162 = {{#if:{{{rl_refereecomps1|}}}|<nowiki />{{{rl_refereeyears1|–}}}}}
| data162a = {{{rl_refereecomps1|}}}
| data162c = {{{rl_refereeapps1|}}}
| label163 = {{#if:{{{rl_refereecomps2|}}}|<nowiki />{{{rl_refereeyears2|–}}}}}
| data163a = {{{rl_refereecomps2|}}}
| data163c = {{{rl_refereeapps2|}}}
| label164 = {{#if:{{{rl_refereecomps3|}}}|<nowiki />{{{rl_refereeyears3|–}}}}}
| data164a = {{{rl_refereecomps3|}}}
| data164c = {{{rl_refereeapps3|}}}
| label165 = {{#if:{{{rl_refereecomps4|}}}|<nowiki />{{{rl_refereeyears4|–}}}}}
| data165a = {{{rl_refereecomps4|}}}
| data165c = {{{rl_refereeapps4|}}}
| label166 = {{#if:{{{rl_refereecomps5|}}}|<nowiki />{{{rl_refereeyears5|–}}}}}
| data166a = {{{rl_refereecomps5|}}}
| data166c = {{{rl_refereeapps5|}}}
| label167 = {{#if:{{{rl_refereecomps6|}}}|<nowiki />{{{rl_refereeyears6|–}}}}}
| data167a = {{{rl_refereecomps6|}}}
| data167c = {{{rl_refereeapps6|}}}
| label168 = {{#if:{{{rl_refereecomps7|}}}|<nowiki />{{{rl_refereeyears7|–}}}}}
| data168a = {{{rl_refereecomps7|}}}
| data168c = {{{rl_refereeapps7|}}}
| label169 = {{#if:{{{rl_refereecomps8|}}}|<nowiki />{{{rl_refereeyears8|–}}}}}
| data169a = {{{rl_refereecomps8|}}}
| data169c = {{{rl_refereeapps8|}}}
| label170 = {{#if:{{{rl_refereecomps9|}}}|<nowiki />{{{rl_refereeyears9|–}}}}}
| data170a = {{{rl_refereecomps9|}}}
| data170c = {{{rl_refereeapps9|}}}
| label171 = {{#if:{{{rl_refereecomps10|}}}|<nowiki />{{{rl_refereeyears10|–}}}}}
| data171a = {{{rl_refereecomps10|}}}
| data171c = {{{rl_refereeapps10|}}}
| data172 = {{#if:{{{rl_refereeupdate|}}}|{{Infobox rugby biography/correct date|{{{rl_refereeupdate|}}}}}}}
}}}}
<!--
***Rugby Union***
-->
| header30 = Rugby union career
| data31 = {{#if:{{{ru_currentposition|{{{ru_position|{{{position|}}}}}}}}}{{{ru_currentteam|{{{currentclub|}}}}}}{{{allblackid|}}}{{{youthclubs1|{{{ru_youthclubs|}}}}}}{{{amatteam1|{{{ru_amateurclubs|}}}}}}{{{clubs1|{{{ru_proclubs|}}}}}}{{{ru_province1|{{{ru_province|}}}}}}{{{super1|{{{super14|}}}}}}{{{repteam1|{{{ru_nationalteam1|{{{ru_nationalteam|}}}}}}}}}{{{ru_sevensnationalteam1|{{{repsevensteam1|}}}}}}{{{coachteams1|{{{ru_coachclubs|}}}}}}{{{ru_refereecomps1|{{{ru_refereecomps|}}}}}}|{{Infobox3cols
| child = yes
| headerstyle = background-color: #e0ffff;
| labelstyle = white-space:nowrap; font-weight: normal;
| datastyle = white-space: nowrap; vertical-align: baseline
| datastylea = white-space: nowrap; vertical-align: baseline
| datastyleb = white-space: nowrap; vertical-align: baseline; text-align: right
| datastylec = white-space: nowrap; vertical-align: baseline; text-align: right
| label4 = '''Position(s)'''
| class4 = role
| data4 = {{Use first nonempty | {{{ru_currentposition|}}} | {{{ru_position|}}} | {{{position|}}} }}
| label5 = '''Current team'''
| class5 = org
| data5 = {{Use first nonempty | {{{ru_currentteam|}}} | {{{currentclub|}}} }}
| label6 = '''All Black No.'''
| data6 = {{#if:{{{allblackid|}}}|[http://stats.allblacks.com/asp/Profile.asp?ABID={{{allblackid}}} {{{allblackno}}}]}}
<!--
*****RU YOUTH*****
-->
| header10 = {{#if:{{{youthclubs1|{{{ru_youthclubs|}}}}}}|Youth career}}
| label11 = {{#if:{{{youthclubs1|{{{ru_youthclubs|}}}}}}|{{{youthyears1|{{{ru_youthyears|–}}}}}}}}
| data11 = {{{youthclubs1|{{{ru_youthclubs|}}}}}}
| label12 = {{#if:{{{youthclubs2|}}}|{{{youthyears2|–}}}}}
| data12 = {{{youthclubs2|}}}
| label13 = {{#if:{{{youthclubs3|}}}|{{{youthyears3|–}}}}}
| data13 = {{{youthclubs3|}}}
| label14 = {{#if:{{{youthclubs4|}}}|{{{youthyears4|–}}}}}
| data14 = {{{youthclubs4|}}}
| label15 = {{#if:{{{youthclubs5|}}}|{{{youthyears5|–}}}}}
| data15 = {{{youthclubs5|}}}
<!--
*****RU AMATEUR*****
-->
| header20 = {{#if:{{{amatteam1|{{{ru_amateurclubs|}}}}}}|Amateur team(s)}}
| label21 = {{#if:{{{amatteam1|{{{ru_amateurclubs|}}}}}}|'''Years'''}}
| data21a = {{#if:{{{amatteam1|{{{ru_amateurclubs|}}}}}}|'''Team'''}}
| data21b = {{#if:{{{amatteam1|{{{ru_amateurclubs|}}}}}}|'''Apps'''}}
| data21c = {{#if:{{{amatteam1|{{{ru_amateurclubs|}}}}}}|'''(Points)'''}}
| label22 = {{#if:{{{amatteam1|{{{ru_amateurclubs|}}}}}}|<nowiki />{{{amatyears1|{{{ru_amateuryears|–}}}}}}}}
| data22a = {{{amatteam1|{{{ru_amateurclubs|}}}}}}
| data22b = {{{amatapps1|{{{ru_amateurcaps|}}}}}}
| data22c = {{#if:{{{ru_amateurpoints|}}}|{{{ru_amateurpoints|}}}|({{{amatpoints1|}}})}}
| label23 = {{#if:{{{amatteam2|}}}|<nowiki />{{{amatyears2|–}}}}}
| data23a = {{{amatteam2|}}}
| data23b = {{{amatapps2|}}}
| data23c = ({{{amatpoints2|}}})
| label24 = {{#if:{{{amatteam3|}}}|<nowiki />{{{amatyears3|–}}}}}
| data24a = {{{amatteam3|}}}
| data24b = {{{amatapps3|}}}
| data24c = ({{{amatpoints3|}}})
| label25 = {{#if:{{{amatteam4|}}}|<nowiki />{{{amatyears4|–}}}}}
| data25a = {{{amatteam4|}}}
| data25b = {{{amatapps4|}}}
| data25c = ({{{amatpoints4|}}})
| label26 = {{#if:{{{amatteam5|}}}|<nowiki />{{{amatyears5|–}}}}}
| data26a = {{{amatteam5|}}}
| data26b = {{{amatapps5|}}}
| data26c = ({{{amatpoints5|}}})
| label27 = {{#if:{{{amatteam6|}}}|<nowiki />{{{amatyears6|–}}}}}
| data27a = {{{amatteam6|}}}
| data27b = {{{amatapps6|}}}
| data27c = ({{{amatpoints6|}}})
| label28 = {{#if:{{{amatteam7|}}}|<nowiki />{{{amatyears7|–}}}}}
| data28a = {{{amatteam7|}}}
| data28b = {{{amatapps7|}}}
| data28c = ({{{amatpoints7|}}})
| label29 = {{#if:{{{amatteam8|}}}|<nowiki />{{{amatyears8|–}}}}}
| data29a = {{{amatteam8|}}}
| data29b = {{{amatapps8|}}}
| data29c = ({{{amatpoints8|}}})
| label30 = {{#if:{{{amatteam9|}}}|<nowiki />{{{amatyears9|–}}}}}
| data30a = {{{amatteam9|}}}
| data30b = {{{amatapps9|}}}
| data30c = ({{{amatpoints9|}}})
| label31 = {{#if:{{{amatteam10|}}}|<nowiki />{{{amatyears10|–}}}}}
| data31a = {{{amatteam10|}}}
| data31b = {{{amatapps10|}}}
| data31c = ({{{amatpoints10|}}})
| data32 = {{#if:{{{amatupdate|{{{ru_amupdate|}}}}}}|{{Infobox rugby biography/correct date|{{{amatupdate|{{{ru_amupdate|}}}}}}}}}}
<!--
*****RU SENIOR*****
-->
| header40 = {{#if:{{{clubs1|{{{ru_proclubs|}}}}}}|Senior career}}
| label41 = {{#if:{{{clubs1|{{{ru_proclubs|}}}}}}|'''Years'''}}
| data41a = {{#if:{{{clubs1|{{{ru_proclubs|}}}}}}|'''Team'''}}
| data41b = {{#if:{{{clubs1|{{{ru_proclubs|}}}}}}|'''Apps'''}}
| data41c = {{#if:{{{clubs1|{{{ru_proclubs|}}}}}}|'''(Points)'''}}
| label42 = {{#if:{{{clubs1|{{{ru_proclubs|}}}}}}|<nowiki />{{{years1|{{{ru_clubyears|–}}}}}}}}
| data42a = {{{clubs1|{{{clubs|{{{ru_proclubs|}}}}}}}}}
| data42b = {{{apps1|{{{ru_clubcaps|}}}}}}
| data42c = {{#if:{{{ru_clubpoints|}}}|{{{ru_clubpoints|}}}|({{{points1|}}})}}
| label43 = {{#if:{{{clubs2|}}}|<nowiki />{{{years2|–}}}}}
| data43a = {{{clubs2|}}}
| data43b = {{{apps2|}}}
| data43c = ({{{points2|}}})
| label44 = {{#if:{{{clubs3|}}}|<nowiki />{{{years3|–}}}}}
| data44a = {{{clubs3|}}}
| data44b = {{{apps3|}}}
| data44c = ({{{points3|}}})
| label45 = {{#if:{{{clubs4|}}}|<nowiki />{{{years4|–}}}}}
| data45a = {{{clubs4|}}}
| data45b = {{{apps4|}}}
| data45c = ({{{points4|}}})
| label46 = {{#if:{{{clubs5|}}}|<nowiki />{{{years5|–}}}}}
| data46a = {{{clubs5|}}}
| data46b = {{{apps5|}}}
| data46c = ({{{points5|}}})
| label47 = {{#if:{{{clubs6|}}}|<nowiki />{{{years6|–}}}}}
| data47a = {{{clubs6|}}}
| data47b = {{{apps6|}}}
| data47c = ({{{points6|}}})
| label48 = {{#if:{{{clubs7|}}}|<nowiki />{{{years7|–}}}}}
| data48a = {{{clubs7|}}}
| data48b = {{{apps7|}}}
| data48c = ({{{points7|}}})
| label49 = {{#if:{{{clubs8|}}}|<nowiki />{{{years8|–}}}}}
| data49a = {{{clubs8|}}}
| data49b = {{{apps8|}}}
| data49c = ({{{points8|}}})
| label50 = {{#if:{{{clubs9|}}}|<nowiki />{{{years9|–}}}}}
| data50a = {{{clubs9|}}}
| data50b = {{{apps9|}}}
| data50c = ({{{points9|}}})
| label51 = {{#if:{{{clubs10|}}}|<nowiki />{{{years10|–}}}}}
| data51a = {{{clubs10|}}}
| data51b = {{{apps10|}}}
| data51c = ({{{points10|}}})
| label52 = {{#if:{{{clubs11|}}}|<nowiki />{{{years11|–}}}}}
| data52a = {{{clubs11|}}}
| data52b = {{{apps11|}}}
| data52c = ({{{points11|}}})
| label53 = {{#if:{{{clubs12|}}}|<nowiki />{{{years12|–}}}}}
| data53a = {{{clubs12|}}}
| data53b = {{{apps12|}}}
| data53c = ({{{points12|}}})
| label54 = {{#if:{{{clubs13|}}}|<nowiki />{{{years13|–}}}}}
| data54a = {{{clubs13|}}}
| data54b = {{{apps13|}}}
| data54c = ({{{points13|}}})
| label55 = {{#if:{{{clubs14|}}}|<nowiki />{{{years14|–}}}}}
| data55a = {{{clubs14|}}}
| data55b = {{{apps14|}}}
| data55c = ({{{points14|}}})
| label56 = {{#if:{{{clubs15|}}}|<nowiki />{{{years15|–}}}}}
| data56a = {{{clubs15|}}}
| data56b = {{{apps15|}}}
| data56c = ({{{points15|}}})
| label57 = {{#if:{{{clubs16|}}}|<nowiki />{{{years16|–}}}}}
| data57a = {{{clubs16|}}}
| data57b = {{{apps16|}}}
| data57c = ({{{points16|}}})
| label58 = {{#if:{{{clubs17|}}}|<nowiki />{{{years17|–}}}}}
| data58a = {{{clubs17|}}}
| data58b = {{{apps17|}}}
| data58c = ({{{points17|}}})
| label59 = {{#if:{{{clubs18|}}}|<nowiki />{{{years18|–}}}}}
| data59a = {{{clubs18|}}}
| data59b = {{{apps18|}}}
| data59c = ({{{points18|}}})
| label60 = {{#if:{{{clubs19|}}}|<nowiki />{{{years19|–}}}}}
| data60a = {{{clubs19|}}}
| data60b = {{{apps19|}}}
| data60c = ({{{points19|}}})
| label61 = {{#if:{{{clubs20|}}}|<nowiki />{{{years20|–}}}}}
| data61a = {{{clubs20|}}}
| data61b = {{{apps20|}}}
| data61c = ({{{points20|}}})
| label62 = {{#if:{{{clubs21|}}}|<nowiki />{{{years21|–}}}}}
| data62a = {{{clubs21|}}}
| data62b = {{{apps21|}}}
| data62c = ({{{points21|}}})
| label63 = {{#if:{{{clubs22|}}}|<nowiki />{{{years22|–}}}}}
| data63a = {{{clubs22|}}}
| data63b = {{{apps22|}}}
| data63c = ({{{points22|}}})
| label64 = {{#if:{{{totalyears|}}}|'''{{{totalyears}}}'''|{{#if:{{{totalapps|}}}|'''Total'''}}}}
| data64a = {{#if:{{{totalyears|}}}|{{#if:{{{totalapps|}}}|'''Total'''}}}}
| data64b = {{#if:{{{totalapps|}}}|'''{{{totalapps|}}}'''}}
| data64c = {{#if:{{{totalpoints|}}}|'''({{{totalpoints}}})'''}}
| data65 = {{#if:{{{clubupdate|{{{ru_clubupdate|}}}}}}|{{Infobox rugby biography/correct date|{{{clubupdate|{{{ru_clubupdate|}}}}}}}}}}
<!--
*****RU PROVINCIAL*****
-->
| header70 = {{#if:{{{ru_province1|{{{ru_province|{{{province1|}}}}}}}}}|Provincial / State sides}}
| label71 = {{#if:{{{ru_province1|{{{ru_province|{{{province1|}}}}}}}}}|'''Years'''}}
| data71a = {{#if:{{{ru_province1|{{{ru_province|{{{province1|}}}}}}}}}|'''Team'''}}
| data71b = {{#if:{{{ru_province1|{{{ru_province|{{{province1|}}}}}}}}}|'''Apps'''}}
| data71c = {{#if:{{{ru_province1|{{{ru_province|{{{province1|}}}}}}}}}|'''(Points)'''}}
| label72 = {{#if:{{{ru_province1|{{{ru_province|{{{province1|}}}}}}}}}|<nowiki />{{{ru_provinceyears1|{{{ru_provinceyears|{{{province|{{{provinceyears1|0}}}}}}}}}}}}}}
| data72a = {{{ru_province1|{{{ru_province|{{{province1|}}}}}}}}}
| data72b = {{{ru_provinceapps1|{{{ru_provincecaps|{{{provinceapps1|}}}}}}}}}
| data72c = {{#if:{{{ru_provincepoints|}}}|{{{ru_provincepoints|}}}|({{{ru_provincepoints1|{{{provincepoints1|}}}}}})}}
| label73 = {{#if:{{{ru_province2|{{{province2|}}}}}}|<nowiki />{{{ru_provinceyears2|{{{provinceyears2|-}}}}}}}}
| data73a = {{{ru_province2|{{{province2|}}}}}}
| data73b = {{{ru_provinceapps2|{{{provinceapps2|}}}}}}
| data73c = ({{{ru_provincepoints2|}}})
| label74 = {{#if:{{{ru_province3|{{{province3|}}}}}}|<nowiki />{{{ru_provinceyears3|{{{provinceyears3|-}}}}}}}}
| data74a = {{{ru_province3|{{{province3|}}}}}}
| data74b = {{{ru_provinceapps3|{{{provinceapps3|}}}}}}
| data74c = ({{{ru_provincepoints3|{{{provincepoints3|}}}}}})
| label75 = {{#if:{{{province4|}}}|<nowiki />{{{provinceyears4|–}}}}}
| data75a = {{{province4|}}}
| data75b = {{{provinceapps4|}}}
| data75c = ({{{provincepoints4|}}})
| label76 = {{#if:{{{province5|}}}|<nowiki />{{{provinceyears5|–}}}}}
| data76a = {{{province5|}}}
| data76b = {{{provinceapps5|}}}
| data76c = ({{{provincepoints5|}}})
| label77 = {{#if:{{{province6|}}}|<nowiki />{{{provinceyears6|–}}}}}
| data77a = {{{province6|}}}
| data77b = {{{provinceapps6|}}}
| data77c = ({{{provincepoints6|}}})
| label78 = {{#if:{{{province7|}}}|<nowiki />{{{provinceyears7|–}}}}}
| data78a = {{{province7|}}}
| data78b = {{{provinceapps7|}}}
| data78c = ({{{provincepoints7|}}})
| label79 = {{#if:{{{province8|}}}|<nowiki />{{{provinceyears8|–}}}}}
| data79a = {{{province8|}}}
| data79b = {{{provinceapps8|}}}
| data79c = ({{{provincepoints8|}}})
| label80 = {{#if:{{{province9|}}}|<nowiki />{{{provinceyears9|–}}}}}
| data80a = {{{province9|}}}
| data80b = {{{provinceapps9|}}}
| data80c = ({{{provincepoints9|}}})
| label81 = {{#if:{{{province10|}}}|<nowiki />{{{provinceyears10|–}}}}}
| data81a = {{{province10|}}}
| data81b = {{{provinceapps10|}}}
| data81c = ({{{provincepoints10|}}})
| data82 = {{#if:{{{ru_provinceupdate|}}}|{{Infobox rugby biography/correct date|{{{ru_provinceupdate|}}}}}}}
<!--
*****RU SUPER RUGBY*****
-->
| header90 = {{#if:{{{super1|{{{super14|}}}}}}|Super Rugby}}
| label91 = {{#if:{{{super1|{{{super14|}}}}}}|'''Years'''}}
| data91a = {{#if:{{{super1|{{{super14|}}}}}}|'''Team'''}}
| data91b = {{#if:{{{super1|{{{super14|}}}}}}|'''Apps'''}}
| data91c = {{#if:{{{super1|{{{super14|}}}}}}|'''(Points)'''}}
| label92 = {{#if:{{{super1|{{{super14|}}}}}}|<nowiki />{{{superyears1|{{{super14years|–}}}}}}}}
| data92a = {{{super1|{{{super14|}}}}}}
| data92b = {{{superapps1|{{{super14caps|}}}}}}
| data92c = {{#if:{{{super14points|}}}|{{{super14points|}}}|({{{superpoints1|}}})}}
| label93 = {{#if:{{{super2|}}}|<nowiki />{{{superyears2|–}}}}}
| data93a = {{{super2|}}}
| data93b = {{{superapps2|}}}
| data93c = ({{{superpoints2|}}})
| label94 = {{#if:{{{super3|}}}|<nowiki />{{{superyears3|–}}}}}
| data94a = {{{super3|}}}
| data94b = {{{superapps3|}}}
| data94c = ({{{superpoints3|}}})
| label95 = {{#if:{{{super4|}}}|<nowiki />{{{superyears4|–}}}}}
| data95a = {{{super4|}}}
| data95b = {{{superapps4|}}}
| data95c = ({{{superpoints4|}}})
| label96 = {{#if:{{{super5|}}}|<nowiki />{{{superyears5|–}}}}}
| data96a = {{{super5|}}}
| data96b = {{{superapps5|}}}
| data96c = ({{{superpoints5|}}})
| label97 = {{#if:{{{super6|}}}|<nowiki />{{{superyears6|–}}}}}
| data97a = {{{super6|}}}
| data97b = {{{superapps6|}}}
| data97c = ({{{superpoints6|}}})
| label98 = {{#if:{{{super7|}}}|<nowiki />{{{superyears7|–}}}}}
| data98a = {{{super7|}}}
| data98b = {{{superapps7|}}}
| data98c = ({{{superpoints7|}}})
| label99 = {{#if:{{{super8|}}}|<nowiki />{{{superyears8|–}}}}}
| data99a = {{{super8|}}}
| data99b = {{{superapps8|}}}
| data99c = ({{{superpoints8|}}})
| label100 = {{#if:{{{super9|}}}|<nowiki />{{{superyears9|–}}}}}
| data100a = {{{super9|}}}
| data100b = {{{superapps9|}}}
| data100c = ({{{superpoints9|}}})
| label101 = {{#if:{{{super10|}}}|<nowiki />{{{superyears10|–}}}}}
| data101a = {{{super10|}}}
| data101b = {{{superapps10|}}}
| data101c = ({{{superpoints10|}}})
| label102 = '''Current local club'''
| data102 = {{#if:{{{super1|}}}|{{if empty|{{{ru_currentclub|}}}|{{{currentclub|}}}}}}}
| data103 = {{#if:{{{superupdate|{{{super14update|}}}}}}|{{Infobox rugby biography/correct date|{{{superupdate|{{{super14update|}}}}}}}}}}
<!--
*****RU NATIONAL TEAM*****
-->
| header110 = {{#if:{{{repteam1|{{{ru_nationalteam1|{{{ru_nationalteam|}}}}}}}}}|National team(s)}}
| label111 = {{#if:{{{repteam1|{{{ru_nationalteam1|{{{ru_nationalteam|}}}}}}}}}|'''Years'''}}
| data111a = {{#if:{{{repteam1|{{{ru_nationalteam1|{{{ru_nationalteam|}}}}}}}}}|'''Team'''}}
| data111b = {{#if:{{{repteam1|{{{ru_nationalteam1|{{{ru_nationalteam|}}}}}}}}}|'''Apps'''}}
| data111c = {{#if:{{{repteam1|{{{ru_nationalteam1|{{{ru_nationalteam|}}}}}}}}}|'''(Points)'''}}
| label112 = {{#if:{{{repteam1|{{{ru_nationalteam1|{{{ru_nationalteam|}}}}}}}}}|<nowiki />{{{repyears1|{{{ru_nationalyears|–}}}}}}}}
| data112a = {{{repteam1|{{{ru_nationalteam1|{{{ru_nationalteam|}}}}}}}}}
| data112b = {{{repcaps1|{{{ru_nationalcaps|}}}}}}
| data112c = {{#if:{{{ru_nationalpoints|}}}|{{{ru_nationalpoints|}}}|{{#if:{{{reppoints1|}}}|({{{reppoints1|}}})}}}}
| label113 = {{#if:{{{repteam2|}}}|<nowiki />{{{repyears2|–}}}}}
| data113a = {{{repteam2|}}}
| data113b = {{{repcaps2|}}}
| data113c = {{#if:{{{reppoints2|}}}|({{{reppoints2|}}})}}
| label114 = {{#if:{{{repteam3|}}}|<nowiki />{{{repyears3|–}}}}}
| data114a = {{{repteam3|}}}
| data114b = {{{repcaps3|}}}
| data114c = {{#if:{{{reppoints3|}}}|({{{reppoints3|}}})}}
| label115 = {{#if:{{{repteam4|}}}|<nowiki />{{{repyears4|–}}}}}
| data115a = {{{repteam4|}}}
| data115b = {{{repcaps4|}}}
| data115c = {{#if:{{{reppoints4|}}}|({{{reppoints4|}}})}}
| label116 = {{#if:{{{repteam5|}}}|<nowiki />{{{repyears5|–}}}}}
| data116a = {{{repteam5|}}}
| data116b = {{{repcaps5|}}}
| data116c = {{#if:{{{reppoints5|}}}|({{{reppoints5|}}})}}
| label117 = {{#if:{{{repteam6|}}}|<nowiki />{{{repyears6|–}}}}}
| data117a = {{{repteam6|}}}
| data117b = {{{repcaps6|}}}
| data117c = {{#if:{{{reppoints6|}}}|({{{reppoints6|}}})}}
| label118 = {{#if:{{{repteam7|}}}|<nowiki />{{{repyears7|–}}}}}
| data118a = {{{repteam7|}}}
| data118b = {{{repcaps7|}}}
| data118c = {{#if:{{{reppoints7|}}}|({{{reppoints7|}}})}}
| label119 = {{#if:{{{repteam8|}}}|<nowiki />{{{repyears8|–}}}}}
| data119a = {{{repteam8|}}}
| data119b = {{{repcaps8|}}}
| data119c = {{#if:{{{reppoints8|}}}|({{{reppoints8|}}})}}
| label120 = {{#if:{{{repteam9|}}}|<nowiki />{{{repyears9|–}}}}}
| data120a = {{{repteam9|}}}
| data120b = {{{repcaps9|}}}
| data120c = {{#if:{{{reppoints9|}}}|({{{reppoints9|}}})}}
| label121 = {{#if:{{{repteam10|}}}|<nowiki />{{{repyears10|–}}}}}
| data121a = {{{repteam10|}}}
| data121b = {{{repcaps10|}}}
| data121c = {{#if:{{{reppoints10|}}}|({{{reppoints10|}}})}}
| data122 = {{#if:{{{repupdate|{{{ru_ntupdate|}}}}}}|{{Infobox rugby biography/correct date|{{{repupdate|{{{ru_ntupdate|}}}}}}}}}}
<!--
*****RU SEVENS NATIONAL TEAM*****
-->
| header130 = {{#if:{{{ru_sevensnationalteam1|{{{repsevensteam1|}}}}}}|National sevens team(s)}}
| label131 = {{#if:{{{ru_sevensnationalteam1|{{{repsevensteam1|}}}}}}|'''Years'''}}
| data131a = {{#if:{{{ru_sevensnationalteam1|{{{repsevensteam1|}}}}}}|'''Team'''}}
| data131c = {{#if:{{{ru_sevensnationalteam1|{{{repsevensteam1|}}}}}}|'''Comps'''}}
| label132 = {{#if:{{{ru_sevensnationalteam1|{{{repsevensteam1|}}}}}}|<nowiki />{{{ru_sevensnationalyears1|{{{repsevensyears1|–}}}}}}}}
| data132a = {{{ru_sevensnationalteam1|{{{repsevensteam1|}}}}}}
| data132c = {{{ru_sevensnationalcomp1|{{{repsevenscomp1|}}}}}}
| label133 = {{#if:{{{repsevensteam2|}}}|<nowiki />{{{repsevensyears2|–}}}}}
| data133a = {{{repsevensteam2|}}}
| data133c = {{{repsevenscomp2|}}}
| label134 = {{#if:{{{repsevensteam3|}}}|<nowiki />{{{repsevensyears3|–}}}}}
| data134a = {{{repsevensteam3|}}}
| data134c = {{{repsevenscomp3|}}}
| label135 = {{#if:{{{repsevensteam4|}}}|<nowiki />{{{repsevensyears4|–}}}}}
| data135a = {{{repsevensteam4|}}}
| data135c = {{{repsevenscomp4|}}}
| label136 = {{#if:{{{repsevensteam5|}}}|<nowiki />{{{repsevensyears5|–}}}}}
| data136a = {{{repsevensteam5|}}}
| data136c = {{{repsevenscomp5|}}}
| label137 = {{#if:{{{repsevensteam6|}}}|<nowiki />{{{repsevensyears6|–}}}}}
| data137a = {{{repsevensteam6|}}}
| data137c = {{{repsevenscomp6|}}}
| label138 = {{#if:{{{repsevensteam7|}}}|<nowiki />{{{repsevensyears7|–}}}}}
| data138a = {{{repsevensteam7|}}}
| data138c = {{{repsevenscomp7|}}}
| label139 = {{#if:{{{repsevensteam8|}}}|<nowiki />{{{repsevensyears8|–}}}}}
| data139a = {{{repsevensteam8|}}}
| data139c = {{{repsevenscomp8|}}}
| label140 = {{#if:{{{repsevensteam9|}}}|<nowiki />{{{repsevensyears9|–}}}}}
| data140a = {{{repsevensteam9|}}}
| data140c = {{{repsevenscomp9|}}}
| label141 = {{#if:{{{repsevensteam10|}}}|<nowiki />{{{repsevensyears10|–}}}}}
| data141a = {{{repsevensteam10|}}}
| data141c = {{{repsevenscomp10|}}}
| data142 = {{#if:{{{ru_sevensupdate|}}}|{{Infobox rugby biography/correct date|{{{ru_sevensupdate|}}}}}}}
<!--
*****RU COACH*****
-->
| header150 = {{#if:{{{coachteams1|{{{ru_coachclubs|}}}}}}|Teams coached}}
| label151 = {{#if:{{{coachteams1|{{{ru_coachclubs|}}}}}}|'''Years'''}}
| data151 = {{#if:{{{coachteams1|{{{ru_coachclubs|}}}}}}|'''Team'''}}
| label152 = {{#if:{{{coachteams1|{{{ru_coachclubs|}}}}}}|{{{coachyears1|{{{ru_coachyears|–}}}}}}}}
| data152 = {{{coachteams1|{{{ru_coachclubs|}}}}}}
| label153 = {{#if:{{{coachteams2|}}}|{{{coachyears2|–}}}}}
| data153 = {{{coachteams2|}}}
| label154 = {{#if:{{{coachteams3|}}}|{{{coachyears3|–}}}}}
| data154 = {{{coachteams3|}}}
| label155 = {{#if:{{{coachteams4|}}}|{{{coachyears4|–}}}}}
| data155 = {{{coachteams4|}}}
| label156 = {{#if:{{{coachteams5|}}}|{{{coachyears5|–}}}}}
| data156 = {{{coachteams5|}}}
| label157 = {{#if:{{{coachteams6|}}}|{{{coachyears6|–}}}}}
| data157 = {{{coachteams6|}}}
| label158 = {{#if:{{{coachteams7|}}}|{{{coachyears7|–}}}}}
| data158 = {{{coachteams7|}}}
| label159 = {{#if:{{{coachteams8|}}}|{{{coachyears8|–}}}}}
| data159 = {{{coachteams8|}}}
| label160 = {{#if:{{{coachteams9|}}}|{{{coachyears9|–}}}}}
| data160 = {{{coachteams9|}}}
| label161 = {{#if:{{{coachteams10|}}}|{{{coachyears10|–}}}}}
| data161 = {{{coachteams10|}}}
| label162 = {{#if:{{{coachteams11|}}}|{{{coachyears11|–}}}}}
| data162 = {{{coachteams11|}}}
| label163 = {{#if:{{{coachteams12|}}}|{{{coachyears12|–}}}}}
| data163 = {{{coachteams12|}}}
| label164 = {{#if:{{{coachteams13|}}}|{{{coachyears13|–}}}}}
| data164 = {{{coachteams13|}}}
| label165 = {{#if:{{{coachteams14|}}}|{{{coachyears14|–}}}}}
| data165 = {{{coachteams14|}}}
| label166 = {{#if:{{{coachteams15|}}}|{{{coachyears15|–}}}}}
| data166 = {{{coachteams15|}}}
| label167 = {{#if:{{{coachteams16|}}}|{{{coachyears16|–}}}}}
| data167 = {{{coachteams16|}}}
| label168 = {{#if:{{{coachteams17|}}}|{{{coachyears17|–}}}}}
| data168 = {{{coachteams17|}}}
| label169 = {{#if:{{{coachteams18|}}}|{{{coachyears18|–}}}}}
| data169 = {{{coachteams18|}}}
| label170 = {{#if:{{{coachteams19|}}}|{{{coachyears19|–}}}}}
| data170 = {{{coachteams19|}}}
| label171 = {{#if:{{{coachteams20|}}}|{{{coachyears20|–}}}}}
| data171 = {{{coachteams20|}}}
| data172 = {{#if:{{{ru_coachupdate|}}}|{{Infobox rugby biography/correct date|{{{ru_coachupdate|}}}}}}}
<!--
*****RU REFEREE*****
-->
| header180 = {{#if:{{{ru_refereecomps1|{{{ru_refereecomps|{{{refereecomps1|}}}}}}}}}|Refereeing career}}
| label181 = {{#if:{{{ru_refereecomps1|{{{ru_refereecomps|{{{refereecomps1|}}}}}}}}}|'''Years'''}}
| data181a = {{#if:{{{ru_refereecomps1|{{{ru_refereecomps|{{{refereecomps1|}}}}}}}}}|'''Competition'''}}
| data181c = {{#if:{{{ru_refereecomps1|{{{ru_refereecomps|{{{refereecomps1|}}}}}}}}}|'''Apps'''}}
| label182 = {{#if:{{{ru_refereecomps1|{{{ru_refereecomps|{{{refereecomps1|}}}}}}}}}|<nowiki />{{{ru_refereeyears1|{{{ru_refereeyears|{{{refereeyears1|-}}}}}}}}}}}
| data182a = {{{ru_refereecomps1|{{{ru_refereecomps|{{{refereecomps1|}}}}}}}}}
| data182c = {{{ru_refereeapps1|{{{ru_refereeapps|{{{refereeapps1|}}}}}}}}}
| label183 = {{#if:{{{refereecomps2|}}}|<nowiki />{{{refereeyears2|–}}}}}
| data183a = {{{refereecomps2|}}}
| data183c = {{{refereeapps2|}}}
| label184 = {{#if:{{{refereecomps3|}}}|<nowiki />{{{refereeyears3|–}}}}}
| data184a = {{{refereecomps3|}}}
| data184c = {{{refereeapps3|}}}
| label185 = {{#if:{{{refereecomps4|}}}|<nowiki />{{{refereeyears4|–}}}}}
| data185a = {{{refereecomps4|}}}
| data185c = {{{refereeapps4|}}}
| label186 = {{#if:{{{refereecomps5|}}}|<nowiki />{{{refereeyears5|–}}}}}
| data186a = {{{refereecomps5|}}}
| data186c = {{{refereeapps5|}}}
| label187 = {{#if:{{{refereecomps6|}}}|<nowiki />{{{refereeyears6|–}}}}}
| data187a = {{{refereecomps6|}}}
| data187c = {{{refereeapps6|}}}
| label188 = {{#if:{{{refereecomps7|}}}|<nowiki />{{{refereeyears7|–}}}}}
| data188a = {{{refereecomps7|}}}
| data188c = {{{refereeapps7|}}}
| label189 = {{#if:{{{refereecomps8|}}}|<nowiki />{{{refereeyears8|–}}}}}
| data189a = {{{refereecomps8|}}}
| data189c = {{{refereeapps8|}}}
| label190 = {{#if:{{{refereecomps9|}}}|<nowiki />{{{refereeyears9|–}}}}}
| data190a = {{{refereecomps9|}}}
| data190c = {{{refereeapps9|}}}
| label191 = {{#if:{{{refereecomps10|}}}|<nowiki />{{{refereeyears10|–}}}}}
| data191a = {{{refereecomps10|}}}
| data191c = {{{refereeapps10|}}}
| data192 = {{#if:{{{ru_refereeupdate|}}}|{{Infobox rugby biography/correct date|{{{ru_refereeupdate|}}}}}}}
}}}}
| header40 = Official website
| data41 = {{{website|{{{url|}}}}}}
| header42 = _BLANK_
| data43 = {{{module|}}}
| data44 = {{Infobox medal templates
| medals = {{{medals|{{{medaltemplates|}}}}}}
| expand = {{#ifeq: {{lc:{{{medals-expand|{{{show-medals|}}}}}}}} | no | | yes }}
}}
| data45 = {{{module2|}}}
}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox rugby biography with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox rugby biography]] with unknown parameter "_VALUE_"|ignoreblank=y | embed | name | image | image_size | alt | caption | birth_name | full_name | fullname | birth_date | birth_place | death_date | death_place | height | height_cm | height_ft | height_in | honorific_suffix | weight | weight_kg | weight_st | weight_lb | school | university | relatives | spouse | children | occupation | weight_update
| rl_currentposition | rl_position | rl_currentteam | regexp1 = rl_youthyears[%d][%d]* | regexp2 = rl_youthclubs[%d][%d]* | regexp3 = rl_amateuryears[%d][%d]* | regexp4 = rl_amateurclubs[%d][%d]* | regexp5 = rl_amateurapps[%d][%d]* | regexp6 = rl_amateurpoints[%d][%d]* | rl_amupdate | regexp7 = rl_clubyears[%d][%d]* | regexp8 = rl_proclubs[%d][%d]* | regexp9 = rl_clubapps[%d][%d]* | regexp10 = rl_clubpoints[%d][%d]* | rl_totalyears | rl_totalapps | rl_totalpoints | rl_clubupdate | regexp11 = sooyears[%d][%d]* | regexp12 = sooteam[%d][%d]* | regexp13 = sooapps[%d][%d]* | regexp14 = soopoints[%d][%d]* | sooupdate | regexp15 = rl_nationalyears[%d][%d]* | regexp16 = rl_nationalteam[%d][%d]* | regexp17 = rl_nationalapps[%d][%d]* | regexp18 = rl_nationalpoints[%d][%d]* | rl_ntupdate | regexp19 = rl_coachyears[%d][%d]* | regexp20 = rl_coachteams[%d][%d]* | rl_coachupdate | regexp21 = rl_refereeyears[%d][%d]* | regexp22 = rl_refereecomps[%d][%d]* | regexp23 = rl_refereeapps[%d][%d]* | rl_refereeupdate
| ru_currentposition | ru_position | position | ru_currentteam | ru_currentclub | currentclub | allblackid | allblackno | regexp24 = youthyears[%d][%d]* | regexp25 = youthclubs[%d][%d]* | ru_youthyears | ru_youthclubs | regexp26 = amatyears[%d][%d]* | regexp27 = amatteam[%d][%d]* | regexp28 = amatapps[%d][%d]* | regexp29 = amatpoints[%d][%d]* | ru_amateuryears | ru_amateurclubs | ru_amateurcaps | ru_amateurpoints | amatupdate | ru_amupdate | regexp30 = years[%d][%d]* | regexp31 = clubs[%d][%d]* | regexp32 = apps[%d][%d]* | regexp33 = points[%d][%d]* | ru_clubyears | clubs | ru_proclubs | ru_clubcaps | ru_clubpoints | totalyears | totalapps | totalpoints | clubupdate | ru_clubupdate | regexp34 = ru_provinceyears[%d][%d]* | regexp35 = ru_province[%d][%d]* | regexp36 = ru_provinceapps[%d][%d]* | regexp37 = ru_provincepoints[%d][%d]* | regexp57 = provinceyears[%d][%d]* | regexp58 = province[%d][%d]* | regexp59 = provinceapps[%d][%d]* | regexp60 = provincepoints[%d][%d]* | ru_provinceyears | ru_province | ru_provincecaps | ru_provincepoints | ru_provinceupdate | regexp38 = superyears[%d][%d]* | regexp39 = super[%d][%d]* | regexp40 = superapps[%d][%d]* | regexp41 = superpoints[%d][%d]* | super14years | super14caps | super14points | superupdate | super14update | regexp42 = repyears[%d][%d]* | regexp43 = repteam[%d][%d]* | regexp44 = repcaps[%d][%d]* | regexp45 = reppoints[%d][%d]* | ru_nationalyears | ru_nationalteam1 | ru_nationalteam | ru_nationalcaps | ru_nationalpoints | repupdate | ru_ntupdate | regexp46 = ru_sevensnationalyears[%d][%d]* | regexp54 = repsevensyears[%d][%d]* | regexp47 = ru_sevensnationalteam[%d][%d]* | regexp55 = repsevensteam[%d][%d]* | regexp48 = ru_sevensnationalcomp[%d][%d]* | regexp56 = repsevenscomp[%d][%d]* | ru_sevensupdate | regexp49 = coachyears[%d][%d]* | regexp50 = coachteams[%d][%d]* | ru_coachyears | ru_coachclubs | ru_coachupdate | ru_refereeyears1 | regexp51 = refereeyears[%d][%d]* | ru_refereecomps1 | regexp52 = refereecomps[%d][%d]* | ru_refereeapps1 | regexp53 = refereeapps[%d][%d]* | ru_refereeyears | ru_refereecomps | ru_refereeapps | ru_refereeupdate
| website | url | module | medals | medaltemplates | medals-expand | show-medals | module2 }}<!--
Tracking categories
If this template is using RL params-->{{main other|1={{#if:{{{rl_youthclubs1|}}}{{{rl_amateurclubs1|}}}{{{rl_proclubs1|}}}{{{sooteam1|}}}{{{rl_nationalteam1|}}}{{{rl_coachteams1|}}}{{{rl_refereecomps1|}}}|[[Category:Infobox rugby biography with rugby league parameters]]}}<!--
City v Country Origin params-->{{#if:{{{city_vs_country_team1|}}}|[[Category:Infobox rugby biography with City v Country parameters]]}}<!--
State of Origin params-->{{#if:{{{sooteam1|}}}|[[Category:Infobox rugby biography with State of Origin parameters]]}}<!--
If this template is *not* using RU params-->{{#if:{{{youthclubs1|{{{ru_youthclubs|}}}}}}{{{amatteam1|{{{ru_amateurclubs|}}}}}}{{{clubs1|{{{ru_proclubs|}}}}}}{{{ru_province1|{{{ru_province|}}}}}}{{{super1|{{{super14|}}}}}}{{{repteam1|{{{ru_nationalteam1|{{{ru_nationalteam|}}}}}}}}}{{{ru_sevensnationalteam1|}}}{{{coachteams1|{{{ru_coachclubs|}}}}}}{{{ru_refereecomps1|{{{ru_refereecomps|}}}}}}||[[Category:Infobox rugby biography with no rugby union parameters]]}}<!--
Tracking deprecated "needs linebreaks" parameters -->{{#if:{{{ru_youthclubs|}}}{{{ru_amateurclubs|}}}{{{clubs|}}}{{{ru_proclubs|}}}{{{ru_province|}}}{{{super14|}}}{{{ru_nationalteam|}}}{{{ru_nationalteam1|}}}{{{ru_sevensnationalteam|}}}{{{ru_coachyears|}}}{{{ru_coachclubs|}}}{{{ru_refereecomps|}}}|[[Category:Infobox rugby biography with deprecated parameters]]{{infobox rugby biography/depcheck|1={{{ru_youthclubs|}}}|2={{{ru_amateurclubs|}}}|3={{{clubs|}}}{{{ru_proclubs|}}}|4={{{ru_province|}}}|5={{{super14|}}}|6={{{ru_nationalteam|}}}{{{ru_nationalteam1|}}}|7={{{ru_sevensnationalteam|}}}|8={{{ru_coachclubs|}}}|9={{{ru_refereecomps|}}}}}}}}}<noinclude>
{{documentation}}<!-- add category and language links to the /doc sub-page, not here -->
</noinclude>
908m91qfsz5cviu94v5883nkqsybmkd
Templat:Mono
10
386885
2444318
2022-08-13T14:52:11Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>ifsubst|1=|2=<templatestyles src="Mono/styles.css" />}}<span class="monospaced">{{{2|{{{1}}}}}}</span><noinclude>
{{Documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
eyigcpktddtgno85j4vajm121b6hlip
Templat:Mono/styles.css
10
386886
2444319
2022-08-13T14:52:36Z
David Wadie Fisher-Freberg
51
b
sanitized-css
text/css
/* {{pp-template}} */
.monospaced {
/* "monospace, monospace" per [[WP:MONO]] */
font-family: monospace, monospace;
}
np4jqak6c9salmg4ht0lxddkoh7wqt0
Templat:Samp
10
386887
2444320
2022-08-13T14:53:01Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
<samp {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} style="padding-left:0.4em; padding-right:0.4em; color:{{{color|#666666}}}; {{{style|}}}" {{#if:{{{lang|}}}|lang="{{{lang}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</samp><noinclude>
<!--Categories and interwikis go near the bottom of the /doc page.-->
{{Documentation}}
</noinclude>
apn9hmhqkv5mh0l3sdd21myapwsnm79
Templat:Subst
10
386888
2444321
2022-08-13T14:53:34Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
{{subst:{{#if:{{{1|}}}|[[Templat:{{{1}}}|{{{1}}}]]}}}}<noinclude>
{{Documentation}}
<!-- Please add categories to the /doc subpage; interwikis go to Wikidata -->
</noinclude>
8uszs1da0dzm0h08gjf5osrnzigeoh8
Templat:Tracks Wikidata
10
386889
2444322
2022-08-13T14:53:52Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
{{Sister project
| image = [[File:Wikidata-logo-with-magnifying-glass-icon.svg|40px|link=Wikipedia:Wikidata]]
| position = {{{position|}}}
| text = This {{template other
| template
| {{module other
| module
| {{category other
| category
| page <!-- not template, module, or category -->
}}
}}
}} [[:Category:{{{cat|Wikidata tracking categories}}}|tracks]] {{#if:{{{section|}}}
| one or more [[Wikidata]] properties; see [[#{{{section}}}|§ {{{section}}}]] for details.
| the [[Wikidata]] propert{{#if:{{{2|}}}|ies:|y:}} {{#invoke:Uses Wikidata|usesProperty}}
}}
}}<includeonly>{{#switch:{{SUBPAGENAME}}
|sandbox |testcases |doc= <!--no category-->
|#default = {{template other
| [[Category:Templates tracking Wikidata]]
| {{module other
| [[Category:Modules tracking Wikidata]]
| {{category other
| <!-- if used in a category, don't automatically add parent category -->
| <!-- not template, module, or category -->
}}
}}
}}
}}</includeonly><noinclude>
{{Documentation}}<!-- Add categories and interwikis to the /doc sub-page -->
</noinclude>
cg6r6zwpm9zi0w8yg3t3p6v04m1aia2
Templat:UF-hcard-person
10
386890
2444323
2022-08-13T14:54:17Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
The HTML markup produced by this template includes an [[HCard|hCard microformat]], which makes the person's details [[Parsing|parsable]] by computers, either acting automatically to catalogue articles across Wikipedia or via a browser tool operated by a reader, to (for example) add the subject to an address book or database. For more information about the use of [[microformat]]s on Wikipedia, please see [[Wikipedia:WikiProject Microformats|the microformat project]].
=== Sub-templates ===
Date-of-birth ("bday") information will only be included in the microformat if {{tl|birth date}}, or {{tl|birth date and age}} are used in the infobox. ([[Wikipedia:WikiProject Microformats/dates|Do not use these if the date is before 1583]]). Be cautious about using these if the person is still living, per [[WP:DOB]].
To include a URL, use {{Tl|URL}}.
'''Please do not remove instances of these sub-templates.'''
=== Classes ===
hCard uses HTML classes including:
{{Flatlist/microformat|
*adr
*agent
*bday
*birthplace
*category
*country-name
*deathdate
*deathplace
*extended-address
*family-name
*fn (required)
*given-name
*honorific-prefix
*honorific-suffix
*label
*locality
*n
*nickname
*note
*org
*role
*url
*vcard
}}
'''Please do not rename or remove these classes nor collapse nested elements which use them.'''<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |{{#ifeq:{{SUBPAGENAME}}|sandbox | |[[Category:Templates generating hCards]]}} }}</includeonly><noinclude>
[[Category:Templates generating hCards]]
[[Category:Microformat (uF) message templates]]
</noinclude>
axz1fcq74yk4k48upkzdbv1ne3ifwdf
Templat:Flatlist/microformat
10
386891
2444324
2022-08-13T14:54:43Z
David Wadie Fisher-Freberg
51
←Mengalihkan ke [[Templat:Flatlist]]
wikitext
text/x-wiki
#ALIH [[Template:Flatlist]]
60ajw6tmoumsma0nme2rk7kqe20tiin
Modul:Person height
828
386892
2444326
2022-08-13T14:56:17Z
David Wadie Fisher-Freberg
51
b
Scribunto
text/plain
-- This module implements [[Template:Infobox person/height]]
local p = {}
local function clean(s)
s = mw.ustring.gsub(s, 'metre', 'm')
s = mw.ustring.gsub(s, '([^a])meter', '%1m') -- prevents "parameter" from being changed to "param"
s = mw.ustring.gsub(s, 'centi', 'c') -- changes "centim" to "cm"
s = mw.ustring.gsub(s, 'ms', 'm')
s = mw.ustring.gsub(s, 'm[%.,]', 'm')
s = mw.ustring.gsub(s, 'feet', 'ft')
s = mw.ustring.gsub(s, 'foot', 'ft')
s = mw.ustring.gsub(s, 'ft[%.,]', 'ft')
s = mw.ustring.gsub(s, 'inches', 'in')
s = mw.ustring.gsub(s, 'inch', 'in')
s = mw.ustring.gsub(s, 'ins', 'in')
s = mw.ustring.gsub(s, 'in[%.,]', 'in')
s = mw.ustring.gsub(s, '%[%[[Mm]%]%]s', '[[Metre|m]]')
s = mw.ustring.gsub(s, '%[%[[Cc]m%]%]s', '[[Centimetre|cm]]')
s = mw.ustring.gsub(s, '%[%[[Cc]entim|cm%]%]', '[[Centimetre|cm]]')
s = mw.ustring.gsub(s, '%[%[[Ii]n|in%]%]', '[[inch|in]]')
return s
end
local function isnumber(s)
if s then
s = mw.ustring.gsub(s, '%+%s*%d+%s*/%s*%d+%s*$', '')
return tonumber(s)
end
return nil
end
local function get_convert_args(s, prefer, enforce)
local prefer_m = (prefer or '') == 'm'
local force_m = (enforce or '') == 'm'
local prefer_cm = (prefer or '') == 'cm'
local force_cm = (enforce or '') == 'cm'
unconverted = clean(s or '') -- basic unit cleaning
s = mw.ustring.gsub(unconverted, '&[Nn][Bb][Ss][Pp];', ' ')
local m = mw.ustring.find(s, 'm')
local c = mw.ustring.find(s, 'cm')
local f = mw.ustring.find(s, 'ft')
local i = mw.ustring.find(s, 'in')
if m == nil and f == nil and i == nil then
return '', unconverted
end
if c ~= nil and f == nil and i == nil then
local n = mw.ustring.sub(s, 1, c - 1)
if isnumber(n) then
return force_m
and {n/100,'m','ftin',0,['abbr']='on'}
or {n,'cm','ftin',0,['abbr']='on'}, mw.ustring.sub(s, c+2)
end
return '', unconverted
end
if m ~= nil and c == nil and f == nil and i == nil then
local n = mw.ustring.sub(s, 1, m - 1)
if isnumber(n) then
return force_cm
and {n*100,'cm','ftin',0,['abbr']='on'}
or {n,'m','ftin',0,['abbr']='on'}, mw.ustring.sub(s, m+1)
end
return '', unconverted
end
if f ~= nil and i ~=nil and m == nil then
local n1 = mw.ustring.sub(s, 1, f - 1)
local n2 = mw.ustring.sub(s, f+2, i - 1)
if isnumber(n1) and isnumber(n2) then
return (force_m or prefer_m)
and {n1,'ft',n2,'in', 'm',2,['abbr']='on'}
or {n1,'ft',n2,'in', 'cm',0,['abbr']='on'}, mw.ustring.sub(s, i+2)
end
return '', unconverted
end
if f ~= nil and i == nil and m == nil then
local n = mw.ustring.sub(s, 1, f - 1)
if isnumber(n) then
return (force_m or prefer_m)
and {n,'ft','m',2,['abbr']='on'}
or {n,'ft','cm',0,['abbr']='on'}, mw.ustring.sub(s, f+2)
end
return '', unconverted
end
if i ~= nil and f == nil and m == nil then
local n = mw.ustring.sub(s, 1, i - 1)
if isnumber(n) then
return (force_m or prefer_m)
and {n,'in','m',2,['abbr']='on'}
or {n,'in','cm',0,['abbr']='on'}, mw.ustring.sub(s, i+2)
end
return '', unconverted
end
return '', unconverted
end
function convert(frame, args)
local targs, str = get_convert_args(args[1], args['prefer'] or '', args['enforce'] or '')
if type(targs) == 'table' then
return frame:expandTemplate{ title = 'convert', args = targs} .. str
else
return str
end
end
function p.main(frame)
return convert(frame, frame.args[1] and frame.args or frame:getParent().args)
end
return p
re69rj438k93l62b8lwpwssapszb494
Templat:Convinfobox/3
10
386893
2444328
2022-08-13T14:58:09Z
David Wadie Fisher-Freberg
51
b
wikitext
text/x-wiki
<noinclude>empty
[[Category:Subtemplates of Template Convinfobox]]
</noinclude>
lnhmxx2e0ivswbyzgwoom01ykyovrkq
Templat:Use first nonempty
10
386894
2444329
2022-08-13T14:58:32Z
David Wadie Fisher-Freberg
51
←Mengalihkan ke [[Templat:If empty]]
wikitext
text/x-wiki
#ALIH [[Templat:If empty]]
9rrul2lkc368g3178x7k4an3ycvz6xd
Pambangkik listrik tanago nuklir
0
386895
2444330
2022-08-13T16:59:46Z
114.10.71.195
←Mambuek laman baisi "[[Berkas:Kernkraftwerk Grafenrheinfeld - 2013.jpg|jmpl|250px|ka|Sabuah pambangkik listrik tanago nuklir di mano duo minaro pandingin dan bangunan pondasi utamo reaktor PWR tacoliak jaleh.]] Berkas:Nuclear power plant-pressurized water reactor-PWR.png|thumb|400px|Pambangkik listrik tanago nuklir dangan reaktor aia batokanan. (RAP, PWR)<br /> 1- Bangunan pondasi utamo, 2- Minaro pandingin, 3- Reaktor, 4- Bar kontrol, 5- Akumulator tokanan, 6- Pambangkik uap, 7..."
wikitext
text/x-wiki
[[Berkas:Kernkraftwerk Grafenrheinfeld - 2013.jpg|jmpl|250px|ka|Sabuah pambangkik listrik tanago nuklir di mano duo minaro pandingin dan bangunan pondasi utamo reaktor PWR tacoliak jaleh.]]
[[Berkas:Nuclear power plant-pressurized water reactor-PWR.png|thumb|400px|Pambangkik listrik tanago nuklir dangan reaktor aia batokanan. (RAP, PWR)<br />
1- Bangunan pondasi utamo,
2- Minaro pandingin,
3- Reaktor,
4- Bar kontrol,
5- Akumulator tokanan,
6- Pambangkik uap,
7- Bahan baka nuklir,
8- Turbin,
9- Generator listrik,
10-Transformator,
11-Kondensor,
12-Uap,
13-Caiaran sanyawa jenuh dan tak jenuh,
14-Ambient udaro,
15-Udaro lombab,
16-Aliran aia,
17-Sirkuit pandingin,
18-Sirkuit primer,
19-Sirkuit sekunder,
20-Emisi udaro lombab (dangan uap aia).,
21-Pompa uap aia.]]
[[Berkas:WASH-1400 - Figure 3-7.png|jmpl|250px|ka|Typical PWR Containment]]
[[Berkas:WASH-1400 - Figure 3-3.png|jmpl|250px|ka|Schematic dari Reactor Coolant System untuak PWR]]
'''Pambangkik listrik tanago nuklir''' atau ('''PLTN''') adolah rangkaian instalasi [[industri]] nan paguno untuak pambangkitan energi listrik dari energi nuklir. Pambangkik iko tadiri dari satu atau lobiah reaktor [[reaktor nuklir]] [[pambangkik listrik]].
PLTN tamasuak dalam [[Pambangkik listrik|pambangkik dayo]] ([[bahaso Inggirih|EN]]: ''base load''), nan dapek bakarojo dangan baiak katiko dayo kaluarannyo konstan (biapun [[reaktor aia didih]] ([[bahaso Inggirih|EN]]: ''boiling water reactor'') dapek turun hinggo satangah dayonyo katiko malam hari). Dayo nan dibangkikan par unit pembangkik barkisar dari [https://www.power-technology.com/features/featurethe-worlds-smallest-nuclear-reactors-4144463/ 12 MWe] hinggo 1400 MWe.
==Kaàmanan==
[[Berkas:TINT Radioactive wastes' barrel.jpg|jmpl|250px|ka|Limbah nan manganduang bahan radioaktif nan disimpan elok-elok untuak diolah.]]
{{sadang karajo}}
==Rujuakan==
{{Reflist}}
==Catatan==
{{Reflist|group="catatan"}}
==Pautan lua==
*{{commons category inline|Nuclear power plants|Pambangkik listrik tanago nuklir}}
* [http://www.ippnw.org IPPNW - International Physicians for the Prevention of Nuclear War (Nobel Peace Prize 1985)]
* [http://www.mapw.org.au/nuclear-reactors/rrr-index.html MAPW - Information on Australia's research reactor] {{Webarchive|url=https://web.archive.org/web/20071125135007/http://www.mapw.org.au/nuclear-reactors/rrr-index.html |date=2007-11-25 }}
* [http://www.vega.org.uk/video/programme/67 Freeview Video 'Nuclear Power Plants - What's the Problem' A Royal Institution Lecture by John Collier by the Vega Science Trust.]
* [http://atomndt.com/en/ Non Destructive Testing for Nuclear Power Plants]
* [http://www.ae4rv.com/games/nuke.htm Web-based simple nuclear power plant game]
* [http://www.uranium.info Uranium.Info] publishing uranium price since 1968.
* [http://www.iaea.org/cgi-bin/db.page.pl/pris.charts.htm Information about all NPP in the world] {{Webarchive|url=https://web.archive.org/web/20120121095022/http://www.iaea.org/cgi-bin/db.page.pl/pris.charts.htm |date=2012-01-21 }}
* [http://www.nucleartourist.com/basics/current.htm U.S. plants and operators]
* [http://www.sckcen.be SCK.CEN Belgian Nuclear Research Centre in Mol.]
* [http://www.world-nuclear.org/info/inf67.htm Civil Liability for Nuclear Damage] {{Webarchive|url=https://web.archive.org/web/20061230211844/http://www.world-nuclear.org/info/inf67.htm |date=2006-12-30 }} - World Nuclear Association
* [http://www.unionmillwright.com/nuke.html Glossary of Nuclear Terms] {{Webarchive|url=https://web.archive.org/web/20111219145715/http://www.unionmillwright.com/nuke.html |date=2011-12-19 }}
* [http://www.swemorph.com/pdf/dbt1.pdf Protection against Sabotage of Nuclear Facilities: Using Morphological Analysis in Revising the Design Basis Threat] From the [http://www.swemorph.com Swedish Morphological Society]
* [http://www.earthhealing.info/CH.pdf Critical Hour: Three Mile Island, The Nuclear Legacy, And National Security] Online book by Albert J. Fritsch, Arthur H. Purcell, and Mary Byrd Davis (2005). [http://www.earthhealing.info/chupdate.html Updated edition] June 2006
* [http://geoimages.berkeley.edu/wwp905/html/JeffreyMartin.html An Interactive VR Panorama of the cooling towers at Temelin Nuclear Power Plant, Czech Republic] {{Webarchive|url=https://web.archive.org/web/20061021042523/http://geoimages.berkeley.edu/wwp905/html/JeffreyMartin.html |date=2006-10-21 }}
* [http://exploreourpla.net/explorer/?geoLink=999&lat=38.6596875&lon=-95.4140625&alt=4194304&mid=8&nbl=8,10,111 Interactive map with all nuclear power plants] US and worldwide (Note: missing many plants)
* [http://dev.qmaps.nl/?application=nuclear Map with all nuclear power plants] US and worldwide (Note: active, not active and under construction)
{{authority control}}
{{tekno-stub}}
g7k8i7e48z6vhyihzjx4ggpt99xq23l
2444331
2444330
2022-08-13T17:02:02Z
114.10.71.195
wikitext
text/x-wiki
[[Berkas:Kernkraftwerk Grafenrheinfeld - 2013.jpg|jmpl|250px|ka|Sabuah pambangkik listrik tanago nuklir di mano duo minaro pandingin dan bangunan pondasi utamo reaktor PWR tacoliak jaleh.]]
[[Berkas:Nuclear power plant-pressurized water reactor-PWR.png|thumb|400px|Pambangkik listrik tanago nuklir dangan reaktor aia batokanan. (RAP, PWR)<br />
1- Bangunan pondasi utamo,
2- Minaro pandingin,
3- Reaktor,
4- Bar kontrol,
5- Akumulator tokanan,
6- Pambangkik uap,
7- Bahan baka nuklir,
8- Turbin,
9- Generator listrik,
10-Transformator,
11-Kondensor,
12-Uap,
13-Caiaran sanyawa jenuh dan tak jenuh,
14-Ambient udaro,
15-Udaro lombab,
16-Aliran aia,
17-Sirkuit pandingin,
18-Sirkuit primer,
19-Sirkuit sekunder,
20-Emisi udaro lombab (dangan uap aia).,
21-Pompa uap aia.]]
[[Berkas:WASH-1400 - Figure 3-7.png|jmpl|250px|ka|Typical PWR Containment]]
[[Berkas:WASH-1400 - Figure 3-3.png|jmpl|250px|ka|Schematic dari Reactor Coolant System untuak PWR]]
'''Pambangkik listrik tanago nuklir''' atau ('''PLTN''') adolah rangkaian instalasi [[industri]] nan paguno untuak pambangkitan energi listrik dari energi nuklir. Pambangkik iko tadiri dari satu atau lobiah [[reaktor nuklir]] [[pambangkik listrik]].
PLTN tamasuak dalam [[Pambangkik listrik|pambangkik dayo]] ([[bahaso Inggirih|EN]]: ''base load''), nan dapek bakarojo dangan baiak katiko dayo kaluarannyo konstan (biapun [[reaktor aia didih]] ([[bahaso Inggirih|EN]]: ''boiling water reactor'') dapek turun hinggo satangah dayonyo katiko malam hari). Dayo nan dibangkikan par unit pembangkik barkisar dari [https://www.power-technology.com/features/featurethe-worlds-smallest-nuclear-reactors-4144463/ 12 MWe] hinggo 1400 MWe.
==Kaàmanan==
[[Berkas:TINT Radioactive wastes' barrel.jpg|jmpl|250px|ka|Limbah nan manganduang bahan radioaktif nan disimpan elok-elok untuak diolah.]]
{{sadang karajo}}
==Rujuakan==
{{Reflist}}
==Catatan==
{{Reflist|group="catatan"}}
==Pautan lua==
*{{commons category inline|Nuclear power plants|Pambangkik listrik tanago nuklir}}
* [http://www.ippnw.org IPPNW - International Physicians for the Prevention of Nuclear War (Nobel Peace Prize 1985)]
* [http://www.mapw.org.au/nuclear-reactors/rrr-index.html MAPW - Information on Australia's research reactor] {{Webarchive|url=https://web.archive.org/web/20071125135007/http://www.mapw.org.au/nuclear-reactors/rrr-index.html |date=2007-11-25 }}
* [http://www.vega.org.uk/video/programme/67 Freeview Video 'Nuclear Power Plants - What's the Problem' A Royal Institution Lecture by John Collier by the Vega Science Trust.]
* [http://atomndt.com/en/ Non Destructive Testing for Nuclear Power Plants]
* [http://www.ae4rv.com/games/nuke.htm Web-based simple nuclear power plant game]
* [http://www.uranium.info Uranium.Info] publishing uranium price since 1968.
* [http://www.iaea.org/cgi-bin/db.page.pl/pris.charts.htm Information about all NPP in the world] {{Webarchive|url=https://web.archive.org/web/20120121095022/http://www.iaea.org/cgi-bin/db.page.pl/pris.charts.htm |date=2012-01-21 }}
* [http://www.nucleartourist.com/basics/current.htm U.S. plants and operators]
* [http://www.sckcen.be SCK.CEN Belgian Nuclear Research Centre in Mol.]
* [http://www.world-nuclear.org/info/inf67.htm Civil Liability for Nuclear Damage] {{Webarchive|url=https://web.archive.org/web/20061230211844/http://www.world-nuclear.org/info/inf67.htm |date=2006-12-30 }} - World Nuclear Association
* [http://www.unionmillwright.com/nuke.html Glossary of Nuclear Terms] {{Webarchive|url=https://web.archive.org/web/20111219145715/http://www.unionmillwright.com/nuke.html |date=2011-12-19 }}
* [http://www.swemorph.com/pdf/dbt1.pdf Protection against Sabotage of Nuclear Facilities: Using Morphological Analysis in Revising the Design Basis Threat] From the [http://www.swemorph.com Swedish Morphological Society]
* [http://www.earthhealing.info/CH.pdf Critical Hour: Three Mile Island, The Nuclear Legacy, And National Security] Online book by Albert J. Fritsch, Arthur H. Purcell, and Mary Byrd Davis (2005). [http://www.earthhealing.info/chupdate.html Updated edition] June 2006
* [http://geoimages.berkeley.edu/wwp905/html/JeffreyMartin.html An Interactive VR Panorama of the cooling towers at Temelin Nuclear Power Plant, Czech Republic] {{Webarchive|url=https://web.archive.org/web/20061021042523/http://geoimages.berkeley.edu/wwp905/html/JeffreyMartin.html |date=2006-10-21 }}
* [http://exploreourpla.net/explorer/?geoLink=999&lat=38.6596875&lon=-95.4140625&alt=4194304&mid=8&nbl=8,10,111 Interactive map with all nuclear power plants] US and worldwide (Note: missing many plants)
* [http://dev.qmaps.nl/?application=nuclear Map with all nuclear power plants] US and worldwide (Note: active, not active and under construction)
{{authority control}}
{{tekno-stub}}
5ex4nj2t6j9d59v2z105ynhmxucc9lm
2444336
2444331
2022-08-14T05:11:08Z
182.2.171.24
/* Kaàmanan */
wikitext
text/x-wiki
[[Berkas:Kernkraftwerk Grafenrheinfeld - 2013.jpg|jmpl|250px|ka|Sabuah pambangkik listrik tanago nuklir di mano duo minaro pandingin dan bangunan pondasi utamo reaktor PWR tacoliak jaleh.]]
[[Berkas:Nuclear power plant-pressurized water reactor-PWR.png|thumb|400px|Pambangkik listrik tanago nuklir dangan reaktor aia batokanan. (RAP, PWR)<br />
1- Bangunan pondasi utamo,
2- Minaro pandingin,
3- Reaktor,
4- Bar kontrol,
5- Akumulator tokanan,
6- Pambangkik uap,
7- Bahan baka nuklir,
8- Turbin,
9- Generator listrik,
10-Transformator,
11-Kondensor,
12-Uap,
13-Caiaran sanyawa jenuh dan tak jenuh,
14-Ambient udaro,
15-Udaro lombab,
16-Aliran aia,
17-Sirkuit pandingin,
18-Sirkuit primer,
19-Sirkuit sekunder,
20-Emisi udaro lombab (dangan uap aia).,
21-Pompa uap aia.]]
[[Berkas:WASH-1400 - Figure 3-7.png|jmpl|250px|ka|Typical PWR Containment]]
[[Berkas:WASH-1400 - Figure 3-3.png|jmpl|250px|ka|Schematic dari Reactor Coolant System untuak PWR]]
'''Pambangkik listrik tanago nuklir''' atau ('''PLTN''') adolah rangkaian instalasi [[industri]] nan paguno untuak pambangkitan energi listrik dari energi nuklir. Pambangkik iko tadiri dari satu atau lobiah [[reaktor nuklir]] [[pambangkik listrik]].
PLTN tamasuak dalam [[Pambangkik listrik|pambangkik dayo]] ([[bahaso Inggirih|EN]]: ''base load''), nan dapek bakarojo dangan baiak katiko dayo kaluarannyo konstan (biapun [[reaktor aia didih]] ([[bahaso Inggirih|EN]]: ''boiling water reactor'') dapek turun hinggo satangah dayonyo katiko malam hari). Dayo nan dibangkikan par unit pembangkik barkisar dari [https://www.power-technology.com/features/featurethe-worlds-smallest-nuclear-reactors-4144463/ 12 MWe] hinggo 1400 MWe.
==Kaàmanan==
[[Berkas:TINT Radioactive wastes' barrel.jpg|jmpl|250px|ka|Limbah nan manganduang bahan radioaktif nan disimpan elok-elok untuak diolah.]]
[[Berkas:PressurizedWaterReactor.gif|jmpl|450px|ka|reaktor aia batokanan.]]
{{sadang karajo}}
==Rujuakan==
{{Reflist}}
==Catatan==
{{Reflist|group="catatan"}}
==Pautan lua==
*{{commons category inline|Nuclear power plants|Pambangkik listrik tanago nuklir}}
* [http://www.ippnw.org IPPNW - International Physicians for the Prevention of Nuclear War (Nobel Peace Prize 1985)]
* [http://www.mapw.org.au/nuclear-reactors/rrr-index.html MAPW - Information on Australia's research reactor] {{Webarchive|url=https://web.archive.org/web/20071125135007/http://www.mapw.org.au/nuclear-reactors/rrr-index.html |date=2007-11-25 }}
* [http://www.vega.org.uk/video/programme/67 Freeview Video 'Nuclear Power Plants - What's the Problem' A Royal Institution Lecture by John Collier by the Vega Science Trust.]
* [http://atomndt.com/en/ Non Destructive Testing for Nuclear Power Plants]
* [http://www.ae4rv.com/games/nuke.htm Web-based simple nuclear power plant game]
* [http://www.uranium.info Uranium.Info] publishing uranium price since 1968.
* [http://www.iaea.org/cgi-bin/db.page.pl/pris.charts.htm Information about all NPP in the world] {{Webarchive|url=https://web.archive.org/web/20120121095022/http://www.iaea.org/cgi-bin/db.page.pl/pris.charts.htm |date=2012-01-21 }}
* [http://www.nucleartourist.com/basics/current.htm U.S. plants and operators]
* [http://www.sckcen.be SCK.CEN Belgian Nuclear Research Centre in Mol.]
* [http://www.world-nuclear.org/info/inf67.htm Civil Liability for Nuclear Damage] {{Webarchive|url=https://web.archive.org/web/20061230211844/http://www.world-nuclear.org/info/inf67.htm |date=2006-12-30 }} - World Nuclear Association
* [http://www.unionmillwright.com/nuke.html Glossary of Nuclear Terms] {{Webarchive|url=https://web.archive.org/web/20111219145715/http://www.unionmillwright.com/nuke.html |date=2011-12-19 }}
* [http://www.swemorph.com/pdf/dbt1.pdf Protection against Sabotage of Nuclear Facilities: Using Morphological Analysis in Revising the Design Basis Threat] From the [http://www.swemorph.com Swedish Morphological Society]
* [http://www.earthhealing.info/CH.pdf Critical Hour: Three Mile Island, The Nuclear Legacy, And National Security] Online book by Albert J. Fritsch, Arthur H. Purcell, and Mary Byrd Davis (2005). [http://www.earthhealing.info/chupdate.html Updated edition] June 2006
* [http://geoimages.berkeley.edu/wwp905/html/JeffreyMartin.html An Interactive VR Panorama of the cooling towers at Temelin Nuclear Power Plant, Czech Republic] {{Webarchive|url=https://web.archive.org/web/20061021042523/http://geoimages.berkeley.edu/wwp905/html/JeffreyMartin.html |date=2006-10-21 }}
* [http://exploreourpla.net/explorer/?geoLink=999&lat=38.6596875&lon=-95.4140625&alt=4194304&mid=8&nbl=8,10,111 Interactive map with all nuclear power plants] US and worldwide (Note: missing many plants)
* [http://dev.qmaps.nl/?application=nuclear Map with all nuclear power plants] US and worldwide (Note: active, not active and under construction)
{{authority control}}
{{tekno-stub}}
k8wsespgngcpoyykdw5670dy1gon69r
Baja ringan
0
386896
2444344
2022-08-14T11:50:35Z
182.0.136.202
←Mambuek laman baisi "{{Infobox tool |name=Baja Ringan | image = Structural-steel-icons.jpg | image size = 250 | caption =Babagai bantuak baja ringan nan dipotong pendek{{br}} [[Berkas:Commons-logo.svg|al=|class=noviewer|16x16px]] [[c:Special:Search/Category:Structural steel|Media: Baja Ringan]] | other_name = | classification = material [[baja]] | types = | related = }} [[Berkas:WikiCFSbuilding.jpg|ka|jmpl|Rangka atok baja ringan]] '''Baja Ringan''' adolah [[baja karbon]] nan basifat..."
wikitext
text/x-wiki
{{Infobox tool
|name=Baja Ringan
| image = Structural-steel-icons.jpg
| image size = 250
| caption =Babagai bantuak baja ringan nan dipotong pendek{{br}}
[[Berkas:Commons-logo.svg|al=|class=noviewer|16x16px]] [[c:Special:Search/Category:Structural steel|Media: Baja Ringan]]
| other_name =
| classification = material [[baja]]
| types =
| related =
}}
[[Berkas:WikiCFSbuilding.jpg|ka|jmpl|Rangka atok baja ringan]]
'''Baja Ringan''' adolah [[baja karbon]] nan basifat kaku dan kuek sahinggo banyak digunoan untuak kaparluan [[konstruksi]]. Baja ringan punyo ''feromagnetisme'' ([[magnet]]) nan baàrti dapek juo untuak digunoan sabagai rangko oto, mambuek paralatan listrik dan sanjato api.<ref name="Wei-Wen Yu">{{Cite book
| last = Wei-Wen Yu, John Wiley and Sons Inc.
| first =
|title = Cold-Formed Steel Design
| author-link =
| publisher = John Wiley & Sons, New York, NY
| year = 2000
| url =
| isbn =
| accessdate = }}</ref>
==Rujuakan==
{{Reflist}}
==Pautan lua==
{{wikiquote}}
*{{commons category inline|Structural steel|baja ringan}}
*[https://www.webarchive.org.uk/wayback/archive/20110412222959/http://www.steelconstruction.org/images/stories/ce_book_final1.pdf Panduan untuk Penandaan CE untuk Pekerjaan Baja Struktural, Publikasi BCSA No. 46/08.]
*[http://www.steelconstruction.info Ensiklopedia untuk informasi konstruksi baja]
*[https://www.aisc.org/globalassets/aisc/publications/historic-shape-references/hot-rolled-carbon-steel-structural-shapes-1948.pdf Buku Pogangan Baja Struktural]
{{authority control}}
rx8ua0enbmhkf2avn7t275gse2rlf0i