Wikipedia
cebwiki
https://ceb.wikipedia.org/wiki/Unang_Panid
MediaWiki 1.46.0-wmf.26
first-letter
Medya
Espesyal
Hisgot
Gumagamit
Hisgot sa Gumagamit
Wikipedia
Hisgot sa Wikipedia
Payl
Hisgot sa Payl
MediaWiki
Hisgot sa MediaWiki
Plantilya
Hisgot sa Plantilya
Tabang
Hisgot sa Tabang
Kategoriya
Hisgot sa Kategoriya
TimedText
TimedText talk
Module
Module talk
Event
Event talk
Wikipedia:Tubaan
4
955
37019688
37019217
2026-05-02T06:42:43Z
Filipinayzd
361
/* Program submissions open: Bikol WikiConference 2026 */ new section
37019688
wikitext
text/x-wiki
[[Kategoriya:Wikipedya]]
:''Non-Cebuano-speakers, please visit [[Wikipedia:Embahada|our Embassy]].''
:''Para sa mga hindi nakakapag-Sebwano, maaari lamang tumungo sa [[Wikipedia:Embahada|aming Pasuguan]].''
:''Si non parli cebuano, per favore, visita [[Wikipedia:Embahada|nostra Ambasciata]].
:''Si no habla cebuano, por favor, visite [[Wikipedia:Embahada|nuestra Embajada]].''
:''수그부아논 또는 세부어(세부아노)를 모르면, [[Wikipedia:Embahada|우리의 대사관]]에 방문하십시요.
:''Đối với những người không nói tiếng Cebu, vui lòng đến trang [[Wikipedia:Embahada|đại sứ quán]] của chúng tôi.''
<div class="plainlinks" style="background-color: #7bceff; border: 1px solid #00a5ff; color: black; font-weight: bold; margin: 2em 0 1em; padding: .5em 1em; vertical-align: middle; clear: both;">Palihog pagbilin og [{{fullurl:{{ns:4}}:{{PAGENAMEE}}|action=edit§ion=new}} <span style="color: #5a3696;">bag-ong mensahe</span>].</div>
{| class="infobox" width="270px"
|-
!align="center"|[[Image:Filing cabinet icon.svg|50px|Arkibo]]<br>[[Wikipedia:Unsaon pag-arkibo ang mga panid sa hisgot|Mga arkibo]]
----
|-
|
* [[Wikipedia:Tubaan/Arkibo 1|Arkibo 1]] (hangtod [[Disyembre 18]], [[2006]])
* [[Wikipedia:Tubaan/Arkibo 2|Arkibo 2]] (hangtod [[Mayo 3]], [[2007]], lakip ang gikan didto sa [[Talk:Unang Panid]])
* [[Wikipedia:Tubaan/Arkibo 3|Arkibo 3]] (hangtod [[Agosto 11]], [[2007]])
* [[Wikipedia:Tubaan/Arkibo 4|Arkibo 4]] (hangtod [[Marso 28]], [[2008]])
* [[Wikipedia:Tubaan/Arkibo 5|Arkibo 5]] (hangtod [[Enero 1]], [[2009]])
* [[Wikipedia:Tubaan/Arkibo 6|Arkibo 6]] (hangtod [[Enero 1]], [[2010]])
* [[Wikipedia:Tubaan/Arkibo 7|Arkibo 7]] (hangtod [[Enero 1]], [[2012]])
* [[Wikipedia:Tubaan/Arkibo 8|Arkibo 8]] (hangtod [[Enero 30]], [[2013]])
* [[Wikipedia:Tubaan/Arkibo 9|Arkibo 9]] (hangtod [[Enero 29]], [[2014]])
* [[Wikipedia:Tubaan/Arkibo 10|Arkibo 10]] (hangtod [[Pebrero 4]], [[2015]])
* [[Wikipedia:Tubaan/Arkibo 11|Arkibo 11]] (hangtod [[Pebrero 15]], [[2017]])
* [[Wikipedia:Tubaan/Arkibo 12|Arkibo 12]] (hangtod [[Marso 2]], [[2018]])
* [[Wikipedia:Tubaan/Arkibo 13|Arkibo 13]] (2018)
* [[Wikipedia:Tubaan/Arkibo 14|Arkibo 14]] (2019)
* [[Wikipedia:Tubaan/Arkibo 15|Arkibo 15]] (2020)
* [[Wikipedia:Tubaan/Arkibo 16|Arkibo 16]] (2021)
* [[Wikipedia:Tubaan/Arkibo 17|Arkibo 17]] (2022)
* [[Wikipedia:Tubaan/Arkibo 18|Arkibo 18]] (2023)
* [[Wikipedia:Tubaan/Arkibo 19|Arkibo 19]] (2024)
* [[Wikipedia:Tubaan/Arkibo 20|Arkibo 20]] (2025)
|}
__NEWSECTIONLINK__
Maayong pag-abot sa atong '''tubaan'''! Kining maong panid gitagana alang sa komunikasyon sa mga miyembro ning atong katilingban sa Wikipedyang Sinugboanon.
Mahimo kang motabang sa paghimo sa [[Wikipedya]] ngadto sa usa ka ikapadayeg nga [[ensiklopedya]] pinaagi sa [[Wikipedia:Unsaon pag-usab ang mga panid|pag-usab]] sa mga nasulat na nga mga artikulo ug [[Wikipedia:Unsaon pagmugna og usa ka panid|pagsulat]] og mga bag-ong artikulo. Kon [[Special:Userlogin|maghimo ka og akawnt]] mangalan kanimo ang imong mga sinulat.
__TOC__
== <span lang="en" dir="ltr">Tech News: 2025-25</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W25"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/25|Translations]] are available.
'''Updates for editors'''
* You can [https://wikimediafoundation.limesurvey.net/359761?lang=en nominate your favorite tools] for the sixth edition of the [[m:Special:MyLanguage/Coolest Tool Award|Coolest Tool Award]]. Nominations are anonymous and will be open until June 25. You can re-use the survey to nominate multiple tools.
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:33}} community-submitted {{PLURAL:33|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]].
'''Updates for technical contributors'''
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.6|MediaWiki]]
'''In depth'''
* Foundation staff and technical volunteers use Wikimedia APIs to build the tools, applications, features, and integrations that enhance user experiences. Over the coming years, the MediaWiki Interfaces team will be investing in Wikimedia web (HTTP) APIs to better serve technical volunteer needs and protect Wikimedia infrastructure from potential abuse. You can [https://techblog.wikimedia.org/2025/06/12/apis-as-a-product-investing-in-the-current-and-next-generation-of-technical-contributors/ read more about their plans to evolve the APIs in this Techblog post].
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/25|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W25"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 23:35, 16 Hunyo 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=28870688 -->
== <span lang="en" dir="ltr">Wikimedia Foundation Board of Trustees 2025 - Call for Candidates</span> ==
<div lang="en" dir="ltr">
<section begin="announcement-content" />
:''<div class="plainlinks">[[m:Special:MyLanguage/Wikimedia Foundation elections/2025/Announcement/Call for candidates|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Wikimedia Foundation elections/2025/Announcement/Call for candidates}}&language=&action=page&filter= {{int:please-translate}}]</div>
Hello all,
The [[m:Special:MyLanguage/Wikimedia Foundation elections/2025|call for candidates for the 2025 Wikimedia Foundation Board of Trustees selection is now open]] from June 17, 2025 – July 2, 2025 at 11:59 UTC [1]. The Board of Trustees oversees the Wikimedia Foundation's work, and each Trustee serves a three-year term [2]. This is a volunteer position.
This year, the Wikimedia community will vote in late August through September 2025 to fill two (2) seats on the Foundation Board. Could you – or someone you know – be a good fit to join the Wikimedia Foundation's Board of Trustees? [3]
Learn more about what it takes to stand for these leadership positions and how to submit your candidacy on [[m:Special:MyLanguage/Wikimedia Foundation elections/2025/Candidate application|this Meta-wiki page]] or encourage someone else to run in this year's election.
Best regards,
Abhishek Suryawanshi<br />
Chair of the Elections Committee
On behalf of the Elections Committee and Governance Committee
[1] https://meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia_Foundation_elections/2025/Call_for_candidates
[2] https://foundation.wikimedia.org/wiki/Legal:Bylaws#(B)_Term.
[3] https://meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia_Foundation_elections/2025/Resources_for_candidates<section end="announcement-content" />
</div>
[[Gumagamit: MediaWiki message delivery | MediaWiki message delivery ]] ([[Hisgot sa Gumagamit: MediaWiki message delivery |talk]]) 17:43, 17 Hunyo 2025 (UTC)
<!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Distribution_list/Global_message_delivery&oldid=28866958 -->
== <span lang="en" dir="ltr">Tech News: 2025-26</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W26"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/26|Translations]] are available.
'''Weekly highlight'''
* This week, the Moderator Tools and Machine Learning teams will continue the rollout of [[mw:Special:MyLanguage/2025 RecentChanges Language Agnostic Revert Risk Filtering|a new filter to Recent Changes]], releasing it to the third and last batch of Wikipedias. This filter utilizes the Revert Risk model, which was created by the Research team, to highlight edits that are likely to be reverted and help Recent Changes patrollers identify potentially problematic contributions. The feature will be rolled out to the following Wikipedias: {{int:project-localized-name-azwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-lawiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-mkwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-mlwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-mrwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-nnwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-pawiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-swwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-tewiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-tlwiki/en}}. The rollout will continue in the coming weeks to include [[mw:Special:MyLanguage/2025 RecentChanges Language Agnostic Revert Risk Filtering|the rest of the Wikipedias in this project]]. [https://phabricator.wikimedia.org/T391964]
'''Updates for editors'''
* Last week, [[mw:Special:MyLanguage/Trust and Safety Product/Temporary Accounts|temporary accounts]] were rolled out on Czech, Korean, and Turkish Wikipedias. This and next week, deployments on larger Wikipedias will follow. [[mw:Talk:Trust and Safety Product/Temporary Accounts|Share your thoughts]] about the project. [https://phabricator.wikimedia.org/T340001]
* Later this week, the Editing team will release [[mw:Special:MyLanguage/Help:Edit check#Multi check|Multi Check]] to all Wikipedias (except English Wikipedia). This feature shows multiple [[mw:Special:MyLanguage/Help:Edit check#Reference check|Reference checks]] within the editing experience. This encourages users to add citations when they add multiple new paragraphs to a Wikipedia article. This feature was previously available as an A/B test. [https://analytics.wikimedia.org/published/reports/editing/multi_check_ab_test_report_final.html#summary-of-results The test shows] that users who are shown multiple checks are 1.3 times more likely to add a reference to their edit, and their edit is less likely to be reverted (-34.7%). [https://phabricator.wikimedia.org/T395519]
* A few pages need to be renamed due to software updates and to match more recent Unicode standards. All of these changes are related to title-casing changes. Approximately 71 pages and 3 files will be renamed, across 15 wikis; the complete list is in [[phab:T396903|the task]]. The developers will rename these pages next week, and they will fix redirects and embedded file links a few minutes later via a system settings update.
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:24}} community-submitted {{PLURAL:24|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, a bug was fixed that had caused pages to scroll upwards when text near the top was selected. [https://phabricator.wikimedia.org/T364023]
'''Updates for technical contributors'''
* Editors can now use Lua modules to filter and transform tabular data for use with [[mw:Special:MyLanguage/Extension:Chart|Extension:Chart]]. This can be used for things like selecting a subset of rows or columns from the source data, converting between units, statistical processing, and many other useful transformations. [[mw:Special:MyLanguage/Extension:Chart/Transforms|Information on how to use transforms is available]]. [https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:Chart/Project/Updates]
* The <code dir=ltr>all_links</code> variable in [[Special:AbuseFilter|AbuseFilter]] is now renamed to <code dir=ltr>new_links</code> for consistency with other variables. Old usages will still continue to work. [https://phabricator.wikimedia.org/T391811]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.7|MediaWiki]]
'''In depth'''
* The latest quarterly [[mw:Special:MyLanguage/Growth/Newsletters/34|Growth newsletter]] is available. It includes: the recent updates for the "Add a Link" Task, two new Newcomer Engagement Features, and updates to Community Configuration.
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/26|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W26"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 23:17, 23 Hunyo 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=28870688 -->
== <span lang="en" dir="ltr">Sister Projects Task Force reviews Wikispore and Wikinews</span> ==
<div lang="en" dir="ltr">
<section begin="message"/>
Dear Wikimedia Community,
The [[m:Wikimedia Foundation Community Affairs Committee|Community Affairs Committee (CAC)]] of the Wikimedia Foundation Board of Trustees assigned [[m:Wikimedia Foundation Community Affairs Committee/Sister Projects Task Force|the Sister Projects Task Force (SPTF)]] to update and implement a procedure for assessing the lifecycle of Sister Projects – wiki [[m:Wikimedia projects|projects supported by Wikimedia Foundation (WMF)]].
A vision of relevant, accessible, and impactful free knowledge has always guided the Wikimedia Movement. As the ecosystem of Wikimedia projects continues to evolve, it is crucial that we periodically review existing projects to ensure they still align with our goals and community capacity.
Despite their noble intent, some projects may no longer effectively serve their original purpose. '''Reviewing such projects is not about giving up – it's about responsible stewardship of shared resources'''. Volunteer time, staff support, infrastructure, and community attention are finite, and the non-technical costs tend to grow significantly as our ecosystem has entered a different age of the internet than the one we were founded in. Supporting inactive projects or projects that didn't meet our ambitions can unintentionally divert these resources from areas with more potential impact.
Moreover, maintaining projects that no longer reflect the quality and reliability of the Wikimedia name stands for, involves a reputational risk. An abandoned or less reliable project affects trust in the Wikimedia movement.
Lastly, '''failing to sunset or reimagine projects that are no longer working can make it much harder to start new ones'''. When the community feels bound to every past decision – no matter how outdated – we risk stagnation. A healthy ecosystem must allow for evolution, adaptation, and, when necessary, letting go. If we create the expectation that every project must exist indefinitely, we limit our ability to experiment and innovate.
Because of this, SPTF reviewed two requests concerning the lifecycle of the Sister Projects to work through and demonstrate the review process. We chose Wikispore as a case study for a possible new Sister Project opening and Wikinews as a case study for a review of an existing project. Preliminary findings were discussed with the CAC, and a community consultation on both proposals was recommended.
=== Wikispore ===
The [[m:Wikispore|application to consider Wikispore]] was submitted in 2019. SPTF decided to review this request in more depth because rather than being concentrated on a specific topic, as most of the proposals for the new Sister Projects are, Wikispore has the potential to nurture multiple start-up Sister Projects.
After careful consideration, the SPTF has decided '''not to recommend''' Wikispore as a Wikimedia Sister Project. Considering the current activity level, the current arrangement allows '''better flexibility''' and experimentation while WMF provides core infrastructural support.
We acknowledge the initiative's potential and seek community input on what would constitute a sufficient level of activity and engagement to reconsider its status in the future.
As part of the process, we shared the decision with the Wikispore community and invited one of its leaders, Pharos, to an SPTF meeting.
Currently, we especially invite feedback on measurable criteria indicating the project's readiness, such as contributor numbers, content volume, and sustained community support. This would clarify the criteria sufficient for opening a new Sister Project, including possible future Wikispore re-application. However, the numbers will always be a guide because any number can be gamed.
=== Wikinews ===
We chose to review Wikinews among existing Sister Projects because it is the one for which we have observed the highest level of concern in multiple ways.
Since the SPTF was convened in 2023, its members have asked for the community's opinions during conferences and community calls about Sister Projects that did not fulfil their promise in the Wikimedia movement.[https://commons.wikimedia.org/wiki/File:WCNA_2024._Sister_Projects_-_opening%3F_closing%3F_merging%3F_splitting%3F.pdf <nowiki>[1]</nowiki>][https://meta.wikimedia.org/wiki/Wikimedia_Foundation_Community_Affairs_Committee/Sister_Projects_Task_Force#Wikimania_2023_session_%22Sister_Projects:_past,_present_and_the_glorious_future%22 <nowiki>[2]</nowiki>][https://meta.wikimedia.org/wiki/WikiConvention_francophone/2024/Programme/Quelle_proc%C3%A9dure_pour_ouvrir_ou_fermer_un_projet_%3F <nowiki>[3]</nowiki>] Wikinews was the leading candidate for an evaluation because people from multiple language communities proposed it. Additionally, by most measures, it is the least active Sister Project, with the greatest drop in activity over the years.
While the Language Committee routinely opens and closes language versions of the Sister Projects in small languages, there has never been a valid proposal to close Wikipedia in major languages or any project in English. This is not true for Wikinews, where there was a proposal to close English Wikinews, which gained some traction but did not result in any action[https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_English_Wikinews <nowiki>[4]</nowiki>][https://meta.wikimedia.org/wiki/WikiConvention_francophone/2024/Programme/Quelle_proc%C3%A9dure_pour_ouvrir_ou_fermer_un_projet_%3F <nowiki>[5]</nowiki>, see section 5] as well as a draft proposal to close all languages of Wikinews[https://meta.wikimedia.org/wiki/Talk:Proposals_for_closing_projects/Archive_2#Close_Wikinews_completely,_all_languages? <nowiki>[6]</nowiki>].
[[:c:File:Sister Projects Taskforce Wikinews review 2024.pdf|Initial metrics]] compiled by WMF staff also support the community's concerns about Wikinews.
Based on this report, SPTF recommends a community reevaluation of Wikinews. We conclude that its current structure and activity levels are the lowest among the existing sister projects. SPTF also recommends pausing the opening of new language editions while the consultation runs.
SPTF brings this analysis to a discussion and welcomes discussions of alternative outcomes, including potential restructuring efforts or integration with other Wikimedia initiatives.
'''Options''' mentioned so far (which might be applied to just low-activity languages or all languages) include but are not limited to:
*Restructure how Wikinews works and is linked to other current events efforts on the projects,
*Merge the content of Wikinews into the relevant language Wikipedias, possibly in a new namespace,
*Merge content into compatibly licensed external projects,
*Archive Wikinews projects.
Your insights and perspectives are invaluable in shaping the future of these projects. We encourage all interested community members to share their thoughts on the relevant discussion pages or through other designated feedback channels.
=== Feedback and next steps ===
We'd be grateful if you want to take part in a conversation on the future of these projects and the review process. We are setting up two different project pages: [[m:Public consultation about Wikispore|Public consultation about Wikispore]] and [[m:Public consultation about Wikinews|Public consultation about Wikinews]]. Please participate between 27 June 2025 and 27 July 2025, after which we will summarize the discussion to move forward. You can write in your own language.
I will also host a community conversation 16th July Wednesday 11.00 UTC and 17th July Thursday 17.00 UTC (call links to follow shortly) and will be around at Wikimania for more discussions.
<section end="message"/>
</div>
-- [[User:Victoria|Victoria]] on behalf of the Sister Project Task Force, 20:56, 27 Hunyo 2025 (UTC)
<!-- Message sent by User:Johan (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:Johan_(WMF)/Sister_project_MassMassage_on_behalf_of_Victoria/Target_list&oldid=28911188 -->
== <span lang="en" dir="ltr">Tech News: 2025-27</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W27"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/27|Translations]] are available.
'''Weekly highlight'''
* The [[mw:Special:MyLanguage/Help:Extension:CampaignEvents|CampaignEvents extension]] has been enabled on all Wikipedias. The extension makes it easier to organize and participate in collaborative activities, like edit-a-thons and WikiProjects, on the wikis. The extension has three features: [[m:Special:MyLanguage/Event Center/Registration|Event Registration]], [[m:Special:MyLanguage/CampaignEvents/Collaboration list|Collaboration List]], and [[m:Campaigns/Foundation Product Team/Invitation list|Invitation List]]. To request the extension for your wiki, visit the [[m:Special:MyLanguage/CampaignEvents/Deployment status#How to Request the CampaignEvents Extension for your wiki|Deployment information page]].
'''Updates for editors'''
* AbuseFilter maintainers can now [[mw:Special:MyLanguage/Extension:IPReputation/AbuseFilter variables|match against IP reputation data]] in [[mw:Special:MyLanguage/Extension:AbuseFilter|AbuseFilters]]. IP reputation data is information about the proxies and VPNs associated with the user's IP address. This data is not shown publicly and is not generated for actions performed by registered accounts. [https://phabricator.wikimedia.org/T354599]
* Hidden content that is within [[mw:Special:MyLanguage/Manual:Collapsible elements|collapsible parts of wikipages]] will now be revealed when someone searches the page using the web browser's "Find in page" function (Ctrl+F or ⌘F) in supporting browsers. [https://phabricator.wikimedia.org/T327893][https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/hidden#browser_compatibility]
* [[File:Octicons-gift.svg|12px|link=|class=skin-invert|Wishlist item]] A new feature, called [[mw:Special:MyLanguage/Help:TemplateData/Template discovery|Favourite Templates]], will be deployed later this week on all projects (except English Wikipedia, which will receive the feature next week), following a piloting phase on Polish and Arabic Wikipedia, and Italian and English Wikisource. The feature will provide a better way for new and experienced contributors to recall and discover templates via the template dialog, by allowing users to put templates on a special "favourite list". The feature works with both the visual editor and the wikitext editor. The feature is a [[m:Special:MyLanguage/Community Wishlist/Focus areas/Template recall and discovery|community wishlist focus area]].
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:31}} community-submitted {{PLURAL:31|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, a bug was fixed that had caused some Notifications to be sent multiple times. [https://phabricator.wikimedia.org/T397103]
'''Updates for technical contributors'''
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.8|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/27|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W27"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 23:37, 30 Hunyo 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=28917415 -->
== <span lang="en" dir="ltr">Tech News: 2025-28</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W28"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/28|Translations]] are available.
'''Weekly highlight'''
* [[mw:Special:MyLanguage/Help:Temporary accounts|Temporary accounts]] have been rolled out on 18 large and medium-sized Wikipedias, including German, Japanese, French, and Chinese. Now, about 1/3 of all logged-out activity across wikis is coming from temporary accounts. Users involved in patrolling may be interested in two new documentation pages: [[mw:Special:MyLanguage/Trust and Safety Product/Temporary Accounts/Access to IP|Access to IP]], explaining everything related to access to temporary account IP addresses, and [[mw:Special:MyLanguage/Trust and Safety Product/Temporary Accounts/Repository|Repository]] with a list of new gadgets and user scripts.
'''Updates for editors'''
* Anyone can play an experimental new game, [[mw:Special:MyLanguage/New Engagement Experiments/WikiRun|WikiRun]], that lets you race through Wikipedia by clicking from one article to another, aiming to reach a target page in as few steps and in as little time as possible. The project's goal is to explore new ways of engaging readers. [https://wikirun-game.toolforge.org/ Try playing the game] and let the team know what you think [[mw:Talk:New Engagement Experiments/WikiRun|on the talk page]].
* Users of the Wikipedia Android app in some languages can now play the new [[mw:Special:MyLanguage/Wikimedia Apps/Team/Android/TrivaGame|trivia game]]. ''Which came first?'' is a simple history game where you guess which of two events happened earlier on today's date. It was previously available as an A/B test. It is now available to all users in English, German, French, Spanish, Portuguese, Russian, Arabic, Turkish, and Chinese. The goal of the feature is to help engage with new generations of readers. [https://meta.wikimedia.org/wiki/Special:MyLanguage/Tech/News/2025/22]
* Users of the iOS Wikipedia App in some languages may see a new tabbed browsing feature that enables you to open multiple tabs while reading. This feature makes it easier to explore related topics and switch between articles. The A/B test is currently running in Arabic, English, and Japanese in selected regions. More details are available on the [[mw:Special:MyLanguage/Wikimedia Apps/Team/iOS/Tabbed Browsing (Tabs)|Tabbed Browsing project page]].
* Bureaucrats on Wikimedia wikis can now use [[{{#special:VerifyOATHForUser}}]] to check if users have enabled [[mw:Special:MyLanguage/Help:Two-factor authentication|two-factor authentication]]. [https://phabricator.wikimedia.org/T265726]
* [[File:Octicons-gift.svg|12px|link=|class=skin-invert|Wishlist item]] A new feature related to [[m:Special:MyLanguage/Community Wishlist/Focus areas/Template recall and discovery|Template Recall and Discovery]] will be deployed later this week to all Wikimedia projects: a [[mw:Special:MyLanguage/Help:TemplateData/Template discovery#Template categories|template category browser]] will be introduced to assist users in finding templates to put in their “favourite” list. The browser will allow users to browse a list of templates which have been organised into a given category tree. The feature has been requested by the community [[m:Special:MyLanguage/Community Wishlist/Wishes/Select templates by categories|through the Community Wishlist]].
* It is now possible to access watchlist preferences from the watchlist page. Also the redundant button to edit the watchlist has been removed. [https://www.mediawiki.org/wiki/Moderator_Tools/Watchlist]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:27}} community-submitted {{PLURAL:27|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]].
'''Updates for technical contributors'''
* As part of [[mw:MediaWiki_1.44|MediaWiki 1.44]] there is now a unified built-in Notifications system that makes it easier for developers to send, manage, and customize notifications. Check out the updated documentation at [[mw:Manual:Notifications|Manual:Notifications]], information about migration in [[phab:T388663|T388663]] and details on deprecated hooks in [[phab:T389624|T389624]].
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.9|MediaWiki]]
'''Meetings and events'''
* [[d:Special:MyLanguage/Event:WikidataCon 2025|WikidataCon 2025]], the conference dedicated to Wikidata is now open for [https://pretalx.com/wikidatacon-2025/cfp session proposals] and for [[d:Special:RegisterForEvent/1340|registration]]. This year's event will be held online from October 31 – November 02 and will explore on the theme of "Connecting People through Linked Open Data".
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/28|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W28"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 00:01, 8 Hulyo 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=28930584 -->
== Wikidata Item and Property labels soon displayed in Wiki Watchlist/Recent Changes ==
''(Apologies for posting in English, you can help by translating into your language)''
Hello everyone, the [[m:Wikidata_For_Wikimedia_Projects/Clearer_Wikidata_Edit_Summaries/Resolve_Labels|Wikidata For Wikimedia Projects]] team is excited to announce an upcoming change in how Wikidata edit changelogs are displayed in your [[Special:Watchlist|Watchlists]] and [[Special:RecentChanges|Recent Changes]] lists. If an edit is made on Wikidata that affects a page in another Wikimedia Project, the changelog will contain some information about the nature of the edit. This can include a QID (or Q-number), a PID (or P-number) and a value (which can be text, numbers, dates, or also QID or PID’s). Confused by these terms? See the [[d:Special:MyLanguage/Wikidata:Glossary|Wikidata:Glossary]] for further explanations.
The upcoming change is scheduled for '''17.07.2025''', between '''1300 - 1500 UTC'''.
The change will display the label (item name) alongside any QID or PIDs, as seen in the image below:
[[File:Apr10 edit summary on Wikidata.png|An edit sum entry on Wikidata, labels display alongside their P- and Q-no.'s]]
These changes will only be visible if you have Wikidata edits enabled in your User Preferences for Watchlists and Recent Changes, or have the active filter ‘Wikidata edits’ checkbox toggled on, directly on the Watchlist and Recent Changes pages.
Your bot and gadget may be affected! There are thousands of bots, gadgets and user-scripts and whilst we have researched potential effects to many of them, we cannot guarantee there won’t be some that are broken or affected by this change.
Further information and context about this change, including how your bot may be affected can be found on this [[m:Wikidata_For_Wikimedia_Projects/Clearer_Wikidata_Edit_Summaries/Resolve_Labels|project task page]]. We welcome your questions and feedback, please write to us on this dedicated [[m:Talk:Wikidata_For_Wikimedia_Projects/Clearer_Wikidata_Edit_Summaries/Resolve_Labels|Talk page]].
Thank you, - [[m:User:Danny_Benjafield_(WMDE)|Danny Benjafield (WMDE)]] on behalf of the Wikidata For Wikimedia Projects Team. [[Gumagamit: MediaWiki message delivery | MediaWiki message delivery ]] ([[Hisgot sa Gumagamit: MediaWiki message delivery |talk]]) 12:45, 14 Hulyo 2025 (UTC)
<!-- Message sent by User:Danny Benjafield (WMDE)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:Danny_Benjafield_(WMDE)/MassMessage_Test_List&oldid=28981877 -->
== <span lang="en" dir="ltr">Tech News: 2025-29</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W29"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/29|Translations]] are available.
'''Updates for editors'''
* [[mw:Special:MyLanguage/Help:TemplateData/Template discovery#Featured templates|Featured templates]], a new feature related to [[m:Special:MyLanguage/Community Wishlist/Focus areas/Template recall and discovery|Template Recall and Discovery]] will be deployed this week to all Wikimedia projects: With this feature, editors will be able to quickly access a list of templates that are likely to be useful. These templates will be displayed in a list, under the "featured" tab of the template discovery interface. Administrators can define the list via the Community Configuration interface. The feature fulfills a request by the community [[m:Special:MyLanguage/Community Wishlist/Wishes/Easy access Templates|through the Community Wishlist]]. [https://phabricator.wikimedia.org/T367428][https://phabricator.wikimedia.org/T392896]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:31}} community-submitted {{PLURAL:31|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the request to add Malayalam fonts in the [[oldWikisource:Special:MyLanguage/Wikisource:WS Export|Wikisource Book Export Tool]] was resolved and now, the rendering of Malayalam letters in exported Wikisource books are accurate. [https://phabricator.wikimedia.org/T374457]
'''Updates for technical contributors'''
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.10|MediaWiki]]
'''In depth'''
* Developers, designers, and all Wikimedians are invited to [https://phabricator.wikimedia.org/project/board/7953/ submit a project idea] for the Wikimania Hackathon 2025. Read [https://diff.wikimedia.org/2025/06/30/call-for-projects-wikimania-hackathon-2025-is-coming-to-nairobi/ this Diff blog post] for more details.
'''Meetings and events'''
* [[m:WikiIndaba conference 2025|WikiIndaba 2025]] scholarship application and program submission is open until 23:59 GMT on July 20. WikiIndaba is a regional conference for African Wikimedians both on the continent and in the diaspora to unite and grow together. Submit [https://docs.google.com/forms/d/e/1FAIpQLSdJTv68R1OPASXXDfpIl8EWiMLTM-TDwh6_5gNVvFuWccFZ2Q/viewform your scholarship application] and [https://ee.kobotoolbox.org/x/BI3omIfH program proposal] now!
* [https://br.wikimedia.org/wiki/WikiCon_Brasil_2025 WikiCon Brasil 2025] will take place on July 19-20 in Salvador, Bahia, Brazil. The Brazilian community members are encouraged to register and attend!
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/29|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W29"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 20:05, 14 Hulyo 2025 (UTC)
<!-- Message sent by User:UOzurumba (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=28980963 -->
== <span lang="en" dir="ltr">Tech News: 2025-30</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W30"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/30|Translations]] are available.
'''Updates for editors'''
* The Translation Suggestions feature in the [[mw:Special:MyLanguage/Content translation|Content Translation tool]] now has another level of article filters added to the "[https://en.wikipedia.org/w/index.php?title=Special:ContentTranslation&filter-type=automatic&filter-id=previous-edits&active-list=suggestions&from=en&to=fi#/ ... More]" category. Translators who use the Suggestions feature can now select and receive article suggestions that are customized to geographical locations of their interest using the new "{{int:Cx-sx-suggestions-filters-tab-regions}}" filter. [https://phabricator.wikimedia.org/T113257]
* Administrators can now limit "Add a Link" to newcomers. The [[mw:Special:MyLanguage/Help:Growth/Tools/Add a link|"Add a Link"]] Structured Task [[mw:Special:MyLanguage/Growth/Constructive activation experimentation#Enwiki A/B test & "Add a Link" Improvements (Wiki Experiences 1.2.11 & 1.2.16)|helps new account holders start editing]], but some communities have requested the ability to restrict it to its intended audience: newcomers. Administrators can configure this setting within the [[Special:CommunityConfiguration/GrowthSuggestedEdits|Community Configuration]] feature.
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:29}} community-submitted {{PLURAL:29|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]].
'''Updates for technical contributors'''
* For AbuseFilter editors on [[phab:T392144|some wikis]], it is now possible to filter edits based on the RevertRisk score of the edit being attempted. It is only populated if the action being evaluated is an edit. For more information, please see the [[mw:Special:MyLanguage/Extension:ORES/AbuseFilter variables#What variables are available for use|ORES/AbuseFilter variables]] documentation.
* The [[mw:Special:MyLanguage/Beta Cluster|Beta Cluster]] wikis have [[listarchive:list/wikitech-l@lists.wikimedia.org/thread/YDABPV75LADRQCXMJAFWUP256N4EQ25B/|been moved]] from <code dir=ltr>beta.wmflabs.org</code> to <code dir=ltr>beta.wmcloud.org</code>. Users may need to update URLs in any tools, or in their password managers. Any related issues can be [[phab:T289318|reported in the task]].
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.11|MediaWiki]]
'''Meetings and events'''
* [[m:Special:MyLanguage/WikiCite 2025|WikiCite 2025]] will take place from 29–31 August, both online and in-person in Bern, Switzerland. The event's goals are to reconnect communities, institutions, and individuals working with open citations, bibliographic data, and the Wikidata/Wikibase ecosystem. Registration is open and the call for proposals will be announced soon. [https://lists.wikimedia.org/hyperkitty/list/wikidata@lists.wikimedia.org/message/KQZUG3ETKLBWPBYSB2YAWZIRPWHS24TG/]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/30|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W30"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 23:38, 21 Hulyo 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29005283 -->
== <span lang="en" dir="ltr">Tech News: 2025-31</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W31"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/31|Translations]] are available.
'''Weekly highlight'''
* The Community Tech team will be focusing on wishes related to Watchlists and Recent Changes pages, over the next few months. They are looking for feedback. Please [[m:Special:MyLanguage/Community Wishlist/Updates#July 24, 2025: Watchlists and Recent Changes pages|read the latest update]], and if you have ideas, please [[m:Special:MyLanguage/Community Wishlist|submit a wish]] on the topic.
'''Updates for editors'''
* The Wikimedia Commons community has decided to block [[:mw:Special:MyLanguage/Upload dialog|cross-wiki uploads]] to Wikimedia Commons, for all users without autoconfirmed rights on that wiki, starting on August 16. This is because of [[:c:Commons:Cross-wiki media upload tool/History|widespread problems]] related to files that are uploaded by newcomers. Users who are affected by this will get an error message with a link to the less restrictive UploadWizard on Commons. Please help translating the [[:c:Special:MyLanguage/MediaWiki:Abusefilter-disallowed-cross-wiki-upload|message]] or give feedback on the message text. Please also update your local help pages to explain this restriction. [https://phabricator.wikimedia.org/T370598]
* On wikis with temporary accounts enabled and Meta-Wiki, administrators may now set up a footer for the Special:Contributions pages of temporary accounts, similar to those which can be shown on IP and user-account pages. They may do it by creating the page named <code dir=ltr>MediaWiki:Sp-contributions-footer-temp</code>. [https://phabricator.wikimedia.org/T398347]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:21}} community-submitted {{PLURAL:21|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]].
'''Updates for technical contributors'''
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.12|MediaWiki]]
'''Meetings and events'''
* [[wmania:Special:MyLanguage/2025:Wikimania|Wikimania 2025]] will run from August 6–9. The [https://wikimedia.eventyay.com/talk/wikimania2025/schedule/ program is available] for you to plan which sessions you want to attend. Most sessions will be live-streamed, with exceptions for those that show the "no camera" icon. If you are joining online to watch live-streams and use the interactive features, please [[wmania:Special:MyLanguage/2025:Registration|register]] for a free virtual ticket. For example, you may be interested in technical sessions such as:
** [https://wikimedia.eventyay.com/talk/wikimania2025/talk/KFEFVG/ Temporary Accounts: Enhancing privacy for our unregistered editors]
** [https://wikimedia.eventyay.com/talk/wikimania2025/talk/TVCVAB/ Building a Sustainable Future for Wikimedia Contributors]
** [https://wikimedia.eventyay.com/talk/wikimania2025/talk/WTRQCJ/ A dozen visions for wikitext!]
** [https://wikimedia.eventyay.com/talk/wikimania2025/talk/8YKKP9/ Coordinate Across Stakeholders with the Product and Technology Advisory Council]
* The [[mw:Special:MyLanguage/MediaWiki Users and Developers Conference Fall 2025|MediaWiki Users and Developers Conference, Fall 2025]] will be held 28–30 October 2025 in Hanover, Germany. This event is organized by and for the third-party MediaWiki community. You can propose sessions and register to attend.
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/31|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W31"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 00:22, 29 Hulyo 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29051727 -->
== <span lang="en" dir="ltr">Tech News: 2025-32</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W32"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/32|Translations]] are available.
'''Updates for editors'''
* Editors can now enable the [[mw:Special:MyLanguage/Product Safety and Integrity/Anti-abuse signals/User Info|User Info card]]. This feature adds an icon next to usernames on history pages and similar user-contribution log pages. When you tap or click on the icon, it displays data related to that user account such as the number of edits, reverted edits, blocks, and more. It's part of a broader project to make it easier for moderators to evaluate account trustworthiness. The feature can be enabled in [[testwiki:Special:GlobalPreferences#mw-prefsection-rendering|your global preferences]], and later this week it will be available in local preferences. [https://phabricator.wikimedia.org/T386439]
* Everybody is invited to share comments on [[m:Special:MyLanguage/CampaignEvents/Collaborative contributions|Collaborative Contributions]], a project recently launched by the [[m:Special:MyLanguage/Connection Team|Connection team]]. The project aims to create a new way to display the impact of collaborative editing activities (such as edit-a-thons, backlog drives, and WikiProjects) on the wikis. Post your comments on the [[m:Talk:CampaignEvents/Collaborative contributions|project talk page]]. [https://phabricator.wikimedia.org/T378035]
* Administrators can now define the default block duration for temporary accounts. To do that, they need to create a page named <code dir=ltr>MediaWiki:Ipb-default-expiry-temporary-account</code> and use a value defined in <code dir=ltr>MediaWiki:Ipboptions</code>. This allows administrators to easily block temporary accounts for 90 days, which is functionally equivalent to an indefinite block. The advantage of this solution is that it does not clutter Special:BlockList. [[mw:Special:MyLanguage/Manual:Block and unblock#Default block duration options|More documentation]] is available. [https://phabricator.wikimedia.org/T398626]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:27}} community-submitted {{PLURAL:27|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]].
'''Updates for technical contributors'''
* Gadgets can now include <code dir=ltr>.vue</code> files. This makes it easier to develop modern user interfaces using [[mw:Vue.js|Vue.js]], in particular using [[mw:Special:MyLanguage/Codex|Codex]], the official design system of Wikimedia. [[wmdoc:codex/latest/icons/overview.html|Codex icons]] can be loaded through the gadget definition. [[mw:Special:MyLanguage/Extension:Gadgets#Pages|The documentation]] has examples. For user scripts that use Vue.js, an [[mw:API:CodexIcons|API module]] now exists to load Codex icons. [https://phabricator.wikimedia.org/T340460][https://phabricator.wikimedia.org/T311099]
* Module developers can now use a [[mw:Help:Extension:Translate/Message Bundles/Lua reference|Lua interface]] to simplify the preparation of Lua modules for translation on Meta-Wiki. This improvement makes it easier for translators to find and edit module strings without dealing with raw Lua code. It helps prevent mistakes that could break the module during translation. Module developers and translators are invited to [[commons:File:Translatable modules video demo July 2025.webm|watch the demo video]], read more about [[mw:Special:MyLanguage/Translatable modules|translatable modules]] to understand how it works, refer to Meta-Wiki's [[m:Module:User Wikimedia project|Module:User Wikimedia project]] for example usage, and [[mw:Talk:Translatable modules|share their feedback]] on how well it addresses the challenges in their workflow. The interface still has some performance issues, so it should not be used in widely used modules yet. [https://phabricator.wikimedia.org/T359918]
* Developers of external tools that connect to Wikimedia pages must set a user-agent that complies with [[foundation:Special:MyLanguage/Policy:Wikimedia Foundation User-Agent Policy|the user-agent policy]]. This policy will start to be more strongly enforced in August because of external crawlers that are [[diffblog:2025/04/01/how-crawlers-impact-the-operations-of-the-wikimedia-projects/|overusing]] Wikimedia's resources. Tools that are hosted on Wikimedia's Toolforge or Cloud VPS will not be affected by this for now, but should still set a user-agent. [[phab:T400119|More technical details are available]], and related questions are welcome in that task.
* Parsoid Read Views is going to be rolling out to some smaller Wikipedias over the next few weeks, following the successful transition of Wikivoyages and Wiktionaries to Parsoid Read Views. For more information, see the [[mw:Special:MyLanguage/Parsoid/Parser Unification|Parsoid/Parser Unification]] project page. [https://phabricator.wikimedia.org/project/profile/7694/]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.13|MediaWiki]]
'''Meetings and events'''
* [[wmania:Special:MyLanguage/2025:Wikimania|Wikimania 2025]] will run from August 6–9. The [https://wikimedia.eventyay.com/talk/wikimania2025/schedule/ program is available] for you to plan which sessions you want to attend. Most sessions will be live-streamed, with exceptions for those that show the "no camera" icon. If you are joining online to watch live-streams and use the interactive features, please [[wmania:Special:MyLanguage/2025:Registration|register]] for a free virtual ticket. For example, you may be interested in technical sessions such as:
** [https://wikimedia.eventyay.com/talk/wikimania2025/talk/GEH9DH/ Wikimedia’s knowledge infrastructure in a changing internet: Establishing sustainable pathways for content reuse]
** [https://wikimedia.eventyay.com/talk/wikimania2025/talk/7ELN9Q/ Wikifunctions is coming soon to a wiki near you!]
** [https://wikimedia.eventyay.com/talk/wikimania2025/talk/ZMGVJV/ Shaping the Future of Wikipedia’s Reader Experience]
** [https://wikimedia.eventyay.com/talk/wikimania2025/talk/KCKTFZ/ Making Wikipedia More Readable: What Comes Next]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/32|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W32"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 03:36, 5 Agosto 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29083927 -->
== <span lang="en" dir="ltr">Tech News: 2025-33</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W33"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/33|Translations]] are available.
'''Updates for editors'''
* The WikiEditor toolbar now includes [[mw:Special:MyLanguage/Help:Extension:WikiEditor#Keyboard shortcuts|its keyboard shortcuts]] in the tooltips for its buttons. This will help to improve the discoverability of this feature. [https://phabricator.wikimedia.org/T400583]
* The [[m:Special:MyLanguage/Product and Technology Advisory Council|Product and Technology Advisory Council]] published a set of [[m:Special:MyLanguage/Product and Technology Advisory Council/August 2025 draft PTAC proposals for feedback|proposed experiments]] the Wikimedia Foundation can try to improve communication with community. Feedback on the proposals are welcomed until August 22 on [[m:Talk:Product and Technology Advisory Council/August 2025 draft PTAC proposals for feedback|this talk page]].
* The search bar on the Minerva skin (mobile) has been updated to use the same type-ahead search component that is used on the Vector 2022 skin. There are no changes in search functionality but there are minor visual changes. Specifically, the close-search button has been changed from an "X" to a back arrow. This helps to distinguish it from the other "X" button that is used to clear any text. [https://phabricator.wikimedia.org/T393944]
* Editors on some wikis will see a new toggle for "Group results by page" on watchlist, related changes, and recent changes pages. This is [[mw:Special:MyLanguage/Moderator Tools/Watchlist/Experiment|an A/B experiment]] that is planned to start on August 11, and will run for 3–6 weeks on the Bengali, Chinese, Czech, French, Greek, Portuguese, and Urdu Wikipedias. The experiment will examine how making this feature more discoverable might affect editors' ability to find the edits they are looking for. [https://phabricator.wikimedia.org/T396789]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:31}} community-submitted {{PLURAL:31|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]].
'''Updates for technical contributors'''
* The multiwiki datasets of [[:wikt:en:Module:Unicode data|Unicode data]] have been moved to [[c:Category:Unicode Module Datasets|Category:Unicode Module Datasets]] on Wikimedia Commons, to follow the idea of "One common data source, multiple local wikis". Most wikis have been updated to use the Commons version. You can ask questions at [[c:Category talk:Unicode Module Datasets|the talkpage]]. [https://en.wiktionary.org/wiki/Module_talk:Unicode_data#Data_from_commons]
* Lua code can add warnings when something is wrong, by using the <code dir=ltr>mw.addWarning()</code> function. It is now possible to add more than one warning, instead of new warnings replacing old ones. If you maintain a Lua module that used warnings, you should check it still works as expected. [https://phabricator.wikimedia.org/T398390]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.14|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/33|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W33"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 23:25, 11 Agosto 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29106516 -->
== <span lang="en" dir="ltr">Tech News: 2025-34</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W34"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/34|Translations]] are available.
'''Updates for editors'''
* Later this week, people who are logged-in and have the "[[mw:Special:MyLanguage/Talk pages project/Feature summary|Discussion tools]]" [[Special:Preferences#mw-prefsection-betafeatures|Beta Feature]] enabled will gain the ability to "Thank" individual comments directly from talk pages, rather than needing to navigate to page history. [[mw:Special:MyLanguage/Talk pages project/Feature summary#Comment actions|Learn more about this feature]]. [https://phabricator.wikimedia.org/T400849]
* An A/B test comparing two versions of the desktop donate link launched on testwiki on 12 August and on English Wikipedia 14 August for 0.1% of logged out users on the desktop site. The experiment will run for three weeks, ending on 12 September. [https://phabricator.wikimedia.org/T395716]
* An A/A test to measure the baseline for reader retention was launched 12 August using [[wikitech:Experimentation Lab|Experimentation Lab]]. This measures the percentage of users who revisit a wiki after their initial visit over a 14-day period. No visual changes are expected. The experiment will run through 31 August. [https://phabricator.wikimedia.org/T399227]
* Five new wikis have been created:
** a {{int:project-localized-name-group-wikisource/en}} in [[d:Q34057|Tagalog]] ([[s:tl:|<code>s:tl:</code>]]) [https://phabricator.wikimedia.org/T388639]
** a {{int:project-localized-name-group-wikisource/en}} in [[d:Q36213|Madurese]] ([[s:mad:|<code>s:mad:</code>]]) [https://phabricator.wikimedia.org/T391747]
** a {{int:project-localized-name-group-wikipedia/en}} in [[d:Q3450749|Rakhine]] ([[w:rki:|<code>w:rki:</code>]]) [https://phabricator.wikimedia.org/T392490]
** a {{int:project-localized-name-group-wikibooks/en}} in [[d:Q13324|Minangkabau]] ([[b:min:|<code>b:min:</code>]]) [https://phabricator.wikimedia.org/T395452]
** a {{int:project-localized-name-group-wiktionary/en}} in [[d:Q7598268|Standard Moroccan Amazigh]] ([[wikt:zgh:|<code>wikt:zgh:</code>]]) [https://phabricator.wikimedia.org/T399684]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:46}} community-submitted {{PLURAL:46|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]].
'''Updates for technical contributors'''
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.15|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/34|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W34"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 00:33, 19 Agosto 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29127690 -->
== <span lang="en" dir="ltr">Tech News: 2025-35</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W35"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/35|Translations]] are available.
'''Updates for editors'''
* [[File:Octicons-gift.svg|12px|link=|class=skin-invert|Wishlist item]] [[File:Octicons-tools.svg|12px|link=|class=skin-invert|Advanced item]] Template authors can now use additional CSS properties, since the CSS sanitizer used by [[mw:Special:MyLanguage/Help:TemplateStyles|TemplateStyles]] was updated. For example: <code>width: fit-content</code>; <code>ruby-align</code>; relative units such as <code>lh</code>; and custom strings in <code>list-style-type</code>. These improvements are a [[m:Special:MyLanguage/Community Wishlist/Wishes/Allow use of modern CSS in templates by updating the TemplateStyles CSS sanitizer|Community Wishlist wish]]. [https://phabricator.wikimedia.org/T271958][https://phabricator.wikimedia.org/T277755][https://phabricator.wikimedia.org/T293633][https://phabricator.wikimedia.org/T295088][https://phabricator.wikimedia.org/T326906][https://phabricator.wikimedia.org/T340057][https://phabricator.wikimedia.org/T360725][https://phabricator.wikimedia.org/T371809][https://phabricator.wikimedia.org/T375344][https://phabricator.wikimedia.org/T394619]
* On large wikis, the default time period to display edits from, within the Special:RecentChanges page, has been changed from 7 days to 1 day. This is part of a performance improvement project. This should have no user-facing impact due to the quantity of edits on these wikis. [https://phabricator.wikimedia.org/T399455]
* Administrators can now access the [[{{#special:BlockedExternalDomains}}]] page from the [[{{#special:CommunityConfiguration}}]] list page. This makes it easier to find. [https://phabricator.wikimedia.org/T393240]
* Wikimedia Commons videos were not shown in the Videos tab in Google Search. The problem was investigated and reported to Google who have now fixed the issue. [https://phabricator.wikimedia.org/T396168][https://meta.wikimedia.org/wiki/Community_Wishlist/Wishes/Do_something_about_Google_%26_DuckDuckGo_search_not_indexing_media_files_and_categories_on_Commons]
* One new wiki has been created: a {{int:project-localized-name-group-wiktionary/en}} in [[d:Q33014|Betawi]] ([[wikt:bew:|<code>wikt:bew:</code>]]) [https://phabricator.wikimedia.org/T402130]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:39}} community-submitted {{PLURAL:39|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]].
'''Updates for technical contributors'''
* Two fields of the [[mw:Special:MyLanguage/Manual:Recentchanges table|recentchanges database table]] are being removed. <code>rc_new</code> and <code>rc_type</code> are being removed in favor of <code>rc_source</code>. Queries to these older fields will start to fail starting this week and developers should use <code>rc_source</code> instead. These older fields were deprecated over 10 years ago and should not be in use. This is part of work to improve the performance and stability of queries to the recentchanges table. [https://phabricator.wikimedia.org/T400696]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.16|MediaWiki]]
'''In depth'''
* The latest quarterly [[mw:Special:MyLanguage/Wikimedia Language and Product Localization/Newsletter/2025/July|Language and Internationalization Newsletter]] is now available. This edition includes: support for new languages in MediaWiki and translatewiki; the start of the Language Onboarding and Development project to help support the growth of new and small wikis; updates on research projects; and more.
'''Meetings and events'''
* The next [[mw:Special:MyLanguage/Wikimedia Language and Product Localization/Community meetings#29 August 2025|Language Community Meeting]] is happening soon, August 29th at [https://zonestamp.toolforge.org/1756479600 15:00 UTC]. This week's meeting will cover: the Avro keyboard developers from Wikimedia Bangladesh, who were recently awarded a national award for their contributions to this keyboard; and other topics.
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/35|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W35"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 00:08, 26 Agosto 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29175124 -->
== <span lang="en" dir="ltr">Temporary accounts will be rolled out soon</span> ==
<div lang="en" dir="ltr">
<section begin="body"/>
Hello, we are the Wikimedia Foundation [[mw:Special:MyLanguage/Product Safety and Integrity|Product Safety and Integrity]] team. We would like to announce that '''we plan to enable [[mw:Special:MyLanguage/Trust and Safety Product/Temporary Accounts|temporary accounts]] for this wiki in the week of September 1'''.
Temporary accounts are successfully live on 30 wikis, including many large ones like German, Japanese, and French. The change they bring is especially relevant to logged-out editors, who this feature is designed to protect. But it is also relevant to community members like mentors, patrollers, and admins – anyone who reverts edits, blocks users, or otherwise interacts with logged-out editors as part of keeping the wikis safe and accurate.
'''Why we are building temporary accounts'''
Our wikis should be safer to edit by default for logged-out editors. Temporary accounts allow people to continue editing the wikis without creating an account, while avoiding publicly tying their edits to their IP address. We believe this is in the best interest of our logged-out editors, who make valuable contributions to the wikis and who may later create accounts and grow our community of editors, admins, and other roles. Even though the wikis do warn logged-out editors that their IP address will be associated with their edit, many people may not understand what an IP address is, or that it could be used to connect them to other information about them in ways they might not expect.
Additionally, our moderation software and tools rely too heavily on network origin (IP addresses) to identify users and patterns of activity, especially as IP addresses themselves are becoming less stable as identifiers. Temporary accounts allow for more precise interactions with logged-out editors, including more precise blocks, and can help limit how often we unintentionally end up blocking good-faith users who use the same IP addresses as bad-faith users.
'''How temporary accounts work'''
[[File:Temporary account banner and empty talk page.png|thumb]]
Any time a logged-out user publishes an edit on this wiki, a cookie will be set in this user's browser, and a temporary account tied with this cookie will be automatically created. This account's name will follow the pattern: <code dir=ltr>~2025-12345-67</code> (a tilde, current year, a number). On pages like Recent Changes or page history, this name will be displayed. The cookie will expire 90 days after its creation. As long as it exists, all edits made from this device will be attributed to this temporary account. It will be the same account even if the IP address changes, unless the user clears their cookies or uses a different device or web browser. A record of the IP address used at the time of each edit will be stored for 90 days after the edit. However, only some logged-in users will be able to see it.
'''What does this mean for different groups of users?'''
'''For logged-out editors'''
* This increases privacy: currently, if you do not use a registered account to edit, then everybody can see the IP address for the edits you made, even after 90 days. That will no longer be possible on this wiki.
* If you use a temporary account to edit from different locations in the last 90 days (for example at home and at a coffee shop), the edit history and the IP addresses for all those locations will now be recorded together, for the same temporary account. Users who [[foundation:Special:MyLanguage/Policy:Access_to_temporary_account_IP_addresses|meet the relevant requirements]] will be able to view this data. If this creates any personal security concerns for you, please contact talktohumanrights at wikimedia.org for advice.
'''For community members interacting with logged-out editors'''
* A temporary account is uniquely linked to a device. In comparison, an IP address can be shared with different devices and people (for example, different people at school or at work might have the same IP address).
* Compared to the current situation, it will be safer to assume that a temporary user's talk page belongs to only one person, and messages left there will be read by them. As you can see in the screenshot, temporary account users will receive notifications. It will also be possible to thank them for their edits, ping them in discussions, and invite them to get more involved in the community.
'''For users who use IP address data to moderate and maintain the wiki'''
* '''For patrollers''' who track persistent abusers, investigate violations of policies, etc.: Users who [[foundation:Special:MyLanguage/Policy:Access_to_temporary_account_IP_addresses|meet the requirements]] will be able to reveal temporary users' IP addresses and all contributions made by temporary accounts from a specific IP address or range ([[Special:IPContributions]]). They will also have access to useful information about the IP addresses thanks to the [[mw:Special:MyLanguage/Trust and Safety Product/IP Info|IP Info]] feature. Many other pieces of software have been built or adjusted to work with temporary accounts, including AbuseFilter, global blocks, Global User Contributions, and more. (For information for volunteer developers on how to update the code of your tools – see the last part of the message.)
* '''For admins blocking logged-out editors''':
** It will be possible to block many abusers by just blocking their temporary accounts. A blocked person won't be able to create new temporary accounts quickly if the admin selects the [[mw:Special:MyLanguage/Autoblock|autoblock]] option.
** It will still be possible to block an IP address or IP range.
* Temporary accounts will not be retroactively applied to contributions made before the deployment. On Special:Contributions, you will be able to see existing IP user contributions, but not new contributions made by temporary accounts on that IP address. Instead, you should use Special:IPContributions for this.
'''Our requests for you, and next steps'''
* If you know of any tools, bots, gadgets etc. using data about IP addresses or being available for logged-out users, you may want to test if they work on [[testwiki:Main_Page|testwiki]] or [[test2wiki:Main_Page|test2wiki]]. If you are a volunteer developer, [[mw:Special:MyLanguage/Trust and Safety Product/Temporary Accounts/For developers|read our documentation for developers]], and in particular, the section on [[mw:Special:MyLanguage/Trust and Safety Product/Temporary Accounts/For developers#How should I update my code?|how your code might need to be updated]].
* If you want to test the temporary account experience, for example just to check what it feels like, go to testwiki or test2wiki and edit without logging in.
* Tell us if you know of any difficulties that need to be addressed. We will try to help, and if we are not able, we will consider the available options.
* Look at our [[m:Meta:Babel#Temporary_Accounts:_access_to_IP_addresses_and_next_steps|previous message]] about requirements for users without extended rights who may need access to IP addresses.
To learn more about the project, check out [[mw:Special:MyLanguage/Trust and Safety Product/Temporary Accounts/FAQ|our FAQ]] – you will find many useful answers there. You may also [[mw:Special:MyLanguage/Trust and Safety Product/Temporary Accounts/Updates|look at the updates]] (we have just posted one) and [[mw:Newsletter:Product Safety and Integrity|subscribe to our new newsletter]]. If you'd like to talk to me (Szymon) off-wiki, you will find me on Discord and Telegram. Thank you!<section end="body" />
</div>
<bdi lang="en" dir="ltr">[[m:user:NKohli (WMF)|NKohli (WMF)]], [[m:user:SGrabarczuk (WMF)|SGrabarczuk (WMF)]]</bdi> 21:35, 26 Agosto 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:Quiddity_(WMF)/sandbox6&oldid=29181713 -->
== <span lang="en" dir="ltr">Tech News: 2025-36</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W36"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/36|Translations]] are available.
'''Weekly highlight'''
* The Editing team wants to compile a list of templates, jargon terms, and policies used in edit summaries when a copyright violation is removed. This will help them identify the number of edits reverted due to copyright issues. We invite community members from the following Wikis to list these terms in [[Phab:T402601|T402601]], or to share their list with [[User:Trizek (WMF)|Trizek_(WMF)]]: {{int:project-localized-name-arwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-cswiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-dewiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-enwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-eswiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-fawiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-frwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-hewiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-idwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-itwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-jawiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-kowiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-nlwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-plwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-ptwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-trwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-ukwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-viwiki/en}}{{int:comma-separator/en}}{{int:project-localized-name-zhwiki/en}}. This project is open until September 9th 2025.
'''Updates for editors'''
* The [[mw:Special:MyLanguage/Help:Extension:CampaignEvents|CampaignEvents extension]] has been enabled for all Wikisources. The extension makes it easier to organize and participate in collaborative activities, like edit-a-thons and WikiProjects, on the wikis. The extension has three features: [[m:Special:MyLanguage/Event Center/Registration|Event Registration]], [[m:Special:MyLanguage/CampaignEvents/Collaboration list|Collaboration List]], and [[m:Special:MyLanguage/Connection Team/Invitation list|Invitation List]]. To request the extension for your wiki, visit the Deployment information page. [https://meta.wikimedia.org/wiki/CampaignEvents/Deployment_status#How_to_Request_the_CampaignEvents_Extension_for_your_wiki]
* The lists in the footer of the editing interface, such as "Templates used on this page," will now be organized into columns when there is enough space. This enhancement minimizes scrolling when editing lengthy articles on Wikipedia. [https://phabricator.wikimedia.org/T401066]
* On September 3rd, 2025 we will increase the sampling percentages of our [[mw:Special:MyLanguage/Moderator Tools/Watchlist/Experiment#Scope of the experiment|group by toggle experiment]] of the <code>Special:RecentChanges</code>, <code>Special:Watchlist</code>, and <code>Special:RelatedChanges</code> pages on the Chinese, French, and Portuguese Wikipedias to 100 percent, allowing more editors to be part of this experiment. This adjustment is intended to ensure we have sufficient data to make informed decisions when evaluating the experiment results. [https://phabricator.wikimedia.org/T402958][https://phabricator.wikimedia.org/T396789]
* Upon clicking an empty search bar, logged-out users will see suggestions of articles for further reading on English Wikipedia beginning the week of September 22. The feature will be available on both desktop and mobile. All non-English wikis received this change in June and July. The goal is to make it easier for users to find articles. [[mw:Special:MyLanguage/Reading/Web/Content Discovery Experiments/Search Suggestions|Learn more]].
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:37}} community-submitted {{PLURAL:37|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]].
'''Updates for technical contributors'''
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.17|MediaWiki]]
'''In depth'''
* Wikifunctions now has a new capability called "lightweight enumeration types", an enumeration type is simply a fixed set of values that's in the type's definition. This capability makes it quick and easy to define such a type, and allows for the reuse of values that are already present in Wikidata. Here is [[f:Special:MyLanguage/Wikifunctions:Status updates/2025-07-19|a newsletter]] to learn more.
* The latest [[mw:Special:MyLanguage/Readers/Newsletter updates#August 2025: Newsletter #1|Readers Newsletter]] is now available. This edition includes: the formation of two new teams — Reader Growth and Reader Experience; insights into declining pageviews and account creations; highlights from the Wikimania Nairobi panel on improving the reading experience; upcoming experiments to engage new and existing readers; and more.
'''Meetings and events'''
* Spotlight on some Wikimania 2025 Sessions:
** Identifying AI-generated text by searching for ISBNs whose checksums fail: Mathias Schindler of WMDE [https://www.youtube.com/watch?v=Dw9o8Lsl974&t=15910s shared tools to help communities search for these].
** [https://wikimedia.eventyay.com/talk/wikimania2025/talk/TCHZKH/ La durabilité du mouvement Wikimedia face aux défis actuels et futurs]: This session explored how Wikimedia can stay a trusted source of knowledge in the age of generative AI, information overload, and disinformation.
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/36|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W36"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 20:45, 1 Septiyembre 2025 (UTC)
<!-- Message sent by User:UOzurumba (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29196010 -->
== <span lang="en" dir="ltr">Tech News: 2025-37</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W37"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/37|Translations]] are available.
'''Weekly highlight'''
* The Editing team is working on a new check: [[mw:Special:MyLanguage/Paste check|Paste check]]. This check informs newcomers who paste text into Wikipedia that the content might not be accepted. This check is an effort to increase the likelihood that the new content people are adding to Wikipedia is aligned with the Movement's commitment to offering information under a free content license. This check will soon be tested at a few wikis. If your community is interested in this test, please [[phab:T403680|tell us in this task]], or [[mw:Talk:Edit check|contact the team]].
'''Updates for editors'''
* [[File:Octicons-tools.svg|12px|link=|class=skin-invert|Advanced item]] Later this week, users of the "{{int:codemirror-beta-feature-title}}" [[Special:Preferences#mw-prefsection-betafeatures|beta feature]] will be able to use a [[w:en:Lint (software)|linting tool]] to see errors or other potential problems in wikitext in real time. See the [[mw:Special:MyLanguage/Help:Extension:CodeMirror#Linting|help page for more information]]. [https://phabricator.wikimedia.org/T381577]
* [[File:Octicons-tools.svg|12px|link=|class=skin-invert|Advanced item]] When browsing a wiki (like <code dir=ltr>en.wikipedia.org</code>), the software responds in one of two ways: a desktop page, or a redirect to a mobile version on an "m" domain (like <code dir=ltr>en.m.wikipedia.org</code>). Over the next three weeks, MediaWiki will start displaying the mobile version to mobile devices directly on the standard domain, without this redirect. This change does not affect existing m-dot URLs, or the "Desktop view" opt-out. [[mw:Requests for comment/Mobile domain sunsetting/2025 Announcement|Learn more]]. [https://phabricator.wikimedia.org/T214998]
* When an edit changes the categories of a page, the changes to the category membership counts are now happening asynchronously. This improves the speed of saving edits, especially when moving many pages to or from the same category, and reduces the risk of site outages, but it means that the counts can show outdated information for a few minutes. [https://phabricator.wikimedia.org/T365303]
* Edits on Wikidata to qualifiers (properties and values) and references (properties and values) in a Wikidata item statement will now not add entries to the RecentChanges or Watchlist pages on all other Wikis. This is a temporary change to improve performance while other solutions are created. Wikidata's own pages remain unchanged. [[m:Wikidata For Wikimedia Projects/Reduce change propagation noise#Phase 1: Turn off (temporarily) Qualifiers and References Wikidata edits to the Recent Changes tables|Learn more]]. [https://phabricator.wikimedia.org/T401286][https://phabricator.wikimedia.org/T400698]
* Japanese-language wikis have had a major upgrade to the way that search works. The new search should generally give more accurate and more relevant search results. [https://phabricator.wikimedia.org/T318269]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:31}} community-submitted {{PLURAL:31|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]].
'''Updates for technical contributors'''
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.18|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/37|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W37"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 01:10, 9 Septiyembre 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29238161 -->
== <span lang="en" dir="ltr">Tech News: 2025-38</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W38"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/38|Translations]] are available.
'''Updates for editors'''
* References lists that are made using the <code dir=ltr><nowiki><references/></nowiki></code> [[mw:Special:MyLanguage/Help:Cite#references-tag|tag]] will now automatically display with columns in Vector 2022 when readers are using its 'standard' settings for text-size and page-width. [https://phabricator.wikimedia.org/T334941]
* Starting in the week of October 6, on [[git:operations/mediawiki-config/+/a2d2aaab9ace84280dd2f4c70a33bb69cd73850f/dblists/small.dblist|small wikis]] and [[git:operations/mediawiki-config/+/a2d2aaab9ace84280dd2f4c70a33bb69cd73850f/dblists/medium.dblist|medium wikis]] that have the [[mw:Special:MyLanguage/Help:Extension:CampaignEvents|CampaignEvents extension]] enabled, all autoconfirmed users will be able to use [[m:Special:MyLanguage/Event Center/Registration|Event Registration]] as an organizer. No changes will be made for [[git:operations/mediawiki-config/+/a2d2aaab9ace84280dd2f4c70a33bb69cd73850f/dblists/large.dblist|large wikis]] unless requested in Phabricator. This change is being made to make it easier for more people to use Event Registration, especially on wikis that are less likely to have policies related to the Event Organizer right. [[m:Special:MyLanguage/CampaignEvents/Proposal to grant autoconfirmed users on small and medium wikis the organizer access to the event registration tool|Learn more]].
* Users that search using regular expressions (regex) can now use additional features including:
** for the <code dir=ltr>intitle:</code> keyword: [[mw:Special:MyLanguage/Help:CirrusSearch#Metacharacters|metacharacters]] for start-of-line (<code dir=ltr>^</code>) and end-of-line (<code dir=ltr>$</code>) anchors [https://phabricator.wikimedia.org/T317599]
** for both <code dir=ltr>intitle:</code> and <code dir=ltr>insource:</code> keywords: shorthand [[mw:Special:MyLanguage/Help:CirrusSearch#Character_Classes|character classes]] for digits (<code dir=ltr>\d</code>), whitespace (<code dir=ltr>\s</code>), and word characters (<code dir=ltr>\w</code>); and [[mw:Special:MyLanguage/Help:CirrusSearch#Escape codes|escape codes]] for line feed (<code dir=ltr>\r</code>), newline (<code dir=ltr>\n</code>), tab (<code dir=ltr>\t</code>), and unicode (e.g. <code dir=ltr>\uHHHH</code>). [https://phabricator.wikimedia.org/T403212]
* When you search for text that looks like an IP, the system will now show search results. It used to take you to the contributions for that IP instead of showing search results. [https://phabricator.wikimedia.org/T306325]
* [[m:Special:MyLanguage/Tech/Server switch|All wikis will be read-only]] for a few minutes on September 24. This is planned at [https://zonestamp.toolforge.org/1758726000 15:00 UTC]. This is for the datacenter server switchover backup tests which happen twice a year. You can [[diffblog:2025/03/12/hear-that-the-wikis-go-silent-twice-a-year/|read more about the background and details of this process on the Diff blog]].
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:24}} community-submitted {{PLURAL:24|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, a bug was fixed that affected users who used the page-tabs to switch from wikitext editing of a section into the visualeditor. [https://phabricator.wikimedia.org/T401043]
'''Updates for technical contributors'''
* The MediaWiki Interfaces team is redesigning the Wikimedia REST API Sandbox with Codex. If you have feedback on improvements for the API documentation or what makes developer experiences smooth (or frustrating), you’re invited to [https://calendar.google.com/calendar/u/0/appointments/schedules/AcZssZ2aZzbXeQvjOF7gB1fJXiwAYemQjKf4sXNaRODPA7_obFyNBwkzNkoVCoTF-aeov89kIjXHbCQm join an upcoming discovery interview], or [[mw:MediaWiki Interfaces Team/Developer Feedback/Wikimedia Web APIs|leave feedback onwiki]]. [[listarchive:list/wikitech-l@lists.wikimedia.org/thread/C4FBAOA57PH6G5ORVMAUF5TGYBLZDU5Q/|Learn more]].
* Edits to Wikidata aliases (an alternative name for an item or a property) will now be shown in RecentChanges and Watchlist entries on other wikis less often, reducing unnecessary notifications. This will reduce the overall quantity of 'noisy' entries. Wikidata's own pages remain unchanged. [[m:Wikidata For Wikimedia Projects/Reduce change propagation noise#Phase 1: More granular Alias tracking|Learn more]]. [https://phabricator.wikimedia.org/T401288]
* The new [https://www.unicode.org/versions/Unicode17.0.0/ Unicode 17.0] version has been released. The [[:c:Category:Unicode Module Datasets|datasets on Commons]] for the [[:d:Q39301585|Module:Unicode data]] have been updated. Wikipedias that do not use the Commons datasets should either update their own data or switch to the Commons datasets.
* Users of the [[m:Special:MyLanguage/Wikimedia Enterprise|Wikimedia Enterprise]] Structured Contents endpoints can now access [https://enterprise.wikimedia.com/blog/parsed-wikipedia-tables/ Parsed Tables]. The new Parsed Tables feature extracts and represents Wikipedia tables in structured JSON. This improves machine accessibility as part of the [https://enterprise.wikimedia.com/api/structured-contents/ Structured Contents initiative]. Structured Contents output is freely available through the [https://enterprise.wikimedia.com/docs/on-demand/#article-structured-contents-beta On-demand API], or through Wikimedia Cloud Services.
* A [https://www.kaggle.com/datasets/wikimedia-foundation/english-wikipedia-people-dataset dataset of English Wikipedia biographical information] from [[m:Special:MyLanguage/Wikimedia Enterprise|Wikimedia Enterprise]] has been published on Kaggle, for evaluation and research. This provides structured data from more than 1.5 million biographies, including birth and death dates, education, affiliations, careers, awards, and more (from a June 2024 snapshot).
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.19|MediaWiki]]
'''Meetings and events'''
* [[wmania:Special:MyLanguage/2026:Scholarships|Scholarship applications]] for Wikimania 2026 in Paris, France, are open until October 31.
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/38|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W38"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 17:02, 15 Septiyembre 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29263921 -->
== <span lang="en" dir="ltr">Server switch - Your wiki will be read-only for a short time soon</span> ==
<div lang="en" dir="ltr">
<section begin="server-switch"/><div class="plainlinks">
[[:m:Special:MyLanguage/Tech/Server switch|Read this message in another language]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-Tech%2FServer+switch&language=&action=page&filter= {{int:please-translate}}]
The [[foundation:|Wikimedia Foundation]] will switch the traffic between its data centers. This will make sure that Wikipedia and the other Wikimedia wikis can stay online even after a disaster.
All traffic will switch on '''{{#time:j xg|2025-09-24|en}}'''. The switch will start at '''[https://zonestamp.toolforge.org/{{#time:U|2025-09-24T15:00|en}} {{#time:H:i e|2025-09-24T15:00}}]'''.
Unfortunately, because of some limitations in [[mw:Special:MyLanguage/Manual:What is MediaWiki?|MediaWiki]], all editing must stop while the switch is made. We apologize for this disruption, and we are working to minimize it in the future.
A banner will be displayed on all wikis 30 minutes before this operation happens. This banner will remain visible until the end of the operation.
You can contribute to the [https://meta.wikimedia.org/w/index.php?title=Special%3ATranslate&group=Centralnotice-tgroup-read_only_banner&task=view&language=&filter=&action=translate translation or proofreading] of this banner text.
'''You will be able to read, but not edit, all wikis for a short period of time.'''
*You will not be able to edit for up to an hour on {{#time:l j xg Y|2025-09-24|en}}.
*If you try to edit or save during these times, you will see an error message. We hope that no edits will be lost during these minutes, but we can't guarantee it. If you see the error message, then please wait until everything is back to normal. Then you should be able to save your edit. But, we recommend that you make a copy of your changes first, just in case.
''Other effects'':
*Background jobs will be slower and some may be dropped. Red links might not be updated as quickly as normal. If you create an article that is already linked somewhere else, the link will stay red longer than usual. Some long-running scripts will have to be stopped.
* We expect the code deployments to happen as any other week. However, some case-by-case code freezes could punctually happen if the operation require them afterwards.
* [[mw:Special:MyLanguage/GitLab|GitLab]] will be unavailable for about 90 minutes.
This project may be postponed if necessary. You can [[wikitech:Switch_Datacenter|read the schedule at wikitech.wikimedia.org]]. Any changes will be announced in the schedule.
'''Please share this information with your community.'''</div><section end="server-switch"/>
</div>
<span dir=ltr>[[m:User:Trizek (WMF)|Trizek (WMF)]] ([[m:User talk:Trizek (WMF)|{{int:talk}}]])</span> 15:41, 18 Septiyembre 2025 (UTC)
<!-- Message sent by User:Trizek (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Distribution_list/Non-Technical_Village_Pumps_distribution_list&oldid=29170715 -->
== <span lang="en" dir="ltr">Tech News: 2025-39</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W39"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/39|Translations]] are available.
'''Weekly highlight'''
* [https://zonestamp.toolforge.org/1758726000 On September 24th at 15:00 UTC], all Wikimedia sites users will experience a brief read-only period due to a scheduled [[m:Special:MyLanguage/Tech/Server switch|datacenter server switchover]]. The Wikimedia Foundation's Site Reliability Engineering (SRE) team will redirect all traffic from one primary server to its backup. You can listen to the switchover using the [http://listen.hatnote.com/ "Listen to Wikipedia"] tool, where you will hear edits stop for a few minutes during the read-only phase, then resume. This twice-yearly datacenter server switchover ensures reliability by testing the backup datacenter, so that our sites can stay online even if the primary datacenter fails. You can [[diffblog:2025/03/12/hear-that-the-wikis-go-silent-twice-a-year/|read more about the process on the Diff blog]].
'''Updates for editors'''
* Editors of [[f:Special:Mylanguage/Wikifunctions:Status updates/2025-09-12#Next round of Wiktionaries to receive embedded Wikifunctions calls|60 more Wiktionaries]] will soon be able to call [[f:Special:MyLanguage/Wikifunctions:Introduction|functions from Wikifunctions]] and integrate them into their pages. A function takes one or more inputs and transforms them into a desired output, like adding numbers, converting miles to meters, calculating elapsed time, or declining a word into a case. They will join the other [[f:Special:MyLanguage/Wikifunctions:Status updates/2025-08-29#Wikifunctions available on 65 Wiktionaries|65 Wiktionary language editions]], which already have access to embedded Wikifunctions calls. Later this year, plans are in place to expand to more Wiktionaries and the Incubator.
* A new [[mw:Special:MyLanguage/Help:Magic words#Technical metadata of another page|parser function]] has been added: <code><nowiki>{{#contentmodel}}</nowiki></code>. Template editors and admins can use it to get the localized or canonical name of the [[mw:Special:MyLanguage/Help:ChangeContentModel|content model]] of a specific page. The function makes it easier to create and edit system messages, such as ''MediaWiki:editinginterface'', even when you switch types of pages, like wiki, JavaScript, CSS or JSON page. [https://phabricator.wikimedia.org/T328254]
* Adding or editing a <code>DISPLAYTITLE</code> for an article using VisualEditor will no longer be broken. Editors who use VisualEditor mode to modify the <code><nowiki>{{DISPLAYTITLE}}</nowiki></code> would no longer have the literal text "DISPLAYTITLE" or its localized variant added to their articles. A list of pages that may have been affected and might need cleanup is documented in [[phab:P83438|this ticket]].
* Beta users of the Wikipedia Android app can now try the redesigned [[mw:Special:MyLanguage/Wikimedia Apps/Team/Android/Activity Tab Experiment|Activity tab]], which replaces the Edits tab. The new tab offers personalized insights into reading, editing, and donation activity, while simplifying navigation and making app use more engaging.
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:12}} community-submitted {{PLURAL:12|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]].
'''Updates for technical contributors'''
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.20|MediaWiki]]
'''In depth'''
* Wikifunctions users can now import many essential facts involving [[f:Special:MyLanguage/Z6011|geo-coordinates]], [[f:Special:MyLanguage/Z6010|quantities]] and [[f:Special:MyLanguage/Z6064|time]] values from Wikidata. This is made possible by the creation of Wikifunctions types for these values, which makes them available for use by functions in Wikifunctions. Learn more about how this works in [[c:File:ImportingWikidataDatatypesIntoWikifunctions.webm|this video]] and Wikifunctions' [[f:Special:MyLanguage/Wikifunctions:Status updates/2025-08-01#News in Types I: Wikidata quantity|August 1 newsletter]] (for quantities) and [[f:Special:MyLanguage/Wikifunctions:Status updates/2025-08-22#News in Types: Wikidata geo-coordinate|August 22 newsletter]] (for geo-coordinates).
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/39|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W39"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 22:51, 22 Septiyembre 2025 (UTC)
<!-- Message sent by User:UOzurumba (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29305556 -->
== <span lang="en" dir="ltr">Tech News: 2025-40</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W40"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/40|Translations]] are available.
'''Weekly highlight'''
* A major software upgrade has been made to [[phab:|Phabricator]]. The update introduces performance improvements, a refreshed search interface, enhancements to Maniphest task search, updates to user profile pages and project workboards, new Herald automation features, as well as general text input, mobile experience improvements and more. [https://phabricator.wikimedia.org/phame/post/view/321/iterative_improvements_september_2025/]
'''Updates for editors'''
* The Community Tech team will release the new Community Wishlist extension on October 1, that will improve the way wishes will be submitted. The new extension will allow users to add tags to their wishes to better categorise them, and (in a future iteration) to filter them by status, tags and focus areas. It will also be possible to support individual wishes again, as requested by the community in many instances. The old system will be retired. There will be a brief period of downtime while the extension is deployed and wishes are migrated to the new system. You can read more about this [[:m:Special:MyLanguage/Community Wishlist/Updates|in the latest update]] or you can consult the [[:mw:Special:MyLanguage/Help:Extension:CommunityRequests|current documentation on MediaWiki]].
* As announced [[diffblog:2025/09/02/better-detecting-bots-and-replacing-our-captcha/|on Diff blog]], the production trial of the [[mw:Special:MyLanguage/Product Safety and Integrity/Anti-abuse signals/hCaptcha|hCaptcha]] service for bot detection has begun. The trial is currently using hCaptcha to protect account creation on Chinese, Persian, Portuguese, Indonesian, Japanese, and Turkish Wikipedias, where it will replace our existing [[mw:Special:MyLanguage/Extension:ConfirmEdit#FancyCaptcha|CAPTCHA]] (FancyCaptcha). The goal with the trial is to better block bots while also improving usability and accessibility for users who encounter CAPTCHA challenges.
* The [[mw:Special:MyLanguage/Extension:CampaignEvents|CampaignEvents]] extension has been [[m:Special:MyLanguage/CampaignEvents/Deployment status|deployed]] to Wikimedia Commons. The extension makes it easier to organize and participate in collaborative activities, like edit-a-thons and WikiProjects, on the wikis. On Commons, anyone who is a registered user can use it as an event participant. To use it as an organizer, someone needs to have the [[c:Special:MyLanguage/Commons:Event organizers|event organizer right]].
* [[:m:Special:MyLanguage/WMDE Technical Wishes/Sub-referencing|Sub-referencing]], a new feature to re-use references with different details has been released to German Wikipedia. You can [[:m:Special:MyLanguage/WMDE Technical Wishes/Sub-referencing#test|test the feature]] on testwiki or [https://en.wikipedia.beta.wmcloud.org/wiki/Sub-referencing on betawiki] as well. Please share your thoughts on [[:m:Talk:WMDE Technical Wishes/Sub-referencing#Templates used in sub-references|using templates in sub-references]] or [[:m:Talk:WMDE Technical Wishes/Sub-referencing#Pilot wikis|volunteer to become a pilot wiki]].
* On wikis using the [[mw:Special:MyLanguage/Help:Growth/Mentorship|Mentorship]] system, communities can now opt experienced editors out of Mentorship through [[{{#special:CommunityConfiguration/Mentorship}}]]. Within this setting, communities may define thresholds, based on edit count and account age, to decide when an editor is considered experienced enough to no longer receive Mentorship. [https://phabricator.wikimedia.org/T403563]
* The Editing Team and the Machine Learning Team are working on a new check for newcomers: [[mw:Special:MyLanguage/Edit check/Tone Check|Tone check]]. Using a prediction model, this check will encourage editors to improve the tone of their edits, using artificial intelligence. We invite volunteers to review the first version of the Tone language model for the following languages: Arabic, Czech, German, Hebrew, Indonesian, Dutch, Polish, Russian, Turkish, Chinese, Farsi, Italian, Norwegian, Romanian and Latvian. Users from these wikis interested in reviewing this model are [[mw:Special:MyLanguage/Edit_check/Tone_Check/Model_evaluation|invited to sign up at MediaWiki.org]]. The deadline to sign up is on October 3, which will be the start date of the test.
* The rollout of [[:mw:Special:MyLanguage/Help:Manage blocks|multiblocks]] had the side effect that non-active block logs may have been shown on {{#special:Contributions}} and on blocked users' user and user_talk pages. This issue will be fully resolved in a few days. As part of the fix, [{{fullurl:Special:Allmessages|prefix=sp-contributions-blocked-notice}} messages prefixed with <code>sp-contributions-blocked-notice</code>] will be removed and replaced with [{{fullurl:Special:Allmessages|prefix=blocked-notice-logextract}} those prefixed with <code>blocked-notice-logextract</code>] in a few weeks. Please help translate the new messages and update any local overrides if needed.
* There was a bug with links added using visual editor if they included characters such as <code dir=ltr><nowiki>[ ] |</nowiki></code> after the fragment identifier (<code><nowiki>#</nowiki></code>). They were not encoded properly creating an incorrect link. This has been fixed. [https://phabricator.wikimedia.org/T404823]
* One new wiki has been created: a {{int:project-localized-name-group-wikiquote/en}} in [[d:Q9237|Malay]] ([[q:ms:|<code>q:ms:</code>]]) [https://phabricator.wikimedia.org/T404698]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:21}} community-submitted {{PLURAL:21|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the [[mw:Special:MyLanguage/Product Safety and Integrity/Anti-abuse signals/User Info|User Info Card]] now displays currently active global lock/blocks. [https://phabricator.wikimedia.org/T401128]
'''Updates for technical contributors'''
* Later this week, editors using Lua modules will be able to use the <code>[[mw:Special:MyLanguage/Extension:Scribunto/Lua reference manual#mw.title.newBatch|mw.title.newBatch]]</code> function to look up the existence of up to 25 pages at once, in a way that only increases the [[mw:Special:MyLanguage/Manual:Parser functions#Expensive parser functions|expensive function]] count once.
* A new [[m:Special:MyLanguage/Product and Technology Advisory Council/Unsupported Tools Working Group|Unsupported Tools Working Group]] has been formed as part of ongoing efforts to collectively determine technical work priorities, similar to the [[m:Special:MyLanguage/Product and Technology Advisory Council|Product & Technology Advisory Council]] (PTAC). The working group will help prioritize and review requests for support of unmaintained extensions, gadgets, bots, and tools. For the first cycle, the group will be prioritizing an unsupported Wikimedia Commons tool.
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.21|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/40|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W40"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 20:47, 29 Septiyembre 2025 (UTC)
<!-- Message sent by User:UOzurumba (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29355230 -->
== Upcoming Dark Mode user interface rollout for anonymous Wikimedia sites users ==
<div lang="en" dir="ltr">
{{int:Hello}} Wikimedians,
Apologies if this message is not in your language. {{int:please-translate}}.
The [[mw:Special:MyLanguage/Reading/Web|Reader Experience team]] will launch the Dark mode feature for anonymous users on all Wikimedia sites, including yours, on October 29, 2025.
[[:en:Special:MyLanguage/Light-on-dark color scheme|Dark mode]] is an option that allows users to view pages in light-coloured text, and icons on a dark background. Once it is available for anonymous users, they can enable it when using various devices. More information on ways to enable it can be found on [[:en:Special:MyLanguage/Wikipedia:Dark mode#Options for anyone|this page]].
Given many pages are still not compatible with dark mode this will be an opt-in feature and not automatically apply to pages.
Dark mode requires modifications to content pages and templates, and since our initial launch [https://diff.wikimedia.org/2024/07/17/dark-modes-bright-future-how-dark-mode-will-transform-wikipedias-accessibility/ in July 2024], we have been working with communities and helping them prepare for dark mode. Before the rollout, it is essential that template authors and technical contributors test dark mode and read [[mw:Special:MyLanguage/Reading/Web/Accessibility for reading/Updates/2024-04|this page]] to learn how to make pages Dark mode-ready and address any compatibility issues found in templates.
We will fix most color compatibility issues only on the most-viewed pages on projects with over 5 million monthly page views. Technical contributors with an account should opt into dark mode currently using preferences or settings and test pages and seek help before the release to ensure everything complies before the enablement.
If you have any questions or need help, please [[mw:Special:MyLanguage/Talk:Reading/Web/Accessibility for reading#|contact the Reader Experience team]] for support.
Thank you!
</div>
<bdi lang="en" dir="ltr">[[User:UOzurumba (WMF)|UOzurumba (WMF)]]</bdi> 02:08, 30 Septiyembre 2025 (UTC)
<!-- Message sent by User:UOzurumba (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:UOzurumba_(WMF)/sandbox_Dark_mode_deployment_mass_message_list_(October_2025)&oldid=29358561 -->
== <span lang="en" dir="ltr">Tech News: 2025-41</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W41"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/41|Translations]] are available.
'''Weekly highlight'''
* [[mw:Special:MyLanguage/Help:Edit check#paste|Paste Check]] is a new Edit Check feature to help avoid and fight copyright violations. When editors paste text into an article, Paste Check prompts them to confirm the origin and licensing of the content. Starting Wednesday, 8 October, [[phab:T403680|22 wikis will test Paste Check]]. Paste Check will help new volunteers understand and follow the policies and guidelines necessary to make constructive contributions to Wikipedia projects.
'''Updates for editors'''
* Mobile devices will receive mobile articles directly on the standard domain (like <code>en.wikipedia.org</code>), instead of via a redirect to an "m" domain (like <code>en.m.wikipedia.org</code>). This change improves performance. This week it will be enabled on Wikipedias. The existing mobile URLs and the "Desktop view" opt-out remain available. [[mw:Requests for comment/Mobile domain sunsetting/2025 Announcement|Learn more]]. [https://phabricator.wikimedia.org/T214998]
* New [[mw:Special:MyLanguage/Help:CirrusSearch#creationdate and lasteditdate|date filters]], <code dir=ltr>creationdate:</code> and <code dir=ltr>lasteditdate:</code>, are now available in the wiki search engine. This allows users to filter search results by a page's first or last revision date. The filters support comparison operators (e.g. <code dir=ltr>>2024</code>) and relative dates (e.g. <code dir=ltr>today-1d</code>), making it easier to find recently updated content or pages within specific age ranges. [https://phabricator.wikimedia.org/T403593]
* [[f:|Wikifunctions]] now supports rich text in embedded calls across the 150 wikis where it's enabled. To showcase this, the team created a [[f:Z26333|Latin declination table]] that Wiktionary editors can use to automatically generate noun forms, producing clear, formatted results — see an [[f:Wikifunctions:Embedded function calls/Wiktionary tables demonstration|example output]]. If you need any help or have any feedback, please [[f:Wikifunctions:Project chat|contact the Wikifunctions Team]]. [https://phabricator.wikimedia.org/T397402]
* An edit link will now appear inside the categories box on article pages for logged in users, which will directly launch the VisualEditor category dialog. [https://phabricator.wikimedia.org/T291691]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:34}} community-submitted {{PLURAL:34|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, there was a problem downloading pdf files last week and that has been resolved. [https://phabricator.wikimedia.org/T405957]
'''Updates for technical contributors'''
* The field <code dir=ltr>rev_sha1</code> in the revision database table is being removed in favor of <code dir=ltr>content_sha1</code> in the content database table. See [https://lists.wikimedia.org/hyperkitty/list/cloud@lists.wikimedia.org/thread/2D2M3SP4WHR6BXXKTZ2PBLZQYR3EGQVR/ the announcement] for more information.
* The [[mw:Special:MyLanguage/Reading/Web|Reader Experience team]] will roll out [[w:en:Light-on-dark color scheme|Dark Mode]] user interface on all Wikimedia sites on October 29, 2025. All anonymous users of Wikimedia sites will have the option to activate a color scheme that features light-colored text on a dark background. This is designed to provide a more comfortable reading experience, especially in low-light situations. Template authors and technical contributors are encouraged to [[mw:Special:MyLanguage/Reading/Web/Accessibility for reading/Updates/2024-04|learn how to make pages ready for Dark mode]] and address any compatibility issues found in templates in their wiki before the enablement. Please contact the Web team for questions or any support on [[mw:Talk:Reading/Web/Accessibility for reading#|this talk page]] before the enablement. [https://phabricator.wikimedia.org/T395628]
* Starting on Monday, October 6, API endpoints under the <code>rest.php</code> path will be rerouted through a new internal API Gateway. Individual wikis will be updated based on the standard release groups, with total traffic increased over time. This change is expected to be non-breaking and non-disruptive. If any issues are observed, please file a Phabricator ticket to the [[phab:tag/serviceops/|Service Ops team board]]. [https://phabricator.wikimedia.org/T400130]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.22|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/41|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W41"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 17:19, 6 Oktubre 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29400897 -->
== <span lang="en" dir="ltr">Have your say: vote for the 2025 Board of Trustees</span> ==
<div lang="en" dir="ltr">
<section begin="announcement-content" />
Hello all,
The voting period for the [[m:Special:MyLanguage/Wikimedia Foundation elections/2025|2025 Board of Trustees election]] is now open. Candidates are running for two (2) seats on the Board.
To check your voter eligibility, please visit the [[m:Special:MyLanguage/Wikimedia Foundation elections/2025/Voter eligibility guidelines|voter eligibility page]].
Learn more about them by [[m:Special:MyLanguage/Wikimedia Foundation elections/2025/Candidates|reading their application statements and watch their candidacy videos]].
When you are ready, go to the [[m:Special:SecurePoll/vote/405|SecurePoll voting page to vote]].
'''The vote is open from October 8 at 00:00 UTC to October 22 at 23:59 UTC.'''
Best regards,
Abhishek Suryawanshi<br />Chair, Elections Committee<section end="announcement-content" />
</div>
[[Gumagamit:MediaWiki message delivery|MediaWiki message delivery]] ([[Hisgot sa Gumagamit:MediaWiki message delivery|talk]]) 04:48, 9 Oktubre 2025 (UTC)
<!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Distribution_list/Global_message_delivery&oldid=29360896 -->
== <span lang="en" dir="ltr">Tech News: 2025-42</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W42"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/42|Translations]] are available.
'''Weekly highlight'''
* Last week, improvements to account security and two-factor authentication (2FA) features were enabled across all wikis. These changes include user interface improvements for [https://auth.wikimedia.org/metawiki/wiki/Special:AccountSecurity Special:AccountSecurity], the support of multiple 2FA methods via authenticator apps and portable security keys (previously users could only enable one method), and a new Recovery Codes module which facilitates fewer account lockouts due to lost two-factor apps and devices. As part of the [[mw:Special:MyLanguage/Product Safety and Integrity/Account Security|Account Security]] project, work is continuing through the rest of 2025 on further user experience improvements, and support for passkeys as an alternate second factor.
'''Updates for editors'''
* Another part of the Account security project is making 2FA generally available to all users. Along with editors with advanced privileges, such as administrators and bureaucrats, 40% of editors now have access to 2FA. You can check if you have access at [https://auth.wikimedia.org/metawiki/wiki/Special:AccountSecurity Special:AccountSecurity]. Instructions for activation are on the linked page. The plan is to continue increasing availability if it is determined that the user support capabilities are able to support global usage. [https://phabricator.wikimedia.org/T400579]
* This week, users at wikis where talk page [[mw:Special:MyLanguage/Talk pages project/Usability|Usability Improvements]] are already available by default (everywhere ''except'' the 12 wikis listed in [[phab:T379264|T379264]]) will gain the ability to Thank a comment directly from the talk page it appears on. Before this change, Thanking could only be done by visiting the revision history of the talk page. You can [[diffblog:2025/10/13/revolutionizing-gratitude-a-new-era-of-thanking-comments/|learn more about this change]]. [https://phabricator.wikimedia.org/T366095]
* Users who have not [[Special:Preferences#mw-prefsection-personal-email|verified their email address]] will soon be receiving monthly Notification reminders to do so. This is because users who have verified their email can more easily recover their account. These reminders will not be sent if the user is inactive or removes the unverified email from their account. [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Email_confirmation][https://phabricator.wikimedia.org/T58074]
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:21}} community-submitted {{PLURAL:21|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, a fix was made for an occasional error with saving translated paragraphs in the Content Translation tool, and the related error messages are now easier to see. [https://phabricator.wikimedia.org/T376531]
'''Updates for technical contributors'''
* The Unsupported Tools Working Group has chosen [[c:Special:MyLanguage/Commons:Video2commons|Video2Commons]] as the first tool for its pilot cycle. The group will explore ways to improve and sustain the tool over the coming months. [[m:Special:MyLanguage/Product and Technology Advisory Council/Unsupported Tools Working Group|Learn more on Meta]].
* [[File:Octicons-sync.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.23|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/42|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W42"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 18:55, 13 Oktubre 2025 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29434481 -->
== Pagboto ==
Kumusta mga Sinugboanon nga Wikipedya, sa pagkakaron adunay nagpadayon nga eleksyon alang sa mga tigdumala. [[Wikipedia:Tigdumala/Exec8 (ikatulo nga termino)|Palihog boto!]] [[Gumagamit:MediaWiki message delivery|MediaWiki message delivery]] ([[Hisgot sa Gumagamit:MediaWiki message delivery|talk]]) 06:40, 17 Oktubre 2025 (UTC)
<!-- Message sent by User:Như Gây Mê@cebwiki using the list at https://ceb.wikipedia.org/w/index.php?title=Gumagamit:Nh%C6%B0_G%C3%A2y_M%C3%AA/announcement&oldid=35050062 -->
== Pagdugang og laing boto ==
Kumusta mga Sinugboanon nga Wikipedya, sa pagkakaron adunay nagpadayon nga eleksyon alang sa mga tigdumala. [[Wikipedia:Tigdumala/Như Gây Mê (ikatulong higayon)|Palihog boto!]] [[Gumagamit:MediaWiki message delivery|MediaWiki message delivery]] ([[Hisgot sa Gumagamit:MediaWiki message delivery|talk]]) 07:27, 20 Oktubre 2025 (UTC)
<!-- Message sent by User:Như Gây Mê@cebwiki using the list at https://ceb.wikipedia.org/w/index.php?title=Gumagamit:Nh%C6%B0_G%C3%A2y_M%C3%AA/announcement&oldid=35050062 -->
== <span lang="en" dir="ltr">Help us decide the name of the new Abstract Wikipedia project</span> ==
<div lang="en" dir="ltr">
<section begin="function1"/>
{{int:Hello}}. Please help pick a name for the new Abstract Wikipedia wiki project. This project will be a wiki that will enable users to combine functions from [[:f:|Wikifunctions]] and data from Wikidata in order to generate natural language sentences in any supported languages. These sentences can then be used by any Wikipedia (or elsewhere).
There will be two rounds of voting, each followed by legal review of candidates, with votes beginning on 20 October and 17 November 2025. Our goal is to have a final project name selected on mid-December 2025. If you would like to participate, then '''[[m:Special:MyLanguage/Abstract Wikipedia/Abstract Wikipedia naming contest|please learn more and vote now]]''' at meta-wiki.
{{Int:Feedback-thanks-title}}
<section end="function1"/>
</div>
-- [[User:Sannita (WMF)|User:Sannita (WMF)]] ([[User talk:Sannita (WMF)|talk]]) 11:42, 20 Oktubre 2025 (UTC)
<!-- Message sent by User:Sannita (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Distribution_list/Global_message_delivery&oldid=29432175 -->
== <span lang="en" dir="ltr">Tech News: 2025-43</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W43"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/43|Translations]] are available.
'''Updates for editors'''
* To optimize how user data is stored in our databases, the saved preferences of users who haven't logged in for over five years and have fewer than 100 edits will be cleared. When those users return, default settings will apply. [https://phabricator.wikimedia.org/T406724]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:20}} community-submitted {{PLURAL:20|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, there was a broken link from the GlobalContributions interface message to the XTools GlobalContributions page which has now been fixed. [https://phabricator.wikimedia.org/T406415]
'''Updates for technical contributors'''
* The work to reroute all traffic to API endpoints under the <code dir=ltr><nowiki>rest.php</nowiki></code> route through a common API gateway is now complete. If any issues are observed, please file a phabricator ticket to the [[phab:tag/serviceops/|Service Ops team board]].
* Edits to Wikidata references or qualifiers will now be shown in RecentChanges and Watchlist entries on other wikis less often, reducing unnecessary notifications. This will reduce the overall quantity of 'noisy' entries. Wikidata's own pages remain unchanged. [https://phabricator.wikimedia.org/T401290]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.24|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/43|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W43"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 19:31, 20 Oktubre 2025 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29478670 -->
== Growth News #35 ==
<div class="plainlinks mw-content-ltr" lang="en" dir="ltr">
[[File:Growth team logo - Icon only.svg|right|frameless|class=skin-invert]]
''A quarterly update from the Growth team on our work to improve the new editor experience.''
=== New releases ===
==== English Wikipedia gets "Add a Link" Structured Task ====
We [[w:Wikipedia_talk:Growth_Team_features#"Add_a_link"_experiment_and_next_steps|released]] the [[mw:Special:MyLanguage/Growth/Personalized first day/Structured tasks/Add a link|"Add a Link" Structured Task]] to 100% of accounts at English Wikipedia on Tuesday, September 2nd (before then it was available to 20% of accounts).
==== Growth features for Wikidata ====
After examining if the Growth features and Mentorship could be adapted to Wikidata, we activated the Growth features on [https://www.wikidata.beta.wmcloud.org/wiki/Wikidata:Main_Page Beta Wikidata] to allow for testing and discussion ([[phab:T400937|T400937]]).
Although some features, like Suggested Edits, are Wikipedia-specific, the Growth team designed most features to be more wiki-agnostic.
=== Work in progress ===
==== Revise Tone Structured Task ====
The Growth team is making progress on [[mw:Special:MyLanguage/Growth/Revise Tone|the technical architecture, onboarding design, and early user testing]].
We are targeting an A/B test before the end of this year, with constructive edits by newcomers as the primary success metric.
==== Add a link to more wikis ====
The machine learning team has been working on a new model that can suggest links to more languages, including Urdu, Chinese, and Japanese Wikipedias. [[phab:T404460|We are starting to release]] the “Add a Link” feature to Wikipedias that weren’t supported by the previous model.
[[mw:Help:Growth/Tools/Add a link|Add a link]], which can be [[mw:Help:Growth/Tools/Add_a_link#Configuration|configured by the community locally]], increases the chance that a new contributor will make their first edit and then continue to participate in Wikipedia.
=== Research ===
The Growth team is involved in several research initiatives to help guide our future work:
[[mw:Growth/Progression System|Progression System]] – We have [[mw:Growth/Progression_System#Design_Research|published]] initial findings from interviews with 10 English and French Wikipedia newcomers.
The research examined motivations, challenges, and feedback on a prototype system intended to help editors build confidence, develop skills, and contribute more constructively over time.
[[mw:Special:MyLanguage/Contributors/Mobile Web Editing Research|Mobile Web Editing Research]] – This project combines quantitative and qualitative data, community feedback, and user journey analysis to identify possible ways to enhance the mobile editing experience.
[[m:Special:MyLanguage/Research:Successful Newcomers Survey 2025|Newcomers Survey]] – This project surveys successful newcomers on English Wikipedia to understand their early editing experiences, tool use, and community interactions.
=== Community events ===
The Growth team participated in several community events to listen, share, and collaborate on improving newcomer experiences across Wikimedia projects.
'''Wikimania - [https://wikimedia.eventyay.com/talk/wikimania2025/talk/RPBSEF/ Organizers as key partners to support newcomers' growth in our movement]'''
This session invited organizers to share how they introduce newcomers to Growth features and the challenges they encounter. The discussion focused on common newcomer questions and opportunities to strengthen collaboration in supporting new editors.
'''Wikimania - [https://wikimedia.eventyay.com/talk/wikimania2025/talk/review/VCSCUVJCGFRNY89TTKXRVFMGYMWPMSXT Lightning Talk: Structured Tasks]'''
This talk demonstrated how Structured Tasks help newcomers take their first successful steps on Wikipedia. It shared impact data, community configurations, and a demo of “Add a Link,” illustrating how these tasks make editing more accessible and sustainable, particularly for mobile contributors.
'''Wikimania - [https://wikimedia.eventyay.com/talk/wikimania2025/talk/TVCVAB/ Building a Sustainable Future for Wikimedia Contributors]'''
With active editor numbers declining, the [[mw:Special:MyLanguage/Contributors/Strategy|Contributors Strategy]] aims to create a clearer, more engaging path for participation. This session, led by the WMF Contributors group with involvement from the Editing, Growth, Moderator Tools, and Connection (formerly Campaigns) teams, highlighted efforts to streamline contributor experiences, offer structured and mobile-friendly workflows, and foster meaningful engagement. Participants learned about ongoing initiatives and shared feedback to help shape a more inclusive and sustainable future for Wikimedia contributors.
'''CEE Meeting - [[metawiki:Wikimedia_CEE_Meeting_2025/Submissions/Retaining_beginners_and_improving_content_moderation:_an_inclusive_and_sustainable_future_for_Wikipedia_contributors|Retaining beginners and improving content moderation: an inclusive and sustainable future for Wikipedia contributors]]'''
Many communities face a decline in volunteer engagement. Newcomers often leave soon after joining, while experienced editors struggle to manage increasingly complex workflows and overwhelming backlogs. We presented the [[mw:Special:MyLanguage/Contributors/Strategy|Contributors Strategy]] and the different features and workflows that can help communities to address these challenges. We listened to the specific needs of the CEE communities to help guide the Contributors teams' work.
''<small>'''[[mw:Special:MyLanguage/Growth/Newsletters|Growth team's newsletter]]''' prepared by [[mw:Special:MyLanguage/Growth|the Growth team]] and posted by [[m:User:MediaWiki message delivery|bot]] • [[mw:Talk:Growth|Give feedback]] • [[m:Special:MyLanguage/Global message delivery/Targets/Growth team updates|Subscribe or unsubscribe]].</small>''
</div> 10:23, 22 Oktubre 2025 (UTC)
<!-- Message sent by User:Trizek (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Growth_team_updates&oldid=29457883 -->
== <span lang="en" dir="ltr">Tech News: 2025-44</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W44"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/44|Translations]] are available.
'''Updates for editors'''
* The Wikipedia iOS app has launched an A/B/C test of improvements made to the tabbed browsing feature for select regions and languages. The test, named “More dynamic tabs”, explores new tab experiences and includes “Did you know” and “Because you read” article recommendations. You can [[mw:Special:MyLanguage/Wikimedia Apps/Team/iOS/Tabbed Browsing (Tabs)/New Tab Experience and Recommendations Experiment|read more on the project page]].
* Autoconfirmed users on [[git:operations/mediawiki-config/+/a2d2aaab9ace84280dd2f4c70a33bb69cd73850f/dblists/small.dblist|small]] and [[git:operations/mediawiki-config/+/a2d2aaab9ace84280dd2f4c70a33bb69cd73850f/dblists/medium.dblist|medium wikis]] with the CampaignEvents extension can now use [[m:Special:MyLanguage/Event Center/Registration|Event Registration]] without the Event Organizer right. This feature lets organizers enable registration, manage participants, and lets users register with one click instead of signing event pages.
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:31}} community-submitted {{PLURAL:31|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the issue of flashing colors when holding or pressing the arrow keys under the dark mode settings in Vector 2022 has been fixed. [https://phabricator.wikimedia.org/T402285]
'''Updates for technical contributors'''
* The CampaignEvents extension will be deployed to all remaining wikis during the week of 17 November 2025. The extension currently includes three features: Event Registration, Collaboration List, and Invitation List. For this rollout, Invitation List will not be enabled on Wikifunctions and MediaWiki unless requested by those communities. [[m:Special:MyLanguage/CampaignEvents/Deployment status|Visit the deployment page to learn more]].
* The SwaggerUI-based REST sandbox experience is now live on all wiki projects. The sandbox can be accessed through the [[{{#special:RestSandbox}}]] page. Please report any issues to the MediaWiki Interfaces team board, or join the discussion on the [[mw:Special:MyLanguage/MediaWiki Interfaces Team/Feature Feedback/REST Sandbox|project launch]] page. [https://phabricator.wikimedia.org/project/board/6931/]
* Transform endpoints with a trailing slash path in the MediaWiki REST API are now marked as deprecated. They will remain functional during this time, but removal is expected by the end of January 2026. All API users currently calling them are encouraged to transition to the non-trailing slash versions. Both endpoint variations can be found and tested using the [https://test.wikipedia.org/w/index.php?api=mw-extra&title=Special%3ARestSandbox REST Sandbox]. See the [[mw:API/Deprecation|MediaWiki REST API Deprecation]] page for more detailed information about the API deprecation policies and procedures.
* A dedicated [[mw:API:REST API/Changelog|changelog now exists for the MediaWiki REST API]]. The changelog provides an overview of these changes, making it easier for developers to keep track of improvements and iterations. Announcements will also continue to flow through the standard communication channels, including Tech News and email distribution lists, but can now be more easily referenced from a central location. If you have feedback about the style, structure, or content of this changelog, please [[mw:API talk:REST API/Changelog|join the discussion]].
* Administrators can delete the tracking category which was previously added by the JsonConfig extension, as it is no longer used. See the categories linked from [[d:Q130635582#sitelinks-wikipedia|Q130635582]]. It is OK if there are still pages listed in the category as that is just a caching issue, and they will be automatically cleared out the next time each page is edited. [https://phabricator.wikimedia.org/T378352]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.25|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/44|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W44"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 19:27, 27 Oktubre 2025 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29513638 -->
== <span lang="en" dir="ltr">Seeking volunteers to join several of the movement’s committees</span> ==
<div lang="en" dir="ltr">
<section begin="announcement-content" />
Each year, typically from October through December, several of the movement’s committees seek new volunteers.
Read more about the committees on their Meta-wiki pages:
* [[m:Special:MyLanguage/Affiliations Committee|Affiliations Committee (AffCom)]]
* [[m:Special:MyLanguage/Ombuds commission|Ombuds commission (OC)]]
* [[m:Special:MyLanguage/Wikimedia Foundation/Legal/Community Resilience and Sustainability/Trust and Safety/Case Review Committee|Case Review Committee (CRC)]]
Applications for the committees open on October 30, 2025. Applications for the Affiliations Committee, Ombuds commission and the Case Review Committee close on December 11, 2025. Learn how to apply by [[m:Special:MyLanguage/Wikimedia Foundation/Legal/Committee appointments|visiting the appointment page on Meta-wiki]]. Post to the talk page or email cst[[File:At sign.svg|16x16px|link=|(_AT_)]]wikimedia.org with any questions you may have.
For the Committee Support team,
<section end="announcement-content" />
</div>
-[[m:User:MKaur (WMF)| MKaur (WMF)]] 14:12, 30 Oktubre 2025 (UTC)
<!-- Message sent by User:MKaur (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Distribution_list/Global_message_delivery&oldid=29517125 -->
== <span lang="en" dir="ltr">Tech News: 2025-45</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W45"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/45|Translations]] are available.
'''Updates for editors'''
* Administrators will now find that [[{{#special:MergeHistory}}]] is now significantly more flexible about what it can merge. It can now merge sections taken from the middle of the history of the source (rather than only the start) and insert revisions anywhere in the history of the destination page (rather than only the start). [https://phabricator.wikimedia.org/T382958]
* For users with "{{int:discussiontools-preference-autotopicsub}}" [[Special:Preferences#mw-prefsection-editing|enabled in their preferences]], starting a new topic or adding a reply to an existing topic will now subscribe them to replies to that topic. Previously, this would only happen if the DiscussionTools "{{int:Skin-action-addsection}}" or "{{int:Discussiontools-replybutton}}" widgets were used. When DiscussionTools was originally launched existing accounts were not opted in to automatic topic subscriptions, so this change should primarily affect newer accounts and users who have deliberately changed their preferences since that time. [https://phabricator.wikimedia.org/T290778]
* Scribunto modules can now be used to [[mw:Special:MyLanguage/Extension:Scribunto/Lua reference manual#SVG library|generate SVG images]]. This can be used to build charts, graphics and other visualizations dynamically through Lua, reducing the need to compose them externally and upload them as files. [https://phabricator.wikimedia.org/T405861]
* Wikimedia sites now provide all anonymous users with the option to enable a dark mode color scheme, featuring light-colored text on a dark background. This enhancement aims to deliver a more enjoyable reading experience, especially in dimly lit environments. [https://phabricator.wikimedia.org/T395628]
* Users with large watchlists have long faced timeouts when editing [[Special:EditWatchlist|Special:EditWatchlist]]. The page now loads entries in smaller sections instead of all at once due to a paging update, allowing everyone to edit their watchlists smoothly. As part of the database update, sorting by expiry has been removed because it was over 100× slower than sorting by title. A [https://meta.wikimedia.org/wiki/Community_Wishlist/W454 community wish] has been created to explore alternative ways to restore sort-by-expiry. If this feature is important to you, please support the wish! [https://phabricator.wikimedia.org/T41510]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:31}} community-submitted {{PLURAL:31|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the fixing of the persisting highlighting when using VisualEditor find and replace during a query. [https://phabricator.wikimedia.org/T407318]
'''Updates for technical contributors'''
* Since 2019 the [[m:Special:MyLanguage/Wikimedia URL Shortener|Wikimedia URL Shortener]] at https://w.wiki is available for all Wikimedia wikis to create short links to articles, permalinks, diffs, etc. It is available in the sidebar as "Get shortened URL". There are 30 wikis that also install an older "ShortUrl" extension. The old extension will soon be removed. This means <code>/s/</code> URLs will not be advertised under article titles via HTML <code dir=ltr>class="title-shortlink"</code>. The <code>/s/</code> URLs will keep working. [https://phabricator.wikimedia.org/T107188]
* On Thursday, October 30, the [[:mw:Special:MyLanguage/MediaWiki Interfaces Team|MediaWiki Interfaces]] and [[:mw:Special:MyLanguage/Wikimedia Site Reliability Engineering|SRE Service Operations]] teams began rerouting Action API traffic through a common API gateway. Individual wikis will be updated based on the standard release groups, with total traffic increased over time. This change is expected to be non-breaking and non-disruptive. If any issues are observed, please file a Phabricator ticket to the [https://phabricator.wikimedia.org/tag/serviceops/ Service Ops team] board.
* MediaWiki Train deployments will pause for the final two weeks of 2025: 22 December and 29 December. Backport windows will also pause between Monday, 22 December 2025 and Thursday, 2 January 2026. A backport window is a scheduled time to add things like bug fixes and configuration changes. There are seven deployment trains remaining for 2025. [https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/SMWTEAES4SDLDUSK4HMWNBSKNCXZAWYN/]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.45/wmf.26|MediaWiki]]
'''In depth'''
* In 2025, the Wikimedia Foundation reported that AI systems and search engines increasingly use Wikipedia content without driving users to the site, contributing to an 8% drop in human pageviews compared to 2024. After detecting bots disguised as humans, Wikimedia updated its traffic data to reflect this shift. Read more about current user trends on Wikipedia in [[diffblog:2025/10/17/new-user-trends-on-wikipedia/|a Diff blog post]].
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/45|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W45"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 19:30, 3 Nobiyembre 2025 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29552512 -->
== <span lang="en" dir="ltr">Tech News: 2025-46</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W46"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/46|Translations]] are available.
'''Updates for editors'''
[[File:Talk pages default look (April 2023).jpg|thumb|alt=Screenshot of the visual improvements made on talk pages|Example of a talk page with the new design, in French.]]
* Starting November 12, users will see a change in the [[m:Special:MyLanguage/Talk pages project/Feature summary#Usability improvements|appearance of talk pages]] on [[Phab:T379264|some Wikipedias]]. Almost [[phab:T392121|all wikis]] have received this design change; [[phab:T409297|English Wikipedia]] will get these changes later. You can read more [[diffblog:2024/05/02/making-talk-pages-better-for-everyone/|on ''Diff'']]. Users can opt out of these changes [[Special:Preferences#mw-prefsection-editing|in their user preferences]] in "{{int:discussiontools-preference-visualenhancements}}". [https://phabricator.wikimedia.org/T379264]
* MediaWiki can now display a [[mw:Special:MyLanguage/Help:Protection indicators|page indicator]] automatically while a page is protected. This feature is disabled by default. It can be enabled by [[m:Special:MyLanguage/Requesting wiki configuration changes|community request]]. [https://phabricator.wikimedia.org/T12347]
* Using the "{{int:showpreview}}" or "{{int:showdiff}}" buttons in the wikitext editor will now carry over certain URL parameters like '[[mw:Special:MyLanguage/Manual:Parameters to index.php#useskin|useskin]]', '[[mw:Special:MyLanguage/Manual:Parameters to index.php#uselang|uselang]]' and '[[mw:Special:MyLanguage/Help:Section#Editing sections|section]]'. This update also fixes an issue where, if the browser crashed while previewing an edit to a single section, saving this edit could overwrite the entire page with just that section’s content. [https://phabricator.wikimedia.org/T62744][https://phabricator.wikimedia.org/T24029][https://phabricator.wikimedia.org/T155097]
* Wikivoyage wikis can use [[mw:Special:MyLanguage/Help:Extension:Kartographer#Markers and counters|colored map markers in the article text]]. The text of these markers will now be shown in contrasting black or white color, instead of always being white. Local workarounds for the problem can be removed. [https://phabricator.wikimedia.org/T369454]
* The Activity tab in the Wikipedia Android app is now available for all users. The new tab offers personalized insights into reading, editing, and donation activity, while simplifying navigation and making app use more engaging. [https://www.mediawiki.org/wiki/Wikimedia_Apps/Team/Android/Activity_Tab_Experiment]
* The Reader Growth team is launching an experiment called "Image browsing" to test how to make it easier for readers to browse and discover images on Wikipedia articles. This experiment, a mobile-only A/B test, will go live on English Wikipedia in the week of November 17 and will run for four weeks, affecting 0.05% of users on English wiki. The test launched on November 3 on Arabic, Chinese, French, Indonesian, and Vietnamese wikis, affecting up to 10% of users on those wikis. [https://www.mediawiki.org/wiki/Readers/Reader_Growth/WE3.1.3_Image_Browsing]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:27}} community-submitted {{PLURAL:27|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example the inability to lock accounts on mobile sites has been fixed. [https://phabricator.wikimedia.org/T256185]
'''Updates for technical contributors'''
* [[wikitech:Help talk:Toolforge/Toolforge standards committee#November 2025 committee nominations|Nominations are open on Wikitech]] for new [[wikitech:Help:Toolforge/Toolforge standards committee|Toolforge standards committee]] members. The committee oversees the Toolforge [[wikitech:Help:Toolforge/Right to fork policy|Right to fork policy]] and [[wikitech:Help:Toolforge/Abandoned tool policy|Abandoned tool policy]] among other duties. Nominations will remain open through 2025-11-28.
* The [[w:JSON Web Token#Standard fields|JWT issuer field]] in [[mw:Special:MyLanguage/OAuth/For Developers#OAuth 2|OAuth 2 access tokens]] for [[m:Special:MyLanguage/Help:Unified login|SUL wikis]] has been changed to <code><nowiki>https://meta.wikimedia.org</nowiki></code>. Old access tokens will still work. [https://phabricator.wikimedia.org/T399199]
* The [[w:JSON Web Token#Standard fields|JWT subject field]] in [[mw:Special:MyLanguage/OAuth/For Developers#OAuth 2|OAuth 2 access tokens]] will soon change from <code><user id></code> to <code dir=ltr style="white-space:nowrap">mw:<identity type>:<user id></code>, where <code><identity type></code> is typically <code dir=ltr>CentralAuth:</code><!-- not a typo --> (for [[m:Special:MyLanguage/Help:Unified login|SUL wikis]]) or <code dir=ltr style="white-space:nowrap">local:<wiki id></code> (for other wikis). This is to avoid conflicts between different user ID types, and to make OAuth 2 access tokens and the <code>sessionJwt</code> cookie more similar. Old access tokens will still work. [https://phabricator.wikimedia.org/T399199]
* MediaWiki's block messages ([[MediaWiki:Blockedtext|blockedtext]], [[MediaWiki:Blockedtext-partial|blockedtext-partial]], [[MediaWiki:Autoblockedtext|autoblockedtext]], [[MediaWiki:Systemblockedtext|systemblockedtext]], [[MediaWiki:Blockedtext-tempuser|blockedtext-tempuser]], [[MediaWiki:Autoblockedtext-tempuser|autoblockedtext-tempuser]]) now support additional parameters indicating whether the user is blocked from editing their own user talk page <code><nowiki>$9</nowiki></code> or emailing other users <code><nowiki>$</nowiki><nowiki>10</nowiki></code>. [https://phabricator.wikimedia.org/T285612]
* A <code>REL1_45</code> branch for MediaWiki core and each of the extensions and skins in Wikimedia git has been created. This is the first step in the release process for MediaWiki 1.45.0, scheduled for late November 2025. If you are working on a critical bug fix or working on a new feature, you may need to take note of this change. [https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/ZUY7TY3Z6XPZWZVAZV63OPO5OW52Q6GE/]
* The process for generating CirrusSearch dumps has been updated due to slowing performance. If you encounter any issues migrating to the replacement dumps, please contact the Search Platform Team for support. [https://phabricator.wikimedia.org/T366248][https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/3KQPOR6ACVN6OVLMLZPIBXQSWQKW4E3K/]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.2|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/46|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W46"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 20:35, 10 Nobiyembre 2025 (UTC)
<!-- Message sent by User:UOzurumba (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29606150 -->
== <span lang="en" dir="ltr">Tech News: 2025-47</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W47"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/47|Translations]] are available.
'''Updates for editors'''
* The [[mw:Special:MyLanguage/Readers/Reader Experience|Reader Experience team]] is experimenting with [[mw:Special:MyLanguage/Readers/Reader Experience/WE3.3.4_Reading lists|reading lists on mobile web]], allowing logged-in readers with no edits to save private lists of articles for later. The experiment is running on Arabic, Chinese, French, Indonesian, and Vietnamese Wikipedias since the week of 10 November, and will begin on English Wikipedia the week of 17 November.
* Users who can’t receive their email verification code during login can now get help by submitting a form on a new special page. This update is part of the [[mw:Special:MyLanguage/Product Safety and Integrity/Account Security|Account Security]] initiative. If your account has an email address, please make sure you still have access to it. When logging in from a new device or location without 2FA, you may be asked to enter a 6-digit code sent by email to finish logging in. [[mw:Special:MyLanguage/Product Safety and Integrity/Account Security#Why are you requiring me to enter a code from my email to log in? Can I opt out of this?|Learn more]].
* One new wiki has been created: a {{int:project-localized-name-group-wikisource}} in [[d:Q13324|Minangkabau]] ([[s:min:|<code>s:min:</code>]]) [https://phabricator.wikimedia.org/T408317]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:23}} community-submitted {{PLURAL:23|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]].
'''Updates for technical contributors'''
* As part of the [[mw:Special:MyLanguage/Parsoid/Parser Unification|Parser Unification]] project, the Content Transform Team rolled out Parsoid as the default parser to many low-traffic Wikipedias and is preparing the next step to high traffic ones. This message is an invitation for you to opt-in to Parsoid, as described in the [[mw:Special:MyLanguage/Help:Extension:ParserMigration|Extension:ParserMigration]] documentation, and identify any issues you might encounter with your own workflow using bots, gadgets, or user scripts. Please, let us know through the ''"Report Visual Bug"'' link in the Tools sidebar or create a phab ticket and tag the [[phab:project/view/5846|Content Transform Team in Phabricator]].
* Unsupported Tools: Several issues with [[:c:Special:MyLanguage/Commons:Video2commons|Video2Commons]] have been fixed, including filename-related upload failures, black-video imports, and retry handling. AV1 support has also been added. Ongoing work focuses on backend stability, ffmpeg errors, subtitle imports, metadata handling, and playlist uploads. To track specific tasks, check the [[phab:tag/video2commons/|Phabricator board]].
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.3|MediaWiki]]
'''Meetings and events'''
* Save the date for the next Wikimedia Hackathon happening in Milan, Italy from May 1–3, 2026. Registration will open in January 2026. [https://pretix.eu/wikimedia/Hackathon-2026/ Scholarship applications are currently open], and will close on November 28, 2025. If you have any questions, please email <bdi lang="en" dir="ltr">hackathon@wikimedia.org</bdi>.
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/47|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W47"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 17:23, 17 Nobiyembre 2025 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29627455 -->
== <span lang="en" dir="ltr">Reminder: Help us decide the name of the new Abstract Wikipedia project</span> ==
<div lang="en" dir="ltr">
<section begin="function2"/>
{{int:Hello}}. Reminder: Please help to choose name for the new Abstract Wikipedia wiki project. The finalist vote starts today. The finalists for the name are: <span lang="en" dir="ltr" class="mw-content-ltr">Abstract Wikipedia, Multilingual Wikipedia, Wikiabstracts, Wikigenerator, Proto-Wiki</span>. If you would like to participate, then '''[[m:Special:MyLanguage/Abstract Wikipedia/Abstract Wikipedia naming contest|please learn more and vote now]]''' at meta-wiki.
{{Int:Feedback-thanks-title}}
<section end="function2"/>
</div>
-- [[User:Sannita (WMF)|User:Sannita (WMF)]] ([[User talk:Sannita (WMF)|talk]]) 14:22, 20 Nobiyembre 2025 (UTC)
<!-- Message sent by User:Sannita (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Distribution_list/Global_message_delivery&oldid=29583860 -->
== <span lang="en" dir="ltr">Tech News: 2025-48</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W48"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/48|Translations]] are available.
'''Updates for editors'''
* Last week, the [[mw:Special:MyLanguage/Wikimedia Search Platform|Wikimedia Search Team]] recreated the "DWIM" (Do What I Mean) gadget functionality server-side, for Russian and Hebrew Wikipedias. This feature adds cross-keyboard suggestions to the standard search-box suggestions. For example, searching for ''<span lang="und" dir="ltr">cxfcnmt</span>'' on Russian Wikipedia will now add suggestions for ''<span lang="ru" dir="ltr">счастье</span>'' ("happiness") that the user probably intended. They plan to enable this feature for other Russian and Hebrew wikis this week. [https://phabricator.wikimedia.org/T408734]
* Later this week, users of the "{{int:codemirror-beta-feature-title}}" [[Special:Preferences#mw-prefsection-betafeatures|beta feature]] will have syntax highlighting available in [[mw:Special:MyLanguage/Help:DiscussionTools|DiscussionTools]]. This requires that the "{{int:discussiontools-preference-sourcemodetoolbar}}" preference be set. [https://phabricator.wikimedia.org/T407918]
* [[mw:Special:MyLanguage/Help:Extension:CampaignEvents|Campaign events extension]] – the set of tools for coordinating events and other on-wiki collaborations has now been deployed to all Wikimedia wikis. A new feature known as [[m:Special:MyLanguage/CampaignEvents/Collaborative contributions|Collaborative contribution]] to help organizers and participants see the impact of activities has also been added. Join the upcoming [[m:Special:MyLanguage/Event:Connection learning session 3|learning session]] to see the new feature in action and share your feedback.
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:24}} community-submitted {{PLURAL:24|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the bug which stopped CodeReviewBot from working, has now been fixed. [https://phabricator.wikimedia.org/T410417]
'''Updates for technical contributors'''
* Users of Wikimedia API can join a usability study to help validate the new design of Wikimedia REST API sandboxes. Interested participants should fill the [https://wikimediafoundation.limesurvey.net/487662 recruitment survey]. [https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/IREJRRWTZTGCYWQHDMSNJFTQAEPOOAE3/]
* The MediaWiki Interfaces team is deprecating XSLT stylesheets within the Action API. Support for <code dir=ltr>format=xml'''&xlst={stylesheet}'''</code> will be removed from Wikimedia projects by the end of November, 2025. In addition, it will soon be disabled by default in MediaWiki release versions: v1.43 (LTS), v1.44, and v1.45. Support for XSLT stylesheets will be fully removed from MediaWiki v1.46 (expected to release between April and May 2026). [https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/5AX7UWAVVUNUSBOIRHMNOKWOZ5EZI3JX/]
* The WDQS legacy endpoint ([https://query-legacy-full.wikidata.org/ query-legacy-full.wikidata.org]) will be decommissioned at the end of December 2025, and finally closed down on 7th January 2026. After this date, users should expect requests to query.wikidata.org that require the full graph to fail or return invalid results if they are not rewritten to use SPARQL federation. The team encourages users to ensure that tools and workflows use the supported WDQS endpoints (<span dir=ltr><nowiki>https://query.wikidata.org/</nowiki></span> - Main graph or <span dir=ltr><nowiki>https://query-scholarly.wikidata.org/</nowiki></span> - Scholarly graph). For support with migrating use cases, please review the [[d:Special:MyLanguage/Wikidata:Data_access|Data Access]] and [[d:Wikidata:Request_a_query|Request a Query]] pages for details and assistance on alternative access methods.
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.4|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/48|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W48"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 15:54, 24 Nobiyembre 2025 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29702226 -->
== <span lang="en" dir="ltr">Tech News: 2025-49</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W49"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/49|Translations]] are available.
'''Updates for editors'''
* The Wikipedia Year in Review 2025 will be available on December 2 for users of iOS and Android Wikipedia apps, featuring new personalized insights, updated reading highlights, and refreshed designs. Learn more on the review's [[mw:Special:MyLanguage/Wikimedia Apps/Team/Wikipedia Year in Review/Updates|project page]].
* The Growth team is working on improving the text and presentation of the Verification Email sent to new users to make them more welcoming, useful and informative. Some new text have been drafted for A/B testing and you can help by translating them. See [[phab:T396155|Phabricator]].
* [[mw:Special:MyLanguage/Help:Growth/Tools/Add a link|Add a link]] will now be deployed at Japanese, Urdu and Chinese Wikipedias on December 2. Add a link is based on a prediction model that suggests links to be added to articles. While this feature has already been available on most Wikipedias, the prediction model could not support certain languages. A new model has now been developed to handle these languages, and it will be gradually rolled out to other Wikipedias over time. If you would like to know more, please contact [[mw:user:Trizek (WMF)|Trizek (WMF)]].
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:34}} community-submitted {{PLURAL:34|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the issue where search boxes on some Commons pages showed no results due to switch from SpecialSearch to MediaSearch, has now been fixed. [https://phabricator.wikimedia.org/T399476]
* Two new wikis have been created:
** a {{int:project-localized-name-group-wikipedia}} in [[d:Q36846|Toki Pona]] ([[w:tok:|<code>w:tok:</code>]]) [https://phabricator.wikimedia.org/T404457]
** a {{int:project-localized-name-group-wikiquote}} in [[d:Q33655|Nigerian Pidgin]] ([[q:pcm:|<code>q:pcm:</code>]]) [https://phabricator.wikimedia.org/T408318]
'''Updates for technical contributors'''
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.5|MediaWiki]]
'''In depth'''
* The Wikimedia Foundation is in the early stages of exploring approaches to '''Article guidance'''. The initiative aims to identify interventions that could help new editors easily understand and apply existing Wikipedia practices and policies when creating an article. The project is in the exploration and early experimental design phase. All community members are encouraged to [[mw:Special:MyLanguage/Article guidance|learn more]] about the project, and share their thoughts on [[mw:Special:MyLanguage/Talk:Article guidance|the talk page]].
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/49|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W49"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 18:55, 1 Disyembre 2025 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29732328 -->
== <span lang="en" dir="ltr">Tech News: 2025-50</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W50"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/50|Translations]] are available.
'''Weekly highlight'''
* Anybody who wishes to secure their user account can now use [[m:Special:MyLanguage/Help:Two-factor authentication|two-factor authentication]] (2FA). This is available to all registered users of all Wikimedia projects. This is part of the [[mw:Special:MyLanguage/Product Safety and Integrity/Account Security|Account Security]] initiative. Later, 2FA will be required for all users who can take security- or privacy-sensitive actions.
'''Updates for editors'''
* Following last week's deployments, the [[mw:Special:MyLanguage/Help:Growth/Tools/Add a link|Add a link]] feature, which allows editors to add suggested links during editing, will be available to an additional [[Phab:T410469|33 Wikipedias]] starting on 9 December. This expansion is possible thanks to the new prediction model that now supports all languages, including those that were previously not covered. While the feature has been available on most Wikipedias for some time, this rollout brings us closer to using the improved model everywhere. If you have any questions or would like more details please contact [[mw:user:Trizek (WMF)|Trizek (WMF)]].
* Last week, the [[mw:Special:MyLanguage/Wikimedia Search Platform|Search Platform team]] added [[w:en:Transliteration|transliterated]] as-you-type search suggestions to Georgian wikis. If there are only a few regular search suggestions, then queries in Latin or Cyrillic script [[phab:T127003|are now rewritten into Georgian script]] to look for more matches. For example, searching for either <bdi lang="ka-Latn" dir="ltr">''bedniereba''</bdi> or <bdi lang="ka-Cyrl" dir="ltr">''бедниереба''</bdi> will now suggest the existing article about <bdi lang="ka" dir="ltr">ბედნიერება</bdi> ("happiness"). You can recommend other languages where transliterated suggestions would be useful [[phab:T375215|on Phabricator]] for future development.
* Later this week, a controlled experiment will begin for editors on the 100 largest Wikipedias who are editing a section in the mobile web visual editor. 50% of these editors will notice a new "Edit full page" button that will enable them to expand their editing session to the whole page. This feature is intended to make it easier for people on mobile web to edit any article section, regardless of which section-edit icon they tapped to begin. The experiment will last ~4 weeks. You can find [[phab:T409112|more details]] about the project.
* Later this week, the [[mw:Special:MyLanguage/Readers/Reader Growth|Reader Growth team]] will launch a [[mw:Special:MyLanguage/Readers/Reader Growth/WE3.1.14 Expanded Mobile Sections|mobile web experiment]] to expand all article sections by default (currently they are collapsed by default) and pin the section header the user is currently reading to the top of the page. The experiment will affect 10% of users on Arabic, Chinese, French, Indonesian, and Vietnamese Wikipedias. [https://phabricator.wikimedia.org/T409485]
* The [[mw:Special:MyLanguage/Wikimedia Apps/Team/Wikipedia Year in Review/2025 Year in Review|Wikipedia Year in Review 2025]], a feature in the Wikipedia mobile apps (iOS and Android) that provides users with a personalised summary of their engagement with Wikipedia over the year, is now available on the iOS and Android apps. This edition includes expanded personalised insights, improved reading highlights, new donor messaging, and updated designs. Open the app to view your Year in Review and explore your reading journey from 2025.
* A recent software bug caused edits made with VisualEditor to make unintended changes to wikitext, including removing whitespace and replacing spaces with underscores in wikilinks inside citations. This was partially fixed last week, and further fixes are in progress. Editors who used VisualEditor between November 28 and December 2 should review their edits for unexpected modifications. [https://phabricator.wikimedia.org/T411238]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:23}} community-submitted {{PLURAL:23|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the incorrect handling of URLs copied from the address bar of Microsoft Edge users, has been resolved. [https://phabricator.wikimedia.org/T341281]
'''Updates for technical contributors'''
* Starting this week, users of the "{{int:codemirror-beta-feature-title}}" [[Special:Preferences#mw-prefsection-betafeatures|beta feature]] will have [[mw:Special:MyLanguage/Help:Extension:CodeMirror|CodeMirror]] as the editor for Lua, JavaScript, CSS, JSON and Vue content models, instead of [[mw:Special:MyLanguage/Extension:CodeEditor|CodeEditor]]. With this, the [[mw:Special:MyLanguage/Help:Extension:CodeMirror#Linting|linters]] will be upgraded. This is part of a larger effort to eventually replace CodeEditor and provide a consistent code editing experience. [https://phabricator.wikimedia.org/T373711]
* Developers are encouraged to take the [https://wikimediafoundation.limesurvey.net/552643 2025 Developer Satisfaction Survey], which remains open until 5 January 2026. If you build software for the Wikimedia ecosystem and would like to share your experiences or feedback, your participation is greatly appreciated. [https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/W4WBKO6Q55UWWCCSFWQATKEXBEHP3QNR/]
* There is no new MediaWiki version this week.
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/50|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W50"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 17:42, 8 Disyembre 2025 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29738112 -->
== <span lang="en" dir="ltr">Tech News: 2025-51</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W51"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/51|Translations]] are available.
'''Updates for editors'''
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:18}} community-submitted {{PLURAL:18|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, one of the fixes addressed an issue for temporary accounts adding an external URL, which triggered an hCaptcha request in more cases than intended, and did not display the required popup on the first attempt to publish the edit. [https://phabricator.wikimedia.org/T411927]
'''Updates for technical contributors'''
* To improve database and site performance, external links to Wikimedia projects will no longer be stored in the database. This means they will not be searchable in [[{{#special:LinkSearch}}]], will not be checked by the Spam Blacklist or AbuseFilter as new links, and will not be in the <code dir=ltr>externallinks</code> table on database replicas. In the future this may be extended to other highly-linked trusted websites on a per-wiki basis, such as Creative Commons links on Wikimedia Commons. [https://phabricator.wikimedia.org/T405005]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.7|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/51|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W51"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 19:00, 15 Disyembre 2025 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29796010 -->
== Wikipedia will be having a 25th birthday party in Metro Manila! ==
[[File:WP25 Birthday cake.gif|right|140px]]
Hi, everyone!
Wikipedia is having its [[M:Wikipedia 25|25th birthday]] this 2026. To celebrate, we're holding a '''Wikipedia birthday party''' on '''January 18, 2026''' (Sunday), 1:00 p.m. at '''Shakey's Eton Centris''' in Diliman, [[Quezon City]]! Everyone in and around Metro Manila is welcome to join us, whether you have over 10,000 edits or are just starting out. We'll be having a mini edit-a-thon at the meetup, so ideally bring a device that you can comfortably edit in. Aside from that, just bring yourself and your excitement! We'll take care of the food, venue, and the birthday cake. If you're coming from in and around Metro Manila, we may also reimburse some of your local transport costs. For more details, you can view the '''[[m:Event:Wikipedia 25/Manila|event page]] on Meta-Wiki'''.
If you'd like to join in, please '''[[m:Event:Wikipedia 25/Manila|register on the event page]]'''. If you have any questions or comments, feel free to reply here, message us on our talk pages, or send [[Special:EmailUser/Chlod|me]] or [[Special:EmailUser/Chipmunkdavis|Chipmunkdavis]] an email. We look forward to seeing you there! -- from [[User:Chipmunkdavis|CMD]] ([[User talk:Chipmunkdavis|talk]]) and [[Gumagamit:Chlod|Chlod]] ([[Hisgot sa Gumagamit:Chlod|talk]]) 06:05, 17 Disyembre 2025 (UTC)
== <span lang="en" dir="ltr">Tech News: 2025-52</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2025-W52"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2025/52|Translations]] are available.
'''Updates for editors'''
* From January, edit filters [[mw:Special:MyLanguage/Extension:AbuseFilter/Access flags|can be set]] to automatically suppress their details such as rules and list of attempted edits and actions. This will help oversighters use edit filters to prevent doxxing or other suppressible material. [https://phabricator.wikimedia.org/T290324]
* The next issue of Tech News will be sent out on 12 January 2026 because of the end of year holidays. Thank you to all of the translators, and people who submitted content or feedback, this year.
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:16}} community-submitted {{PLURAL:16|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the crash that occurred when tapping "First Steps" in the Wikipedia Android Year in Review has now been fixed, and the feature opens as expected. [https://phabricator.wikimedia.org/T411546]
'''Updates for technical contributors'''
* Interface elements such as diffs and categories generated by MediaWiki used to have the attribute <code dir=ltr>data-mw="interface"</code> to distinguish from wiki content. The attribute has been replaced with <code dir=ltr>data-mw-interface=""</code>, to avoid potential conflicts with other <code dir=ltr>data-mw</code> attributes, which are generated by Parsoid. [https://phabricator.wikimedia.org/T409187]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] There is no new MediaWiki version this week or next week.
'''Meetings and events'''
* The [[mw:Wikimedia Hackathon Northwestern Europe 2026|Wikimedia Hackathon Northwestern Europe 2026]] will take place on 13-14 March 2026 in Arnhem, the Netherlands. Applications just opened mid-December and will close in mid-January or earlier if capacity is reached. With space for approximately 100 participants, early application is encouraged.
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2025/52|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2025-W52"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 21:42, 22 Disyembre 2025 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29831856 -->
== <span lang="en" dir="ltr">Migration to Parsoid</span> ==
<div lang="en" dir="ltr">
<section begin="announcement-content" />
<em>[[m:Special:MyLanguage/Wikimedia Foundation/Product and Technology/Parsoid Read Views/Read View Announcement|Read this in another language]]</em>
Hello everyone! I am glad to inform you that as the next step in the [[mw:Special:MyLanguage/Parsoid/Parser Unification|Parser Unification]] project, Parsoid will soon be turned on as the default article renderer on your wiki. We are gradually increasing the number of wikis using Parsoid, with the intention of making it the default wikitext parser for MediaWiki's next long-term support release. This will make our wikis more reliable and consistent for editors, readers, and tools to use, as well as making the development of future wikitext features easier.
If this disrupts your workflow, don’t worry! You can still opt out through a user preference or turn Parsoid off on the current page using the Tools submenu, as described in the [[mw:Special:MyLanguage/Help:Extension:ParserMigration|Extension:ParserMigration]] documentation.
There is [[mw:Special:MyLanguage/Parsoid/Parser Unification/Confidence Framework|more information about our roll-out strategy]] available, including the testing done before we turn on Parsoid for a new wiki.
To report bugs and issues, please look at our [[mw:Special:MyLanguage/Parsoid/Parser Unification/Known Issues|known issues]] documentation and if you found a new bug please create a phab ticket and tag the [[phab:project/view/5846|Content Transform Team in Phabricator]].
<section end="announcement-content" />
</div>
<bdi lang="en" dir="ltr">[[mw:User:ABreault (WMF)|Content Transform Team]]</bdi> 00:35, 6 Enero 2026 (UTC)
<!-- Message sent by User:ABreault (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Wikimedia_Foundation/Product_and_Technology/Parsoid_Read_Views/2025-12-22_Wikipedias&oldid=29825860 -->
== <span lang="en" dir="ltr">Tech News: 2026-03</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W03"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/03|Translations]] are available.
'''Weekly highlight'''
* The Wikimedia Foundation has shared some guiding questions for the July 2026–June 2027 Annual Plan on [[m:Special:MyLanguage/Wikimedia Foundation Annual Plan/2026-2027/Product & Technology OKRs|Meta]] and ''[[diffblog:2025/12/10/shaping-wikimedia-foundations-2026-2027-annual-goals-key-questions-for-the-wikimedia-movement/|Diff]]''. These focus on global trends, faster and healthier experimentation, better support for newcomers, strengthening editors and advanced users, improving collaboration across projects, and growing and retaining readership. Feedback and ideas are welcome on the [[m:Talk:Wikimedia Foundation Annual Plan/2026-2027|talk page]].
'''Updates for editors'''
* As part of the current work of Community Tech team on the [[m:Special:MyLanguage/Community Wishlist/W372|Multiple watchlists]] project, the display of [[Special:EditWatchlist|EditWatchlist]] will be updated as a first step towards multiple watchlists. Additionally, the pagination on [[Special:Search|Search]] will be updated too, as a part of the work on the [[m:Special:MyLanguage/Community Wishlist/W186|Revamp pagination / page navigation]] wish. [https://phabricator.wikimedia.org/T411596]
* [[m:Special:GlobalWatchlist|The Global Watchlist]] is a MediaWiki [[mw:Special:MyLanguage/Extension:GlobalWatchlist|extension]] that lets you see your watchlists from different wikis on the same page. It was recently updated to look more like the regular [[Special:Watchlist|Watchlist]], such as preparing it for temporary accounts in IP masking (including rerouting user links to contributions pages), making page titles bold, and opening links in edit summaries and tags in new browser tabs. [https://phabricator.wikimedia.org/T398361][https://phabricator.wikimedia.org/T298919][https://phabricator.wikimedia.org/T273526][https://phabricator.wikimedia.org/T286309]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:28}} community-submitted {{PLURAL:28|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the issue where global blocks did not have the option to disable sending emails, has now been fixed, and will be available for use in the week of January 13. [https://phabricator.wikimedia.org/T401293]
'''Updates for technical contributors'''
* The [[mw:Special:MyLanguage/VisualEditor/Citation tool|VisualEditor citation tool]] and [[mw:Special:MyLanguage/Help:Reference Previews|Reference Previews]] now support "map" as a reference type. [https://phabricator.wikimedia.org/T411083]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.10|MediaWiki]]/[[mw:MediaWiki 1.46/wmf.11|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/03|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W03"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 19:31, 12 Enero 2026 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29907192 -->
== Thank You for Last Year – Join Wiki Loves Ramadan 2026 ==
Dear Wikimedia communities,
We hope you are doing well, and we wish you a happy New Year.
''Last year, we captured light. This year, we’ll capture legacy.''
In 2025, communities around the world shared the glow of Ramadan nights and the warmth of collective iftars. In 2026, ''Wiki Loves Ramadan'' is expanding, bringing more stories, more cultures, and deeper global connections across Wikimedia projects.
We invite you to explore the ''Wiki Loves Ramadan 2026'' [[m:Special:MyLanguage/Wiki Loves Ramadan 2026|Meta page]] to learn how you can participate and [[m:Special:MyLanguage/Wiki Loves Ramadan 2026/Participating communities|sign up]] your community.
📷 ''Photo campaign on '' [[c:Special:MyLanguage/Commons:Wiki Loves Ramadan 2026|Wikimedia Commons]]
If you have questions about the project, please refer to the FAQs:
* [[m:Special:MyLanguage/Wiki Loves Ramadan/FAQ/|Meta-Wiki]]
* [[c:Special:MyLanguage/Commons:Wiki Loves Ramadan/FAQ|Wikimedia Commons]]
''Early registration for updates is now open via the '''[[m:Special:RegisterForEvent/2710|Event page]]'''''
''Stay connected and receive updates:''
* [https://t.me/WikiLovesRamadan Telegram channel]
* [https://lists.wikimedia.org/postorius/lists/wikilovesramadan.lists.wikimedia.org/ Mailing list]
We look forward to collaborating with you and your community.
'''The Wiki Loves Ramadan 2026 Organizing Team''' 19:45, 16 Enero 2026 (UTC)
<!-- Message sent by User:ZI Jony@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Distribution_list/Non-Technical_Village_Pumps_distribution_list&oldid=29879549 -->
== Feminism and Folklore 2026 starts soon ==
<div style="border:8px maroon ridge;padding:6px;">
[[File:Feminism and Folklore 2026 logo.svg|centre|550px|frameless]]
::<div lang="en" dir="ltr" class="mw-content-ltr">
<div style="text-align: center; width: 100%;">''{{int:please-translate}}''</div>
;Invitation to Organize Feminism and Folklore 2026
Dear Wiki Community,
We are pleased to invite Wikimedia communities, affiliates, and independent contributors to organize the '''[[:m:Feminism and Folklore 2026|Feminism and Folklore 2026]]''' writing competition on your local Wikipedia.
The international campaign will run from '''1 February to 31 March 2026''' and aims to improve coverage of feminism, women’s histories, gender-related topics, and folk culture across Wikipedia projects.
;About the Campaign
'''Feminism and Folklore''' is a global writing initiative that complements the '''[[:c:Commons:Wiki Loves Folklore 2026|Wiki Loves Folklore]]''' photography competition. While Wiki Loves Folklore focuses on visual documentation, this writing campaign addresses the '''gender gap on Wikipedia''' by improving encyclopedic content related to folk culture and marginalized voices.
;What Can Participants Write About?
Communities can contribute by creating, expanding, or translating articles related to:
* Folk festivals, rituals, and celebrations
* Folk dances, music, and traditional performances
* Women and queer figures in folklore
* Women in mythology and oral traditions
* Women warriors, witches, and witch-hunting narratives
* Fairy tales, folk stories, and legends
* Folk games, sports, and cultural practices
Participants may work from curated article lists or generate new article suggestions using campaign tools.
;How to Sign Up as an Organizer
Organizers are requested to complete the following steps to register their community:
# Create a local project page on your wiki [[:m:Feminism and Folklore/Sample|(see sample)]]
# Set up the campaign using the '''CampWiz''' tool
# Prepare a local article list and clearly mention:
#* Campaign timeline
#* Local and international prizes
# Request a site notice from local administrators [[:mr:Template:SN-FNF|(see sample)]]
# Add your local project page and CampWiz link to the '''[[:m:Feminism and Folklore 2026/Project Page|Meta project page]]'''
;Campaign Tools
The Wiki Loves Folklore Tech Team has introduced tools to support organizers and participants:
* '''Article List Generator by Topic''' – Helps identify articles available on English Wikipedia but missing in your local language Wikipedia. The tool allows customized filters and provides downloadable article lists in CSV and wikitable formats.
* '''CampWiz''' – Enables communities to manage writing campaigns effectively, including jury-based evaluation. This will be the third year CampWiz is officially used for Feminism and Folklore.
Both tools are now available for use in the campaign. '''[https://tools.wikilovesfolklore.org/ Click here to access the tools]'''
;Learn More & Get Support
For detailed information about rules, timelines, and prizes, please visit the
'''[[:m:Feminism and Folklore 2026|Feminism and Folklore 2026 project page]]'''.
If you have any questions or need assistance, feel free to reach out via:
* '''[[:m:Talk:Feminism and Folklore 2026/Project Page|Meta talk page]]'''
* Email us using details on the contact page.
;Join Us
We look forward to your collaboration and coordination in making Feminism and Folklore 2026 a meaningful and impactful campaign for closing gender gaps and enriching folk culture content on Wikipedia.
Thank you and best wishes,
'''[[:m:Feminism and Folklore 2026|Feminism and Folklore 2026 International Team]]'''
----
''Stay connected:''
[[File:B&W Facebook icon.png|link=https://www.facebook.com/feminismandfolklore/|30x30px]]
[[File:B&W Twitter icon.png|link=https://twitter.com/wikifolklore|30x30px]]
</div></div>
== Invitation to Host Wiki Loves Folklore 2026 in Your Country ==
<div lang="en" dir="ltr" class="mw-content-ltr">
<div style="text-align: center; width: 100%;">''{{int:please-translate}}''</div>
[[File:Wiki Loves Folklore Logo.svg|right|150px|frameless]]
Hello everyone,
We are delighted to invite Wikimedia affiliates, user groups, and community organizations worldwide to participate in '''Wiki Loves Folklore 2026''', an international initiative dedicated to documenting and celebrating folk culture across the globe.
;About Wiki Loves Folklore
'''Wiki Loves Folklore''' is an annual international photography competition hosted on Wikimedia Commons. The campaign runs from '''1 February to 31 March 2026''' and encourages photographers, cultural enthusiasts, and community members to contribute photographs that highlight:
* Folk traditions and rituals
* Cultural festivals and celebrations
* Traditional attire and crafts
* Performing arts, music, and dance
* Everyday practices rooted in folk heritage
Through this campaign, we aim to preserve and promote diverse folk cultures and make them freely accessible to the world.
[[:c:Commons:Wiki_Loves_Folklore_2026|Project page on Wikimedia Commons]]
; Host a Local Edition
As we celebrate the '''eight edition''' of Wiki Loves Folklore, we warmly invite communities to organize a local edition in their country or region. Hosting a local campaign is a great opportunity to:
* Increase visibility of your region’s folk culture
* Engage new contributors in your community
* Enrich Wikimedia Commons with high-quality cultural content
'''[[:c:Commons:Wiki_Loves_Folklore_2026/Organize|Sign up to organize]]:'''
If your team prefers to organize the competition in ''either February or March only'', please feel free to let us know.
If you are unable to organize, we encourage you to share this opportunity with other interested groups or organizations in your region.
;Get in Touch
If you have any questions, need support, or would like to explore collaboration opportunities, please feel free to contact us via:
* The project Talk pages
* Email: '''support@wikilovesfolklore.org'''
We are also happy to connect via an online meeting if your team would like to discuss planning or coordination in more detail.
Warm regards,
'''The Wiki Loves Folklore International Team'''
</div>
[[Gumagamit:MediaWiki message delivery|MediaWiki message delivery]] ([[Hisgot sa Gumagamit:MediaWiki message delivery|talk]]) 13:20, 18 Enero 2026 (UTC)
<!-- Message sent by User:Tiven2240@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Distribution_list/Global_message_delivery/Wikipedia&oldid=29228188 -->
== <span lang="en" dir="ltr">Tech News: 2026-04</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W04"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/04|Translations]] are available.
'''Updates for editors'''
* The tray shown on [[Special:Diff|Special:Diff]] in mobile view has been redesigned. It is now collapsed by default, and incorporates a link to undo the edit being viewed, making it easier for mobile editors and reviewers to take action while keeping the interface uncluttered. [https://phabricator.wikimedia.org/T402297]
* [[m:Special:GlobalWatchlist|The Global Watchlist]] lets you view your watchlists from multiple wikis on one page. The [[mw:Special:MyLanguage/Extension:GlobalWatchlist|extension]] continues to improve — it now automatically determines the text direction (ensuring correct display of sites with unusual domain names) and shows detailed descriptions for log actions. Later this week, a new permanent link for page creations and CSS classes for each entry element will be added. [https://phabricator.wikimedia.org/T412505][https://phabricator.wikimedia.org/T287929][https://phabricator.wikimedia.org/T262768][https://phabricator.wikimedia.org/T414135]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:32}} community-submitted {{PLURAL:32|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the previously observed issue in Vector 2022, where anchor link targets were obscured by the sticky header, has now been addressed. [https://phabricator.wikimedia.org/T406114]
'''Updates for technical contributors'''
* As mentioned in the [[m:Special:MyLanguage/Tech/News/2025/44|October 2025 deprecation announcement]], MediaWiki Interfaces team will begin sunsetting all transform endpoints containing a trailing slash from the MediaWiki REST API the week of January 26. Changes are expected to roll out to all wikis on or before January 30th. All API users currently calling them are encouraged to transition to the non-trailing slash versions. Both endpoint variations can be found, compared, and tested using the [https://test.wikipedia.org/wiki/Special:RestSandbox REST Sandbox]. If you have questions or encounter any problems, please file a ticket in Phabricator to the [https://phabricator.wikimedia.org/project/view/6931/ #MW-Interfaces-Team board].
* Interactive reference documentation for the [[mw:Special:MyLanguage/Wikimedia REST API|Wikimedia REST API]] has moved. Requests to API docs previously hosted through [[mw:Special:MyLanguage/RESTBase|RESTBase]] (e.g.: <code dir=ltr>https://en.wikipedia.org/api/rest_v1/</code>) are now redirected to the [[w:en:Special:RestSandbox|REST Sandbox]].
* The [[mw:Special:MyLanguage/Wikidata Platform|WMF Wikidata Platform team]] (WDP) has published its [[d:Special:MyLanguage/Wikidata:Wikidata Platform team/Newsletter|January 2026 newsletter]]. It includes updates on the legacy full-graph endpoint decommissioning, the User-Agent policy change, the monthly Blazegraph migration office hours, and efforts to reduce regressions caused by the legacy endpoint shutdown. As a reminder, you can [[m:Special:MyLanguage/Global message delivery/Targets/WDP team updates|subscribe to the WDP newsletter]]!
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.12|MediaWiki]]
'''Meetings and events'''
* The [[mw:Wikimedia Hackathon Northwestern Europe 2026|Wikimedia Hackathon Northwestern Europe 2026]] will take place on 13-14 March 2026 in Arnhem, the Netherlands. Applications opened mid-December and will close soon or when capacity is reached. It's a two-day, technically oriented hackathon bringing together Wikimedians from the region. Hope to see you there!
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/04|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W04"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 20:27, 19 Enero 2026 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29943403 -->
== <span lang="en" dir="ltr">Annual review of the Universal Code of Conduct and Enforcement Guidelines</span> ==
<div lang="en" dir="ltr">
<section begin="announcement-content" />
I am writing to you to let you know the annual review period for the Universal Code of Conduct and Enforcement Guidelines is open now. You can make suggestions for changes through 9 February 2026. This is the first step of several to be taken for the annual review. [[m:Special:MyLanguage/Universal Code of Conduct/Annual review/2026|Read more information and find a conversation to join on the UCoC page on Meta]].
The [[m:Special:MyLanguage/Universal Code of Conduct/Coordinating Committee|Universal Code of Conduct Coordinating Committee]] (U4C) is a global group dedicated to providing an equitable and consistent implementation of the UCoC. This annual review was planned and implemented by the U4C. For more information and the responsibilities of the U4C, [[m:Special:MyLanguage/Universal Code of Conduct/Coordinating Committee/Charter|you may review the U4C Charter]].
Please share this information with other members in your community wherever else might be appropriate.
-- In cooperation with the U4C, [[m:User:Keegan (WMF)|Keegan (WMF)]] ([[m:User talk:Keegan (WMF)|talk]])<section end="announcement-content" />
</div>
21:01, 19 Enero 2026 (UTC)
<!-- Message sent by User:Keegan (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Distribution_list/Global_message_delivery&oldid=29905753 -->
== <span lang="en" dir="ltr">Tech News: 2026-05</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W05"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/05|Translations]] are available.
'''Updates for editors'''
* Wikimedia Foundation invites comments on [[m:Special:MyLanguage/Product and Technology Advisory Council/Year1 Reflections and Proposed Way Forward 2026 Update|proposed future]] of the [[:m:Special:MyLanguage/Product and Technology Advisory Council|Product and Technology Advisory Council]] until 28 February.
* All users with registered accounts can now use passkeys for [[m:Special:MyLanguage/Help:Two-factor authentication|two-factor authentication]] (2FA). Passkeys are a simple way to log in without using a second device. They verify the user's identity using a fingerprint, face scan, or a PIN code. To set up a passkey, first set up a regular 2FA method. Currently, to log in with a passkey, users must also use a password. Later this quarter, passwordless login will allow users to log in with a single click and a passkey. Users with advanced rights will also be required to have 2FA enabled. This is part of the [[mw:Special:MyLanguage/Product Safety and Integrity/Account Security|Account Security]] project.
* Unregistered contributors on blocked IPs or blocked IP ranges can now interact on-wiki to appeal a block by creating a temporary account to appeal a block on the user talk page, unless the "prevent this user from editing their own talk page" is enabled. This solves the problem of logged-out users unable to use the default unblock process via user talk page. [https://phabricator.wikimedia.org/T398673]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:20}} community-submitted {{PLURAL:20|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the Two-Factor Authentication (2FA) methods description on the management page has been updated. It is now clearer and easier for users to understand and make use of. [https://phabricator.wikimedia.org/T332385]
'''Updates for technical contributors'''
* A new AbuseFilter variable, <code>account_type</code>, has been added to provide a reliable way to determine the account type being created in the <code>createaccount</code> and <code>autocreateaccount</code> actions. As part of this change, the variable <code>accountname</code> has been renamed to <code>account_name</code>, and <code>accountname</code> is now deprecated. Edit filter managers should update any filters that use hardcoded account type checks or the deprecated variable. [https://phabricator.wikimedia.org/T414049]
* Image thumbnails that are requested in non-standard sizes, and using non-standard methods such as direct requests to <code dir=ltr><nowiki>upload.wikimedia.org/…</nowiki></code> will stop working in the near future. This change is to prevent ongoing external abuse by web-scrapers and bots. Some users with custom CSS/JS, Interface Admins who can fix gadgets and local skins, and Tool-authors, will need to update their code to use standard thumbnail sizes. [[phab:T414805|Details, search-links, and examples of how to fix them, are available in the task]].
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.13|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/05|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W05"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 21:15, 26 Enero 2026 (UTC)
<!-- Message sent by User:UOzurumba (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=29969530 -->
== <span lang="en" dir="ltr">Tech News: 2026-06</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W06"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/06|Translations]] are available.
'''Updates for editors'''
* The "{{int:pageinfo-toolboxlink}}" feature, which gives validating information about a page ([{{fullurl:{{FULLPAGENAME}}|action=info}} example]), now automatically includes a table of contents. If there is a local [[{{ns:8}}:Pageinfo-header]] page created by individual users, it can now be removed. [https://phabricator.wikimedia.org/T363726]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:21}} community-submitted {{PLURAL:21|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, VisualEditor previously added bold or italic formatting inside link descriptions, making the wikicode complex. This has now been fixed. [https://phabricator.wikimedia.org/T409669]
'''Updates for technical contributors'''
* There was no XML dump on 20 January. Additionally, from now on, dumps will be generated once per month only. [https://phabricator.wikimedia.org/T414389]
* The MediaWiki Interfaces team removed support for all transform endpoints containing a trailing slash from the [https://www.mediawiki.org/wiki/Special:MyLanguage/API:REST%20API MediaWiki REST API]. All API users currently calling those endpoints are encouraged to transition to the non-trailing slash versions. If you have questions or encounter any problems, please file a ticket in phabricator to the [https://phabricator.wikimedia.org/project/view/6931/ #MW-Interfaces-Team board].
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.14|MediaWiki]]
'''Weekly highlight'''
* Users are reminded that the Wikimedia Foundation has shared some guiding questions for the July 2026–June 2027 Annual Plan on [[m:Special:MyLanguage/Wikimedia Foundation Annual Plan/2026-2027/Product & Technology OKRs|Meta]] and ''[[diffblog:2025/12/10/shaping-wikimedia-foundations-2026-2027-annual-goals-key-questions-for-the-wikimedia-movement/|Diff]]''. These focus on global trends, faster and healthier experimentation, better support for newcomers, strengthening editors and advanced users, improving collaboration across projects, and growing and retaining readership. Feedback and ideas are welcome on the [[m:Talk:Wikimedia Foundation Annual Plan/2026-2027|talk page]].
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/06|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W06"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 17:41, 2 Pebrero 2026 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30000986 -->
== <span lang="en" dir="ltr">Tech News: 2026-07</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W07"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/07|Translations]] are available.
'''Updates for editors'''
* [[File:Maki-gift-15.svg|12px|link=|class=skin-invert|Wishlist item]] Logged-in contributors who manage large or complex watchlists can now organise and filter watched pages in ways that improve their workflows with the new [[mw:Special:MyLanguage/Help:Watchlist labels|Watchlist labels]] feature. By adding custom labels (for example: pages you created, pages being monitored for vandalism, or discussion pages) users can more quickly identify what needs attention, reduce cognitive load, and respond more efficiently. This improves watchlist usability, especially for highly active editors.
* A new feature available on [[Special:Contributions|Special:Contributions]] shows [[mw:Special:MyLanguage/Trust and Safety Product/Temporary Accounts|temporary accounts]] that are likely operated by the same person, and so makes patrolling less time-consuming. Upon checking contributions of a temporary account, users with access to temporary account IP addresses can now see a view of contributions from the related temporary accounts. The feature looks up all the IPs associated with a given temporary account within the data retention period and shows all the contributions of all temporary accounts that have used these IPs. [[mw:Special:MyLanguage/Trust and Safety Product/Temporary Accounts#February 2026: Improvements to the patroller tooling|Learn more]]. [https://phabricator.wikimedia.org/T415674]
* When editors preview a wikitext edit, the reminder box that they are only seeing a preview (which is shown at the top), now has a grey/neutral background instead of a yellow/warning background. This makes it easier to distinguish preview notes from actual warnings (for example, edit conflicts or problematic redirect targets), which will now be shown in separate warning or error boxes. [https://phabricator.wikimedia.org/T414742]
* The [[m:Special:GlobalWatchlist|Global Watchlist]] lets you view your watchlists from multiple wikis on one page. The [[mw:Special:MyLanguage/Extension:GlobalWatchlist|extension]] continues to improve — it now properly supports more than one Wikibase site, for example both [[d:|Wikidata]] and [[testwikidata:|testwikidata]]. In addition, issues regarding text direction have been fixed for users who prefer Wikidata or other Wikibase sites in right-to-left (RTL) languages. [https://phabricator.wikimedia.org/T415440][https://phabricator.wikimedia.org/T415458]
* The automatic "magic links" for ISBN, RFC, and PMID numbers have been [[mw:Special:MyLanguage/Help:Magic links|deprecated in wikitext since 2021]] due to inflexibility and difficulties with localization. Several wikis have successfully replaced RFC and PMID magic links with equivalent external links, but a template was often required to replace the functionality of the ISBN magic link. There is now a new [[mw:Special:MyLanguage/Help:Magic words#isbn|built-in parser function]] <code dir=ltr><nowiki>{{#isbn}}</nowiki></code> available to replace the basic functionality of the ISBN magic link. This makes it easier for wikis who wish to migrate off of the deprecated magic link functionality to do so. [https://phabricator.wikimedia.org/T145604]
* Two new wikis have been created:
** a {{int:project-localized-name-group-wikipedia}} in [[d:Q35401|Jju]] ([[w:kaj:|<code>w:kaj:</code>]]) [https://phabricator.wikimedia.org/T413283]
** a {{int:project-localized-name-group-wikipedia}} in [[d:Q1186896|Nawat]] ([[w:ppl:|<code>w:ppl:</code>]]) [https://phabricator.wikimedia.org/T413273]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:23}} community-submitted {{PLURAL:23|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]].
'''Updates for technical contributors'''
* A new global user group has been created: [[{{int:grouppage-local-bot}}|{{int:group-local-bot}}]]. It will be used internally by the software to allow community bots to bypass rate limits that are applied to abusive [[w:en:Web scraping|web scrapers]]. Accounts that are approved as bots on at least one Wikimedia wiki will be automatically added to this group. It will not change what user permissions the bot has. [https://phabricator.wikimedia.org/T415588]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.15|MediaWiki]]
'''Meetings and events'''
* The [[mw:Special:MyLanguage/MediaWiki Users and Developers Conference Spring 2026|MediaWiki Users and Developers Conference, Spring 2026]] will be held March 25–27 in Salt Lake City, USA. This event is organized by and for the third-party MediaWiki community. You can propose sessions and register to attend. [https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/AZBWVI46SDEB65PGR5J6E4TYOQQEZXM7/]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/07|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W07"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 23:28, 9 Pebrero 2026 (UTC)
<!-- Message sent by User:Quiddity (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30026671 -->
== IMPORTANT: Admin activity review ==
Hello. A policy regarding the removal of "advanced rights" (administrator, bureaucrat, interface administrator, etc.) was adopted by [[:m:Requests for comment/Activity levels of advanced administrative rights holders|global community consensus]] in 2013. According to this policy, the [[:m:stewards|stewards]] are reviewing administrators' activity on all Wikimedia Foundation wikis with no inactivity policy. To the best of our knowledge, your wiki does not have a formal process for removing "advanced rights" from inactive accounts. This means that the stewards will take care of this according to the [[:m:Admin activity review|admin activity review]].
We have determined that the following users meet the inactivity criteria (no edits and no logged actions for more than 2 years):
# [[User:Josefwintzent Libot]] (administrator)
These users will receive a notification soon, asking them to start a community discussion if they want to retain some or all of their rights. If the users do not respond, then their advanced rights will be removed by the stewards.
However, if you as a community would like to create your own activity review process superseding the global one, want to make another decision about these inactive rights holders, or already have a policy that we missed, then please notify the [[:m:Stewards' noticeboard|stewards on Meta-Wiki]] so that we know not to proceed with the rights review on your wiki. Thanks, [[Gumagamit:EPIC|EPIC]] ([[Hisgot sa Gumagamit:EPIC|talk]]) 17:21, 14 Pebrero 2026 (UTC)
== <span lang="en" dir="ltr">Tech News: 2026-08</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W08"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/08|Translations]] are available.
'''Weekly highlight'''
* The [[mw:Special:MyLanguage/Wikimedia Site Reliability Engineering|SRE Team]] will be performing a cleanup of Wikimedia's [[m:Special:MyLanguage/Etherpad|Etherpad]] instance, the web-based editor for real-time collaborative document editing. All pads will be permanently deleted after 30 April, 2026 – if there are still migration projects in progress at that point the team can revisit the date on a case by case basis. Please create local backups of any content you wish to keep, as deleted data cannot be recovered. This cleanup helps reduce database size and minimize infrastructure footprint. Etherpad will continue to support real-time collaboration, but long-term storage should not be expected. Additional cleanups may occur in the future without prior notice. [https://phabricator.wikimedia.org/T415237]
'''Updates for editors'''
* The Information Retrieval team will be launching an [[mw:Special:MyLanguage/Readers/Information Retrieval/Phase 1|Android mobile app experiment]] that tests hybrid search capabilities which can handle both semantic and keyword queries. The improvement of on-platform search will enable readers to find what they’re looking for directly on Wikipedia more easily. The experiment will first be launched on Greek Wikipedia in late February, followed by English, French, and Portuguese in March. [https://diff.wikimedia.org/2026/01/08/semantic-search-making-it-easier-to-find-the-information-readers-want/ Read more] on Diff blog. [https://www.mediawiki.org/wiki/Readers/Information_Retrieval]
* The Reader Growth team will run [[mw:Special:MyLanguage/Readers/Reader Growth/WE3.10.2 Mobile Table of Contents|an experiment]] for mobile web users, that adds a table of contents and automatically expands all article sections, to learn more about navigation issues they face. The test will be available on Arabic, Chinese, English, French, Indonesian, and Vietnamese Wikipedias.
* Previously, site notices ([[{{ns:8}}:Sitenotice]] and [[{{ns:8}}:Anonnotice]]) would only render on the desktop site. Now, they will render on all platforms. Users on mobile web will now see these notices and be informed. Site administrators should be prepared to test and fix notices on mobile devices to avoid interference with articles. To opt out, interface admins can add <code dir="ltr">#siteNotice { display: none; }</code> to [[{{ns:8}}:Minerva.css]]. [https://phabricator.wikimedia.org/T138572][https://phabricator.wikimedia.org/T416644]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:19}} community-submitted {{PLURAL:19|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, an issue on [[Special:RecentChanges|Special:RecentChanges]] has been fixed. Previously, clicking hide in the active filters caused the "view new changes since…" button to disappear, though it should have remained visible. The button now behaves as expected. [https://phabricator.wikimedia.org/T406339]
'''Updates for technical contributors'''
* New documentation is now available to help editors debug on-site search features. It supports troubleshooting when pages do not appear in results, when ranking seems unexpected, and when you need to inspect what content is being indexed, helping make search behavior easier to understand and analyze. [[mw:Help:CirrusSearch/Debug|Learn more]]. [https://phabricator.wikimedia.org/T411169]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.16|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/08|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W08"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 19:14, 16 Pebrero 2026 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30086330 -->
== <span lang="en" dir="ltr">Tech News: 2026-09</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W09"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/09|Translations]] are available.
'''Weekly highlight'''
* [[mw:Special:MyLanguage/Edit check/Reference Check|Reference Check]] has been deployed to English Wikipedia, completing its rollout across all Wikipedias. The feature prompts newcomers to add a citation before publishing new content, helping reduce common citation-related reverts and improve verifiability. In A/B testing, the impact was substantial: newcomers shown Reference Check were approximately 2.2 times more likely to include a reference on desktop and about 17.5 times more likely on mobile web. [https://analytics.wikimedia.org/published/reports/editing/reference_check_ab_test_report_final_2025.html]
'''Updates for editors'''
* The [[mw:Special:MyLanguage/Extension:InterwikiSorting|InterwikiSorting extension]], which allowed for the [[m:Special:MyLanguage/Interwiki sorting order|sorting of interwiki links]], has been undeployed from Wikipedia. As a result, editors who had enabled interwiki link sorting in non-compact mode (full list format) will now see links reordered. The links moving forward will be listed in the alphabetical order of language code. [https://phabricator.wikimedia.org/T253764]
* Later this week, people who are editing a page-section using the mobile visual editor, will notice a new "Edit full page" button. When tapped, you will be able to edit the entire article. This helps when the change you want to make is outside the section you initially opened. [https://phabricator.wikimedia.org/T387175][https://phabricator.wikimedia.org/T409112]
* [[mw:Special:MyLanguage/Readers/Reader Experience|The Reader Experience team]] is inviting editors to assess whether dark mode should still be considered "beta" on their wiki, based on their experience of how well it functions on desktop and mobile. If the feature is deemed mature, editors can update the interface messages in <code dir=ltr>MediaWiki:skin-theme-description</code> and <code dir=ltr>MediaWiki:Vector-night-mode-beta-tag</code> to indicate that dark mode is ready and no longer considered beta.
* The improved [[mw:Wikimedia_Apps/Team/iOS/Activity_Tab|Activity tab]] which displays user-insights is now available to all users of the Wikipedia iOS app (version 7.9.0 and later). Following earlier A/B testing that showed higher account creation among users with access to the feature, it has been rolled out to 100% of users along with some updates. The Activity tab now shows your edited articles in the timeline, offers editing impact insights like contribution counts and article view trends, and customization options to improve in-app experience for users.
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:21}} community-submitted {{PLURAL:21|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, a bug that prevented [[mw:Special:MyLanguage/Extension:DiscussionTools|DiscussionTools]] from working on mobile has now been fixed, restoring full functionality. [https://phabricator.wikimedia.org/T415303]
'''Updates for technical contributors'''
* The [[m:Special:GlobalWatchlist|Global Watchlist]] lets you view your watchlists from multiple wikis on one page. The [[mw:Special:MyLanguage/Extension:GlobalWatchlist|extension]] that makes this possible continues to improve. The latest upgrade is the inclusion of a [[mw:Extension:GlobalWatchlist#hook|new hook]], <code dir=ltr>ext.globalwatchlist.rebuild</code>, which fires after each watchlist rebuild. This allows you to run gadgets and user scripts for the Special page. [https://phabricator.wikimedia.org/T275159]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.17|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/09|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W09"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 19:01, 23 Pebrero 2026 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30119102 -->
== Help Needed – A project to grow content and attract more contributors Cebuano in Wikipedia ==
{{int:Hello}} Cebuano Wikipedia,
We apologize that this message is not in your language. {{int:Please-translate}}.
The WMF Language and Product Localization team is planning to launch a campaign project to encourage more native speakers to contribute to your Wikipedia.
'''Our approach'''
We will invite native speakers through Cebuano Wikipedia homepage to join a 3-week onboarding program in an [[metawiki:Event_Center/Registration#Event_Registration_Tool|Event registration page]]. This program will:
* Guide them step-by-step through an onboarding material on how to edit and use contribution tools to expand articles.
* Surface vital articles that the community has prioritized for improvement and editing tasks can be worked on to improve those articles.
Through this guided onboarding program we will see if this approach will increase contributions from new editors or less experienced editors in your Wikipedia. You can read more about the project here: https://meta.wikimedia.org/wiki/Research:Engage_native_speakers_to_improve_vital_content_in_small_language_Wikipedias#Hypothesis_WE2.1.5.
'''Tasks you can volunteer to help us with'''
To make this project successful, we need your community’s help with these key tasks:
* Translate the onboarding materials on this page: https://meta.wikimedia.org/wiki/User:SSethi_(WMF)/Sandbox/Event:_Vital_Knowledge_Drive_2026#Overview into Cebuano.
* Set up a call-to-action message on your [[Unang Panid|homepage]] using the translations. Admins are needed for this step. Instructions for the setup are on [[metawiki:User:SSethi_(WMF)/Sandbox/Event:_Vital_Knowledge_Drive_2026#For_event_organizers:_adding_vital_knowledge_section_to_wiki_home_page|this page]]. @[[Gumagamit:Lsj|Lsj]] and @[[Gumagamit:Sunny Cryolite|Sunny Cryolite]], please can you help with this task?
* Create an Event Registration Page on Cebuano Wikipedia, and insert the translated materials in it. Here is a sample of the event registration page: https://meta.wikimedia.org/wiki/User:SSethi_(WMF)/Sandbox/Event:_Vital_Knowledge_Drive_2026#Event:_Vital_Knowledge_Drive_2026
* Identify local Wikipedia articles or lists of articles needing improvement or missing in your Wikipedia. You might find inspiration in the "[[metawiki:List_of_articles_every_Wikipedia_should_have|List of articles every Wikipedia should have]]". These articles are to be added into the Event page you will create. Our team will help generate links to contribution tools for the selected articles.
'''Timeline and Next Steps'''
Please, help us complete these tasks by '''March 20, 2026'''. We plan to launch the program on March 23, 2026.
We understand this is a big effort and truly appreciate any help you all can provide. Your support can help grow your community and make Cebuano Wikipedia stronger.
Please let us know If your community is interested in this project and would help us with the tasks by replying on this thread.
Thank you for your time and support!
[[Gumagamit:UOzurumba (WMF)|UOzurumba (WMF)]] ([[Hisgot sa Gumagamit:UOzurumba (WMF)|talk]]) 09:37, 26 Pebrero 2026 (UTC)
== <span lang="en" dir="ltr">Tech News: 2026-10</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W10"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/10|Translations]] are available.
'''Weekly highlight'''
* Wikipedia 25 [[m:Special:MyLanguage/Wikipedia 25/Easter egg experiments|Birthday mode]] is now live on Betawi, Breton, Chinese, Czech, Dutch, English, French, Gorontalo, Indonesian, Italian, Luxembourgish, Madurese, Sicilian, Spanish, Thai, and Vietnamese Wikipedias! This limited-time campaign feature celebrates 25 years of Wikipedia with a birthday mascot, Baby Globe. When turned on, Baby Globe is shown on [[m:Special:MyLanguage/Wikipedia 25/Easter egg experiments/article configuration|~2,500 articles]], waiting to be discovered by readers. Communities can choose to turn Birthday mode on by getting consensus from their community and asking an admin to enable the feature and customize it via [[m:Special:MyLanguage/Wikipedia 25/Easter egg experiments#Community Configuration Demo|community configuration]] on the local wiki.
'''Updates for editors'''
* [[:m:Special:MyLanguage/WMDE Technical Wishes/Sub-referencing|Sub-referencing]], a new feature to re-use references with different details has been released to Swedish Wikipedia, Polish Wikipedia and [[:phab:T418209|a couple of other wikis]]. You can [[:m:Special:MyLanguage/WMDE Technical Wishes/Sub-referencing#test|try the feature]] on these projects or on testwiki and [https://en.wikipedia.beta.wmcloud.org/wiki/Sub-referencing betawiki]. Learnings from the first pilot wiki German Wikipedia have been [[:m:Special:MyLanguage/WMDE Technical Wishes/Sub-referencing/Learnings|published in a report]]. Reach out to the Wikimedia Deutschland team if you are [[:m:Talk:WMDE Technical Wishes/Sub-referencing#Pilot wikis|interested in becoming a pilot wiki]].
* [[mw:Special:MyLanguage/Help:Edit check#Paste check|Paste Check]] will become available at all Wikipedias this week. The feature prompts newcomers who are pasting text they are not likely to have written into VisualEditor to consider whether doing so risks a copyright violation. Paste Check [[mw:Special:MyLanguage/Edit check/Tags|tags]] all edits where it is shown for potential review. Local administrators can configure various aspects of the feature via [[{{#special:EditChecks}}]]. [[mw:Special:MyLanguage/Edit check/Paste Check#A/B Experiment|Research]] across 22 wikis found that Paste Check resulted in an 18% decrease in relative reverted-edits compared to the control group. Translators can [https://translatewiki.net/w/i.php?title=Special%3ATranslate&group=ext-visualeditor-ve-mw-editcheck&filter=&optional=1&action=translate help to localize] this and related features.
* The [[mw:Special:MyLanguage/Readers/Reader Experience|Reader Experience team]] will be standardizing the user menu in the top right for all mobile users so that it is closer to the desktop experience. Currently this user menu is only visible to users with Advanced Mobile Controls (AMC) turned on. The only change is that a couple buttons previously in the left-side menu will move to the top right for users who do not have AMC turned on. This change is expected to go out March 9 and seeks to improve the user interface. [https://phabricator.wikimedia.org/T413912]
* Starting in the week of March 2, the emails sent out when an email address was added, removed, or changed for an account will switch to a substantially nicer and clearer HTML email from the prior plaintext one. [https://phabricator.wikimedia.org/T410807]
* Notifications are currently limited to 2,000 historic entries per user, and extend back to 2013 when the feature was released. This is going to be changed to only store Notifications from the last 5 years, but up to 10,000 of them. This will help with long-term infrastructure health and help to prevent more recent notifications from disappearing too soon. [https://phabricator.wikimedia.org/T383948]
* The [[m:Special:GlobalWatchlist|Global Watchlist]] which lets you view your watchlists from multiple wikis on a single page continues to see improvements. The latest update improves label usage experience. The [[mw:Special:MyLanguage/Extension:GlobalWatchlist|extension]] now allows activating the [[mw:Special:MyLanguage/Manual:Language#Fallback languages|language fallback system]] for Wikidata items without labels in the viewed language, and showing those labels in the user’s preferred Wikidata language if no <code dir=ltr>uselang=</code> URL parameter is provided. [https://phabricator.wikimedia.org/T373686][https://phabricator.wikimedia.org/T416111]
* The Wikipedia Android team has started a beta test of [[mw:Special:MyLanguage/Readers/Information Retrieval/Phase 1|hybrid search]] on Greek Wikipedia. Hybrid search capabilities can handle both semantic and keyword queries enabling readers to find what they’re looking for directly on Wikipedia more easily.
* For security reasons, members of certain user groups are [[m:Special:MyLanguage/Mandatory two-factor authentication for users with some extended rights|required to have two-factor authentication]] (2FA) enabled. Currently, 2FA is required to use the group, but not to be a member of it. Given that this model still has some vulnerabilities, the situation will [[phab:T418580|gradually change in March]]. Members of these groups will be unable to disable last 2FA method on their account, and it will be impossible to add users without 2FA to these groups. Users will still be able to add new authentication methods or remove them, as long as at least one method is continuously enabled. In the second half of March, users without 2FA will be removed from these groups. This applies to: CentralNotice administrators, checkusers, interface administrators, suppressors, Wikidata staff, Wikifunctions staff, WMF Office IT and WMF Trust & Safety. Nothing will change for other users. See the linked task for deployment schedule. [https://phabricator.wikimedia.org/T418580]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:27}} community-submitted {{PLURAL:27|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the issue preventing users from creating an instance in [https://www.wikibase.cloud/ Wikibase.cloud] has now been fixed. [https://phabricator.wikimedia.org/T416807]
'''Updates for technical contributors'''
* To help ensure [[mw:Special:MyLanguage/MediaWiki Product Insights/Responsible Reuse|fair use of infrastructure]], over the next month the Wikimedia Foundation will implement global API rate limits across our APIs. In early March, stricter limits will be applied to unidentified requests from outside Toolforge/WMCS and API requests that are made from web browsers. In April, higher limits will be applied to identified traffic. These limits are intentionally set as high as possible to minimise impact on the community. Bots running in Toolforge/WMCS or with the bot user right on any wiki should not be affected for now. However, all developers are advised to follow updated best practices. For more information, see [[mw:Special:MyLanguage/Wikimedia APIs/Rate limits|Wikimedia APIs/Rate limits]].
* The Wikidata Query Service Linked Data Fragment (LDF) endpoint will be decommissioned in February. This endpoint served limited traffic, which was successfully migrated to other data access methods that were better suited to support existing use cases. The hardware used to support the LDF endpoint will be reallocated to support the ongoing backend migration efforts. [https://phabricator.wikimedia.org/T415696]
* The new Parsoid parser [[mw:Special:MyLanguage/Parsoid/Parser Unification/Updates|continues to be deployed to additional wikis]], improving platform sustainability and making it easier to introduce new reading and editing features. Parsoid is now the default parser on 488 WMF wikis (268 Wikipedias), now covering more than 10% of all Wikipedia page views.
* The process and criteria for [[Special:MyLanguage/Wikimedia Enterprise#Access|requesting exceptional access]] to the high volume feed of the ''Wikimedia Enterprise'' APIs (at no cost for mission-aligned usecases), [[m:Talk:Wikimedia Enterprise#Exceptional access criteria|have now been published]]. This is to provide more thorough and clearer documentation for users.
* [https://techblog.wikimedia.org/ Tech Blog], the blog dedicated to the Wikimedia technical community [https://techblog.wikimedia.org/2026/02/24/a-tech-blog-diff/ will be migrating] to [[diffblog:|Diff]], the community news and event blog. The migration should be complete in April 2026, after which new posts will be accepted for publishing. Readers will be able to access posts – old and new – on the landing page at https://diff.wikimedia.org/techblog.
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.18|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/10|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W10"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 17:49, 2 Marso 2026 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30137798 -->
== <span lang="en" dir="ltr">Tech News: 2026-11</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W11"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/11|Translations]] are available.
'''Weekly highlight'''
* [[m:Special:MyLanguage/Tech/Server switch|All wikis will be read-only]] for a few minutes on Wednesday, 25 March 2026 at [https://zonestamp.toolforge.org/1774450800 15:00 UTC]. This is for the datacenter server switchover backup tests, [[wikitech:Deployments/Yearly calendar|which happen twice a year]]. During the switchover, all Wikimedia website traffic is shifted from one primary data center to the backup data center to test availability and prevent service disruption even in emergencies.
* Last week, all wikis had 2 hours of read-only time, and extended unavailability for user-scripts and gadgets. This was due to a security incident which has since been resolved. Work is ongoing to prevent re-occurrences. For current information please see the [[m:Steward's noticeboard#Statement on Meta about today's user script security incident|post on the Stewards' noticeboard]] ([[m:Special:MyLanguage/Wikimedia Foundation/Product and Technology/Product Safety and Integrity/March 2026 User Script Incident|translations]]).
'''Updates for editors'''
* Users facing multiple blocks on mobile will now see the reasons for each block separately, instead of a generic message. This helps them understand why they are blocked and what steps they can take to resolve the issue. For example, users affected for using common VPNs (such as [[Special:MyLanguage/Apple iCloud Private Relay|iCloud Private Relay]]) will receive clearer guidance on what they need to do to start editing again. [https://phabricator.wikimedia.org/T357118]
* Later this week, [[mw:Special:MyLanguage/VisualEditor/Suggestion Mode|Suggestion Mode]] will become available as a beta feature within the visual editor at all Wikipedias. This feature proactively suggests various types of actions that people can consider taking to improve Wikipedia articles, and learn about related guidelines. The feature is locally configurable, and can also be locally expanded with custom Suggestions. Current settings can be seen at [[Special:EditChecks]] and there are [[mw:Special:MyLanguage/Help:Suggestion mode#For administrators %E2%80%93 local customization|instructions for how administrators can customize]] the links to point to local guidelines. The feature is connected to [[mw:Special:MyLanguage/Help:Edit check|Edit check]] which suggests improvements while someone is writing new content. In the future, the Editing team plans to evaluate the feature's impact with newcomers through a controlled experiment. [https://phabricator.wikimedia.org/T404600]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:23}} community-submitted {{PLURAL:23|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the issue where the cursor became misaligned during the use of CodeMirror’s syntax highlighting, which makes wikitext and code easier to read, has now been fixed. This problem specifically affected users who defined a font rule in a custom stylesheet while creating a new topic with DiscussionTools. [https://phabricator.wikimedia.org/T418793]
'''Updates for technical contributors'''
* API rate limiting update: To help ensure [[mw:Special:MyLanguage/MediaWiki Product Insights/Responsible Reuse|fair use of infrastructure]], global API rate limits will be applied this week to requests without a compliant User-Agent that originate from outside Toolforge/WMCS and to unauthenticated requests made from web browsers. Higher limits will be applied to identified traffic in April. Bots running in Toolforge/WMCS or with the bot user right on any wiki should not be affected for now. However, all developers are advised to follow updated best practices. For more information, see [[mw:Special:MyLanguage/Wikimedia APIs/Rate limits|Wikimedia APIs/Rate limits]].
* The new GraphQL API has been released. The API was developed as a flexible alternative to select features of the Wikidata Query Service (WDQS), to improve developer experience and foster adaptability, and efficient data access. Try it out and [[d:Wikidata:Wikibase GraphQL#Feedback and development|give feedback]]. You can also [https://greatquestion.co/wikimediadeutschland/GraphQLAPI/apply sign up for usability tests].
* The [[m:Special:MyLanguage/Product and Technology Advisory Council/Unsupported Tools Working Group|PTAC Unsupported Tools Working Group]] continued improvements to [[commons:Special:MyLanguage/Commons:Video2commons#|Video2Commons]] in February, with fixes addressing authentication errors, large-file handling, task queue visibility, and clearer upload behavior. Work is still ongoing in some areas, including changes related to deprecated server-side uploads. Read [[m:Special:MyLanguage/Product and Technology Advisory Council/Unsupported Tools Working Group#February 2026|this update]] to learn more.
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.19|MediaWiki]]
'''In depth'''
* The Article Guidance team invites experienced Wikipedia editors from selected [[mw:Special:MyLanguage/Article guidance/Pilot wikis and collaborators#Collaborators|pilot wikis]] and interested contributors from other Wikipedias to fill out this questionnaire which is available in [https://docs.google.com/forms/d/e/1FAIpQLSfmLeVWnxmsCbPoI_UF2jyRcn73WRGWCVPHzerXb4Cz97X_Ag/viewform English], [https://docs.google.com/forms/d/e/1FAIpQLSd6rzr4XXQw8r4024fE3geTPFe13M_6w7Mitj-YJi0sOlWTAw/viewform?usp=header Arabic], [https://docs.google.com/forms/d/e/1FAIpQLSdok3-RfB18lcugYTUMGkpwmqG_8p760Wv4dCXitOXOszjUDw/viewform?usp=header Bengali], [https://docs.google.com/forms/d/e/1FAIpQLSfjTfYp4jEo0akA4B1e-Nfg3QZPCudUjhJzHzzDi6AHyAaMGA/viewform?usp=header Japanese], [https://docs.google.com/forms/d/e/1FAIpQLScteVoI29Aue4xc72dekk-6RYtvmMgQxzMI900UOawrFrSTWg/viewform?usp=header Portuguese], [https://docs.google.com/forms/d/e/1FAIpQLSetdxnYwL3ub2vqA7awCg5hJZPMIYcDPaiTe12rY9h0GYnVlw/viewform?usp=header Persian], and [https://docs.google.com/forms/d/e/1FAIpQLScNvfJF-Ot-4pzA4qAN771_0QDJ4Li19YcUsaTgSKW8Nc7U_Q/viewform?usp=header Turkish]. Your answers will help the team customize guidance for less experienced editors and help them learn community policies and practices while creating an article. Learn more [[mw:Special:MyLanguage/Article guidance|on the project page]].
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/11|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W11"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 18:50, 9 Marso 2026 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30213008 -->
== <span lang="en" dir="ltr">Tech News: 2026-12</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W12"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/12|Translations]] are available.
'''Updates for editors'''
* The [[mw:Special:MyLanguage/Help:Extension:CodeMirror|{{int:codemirror-beta-feature-title}}]] beta feature, also known as [[mw:Special:MyLanguage/Extension:CodeMirror|CodeMirror 6]], has been used for wikitext syntax highlighting since November 2024. It will be promoted out of beta by May 2026 in order to bring improvements and new [[mw:Special:MyLanguage/Help:Extension:CodeMirror#Features|features]] to all editors who use the standard syntax highlighter. If you have any questions or concerns about promoting the feature out of beta, [[mw:Special:MyLanguage/Help talk:Extension:CodeMirror|please share]]. [https://phabricator.wikimedia.org/T259059]
* Some changes to local user groups are performed by stewards on Meta-Wiki and logged there only. Now, interwiki rights changes will be logged both on Meta-Wiki and the wiki of the target user to make it easier to access a full record of user's rights changes on a local wiki. Past log entries for such changes will be backfilled in the coming weeks. [https://phabricator.wikimedia.org/T6055]
* On wikis using [[m:Special:MyLanguage/Flagged Revisions|Flagged Revisions]], the number of pending changes shown on [[{{#Special:PendingChanges}}]] previously counted pages which were no longer pending review, because they have been removed from the system without being reviewed, e.g. due to being deleted, moved to a different namespace, or due to wiki configuration changes. The count will be correct now. On some wikis the number shown will be much smaller than before. There should be no change to the list of pages itself. [https://phabricator.wikimedia.org/T413016]
* Wikifunctions composition language has been rewritten, resulting in a new version of the language. This change aims to increase service stability by reducing the orchestrator's memory consumption. This rewrite also enables substantial latency reduction, code simplification, and better abstractions, which will open the door to later feature additions. Read more about [[f:Special:MyLanguage/Wikifunctions:Status updates/2026-03-11|the changes]].
* Users can now sort search results alphabetically by page title. The update gives an additional option to finding pages more easily and quickly. Previously, results could be sorted by Edit date, Creation date, or Relevance. To use the new option, open 'Advanced Search' on the search results page and select 'Alphabetically' under 'Sorting Order'. [https://phabricator.wikimedia.org/T403775]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:28}} community-submitted {{PLURAL:28|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the bug that prevented UploadWizard on Wikimedia Commons from importing files from Flickr has now been fixed. [https://phabricator.wikimedia.org/T419263]
'''Updates for technical contributors'''
* A new special page, [[{{#special:LintTemplateErrors}}]], has been created to list transcluded pages that are flagged as containing lint errors to help users discover them easily. The list is sorted by the number of transclusions with errors. For example: [[{{#special:LintTemplateErrors}}/night-mode-unaware-background-color]]. [https://phabricator.wikimedia.org/T170874]
* Users of the [[mw:Special:MyLanguage/Help:Extension:CodeMirror|{{int:codemirror-beta-feature-title}}]] beta feature have been using [[mw:Special:MyLanguage/Extension:CodeMirror|CodeMirror]] instead of [[mw:Special:MyLanguage/Extension:CodeEditor|CodeEditor]] for syntax highlighting when editing JavaScript, CSS, JSON, Vue and Lua content pages, for some time now. Along with promoting CodeMirror 6 out of beta, the plan is to replace CodeEditor as the standard editor for these content models by May 2026. [[mw:Special:MyLanguage/Help talk:Extension:CodeMirror|Feedback or concerns are welcome]]. [https://phabricator.wikimedia.org/T419332]
* The [[mw:Special:MyLanguage/Extension:CodeMirror|CodeMirror]] JavaScript modules will soon be upgraded to CodeMirror 6. Leading up to the upgrade, loading the <code dir=ltr>ext.CodeMirror</code> or <code dir=ltr>ext.CodeMirror.lib</code> modules from gadgets and user scripts was deprecated in July 2025. The use of the <code dir=ltr>ext.CodeMirror.switch</code> hook was also deprecated in March 2025. Contributors can now make their scripts or gadgets compatible with CodeMirror 6. See the [[mw:Special:MyLanguage/Extension:CodeMirror#Gadgets and user scripts|migration guide]] for more information. [https://phabricator.wikimedia.org/T373720]
* The MediaWiki Interfaces team is expanding coverage of REST API module definitions to include [[mw:Special:MyLanguage/API:REST API/Extensions|extension APIs]]. REST API modules are groups of related endpoints that can be independently managed and versioned. Modules now exist for [https://phabricator.wikimedia.org/T414470 GrowthExperiments] and [https://phabricator.wikimedia.org/T419053 Wikifunctions] APIs. As we migrate extension APIs to this structure, documentation will move out of the main MediaWiki OpenAPI spec and REST Sandbox view, and will instead be accessible via module-specific options in the dropdown on the [https://test.wikipedia.org/wiki/Special:RestSandbox REST Sandbox] (i.e., [[{{#Special:RestSandbox}}]], available on all wiki projects).
* The [[mw:Special:MyLanguage/Extension:Scribunto|Scribunto]] extension provides different pieces of information about the wiki where the module is being used via the [[mw:Special:MyLanguage/Extension:Scribunto/Lua reference manual|mw.site]] library. Starting last week, the library also provides a [[mw:Special:MyLanguage/Extension:Scribunto/Lua reference manual#mw.site.wikiId|way]] of accessing the [[mw:Special:MyLanguage/Manual:Wiki ID|wiki ID]] that can be used to facilitate cross-wiki module maintenance. [https://phabricator.wikimedia.org/T146616]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.20|MediaWiki]]
'''In depth'''
* The [[m:Special:MyLanguage/Coolest Tool Award|2026 Coolest Tool Award]] celebrating outstanding community tools, is now open for nominations! Nominate your favorite tool using the [https://wikimediafoundation.limesurvey.net/435684?lang=en nomination survey] form by 23 March 2026. For more information on privacy and data handling, please see the [[foundation:Special:MyLanguage/Legal:Coolest_Tool_Award_2026_Survey_Privacy_Statement|survey privacy statement]].
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/12|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W12"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 19:33, 16 Marso 2026 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30260505 -->
== Request for Comment: VisualEditor automatic reference names ==
<div lang="en" dir="ltr">
Hi, I’m Johannes from [[:m:Wikimedia Deutschland|Wikimedia Deutschland]]’s [[:m:WMDE Technical Wishes|Technical Wishes team]]. Apologies for writing in English. {{Int:Please-translate}}! We are considering to work on [[:m:Community Wishlist/W17|Community Wishlist/W17: Improve VE references' automatic names and reuse]]. This has been a long-term issue for wikitext editors (see e.g. [[:en:WP:VisualEditor/Named references]]) which has been among the top-voted wishes in several [[:m:Community Wishlist Survey|Community Wishlist Surveys]], e.g. [[:m:Community Wishlist Survey 2017/Editing/VisualEditor: Allow editing of auto-generated references before adding them|2017]], [[:m:Community Wishlist Survey 2019/Citations/VisualEditor: Allow references to be named|2019]], [[:m:Community Wishlist Survey 2022/Editing/VisualEditor should use human-like names for references|2022]] or [[:m:Community Wishlist Survey 2023/Editing/VisualEditor should use proper names for references|2023]].
We would like your input on the [[:m:WMDE Technical Wishes/References/VisualEditor automatic reference names#Proposed solutions|solutions]] proposed on our project page: '''[[:m:WMDE Technical Wishes/References/VisualEditor automatic reference names]]'''. We are considering several options, which can be combined if desired by the community.
* Changing the default pattern for automatically generated reference names (currently <code>":n"</code>, e.g. <code>":0"</code>, <code>":1"</code>...) to use the [[:mw:Help:Reference Previews#Exposed reference types|reference type]] instead (e.g. <code>"book_reference-1"</code>).
* Providing a simple mechanism for communities to configure a different default name.
* Generating automatic reference names based on the [[:en:domain name|domain name]] (if it’s a web citation).
* Generating automatic reference names based on template parameters (e.g. "title" or "last"+"first") – defined by the community.
=== Feedback ===
[[:m:WMDE Technical Wishes/References/VisualEditor automatic reference names|Visit our project page]] to read about our proposal in detail and share your thoughts [[:m:Talk:WMDE Technical Wishes/References/VisualEditor automatic reference names#Request for comment|on metawiki]].
'''Please note''': We will only implement a solution if there’s clear consensus among the global community. Our intention is not to build the perfect solution, but to find a simple and lean one that alleviates the pain caused by auto generated names. We are aware that some experienced VisualEditor users might prefer an option to manually change reference names in VisualEditor, but such a UX intervention is difficult to achieve across reference types and thus out of scope for our team, we can only improve the auto-naming mechanism.
We are happy about suggestions for improving certain details of the proposed solutions. Any other feedback and alternative proposals are also welcome – even though it’s out of scope for us, it might still be relevant for future work on this topic.
Please support us interpreting consensus by clearly indicating your opinion (e.g. by using support/neutral/oppose templates). We are aware of [[:en:WP:NOTVOTE]], but given that we are facilitating this discussion with users from different wikis, potentially commenting in their native language, clearly indicating your position helps us avoid misunderstandings.
Thank you for participating!</div> <bdi lang="en" dir="ltr">[[User:Johannes Richter (WMDE)|Johannes Richter (WMDE)]] ([[User talk:Johannes Richter (WMDE)|hisgot]])</bdi> 11:15, 19 Marso 2026 (UTC)
<!-- Message sent by User:Johannes Richter (WMDE)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:Johannes_Richter_(WMDE)/MassMessageRecipients&oldid=30281362 -->
== <span lang="en" dir="ltr">Tech News: 2026-13</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W13"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/13|Translations]] are available.
'''Weekly highlight'''
* Wikimedia site users can now log in without a password using passkeys. This is a secure method supported by fingerprint, facial recognition, or PIN. With this change, all users who opt for passwordless login will find it easier, faster, and more secure to log in to their accounts using any device. The new passkey login option currently appears as an autofill suggestion in the username field. An additional [[phab:T417120|"Log in with passkey" button]] will soon be available for users who have already registered a passkey. This update will improve security and user experience. The [[c:File:Passwordless_login_screencast.webm|screen recording]] demonstrates the passwordless login process step by step.
* [[m:Special:MyLanguage/Tech/Server switch|All wikis will be read-only]] for a few minutes on Wednesday, 25 March 2026 at [https://zonestamp.toolforge.org/1774450800 15:00 UTC]. This is for the datacenter server switchover backup tests, [[wikitech:Deployments/Yearly calendar|which happen twice a year]]. During the switchover, all Wikimedia website traffic is shifted from one primary data center to the backup data center to test availability and prevent service disruption even in emergencies.
'''Updates for editors'''
* Wikimedia site users can now export their notifications older than 5 years using a [[toolforge:echo-chamber|new Toolforge tool]]. This will ensure that users retain their important notifications and avoid them being lost based on the planned change to delete notifications older than 5 years, as previously announced. [https://phabricator.wikimedia.org/T383948]
* Wikipedia editors in Indonesian, Thai, Turkish, and Simple English now have access to Special:PersonalDashboard. This is an [[mw:Special:MyLanguage/Moderator Tools/Dashboard|early version of an experience]] that introduces newer editors to patrolling workflows, making it easier for them to move from making edits to participating in more advanced moderation work on their project. [https://phabricator.wikimedia.org/T402647]
* The [[Special:Block]] now has two minor interface changes. Administrators can now easily perform indefinite blocks through a dedicated radio button in the expiry section. Also, choosing an indefinite expiry provides a different set of common reasons to select from, which can be changed at: [[MediaWiki:Ipbreason-indef-dropdown]]. [https://phabricator.wikimedia.org/T401823]
* Mobile editors [[mw:Special:MyLanguage/Contributors/Account Creation Experiments#Logged-out|at several wikis]] can now see an improved logged-out edit warning, thanks to the recent updates from the Growth team. These changes released last week are part of ongoing efforts and tests to enhance [[mw:Special:MyLanguage/Contributors/Account Creation Experiments|account creation experience on mobile]] and then increase participation. [https://phabricator.wikimedia.org/T408484]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:36}} community-submitted {{PLURAL:36|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the bug that prevented mobile web users from seeing the block information when affected by multiple blocks has been fixed. They can now see messages of all the blocks currently affecting them when they access Wikipedia.
'''Updates for technical contributors'''
* Images built using Toolforge will soon get the upgraded buildpacks version, bringing support for newer language versions and other upstream improvements and fixes. If you use Toolforge Build Service, review the recent [https://lists.wikimedia.org/hyperkitty/list/cloud-announce@lists.wikimedia.org/thread/EMYTA32EV2V5SQ2JIEOD2CL66YFIZEKV/ cloud-announce email] and update your build configuration as necessary to ensure your tools are compatible. [https://wikitech.wikimedia.org/w/index.php?title=Help:Toolforge/Building_container_images&oldid=2392097#Buildpack_environment_upgrade_process][https://phabricator.wikimedia.org/T380127]
* The [https://api.wikimedia.org/wiki/Main_Page API Portal] documentation wiki will shut down in June 2026. API keys created on the API Portal will continue to work normally. api.wikimedia.org endpoints will be deprecated gradually starting in July 2026. Documentation on the API Portal is moving to [[mw:Wikimedia APIs|mediawiki.org]]. Learn more on the [[wikitech:API Portal/Deprecation|project page]].
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.21|MediaWiki]]
'''In depth'''
* [[m:Special:MyLanguage/WMDE Technical Wishes|WMDE Technical Wishes]] is considering improvements to [[m:WMDE Technical Wishes/References/VisualEditor automatic reference names|automatically generated reference names in VisualEditor]]. Please check out the [[m:WMDE Technical Wishes/References/VisualEditor automatic reference names#Proposed solutions|proposed solutions]] and participate in the [[m:Talk:WMDE Technical Wishes/References/VisualEditor automatic reference names#Request for comment|request for comment]].
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/13|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W13"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 16:49, 23 Marso 2026 (UTC)
<!-- Message sent by User:UOzurumba (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30268305 -->
== <span lang="en" dir="ltr">Tech News: 2026-14</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W14"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/14|Translations]] are available.
'''Weekly highlight'''
* The Beta version of [[abstract:|Abstract Wikipedia]] a new Wikimedia project which is language-independent, was launched last week. The project allows communities to build Wikipedia articles in their native language, which can be readily accessed by other users in their own languages. The wiki is powered by instructions from Wikifunctions and also based on structured content from Wikidata. [[:f:Special:MyLanguage/Wikifunctions:Status updates/2026-03-26|Read more]].
'''Updates for editors'''
* The Growth team is running an A/B test to evaluate a clearer, more user-friendly message that promotes account creation on wikis. Currently when logged-out mobile users begin editing, they see a jarring warning message that can feel abrupt and discouraging. This also presents temporary account editing as the default rather than encouraging account creation. The test is running on ten Wikipedias, including Arabic, French, Spanish and German. [[mw:Special:MyLanguage/Contributors/Account Creation Experiments#2. Improve logged-out warning message (T415160)|Read more]].
* The Wikimedia Apps team is inviting feedback on [[mw:Special:MyLanguage/Wikimedia Apps/Team/Future of Editing on the Mobile Apps|how editing should work on the Wikipedia mobile apps]]. The discussion focuses on improving how users access editing tools when they tap "Edit". This is part of a broader effort to convert readers who develop an interest in editing, to access a more user-friendly pathway to start contributing.
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:45}} community-submitted {{PLURAL:45|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, an issue where citation fetching from the large newspaper archive [https://www.newspapers.com Newspapers.com] was no longer working, due to a block in [[mw:Special:MyLanguage/Citoid|Citoid]] requests, has now been fixed. [https://phabricator.wikimedia.org/T419903]
'''Updates for technical contributors'''
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.22|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/14|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W14"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 19:23, 30 Marso 2026 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30329462 -->
== Join the sixth Ukraine’s Cultural Diplomacy Month on Wikipedia! ==
<div lang="en" dir="ltr">
[[File:Ukraine’s Cultural Diplomacy Month on Wikipedia 2026.png|right|250px|thumb|link=https://meta.wikimedia.org/wiki/Ukraine%27s_Cultural_Diplomacy_Month_2026|Join our campaign!]]
{{int:please-translate}}
Dear Wikipedians!
[[:m:Special:MyLanguage/Wikimedia Ukraine|Wikimedia Ukraine]], in cooperation with the [[:en:Ministry of Foreign Affairs of Ukraine|MFA of Ukraine]] and [[:en:Ukrainian Institute|Ukrainian Institute]], has launched the sixth edition of writing challenge "'''[[:m:Special:MyLanguage/Ukraine's Cultural Diplomacy Month 2026|Ukraine's Cultural Diplomacy Month]]'''", which lasts from '''1st April''' until '''30th April 2026'''.
The initiative aims to promote knowledge about Ukrainian culture abroad by creating and improving Wikipedia articles in multiple languages. This year marks the sixth edition of the campaign, which will focus on contemporary culture, making today’s artistic voices and practices more visible to international audiences.
🧩'''How to participate?'''
Choose an article from the suggested list → Write an article in your language, or improve an existing one according to the rules → Add your contribution to the contest page and calculate your points → Win prizes and receive a certificate of participation → Become a promoter of truthful knowledge about Ukraine.
🧩'''[[m:Special:MyLanguage/Ukraine's Cultural Diplomacy Month 2026|Check our main page for more information]]'''.
'''If you are interested in coordinating long-term community engagement for the campaign and becoming a local ambassador, we would love to hear from you! Please let us know your interest.'''
If not, then we encourage you to translate the [[m:Special:MyLanguage/Ukraine's Cultural Diplomacy Month 2026|landing page of the contest]] and [https://meta.wikimedia.org/wiki/Special:MessageGroupStats?group=Centralnotice-tgroup-UCDM2026banner&messages=&language=en&x=D banner] into your own language.
Also, we set up a [[:m:CentralNotice/Request/Ukraine's Cultural Diplomacy Month 2026|banner]] to notify users of the possibility to participate in this challenge!
[[:m:User:OlesiaLukaniuk (WMUA)|OlesiaLukaniuk (WMUA)]] ([[:m:User talk:OlesiaLukaniuk (WMUA)|talk]]) 04:35, 1 April 2026 (UTC)
</div>
<!-- Message sent by User:OlesiaLukaniuk (WMUA)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:OlesiaLukaniuk_(WMUA)/list_of_wikis&oldid=28552112 -->
== Action Required: Update templates/modules for electoral maps (Migrating from P1846 to P14226) ==
Hello everyone,
This is a notice regarding an ongoing data migration on Wikidata that may affect your election-related templates and Lua modules (such as <code>Module:Itemgroup/list</code>).
'''The Change:'''<br />
Currently, many templates pull electoral maps from Wikidata using the property [[:d:Property:P1846|P1846]], combined with the qualifier [[:d:Property:P180|P180]]: [[:d:Q19571328|Q19571328]].
We are migrating this data (across roughly 4,000 items) to a newly created, dedicated property: '''[[:d:Property:P14226|P14226]]'''.
'''What You Need To Do:'''<br />
To ensure your templates and infoboxes do not break or lose their maps, please update your local code to fetch data from [[:d:Property:P14226|P14226]] instead of the old [[:d:Property:P1846|P1846]] + [[:d:Property:P180|P180]] structure. A [[m:Wikidata/Property Migration: P1846 to P14226/List|list of pages]] was generated using Wikimedia Global Search.
'''Deadline:'''<br />
We are temporarily retaining the old data on [[:d:Property:P1846|P1846]] to allow for a smooth transition. However, to complete the data cleanup on Wikidata, the old [[:d:Property:P1846|P1846]] statements will be removed after '''May 1, 2026'''. Please update your modules and templates before this date to prevent any disruption to your wiki's election articles.
Let us know if you have any questions or need assistance with the query logic. Thank you for your help! [[User:ZI Jony|ZI Jony]] using [[Gumagamit:MediaWiki message delivery|MediaWiki message delivery]] ([[Hisgot sa Gumagamit:MediaWiki message delivery|talk]]) 17:11, 3 Abril 2026 (UTC)
<!-- Message sent by User:ZI Jony@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Distribution_list/Non-Technical_Village_Pumps_distribution_list&oldid=29941252 -->
== <span lang="en" dir="ltr">Tech News: 2026-15</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W15"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/15|Translations]] are available.
'''Updates for editors'''
* The [[mw:Special:MyLanguage/Help:Extension:CampaignEvents|CampaignEvents extension]] now includes a new group goal-setting feature, enabling organizers to set and track event goals such as the number of articles created and participating contributors in real time. Similarly, participants can work toward shared targets and see their collective impact as the event unfolds. The feature is now available on all Wikimedia wikis. Learn more in [[mw:Special:MyLanguage/Help:Extension:CampaignEvents/Registration/Collaborative contributions#Goal setting|the documentation]].
* [[File:Maki-gift-15.svg|12px|link=|class=skin-invert|Wishlist item]] The new [[mw:Special:MyLanguage/Help:Watchlist labels|watchlist labels]] feature (announced in [[m:Special:MyLanguage/Tech/News/2026/07|Tech News 2026-07]]) is now available via VisualEditor, the source editor, and the 'watchstar' (or watch link, for skins that don't have a star icon). Previously it was only possible to assign labels via [[Special:EditWatchlist|EditWatchlist]]. In all three places it is a new field following the expiry field.
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:23}} community-submitted {{PLURAL:23|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the issue where talk pages on mobile with Parsoid are unusable after empty section headers, has now been fixed. [https://phabricator.wikimedia.org/T419171]
'''Updates for technical contributors'''
* The [[m:Special:MyLanguage/WMDE Technical Wishes/Sub-referencing|sub-referencing feature]], which lets editors add details to an existing reference without duplicating it, will be gradually rolled out to [[phab:T414094|more wikis]] later this year. Wikis using the [[mw:Special:MyLanguage/Reference Tooltips|Reference Tooltips]] gadget are encouraged to update their version (typically at [[m:MediaWiki:Gadget-ReferenceTooltips.js|MediaWiki:Gadget-ReferenceTooltips.js]] as shown [https://en.wikipedia.org/w/index.php?diff=1344408362 here]) to ensure compatibility. Other reference-related gadgets may also be affected. [https://phabricator.wikimedia.org/T416304]
* All Wikinews editions will be closed and switched to read-only mode on 4 May 2026. Content will remain accessible, but no new edits or articles can be added. This closure was approved by the Board of Trustees of the Wikimedia Foundation following extended discussions. [[m:Wikimedia Foundation Board noticeboard#Board of Trustees Approves Closure of Wikinews|Read more]].
* The [[:mw:Special:MyLanguage/API:Action API|Action API]] has had several formats for requested output. One of them, <bdi lang="zxx" dir="ltr"><code><nowiki>format=php</nowiki></code></bdi>, is being removed soon. Please ensure your scripts or bots use the [[mw:Special:MyLanguage/API:Data formats#Output|JSON format]]. This removal should affect very few scripts and bots. [https://phabricator.wikimedia.org/T118538]
* The [[Special:NamespaceInfo|Special:NamespaceInfo]] page now includes namespace aliases. For example "WP" for the "Project" ("Wikipedia") namespace on the German Wikipedia. [https://phabricator.wikimedia.org/T381455]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.23|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/15|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W15"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 16:17, 6 Abril 2026 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30362761 -->
== <span lang="en" dir="ltr">Tech News: 2026-16</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W16"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/16|Translations]] are available.
'''Weekly highlight'''
* Experienced editors are invited to [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page test] the [[mw:Special:MyLanguage/Article guidance|Article guidance]] feature, designed to help less-experienced editors create well-structured, policy-compliant Wikipedia articles. Testing instructions are [[mw:Special:MyLanguage/Article guidance/Test feature guide|available]]. Also, after reviewing [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance the outlines], please provide feedback on the [[mw:Talk:Article guidance|project talk page]]. Based on your input, the feature will be refined and transferred to the pilot Wikipedias to translate and adapt. Check out [[c:File:Article Guidance workflow demo - April 2026.webm|the video]] explaining the feature.
'''Updates for editors'''
* On most wikis, all autoconfirmed users can now use [[Special:ChangeContentModel|Special:ChangeContentModel]] page to [[mw:Special:MyLanguage/Help:ChangeContentModel|create new pages with custom content models]], such as mass message lists, making custom page formats more accessible. Check [[Special:ListGroupRights|Special:ListGroupRights]] for the status of your wiki. [https://phabricator.wikimedia.org/T248294]
* The Growth team has launched an [[mw:Special:MyLanguage/Contributors/Account_Creation_Experiments|account creation experiment]] to evaluate whether adding an account creation button to the mobile web header increases new account registrations and encourages more mobile users to contribute to the wikis. The experiment is currently live on Hindi, Indonesian, Bengali, Thai, and Hebrew Wikipedia, and targets 10% of logged-out mobile web users.
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:30}} community-submitted {{PLURAL:30|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, an issue where VisualEditor could get stuck loading on Windows devices with animations turned off, has now been fixed. [https://phabricator.wikimedia.org/T382856]
'''Updates for technical contributors'''
* Starting later this week, {{int:group-abusefilter}} who have the [[mw:Special:MyLanguage/Help:Extension:CodeMirror|{{int:codemirror-beta-feature-title}}]] beta feature enabled will have [[mw:Special:MyLanguage/Extension:CodeMirror|CodeMirror]] instead of [[mw:Special:MyLanguage/Extension:CodeEditor|CodeEditor]] as the editor at [[Special:AbuseFilter|Special:AbuseFilter]]. This is part of the broader effort to make the user experience more consistent across all editors. [https://phabricator.wikimedia.org/T399673][https://phabricator.wikimedia.org/T419332]
* Tools and bots that access the [[mw:Special:MyLanguage/Notifications/API|Notifications API]] (<bdi lang="zxx" dir="ltr"><code><nowiki>action=query&meta=notifications</nowiki></code></bdi>) will need to update their OAuth or BotPassword grants to also include access to private notifications. [https://phabricator.wikimedia.org/T421991]
* Due to a library upgrade, listings on category pages may be displayed out of order starting on Monday, 20th April. A migration script will be run to correct this, and will take hours to days depending on the size of the wiki (up to a week for English Wikipedia). [https://phabricator.wikimedia.org/T422544]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.24|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/16|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W16"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 15:16, 13 Abril 2026 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30380527 -->
== <span lang="en" dir="ltr">Tech News: 2026-17</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W17"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/17|Translations]] are available.
'''Weekly highlight'''
* After two years of development, [[mw:Special:MyLanguage/Help:Extension:CodeMirror|{{int:codemirror-beta-feature-title}}]], also known as [[mw:Special:MyLanguage/Extension:CodeMirror|CodeMirror 6]], is to be promoted out of beta on Tuesday, April 21. It brings better code and wikitext readability, reduction in typing errors, and other [[mw:Special:MyLanguage/Help:Extension:CodeMirror|benefits]] to all users of the standard syntax highlighter. A huge thank you to volunteer [https://phabricator.wikimedia.org/p/Bhsd/ Bhsd] who developed many of the new features, including [[mw:Special:MyLanguage/Help:Extension:CodeMirror#Code folding|code folding]], [[mw:Special:MyLanguage/Help:Extension:CodeMirror#Autocompletion|autocompletion]], and [[mw:Special:MyLanguage/Help:Extension:CodeMirror#Linting|linting]]. [https://phabricator.wikimedia.org/T259059]
* A major update to the Wikipedia app for iOS is now rolling out, redesigning the interface to align with Apple's latest "Liquid Glass" visual design. [https://apps.apple.com/us/app/wikipedia/id324715238 Download the latest version] and explore the update.
'''Updates for editors'''
* [[mw:Special:MyLanguage/Readers/Reader Experience/WE3.3.4 Reading lists|Reading lists]] is a feature which allows readers to save articles to a list for reading later. This feature is now in beta on Arabic, French, Indonesian, Vietnamese, and Chinese Wikipedias and by default for all new accounts on all Wikipedias.
* An experiment which explores extending [[mw:Special:MyLanguage/Readers/Reader Growth/Mobile page previews|Page Previews to mobile web]] will be launched in the week of April 20 on Arabic, English, French, Italian, Polish, and Vietnamese Wikipedias. Page Previews are pop-ups that display a thumbnail, lead paragraph, and a link to open the full article of a blue link, thereby improving content discovery. The feature is already available on desktop and in the apps. [[m:Special:MyLanguage/List of experiments in Product and Technology#Template|Read more about this experiment and others]].
* On several wikis, logged-in editors who haven't [[mw:Special:MyLanguage/Help:Email confirmation|confirmed their email addresses]] can now see a banner encouraging them to do so. Having the email address confirmed allows a user to restore access to the account if they lose it. [[mw:Special:MyLanguage/Product Safety and Integrity/Account Security#Encouraging users to confirm their email addresses|Learn more]]. [https://phabricator.wikimedia.org/T421366]
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:15}} community-submitted {{PLURAL:15|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, an issue where editing very large wiki pages in the 2017 wikitext editor caused slow loading, preview and scrolling lag, and performance issues when selecting, cutting, or pasting content, has now been fixed. [https://phabricator.wikimedia.org/T184857]
'''Updates for technical contributors'''
* As part of the promotion of [[mw:Special:MyLanguage/Help:Extension:CodeMirror|CodeMirror]] from a beta feature, all users will use [[mw:Special:MyLanguage/Extension:CodeMirror|CodeMirror]] instead of [[mw:Special:MyLanguage/Extension:CodeEditor|CodeEditor]] for syntax highlighting when editing JavaScript, CSS, JSON, Vue and Lua content pages. [https://phabricator.wikimedia.org/T419332]
* The <code>mirrors.wikimedia.org</code> service for Debian and Ubuntu users will sunset and stop working on May 15. The resources for the service will be replaced with new and better options. Some users may need to switch to a different server which should take about a minute. [https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/LJYRIS4WB66HIRCAO4GIDTXCMDVZRBMA/ You can read more]. [https://phabricator.wikimedia.org/T416707]
* The <bdi lang="zxx" dir="ltr"><code><nowiki>image</nowiki></code></bdi> and <bdi lang="zxx" dir="ltr"><code><nowiki>oldimage</nowiki></code></bdi> table will be removed from [[wikitech:Help:Wiki Replicas|wikireplicas]]. If your tools or queries access <bdi lang="zxx" dir="ltr"><code><nowiki>image</nowiki></code></bdi> or <bdi lang="zxx" dir="ltr"><code><nowiki>oldimage</nowiki></code></bdi> directly, please update them to use the <bdi lang="zxx" dir="ltr"><code><nowiki>file</nowiki></code></bdi> and <bdi lang="zxx" dir="ltr"><code><nowiki>filerevision</nowiki></code></bdi> table before 28 May. [https://phabricator.wikimedia.org/T28741]
* Following the recent implementation of global API rate limits on unidentified traffic, the Wikimedia Foundation will continue efforts to ensure [[mw:Special:MyLanguage/MediaWiki Product Insights/Responsible Reuse|fair use of infrastructure]] by applying global limits to identified API traffic beginning the last week of April. These limits are intentionally set as high as possible to minimise impact on the community. Bots running in Toolforge/WMCS or with the bot user right on any wiki should not be affected for now. However, all developers are advised to follow updated best practices. For more information, see [[mw:Special:MyLanguage/Wikimedia APIs/Rate limits|Wikimedia APIs/Rate limits]] and [[mw:Special:MyLanguage/Wikimedia APIs/Rate limits/FAQ|Frequently Asked Questions]].
* The [[mw:Special:MyLanguage/Attribution API|Attribution API]] is now available as a [[mw:Special:MyLanguage/Wikimedia APIs/Stability policy|beta]]. The API fetches information for crediting Wikimedia articles and media files wherever they are used. Reference documentation is available through the REST Sandbox special page available on all Wikimedia wikis (such as the [https://en.wikipedia.org/w/index.php?api=attribution.v0-beta&title=Special%3ARestSandbox REST sandbox on English Wikipedia]). Share your feedback on the [[mw:Talk:Attribution API|project talk page]].
* There is no new MediaWiki version this week.
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/17|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W17"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 14:58, 20 Abril 2026 (UTC)
<!-- Message sent by User:STei (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30432763 -->
== Request for comment (global AI policy) ==
<bdi lang="en" dir="ltr" class="mw-content-ltr">
Apologies for writing in English. {{int:Please-translate}}
A [[:m:Requests for comment/Artificial intelligence policy|request for comment]] is currently being held to decide on a global AI policy. {{int:Feedback-thanks-title}}
[[Gumagamit:MediaWiki message delivery|MediaWiki message delivery]] ([[Hisgot sa Gumagamit:MediaWiki message delivery|talk]]) 00:57, 26 Abril 2026 (UTC)
</bdi>
<!-- Message sent by User:Codename Noreste@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Distribution_list/Global_message_delivery&oldid=30424282 -->
== <span lang="en" dir="ltr">Tech News: 2026-18</span> ==
<div lang="en" dir="ltr">
<section begin="technews-2026-W18"/><div class="plainlinks">
Latest '''[[m:Special:MyLanguage/Tech/News|tech news]]''' from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. [[m:Special:MyLanguage/Tech/News/2026/18|Translations]] are available.
'''Updates for editors'''
* There is a change in how new users are autoconfirmed that will improve anti-vandalism protection. Currently, users who have had an account for a few days and made a few edits are automatically added to the [[{{int:grouppage-autoconfirmed/{{CONTENTLANGUAGE}}}}|{{int:group-autoconfirmed}}]] group. This configuration tends to be exploited by some vandals, who create accounts and start to use them only after some time. To mitigate this, the configuration will be updated next week so that – for the purpose of becoming autoconfirmed – the account age will be counted from their first edit, instead of registration date. The numeric value of the age threshold will remain the same. This change will be deployed only to wikis which require at least one edit as part of the autoconfirmation conditions. [https://phabricator.wikimedia.org/T418484]
* All Wikipedia users with new accounts and those who activated the "automatically enable most beta features" option in their preference can now use the [[mw:Special:MyLanguage/Readers/Reader Experience/WE3.3.4 Reading lists|reading lists]] beta feature to save articles for later reading. This helps organize reading interests in one place for convenient access.
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] View all {{formatnum:30}} community-submitted {{PLURAL:30|task|tasks}} that were [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resolved last week]]. For example, the issue where infobox images have huge padding in Firefox, has been fixed. [https://phabricator.wikimedia.org/T423676]
'''Updates for technical contributors'''
* As a reminder, the global API rate limits will be applied this week to identified API traffic. This is to help ensure [[mw:MediaWiki Product Insights/Responsible Reuse|fair use of infrastructure]]. Bots running in Toolforge/WMCS or with the bot user right on any wiki should not be affected for now. However, all developers are advised to follow updated best practices. For more information, including the actual rate limits, see [[mw:Wikimedia APIs/Rate limits|Wikimedia APIs/Rate limits]] and [[mw:Wikimedia APIs/Rate limits/FAQ|Frequently Asked Questions]].
* [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Recurrent item]] Detailed code updates later this week: [[mw:MediaWiki 1.46/wmf.26|MediaWiki]]
'''''[[m:Special:MyLanguage/Tech/News|Tech news]]''' prepared by [[m:Special:MyLanguage/Tech/News/Writers|Tech News writers]] and posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]] • [[m:Special:MyLanguage/Tech/News#contribute|Contribute]] • [[m:Special:MyLanguage/Tech/News/2026/18|Translate]] • [[m:Tech|Get help]] • [[m:Talk:Tech/News|Give feedback]] • [[m:Global message delivery/Targets/Tech ambassadors|Subscribe or unsubscribe]].''
</div><section end="technews-2026-W18"/>
</div>
<bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 18:04, 27 Abril 2026 (UTC)
<!-- Message sent by User:UOzurumba (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30458046 -->
== Program submissions open: Bikol WikiConference 2026 ==
[[File:Bikol_WikiConference_2026_logo.png|frameless|250px|right]]
The '''[[m:Bikol Wikipedia Community/Bikol WikiConference 2026|Bikol WikiConference 2026]]''' will take place '''29–31 May 2026 in Naga City''', under the theme: ''Advancing Language and Culture in the Digital Age''.
The Bikol WikiCon is an extraordinary regional gathering that brings together Bikolanos actively supporting and contributing to open educational resources (OERs) with the vibrant Wikimedia communities in the Philippines. Next year, Bikol Wikipedia will be turning 20 years old. Reaching 2 decades is a strong milestone therefore it is also the right moment to ask harder questions about sustainability, quality and direction. The conference will serve as a venue for the participants to exchange and share their experiences, new ideas, and collaboration results, and to discuss the challenges encountered and the solutions adopted. We can’t wait to see you at the event!
The conference will cover topics pertaining to Digital Resources, Heritage Advocacy, Cultural Preservation, and Partnerships with various institutional, social, and cultural contexts.
You may submit any of the following types of session proposals:
* '''Lightning talk:''' One presenter gives a talk with no follow-up by the audience. The total time for a lightning talk will be 10-15 minutes.
* '''Lecture:''' One or two presenters offer(s) a presentation followed by questions and comments from the audience. The total time for a lecture (including questions and comments) will be 30-45 minutes.
* '''Roundtable:''' A group of 10-15 people discusses a particular topic. The total time for a roundtable discussion will be 60 minutes.
* '''Workshop:''' One or two moderators present(s) a topic by actively interacting with the audience. The total time for a workshop will be 60-120 minutes.
* '''Meetup:''' A group of people with common interests informally meets to discuss different topics. The total time for a meetup is not pre-determined and depends on the proposer’s preferences.
Submissions will be evaluated by the Program Committee based on:
* Potential impact and expected outcomes
* Relevance to the conference theme or focus areas
Sessions may be recorded and made publicly available. If you prefer not to be filmed, you may indicate this during submission.
'''→ [[m:Bikol Wikipedia Community/Bikol WikiConference 2026/Program|Submit your proposal on Meta]] or [https://docs.google.com/forms/d/e/1FAIpQLSd1vYWPvrNltZS2ie51lYK-OB6cfS8E2NQFjH1I213dYl24NQ/viewform?usp=header Google Form]''' on or before '''May 15.'''
For more information, or questions, contact: bikolwikicommunity(@)gmail.com
Mabalos!
On behalf of the Bikol WikiConference Organizing Team,<br> [[Gumagamit:Filipinayzd|Filipinayzd]] ([[Hisgot sa Gumagamit:Filipinayzd|talk]]) 06:42, 2 Mayo 2026 (UTC)
1z7yd95xmpgdl2f5ypss3fshae52gdu
Habagatang Leyte
0
957
37019545
34909579
2026-05-01T14:33:30Z
Exec8
10305
37019545
wikitext
text/x-wiki
Ang '''Southern Leyte''' (''Sinugboanon:'' '''Habagatang Leyte''') usa ka lalawigan sa [[Sidlakang Kabisay-an]]. Kining lalawigana mao ra ang lalawigan sa Sidlakang Kabisay-an nga ang kadaghanang lungsod ug dakbayan niini Bohol-anun ang pinulongan.
Ang kapital o ulohan sa lalawigan mao ang [[Dakbayan sa Maasin]]. Ang lalawigan nahimutang sa ika-upat nga habagatang dapit sa pulo sa [[Leyte (pulo)|Leyte]]. Sa amihanan sa Habagatang Leyte makaplagan ang probinsiya o lalawigan sa [[Leyte (lalawigan)|Leyte]]. Sa sidlakan makaplagan ang [[Surigao Strait]]. Ang [[Dagat Bohol]] makaplagan sa habagatan, ug ang [[Canigao Channel]], sa kasadpan.
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Southern Leyte<br>Lalawigan sa Habagatang Leyte|
sealfile=[[Image:Ph seal southern leyte.png]]|
rehiyon=[[Sidlakang Kabisay-an]] (Region VIII)|
capital=[[Dakbayan sa Maasin]]|
founded=[[22 sa Mayo]], [[1959]]|
pop2000=360,160|
pop2000rank=ika-18 smallest|
popden2000=208|
popden2000rank=ika-42 highest|
areakm2=1,734.8|
arearank=ika-16 smallest|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=1|
mga lungsod=18|
mga barangay=500|
mga distrito=1|
mga pinulongan=[[Sinugboanon|Sinugboanon]]|
gobernador=Rosette Y. Lerias|
locatormapfile=[[Image:Ph_locator_map_southern_leyte (white).png]]}}
==Heyograpiya==
===Politikal===
Ang lalawigan sa Habagatang Leyte may usa ka nahisakpang dakbayan ug 18 ka lungsod.
====Dakbayan====
*[[Dakbayan sa Maasin]]
====Mga Lungsod====
<table border="0"><tr>
<td valign="top">
*[[Anahawan, Habagatang Leyte|Anahawan]]
*[[Bontoc, Habagatang Leyte|Bontoc]]
*[[Hinunangan, Habagatang Leyte|Hinunangan]]
*[[Hinundayan, Habagatang Leyte|Hinundayan]]
*[[Libagon, Habagatang Leyte|Libagon]]
*[[Liloan, Habagatang Leyte|Liloan]]
*[[Limasawa, Habagatang Leyte|Limasawa]]
*[[Macrohon, Habagatang Leyte|Macrohon]]
*[[Malitbog, Habagatang Leyte|Malitbog]]
</td><td valign="top">
*[[Padre Burgos, Habagatang Leyte|Padre Burgos]]
*[[Pintuyan, Habagatang Leyte|Pintuyan]]
*[[Saint Bernard, Habagatang Leyte|Saint Bernard]]
*[[San Francisco, Habagatang Leyte|San Francisco]]
*[[San Juan, Habagatang Leyte|San Juan]] (Cabalian)
*[[San Ricardo, Habagatang Leyte|San Ricardo]]
*[[Silago, Habagatang Leyte|Silago]]
*[[Sogod, Habagatang Leyte|Sogod]]
*[[Tomas Oppus, Habagatang Leyte|Tomas Oppus]]
</td></tr></table>
===Pisikal===
==Ekonomiya==
==Kasaysayan==
==Kitaa Usab==
*[[Talaan sa mga gobernador sa Habagatang Leyte]]
==Impormasyon sa Gawas==
*[http://elgu.ncc.gov.ph/ecommunity/southernleyte/index.php Opisyal na Website sa Habagatang Leyte] {{Webarchive|url=https://web.archive.org/web/20090226052710/http://elgu.ncc.gov.ph/ecommunity/southernleyte/index.php |date=2009-02-26 }}
*[http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Southern%20Leyte Panid mahitungod sa Habagatang Leyte sa Ahensya Impormasyon Pilipinhon (Philippine Information Agency)] {{Webarchive|url=https://web.archive.org/web/20070927015804/http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Southern%20Leyte |date=2007-09-27 }}
*[http://www.southernleyteonline.com/index.htm Ang Websayt nga Southern Leyte Online] {{Webarchive|url=https://web.archive.org/web/20060325223930/http://www.southernleyteonline.com/index.htm |date=2006-03-25 }}
== Mga Reperensya ==
{{reflist|2}}
{{Southern Leyte}}
{{Sidlakang Kabisay-an}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
3jbe64ivrm0d2fne0tf6yy8rbw7l725
Leyte (lalawigan)
0
959
37019540
34902726
2026-05-01T14:31:52Z
Exec8
10305
37019540
wikitext
text/x-wiki
<div style="float: right; width: 300px; background-color: #DEF; margin: 0px 0px 1em 1em;"><div style="padding: 0.5em;">''Kining artikulo mahitungod sa lalawigan sa Leyte. Para sa impormasyon mahitungod sa pulo kitaa ang [[Leyte (pulo)]].''</div></div>
Ang '''lalawigan sa Leyte''' diha sa amihanang dapit sa pulo sa Leyte. Ang lalawigan nahimutangan sa kasadpan sa [[Samar (lalawigan)|lalawigan sa Samar]], ug sa amihanan sa [[Southern Leyte]]. Sa amihanang dapit sa lalawigan makaplagan ang pulo-lalawigan sa [[Biliran]]. Ang [[Dagat sa Camotes]] makaplagan sa kasadpan sa lalawigan samtang ang [[Golpo sa Leyte]] makaplagan sa sidlakan. Sa kasadpan, tabok sa Dagat sa Camotes, makaplagan ang lalawigan sa [[Sugbo]].
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Leyte|
sealfile=[[Payl:Ph_seal_leyte.png]]|
rehiyon=[[Sidlakang Kabisay-an]] (Region VIII)|
capital=[[Dakbayan sa Tacloban]]|
founded=[[Marso 10]], [[1917]]|
pop2000=1,592,336 |
pop2000rank=ika-14 sa kinadak-an|
popden2000=279|
popden2000rank=ika-24 sa kinadam-an|
areakm2=5,712.8|
arearank=ika-12 sa kinadak-an|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=3|
mga lungsod=40|
mga barangay=1,641|
mga distrito=5|
mga pinulongan=[[Winaray]], [[Sinugboanon]]|
gobernador=Leopoldo Dominico Petilla|
locatormapfile=[[Payl:Ph_locator_map_leyte (white).png]]}}
== Kataw'han ==
Duha ang pinulongang Binisayang gisulti dire: [[Sinugboanon]] ug [[Winaray]]. Sinugboanon ang pinulongan sa kasadpang dapit sa lalawigan. Winaray ang pinulongan sa sidlakan.
=== Mga Lungsod ug Dakbayang Sugboanon ===
<table border="0"><tr>
<td valign="top">
* [[Albuera, Leyte|Albuera]]
* [[Bato, Leyte|Bato]]
* [[Baybay, Leyte|Baybay]]
* [[Calubian, Leyte|Calubian]]
* [[Hilongos, Leyte|Hilongos]]
* [[Hindang, Leyte|Hindang]]
* [[Inopacan, Leyte|Inopacan]]
* [[Isabel, Leyte|Isabel]]
* [[Kananga, Leyte|Kananga]]
</td><td valign="top">
* [[Mahaplag, Leyte|Mahaplag]] (?)
* [[Matag-ob, Leyte|Matag-ob]]
* [[Matalom, Leyte|Matalom]]
* [[Merida, Leyte|Merida]]
* [[Dakbayan sa Ormoc]]
* [[Palompon, Leyte|Palompon]]
* [[San Isidro, Leyte|San Isidro]]
* [[Tabango, Leyte|Tabango]]
* [[Villaba, Leyte|Villaba]]
</td></tr></table>
=== Mga Lungsod ug Dakbayang Waraynon ===
<table border="0"><tr>
<td valign="top">
* [[Abuyog, Leyte|Abuyog]]
* [[Alangalang, Leyte|Alangalang]]
* [[Babatngon, Leyte|Babatngon]]
* [[Barugo, Leyte|Barugo]]
* [[Burauen, Leyte|Burauen]]
* [[Capoocan, Leyte|Capoocan]]
* [[Carigara, Leyte|Carigara]]
* [[Dagami, Leyte|Dagami]]
* [[Dulag, Leyte|Dulag]]
* [[Jaro, Leyte|Jaro]]
* [[Javier, Leyte|Javier]]
* [[Julita, Leyte|Julita]]
* [[La Paz, Leyte|La Paz]]
</td><td valign="top">
* [[Leyte, Leyte|Leyte]]
* [[MacArthur, Leyte|MacArthur]]
* [[Mahaplag, Leyte|Mahaplag]] (?)
* [[Mayorga, Leyte|Mayorga]]
* [[Palo, Leyte|Palo]]
* [[Pastrana, Leyte|Pastrana]]
* [[San Miguel, Leyte|San Miguel]]
* [[Santa Fe, Leyte|Sta. Fe]]
* [[Tabontabon, Leyte|Tabontabon]]
* [[Dakbayan sa Tacloban]]
* [[Tanauan, Leyte|Tanauan]]
* [[Tolosa, Leyte|Tolosa]]
* [[Tunga, Leyte|Tunga]]
</td></tr></table>
== Heyograpiya ==
=== Politikal ===
Tulo (3) ang dakbayan sa lalawigan ug 40 ang mga lungsod. Ang [[Dakbayan sa Ormoc]] ''independent component city'' ug dili sakop sa mga pamalaod sa lalawigan sa Leyte.
==== Mga Dakbayan ====
* [[Dakbayan sa Baybay]]
* [[Dakbayan sa Ormoc]]
* [[Dakbayan sa Tacloban]]
==== Mga Lungsod ====
<table border="0"><tr>
<td valign="top">
* [[Abuyog, Leyte|Abuyog]]
* [[Alangalang, Leyte|Alangalang]]
* [[Albuera, Leyte|Albuera]]
* [[Babatngon, Leyte|Babatngon]]
* [[Barugo, Leyte|Barugo]]
* [[Bato, Leyte|Bato]]
* [[Burauen, Leyte|Burauen]]
* [[Calubian, Leyte|Calubian]]
* [[Capoocan, Leyte|Capoocan]]
* [[Carigara, Leyte|Carigara]]
* [[Dagami, Leyte|Dagami]]
* [[Dulag, Leyte|Dulag]]
* [[Hilongos, Leyte|Hilongos]]
* [[Hindang, Leyte|Hindang]]
* [[Inopacan, Leyte|Inopacan]]
* [[Isabel, Leyte|Isabel]]
* [[Jaro, Leyte|Jaro]]
* [[Javier, Leyte|Javier]] (Bugho)
* [[Julita, Leyte|Julita]]
* [[Kananga, Leyte|Kananga]]
</td><td valign="top">
* [[La Paz, Leyte|La Paz]]
* [[Leyte, Leyte|Leyte]]
* [[MacArthur, Leyte|MacArthur]]
* [[Mahaplag, Leyte|Mahaplag]]
* [[Matag-ob, Leyte|Matag-ob]]
* [[Matalom, Leyte|Matalom]]
* [[Mayorga, Leyte|Mayorga]]
* [[Merida, Leyte|Merida]]
* [[Palo, Leyte|Palo]]
* [[Palompon, Leyte|Palompon]]
* [[Pastrana, Leyte|Pastrana]]
* [[San Isidro, Leyte|San Isidro]]
* [[San Miguel, Leyte|San Miguel]]
* [[Santa Fe, Leyte|Santa Fe]]
* [[Tabango, Leyte|Tabango]]
* [[Tabontabon, Leyte|Tabontabon]]
* [[Tanauan, Leyte|Tanauan]]
* [[Tolosa, Leyte|Tolosa]]
* [[Tunga, Leyte|Tunga]]
* [[Villaba, Leyte|Villaba]]
</td></tr></table>
=== Pisikal ===
== Ekonomiya ==
== Kasaysayan ==
== Tan-awa usab ==
* [[Talaan sa mga gobernador sa Leyte]]
==Mga sumpay sa gawas==
* [http://www.leyte.org.ph/index.html Opisyal nga Website sa Lalawigan sa Leyte] {{Webarchive|url=https://web.archive.org/web/20080103011331/http://www.leyte.org.ph/index.html |date=2008-01-03 }}
* [http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Leyte Panid sa PIA mahitungod sa Leyte] {{Webarchive|url=https://web.archive.org/web/20070318071456/http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Leyte |date=2007-03-18 }}
== Mga Reperensya ==
{{reflist|2}}
{{Leyte}}
{{Sidlakang Kabisay-an}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
dpcw1ndz1rqw4ne74h4jp8c1wyfrnzk
Siquijor
0
1423
37019656
34909604
2026-05-01T16:29:22Z
Exec8
10305
37019656
wikitext
text/x-wiki
Ang '''Siquijor''' pulo ug lalawigan sa Pilipinas sa Sentral sa Kabisay-an. Ang kapital niini ang lungsod ginganlan usab na [[Siquijor, Siquijor|Siquijor]]. Sa ''amihanang-kasadpan'' sa Siquijor ang Sugbo ug Negros, sa ''amihanang-sidlakan'' Bohol ug sa habagat, atbang sa Dagat Bohol ang Mindanao.
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Siquijor|
sealfile=[[Image:Ph_seal_siquijor.png]]|
rehiyon=[[Tunga-tungang Kabisay-an]] (Region VII)|
capital=[[Siquijor, Siquijor|Siquijor]]|
founded=[[17 sa Setyembre]], [[1971]]|
pop2000=81,598|
pop2000rank=ika-3 sa kinagamay|
popden2000=238|
popden2000rank=ika-32 sa kinataas|
areakm2=343.5|
arearank=ika-3 sa kinagamay|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=0|
mga lungsod=6|
mga barangay=134|
mga distrito=1|
mga pinulongan=[[Sinugboanon|Sinugboanon]]|
gobernador=Orlando Fua, Sr.|
locatormapfile=[[Image:Ph_locator_map_siquijor (white).png]]}}
==Kataw'han==
===Pinulongan===
Binisayang [[Sinugboanon]] ang lumad na pinulongan sa Siquijor.
==Heyograpiya==
Unom (6) ang lungsod sa lalawigan sa Siquijor.
===Mga Lungsod===
<table border="0"><tr>
<td valign="top">
*[[Enrique Villanueva, Siquijor|Enrique Villanueva]]
*[[Larena, Siquijor|Larena]]
*[[Lazi, Siquijor|Lazi]]
</td><td valign="top">
*[[Maria, Siquijor|Maria]]
*[[San Juan, Siquijor|San Juan]]
*[[Siquijor, Siquijor|Siquijor]]
</td></tr></table>
===Pisikal===
<div style="text-align:center; margin:1em 0em; clear:both;">[[Image:Ph_map_siquijor.png]]</div>
==Ekonomiya==
==Medya==
*D___ Radyo Taksim 100.9 MHz (Audiovisual Communicators, Inc.)
*DYWS 106.9 MHz
==Kasaysayan==
== Mga Reperensya ==
{{reflist|2}}
{{Siquijor}}
{{Rehiyon sa Isla sa Negros}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
tso51ftlqfq3uj08itck493xl8ee6zz
37019657
37019656
2026-05-01T16:29:59Z
Exec8
10305
37019657
wikitext
text/x-wiki
Ang '''Siquijor''' pulo ug lalawigan sa Pilipinas sa Sentral sa Kabisay-an. Ang kapital niini ang lungsod ginganlan usab na [[Siquijor, Siquijor|Siquijor]]. Sa ''amihanang-kasadpan'' sa Siquijor ang Sugbo ug Negros, sa ''amihanang-sidlakan'' Bohol ug sa habagat, atbang sa Dagat Bohol ang Mindanao.
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Siquijor|
sealfile=[[Image:Ph_seal_siquijor.png]]|
rehiyon=[[Tunga-tungang Kabisay-an]] (Region VII)|
capital=[[Siquijor, Siquijor|Siquijor]]|
founded=[[17 sa Setyembre]], [[1971]]|
pop2000=81,598|
pop2000rank=ika-3 sa kinagamay|
popden2000=238|
popden2000rank=ika-32 sa kinataas|
areakm2=343.5|
arearank=ika-3 sa kinagamay|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=0|
mga lungsod=6|
mga barangay=134|
mga distrito=1|
mga pinulongan=[[Sinugboanon|Sinugboanon]]|
gobernador=Orlando Fua, Sr.|
locatormapfile=[[Image:Ph_locator_map_siquijor (white).png]]}}
==Kataw'han==
===Pinulongan===
Binisayang [[Sinugboanon]] ang lumad na pinulongan sa Siquijor.
==Heyograpiya==
Unom (6) ang lungsod sa lalawigan sa Siquijor.
===Mga Lungsod===
<table border="0"><tr>
<td valign="top">
*[[Enrique Villanueva, Siquijor|Enrique Villanueva]]
*[[Larena, Siquijor|Larena]]
*[[Lazi, Siquijor|Lazi]]
</td><td valign="top">
*[[Maria, Siquijor|Maria]]
*[[San Juan, Siquijor|San Juan]]
*[[Siquijor, Siquijor|Siquijor]]
</td></tr></table>
===Pisikal===
[[File::Ph_map_siquijor.png|right|280px]]
==Ekonomiya==
==Medya==
*D___ Radyo Taksim 100.9 MHz (Audiovisual Communicators, Inc.)
*DYWS 106.9 MHz
==Kasaysayan==
== Mga Reperensya ==
{{reflist|2}}
{{Siquijor}}
{{Rehiyon sa Isla sa Negros}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
a2fffwscpehu382l0yvzshoxb5bm7ys
37019658
37019657
2026-05-01T16:30:18Z
Exec8
10305
37019658
wikitext
text/x-wiki
Ang '''Siquijor''' pulo ug lalawigan sa Pilipinas sa Sentral sa Kabisay-an. Ang kapital niini ang lungsod ginganlan usab na [[Siquijor, Siquijor|Siquijor]]. Sa ''amihanang-kasadpan'' sa Siquijor ang Sugbo ug Negros, sa ''amihanang-sidlakan'' Bohol ug sa habagat, atbang sa Dagat Bohol ang Mindanao.
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Siquijor|
sealfile=[[Image:Ph_seal_siquijor.png]]|
rehiyon=[[Tunga-tungang Kabisay-an]] (Region VII)|
capital=[[Siquijor, Siquijor|Siquijor]]|
founded=[[17 sa Setyembre]], [[1971]]|
pop2000=81,598|
pop2000rank=ika-3 sa kinagamay|
popden2000=238|
popden2000rank=ika-32 sa kinataas|
areakm2=343.5|
arearank=ika-3 sa kinagamay|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=0|
mga lungsod=6|
mga barangay=134|
mga distrito=1|
mga pinulongan=[[Sinugboanon|Sinugboanon]]|
gobernador=Orlando Fua, Sr.|
locatormapfile=[[Image:Ph_locator_map_siquijor (white).png]]}}
==Kataw'han==
===Pinulongan===
Binisayang [[Sinugboanon]] ang lumad na pinulongan sa Siquijor.
==Heyograpiya==
Unom (6) ang lungsod sa lalawigan sa Siquijor.
===Mga Lungsod===
<table border="0"><tr>
<td valign="top">
*[[Enrique Villanueva, Siquijor|Enrique Villanueva]]
*[[Larena, Siquijor|Larena]]
*[[Lazi, Siquijor|Lazi]]
</td><td valign="top">
*[[Maria, Siquijor|Maria]]
*[[San Juan, Siquijor|San Juan]]
*[[Siquijor, Siquijor|Siquijor]]
</td></tr></table>
===Pisikal===
[[File:Ph_map_siquijor.png|right|280px]]
==Ekonomiya==
==Medya==
*D___ Radyo Taksim 100.9 MHz (Audiovisual Communicators, Inc.)
*DYWS 106.9 MHz
==Kasaysayan==
== Mga Reperensya ==
{{reflist|2}}
{{Siquijor}}
{{Rehiyon sa Isla sa Negros}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
iej4g6ye9okr2dzopmh8bw7oacsb5xy
Biliran
0
1424
37019524
34902310
2026-05-01T14:22:38Z
Exec8
10305
37019524
wikitext
text/x-wiki
Ang '''Biliran''' usa ka islang lalawigan sa Pilipinas nga nahimutang sa Rehiyon Sidlakang Kabisay-an (Rehiyon VIII). Ang Biliran usa sa kinagamyan ug labing bag-ong lalawigan sa Pilipinas. Kaniadto, ang Biliran sakop sa lalawigan sa Leyte, apan nahimo kining kaugalingong lalawigan niadtong 1992.
Ang Isla sa Biliran makit-an wala pa'y usa ka kilometro sa amihanan sa isla sa Leyte. Ang tulay nga nagsumpay sa Biliran ug Leyte mao ang tulay nga anaa sa igbaw sa Isla sa Poro.<ref>"Poro Island, Biliran, Eastern Visayas, Philippines". Google Maps. Retrieved on 2013-11-15.</ref> Ang kaulohan sa Biliran mao ang lungsod sa Naval nga anaa sa kasadpang bahin sa isla. {{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Biliran|
sealfile=[[Payl:Ph_seal_biliran.png]]|
rehiyon=[[Sidlakang Kabisay-an]] (Region VIII)|
capital=[[Naval, Biliran|Naval]]|
founded=[[11 sa Mayo]], [[1992]]|
pop2000=171,612 |
pop2000rank=pinakagamay|
popden2000=253|
popden2000rank=ika-26 sa highest|
areakm2=555.4|
arearank=ika-16 sa kinagamay|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=0|
mga lungsod=8|
mga barangay=132|
mga distrito=1|
mga pinulongan=[[Sinugboanon]], [[Winaray]]|
gobernador=Rogelio J. Espina|
locatormapfile=[[Payl:Ph_locator_map_biliran (white).png]]}}
== Katawhan ug pinulongan ==
Binisayang [[Sinugboanon]] ang pinulongan sa tulo sa mga lungsod sa Biliran ug Binisayang [[Winaray]] ang pinulongan sa uban. Ang mga lungsod nga magsusulti sa Binisayang Sinugboanon mao ang Naval, Almeria, ug Kawayan. Aduna usab ing ubang mga baranggay sa lungsod sa Culaba ug Cabucgayan ang lumad nga nagagamit sa maong pinulongan. Sa laing bahin, ang mga lungsod nga magsusulti sa Binisayang Winaray mao ang Biliran, Cabucgayan, Caibiran, Culaba ug ang Maripipi nga nagagamit sa Winaray "s" nga sama sa ginagamit nga Winaray sa atbang niining mga lungsod sa isla sa Samar inay sa Winaray "h" nga mao'y ginagamit sa kadaghanan sa Leyte ug ang ubos sa katungang bahin sa tibuok isla sa Samar.
== Mga Kalungsoran ==
=== Mga Lungsod Sinugboanon ===
*[[Naval, Biliran|Naval]]
*[[Almeria, Biliran|Almeria]]
*[[Kawayan, Biliran|Kawayan]]
=== Mga Lungsod Waraynon ===
*[[Biliran, Biliran|Biliran]]
*[[Cabucgayan, Biliran|Cabucgayan]]
*[[Caibiran, Biliran|Caibiran]]
*[[Culaba, Biliran|Culaba]]
*[[Maripipi, Biliran|Maripipi]]
== Hinalinan ==
==== '''Etymology''' ====
Sa panahon sa mga Katsila, ang gitawag karon og Biliran nahibal-an nga ''Isla de Panamao''. Ang ngalan karon sa isla gituohang sinagop tunga-tunga sa tikatapos nga ika-17 nga siglo ug sa pagsugod sa ika-18 nga siglo, matod pa sa daghang mga mantalaan nakuha kini gikan ngalan sa lumad nga balili nga gitawag nga ''borobiliran'' nga madagayong nanugbo sa mga kapatagan sa isla. Usa pa ka umiindig nga pangagpas (o teorya) sa ngalan sa isla mao ang pulong nga ''bilir'' (kun ''bilid'') nga gipakahulugan sa usa ka karaang kapulongnan nga ''kanto o tumoy sa sakayan, plorera o bisag unsang nagasiwil''. Kini nga pangagpas gisandigan upod sa kamatuoran nga ang Biliran mao'y dapit sa unang dinagkong-sukod nga hilimoan o pandayan og barko nga gitukod niadtong ika-17 nga siglo.'''<ref>Borrinaga, Rolando O. "History of Biliran". Biliran Island Undiscovered Paradise. Retrieved on 2013-11-06.</ref>'''
==Tan-awa usab==
*[[Talaan sa mga Gobernador sa Biliran]]
==Mga sumpay sa gawas==
*[http://www.biliran.gov.ph/ Official Website of the Provincial Government of Biliran] {{Webarchive|url=https://web.archive.org/web/20090413210855/http://www.biliran.gov.ph/ |date=2009-04-13 }}
*[http://elgu.ncc.gov.ph/ecommunity/biliran/ ELGU na panid sa Biliran] {{Webarchive|url=https://web.archive.org/web/20050921094849/http://elgu.ncc.gov.ph/ecommunity/biliran/ |date=2005-09-21 }}
*[http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Biliran Panid sa PIA mahitungod sa Biliran] {{Webarchive|url=https://web.archive.org/web/20070318071515/http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Biliran |date=2007-03-18 }}
*[http://www.biliranisland.com/ Biliran - The Island Paradise ]
*[http://my.biliranisland.com/ My Biliran Island Picture Gallery ]
*[http://s4.invisionfree.com/Biliran_Forum/index.php Biliran Forum] {{Webarchive|url=https://web.archive.org/web/20050406104622/http://s4.invisionfree.com/Biliran_Forum/index.php |date=2005-04-06 }}
*[https://web.archive.org/web/20001003011450/http://www.geocities.com/rolborr/official.html Biliran Province]
*[http://www.geocities.com/biliranisland Biliran Island Website] {{Webarchive|url=https://web.archive.org/web/20050525004223/http://www.geocities.com/biliranisland/ |date=2005-05-25 }}
== Mga pakisayran ==
*"Poro Island, Biliran, Eastern Visayas, Philippines". Google Maps. Retrieved on 2013-11-15.
*Borrinaga, Rolando O. "History of Biliran". Biliran Island Undiscovered Paradise. Retrieved on 2013-11-06.
*Borrinaga, Rolando O. “Lost meanings in Biliran.” [https://web.archive.org/web/20030515181554/http://www.geocities.com/bilirannews/whatname.html]
*Borrinaga, Rolando O. “How Biliran got its name.” [https://web.archive.org/web/20011108125902/http://www.geocities.com/rolborr/bilname.html]
*Biliran. “About Biliran.” [http://www.biliranisland.com/aboutbiliran.php] {{Webarchive|url=https://web.archive.org/web/20070928105501/http://www.biliranisland.com/aboutbiliran.php |date=2007-09-28 }}
== Mga Reperensya ==
{{reflist|2}}
{{Biliran}}
{{Sidlakang Kabisay-an}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
fg5xy64bnkweccurbdcvl4qrli0vy91
37019525
37019524
2026-05-01T14:22:59Z
Exec8
10305
/* Hinalinan */
37019525
wikitext
text/x-wiki
Ang '''Biliran''' usa ka islang lalawigan sa Pilipinas nga nahimutang sa Rehiyon Sidlakang Kabisay-an (Rehiyon VIII). Ang Biliran usa sa kinagamyan ug labing bag-ong lalawigan sa Pilipinas. Kaniadto, ang Biliran sakop sa lalawigan sa Leyte, apan nahimo kining kaugalingong lalawigan niadtong 1992.
Ang Isla sa Biliran makit-an wala pa'y usa ka kilometro sa amihanan sa isla sa Leyte. Ang tulay nga nagsumpay sa Biliran ug Leyte mao ang tulay nga anaa sa igbaw sa Isla sa Poro.<ref>"Poro Island, Biliran, Eastern Visayas, Philippines". Google Maps. Retrieved on 2013-11-15.</ref> Ang kaulohan sa Biliran mao ang lungsod sa Naval nga anaa sa kasadpang bahin sa isla. {{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Biliran|
sealfile=[[Payl:Ph_seal_biliran.png]]|
rehiyon=[[Sidlakang Kabisay-an]] (Region VIII)|
capital=[[Naval, Biliran|Naval]]|
founded=[[11 sa Mayo]], [[1992]]|
pop2000=171,612 |
pop2000rank=pinakagamay|
popden2000=253|
popden2000rank=ika-26 sa highest|
areakm2=555.4|
arearank=ika-16 sa kinagamay|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=0|
mga lungsod=8|
mga barangay=132|
mga distrito=1|
mga pinulongan=[[Sinugboanon]], [[Winaray]]|
gobernador=Rogelio J. Espina|
locatormapfile=[[Payl:Ph_locator_map_biliran (white).png]]}}
== Katawhan ug pinulongan ==
Binisayang [[Sinugboanon]] ang pinulongan sa tulo sa mga lungsod sa Biliran ug Binisayang [[Winaray]] ang pinulongan sa uban. Ang mga lungsod nga magsusulti sa Binisayang Sinugboanon mao ang Naval, Almeria, ug Kawayan. Aduna usab ing ubang mga baranggay sa lungsod sa Culaba ug Cabucgayan ang lumad nga nagagamit sa maong pinulongan. Sa laing bahin, ang mga lungsod nga magsusulti sa Binisayang Winaray mao ang Biliran, Cabucgayan, Caibiran, Culaba ug ang Maripipi nga nagagamit sa Winaray "s" nga sama sa ginagamit nga Winaray sa atbang niining mga lungsod sa isla sa Samar inay sa Winaray "h" nga mao'y ginagamit sa kadaghanan sa Leyte ug ang ubos sa katungang bahin sa tibuok isla sa Samar.
== Mga Kalungsoran ==
=== Mga Lungsod Sinugboanon ===
*[[Naval, Biliran|Naval]]
*[[Almeria, Biliran|Almeria]]
*[[Kawayan, Biliran|Kawayan]]
=== Mga Lungsod Waraynon ===
*[[Biliran, Biliran|Biliran]]
*[[Cabucgayan, Biliran|Cabucgayan]]
*[[Caibiran, Biliran|Caibiran]]
*[[Culaba, Biliran|Culaba]]
*[[Maripipi, Biliran|Maripipi]]
== Hinalinan ==
==== Etymologi ====
Sa panahon sa mga Katsila, ang gitawag karon og Biliran nahibal-an nga ''Isla de Panamao''. Ang ngalan karon sa isla gituohang sinagop tunga-tunga sa tikatapos nga ika-17 nga siglo ug sa pagsugod sa ika-18 nga siglo, matod pa sa daghang mga mantalaan nakuha kini gikan ngalan sa lumad nga balili nga gitawag nga ''borobiliran'' nga madagayong nanugbo sa mga kapatagan sa isla. Usa pa ka umiindig nga pangagpas (o teorya) sa ngalan sa isla mao ang pulong nga ''bilir'' (kun ''bilid'') nga gipakahulugan sa usa ka karaang kapulongnan nga ''kanto o tumoy sa sakayan, plorera o bisag unsang nagasiwil''. Kini nga pangagpas gisandigan upod sa kamatuoran nga ang Biliran mao'y dapit sa unang dinagkong-sukod nga hilimoan o pandayan og barko nga gitukod niadtong ika-17 nga siglo.'''<ref>Borrinaga, Rolando O. "History of Biliran". Biliran Island Undiscovered Paradise. Retrieved on 2013-11-06.</ref>'''
==Tan-awa usab==
*[[Talaan sa mga Gobernador sa Biliran]]
==Mga sumpay sa gawas==
*[http://www.biliran.gov.ph/ Official Website of the Provincial Government of Biliran] {{Webarchive|url=https://web.archive.org/web/20090413210855/http://www.biliran.gov.ph/ |date=2009-04-13 }}
*[http://elgu.ncc.gov.ph/ecommunity/biliran/ ELGU na panid sa Biliran] {{Webarchive|url=https://web.archive.org/web/20050921094849/http://elgu.ncc.gov.ph/ecommunity/biliran/ |date=2005-09-21 }}
*[http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Biliran Panid sa PIA mahitungod sa Biliran] {{Webarchive|url=https://web.archive.org/web/20070318071515/http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Biliran |date=2007-03-18 }}
*[http://www.biliranisland.com/ Biliran - The Island Paradise ]
*[http://my.biliranisland.com/ My Biliran Island Picture Gallery ]
*[http://s4.invisionfree.com/Biliran_Forum/index.php Biliran Forum] {{Webarchive|url=https://web.archive.org/web/20050406104622/http://s4.invisionfree.com/Biliran_Forum/index.php |date=2005-04-06 }}
*[https://web.archive.org/web/20001003011450/http://www.geocities.com/rolborr/official.html Biliran Province]
*[http://www.geocities.com/biliranisland Biliran Island Website] {{Webarchive|url=https://web.archive.org/web/20050525004223/http://www.geocities.com/biliranisland/ |date=2005-05-25 }}
== Mga pakisayran ==
*"Poro Island, Biliran, Eastern Visayas, Philippines". Google Maps. Retrieved on 2013-11-15.
*Borrinaga, Rolando O. "History of Biliran". Biliran Island Undiscovered Paradise. Retrieved on 2013-11-06.
*Borrinaga, Rolando O. “Lost meanings in Biliran.” [https://web.archive.org/web/20030515181554/http://www.geocities.com/bilirannews/whatname.html]
*Borrinaga, Rolando O. “How Biliran got its name.” [https://web.archive.org/web/20011108125902/http://www.geocities.com/rolborr/bilname.html]
*Biliran. “About Biliran.” [http://www.biliranisland.com/aboutbiliran.php] {{Webarchive|url=https://web.archive.org/web/20070928105501/http://www.biliranisland.com/aboutbiliran.php |date=2007-09-28 }}
== Mga Reperensya ==
{{reflist|2}}
{{Biliran}}
{{Sidlakang Kabisay-an}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
seavv0krghggfyskrofg01i8gwo5yaq
Negros Oriental
0
1471
37019655
10722131
2026-05-01T16:28:36Z
Exec8
10305
37019655
wikitext
text/x-wiki
Ang '''Negros Oriental''' (sa [[Sinugboanon]]: ''Sidlakang Negros'') usa ka lalawigan sa [[Tunga-tungang Kabisay-an]] sa [[Pilipinas]]. Nahimutang ang lalawigan sa habagatang-sidlakan sa pulo sa [[Negros]], samtang ang [[Negros Occidental]] mao ang kasadpang dapit sa pulo. Ang Negros Oriental nag-atubang sa [[Sugbo]] sa sidlakan tabok sa [[Tañon Strait]] ug ang [[Siquijor]] sa habagatang-sidlakan. Ang [[Dakbayan sa Dumaguete]] maoy kapital o ulohan sa lalawigan.
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Negros Oriental|
sealfile=[[Payl:Ph seal negros oriental.png]]|
rehiyon=[[Tunga-tungang Kabisay-an]] (Region VII)|
capital=[[Dakbayan sa Dumaguete]]|
founded=[[10 sa Marso]], [[1917]]|
pop2000=1,126,061|
pop2000rank=ika-20 sa kinadak-an|
popden2000=208|
popden2000rank=ika-41 sa kinadam-an|
areakm2=5,402.3|
arearank=ika-14 sa kinadak-an|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=5|
mga lungsod=20|
mga barangay=557|
mga distrito=3|
mga pinulongan=[[Sinugboanon]], [[Hiligaynon]]|
gobernador=George P. Arnaiz|
locatormapfile=[[Payl:Ph_locator_map_negros_oriental (white).png]]}}
== Heyograpiya ==
=== Politikal ===
=== Mga Dakbayan ===
* [[Dakbayan sa Bais]]
* [[Dakbayan sa Bayawan]] (Tulong)
* [[Dakbayan sa Canlaon]]
* [[Dakbayan sa Dumaguete]]
* [[Dakbayan sa Guihulngan]]
* [[Dakbayan sa Tanjay]]
=== Mga Lungsod ===
<table border="0"><tr>
<td valign="top">
* [[Amlan, Negros Oriental|Amlan]] (Ayuquitan)
* [[Ayungon, Negros Oriental|Ayungon]]
* [[Bacong, Negros Oriental|Bacong]]
* [[Basay, Negros Oriental|Basay]]
* [[Bindoy, Negros Oriental|Bindoy]] (Payabon)
* [[Dauin, Negros Oriental|Dauin]]
* [[Jimalalud, Negros Oriental|Jimalalud]]
* [[La Libertad, Negros Oriental|La Libertad]]
* [[Mabinay, Negros Oriental|Mabinay]]
* [[Manjuyod, Negros Oriental|Manjuyod]]
</td><td valign="top">
* [[Pamplona, Negros Oriental|Pamplona]]
* [[San Jose, Negros Oriental|San Jose]]
* [[Santa Catalina, Negros Oriental|Santa Catalina]]
* [[Siaton, Negros Oriental|Siaton]]
* [[Sibulan, Negros Oriental|Sibulan]]
* [[Tayasan, Negros Oriental|Tayasan]]
* [[Valencia, Negros Oriental|Valencia]] (Luzurriaga)
* [[Vallehermoso, Negros Oriental|Vallehermoso]]
* [[Zamboanguita, Negros Oriental|Zamboanguita]]
</td></tr></table>
=== Pisikal ===
== Ekonomiya ==
== Kasaysayan ==
=== Sa Pagsugod ===
=== Sa Panahon sa mga Katsila ===
=== Republika sa Negros ===
=== Sa Panahon sa mga Amerikano ===
=== Gikan sa 1946 hangtod karon ===
== Tan-awa Usab ==
* [[Talaan sa mga Gobernador sa Negros Oriental]]
== Impormasyon sa Gawas ==
* [http://www.negor.gov.ph Opisyal nga Website sa Gobierno sa Probinsya sa Negros Oriental]
== Mga Reperensya ==
{{reflist|2}}
{{Negros Oriental}}
{{Rehiyon sa Isla sa Negros}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
aggyopbasip59k9d3jw4prn2ng9cpgt
Sidlakang Samar
0
1474
37019527
35517820
2026-05-01T14:23:29Z
Exec8
10305
37019527
wikitext
text/x-wiki
Ang '''Lalawigan sa Eastern Samar''' (o '''Lalawigan sa Sidlakang Samar''') usa sa mga lalawigan sa pulo sa Samar. [[Borongan, Eastern Samar|Borongan]] maoy ang kapital o ulohan sa lalawigan. Ang lalawigan nahimutangan sa sidlakang dapit sa pulo sa Samar. Sa amihanan sa lalawigan, makaplagan ang lalawigan sa [[Northern Samar]] ug sa kasadpan ang [[Samar (lalawigan)|lalawigan sa Samar]]. Sa sidlakan sa lalawigan ang [[Dagat Pilipinhon]] ug ang [[Golpo sa Leyte]] sa habagatan.
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Eastern Samar<br />Lalawigan sa Sidlakang Samar|
sealfile=[[Payl:Ph_seal_east_samar.png|300px]]|
rehiyon=[[Sidlakang Kabisay-an]] (Region VIII)|
capital=[[Borongan, Eastern Samar|Borongan]]|
founded=[[19 sa Hunyo]], [[1965]]|
pop2000=375,822|
pop2000rank=ika-20 sa kinagamay|
popden2000=87|
popden2000rank=ika-13 sa kinagamay|
areakm2=4,339.6|
arearank=ika-28 sa kinadak-an|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=1|
mga lungsod=22|
mga barangay=597|
mga distrito=1|
mga pinulongan=[[Winaray]]|
gobernador=Ben Evardone|
locatormapfile=[[Payl:Ph_locator_map_eastern_samar (white).png]]}}
== Kataw'han ==
[[Winaray|Binisayang Winaray]] ang lumad nga pinulongan sa Eastern Samar
== Ekonomiya ==
== Heyograpiya ==
=== Political ===
Ang Sidlakang Samar may usa ka dakbayan ug 22 ka mga lungsod.
==== Dakbayan ====
* [[Dakbayan sa Borongan]]
==== Mga Lungsod ====
<table border="0"><tr>
<td valign="top">
* [[Arteche, Eastern Samar|Arteche]]
* [[Balangiga, Eastern Samar|Balangiga]]
* [[Balangkayan, Eastern Samar|Balangkayan]]
* [[Can-avid, Eastern Samar|Can-avid]]
* [[Dolores, Eastern Samar|Dolores]]
* [[General MacArthur, Eastern Samar|General MacArthur]]
* [[Giporlos, Eastern Samar|Giporlos]]
* [[Guiuan, Eastern Samar|Guiuan]]
* [[Hernani, Eastern Samar|Hernani]]
* [[Jipapad, Eastern Samar|Jipapad]]
* [[Lawaan, Eastern Samar|Lawaan]]
</td><td valign="top">
* [[Llorente, Eastern Samar|Llorente]]
* [[Maslog, Eastern Samar|Maslog]]
* [[Maydolong, Eastern Samar|Maydolong]]
* [[Mercedes, Eastern Samar|Mercedes]]
* [[Oras, Eastern Samar|Oras]]
* [[Quinapondan, Eastern Samar|Quinapondan]]
* [[Salcedo, Eastern Samar|Salcedo]]
* [[San Julian, Eastern Samar|San Julian]]
* [[San Policarpo, Eastern Samar|San Policarpo]]
* [[Sulat, Eastern Samar|Sulat]]
* [[Taft, Eastern Samar|Taft]]
</td></tr></table>
=== Pisikal ===
== Turismo ==
== Kasaysayan ==
== Kitaa Usab ==
* [[Talaan sa mga Gobernador sa Sidlakang Samar]]
==Mga sumpay sa gawas==
* [http://www.easternsamar.gov.ph/ Opisyal na Websayt sa Eastern Samar] {{Webarchive|url=https://web.archive.org/web/20120318012732/http://www.easternsamar.gov.ph/ |date=2012-03-18 }}
* [http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Eastern%20Samar Panid sa Ahensyang Impormasyong Pilipinhon (Philippine Information Agency) mahitungod sa Eastern Samar] {{Webarchive|url=https://web.archive.org/web/20070927015854/http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Eastern%20Samar |date=2007-09-27 }}
* [http://www.calicoanisland.com/ Guiuan] {{Webarchive|url=https://web.archive.org/web/20051123103506/http://www.calicoanisland.com/ |date=2005-11-23 }}
* [http://www.easternsamar.de/html%20englisch/info%20e.%20samar.htm Eastern Samar] {{Webarchive|url=https://web.archive.org/web/20050908182955/http://easternsamar.de/html%20englisch/info%20e.%20samar.htm |date=2005-09-08 }}
{{geobox
| 1 = Region
<!-- *** Header *** -->
| name = Sidlakang Samar
| native_name = Eastern Samar
| other_name = Province of Eastern Samar
| category = Lalawigan
| official_name =
| etymology =
| motto =
| nickname =
<!-- *** Image *** -->
| image =
| image_caption =
<!-- *** Symbols *** -->
| flag =
| symbol =
<!-- *** Admin *** -->
| country = {{flag|Pilipinas}}
| country_flag =
| state = [[Sidlakang Kabisay-an (rehiyon sa Pilipinas)|Sidlakang Kabisay-an]]
| state_type = Rehiyon
| region =
| region_type =
| district =
| district_type =
| economic_region =
| economic_region_type =
<!-- *** Associated with *** -->
| border =
| part =
| city =
| landmark =
| river =
<!-- *** Location *** -->
| capital =
| capital_type =
| capital_location =
| capital_region =
| capital_country =
| capital_elevation =
| capital_lat_d =
| capital_lat_m =
| capital_lat_s =
| capital_lat_NS =
| capital_long_d =
| capital_long_m =
| capital_long_s =
| capital_long_EW =
| highest =
| highest_location =
| highest_region =
| highest_country =
| highest_elevation =
| highest_lat_d =
| highest_lat_m =
| highest_lat_s =
| highest_lat_NS =
| highest_long_d =
| highest_long_m =
| highest_long_s =
| highest_long_EW =
| lowest =
| lowest_location =
| lowest_region =
| lowest_country =
| lowest_elevation =
| lowest_lat_d =
| lowest_lat_m =
| lowest_lat_s =
| lowest_lat_NS =
| lowest_long_d =
| lowest_long_m =
| lowest_long_s =
| lowest_long_EW =
<!-- *** Dimensions *** -->
| length =
| length_orientation =
| width =
| width_orientation =
| area = 4660.47
| area_decimals =
<!-- *** Population *** -->
| population = 405114
| population_date = 2015-04-02
| population_density = auto
| established =
| date =
| government_location =
| government_region =
| government_country =
| government_elevation =
| government_lat_d =
| government_lat_m =
| government_lat_s =
| government_lat_NS =
| government_long_d =
| government_long_m =
| government_long_s =
| government_long_EW =
| leader =
| leader_party =
<!-- *** Codes *** -->
| timezone = [[Philippine Standard Time|PST]]
| utc_offset = +8
| timezone_DST =
| utc_offset_DST =
| postal_code =
| area_code =
| code =
<!-- *** Free *** -->
| free =
| free_type =
<!-- *** Maps *** -->
| map =
| map_size =
| map_caption =
| map_locator_x =
| map_locator_y =
<!-- *** Website *** -->
| website =
<!-- *** Notes *** -->
| footnotes =
| other_name1 = Samar Oriental
| other_name2 = Silangang Samar
| lat_d = 11.53054
| long_d = 125.47647
| elevation = 16
| population_note = <ref name = "gn1713986"/>
| timezone_label = Asia/Manila
| geonames = 1713986
}}
<!--A.ADM2-->[[administratibo nga mga dibisyon sa Pilipinas|Lalawigan]] ang '''Sidlakang Samar''' ([[Ininggles]]: '''Eastern Samar''', [[Tinagalog]]: '''Silangang Samar''') sa [[Pilipinas]].<ref name = "gn1713986"/> Nahimutang ni sa rehiyon sa <!--ADM1-->[[Sidlakang Kabisay-an (rehiyon sa Pilipinas)|Sidlakang Kabisay-an]], sa sidlakang bahin sa nasod, {{formatnum:600}} km sa habagatan-sidlakan sa [[Dakbayan sa Manila (ulohang dakbayan sa Pilipinas)|Dakbayan sa Manila]] ang ulohan sa nasod. Adunay <!--pop-->{{formatnum:405114}} ka molupyo.<ref name = "gn1713986"/> Naglangkob kin og {{formatnum:4660}} ka kilometro kwadrado. Ang Sidlakang Samar nahimutang sa pulo sa [[Samar (pulo)|Samar]].{{efn|group=saysay|Kalkulado gikan sa gitas-on data (DEM 3") gikan sa Viewfinder Panoramas.<ref name = "vp"/> Ang bug-os nga algoritmo anaa [https://sv.wikipedia.org/wiki/Wikipedia:Projekt_DotNetWikiBot_Framework/Lsjbot/Make-Geonames dinhi].}}
Ang yuta sa Sidlakang Samar kay kasagaran kabungtoran, apan sa habagatang-sidlakan nga kini mao ang patag.{{efn|group=saysay|Kalkulado gikan sa gitas-on data (DEM 3") gikan sa Viewfinder Panoramas.<ref name = "vp"/> Ang bug-os nga algoritmo anaa [https://sv.wikipedia.org/wiki/Wikipedia:Projekt_DotNetWikiBot_Framework/Lsjbot/Make-Geonames dinhi].}}
Sidlakang Samar may sa mosunod nga mga subdibisyon:
* [[Taft (munisipyo)|Taft]]
* [[Sulat (munisipyo)|Sulat]]
* [[San Policarpo (munisipyo)|San Policarpo]]
* [[San Julian (munisipyo sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 11,73, long 125,37)|San Julian]]
* [[Salcedo (munisipyo sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 11,17, long 125,62)|Salcedo]]
* [[Quinapundan (munisipyo)|Quinapundan]]
* [[Oras (munisipyo)|Oras]]
* [[Maydolong (munisipyo)|Maydolong]]
* [[Maslog (munisipyo)|Maslog]]
* [[Llorente (munisipyo)|Llorente]]
* [[Lawa-an (munisipyo sa Pilipinas, Sidlakang Kabisay-an)|Lawa-an]]
* [[Jipapad (munisipyo sa Pilipinas)|Jipapad]]
* [[Hernani (munisipyo sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 11,33, long 125,58)|Hernani]]
* [[Guiuan (munisipyo)|Guiuan]]
* [[Giporlos (munisipyo)|Giporlos]]
* [[General MacArthur (munisipyo)|General MacArthur]]
* [[Dolores (munisipyo sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 12,05, long 125,33)|Dolores]]
* [[Can-Avid (munisipyo)|Can-Avid]]
* [[City of Borongan]]
* [[Balangkayan (munisipyo)|Balangkayan]]
* [[Balangiga (munisipyo)|Balangiga]]
* [[Arteche (munisipyo)|Arteche]]
Mga lungsod sa Sidlakang Samar:
* [[Dolores (lungsod sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 12,04, long 125,48)|Dolores]]
* [[Llorente (lungsod sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 11,41, long 125,55)|Llorente]]
* [[Balangiga (lungsod)|Balangiga]]
* [[Maydolong (lungsod)|Maydolong]]
* [[Hipadpad]]
* [[Balangkayan (lungsod)|Balangkayan]]
* [[Sulangan (lungsod sa Pilipinas, Sidlakang Kabisay-an)|Sulangan]]
* [[Balud (lungsod sa Pilipinas, Sidlakang Kabisay-an)|Balud]]
* [[Dao (lungsod)|Dao]]
* [[Maypangdan]]
* [[Cabay (lungsod sa Pilipinas, Sidlakang Kabisay-an)|Cabay]]
* [[Nena (lungsod)|Nena]]
* [[Dapdap (lungsod sa Pilipinas, Sidlakang Kabisay-an)|Dapdap]]
* [[San Eduardo (lungsod sa Pilipinas)|San Eduardo]]
* [[Alugan (lungsod sa Pilipinas)|Alugan]]
* [[Mantang (lungsod)|Mantang]]
* [[Lalauigan]]
Sa mosunod nga mga natural nga mga bahin makita sa Sidlakang Samar:
* Nabigasyon:
:* [[Calicoan Pass]] (<!--H.CHNM-->[[agianan nga kadagatan]])
:* [[Minanut Anchorage]] (<!--H.ANCH-->[[pundohanan]])
:* [[Nabugtusan Channel]] (<!--H.CHNM-->[[agianan nga kadagatan]])
:* [[Port Borongan]] (<!--H.ANCH-->[[pundohanan]])
:* [[Port Libas]] (<!--H.ANCH-->[[pundohanan]])
* Mga luuk:
:* [[Alugan Bay]] (<!--H.BAY-->[[luuk]])
:* [[Bactol Bay]] (<!--H.BAY-->[[luuk]])
:* [[Baligasag Bay]] (<!--H.BAY-->[[luuk]])
:* [[Binugayan Bay]] (<!--H.BAY-->[[luuk]])
:* [[Cabay Bay]] (<!--H.BAY-->[[luuk]])
:* [[Casogoran Bay]] (<!--H.BAY-->[[luuk]])
:* [[Lipusan Bay]] (<!--H.BAY-->[[luuk]])
:* [[Maglolobo Bay]] (<!--H.BAY-->[[luuk]])
:* [[Matarinao Bay]] (<!--H.BAY-->[[luuk]])
:* [[Nagaha Bay]] (<!--H.BAY-->[[luuk]])
:* [[Napla Bay]] (<!--H.BAY-->[[luuk]])
:* [[Oras Bay]] (<!--H.BAY-->[[luuk]])
:* [[Panablijon Bay]] (<!--H.BAY-->[[luuk]])
:* [[Pangpang Bay]] (<!--H.BAY-->[[luuk]])
:* [[Quinapundan Bay]] (<!--H.BAY-->[[luuk]])
:* [[San Policarpo Bay]] (<!--H.BAY-->[[luuk]])
:* [[San Ramon Bay]] (<!--H.BAY-->[[luuk]])
:* [[Sua Bay (luuk sa Pilipinas, Sidlakang Samar)|Sua Bay]] (<!--H.BAY-->[[luuk]])
:* [[Sulat Bay]] (<!--H.BAY-->[[luuk]])
* Mga suba:
:* [[Alugan River]] (<!--H.STM-->[[suba]])
:* [[Aroganga River]] (<!--H.STM-->[[suba]])
:* [[Balangiga River]] (<!--H.STM-->[[suba]])
:* [[Bantayan River (suba sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Bantayan River]] (<!--H.STM-->[[suba]])
:* [[Barujb River]] (<!--H.STM-->[[suba]])
:* [[Bato River (suba sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Bato River]] (<!--H.STM-->[[suba]])
:* [[Binalayan River]] (<!--H.STM-->[[suba]])
:* [[Bolalacao River]] (<!--H.STM-->[[suba]])
:* [[Borongan River]] (<!--H.STM-->[[suba]])
:* [[Bugas River (suba sa Pilipinas, Sidlakang Kabisay-an)|Bugas River]] (<!--H.STM-->[[suba]])
:* [[Cabay River]] (<!--H.STM-->[[suba]])
:* [[Cabayaoan River]] (<!--H.STM-->[[suba]])
:* [[Cahoti River]] (<!--H.STM-->[[suba]])
:* [[Cambanug River]] (<!--H.STM-->[[suba]])
:* [[Canooma River]] (<!--H.STM-->[[suba]])
:* [[Danao River (suba sa Pilipinas, Sidlakang Kabisay-an)|Danao River]] (<!--H.STM-->[[suba]])
:* [[Dapdap River (suba sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Dapdap River]] (<!--H.STM-->[[suba]])
:* [[Dolores River (suba sa Pilipinas)|Dolores River]] (<!--H.STM-->[[suba]])
:* [[Doongoon River]] (<!--H.STM-->[[suba]])
:* [[Dulang River (suba sa Pilipinas, Sidlakang Kabisay-an)|Dulang River]] (<!--H.STM-->[[suba]])
:* [[Hernani River]] (<!--H.STM-->[[suba]])
:* [[Lauaan River (suba sa Pilipinas)|Lauaan River]] (<!--H.STM-->[[suba]])
:* [[Layog River (suba sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Layog River]] (<!--H.STM-->[[suba]])
:* [[Libas River (suba sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Libas River]] (<!--H.STM-->[[suba]])
:* [[Llorente River]] (<!--H.STM-->[[suba]])
:* [[Loom River]] (<!--H.STM-->[[suba]])
:* [[Losungan River]] (<!--H.STM-->[[suba]])
:* [[Malobago River]] (<!--H.STM-->[[suba]])
:* [[Mantang River]] (<!--H.STM-->[[suba]])
:* [[Mayon River (suba sa Pilipinas, Sidlakang Kabisay-an)|Mayon River]] (<!--H.STM-->[[suba]])
:* [[Moranon River]] (<!--H.STM-->[[suba]])
:* [[Mubmub River]] (<!--H.STM-->[[suba]])
:* [[Opong River (suba sa Pilipinas, Sidlakang Samar)|Opong River]] (<!--H.STM-->[[suba]])
:* [[Oras River]] (<!--H.STM-->[[suba]])
:* [[Pambuhan River (suba sa Pilipinas)|Pambuhan River]] (<!--H.STM-->[[suba]])
:* [[Panablijon River]] (<!--H.STM-->[[suba]])
:* [[Pandan River (suba sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Pandan River]] (<!--H.STM-->[[suba]])
:* [[Pulane River]] (<!--H.STM-->[[suba]])
:* [[Quinapundan River]] (<!--H.STM-->[[suba]])
:* [[Salug River (suba sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Salug River]] (<!--H.STM-->[[suba]])
:* [[San Eduardo River (suba sa Pilipinas, lat 12,17, long 124,47)|San Eduardo River]] (<!--H.STM-->[[suba]])
:* [[San Eduardo River (suba sa Pilipinas, lat 12,17, long 125,46)|San Eduardo River]] (<!--H.STM-->[[suba]])
:* [[San Ramon River (suba sa Pilipinas, Sidlakang Kabisay-an)|San Ramon River]] (<!--H.STM-->[[suba]])
:* [[Siginon River]] (<!--H.STM-->[[suba]])
:* [[Sulat River]] (<!--H.STM-->[[suba]])
:* [[Suribao River]] (<!--H.STM-->[[suba]])
:* [[Taft River]] (<!--H.STM-->[[suba]])
:* [[Tamboc River]] (<!--H.STM-->[[suba]])
:* [[Tanglao River (suba sa Pilipinas)|Tanglao River]] (<!--H.STM-->[[suba]])
:* [[Tubig River]] (<!--H.STM-->[[suba]])
:* [[Tubigan River]] (<!--H.STM-->[[suba]])
:* [[Tungkip River]] (<!--H.STM-->[[suba]])
:* [[Ulot River (suba sa Pilipinas)|Ulot River]] (<!--H.STM-->[[suba]])
:* [[Ulut River]] (<!--H.STM-->[[suba]])
:* [[Ungay River]] (<!--H.STM-->[[suba]])
* Salog sa dagat:
:* [[Calianan Shoal]] (<!--H.SHOL-->[[piliw]])
:* [[Walker Shoal (piliw sa Pilipinas)|Walker Shoal]] (<!--H.SHOL-->[[piliw]])
* Kapuloan:
:* [[Agauan Island]] (<!--T.ISL-->[[pulo]])
:* [[Anahap Island]] (<!--T.ISL-->[[pulo]])
:* [[Anajao Island (pulo sa Pilipinas, Sidlakang Samar)|Anajao Island]] (<!--T.ISL-->[[pulo]])
:* [[Andis Island]] (<!--T.ISL-->[[pulo]])
:* [[Apitong Island]] (<!--T.ISL-->[[pulo]])
:* [[Bactol Island]] (<!--T.ISL-->[[pulo]])
:* [[Baganbanua Island]] (<!--T.ISL-->[[pulo]])
:* [[Bakalod Island]] (<!--T.ISL-->[[pulo]])
:* [[Bakolod Island]] (<!--T.ISL-->[[pulo]])
:* [[Balinatio Island]] (<!--T.ISL-->[[pulo]])
:* [[Baohan Island]] (<!--T.ISL-->[[pulo]])
:* [[Bar Islet]] (<!--T.ISL-->[[pulo]])
:* [[Basod Island]] (<!--T.ISL-->[[pulo]])
:* [[Baul Island]] (<!--T.ISL-->[[pulo]])
:* [[Benarauam Island]] (<!--T.ISL-->[[pulo]])
:* [[Binabasalan Islet]] (<!--T.ISL-->[[pulo]])
:* [[Binarayan Island]] (<!--T.ISL-->[[pulo]])
:* [[Borabo Island]] (<!--T.ISL-->[[pulo]])
:* [[Botic Island]] (<!--T.ISL-->[[pulo]])
:* [[Cabalarian Island]] (<!--T.ISL-->[[pulo]])
:* [[Calicoan Island]] (<!--T.ISL-->[[pulo]])
:* [[Cambaangan Island]] (<!--T.ISL-->[[pulo]])
:* [[Cambasingan Island]] (<!--T.ISL-->[[pulo]])
:* [[Cancahinibing Island]] (<!--T.ISL-->[[pulo]])
:* [[Candulo Island]] (<!--T.ISL-->[[pulo]])
:* [[Canigaran Islands]] (<!--T.ISLS-->[[kapuloan]])
:* [[Caninoan Island]] (<!--T.ISL-->[[pulo]])
:* [[Cantican Island]] (<!--T.ISL-->[[pulo]])
:* [[Catalaban Island]] (<!--T.ISL-->[[pulo]])
:* [[Coco Islands (kapuloan sa Pilipinas)|Coco Islands]] (<!--T.ISLS-->[[kapuloan]])
:* [[Coral Island (pulo sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Coral Island]] (<!--T.ISL-->[[pulo]])
:* [[Dalo Island]] (<!--T.ISL-->[[pulo]])
:* [[Divinubo Island]] (<!--T.ISL-->[[pulo]])
:* [[Dry Island (pulo sa Pilipinas)|Dry Island]] (<!--T.ISL-->[[pulo]])
:* [[Fulin Island]] (<!--T.ISL-->[[pulo]])
:* [[Guotasan Island]] (<!--T.ISL-->[[pulo]])
:* [[Hilaba-an Island]] (<!--T.ISL-->[[pulo]])
:* [[Hilaban Island]] (<!--T.ISL-->[[pulo]])
:* [[Homonhon Island]] (<!--T.ISL-->[[pulo]])
:* [[Inayauan Island]] (<!--T.ISL-->[[pulo]])
:* [[Iniyao Island]] (<!--T.ISL-->[[pulo]])
:* [[Juana Island]] (<!--T.ISL-->[[pulo]])
:* [[Kabani Island]] (<!--T.ISL-->[[pulo]])
:* [[Kanadag Island]] (<!--T.ISL-->[[pulo]])
:* [[Kapapariuan Islet]] (<!--T.ISL-->[[pulo]])
:* [[Lalauigan Island]] (<!--T.ISL-->[[pulo]])
:* [[Lapogpocahan Island]] (<!--T.ISL-->[[pulo]])
:* [[Lauaan Island]] (<!--T.ISL-->[[pulo]])
:* [[Leleboon Island (pulo sa Pilipinas)|Leleboon Island]] (<!--T.ISL-->[[pulo]])
:* [[Linao Island]] (<!--T.ISL-->[[pulo]])
:* [[Linoa Island]] (<!--T.ISL-->[[pulo]])
:* [[Loud Island (pulo sa Pilipinas)|Loud Island]] (<!--T.ISL-->[[pulo]])
:* [[Luctaban Island]] (<!--T.ISL-->[[pulo]])
:* [[Macalayo Island]] (<!--T.ISL-->[[pulo]])
:* [[Maiduun Islands]] (<!--T.ISLS-->[[kapuloan]])
:* [[Makate Island]] (<!--T.ISL-->[[pulo]])
:* [[Manicani Island]] (<!--T.ISL-->[[pulo]])
:* [[Masisingi Island]] (<!--T.ISL-->[[pulo]])
:* [[Minaanod Island (pulo sa Pilipinas)|Minaanod Island]] (<!--T.ISL-->[[pulo]])
:* [[Minadion Island]] (<!--T.ISL-->[[pulo]])
:* [[Minaloa Island]] (<!--T.ISL-->[[pulo]])
:* [[Minanut Island]] (<!--T.ISL-->[[pulo]])
:* [[Minasañgan Island]] (<!--T.ISL-->[[pulo]])
:* [[Montoconan Island]] (<!--T.ISL-->[[pulo]])
:* [[Mugtma Island]] (<!--T.ISL-->[[pulo]])
:* [[Nabalicad Island]] (<!--T.ISL-->[[pulo]])
:* [[Naburaburao Island]] (<!--T.ISL-->[[pulo]])
:* [[Onas Island]] (<!--T.ISL-->[[pulo]])
:* [[Panit Island]] (<!--T.ISL-->[[pulo]])
:* [[Pasig Island]] (<!--T.ISL-->[[pulo]])
:* [[Popotihon Island]] (<!--T.ISL-->[[pulo]])
:* [[Rapit Island]] (<!--T.ISL-->[[pulo]])
:* [[Raton Island (pulo sa Pilipinas, Sidlakang Kabisay-an)|Raton Island]] (<!--T.ISL-->[[pulo]])
:* [[Sibay Island (pulo sa Pilipinas, Sidlakang Kabisay-an)|Sibay Island]] (<!--T.ISL-->[[pulo]])
:* [[Sisi Island (pulo sa Pilipinas)|Sisi Island]] (<!--T.ISL-->[[pulo]])
:* [[Suluan Island]] (<!--T.ISL-->[[pulo]])
:* [[Tenatoulan Island]] (<!--T.ISL-->[[pulo]])
:* [[Tinongtongan Island]] (<!--T.ISL-->[[pulo]])
:* [[Tubabao Island (pulo sa Pilipinas, lat 12,11, long 125,56)|Tubabao Island]] (<!--T.ISL-->[[pulo]])
:* [[Tubabao Island (pulo sa Pilipinas, lat 11,05, long 125,69)|Tubabao Island]] (<!--T.ISL-->[[pulo]])
:* [[Uguis Island]] (<!--T.ISL-->[[pulo]])
* Nga bato nga pormasyon:
:* [[Mushroom Rock (bato sa Pilipinas, Sidlakang Kabisay-an)|Mushroom Rock]] (<!--T.RK-->[[bato]])
:* [[Pinnacle Rock (bato sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 10,77, long 125,97)|Pinnacle Rock]] (<!--T.RK-->[[bato]])
:* [[Pinnacle Rock (bato sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 10,75, long 125,97)|Pinnacle Rock]] (<!--T.RK-->[[bato]])
:* [[Pou Rock]] (<!--T.RK-->[[bato]])
:* [[Pyramidal Rock]] (<!--T.RK-->[[bato]])
* Mga lawis:
:* [[Agdan Point]] (<!--T.PT-->[[punta]])
:* [[Agojo Point (punta sa Pilipinas)|Agojo Point]] (<!--T.PT-->[[punta]])
:* [[Amogotada Point (punta sa Pilipinas, Sidlakang Samar)|Amogotada Point]] (<!--T.PT-->[[punta]])
:* [[Anitaguipan Point]] (<!--T.PT-->[[punta]])
:* [[Asgad Point]] (<!--T.PT-->[[punta]])
:* [[Bactol Point]] (<!--T.PT-->[[punta]])
:* [[Bagtong Point]] (<!--T.PT-->[[punta]])
:* [[Bankari Point]] (<!--T.PT-->[[punta]])
:* [[Bantayan Point (punta sa Pilipinas, Sidlakang Kabisay-an)|Bantayan Point]] (<!--T.PT-->[[punta]])
:* [[Barapdaban Point]] (<!--T.PT-->[[punta]])
:* [[Baras Point (punta sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Baras Point]] (<!--T.PT-->[[punta]])
:* [[Baris Point]] (<!--T.PT-->[[punta]])
:* [[Binugawan Point]] (<!--T.PT-->[[punta]])
:* [[Bobon Point (punta sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Bobon Point]] (<!--T.PT-->[[punta]])
:* [[Bunga Point (punta sa Pilipinas, Sidlakang Kabisay-an)|Bunga Point]] (<!--T.PT-->[[punta]])
:* [[Bura Point]] (<!--T.PT-->[[punta]])
:* [[Bypungnan Point]] (<!--T.PT-->[[punta]])
:* [[Cabadlongan Point]] (<!--T.PT-->[[punta]])
:* [[Cabarasan Point]] (<!--T.PT-->[[punta]])
:* [[Cablagna Point]] (<!--T.PT-->[[punta]])
:* [[Cabra Point]] (<!--T.PT-->[[punta]])
:* [[Cagbanlio Point]] (<!--T.PT-->[[punta]])
:* [[Cagosoan Point]] (<!--T.PT-->[[punta]])
:* [[Canaybon Point]] (<!--T.PT-->[[punta]])
:* [[Cannomanda Point]] (<!--T.PT-->[[punta]])
:* [[Capinas Point]] (<!--T.PT-->[[punta]])
:* [[Carapdas Point]] (<!--T.PT-->[[punta]])
:* [[Colasi Point (punta sa Pilipinas, Sidlakang Kabisay-an)|Colasi Point]] (<!--T.PT-->[[punta]])
:* [[Coracoraan Point]] (<!--T.PT-->[[punta]])
:* [[Gigoso Point]] (<!--T.PT-->[[punta]])
:* [[Gintaguican Point]] (<!--T.PT-->[[punta]])
:* [[Guinanug Point]] (<!--T.PT-->[[punta]])
:* [[Hagnaya Point]] (<!--T.PT-->[[punta]])
:* [[Handig Point]] (<!--T.PT-->[[punta]])
:* [[Haravis Point]] (<!--T.PT-->[[punta]])
:* [[Hinablan Point]] (<!--T.PT-->[[punta]])
:* [[Homoraon Point]] (<!--T.PT-->[[punta]])
:* [[Kanaoayong Point]] (<!--T.PT-->[[punta]])
:* [[Lalawigan Point (punta sa Pilipinas, Sidlakang Kabisay-an)|Lalawigan Point]] (<!--T.PT-->[[punta]])
:* [[Lauaan Point]] (<!--T.PT-->[[punta]])
:* [[Lucson Point]] (<!--T.PT-->[[punta]])
:* [[Ludo Point]] (<!--T.PT-->[[punta]])
:* [[Luyong Point]] (<!--T.PT-->[[punta]])
:* [[Macatol Point (punta sa Pilipinas, Sidlakang Kabisay-an)|Macatol Point]] (<!--T.PT-->[[punta]])
:* [[Macatucas Point]] (<!--T.PT-->[[punta]])
:* [[Magnana Point]] (<!--T.PT-->[[punta]])
:* [[Malapacao Point]] (<!--T.PT-->[[punta]])
:* [[Malistis Point]] (<!--T.PT-->[[punta]])
:* [[Matarinao Point]] (<!--T.PT-->[[punta]])
:* [[Najibil Point]] (<!--T.PT-->[[punta]])
:* [[Nasomo Point]] (<!--T.PT-->[[punta]])
:* [[Pagbabacnan Point]] (<!--T.PT-->[[punta]])
:* [[Palan Point]] (<!--T.PT-->[[punta]])
:* [[Palanas Point (punta sa Pilipinas)|Palanas Point]] (<!--T.PT-->[[punta]])
:* [[Pamang Point]] (<!--T.PT-->[[punta]])
:* [[Pamunacan Point]] (<!--T.PT-->[[punta]])
:* [[Panadlihan Point (punta sa Pilipinas)|Panadlihan Point]] (<!--T.PT-->[[punta]])
:* [[Pananamitan Point]] (<!--T.PT-->[[punta]])
:* [[Paninihian Point]] (<!--T.PT-->[[punta]])
:* [[Paporan Point]] (<!--T.PT-->[[punta]])
:* [[Pindilin Point]] (<!--T.PT-->[[punta]])
:* [[Ranis Point]] (<!--T.PT-->[[punta]])
:* [[San Miguel Point (punta sa Pilipinas, Sidlakang Kabisay-an)|San Miguel Point]] (<!--T.PT-->[[punta]])
:* [[Soribao Point]] (<!--T.PT-->[[punta]])
:* [[Sua Point]] (<!--T.PT-->[[punta]])
:* [[Sungi Point]] (<!--T.PT-->[[punta]])
:* [[Taig Point]] (<!--T.PT-->[[punta]])
:* [[Tubigan Point (punta sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Tubigan Point]] (<!--T.PT-->[[punta]])
:* [[Tugasan Point]] (<!--T.PT-->[[punta]])
:* [[Tugnug Point]] (<!--T.PT-->[[punta]])
* Kabukiran:
:* [[Mount Amangsarahacan]] (<!--T.MT-->[[bukid]])
:* [[Mount Barayan]] (<!--T.MT-->[[bukid]])
:* [[Mount Bihag]] (<!--T.MT-->[[bukid]])
:* [[Mount Honop]] (<!--T.MT-->[[bukid]])
:* [[Mount Mactaon]] (<!--T.MT-->[[bukid]])
:* [[Mount Magnagua]] (<!--T.MT-->[[bukid]])
:* [[Mount Pacgem]] (<!--T.MT-->[[bukid]])
* Kagaangan:
:* [[Candamat Reef]] (<!--H.RF-->[[kagaangan]])
{{Location map|Philippines |float = right |width=300 | caption = Nahimutangan sa Sidlakang Samar sa Pilipinas. | label = Sidlakang Samar|position=left|background=white|lat=11.53054|long=125.47647}}
Ang klima [[tropikal nga kasalupan]].<ref name = "koppen"/> Ang kasarangang giiniton {{formatnum:23}} [[°C]]. Ang kinainitan nga bulan Hunyo, sa {{formatnum:24}} [[°C]], ug ang kinabugnawan Enero, sa {{formatnum:20}} °C.<ref name = "nasa"/> Ang kasarangang pag-ulan {{formatnum:4682}} milimetro matag tuig. Ang kinabasaan nga bulan Enero, sa {{formatnum:756}} milimetro nga ulan, ug ang kinaugahan Mayo, sa {{formatnum:153}} milimetro.<ref name = "nasarain"/>
{|
|-
|{{climate chart
| Sidlakang Samar
| 16| 23| 756
| 22| 24| 444
| 21| 23| 349
| 22| 26| 278
| 22| 25| 153
| 24| 25| 406
| 21| 23| 327
| 23| 25| 200
| 22| 26| 341
| 23| 23| 333
| 21| 24| 414
| 21| 24| 683
|maxprecip = 756
|float=left
|clear=left
|source = <ref name = "nasa"/>
}}
|}
== Saysay ==
<references group="saysay"/>
== Ang mga gi basihan niini ==
<references>
<ref name = "gn1713986">[{{Geonameslink|gnid=1713986|name=province%20of%20eastern%20samar}} Province of Eastern Samar] at [{{Geonamesabout}} GeoNames.Org (cc-by)]; post updated 2015-04-02; database download sa 2015-11-25</ref>
<ref name = "vp">{{Cite web |url= {{Viewfinderlink}}|title= Viewfinder Panoramas Digital elevation Model|date= 2015-06-21|format= }}</ref>
<ref name = "koppen">{{cite journal |last= Peel|first= M C|last2= Finlayson|first2= B L|date= |title= Updated world map of the Köppen-Geiger climate classification| url = http://www.hydrol-earth-syst-sci.net/11/1633/2007/hess-11-1633-2007.html |journal= Hydrology and Earth System Sciences|publisher= |volume= 11|issue= |pages= 1633-1644|doi= 10.5194/hess-11-1633-2007|access-date=30 Enero 2016}}</ref>
<ref name = "nasa">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/dataset_index.php|title= NASA Earth Observations Data Set Index|access-date = 30 Enero 2016 |publisher= NASA}}</ref>
<ref name = "nasarain">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/view.php?datasetId=TRMM_3B43M&year=2014|title= NASA Earth Observations: Rainfall (1 month - TRMM)|access-date = 30 Enero 2016 |publisher= NASA/Tropical Rainfall Monitoring Mission}}</ref>
</references>
== Mga Reperensya ==
{{reflist|2}}
{{Sidlakang Samar}}
{{Sidlakang Kabisay-an}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
lgrkvgyk8hbfu7sufx24upwixsreqat
37019528
37019527
2026-05-01T14:24:58Z
Exec8
10305
37019528
wikitext
text/x-wiki
Ang '''Lalawigan sa Eastern Samar''' (o '''Lalawigan sa Sidlakang Samar''') usa sa mga lalawigan sa pulo sa Samar. [[Borongan, Eastern Samar|Borongan]] maoy ang kapital o ulohan sa lalawigan. Ang lalawigan nahimutangan sa sidlakang dapit sa pulo sa Samar. Sa amihanan sa lalawigan, makaplagan ang lalawigan sa [[Northern Samar]] ug sa kasadpan ang [[Samar (lalawigan)|lalawigan sa Samar]]. Sa sidlakan sa lalawigan ang [[Dagat Pilipinhon]] ug ang [[Golpo sa Leyte]] sa habagatan.
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Eastern Samar<br />Lalawigan sa Sidlakang Samar|
sealfile=[[Payl:Ph_seal_east_samar.png|300px]]|
rehiyon=[[Sidlakang Kabisay-an]] (Region VIII)|
capital=[[Borongan, Eastern Samar|Borongan]]|
founded=[[19 sa Hunyo]], [[1965]]|
pop2000=375,822|
pop2000rank=ika-20 sa kinagamay|
popden2000=87|
popden2000rank=ika-13 sa kinagamay|
areakm2=4,339.6|
arearank=ika-28 sa kinadak-an|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=1|
mga lungsod=22|
mga barangay=597|
mga distrito=1|
mga pinulongan=[[Winaray]]|
gobernador=Ben Evardone|
locatormapfile=[[Payl:Ph_locator_map_eastern_samar (white).png]]}}
== Kataw'han ==
[[Winaray|Binisayang Winaray]] ang lumad nga pinulongan sa Eastern Samar
== Ekonomiya ==
== Heyograpiya ==
=== Political ===
Ang Sidlakang Samar may usa ka dakbayan ug 22 ka mga lungsod.
==== Dakbayan ====
* [[Dakbayan sa Borongan]]
==== Mga Lungsod ====
<table border="0"><tr>
<td valign="top">
* [[Arteche, Eastern Samar|Arteche]]
* [[Balangiga, Eastern Samar|Balangiga]]
* [[Balangkayan, Eastern Samar|Balangkayan]]
* [[Can-avid, Eastern Samar|Can-avid]]
* [[Dolores, Eastern Samar|Dolores]]
* [[General MacArthur, Eastern Samar|General MacArthur]]
* [[Giporlos, Eastern Samar|Giporlos]]
* [[Guiuan, Eastern Samar|Guiuan]]
* [[Hernani, Eastern Samar|Hernani]]
* [[Jipapad, Eastern Samar|Jipapad]]
* [[Lawaan, Eastern Samar|Lawaan]]
</td><td valign="top">
* [[Llorente, Eastern Samar|Llorente]]
* [[Maslog, Eastern Samar|Maslog]]
* [[Maydolong, Eastern Samar|Maydolong]]
* [[Mercedes, Eastern Samar|Mercedes]]
* [[Oras, Eastern Samar|Oras]]
* [[Quinapondan, Eastern Samar|Quinapondan]]
* [[Salcedo, Eastern Samar|Salcedo]]
* [[San Julian, Eastern Samar|San Julian]]
* [[San Policarpo, Eastern Samar|San Policarpo]]
* [[Sulat, Eastern Samar|Sulat]]
* [[Taft, Eastern Samar|Taft]]
</td></tr></table>
=== Pisikal ===
== Turismo ==
== Kasaysayan ==
== Kitaa Usab ==
* [[Talaan sa mga Gobernador sa Sidlakang Samar]]
==Mga sumpay sa gawas==
* [http://www.easternsamar.gov.ph/ Opisyal na Websayt sa Eastern Samar] {{Webarchive|url=https://web.archive.org/web/20120318012732/http://www.easternsamar.gov.ph/ |date=2012-03-18 }}
* [http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Eastern%20Samar Panid sa Ahensyang Impormasyong Pilipinhon (Philippine Information Agency) mahitungod sa Eastern Samar] {{Webarchive|url=https://web.archive.org/web/20070927015854/http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Eastern%20Samar |date=2007-09-27 }}
* [http://www.calicoanisland.com/ Guiuan] {{Webarchive|url=https://web.archive.org/web/20051123103506/http://www.calicoanisland.com/ |date=2005-11-23 }}
* [http://www.easternsamar.de/html%20englisch/info%20e.%20samar.htm Eastern Samar] {{Webarchive|url=https://web.archive.org/web/20050908182955/http://easternsamar.de/html%20englisch/info%20e.%20samar.htm |date=2005-09-08 }}
{{geobox
| 1 = Region
<!-- *** Header *** -->
| name = Sidlakang Samar
| native_name = Eastern Samar
| other_name = Province of Eastern Samar
| category = Lalawigan
| official_name =
| etymology =
| motto =
| nickname =
<!-- *** Image *** -->
| image =
| image_caption =
<!-- *** Symbols *** -->
| flag =
| symbol =
<!-- *** Admin *** -->
| country = {{flag|Pilipinas}}
| country_flag =
| state = [[Sidlakang Kabisay-an (rehiyon sa Pilipinas)|Sidlakang Kabisay-an]]
| state_type = Rehiyon
| region =
| region_type =
| district =
| district_type =
| economic_region =
| economic_region_type =
<!-- *** Associated with *** -->
| border =
| part =
| city =
| landmark =
| river =
<!-- *** Location *** -->
| capital =
| capital_type =
| capital_location =
| capital_region =
| capital_country =
| capital_elevation =
| capital_lat_d =
| capital_lat_m =
| capital_lat_s =
| capital_lat_NS =
| capital_long_d =
| capital_long_m =
| capital_long_s =
| capital_long_EW =
| highest =
| highest_location =
| highest_region =
| highest_country =
| highest_elevation =
| highest_lat_d =
| highest_lat_m =
| highest_lat_s =
| highest_lat_NS =
| highest_long_d =
| highest_long_m =
| highest_long_s =
| highest_long_EW =
| lowest =
| lowest_location =
| lowest_region =
| lowest_country =
| lowest_elevation =
| lowest_lat_d =
| lowest_lat_m =
| lowest_lat_s =
| lowest_lat_NS =
| lowest_long_d =
| lowest_long_m =
| lowest_long_s =
| lowest_long_EW =
<!-- *** Dimensions *** -->
| length =
| length_orientation =
| width =
| width_orientation =
| area = 4660.47
| area_decimals =
<!-- *** Population *** -->
| population = 405114
| population_date = 2015-04-02
| population_density = auto
| established =
| date =
| government_location =
| government_region =
| government_country =
| government_elevation =
| government_lat_d =
| government_lat_m =
| government_lat_s =
| government_lat_NS =
| government_long_d =
| government_long_m =
| government_long_s =
| government_long_EW =
| leader =
| leader_party =
<!-- *** Codes *** -->
| timezone = [[Philippine Standard Time|PST]]
| utc_offset = +8
| timezone_DST =
| utc_offset_DST =
| postal_code =
| area_code =
| code =
<!-- *** Free *** -->
| free =
| free_type =
<!-- *** Maps *** -->
| map =
| map_size =
| map_caption =
| map_locator_x =
| map_locator_y =
<!-- *** Website *** -->
| website =
<!-- *** Notes *** -->
| footnotes =
| other_name1 = Samar Oriental
| other_name2 = Silangang Samar
| lat_d = 11.53054
| long_d = 125.47647
| elevation = 16
| population_note = <ref name = "gn1713986"/>
| timezone_label = Asia/Manila
| geonames = 1713986
}}
<!--A.ADM2-->[[administratibo nga mga dibisyon sa Pilipinas|Lalawigan]] ang '''Sidlakang Samar''' ([[Ininggles]]: '''Eastern Samar''', [[Tinagalog]]: '''Silangang Samar''') sa [[Pilipinas]].<ref name = "gn1713986"/> Nahimutang ni sa rehiyon sa <!--ADM1-->[[Sidlakang Kabisay-an (rehiyon sa Pilipinas)|Sidlakang Kabisay-an]], sa sidlakang bahin sa nasod, {{formatnum:600}} km sa habagatan-sidlakan sa [[Dakbayan sa Manila (ulohang dakbayan sa Pilipinas)|Dakbayan sa Manila]] ang ulohan sa nasod. Adunay <!--pop-->{{formatnum:405114}} ka molupyo.<ref name = "gn1713986"/> Naglangkob kin og {{formatnum:4660}} ka kilometro kwadrado. Ang Sidlakang Samar nahimutang sa pulo sa [[Samar (pulo)|Samar]].{{efn|group=saysay|Kalkulado gikan sa gitas-on data (DEM 3") gikan sa Viewfinder Panoramas.<ref name = "vp"/> Ang bug-os nga algoritmo anaa [https://sv.wikipedia.org/wiki/Wikipedia:Projekt_DotNetWikiBot_Framework/Lsjbot/Make-Geonames dinhi].}}
Ang yuta sa Sidlakang Samar kay kasagaran kabungtoran, apan sa habagatang-sidlakan nga kini mao ang patag.{{efn|group=saysay|Kalkulado gikan sa gitas-on data (DEM 3") gikan sa Viewfinder Panoramas.<ref name = "vp"/> Ang bug-os nga algoritmo anaa [https://sv.wikipedia.org/wiki/Wikipedia:Projekt_DotNetWikiBot_Framework/Lsjbot/Make-Geonames dinhi].}}
Sidlakang Samar may sa mosunod nga mga subdibisyon:
* [[Taft (munisipyo)|Taft]]
* [[Sulat (munisipyo)|Sulat]]
* [[San Policarpo (munisipyo)|San Policarpo]]
* [[San Julian (munisipyo sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 11,73, long 125,37)|San Julian]]
* [[Salcedo (munisipyo sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 11,17, long 125,62)|Salcedo]]
* [[Quinapundan (munisipyo)|Quinapundan]]
* [[Oras (munisipyo)|Oras]]
* [[Maydolong (munisipyo)|Maydolong]]
* [[Maslog (munisipyo)|Maslog]]
* [[Llorente (munisipyo)|Llorente]]
* [[Lawa-an (munisipyo sa Pilipinas, Sidlakang Kabisay-an)|Lawa-an]]
* [[Jipapad (munisipyo sa Pilipinas)|Jipapad]]
* [[Hernani (munisipyo sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 11,33, long 125,58)|Hernani]]
* [[Guiuan (munisipyo)|Guiuan]]
* [[Giporlos (munisipyo)|Giporlos]]
* [[General MacArthur (munisipyo)|General MacArthur]]
* [[Dolores (munisipyo sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 12,05, long 125,33)|Dolores]]
* [[Can-Avid (munisipyo)|Can-Avid]]
* [[City of Borongan]]
* [[Balangkayan (munisipyo)|Balangkayan]]
* [[Balangiga (munisipyo)|Balangiga]]
* [[Arteche (munisipyo)|Arteche]]
Mga lungsod sa Sidlakang Samar:
* [[Dolores (lungsod sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 12,04, long 125,48)|Dolores]]
* [[Llorente (lungsod sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 11,41, long 125,55)|Llorente]]
* [[Balangiga (lungsod)|Balangiga]]
* [[Maydolong (lungsod)|Maydolong]]
* [[Hipadpad]]
* [[Balangkayan (lungsod)|Balangkayan]]
* [[Sulangan (lungsod sa Pilipinas, Sidlakang Kabisay-an)|Sulangan]]
* [[Balud (lungsod sa Pilipinas, Sidlakang Kabisay-an)|Balud]]
* [[Dao (lungsod)|Dao]]
* [[Maypangdan]]
* [[Cabay (lungsod sa Pilipinas, Sidlakang Kabisay-an)|Cabay]]
* [[Nena (lungsod)|Nena]]
* [[Dapdap (lungsod sa Pilipinas, Sidlakang Kabisay-an)|Dapdap]]
* [[San Eduardo (lungsod sa Pilipinas)|San Eduardo]]
* [[Alugan (lungsod sa Pilipinas)|Alugan]]
* [[Mantang (lungsod)|Mantang]]
* [[Lalauigan]]
Sa mosunod nga mga natural nga mga bahin makita sa Sidlakang Samar:
* Nabigasyon:
:* [[Calicoan Pass]] (<!--H.CHNM-->[[agianan nga kadagatan]])
:* [[Minanut Anchorage]] (<!--H.ANCH-->[[pundohanan]])
:* [[Nabugtusan Channel]] (<!--H.CHNM-->[[agianan nga kadagatan]])
:* [[Port Borongan]] (<!--H.ANCH-->[[pundohanan]])
:* [[Port Libas]] (<!--H.ANCH-->[[pundohanan]])
* Mga luuk:
:* [[Alugan Bay]] (<!--H.BAY-->[[luuk]])
:* [[Bactol Bay]] (<!--H.BAY-->[[luuk]])
:* [[Baligasag Bay]] (<!--H.BAY-->[[luuk]])
:* [[Binugayan Bay]] (<!--H.BAY-->[[luuk]])
:* [[Cabay Bay]] (<!--H.BAY-->[[luuk]])
:* [[Casogoran Bay]] (<!--H.BAY-->[[luuk]])
:* [[Lipusan Bay]] (<!--H.BAY-->[[luuk]])
:* [[Maglolobo Bay]] (<!--H.BAY-->[[luuk]])
:* [[Matarinao Bay]] (<!--H.BAY-->[[luuk]])
:* [[Nagaha Bay]] (<!--H.BAY-->[[luuk]])
:* [[Napla Bay]] (<!--H.BAY-->[[luuk]])
:* [[Oras Bay]] (<!--H.BAY-->[[luuk]])
:* [[Panablijon Bay]] (<!--H.BAY-->[[luuk]])
:* [[Pangpang Bay]] (<!--H.BAY-->[[luuk]])
:* [[Quinapundan Bay]] (<!--H.BAY-->[[luuk]])
:* [[San Policarpo Bay]] (<!--H.BAY-->[[luuk]])
:* [[San Ramon Bay]] (<!--H.BAY-->[[luuk]])
:* [[Sua Bay (luuk sa Pilipinas, Sidlakang Samar)|Sua Bay]] (<!--H.BAY-->[[luuk]])
:* [[Sulat Bay]] (<!--H.BAY-->[[luuk]])
* Mga suba:
:* [[Alugan River]] (<!--H.STM-->[[suba]])
:* [[Aroganga River]] (<!--H.STM-->[[suba]])
:* [[Balangiga River]] (<!--H.STM-->[[suba]])
:* [[Bantayan River (suba sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Bantayan River]] (<!--H.STM-->[[suba]])
:* [[Barujb River]] (<!--H.STM-->[[suba]])
:* [[Bato River (suba sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Bato River]] (<!--H.STM-->[[suba]])
:* [[Binalayan River]] (<!--H.STM-->[[suba]])
:* [[Bolalacao River]] (<!--H.STM-->[[suba]])
:* [[Borongan River]] (<!--H.STM-->[[suba]])
:* [[Bugas River (suba sa Pilipinas, Sidlakang Kabisay-an)|Bugas River]] (<!--H.STM-->[[suba]])
:* [[Cabay River]] (<!--H.STM-->[[suba]])
:* [[Cabayaoan River]] (<!--H.STM-->[[suba]])
:* [[Cahoti River]] (<!--H.STM-->[[suba]])
:* [[Cambanug River]] (<!--H.STM-->[[suba]])
:* [[Canooma River]] (<!--H.STM-->[[suba]])
:* [[Danao River (suba sa Pilipinas, Sidlakang Kabisay-an)|Danao River]] (<!--H.STM-->[[suba]])
:* [[Dapdap River (suba sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Dapdap River]] (<!--H.STM-->[[suba]])
:* [[Dolores River (suba sa Pilipinas)|Dolores River]] (<!--H.STM-->[[suba]])
:* [[Doongoon River]] (<!--H.STM-->[[suba]])
:* [[Dulang River (suba sa Pilipinas, Sidlakang Kabisay-an)|Dulang River]] (<!--H.STM-->[[suba]])
:* [[Hernani River]] (<!--H.STM-->[[suba]])
:* [[Lauaan River (suba sa Pilipinas)|Lauaan River]] (<!--H.STM-->[[suba]])
:* [[Layog River (suba sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Layog River]] (<!--H.STM-->[[suba]])
:* [[Libas River (suba sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Libas River]] (<!--H.STM-->[[suba]])
:* [[Llorente River]] (<!--H.STM-->[[suba]])
:* [[Loom River]] (<!--H.STM-->[[suba]])
:* [[Losungan River]] (<!--H.STM-->[[suba]])
:* [[Malobago River]] (<!--H.STM-->[[suba]])
:* [[Mantang River]] (<!--H.STM-->[[suba]])
:* [[Mayon River (suba sa Pilipinas, Sidlakang Kabisay-an)|Mayon River]] (<!--H.STM-->[[suba]])
:* [[Moranon River]] (<!--H.STM-->[[suba]])
:* [[Mubmub River]] (<!--H.STM-->[[suba]])
:* [[Opong River (suba sa Pilipinas, Sidlakang Samar)|Opong River]] (<!--H.STM-->[[suba]])
:* [[Oras River]] (<!--H.STM-->[[suba]])
:* [[Pambuhan River (suba sa Pilipinas)|Pambuhan River]] (<!--H.STM-->[[suba]])
:* [[Panablijon River]] (<!--H.STM-->[[suba]])
:* [[Pandan River (suba sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Pandan River]] (<!--H.STM-->[[suba]])
:* [[Pulane River]] (<!--H.STM-->[[suba]])
:* [[Quinapundan River]] (<!--H.STM-->[[suba]])
:* [[Salug River (suba sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Salug River]] (<!--H.STM-->[[suba]])
:* [[San Eduardo River (suba sa Pilipinas, lat 12,17, long 124,47)|San Eduardo River]] (<!--H.STM-->[[suba]])
:* [[San Eduardo River (suba sa Pilipinas, lat 12,17, long 125,46)|San Eduardo River]] (<!--H.STM-->[[suba]])
:* [[San Ramon River (suba sa Pilipinas, Sidlakang Kabisay-an)|San Ramon River]] (<!--H.STM-->[[suba]])
:* [[Siginon River]] (<!--H.STM-->[[suba]])
:* [[Sulat River]] (<!--H.STM-->[[suba]])
:* [[Suribao River]] (<!--H.STM-->[[suba]])
:* [[Taft River]] (<!--H.STM-->[[suba]])
:* [[Tamboc River]] (<!--H.STM-->[[suba]])
:* [[Tanglao River (suba sa Pilipinas)|Tanglao River]] (<!--H.STM-->[[suba]])
:* [[Tubig River]] (<!--H.STM-->[[suba]])
:* [[Tubigan River]] (<!--H.STM-->[[suba]])
:* [[Tungkip River]] (<!--H.STM-->[[suba]])
:* [[Ulot River (suba sa Pilipinas)|Ulot River]] (<!--H.STM-->[[suba]])
:* [[Ulut River]] (<!--H.STM-->[[suba]])
:* [[Ungay River]] (<!--H.STM-->[[suba]])
* Salog sa dagat:
:* [[Calianan Shoal]] (<!--H.SHOL-->[[piliw]])
:* [[Walker Shoal (piliw sa Pilipinas)|Walker Shoal]] (<!--H.SHOL-->[[piliw]])
* Kapuloan:
:* [[Agauan Island]] (<!--T.ISL-->[[pulo]])
:* [[Anahap Island]] (<!--T.ISL-->[[pulo]])
:* [[Anajao Island (pulo sa Pilipinas, Sidlakang Samar)|Anajao Island]] (<!--T.ISL-->[[pulo]])
:* [[Andis Island]] (<!--T.ISL-->[[pulo]])
:* [[Apitong Island]] (<!--T.ISL-->[[pulo]])
:* [[Bactol Island]] (<!--T.ISL-->[[pulo]])
:* [[Baganbanua Island]] (<!--T.ISL-->[[pulo]])
:* [[Bakalod Island]] (<!--T.ISL-->[[pulo]])
:* [[Bakolod Island]] (<!--T.ISL-->[[pulo]])
:* [[Balinatio Island]] (<!--T.ISL-->[[pulo]])
:* [[Baohan Island]] (<!--T.ISL-->[[pulo]])
:* [[Bar Islet]] (<!--T.ISL-->[[pulo]])
:* [[Basod Island]] (<!--T.ISL-->[[pulo]])
:* [[Baul Island]] (<!--T.ISL-->[[pulo]])
:* [[Benarauam Island]] (<!--T.ISL-->[[pulo]])
:* [[Binabasalan Islet]] (<!--T.ISL-->[[pulo]])
:* [[Binarayan Island]] (<!--T.ISL-->[[pulo]])
:* [[Borabo Island]] (<!--T.ISL-->[[pulo]])
:* [[Botic Island]] (<!--T.ISL-->[[pulo]])
:* [[Cabalarian Island]] (<!--T.ISL-->[[pulo]])
:* [[Calicoan Island]] (<!--T.ISL-->[[pulo]])
:* [[Cambaangan Island]] (<!--T.ISL-->[[pulo]])
:* [[Cambasingan Island]] (<!--T.ISL-->[[pulo]])
:* [[Cancahinibing Island]] (<!--T.ISL-->[[pulo]])
:* [[Candulo Island]] (<!--T.ISL-->[[pulo]])
:* [[Canigaran Islands]] (<!--T.ISLS-->[[kapuloan]])
:* [[Caninoan Island]] (<!--T.ISL-->[[pulo]])
:* [[Cantican Island]] (<!--T.ISL-->[[pulo]])
:* [[Catalaban Island]] (<!--T.ISL-->[[pulo]])
:* [[Coco Islands (kapuloan sa Pilipinas)|Coco Islands]] (<!--T.ISLS-->[[kapuloan]])
:* [[Coral Island (pulo sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Coral Island]] (<!--T.ISL-->[[pulo]])
:* [[Dalo Island]] (<!--T.ISL-->[[pulo]])
:* [[Divinubo Island]] (<!--T.ISL-->[[pulo]])
:* [[Dry Island (pulo sa Pilipinas)|Dry Island]] (<!--T.ISL-->[[pulo]])
:* [[Fulin Island]] (<!--T.ISL-->[[pulo]])
:* [[Guotasan Island]] (<!--T.ISL-->[[pulo]])
:* [[Hilaba-an Island]] (<!--T.ISL-->[[pulo]])
:* [[Hilaban Island]] (<!--T.ISL-->[[pulo]])
:* [[Homonhon Island]] (<!--T.ISL-->[[pulo]])
:* [[Inayauan Island]] (<!--T.ISL-->[[pulo]])
:* [[Iniyao Island]] (<!--T.ISL-->[[pulo]])
:* [[Juana Island]] (<!--T.ISL-->[[pulo]])
:* [[Kabani Island]] (<!--T.ISL-->[[pulo]])
:* [[Kanadag Island]] (<!--T.ISL-->[[pulo]])
:* [[Kapapariuan Islet]] (<!--T.ISL-->[[pulo]])
:* [[Lalauigan Island]] (<!--T.ISL-->[[pulo]])
:* [[Lapogpocahan Island]] (<!--T.ISL-->[[pulo]])
:* [[Lauaan Island]] (<!--T.ISL-->[[pulo]])
:* [[Leleboon Island (pulo sa Pilipinas)|Leleboon Island]] (<!--T.ISL-->[[pulo]])
:* [[Linao Island]] (<!--T.ISL-->[[pulo]])
:* [[Linoa Island]] (<!--T.ISL-->[[pulo]])
:* [[Loud Island (pulo sa Pilipinas)|Loud Island]] (<!--T.ISL-->[[pulo]])
:* [[Luctaban Island]] (<!--T.ISL-->[[pulo]])
:* [[Macalayo Island]] (<!--T.ISL-->[[pulo]])
:* [[Maiduun Islands]] (<!--T.ISLS-->[[kapuloan]])
:* [[Makate Island]] (<!--T.ISL-->[[pulo]])
:* [[Manicani Island]] (<!--T.ISL-->[[pulo]])
:* [[Masisingi Island]] (<!--T.ISL-->[[pulo]])
:* [[Minaanod Island (pulo sa Pilipinas)|Minaanod Island]] (<!--T.ISL-->[[pulo]])
:* [[Minadion Island]] (<!--T.ISL-->[[pulo]])
:* [[Minaloa Island]] (<!--T.ISL-->[[pulo]])
:* [[Minanut Island]] (<!--T.ISL-->[[pulo]])
:* [[Minasañgan Island]] (<!--T.ISL-->[[pulo]])
:* [[Montoconan Island]] (<!--T.ISL-->[[pulo]])
:* [[Mugtma Island]] (<!--T.ISL-->[[pulo]])
:* [[Nabalicad Island]] (<!--T.ISL-->[[pulo]])
:* [[Naburaburao Island]] (<!--T.ISL-->[[pulo]])
:* [[Onas Island]] (<!--T.ISL-->[[pulo]])
:* [[Panit Island]] (<!--T.ISL-->[[pulo]])
:* [[Pasig Island]] (<!--T.ISL-->[[pulo]])
:* [[Popotihon Island]] (<!--T.ISL-->[[pulo]])
:* [[Rapit Island]] (<!--T.ISL-->[[pulo]])
:* [[Raton Island (pulo sa Pilipinas, Sidlakang Kabisay-an)|Raton Island]] (<!--T.ISL-->[[pulo]])
:* [[Sibay Island (pulo sa Pilipinas, Sidlakang Kabisay-an)|Sibay Island]] (<!--T.ISL-->[[pulo]])
:* [[Sisi Island (pulo sa Pilipinas)|Sisi Island]] (<!--T.ISL-->[[pulo]])
:* [[Suluan Island]] (<!--T.ISL-->[[pulo]])
:* [[Tenatoulan Island]] (<!--T.ISL-->[[pulo]])
:* [[Tinongtongan Island]] (<!--T.ISL-->[[pulo]])
:* [[Tubabao Island (pulo sa Pilipinas, lat 12,11, long 125,56)|Tubabao Island]] (<!--T.ISL-->[[pulo]])
:* [[Tubabao Island (pulo sa Pilipinas, lat 11,05, long 125,69)|Tubabao Island]] (<!--T.ISL-->[[pulo]])
:* [[Uguis Island]] (<!--T.ISL-->[[pulo]])
* Nga bato nga pormasyon:
:* [[Mushroom Rock (bato sa Pilipinas, Sidlakang Kabisay-an)|Mushroom Rock]] (<!--T.RK-->[[bato]])
:* [[Pinnacle Rock (bato sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 10,77, long 125,97)|Pinnacle Rock]] (<!--T.RK-->[[bato]])
:* [[Pinnacle Rock (bato sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar, lat 10,75, long 125,97)|Pinnacle Rock]] (<!--T.RK-->[[bato]])
:* [[Pou Rock]] (<!--T.RK-->[[bato]])
:* [[Pyramidal Rock]] (<!--T.RK-->[[bato]])
* Mga lawis:
:* [[Agdan Point]] (<!--T.PT-->[[punta]])
:* [[Agojo Point (punta sa Pilipinas)|Agojo Point]] (<!--T.PT-->[[punta]])
:* [[Amogotada Point (punta sa Pilipinas, Sidlakang Samar)|Amogotada Point]] (<!--T.PT-->[[punta]])
:* [[Anitaguipan Point]] (<!--T.PT-->[[punta]])
:* [[Asgad Point]] (<!--T.PT-->[[punta]])
:* [[Bactol Point]] (<!--T.PT-->[[punta]])
:* [[Bagtong Point]] (<!--T.PT-->[[punta]])
:* [[Bankari Point]] (<!--T.PT-->[[punta]])
:* [[Bantayan Point (punta sa Pilipinas, Sidlakang Kabisay-an)|Bantayan Point]] (<!--T.PT-->[[punta]])
:* [[Barapdaban Point]] (<!--T.PT-->[[punta]])
:* [[Baras Point (punta sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Baras Point]] (<!--T.PT-->[[punta]])
:* [[Baris Point]] (<!--T.PT-->[[punta]])
:* [[Binugawan Point]] (<!--T.PT-->[[punta]])
:* [[Bobon Point (punta sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Bobon Point]] (<!--T.PT-->[[punta]])
:* [[Bunga Point (punta sa Pilipinas, Sidlakang Kabisay-an)|Bunga Point]] (<!--T.PT-->[[punta]])
:* [[Bura Point]] (<!--T.PT-->[[punta]])
:* [[Bypungnan Point]] (<!--T.PT-->[[punta]])
:* [[Cabadlongan Point]] (<!--T.PT-->[[punta]])
:* [[Cabarasan Point]] (<!--T.PT-->[[punta]])
:* [[Cablagna Point]] (<!--T.PT-->[[punta]])
:* [[Cabra Point]] (<!--T.PT-->[[punta]])
:* [[Cagbanlio Point]] (<!--T.PT-->[[punta]])
:* [[Cagosoan Point]] (<!--T.PT-->[[punta]])
:* [[Canaybon Point]] (<!--T.PT-->[[punta]])
:* [[Cannomanda Point]] (<!--T.PT-->[[punta]])
:* [[Capinas Point]] (<!--T.PT-->[[punta]])
:* [[Carapdas Point]] (<!--T.PT-->[[punta]])
:* [[Colasi Point (punta sa Pilipinas, Sidlakang Kabisay-an)|Colasi Point]] (<!--T.PT-->[[punta]])
:* [[Coracoraan Point]] (<!--T.PT-->[[punta]])
:* [[Gigoso Point]] (<!--T.PT-->[[punta]])
:* [[Gintaguican Point]] (<!--T.PT-->[[punta]])
:* [[Guinanug Point]] (<!--T.PT-->[[punta]])
:* [[Hagnaya Point]] (<!--T.PT-->[[punta]])
:* [[Handig Point]] (<!--T.PT-->[[punta]])
:* [[Haravis Point]] (<!--T.PT-->[[punta]])
:* [[Hinablan Point]] (<!--T.PT-->[[punta]])
:* [[Homoraon Point]] (<!--T.PT-->[[punta]])
:* [[Kanaoayong Point]] (<!--T.PT-->[[punta]])
:* [[Lalawigan Point (punta sa Pilipinas, Sidlakang Kabisay-an)|Lalawigan Point]] (<!--T.PT-->[[punta]])
:* [[Lauaan Point]] (<!--T.PT-->[[punta]])
:* [[Lucson Point]] (<!--T.PT-->[[punta]])
:* [[Ludo Point]] (<!--T.PT-->[[punta]])
:* [[Luyong Point]] (<!--T.PT-->[[punta]])
:* [[Macatol Point (punta sa Pilipinas, Sidlakang Kabisay-an)|Macatol Point]] (<!--T.PT-->[[punta]])
:* [[Macatucas Point]] (<!--T.PT-->[[punta]])
:* [[Magnana Point]] (<!--T.PT-->[[punta]])
:* [[Malapacao Point]] (<!--T.PT-->[[punta]])
:* [[Malistis Point]] (<!--T.PT-->[[punta]])
:* [[Matarinao Point]] (<!--T.PT-->[[punta]])
:* [[Najibil Point]] (<!--T.PT-->[[punta]])
:* [[Nasomo Point]] (<!--T.PT-->[[punta]])
:* [[Pagbabacnan Point]] (<!--T.PT-->[[punta]])
:* [[Palan Point]] (<!--T.PT-->[[punta]])
:* [[Palanas Point (punta sa Pilipinas)|Palanas Point]] (<!--T.PT-->[[punta]])
:* [[Pamang Point]] (<!--T.PT-->[[punta]])
:* [[Pamunacan Point]] (<!--T.PT-->[[punta]])
:* [[Panadlihan Point (punta sa Pilipinas)|Panadlihan Point]] (<!--T.PT-->[[punta]])
:* [[Pananamitan Point]] (<!--T.PT-->[[punta]])
:* [[Paninihian Point]] (<!--T.PT-->[[punta]])
:* [[Paporan Point]] (<!--T.PT-->[[punta]])
:* [[Pindilin Point]] (<!--T.PT-->[[punta]])
:* [[Ranis Point]] (<!--T.PT-->[[punta]])
:* [[San Miguel Point (punta sa Pilipinas, Sidlakang Kabisay-an)|San Miguel Point]] (<!--T.PT-->[[punta]])
:* [[Soribao Point]] (<!--T.PT-->[[punta]])
:* [[Sua Point]] (<!--T.PT-->[[punta]])
:* [[Sungi Point]] (<!--T.PT-->[[punta]])
:* [[Taig Point]] (<!--T.PT-->[[punta]])
:* [[Tubigan Point (punta sa Pilipinas, Sidlakang Kabisay-an, Sidlakang Samar)|Tubigan Point]] (<!--T.PT-->[[punta]])
:* [[Tugasan Point]] (<!--T.PT-->[[punta]])
:* [[Tugnug Point]] (<!--T.PT-->[[punta]])
* Kabukiran:
:* [[Mount Amangsarahacan]] (<!--T.MT-->[[bukid]])
:* [[Mount Barayan]] (<!--T.MT-->[[bukid]])
:* [[Mount Bihag]] (<!--T.MT-->[[bukid]])
:* [[Mount Honop]] (<!--T.MT-->[[bukid]])
:* [[Mount Mactaon]] (<!--T.MT-->[[bukid]])
:* [[Mount Magnagua]] (<!--T.MT-->[[bukid]])
:* [[Mount Pacgem]] (<!--T.MT-->[[bukid]])
* Kagaangan:
:* [[Candamat Reef]] (<!--H.RF-->[[kagaangan]])
{{Location map|Philippines |float = right |width=300 | caption = Nahimutangan sa Sidlakang Samar sa Pilipinas. | label = Sidlakang Samar|position=left|background=white|lat=11.53054|long=125.47647}}
Ang klima [[tropikal nga kasalupan]].<ref name = "koppen"/> Ang kasarangang giiniton {{formatnum:23}} [[°C]]. Ang kinainitan nga bulan Hunyo, sa {{formatnum:24}} [[°C]], ug ang kinabugnawan Enero, sa {{formatnum:20}} °C.<ref name = "nasa"/> Ang kasarangang pag-ulan {{formatnum:4682}} milimetro matag tuig. Ang kinabasaan nga bulan Enero, sa {{formatnum:756}} milimetro nga ulan, ug ang kinaugahan Mayo, sa {{formatnum:153}} milimetro.<ref name = "nasarain"/>
{|
|-
|{{climate chart
| Sidlakang Samar
| 16| 23| 756
| 22| 24| 444
| 21| 23| 349
| 22| 26| 278
| 22| 25| 153
| 24| 25| 406
| 21| 23| 327
| 23| 25| 200
| 22| 26| 341
| 23| 23| 333
| 21| 24| 414
| 21| 24| 683
|maxprecip = 756
|float=left
|clear=left
|source = <ref name = "nasa"/>
}}
|}
== Saysay ==
<references group="saysay"/>
== Ang mga gi basihan niini ==
{{reflist|2}}
<ref name = "gn1713986">[{{Geonameslink|gnid=1713986|name=province%20of%20eastern%20samar}} Province of Eastern Samar] at [{{Geonamesabout}} GeoNames.Org (cc-by)]; post updated 2015-04-02; database download sa 2015-11-25</ref>
<ref name = "vp">{{Cite web |url= {{Viewfinderlink}}|title= Viewfinder Panoramas Digital elevation Model|date= 2015-06-21|format= }}</ref>
<ref name = "koppen">{{cite journal |last= Peel|first= M C|last2= Finlayson|first2= B L|date= |title= Updated world map of the Köppen-Geiger climate classification| url = http://www.hydrol-earth-syst-sci.net/11/1633/2007/hess-11-1633-2007.html |journal= Hydrology and Earth System Sciences|publisher= |volume= 11|issue= |pages= 1633-1644|doi= 10.5194/hess-11-1633-2007|access-date=30 Enero 2016}}</ref>
<ref name = "nasa">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/dataset_index.php|title= NASA Earth Observations Data Set Index|access-date = 30 Enero 2016 |publisher= NASA}}</ref>
<ref name = "nasarain">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/view.php?datasetId=TRMM_3B43M&year=2014|title= NASA Earth Observations: Rainfall (1 month - TRMM)|access-date = 30 Enero 2016 |publisher= NASA/Tropical Rainfall Monitoring Mission}}</ref>
</references>
{{Eastern Samar}}
{{Sidlakang Kabisay-an}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
mjz2ag6a1oryolzr5zpmk8sqiekos9x
37019539
37019528
2026-05-01T14:31:07Z
Exec8
10305
37019539
wikitext
text/x-wiki
Ang '''Lalawigan sa Eastern Samar''' (o '''Lalawigan sa Sidlakang Samar''') usa sa mga lalawigan sa pulo sa Samar. [[Borongan, Eastern Samar|Borongan]] maoy ang kapital o ulohan sa lalawigan. Ang lalawigan nahimutangan sa sidlakang dapit sa pulo sa Samar. Sa amihanan sa lalawigan, makaplagan ang lalawigan sa [[Northern Samar]] ug sa kasadpan ang [[Samar (lalawigan)|lalawigan sa Samar]]. Sa sidlakan sa lalawigan ang [[Dagat Pilipinhon]] ug ang [[Golpo sa Leyte]] sa habagatan.
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Eastern Samar<br />Lalawigan sa Sidlakang Samar|
sealfile=[[Payl:Ph_seal_east_samar.png|300px]]|
rehiyon=[[Sidlakang Kabisay-an]] (Region VIII)|
capital=[[Borongan, Eastern Samar|Borongan]]|
founded=[[19 sa Hunyo]], [[1965]]|
pop2000=375,822|
pop2000rank=ika-20 sa kinagamay|
popden2000=87|
popden2000rank=ika-13 sa kinagamay|
areakm2=4,339.6|
arearank=ika-28 sa kinadak-an|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=1|
mga lungsod=22|
mga barangay=597|
mga distrito=1|
mga pinulongan=[[Winaray]]|
gobernador=Ben Evardone|
locatormapfile=[[Payl:Ph_locator_map_eastern_samar (white).png]]}}
== Kataw'han ==
[[Winaray|Binisayang Winaray]] ang lumad nga pinulongan sa Eastern Samar
== Ekonomiya ==
== Heyograpiya ==
=== Political ===
Ang Sidlakang Samar may usa ka dakbayan ug 22 ka mga lungsod.
==== Dakbayan ====
* [[Dakbayan sa Borongan]]
==== Mga Lungsod ====
<table border="0"><tr>
<td valign="top">
* [[Arteche, Eastern Samar|Arteche]]
* [[Balangiga, Eastern Samar|Balangiga]]
* [[Balangkayan, Eastern Samar|Balangkayan]]
* [[Can-avid, Eastern Samar|Can-avid]]
* [[Dolores, Eastern Samar|Dolores]]
* [[General MacArthur, Eastern Samar|General MacArthur]]
* [[Giporlos, Eastern Samar|Giporlos]]
* [[Guiuan, Eastern Samar|Guiuan]]
* [[Hernani, Eastern Samar|Hernani]]
* [[Jipapad, Eastern Samar|Jipapad]]
* [[Lawaan, Eastern Samar|Lawaan]]
</td><td valign="top">
* [[Llorente, Eastern Samar|Llorente]]
* [[Maslog, Eastern Samar|Maslog]]
* [[Maydolong, Eastern Samar|Maydolong]]
* [[Mercedes, Eastern Samar|Mercedes]]
* [[Oras, Eastern Samar|Oras]]
* [[Quinapondan, Eastern Samar|Quinapondan]]
* [[Salcedo, Eastern Samar|Salcedo]]
* [[San Julian, Eastern Samar|San Julian]]
* [[San Policarpo, Eastern Samar|San Policarpo]]
* [[Sulat, Eastern Samar|Sulat]]
* [[Taft, Eastern Samar|Taft]]
</td></tr></table>
=== Pisikal ===
== Turismo ==
== Kasaysayan ==
== Kitaa Usab ==
* [[Talaan sa mga Gobernador sa Sidlakang Samar]]
==Mga sumpay sa gawas==
* [http://www.easternsamar.gov.ph/ Opisyal na Websayt sa Eastern Samar] {{Webarchive|url=https://web.archive.org/web/20120318012732/http://www.easternsamar.gov.ph/ |date=2012-03-18 }}
* [http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Eastern%20Samar Panid sa Ahensyang Impormasyong Pilipinhon (Philippine Information Agency) mahitungod sa Eastern Samar] {{Webarchive|url=https://web.archive.org/web/20070927015854/http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Eastern%20Samar |date=2007-09-27 }}
* [http://www.calicoanisland.com/ Guiuan] {{Webarchive|url=https://web.archive.org/web/20051123103506/http://www.calicoanisland.com/ |date=2005-11-23 }}
* [http://www.easternsamar.de/html%20englisch/info%20e.%20samar.htm Eastern Samar] {{Webarchive|url=https://web.archive.org/web/20050908182955/http://easternsamar.de/html%20englisch/info%20e.%20samar.htm |date=2005-09-08 }}
== Ang mga gi basihan niini ==
{{reflist|2}}
{{Eastern Samar}}
{{Sidlakang Kabisay-an}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
ez1q66n733edf7j9f3y1odfb33uqit9
Amihanang Samar
0
1478
37019541
34909563
2026-05-01T14:32:26Z
Exec8
10305
37019541
wikitext
text/x-wiki
Ang '''Amihanang Samar''' ([[Iningles]]: '''Northern Samar''') usa sa mga lalawigan sa [[Sidlakang Kabisay-an]]. Ang ulohan o kapital sa lalawigan mao ang [[Catarman, Northern Samar|Catarman]] ug nahimutang kini sa amihanang bahin sa pulo sa [[Samar]]. Sa habagatan sa lalawigan mao ang mga lalawigan sa [[Sidlakang Samar]] ug [[Samar (lalawigan)|Samar]]. Sa amihanang-kasadpan, tabok sa [[San Bernardino Strait]] makaplagan ang [[Sorsogon]]; sa sidlakan makaplagan ang [[Dagat Pilipinhon]] ug sa kasadpan ang [[Dagat Samar]].
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Northern Samar<br>Lalawigan sa Amihanang Samar|
sealfile=[[Image:Ph_seal_north_samar.png]]|
rehiyon=[[Sidlakang Kabisay-an]] (Region VIII)|
capital=[[Catarman, Northern Samar|Catarman]]|
founded=[[19 sa Hunyo]], [[1965]]|
pop2000=500,639|
pop2000rank=ika-30 sa kinagamay|
popden2000=143|
popden2000rank=ika-25 sa kinagamay|
areakm2=3,498.0|
arearank=ika-37 sa kinadak-an|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=0|
mga lungsod=23|
mga barangay=597|
mga distrito=2|
mga pinulongan=[[Winaray]], [[Sinugboanon]], [[Inabaknon]]|
gobernador=Raul Daza|
locatormapfile=[[Image:Ph_locator_map_northern_samar(white).png]]}}
==Katawhan==
Tulo ang lumad nga [[pinulongan]] sa Amihanang Samar: [[Binisaya]]ng [[Winaray]], Binisayang [[Sinugboanon]] ug [[Inabaknon]]. Sinugboanon ang pinulongan sa mga lungsod sa [[San Isidro, Northern Samar|San Isidro]], [[San Antonio, Northern Samar|San Antonio]] ug sa [[San Vicente, Northern Samar|San Vicente]]. Ang pinulongang Inabaknon ang lumad nga pinulongan sa pulo ug lungsod sa [[Capul, Amihanang Samar|Capul]]. Winaray ang pinulongan sa ubang dapit sa lalawigan.
==Ekonomiya==
==Heyograpiya==
===Politikal===
Kawhaag upat (24) ang mga lungsod sa Amihanang Samar.
====Mga lungsod====
<table border="0"><tr>
<td valign="top">
*[[Allen, Northern Samar|Allen]]
*[[Biri, Northern Samar|Biri]]
*[[Bobon, Northern Samar|Bobon]]
*[[Capul, Northern Samar|Capul]]
*[[Catarman, Northern Samar|Catarman]]
*[[Catubig, Northern Samar|Catubig]]
*[[Gamay, Northern Samar|Gamay]]
*[[Laoang, Northern Samar|Laoang]]
*[[Lapinig, Northern Samar|Lapinig]]
*[[Las Navas, Northern Samar|Las Navas]]
*[[Lavezares, Northern Samar|Lavezares]]
*[[Lope de Vega, Northern Samar|Lope de Vega]]
</td><td valign="top">
*[[Mapanas, Northern Samar|Mapanas]]
*[[Mondragon, Northern Samar|Mondragon]]
*[[Palapag, Northern Samar|Palapag]]
*[[Pambujan, Northern Samar|Pambujan]]
*[[Rosario, Northern Samar|Rosario]]
*[[San Antonio, Northern Samar|San Antonio]]
*[[San Isidro, Northern Samar|San Isidro]]
*[[San Jose, Northern Samar|San Jose]]
*[[San Roque, Northern Samar|San Roque]]
*[[San Vicente, Northern Samar|San Vicente]]
*[[Silvino Lobos, Northern Samar|Silvino Lobos]]
*[[Victoria, Northern Samar|Victoria]]
</td></tr></table>
===Pisikal===
==Turismo==
==Kasaysayan==
==Kitaa Usab==
*[[Talaan sa mga Gobernador sa Northern Samar]]
==Impormasyon sa Gawas==
*[http://www.northernsamar.gov.ph/index.html Opisyal na Website sa Gobierno sa Probinsya sa Amihanang Samar] {{Webarchive|url=https://web.archive.org/web/20120209132750/http://www.northernsamar.gov.ph/index.html |date=2012-02-09 }}
*[http://elgu.ncc.gov.ph/ecommunity/northernsamar ELGU na websayt mahitungod sa Northern Samar] {{Webarchive|url=https://web.archive.org/web/20050425234540/http://elgu.ncc.gov.ph/ecommunity/northernsamar/ |date=2005-04-25 }}
*[http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Northern%20Samar Panid sa PIA mahitungod sa Northern Samar] {{Webarchive|url=https://web.archive.org/web/20070318113624/http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Northern%20Samar |date=2007-03-18 }}
== Mga Reperensya ==
{{reflist|2}}
{{Northern Samar}}
{{Sidlakang Kabisay-an}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
lcgfr43kgjotfn2n1gx66ohkx96srbz
Samar
0
1482
37019544
34909558
2026-05-01T14:32:56Z
Exec8
10305
37019544
wikitext
text/x-wiki
Ang '''Lalawigan sa Samar''' usa sa mga lalawigan sa [[Pilipinas]] sa [[Kabisay-an]]. Sa una ginganlan ang lalawigan na '''Western Samar''' (''Iningles'' sa '''Kasadpang Samar''') kay ang ngalan na '''Samar''' ngalan usab sa [[Samar (pulo)|pulo]]. Ang [[Dakbayan sa Catbalogan]] ang ulohan o kapital sa lalawigan. Lakip sa lalawigan ang kasadpang dapit sa pulo sa Samar ug mga pila ka pulo sa Dagat Samar sa kasadpan sa ''mainland''. Sa amihanan sa lalawigan makaplagan ang lalawigan sa Northern Samar ug sa sidlakan ang lalawigan sa Eastern Samar. Konektado ang Samar sa Leyte pinaagi sa Tulay San Juanico, sa Estrecho de San Juanico (o San Juanico Strait). Sa habagatan sa lalawigan maoy ang [[Golpo sa Leyte]].
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Samar|
sealfile=[[Image:Ph_seal_samar.png]]|
rehiyon=[[Sidlakang Kabisay-an]] (Region VIII)|
capital=[[Dakbayan sa Catbalogan]]|
founded=|
pop2000=641,124|
pop2000rank=ika-38 sa kinadak-an|
popden2000=115|
popden2000rank=ika-17 sa kinagamay|
areakm2=5,591.0|
arearank=ika-13 sa kinadak-an|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=1|
mga lungsod=25|
mga barangay=951|
mga distrito=2|
mga pinulongan=[[Winaray]], [[Sinugboanon]]|
gobernador=Milagrosa T. Tan|
locatormapfile=[[Image:Ph_locator_map_samar (white).png]]}}
==Kataw'han==
Binisayang [[Sinugboanon]] ang pinulongan sa mga pulo ug lungsod sa [[Almagro, Samar|Almagro]] ug [[Santo Niño, Samar|Santo Niño]] samtang Binisayang [[Winaray]] ang pinulongan sa ubang dapit sa lalawigan.
==Ekonomiya==
==Heyograpiya==
===Political===
Ang Samar nabahin ngadto sa 24 ka mga lungsod ug 2 ka dakbayan.
====Mga Dakbayan====
*[[Dakbayan sa Calbayog]]
*[[Dakbayan sa Catbalogan]]
====Mga Lungsod====
<table border="0"><tr>
<td valign="top">
*[[Almagro, Samar|Almagro]]
*[[Basay, Samar|Basay]]
*[[Calbiga, Samar|Calbiga]]
*[[Daram, Samar|Daram]]
*[[Gandara, Samar|Gandara]]
*[[Hinabangan, Samar|Hinabangan]]
*[[Jiabong, Samar|Jiabong]]
*[[Marabut, Samar|Marabut]]
*[[Matuguinao, Samar|Matuguinao]]
*[[Motiong, Samar|Motiong]]
*[[Pagsanghan, Samar|Pagsanghan]]
*[[Paranas, Samar|Paranas]] (Wright)
</td><td valign="top">
*[[Pinabacdao, Samar|Pinabacdao]]
*[[San Jorge, Samar|San Jorge]]
*[[San Jose De Buan, Samar|San Jose De Buan]]
*[[San Sebastian, Samar|San Sebastian]]
*[[Santa Margarita, Samar|Sta. Margarita]]
*[[Santa Rita, Samar|Sta. Rita]]
*[[Santo Niño, Samar|Sto. Niño]]
*[[Tagapul-an, Samar|Tagapul-an]]
*[[Talalora, Samar|Talalora]]
*[[Tarangnan, Samar|Tarangnan]]
*[[Villareal, Samar|Villareal]]
*[[Zumarraga, Samar|Zumarraga]]
</td></tr></table>
===Pisikal===
==Turismo==
==Kasaysayan==
==Kitaa Usab==
*[[Talaan sa mga Gobernador sa Samar]]
==Impormasyon sa Gawas==
*[http://elgu.ncc.gov.ph/ecommunity/westernsamar/ Opisyal na Website sa Gobierno sa Probinsya sa Samar (o Kasadpang Samar)] {{Webarchive|url=https://web.archive.org/web/20060319182404/http://elgu.ncc.gov.ph/ecommunity/westernsamar/ |date=2006-03-19 }}
*[http://samar.lgu-ph.com/ http://samar.lgu-ph.com]
*[http://www.pia.gov.ph/lgu.asp?ar=visayas&re=Eastern%20Visayas&pr=Western%20Samar Panid sa Ahensyang Impormasyong Pilipinhon (PIA) mahitungod sa Kasadpang Samar]
== Mga Reperensya ==
{{reflist|2}}
{{Samar}}
{{Sidlakang Kabisay-an}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
dnobatpe12zirc8mg6p9zo4l8s3jk3b
Aklan
0
1486
37019669
30581084
2026-05-01T16:38:40Z
Exec8
10305
37019669
wikitext
text/x-wiki
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Aklan|
sealfile=[[Payl:Ph_seal_aklan.png]]|
rehiyon=[[Kasadpang Kabisay-an]] (Region VI)|
capital=[[Kalibo, Aklan|Kalibo]]|
founded=[[_____ __]], [[1956]]|
pop2000=451,314|
pop2000rank=ika-24 sa kinagamay|
popden2000=248|
popden2000rank=ika-29 sa kinadam-an|
areakm2=1,817.9|
arearank=ika-18 sa kinagamay|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=0|
mga lungsod=17|
mga barangay=327|
mga distrito=1|
mga pinulongan=[[Akeanon]], [[Kinaray-a]], [[Hiligaynon]]|
gobernador=Florencio T. Miraflores|
locatormapfile=[[Payl:Ph_locator_map_aklan (white).png]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
== Kataw'han ==
Binisayang Aklanon (o [[Akeanon]]) ang lumad na pinulongan sa lalawigan sa Aklan. Samtang ''Aklanon'' ang paglitok sa ilang ngalan sa ubang pinulongang binisaya, sa lumad na pinulongan sa Aklan ''Akeanon'' ang ilang pagsuwat sa ilang paagi na paglitok sa ilang ngalan.
== Ekonomiya ==
== Heyograpiya ==
=== Politikal ===
Napulo'g pito (17) ang mga lungsod sa Aklan.
==== Mga Lungsod ====
<table border="0"><tr>
<td valign="top">
* [[Altavas, Aklan|Altavas]]
* [[Balete, Aklan|Balete]]
* [[Banga, Aklan|Banga]]
* [[Batan, Aklan|Batan]]
* [[Buruanga, Aklan|Buruanga]]
* [[Ibajay, Aklan|Ibajay]]
* [[Kalibo, Aklan|Kalibo]]
* [[Lezo, Aklan|Lezo]]
* [[Libacao, Aklan|Libacao]]
</td><td valign="top">
* [[Madalag, Aklan|Madalag]]
* [[Makato, Aklan|Makato]]
* [[Malay, Aklan|Malay]]
* [[Malinao, Aklan|Malinao]]
* [[Nabas, Aklan|Nabas]]
* [[New Washington, Aklan|New Washington]]
* [[Numancia, Aklan|Numancia]]
* [[Tangalan, Aklan|Tangalan]]
</td></tr></table>
=== Pisikal ===
== Kasaysayan ==
== Impormasyon sa Gawas ==
* Ang Opisyal nga Website sa Gobierno sa Lalawigan sa Aklan <div style="font-size:smaller;">http://popweb.i-next.net/~aklanpgo {{Webarchive|url=https://web.archive.org/web/20061209134334/http://popweb.i-next.net/%7Eaklanpgo/ |date=2006-12-09 }}</div>
* Ang Opisyal nga Website sa Lungsod sa Malinao, Aklan <div style="font-size:smaller;">http://www.malinao-aklan.ph {{Webarchive|url=https://web.archive.org/web/20201124025325/http://malinao-aklan.ph/ |date=2020-11-24 }}</div>
* Ang Opisyal nga Website sa Kalibo Ati-atihan Festival<div style="font-size:smaller;">http://www.ati-atihan.net/atihome.html {{Webarchive|url=https://web.archive.org/web/20051228060757/http://www.ati-atihan.net/atihome.html |date=2005-12-28 }}</div>
* Ang Opisyal nga Website sa Departamento sa Turismo sa Pilipinas<div style="font-
size:smaller;">http://www.wowphilippines.com.ph/explore_phil/place_details.asp?content=description&province=37</div>
== Mga Reperensya ==
{{reflist|2}}
{{Aklan}}
{{Kasadpang Kabisay-an}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
nvg2pst3nt2jb4o6y84c4mqk05b7fo1
Antique
0
1487
37019670
9555032
2026-05-01T16:39:26Z
Exec8
10305
37019670
wikitext
text/x-wiki
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Antique|
sealfile=[[Payl:Ph_seal_antique.png]]|
rehiyon=[[Kasadpang Kabisay-an]] (Region VI)|
capital=[[San Jose, Antique|San Jose]]|
founded=[[_____ __]], [[____]]|
pop2000=471,088|
pop2000rank=ika-26 sa kinagamay|
popden2000=187|
popden2000rank=ika-46 sa kinadam-an|
areakm2=2,522.0|
arearank=ika-25 sa kinagamay|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=0|
mga lungsod=18|
mga barangay=590|
mga distrito=1|
mga pinulongan=[[Kinaray-a]]|
gobernador=Salvacion Z. Perez|
locatormapfile=[[Payl:Ph_locator_map_antique (white).png]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
== Heyograpiya ==
=== Politikal ===
18 ang mga nahisakpang lungsod sa Antique.
==== Mga Lungsod ====
<table border="0"><tr>
<td valign="top">
* [[Anini-y, Antique|Anini-y]]
* [[Barbaza, Antique|Barbaza]]
* [[Belison, Antique|Belison]]
* [[Bugasong, Antique|Bugasong]]
* [[Caluya, Antique|Caluya]]
* [[Culasi, Antique|Culasi]]
* [[Hamtic, Antique|Hamtic]]
* [[Laua-an, Antique|Laua-an]]
* [[Libertad, Antique|Libertad]]
</td><td valign="top">
* [[Pandan, Antique|Pandan]]
* [[Patnongon, Antique|Patnongon]]
* [[San Jose, Antique|San Jose]]
* [[San Remigio, Antique|San Remigio]]
* [[Sebaste, Antique|Sebaste]]
* [[Sibalom, Antique|Sibalom]]
* [[Tibiao, Antique|Tibiao]]
* [[Tobias Fornier, Antique|Tobias Fornier]] (Dao)
* [[Valderrama, Antique|Valderrama]]
</td></tr></table>
=== Pisikal ===
== Kasaysayan ==
== Mga Reperensya ==
{{reflist|2}}
{{Antique}}
{{Kasadpang Kabisay-an}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
ghtf7stlj982c66yycbyqf8ckyr8m8r
Capiz
0
1488
37019671
34909565
2026-05-01T16:40:08Z
Exec8
10305
37019671
wikitext
text/x-wiki
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Capiz|
sealfile=[[Image:Ph_seal_capiz.png]]|
rehiyon=[[Kasadpang Kabisay-an]] (Region VI)|
capital=[[Dakbayan sa Roxas]]|
founded=[[_____ __]], [[____]]|
pop2000=654,156|
pop2000rank=ika-36 sa kinadak-an|
popden2000=248|
popden2000rank=ika-28 sa kinadam-an|
areakm2=2,633.2|
arearank=ika-30 sa kinagamay|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=1|
mga lungsod=16|
mga barangay=473|
mga distrito=2|
mga pinulongan=Hiligaynon|
gobernador=Vicente B. Bermejo|
locatormapfile=[[Image:Ph_locator_map_capiz (white).png]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Kataw'han ug Kultura==
==Ekonomiya==
==Heyograpiya==
===Politikal===
Napulo'g unom (16) ang mga lungsod sa Capiz ug usang dakbayan.
====Dakbayan====
*[[Dakbayan sa Roxas]]
====Mga Lungsod====
<table border="0"><tr>
<td valign="top">
*[[Cuartero, Capiz|Cuartero]]
*[[Dao, Capiz|Dao]]
*[[Dumalag, Capiz|Dumalag]]
*[[Dumarao, Capiz|Dumarao]]
*[[Ivisan, Capiz|Ivisan]]
*[[Jamindan, Capiz|Jamindan]]
*[[Ma-ayon, Capiz|Ma-ayon]]
*[[Mambusao, Capiz|Mambusao]]
</td><td valign="top">
*[[Panay, Capiz|Panay]]
*[[Panitan, Capiz|Panitan]]
*[[Pilar, Capiz|Pilar]]
*[[Pontevedra, Capiz|Pontevedra]]
*[[President Roxas, Capiz|President Roxas]]
*[[Sapi-an, Capiz|Sapi-an]]
*[[Sigma, Capiz|Sigma]]
*[[Tapaz, Capiz|Tapaz]]
</td></tr></table>
===Pisical===
==Kasaysayan==
== Mga Reperensya ==
{{reflist|2}}
{{Capiz}}
{{Kasadpang Kabisay-an}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
rh10lbls22ez9zaksc0qwrvilq6nju9
Guimaras
0
1489
37019673
34909599
2026-05-01T16:41:27Z
Exec8
10305
37019673
wikitext
text/x-wiki
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Guimaras|
sealfile=[[Image:Ph_seal_guimaras.png]]|
rehiyon=[[Kasadpang Kabisay-an]] (Region VI)|
capital=[[Jordan, Guimaras|Jordan]]|
founded=[[11 sa Mayo]], [[1992]]|
pop2000=141,450|
pop2000rank=ika-7 sa kinagamay|
popden2000=234|
popden2000rank=ika-33 sa kinagamay|
areakm2=604.7|
arearank=ika-5 sa kinagamay|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=0|
mga lungsod=5|
mga barangay=98|
mga distrito=1|
mga pinulongan=Hiligaynon|
gobernador=Joaquin Carlos Rahma A. Nava|
locatormapfile=[[Image:Ph_locator_map_guimaras (white).png]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Kataw'han ug Kultura==
Ilonggo ang mga taga-Guimaras ug ang ilang pinulongan mao ang Binisayang [[Hiligaynon]].
==Ekonimiya==
==Heyograpiya==
Ang tibuok nga pulo sa Guimaras maoy parte sa [[Metro Iloilo-Guimaras|metropolitanong sukod sa Iloilo-Guimaras]].
===Politikal===
Lima (5) ang nahisakpang lungsod sa Guimaras.
====Municipalities====
*[[Buenavista, Guimaras|Buenavista]]: populasyon 43,817 / 128 km2
*[[Jordan, Guimaras|Jordan]]: populasyon 32,524 / 126 km2
*[[Nueva Valencia, Guimaras|Nueva Valencia]]: populasyon 35,026 / 137 km2
*[[San Lorenzo, Guimaras|San Lorenzo]]: populasyon 22,319 / 93 km2
*[[Sibunag, Guimaras|Sibunag]]: populasyon 17,552 / 120 km2
Populasyon: NSO 2007<ref>[http://guimaras.gov.ph/quickfacts/ Guimaras Quick Facts] {{Webarchive|url=https://web.archive.org/web/20120415103046/http://guimaras.gov.ph/quickfacts/ |date=2012-04-15 }}</ref>
===Pisikal===
==Kasaysayan==
==Ref==
{{reflist}}
==Mga sumpay sa gawas==
*[http://www.guimaras.gov.ph/ Opisyal nga sityo]
== Mga Reperensya ==
{{reflist|2}}
{{Guimaras}}
{{Kasadpang Kabisay-an}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
1tiyy9k9z2u2it3ub26qb2n6ws532n7
Iloilo
0
1490
37019674
37017643
2026-05-01T16:42:08Z
Exec8
10305
37019674
wikitext
text/x-wiki
{{ubanggamit}}
{{Infobox lalawigan sa Pilipinas 2|
infoboxtitle=Lalawigan sa Iloilo|
sealfile=[[Image:Ph_seal_iloilo.png]]|
rehiyon=[[Kasadpang Kabisay-an]] (Region VI)|
capital=[[Dakbayan sa Iloilo]]|
founded=[[_____ __]], [[____]]|
pop2000=1,925,002|
pop2000rank=ika-7 sa kinadak-an|
popden2000=408|
popden2000rank=ika-11 sa kinadam-an|
areakm2=4,719.4|
arearank=ika-22 sa kinadak-an|
mga dakbayang kina-urbanisado=1|
mga nahisakpang dakbayan=1|
mga lungsod=20|
mga barangay=1,901|
mga distrito=6†|
mga pinulongan=[[Hiligaynon]]|
gobernador=Niel D. Tupas|
notes='''†'''Kauban diri ang distrito sa Dakbayan sa Iloilo|
locatormapfile=[[Image:Ph_locator_map_iloilo (white).png]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Katawhan ug kultura==
==Ekonomiya==
==Heyograpiya==
===Politikal===
Duha ang dakbayan sa Iloilo ug 42 ang lungsod.
====Mga dakbayan====
*[[Dakbayan sa Iloilo]]
*[[Dakbayan sa Passi]]
====Mga lungsod====
<table border="0"><tr>
<td valign="top">
*[[Ajuy, Iloilo|Ajuy]]
*[[Alimodian, Iloilo|Alimodian]]
*[[Anilao, Iloilo|Anilao]]
*[[Badiangan, Iloilo|Badiangan]]
*[[Balasan, Iloilo|Balasan]]
*[[Banate, Iloilo|Banate]]
*[[Barotac Nuevo, Iloilo|Barotac Nuevo]]
*[[Barotac Viejo, Iloilo|Barotac Viejo]]
*[[Batad, Iloilo|Batad]]
*[[Bingawan, Iloilo|Bingawan]]
*[[Cabatuan, Iloilo|Cabatuan]]
*[[Calinog, Iloilo|Calinog]]
*[[Carles, Iloilo|Carles]]
*[[Concepcion, Iloilo|Concepcion]]
*[[Dingle, Iloilo|Dingle]]
*[[Dueñas, Iloilo|Dueñas]]
*[[Dumangas, Iloilo|Dumangas]]
*[[Estancia, Iloilo|Estancia]]
*[[Guimbal, Iloilo|Guimbal]]
*[[Igbaras, Iloilo|Igbaras]]
*[[Janiuay, Iloilo|Janiuay]]
</td><td valign="top">
*[[Lambunao, Iloilo|Lambunao]]
*[[Leganes, Iloilo|Leganes]]
*[[Lemery, Iloilo|Lemery]]
*[[Leon, Iloilo|Leon]]
*[[Maasin, Iloilo|Maasin]]
*[[Miagao, Iloilo|Miagao]]
*[[Mina, Iloilo|Mina]]
*[[New Lucena, Iloilo|New Lucena]]
*[[Oton, Iloilo|Oton]]
*[[Pavia, Iloilo|Pavia]]
*[[Pototan, Iloilo|Pototan]]
*[[San Dionisio, Iloilo|San Dionisio]]
*[[San Enrique, Iloilo|San Enrique]]
*[[San Joaquin, Iloilo|San Joaquin]]
*[[San Miguel, Iloilo|San Miguel]]
*[[San Rafael, Iloilo|San Rafael]]
*[[Santa Barbara, Iloilo|Santa Barbara]]
*[[Sara, Iloilo|Sara]]
*[[Tigbauan, Iloilo|Tigbauan]]
*[[Tubungan, Iloilo|Tubungan]]
*[[Zarraga, Iloilo|Zarraga]]
</td></tr></table>
===Pisikal===
==Kasaysayan==
[[Kategoriya:Iloilo| ]]
== Mga Reperensya ==
{{reflist|2}}
{{Iloilo}}
{{Kasadpang Kabisay-an}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
i6j1hq0sppvahfh5cgdf01e9jppvzah
Negros Occidental
0
1491
37019654
37017592
2026-05-01T16:27:53Z
Exec8
10305
37019654
wikitext
text/x-wiki
Ang '''Negros Occidental''' ([[Sinugbuanon]]: ''Kasadpang Negros'') usa sa mga lalawigan sa [[Kasadpang Kabisay-an]]. Ang kapital sa lalawigan mao ang [[Dakbayan sa Bacolod]]. Ang lalawigan naa sa kasadpang dapit sa pulo og [[Negros]]. Sa sidlakang dapit sa pulo mao ang lalawigan sa [[Negros Oriental]]. Sa tabok sa [[Golfo sa Panay]] ug [[Guimaras Strait]] sa amihanang-kasadpan makaplagan ang pulo-lalawigan sa [[Guimaras]] ug ang lalawigan sa [[Iloilo]] sa Pulo sa [[Panay]].
{{Infobox lalawigan sa Pilipinas 2|
infoboxtitle=Lalawigan sa Negros Occidental|
sealfile=[[Payl:Ph seal negros occidental.png]]|
rehiyon=[[Kasadpang Kabisay-an]] (Region VI)|
capital=[[Dakbayan sa Bacolod]]|
founded= 1 Enero 1890|
pop2024= 2,680,477 |
pop2000rank=ika-2 sa kinadak-an|
popden2000=324|
popden2000rank=ika-15 sa kinadam-an|
areakm2=7,926.1|
arearank=ika-7 sa kinadak-an|
mga dakbayang kina-urbanisado=1|
mga nahisakpang dakbayan=12|
mga lungsod=20|
mga barangay=661|
mga distrito=7†|
mga pinulongan=[[Hiligaynon]], [[Sinugboanon]]|
gobernador=Eugenio Jose V. Lacson|
locatormapfile=[[Payl:Ph_locator_map_negros_occidental (white).png]]|
notes='''†'''Kauban ang independyenteng distrito sa Dakbayan sa Bacolod}}
Dire sa Negros Occidental nagsugod ang [[Republika sa Negros]] sa [[5 sa Nobyembre]], [[1898]] nila [[Juan Araneta]] ug [[Aniceto Lacson]]. Ang Republika sa Negros mao ang gobyerno sa tibuok na pulo sa Negros pagkatapos sa panahon sa mga Katsila hangtod sa pag-abot sa mga Americano.
== Kataw'han ug Kultura ==
Binisayang [[Hiligaynon]] ang pinulongan sa Negros Occidental. Pero naay mga dakbayan ug lungsod sa Negros Occidental nga Binisayang [[Sinugboanon]] ang ilang pinulongan. Kining mga dakbayan ug lungsod Sugboanon tua sa sidlakang dapit sa lalawigan sa Negros Occidental nga nag-atubang sa [[Tañon Strait]] ug sa pulo ug lalawigan sa [[Sugbo]] . Ang mga Sugboanong dakbayan ug lungsod sa Negros Occidental mao ang:
* [[Calatrava, Negros Occidental|Calatrava]]
* [[Dakbayan sa Escalante]]
* [[Dakbayan sa San Carlos, Negros Occidental|Dakbayan sa San Carlos]]
* [[Toboso, Negros Occidental|Toboso]]
== Heyograpiya ==
=== Politikal ===
Ang Negros Occidental napulo'g siyam (19) ang mga lungsod ug napulo'g tulo (13) ang mga dakbayan. Ang lalawigan mao ang naay kinadam-ang mga dakbayan sa tanang mga lalawigan sa Pilipinas.
==== Mga Dakbayan ====
<table width="50%" border="0"><tr>
<td valign="top" width="40%">
* [[Dakbayan sa Bacolod]]
* [[Dakbayan sa Bago]]
* [[Dakbayan sa Cadiz]]
* [[Dakbayan sa Escalante]]
* [[Dakbayan sa Himamaylan]]
* [[Dakbayan sa Kabankalan]]
* [[Dakbayan sa La Carlota]]
</td><td width="40%" valign="top">
* [[Dakbayan sa Sagay]]
* [[Dakbayan sa San Carlos, Negros Occidental|Dakbayan sa San Carlos]]
* [[Dakbayan sa Silay]]
* [[Dakbayan sa Sipalay]]
* [[Dakbayan sa Talisay, Negros Occidental|Dakbayan sa Talisay]]
* [[Dakbayan sa Victorias]]
</td></tr></table>
==== Mga Lungsod ====
<table width="50%" border="0"><tr>
<td valign="top" width="40%">
* [[Binalbagan, Negros Occidental|Binalbagan]]
* [[Calatrava, Negros Occidental|Calatrava]]
* [[Candoni, Negros Occidental|Candoni]]
* [[Cauayan, Negros Occidental|Cauayan]]
* [[Enrique B. Magalona, Negros Occidental|Enrique B. Magalona]] (Saravia)
* [[Hinigaran, Negros Occidental|Hinigaran]]
* [[Hinoba-an, Negros Occidental|Hinoba-an]] (Asia)
* [[Ilog, Negros Occidental|Ilog]]
* [[Isabela, Negros Occidental|Isabela]]
* [[La Castellana, Negros Occidental|La Castellana]]
</td><td valign="top" width="40%">
* [[Manapla, Negros Occidental|Manapla]]
* [[Moises Padilla, Negros Occidental|Moises Padilla]] (Magallon)
* [[Murcia, Negros Occidental|Murcia]]
* [[Pontevedra, Negros Occidental|Pontevedra]]
* [[Pulupandan, Negros Occidental|Pulupandan]]
* [[Salvador Benedicto, Negros Occidental|Salvador Benedicto]]
* [[San Enrique, Negros Occidental|San Enrique]]
* [[Toboso, Negros Occidental|Toboso]]
* [[Valladolid, Negros Occidental|Valladolid]]
</td></tr></table>
=== Pisikal ===
== Ekonomiya ==
== Turismo ==
== Kasaysayan ==
=== Sa Pagsugod ===
=== Sa Panahon sa mga Katsila ===
=== Republika sa Negros ===
=== Sa Panahon sa mga Americano ===
=== Gikan 1946 hangtod karon ===
== Mga Reperensya ==
{{reflist|2}}
{{Negros Occidental}}
{{Rehiyon sa Isla sa Negros}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
5z8rsh8dxol1t37kxu59pwcofdievkp
Palawan
0
1492
37019652
37017940
2026-05-01T16:25:37Z
Exec8
10305
37019652
wikitext
text/x-wiki
[[File:{{PH wikidata|image_map}}|280px|right]]
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Palawan}}
{{Mimaropa}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
neob63e0ffir75m5hej13nkv3ki4nil
Bukidnon
0
1499
37019659
34913055
2026-05-01T16:31:13Z
Exec8
10305
37019659
wikitext
text/x-wiki
{{ihubad}}
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Bukidnon|
sealfile=[[Payl:Ph_seal_bukidnon.png]]|
rehiyon=[[Amihanang Mindanao]] (Region X)|
capital=[[Dakbayan sa Malaybalay]]|
founded=[[Marso 10]], [[1917]]|
pop2000=1,060,265|
pop2000rank=ika-24 sa kinadak-an|
popden2000=128|
popden2000rank=ika-22 sa kinagamay|
areakm2=8,293.8|
arearank=ika-6 sa kinadak-an|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=2|
mga lungsod=20|
mga barangay=464|
mga distrito=3|
mga pinulongan=[[Binisaya]], [[Tinagalog]], [[Inilonggo]], [[Binukid]], [[Inilokano]]|
gobernador='''[[Jose Ma. R. Zubiri]]'''|
locatormapfile=[[Image:Ph_locator_map_bukidnon.png]]}}
Ang '''Bukidnon''' usa sa mga lalawigan sa [[Amihanang Mindanao]] sa [[Pilipinas]]. Ang ulohan o kapital niini maoy ang [[Dakbayan sa Malaybalay]].
==Kataw'han ug Kultura
==Heyograpiya==
===Politikal===
Kaluhaan (20) ka lungsod ug duha (2) ka dakbayan ang nahisakpan sa Bukidnon.
<center>
{| class="wikitable sortable" cellpadding=2 cellspacing=2
|- bgcolor=#cccccc
! colspan=1 | [[Dakbayan]]/[[Lungsod]] !! Date of Creation !! Arya(km²) !! Populasyon(</br>[[2000]]) !! Pop. Density</br>(per km²)
|-
|| [[Baungon, Bukidnon|Baungon]] || July 1, 1956 || 175.86 || 26,695 || 152
|-
|| [[Cabanglasan, Bukidnon|Cabanglasan]] || August 13, 1979 || 209.00 || 32,305 || 154
|-
|| [[Damulog, Bukidnon|Damulog]] || August 16, 1971 || 245.66 || 20,332 || 83
|-
|| [[Dangcagan, Bukidnon|Dangcagan]] || August 29, 1961] || 115.15 || 18,857 || 164
|-
|| [[Don Carlos, Bukidnon|Don Carlos]] || June 18, 1966 || 157.02 || 55,495 || 353
|-
|| [[Impasug-Ong, Bukidnon|Impasug-ong]] || Sept. 1, 1914 || 1,071.67 || 31,173 || 29
|-
|| [[Kadingilan, Bukidnon|Kadingilan]] || August 16, 1971 || 172.06 || 25,858 || 150
|-
|| [[Kalilangan, Bukidnon|Kalilangan]] || June 18, 1966 || 153.59 || 30,592 || 199
|-
|| [[Kibawe, Bukidnon|Kibawe]] || July 1, 1956 || 214.35 || 32,955 || 154
|-
|| [[Kitaotao, Bukidnon|Kitaotao]] || June 18, 1966 || 150.74 || 37,733 || 250
|-
|| [[Lantapan, Bukidnon|Lantapan]] || June 18, 1966 || 240.76 || 42,383 || 176
|-
|| [[Libona, Bukidnon|Libona]] || July 1, 1956 || 244.95 || 33,273 || 136
|--style="background:#ccccff"
|| [[Dakbayan sa Malaybalay]] || March 23, 1998 || 984.38 || 123,672 || 126
|-
|| [[Malitbog, Bukidnon|Malitbog]] || June 25,1963 || 260.53 || 19,315 || 74
|-
|| [[Manolo Fortich, Bukidnon|Manolo Fortich]] || June 21, 1957 || 506.64 || 74,252 || 146
|-
|| [[Maramag, Bukidnon|Maramag]] || July 1, 1956 || 351.72 || 75,233 || 214
|-
|| [[Pangantucan, Bukidnon|Pangantucan]] || June 25, 1963 || 343.34 || 43,202 || 126
|-
|| [[Quezon, Bukidnon|Quezon]] || June 18, 1966 || 409.41 || 82,567 || 20
|-
|| [[San Fernando, Bukidnon|San Fernando]] || June 18, 1966 || 638.63 || 40,165 || 63
|-
|| [[Sumilao, Bukidnon|Sumilao]] || July 1, 1956 || 207.49 || 17,958 || 86
|-
|| [[Talakag, Bukidnon|Talakag]] || 1917 || 833.70 || 48,326 || 58
|-
|| [[Dakbayan sa Valencia, Bukidnon|Dakbayan sa Valencia]] || January 12, 2001 || 607.13 || 147,924 || 244
|}
</center>
Gigikanan: ''Provincial Planning & Development Office, Province of Bukidnon'', ''National Statistics Office, 2000 Census of Population'', ''Department of Finance (DOF)''
====Mga Dakbayan====
*[[Dakbayan sa Malaybalay]]
*[[Dakbayan sa Valencia, Bukidnon|Dakbayan sa Valencia]]
====Mga Lungsod====
<table border="0"><tr>
<td valign="top">
*[[Baungon, Bukidnon|Baungon]]
*[[Cabanglasan, Bukidnon|Cabanglasan]]
*[[Damulog, Bukidnon|Damulog]]
*[[Dangcagan, Bukidnon|Dangcagan]]
*[[Don Carlos, Bukidnon|Don Carlos]]
*[[Impasug-Ong, Bukidnon|Impasug-Ong]]
*[[Kadingilan, Bukidnon|Kadingilan]]
*[[Kalilangan, Bukidnon|Kalilangan]]
*[[Kibawe, Bukidnon|Kibawe]]
*[[Kitaotao, Bukidnon|Kitaotao]]
</td><td valign="top">
*[[Lantapan, Bukidnon|Lantapan]]
*[[Libona, Bukidnon|Libona]]
*[[Malitbog, Bukidnon|Malitbog]]
*[[Manolo Fortich, Bukidnon|Manolo Fortich]]
*[[Maramag, Bukidnon|Maramag]]
*[[Pangantucan, Bukidnon|Pangantucan]]
*[[Quezon, Bukidnon|Quezon]]
*[[San Fernando, Bukidnon|San Fernando]]
*[[Sumilao, Bukidnon|Sumilao]]
*[[Talakag, Bukidnon|Talakag]]
</td></tr></table>
===Pisikal===
==Kasaysayan==
==Impormasyon sa Gawas==
* [http://www.bukidnon.gov.ph/ Gobyerno sa Probinsya sa Bukidnon]
== Mga Reperensya ==
{{reflist|2}}
{{Bukidnon}}
{{Amihanang Mindanao}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
401lassn4p5o743orlb0sx54syw92n1
Davao de Oro
0
1500
37019623
37019468
2026-05-01T15:51:08Z
Exec8
10305
37019623
wikitext
text/x-wiki
{{Infobox lalawigan sa Pilipinas 2|
infoboxtitle=Lalawigan sa Compostela Valley|
sealfile=[[Payl:Davao_de_Oro_Official_Seal.png|200px]]|
rehiyon=[[Rehiyon sa Dabaw]] (Region XI)|
capital=[[Nabunturan, Compostela Valley|Nabunturan]]|
founded=ika-8 sa Marso1998|
pop2000=_____|
pop2000rank=ika-____ sa kinadak-an|
popden2000=_____|
popden2000rank=ika-_____ sa kinadam-an|
areakm2=_____._|
arearank=ika-_____ sa kinadak-an|
mga dakbayang kina-urbanisado=_____|
mga nahisakpang dakbayan=_____|
mga lungsod=_____|
mga barangay=_____|
mga distrito=_____|
mga pinulongan=_____|
gobernador=_____|
locatormapfile=[[Payl:Ph locator davao de oro.svg|200px]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Davao de Oro}}
{{Rehiyon sa Davao}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
2ymrv9ek1ccxwxc5kqwghoz7itreg6u
Davao del Norte
0
1501
37019624
37019469
2026-05-01T15:51:19Z
Exec8
10305
37019624
wikitext
text/x-wiki
{{ihubad}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Davao del Norte|
sealfile = [[Payl:Ph_seal_davaodelnorte.png]] |
region = [[Rehiyon sa Davao]] (Region XI) |
capital = [[Dakbayan sa Tagum]] |
founded = [[Mayo 8]], [[1967]] |
pop2000 = 743,811 |
pop2000rank = ika-32 kinadaghanan |
popden2000 = 215 |
popden2000rank= ika-38 kinatas-an |
areakm2 = 3,463.0 |
arearank = ika-38 kinadak-an |
hucities = 0 |
componentcities=3 |
municipalities= 8 |
barangays = 223 |
districts = 2 |
languages = [[Sinugboanon]], [[Dabaweño]] |
governor = Gelacio P. Gementiza |
locatormapfile= [[Payl:Ph_locator_map_davao.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Katawhan ug Kultura ==
==Ekonomiya==
== Heyograpiya ==
=== Politikal ===
==== Mga lungsod ====
====Dakbayan====
==== Mga dakbayan ====
=== Pisikal ===
== Kaagi ==
==Mga sumpay sa gawas==
== Mga Reperensya ==
{{reflist|2}}
{{Davao del Norte}}
{{Rehiyon sa Davao}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{saha-Pilipinas}}
0l5u238wndf9iffpc18k1shq4vpdrmd
Lanao del Norte
0
1502
37019661
37017588
2026-05-01T16:32:35Z
Exec8
10305
37019661
wikitext
text/x-wiki
{{ihubad}}
Ang '''Lanao del Norte''' usa ka [[Mga Lalawigan sa Pilipinas|lalawigan]] sa [[Pilipinas]] nga nahamutangan sa [[Amihanang Mindanao]] nga [[Mga Rehiyon sa Pilipinas|rehiyon]]. Ang ulohan sa lalawigan maoy ang [[Tubod, Lanao del Norte|Tubod]]. Sa habagatan sa lalawigan maoy ang [[Lanao del Sur]], ang [[Zamboanga del Sur]] sa kasadpan, [[Misamis Oriental]] sa amihanang-sidlakan, [[Bukidnon]] sa sidlakan, and is separated from [[Misamis Occidental]] by [[Iligan Bay]].
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Lanao del Norte |
sealfile = [[Payl:Ph_seal_lanao_del_norte.png]] |
region = [[Amihanang Mindanao]] (Rehiyon X) |
capital = [[Tubod, Lanao del Norte|Tubod]] |
founded = [[Hunyo 6]], [[1952]] |
pop2000 = 758,123 |
pop2000rank = ika-30 kinadak-an |
popden2000 = 245 |
popden2000rank = ika-31 kinadaghanan |
areakm2 = 3,092.0 |
arearank = ika-43 kinadak-an |
hucities = 1 |
componentcities = 2|
municipalities = 23|
barangays = 506 |
districts = 2 |
languages = [[Sinugboanon]] |
governor = Mohamad Khalid Q. Dimaporo |
locatormapfile = [[Payl:Ph_locator_map_lanao_del_norte.png]]
}}
== Katawhan ug Kultura ==
== Ekonomiya ==
== Heyograpiya ==
=== Politikal ===
Ang Lanao del Norte nabahin ngadto sa 22 ka mga [[lungsod]] ug 1 ka [[dakbayan]].
==== Dakbayan ====
* [[Dakbayan sa Iligan]]
==== Mga lungsod ====
<table border="0"><tr>
<td valign="top">
* [[Bacolod, Lanao del Norte|Bacolod]]
* [[Baloi, Lanao del Norte|Baloi]]
* [[Baroy, Lanao del Norte|Baroy]]
* [[Kapatagan, Lanao del Norte|Kapatagan]]
* [[Kauswagan, Lanao del Norte|Kauswagan]]
* [[Kolambugan, Lanao del Norte|Kolambugan]]
* [[Lala, Lanao del Norte|Lala]]
* [[Linamon, Lanao del Norte|Linamon]]
* [[Magsaysay, Lanao del Norte|Magsaysay]]
* [[Maigo, Lanao del Norte|Maigo]]
* [[Matungao, Lanao del Norte|Matungao]]
</td><td valign="top">
* [[Munai, Lanao del Norte|Munai]]
* [[Nunungan, Lanao del Norte|Nunungan]]
* [[Pantao Ragat, Lanao del Norte|Pantao Ragat]]
* [[Pantar, Lanao del Norte|Pantar]]
* [[Poona Piagapo, Lanao del Norte|Poona Piagapo]]
* [[Salvador, Lanao del Norte|Salvador]]
* [[Sapad, Lanao del Norte|Sapad]]
* [[Sultan Naga Dimaporo, Lanao del Norte|Sultan Naga Dimaporo]] (Karomatan)
* [[Tagoloan, Lanao del Norte|Tagoloan]]
* [[Tangcal, Lanao del Norte|Tangcal]]
* [[Tubod, Lanao del Norte|Tubod]]
</td></tr></table>
=== Pisikal ===
== Kaagi ==
==Mga sumpay sa gawas==
== Mga Reperensya ==
{{reflist|2}}
{{Lanao del Norte}}
{{Amihanang Mindanao}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
7bv6l5dw8wbhcmaw52mqdnh9htb3u5i
Misamis Occidental
0
1503
37019662
35084037
2026-05-01T16:33:24Z
Exec8
10305
37019662
wikitext
text/x-wiki
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Misamis Occidental|
sealfile=[[Payl:Official Seal of Misamis Occidental.svg]]|
rehiyon= [[10]] (Region ___10__)|
capital= [[Oroquieta City]] |
founded=[[_____ __]], [[____]]|
pop2000=_____|
pop2000rank=ika-____ sa kinadak-an|
popden2000=_____|
popden2000rank=ika-_____ sa kinadam-an|
areakm2=_____._|
arearank=ika-_____ sa kinadak-an|
mga dakbayang kina-urbanisado=_____|
mga nahisakpang dakbayan=_____|
mga lungsod=_____|
mga barangay=_____|
mga distrito=__|
mga pinulongan=_Cebuano, English, Tagalog, Subanen_|
gobernador=__Gov. Herminia M. Ramiro___|
locatormapfile=[[Payl:Ph_locator_map_misamis_occidental.png]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Misamis Occidental}}
{{Amihanang Mindanao}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
szjr2vfhryovlzd8f585ibcp7vlyqfm
Misamis Oriental
0
1504
37019663
1963861
2026-05-01T16:34:07Z
Exec8
10305
37019663
wikitext
text/x-wiki
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Misamis Oriental|
sealfile=[[Payl:Ph_seal_misamis_oriental.png]]|
rehiyon=[[_____]] (Region _____)|
capital=[[_____]]|
founded=[[_____ __]], [[____]]|
pop2000=_____|
pop2000rank=ika-____ sa kinadak-an|
popden2000=_____|
popden2000rank=ika-_____ sa kinadam-an|
areakm2=_____._|
arearank=ika-_____ sa kinadak-an|
mga dakbayang kina-urbanisado=_____|
mga nahisakpang dakbayan=_____|
mga lungsod=_____|
mga barangay=_____|
mga distrito=_____|
mga pinulongan=_____|
gobernador=_____|
locatormapfile=[[Payl:Ph_locator_map_misamis_oriental.png]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Misamis Oriental}}
{{Amihanang Mindanao}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
gsr5kpv0fdnkyjn75kagsxghlfym4j7
Zamboanga del Norte
0
1507
37019677
37017916
2026-05-01T16:44:23Z
Exec8
10305
37019677
wikitext
text/x-wiki
{{Infobox lalawigan sa Pilipinas|
infoboxtitle = Lalawigan sa Zamboanga del Norte|
sealfile = [[Payl:Ph_seal_zamboangadelnorte.png]] |
rehiyon = [[Zamboanga|Peninsula sa Zamboanga]] (Rehiyon IX) |
capital = [[Dakbayan sa Dipolog]] |
founded = [[Hunyo 23]], [[1635]] ug [[Hunyo 6]], [[1952]]|
pop2000 = 823,130|
pop2000rank = ika-27 sa kinadak-an|
popden2000 = 124|
popden2000rank = ika-27 sa kinadam-an|
areakm2 = 6,618.0|
arearank = ika-8 sa kinadak-an|
mga dakbayang kina-urbanisado = 0|
mga nahisakpang dakbayan = 2|
mga lungsod = 25|
mga barangay = 691|
mga distrito = 3|
mga pinulongan = [[Sinugboanon|Sinugboanon (Cebuano)]], [[Chabacano]] ug [[Kinatsila]] ||
gobernador = Rolando E. Yebes|
locatormapfile = [[Payl:Ph_locator_map zamboanga del norte.png]]}}
Ang '''Zamboanga del Norte''' (sa literal nga Binisaya: '''Zamboanga sa Amihanan''')dunay 1,067,067 katawo sa usa ka [[lalawigan Pilipinhon|lalawigan]] sa [[Pilipinas]] nga nahimutang sa [[Zamboanga|Peninsula sa Zamboangang]] [[Mga rehiyon sa Pilipinas|rehiyon]] sa [[Mindanao]]. Ang ulohan sa lalawigan maoy ang [[Dakbayan sa Dipolog]] ug tapad sa lalawigan ang [[Zamboanga del Sur]] ug ang [[Zamboanga Sibugay]] sa habagatan ug makaplagan ang lalawigan sa [[Misamis Occidental]] sidlakan. Ang [[Dagat Sulu]] nahimutang sa amihanang-kasadpan gikan sa Zamboanga del Norte.
== Heyograpiya ==
=== Politikal ===
Ang Zamboanga del Norte nabahin ngadto sa kaluhaan ug lima (25) ka [[lungsod Pilipinhon|lungsod]] ug duha (2) ka [[dakbayan Pilipinhon|dakbayan]].
==== Mga dakbayan ====
* [[Dakbayan sa Dapitan]]
* [[Dakbayan sa Dipolog]]
==== Mga lungsod ====
<table border="0"><tr>
<td valign="top">
* [[Bacungan, Zamboanga del Norte|Bacungan]] (Leon T. Postigo)
* [[Baliguian, Zamboanga del Norte|Baliguian]]
* [[Godod, Zamboanga del Norte|Godod]] (17)
* [[Gutalac, Zamboanga del Norte|Gutalac]]
* [[Jose Dalman, Zamboanga del Norte|Jose Dalman]] (Ponot)
* [[Kalawit, Zamboanga del Norte|Kalawit]]
* [[Katipunan, Zamboanga del Norte|Katipunan]]
* [[La Libertad, Zamboanga del Norte|La Libertad]]
* [[Labason, Zamboanga del Norte|Labason]]
* [[Liloy, Zamboanga del Norte|Liloy]]
* [[Manukan, Zamboanga del Norte|Manukan]]
* [[Mutia, Zamboanga del Norte|Mutia]]
* [[Piñan, Zamboanga del Norte|Piñan]] (New Piñan)
</td><td valign="top">
* [[Polanco, Zamboanga del Norte|Polanco]]
* [[Pres. Manuel A. Roxas, Zamboanga del Norte|Pres. Manuel A. Roxas]]
* [[Rizal, Zamboanga del Norte|Rizal]]
* [[Salug, Zamboanga del Norte|Salug]]
* [[Sergio Osmeña Sr., Zamboanga del Norte|Sergio Osmeña Sr.]]
* [[Siayan, Zamboanga del Norte|Siayan]]
* [[Sibuco, Zamboanga del Norte|Sibuco]]
* [[Sibutad, Zamboanga del Norte|Sibutad]]
* [[Sindangan, Zamboanga del Norte|Sindangan]]
* [[Siocon, Zamboanga del Norte|Siocon]]
* [[Sirawai, Zamboanga del Norte|Sirawai]]
* [[Tampilisan, Zamboanga del Norte|Tampilisan]]
</td></tr></table>
== Mga Reperensya ==
{{reflist|2}}
{{Zamboanga del Norte}}
{{Lawisnong Zamboanga}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
[[Kategoriya:Zamboanga del Norte| ]]
fj8w3vp42ldo8879ufium1ewjl8xfc1
Zamboanga del Sur
0
1508
37019678
37017603
2026-05-01T16:44:54Z
Exec8
10305
37019678
wikitext
text/x-wiki
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Zamboanga del Sur|
sealfile=[[Payl:Ph_seal_zamboanga_del_sur.png]]|
rehiyon=[[Peninsula sa Zamboanga]] (Region IX)|
capital=[[Dakbayan sa Pagadian]]|
founded=[[Septiyembre 17]], [[1952]]|
pop2000=836,217|
pop2000rank=ika-16 sa kinadak-an|
popden2000=186.2|
popden2000rank=ika-44 sa kinadam-an|
areakm2=4,489.0|
arearank=ika-27 sa kinadak-an|
mga dakbayang kina-urbanisado=1 ([[Dakbayan sa Zamboanga|Zamboanga]])|
mga nahisakpang dakbayan=1 ([[Dakbayan sa Pagadian|Pagadian]])|
mga lungsod=26|
mga barangay=681|
mga distrito=2|
mga pinulongan=[[Binisayang Sinugboanon]], [[Subanen]], [[Chavacano]]|
gobernador=Victor J. Yu|
locatormapfile=[[Payl:Ph_locator_map_zamboanga_del_sur.png]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Zamboanga del Sur}}
{{Lawisnong Zamboanga}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
2bv946mfrsggy38ssp530vgm5k5h6dx
Zamboanga Sibugay
0
1509
37019679
37017612
2026-05-01T16:45:23Z
Exec8
10305
37019679
wikitext
text/x-wiki
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Zamboanga Sibugay|
sealfile=|
rehiyon=[[Peninsula sa Zamboanga]] (Region IX)|
capital=[[Ipil]]|
founded=[[Pebrero 22]], [[2001]]|
pop2000=497,239|
pop2000rank=ika-49 sa kinadak-an|
popden2000=151.4|
popden2000rank=ika-56 sa kinadam-an|
areakm2=3,228.0|
arearank=ika-38 sa kinadak-an|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=0|
mga lungsod=16|
mga barangay=389|
mga distrito=2|
mga pinulongan=[[Binisayang Sinugboanon]], [[Subanen]], [[Chavacano]]|
gobernador=Dulce Ann K. Hofer|
locatormapfile=[[Payl:Ph_locator_map_zamboanga_sibugay.png]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Zamboanga Sibugay}}
{{Lawisnong Zamboanga}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
enwfe8mnra2p7z9rtbyzg0qpzu5734r
Camiguin
0
1512
37019660
34909605
2026-05-01T16:31:52Z
Exec8
10305
37019660
wikitext
text/x-wiki
Ang '''Camiguin''' usa ka islang-[[Mga Lalawigan sa Pilipinas|lalawigan]] sa [[Pilipinas]] sa [[Amihanang Mindanao]] nga [[Mga Rehiyon sa Pilipinas|rehiyon]].
Ang ulohan sa lalawigan maoy ang [[Mambajao, Camiguin|Mambajao]] ug ang lalawigan maoy ang ika-duha nga kinagamay nga lalawigan sa populasyon ug sa arya sa yuta. Ang [[Batanes]] ra ang mas gamay. Ang isla sa Camiguin diha sa [[Dagat Bohol]] mga 10 ka kilometro sa amihanan sa [[Misamis Oriental]].
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Camiguin|
sealfile=[[Image:Ph_seal_camiguin.png]]|
rehiyon=[[Amihanang Mindanao]] (Region X)|
capital=[[Mambajao, Camiguin|Mambajao]]|
founded=[[1565]] |
pop2000=74,232|
pop2000rank=ika-2 sa kinagamay|
popden2000=323|
popden2000rank=ika-16 sa kinadam-an|
areakm2=229.8|
arearank=ika-2 sa kinagamay|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=0|
mga lungsod=5|
mga barangay=58|
mga distrito=1|
mga pinulongan=[[Sinugboanon]]|
gobernador=Pedro P. Romualdo (2001-2004)|
locatormapfile=[[Image:Ph_locator_map_camiguin.png]]}}
==Heyograpiya==
===Politikal===
Ang Camiguin nabahin ngadto sa lima (5) ka [[lungsod Pilipinhon|lungsod]].
====Mga Lungsod====
<table border="0"><tr>
<td valign="top">
*[[Catarman, Camiguin|Catarman]]
*[[Guinsiliban, Camiguin|Guinsiliban]]
*[[Mahinog, Camiguin|Mahinog]]
</td><td valign="top">
*[[Mambajao, Camiguin|Mambajao]]
*[[Sagay, Camiguin|Sagay]]
</td></tr></table>
===Pisikal===
[[Payl:Camiguin across Bohol Sea.jpg|thumb|none|300px|Camiguin]]
== Mga Reperensya ==
{{reflist|2}}
{{Camiguin}}
{{Amihanang Mindanao}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
qf81vvt6sd0ceuh0fg5uvxh5dwj7no9
Davao Oriental
0
1515
37019647
37019473
2026-05-01T16:20:16Z
Exec8
10305
37019647
wikitext
text/x-wiki
{{Infobox lalawigan sa Pilipinas|
infoboxtitle=Lalawigan sa Davao Oriental|
sealfile=[[Payl:Ph_seal_davao_oriental.png]]|
rehiyon=[[Rehiyon sa Davao]] (Rehiyon XI)|
capital=[[Dakbayan sa Mati]]|
founded=[[Mayo 8]], [[1967]]|
pop2000=446,191|
pop2000rank=ika-____ sa kinadak-an|
popden2000=86|
popden2000rank=ika-_____ sa kinadam-an|
areakm2=5,164.5|
arearank=ika-18 sa kinadak-an|
mga dakbayang kina-urbanisado=0|
mga nahisakpang dakbayan=0|
mga lungsod=11|
mga barangay=183|
mga distrito=2|
mga pinulongan=[[Dabawenyo]], [[Sinugboanon]]|
gobernador=NELSON BOY DAYANGHIRANG|
locatormapfile=[[Payl:Ph_locator_map_davao_oriental.png]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Davao Oriental}}
{{Rehiyon sa Davao}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
8k04kmh7hb0xbnbykf18pl7twjm1jbq
Cotabato
0
1516
37019664
34909584
2026-05-01T16:35:16Z
Exec8
10305
37019664
wikitext
text/x-wiki
[[File:{{PH wikidata|image_map}}|280px|right]]
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Cotabato}}
{{Soccsksargen}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
46ypz3tw5b2i5pggk2sptkucad7ebdw
Sarangani
0
1518
37019665
34909593
2026-05-01T16:35:54Z
Exec8
10305
37019665
wikitext
text/x-wiki
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Sarangani}}
{{Soccsksargen}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
5443cqsfqlr90gvklsxphp1cd9ken0q
37019666
37019665
2026-05-01T16:36:06Z
Exec8
10305
37019666
wikitext
text/x-wiki
[[File:{{PH wikidata|image_map}}|280px|right]]
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Sarangani}}
{{Soccsksargen}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
li13910o3qehwhshl9m4a5zjrjp69xf
Sulu
0
1547
37019675
34903375
2026-05-01T16:43:22Z
Exec8
10305
37019675
wikitext
text/x-wiki
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}. Kini nahimutang sa tunga-tungang mga pulo sa [[Arkipelago sa Sulu]], taliwala sa [[Basilan]] ug [[Tawi-tawi]]. Kini mao ang pinuy-anan sa Royal nga '''Sultanato sa Sulu'''.
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Sulu |
sealfile = [[Payl:Ph_seal_sulu.png]] |
region = [[Bangsamoro|Awtonomong Rehiyon sa Bangsamoro sa Muslim Mindanao]] (BARMM) |
capital = [[Jolo, Sulu|Jolo]] |
founded = |
pop2000 = 619,668 |
pop2000rank = ika-40 kinadak-an |
popden2000 = 387 |
popden2000rank = ika-13 kinatas-an |
areakm2 = 1,600.4 |
arearank = ika-15 kinagamyan |
hucities = 0 |
componentcities = 0 |
municipalities = 18 |
barangays = 410 |
districts = 2 |
languages = [[Tinausug]] |
governor = Benjamin T. Loong |
locatormapfile = [[Payl:Ph_locator_map_sulu.png]]
}}
== Katawhan ug kultura ==
== Ekonomiya ==
== Heyograpiya ==
=== Politikal ===
Ang Sulu nabahin ngadto sa 18 ka mga [[lungsod]].
==== Mga lungsod ====
<table border="0"><tr>
<td valign="top">
* [[Hadji Panglima Tahil, Sulu|Hadji Panglima Tahil]] (Marunggas)
* [[Indanan, Sulu|Indanan]]
* [[Jolo, Sulu|Jolo]]
* [[Kalingalan Caluang, Sulu|Kalingalan Caluang]]
* [[Lugus, Sulu|Lugus]]
* [[Luuk, Sulu|Luuk]]
* [[Maimbung, Sulu|Maimbung]]
* [[Old Panamao, Sulu|Old Panamao]]
* [[Pandami, Sulu|Pandami]]
</td><td valign="top">
* [[Panglima Estino, Sulu|Panglima Estino]] (New Panamao)
* [[Pangutaran, Sulu|Pangutaran]]
* [[Parang, Sulu|Parang]]
* [[Pata, Sulu|Pata]]
* [[Patikul, Sulu|Patikul]]
* [[Siasi, Sulu|Siasi]]
* [[Talipao, Sulu|Talipao]]
* [[Tapul, Sulu|Tapul]]
* [[Tongkil, Sulu|Tongkil]]
</td></tr></table>
=== Pisikal ===
== Kaagi ==
== Tan-awa usab ==
* [[Islam sa Pilipinas]]
==Mga sumpay sa gawas==
== Mga Reperensya ==
{{reflist|2}}
{{Sulu}}
{{Lawisnong Zamboanga}}
{{pilipinas-saha}}
5edmflz02o5y5ez1d2bah19a4ppc589
37019676
37019675
2026-05-01T16:44:00Z
Exec8
10305
37019676
wikitext
text/x-wiki
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}. Kini nahimutang sa tunga-tungang mga pulo sa [[Arkipelago sa Sulu]], taliwala sa [[Basilan]] ug [[Tawi-tawi]]. Kini mao ang pinuy-anan sa Royal nga '''Sultanato sa Sulu'''.
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Sulu |
sealfile = [[Payl:Ph_seal_sulu.png]] |
region = [[Bangsamoro|Awtonomong Rehiyon sa Bangsamoro sa Muslim Mindanao]] (BARMM) |
capital = [[Jolo, Sulu|Jolo]] |
founded = |
pop2000 = 619,668 |
pop2000rank = ika-40 kinadak-an |
popden2000 = 387 |
popden2000rank = ika-13 kinatas-an |
areakm2 = 1,600.4 |
arearank = ika-15 kinagamyan |
hucities = 0 |
componentcities = 0 |
municipalities = 18 |
barangays = 410 |
districts = 2 |
languages = [[Tinausug]] |
governor = Benjamin T. Loong |
locatormapfile = [[Payl:Ph_locator_map_sulu.png]]
}}
== Katawhan ug kultura ==
== Ekonomiya ==
== Heyograpiya ==
=== Politikal ===
Ang Sulu nabahin ngadto sa 18 ka mga [[lungsod]].
==== Mga lungsod ====
<table border="0"><tr>
<td valign="top">
* [[Hadji Panglima Tahil, Sulu|Hadji Panglima Tahil]] (Marunggas)
* [[Indanan, Sulu|Indanan]]
* [[Jolo, Sulu|Jolo]]
* [[Kalingalan Caluang, Sulu|Kalingalan Caluang]]
* [[Lugus, Sulu|Lugus]]
* [[Luuk, Sulu|Luuk]]
* [[Maimbung, Sulu|Maimbung]]
* [[Old Panamao, Sulu|Old Panamao]]
* [[Pandami, Sulu|Pandami]]
</td><td valign="top">
* [[Panglima Estino, Sulu|Panglima Estino]] (New Panamao)
* [[Pangutaran, Sulu|Pangutaran]]
* [[Parang, Sulu|Parang]]
* [[Pata, Sulu|Pata]]
* [[Patikul, Sulu|Patikul]]
* [[Siasi, Sulu|Siasi]]
* [[Talipao, Sulu|Talipao]]
* [[Tapul, Sulu|Tapul]]
* [[Tongkil, Sulu|Tongkil]]
</td></tr></table>
=== Pisikal ===
== Kaagi ==
== Tan-awa usab ==
* [[Islam sa Pilipinas]]
==Mga sumpay sa gawas==
== Mga Reperensya ==
{{reflist|2}}
{{Sulu}}
{{Lawisnong Zamboanga}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
nuhzijpx6n3cluunembje8uc70150xv
Habagatang Cotabato
0
1550
37019667
1963910
2026-05-01T16:36:49Z
Exec8
10305
.
37019667
wikitext
text/x-wiki
[[File:{{PH wikidata|image_map}}|280px|right]]
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{South Cotabato}}
{{Soccsksargen}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
2wbf96rig8vivpg52p3zof5a3sdfhdd
Quirino
0
2696
37019579
37019437
2026-05-01T15:04:03Z
Exec8
10305
37019579
wikitext
text/x-wiki
{{ihubad}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Quirino |
sealfile = [[Image:Ph_seal_quirino.svg]] |
region = [[Lupot sa Cagayan]] (Rehiyon II) |
capital = [[Cabarroguis, Quirino]] |
founded = [[Hunyo 18]], [[1966]] |
pop2000 = 148,575 |
pop2000rank = 8th kinagamyan |
popden2000 = 49 |
popden2000rank= 2nd kinaubsan |
areakm2 = 3,057.2 |
arearank = 45th kinadak-an |
hucities = 0 |
componentcities=0 |
municipalities= 6 |
barangays = 132 |
districts = 1 |
languages = [[Ilokano]], [[Tagalog]] |
governor = Pedro L. Bacani |
locatormapfile= [[Image:Ph_locator_map_quirino.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Quirino}}
{{Lupot sa Cagayan}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{saha}}
r2kwc7tkhylf6lydonh7lrogwwgcl7l
Ilocos Norte
0
2697
37019563
34909582
2026-05-01T14:48:11Z
Exec8
10305
37019563
wikitext
text/x-wiki
{{ihubad}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Ilocos Norte |
sealfile = [[Image:Ph_seal_ilocos_norte.png]] |
region = [[Rehiyon sa Ilocos]] (Rehiyon I) |
capital = [[Dakbayan sa Laoag]] |
founded = — |
pop2000 = 514,241 |
pop2000rank = 48th kinadak-an |
popden2000 = 151 |
popden2000rank = 27th kinaubsan |
areakm2 = 3,399.3 |
arearank = 27th kinagamyan |
hucities = 0 |
componentcities = 2 |
municipalities = 21 |
barangays = 557 |
districts = 2 |
languages = [[Ilokano]] |
governor = [[Ferdinand Marcos, Jr.]] (1998-kasamtangan) |
locatormapfile = [[Image:Ph_locator_map_ilocos_norte.png]]
}}
Ang '''Ilocos Norte''' (okun sa Binisayang Sinugboanon: '''Amihanang Ilocos''') usa ka lalawigan sa [[Pilipinas]] nga nahimutang sa [[Rehiyon sa Ilokos]]. Ang [[Dakbayan sa Laoag]] mao ang ulohang dakbayan sa lalawigan.
==Heyograpiya==
===Politikal===
Ang Ilocos Norte nabahin ngadto sa 2 ka [[dakbayan Pilipinhon|dakbayan]] ug 21 ka [[lungsod Pilipinhon|lungsod]]
====Mga dakbayan====
*[[Dakbayan sa Batac]]
*[[Dakbayan sa Laoag]]
====Mga lungsod====
<table border="0"><tr>
<td valign="top">
*[[Adams, Ilocos Norte|Adams]]
*[[Bacarra, Ilocos Norte|Bacarra]]
*[[Badoc, Ilocos Norte|Badoc]]
*[[Bangui, Ilocos Norte|Bangui]]
*[[Banna, Ilocos Norte|Banna]] (Espiritu)
*[[Burgos, Ilocos Norte|Burgos]]
*[[Carasi, Ilocos Norte|Carasi]]
*[[Currimao, Ilocos Norte|Currimao]]
*[[Dingras, Ilocos Norte|Dingras]]
*[[Dumalneg, Ilocos Norte|Dumalneg]]
*[[Marcos, Ilocos Norte|Marcos]]
</td><td valign="top">
*[[Nueva Era, Ilocos Norte|Nueva Era]]
*[[Pagudpud, Ilocos Norte|Pagudpud]]
*[[Paoay, Ilocos Norte|Paoay]]
*[[Pasuquin, Ilocos Norte|Pasuquin]]
*[[Piddig, Ilocos Norte|Piddig]]
*[[Pinili, Ilocos Norte|Pinili]]
*[[San Nicolas, Ilocos Norte|San Nicolas]]
*[[Sarrat, Ilocos Norte|Sarrat]]
*[[Solsona, Ilocos Norte|Solsona]]
*[[Vintar, Ilocos Norte|Vintar]]
</td></tr></table>
== Mga Reperensya ==
{{reflist|2}}
{{Ilocos Norte}}
{{Ilocos}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{saha-Pilipinas}}
10zvbkjuemkxmk22zdyxyimbwwbzkh3
37019564
37019563
2026-05-01T14:52:01Z
Exec8
10305
37019564
wikitext
text/x-wiki
{{ihubad}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Ilocos Norte |
sealfile = [[Image:Ph_seal_ilocos_norte.png]] |
region = [[Rehiyon sa Ilocos]] (Rehiyon I) |
capital = [[Dakbayan sa Laoag]] |
founded = — |
pop2000 = 514,241 |
pop2000rank = 48th kinadak-an |
popden2000 = 151 |
popden2000rank = 27th kinaubsan |
areakm2 = 3,399.3 |
arearank = 27th kinagamyan |
hucities = 0 |
componentcities = 2 |
municipalities = 21 |
barangays = 557 |
districts = 2 |
languages = [[Ilokano]] |
governor = [[Ferdinand Marcos, Jr.]] (1998-kasamtangan) |
locatormapfile = [[Image:Ph_locator_map_ilocos_norte.png]]
}}
Ang '''Ilocos Norte''' (okun sa Binisayang Sinugboanon: '''Amihanang Ilocos''') usa ka lalawigan sa [[Pilipinas]] nga nahimutang sa [[Rehiyon sa Ilokos]]. Ang [[Dakbayan sa Laoag]] mao ang ulohang dakbayan sa lalawigan.
==Heyograpiya==
===Politikal===
Ang Ilocos Norte nabahin ngadto sa 2 ka [[dakbayan Pilipinhon|dakbayan]] ug 21 ka [[lungsod Pilipinhon|lungsod]]
====Mga dakbayan====
*[[Dakbayan sa Batac]]
*[[Dakbayan sa Laoag]]
====Mga lungsod====
<table border="0"><tr>
<td valign="top">
*[[Adams, Ilocos Norte|Adams]]
*[[Bacarra, Ilocos Norte|Bacarra]]
*[[Badoc, Ilocos Norte|Badoc]]
*[[Bangui, Ilocos Norte|Bangui]]
*[[Banna, Ilocos Norte|Banna]] (Espiritu)
*[[Burgos, Ilocos Norte|Burgos]]
*[[Carasi, Ilocos Norte|Carasi]]
*[[Currimao, Ilocos Norte|Currimao]]
*[[Dingras, Ilocos Norte|Dingras]]
*[[Dumalneg, Ilocos Norte|Dumalneg]]
*[[Marcos, Ilocos Norte|Marcos]]
</td><td valign="top">
*[[Nueva Era, Ilocos Norte|Nueva Era]]
*[[Pagudpud, Ilocos Norte|Pagudpud]]
*[[Paoay, Ilocos Norte|Paoay]]
*[[Pasuquin, Ilocos Norte|Pasuquin]]
*[[Piddig, Ilocos Norte|Piddig]]
*[[Pinili, Ilocos Norte|Pinili]]
*[[San Nicolas, Ilocos Norte|San Nicolas]]
*[[Sarrat, Ilocos Norte|Sarrat]]
*[[Solsona, Ilocos Norte|Solsona]]
*[[Vintar, Ilocos Norte|Vintar]]
</td></tr></table>
== Mga Reperensya ==
{{reflist|2}}
{{Ilocos Norte}}
{{Rehiyon sa Ilocos}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{saha-Pilipinas}}
pm2zfcrdvs0omzv3hdm4lqqmr0q78tz
Ilocos Sur
0
2698
37019573
34909586
2026-05-01T15:00:50Z
Exec8
10305
37019573
wikitext
text/x-wiki
{{ihubad}}
{{saha-Pilipinas}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Ilocos Sur |
sealfile = [[Image:Ph_seal_ilocos_sur.png]] |
region = [[Rehiyon sa Ilokos]] (Rehiyon I) |
capital = [[Dakbayan sa Vigan]] |
founded = [[1572]] |
pop2000 = 594,206 |
pop2000rank = 41st kinadak-an |
popden2000 = 230 |
popden2000rank= 34th kinatas-an |
areakm2 = 2,579.6 |
arearank = 27th kinagamyan |
hucities = 0 |
componentcities=2 |
municipalities= 32 |
barangays = 768 |
districts = 2 |
languages = [[Ilokano]] |
governor = Luis Chavit C. Singson |
locatormapfile= [[Image:Ph_locator_map_ilocos_sur.png]] |
}}
== Mga Reperensya ==
{{reflist|2}}
{{Ilocos Sur}}
{{Rehiyon sa Ilocos}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
rzg8fxjmadsfyebvvuthfzccj053lqw
37019574
37019573
2026-05-01T15:01:24Z
Exec8
10305
37019574
wikitext
text/x-wiki
{{ihubad}}
{{saha-Pilipinas}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Ilocos Sur |
sealfile = [[Image:Ph_seal_ilocos_sur.png]] |
region = [[Rehiyon sa Ilokos]] (Rehiyon I) |
capital = [[Dakbayan sa Vigan]] |
founded = [[1572]] |
pop2000 = 594,206 |
pop2000rank = 41st kinadak-an |
popden2000 = 230 |
popden2000rank= 34th kinatas-an |
areakm2 = 2,579.6 |
arearank = 27th kinagamyan |
hucities = 0 |
componentcities=2 |
municipalities= 32 |
barangays = 768 |
districts = 2 |
languages = [[Ilokano]] |
governor = Luis Chavit C. Singson |
locatormapfile= [[Image:Ph_locator_map_ilocos_sur.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa [[Calabarzon]], [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Ilocos Sur}}
{{Rehiyon sa Ilocos}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
9sfaa7gtlp7bxwbiii5covi0zm9e8el
37019575
37019574
2026-05-01T15:02:26Z
Exec8
10305
.
37019575
wikitext
text/x-wiki
{{ihubad}}
{{saha-Pilipinas}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Ilocos Sur |
sealfile = [[Image:Ph_seal_ilocos_sur.png]] |
region = [[Rehiyon sa Ilokos]] (Rehiyon I) |
capital = [[Dakbayan sa Vigan]] |
founded = [[1572]] |
pop2000 = 594,206 |
pop2000rank = 41st kinadak-an |
popden2000 = 230 |
popden2000rank= 34th kinatas-an |
areakm2 = 2,579.6 |
arearank = 27th kinagamyan |
hucities = 0 |
componentcities=2 |
municipalities= 32 |
barangays = 768 |
districts = 2 |
languages = [[Ilokano]] |
governor = Luis Chavit C. Singson |
locatormapfile= [[Image:Ph_locator_map_ilocos_sur.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Ilocos Sur}}
{{Rehiyon sa Ilocos}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
fzyc68u63hcnd4ga5zd8l1f3vfc5x29
La Union
0
2699
37019580
34909597
2026-05-01T15:04:30Z
Exec8
10305
37019580
wikitext
text/x-wiki
{{ihubad}}
{{pilipinas-saha}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa La Union |
sealfile = [[Image:Ph_seal_la_union.png]] |
region = [[Rehiyon sa Ilocos]] (Rehiyon I) |
capital = [[Dakbayan sa San Fernando]] |
founded = [[1850]] |
pop2000 = 657,945 |
pop2000rank = ika-5 kinadak-an |
popden2000 = 441 |
popden2000rank= ika-9 kinatas-an |
areakm2 = 1,493.1 |
arearank = ika-13 kinagamyan |
hucities = 0 |
componentcities= 1 |
municipalities= 19 |
barangays = 576 |
districts = 2 |
languages = [[Ilokano]] |
governor = Victor C. Ortega |
locatormapfile= [[Image:Ph_locator_map_la_union.png]]
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{La Union}}
{{Rehiyon sa Ilocos}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
mabnlvjdf5mx6jnzcyywyesbxjil4mj
Pangasinan
0
2700
37019581
33077873
2026-05-01T15:05:00Z
Exec8
10305
37019581
wikitext
text/x-wiki
{{ihubad}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Pangasinan |
sealfile = |
region = [[Rehiyon sa Ilocos]] (Rehiyon I) |
capital = [[Lingayen, Pangasinan|Lingayen]] |
founded = [[1578]] |
pop2000 = 2,434,086 |
pop2000rank = ika-3 kinadak-an |
popden2000 = 453 |
popden2000rank= ika-8 kinatas-an |
areakm2 = 5,368.2 |
arearank = ika-15 kinadak-an |
hucities = 0 |
componentcities=4 |
municipalities= 44 |
barangays = 1,364 |
districts = 6 |
languages = [[Pangasinense]], [[Ilokano]], [[Bolinao]] |
governor = Victor Aguedo E. Agbayani |
locatormapfile= [[Payl:Ph_locator_map_pangasinan.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Pangasinan}}
{{Rehiyon sa Ilocos}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{Pilipinas-saha}}
tic08bbn3y7urymynvjgn06dlhqp7a4
Cagayan
0
2702
37019577
37019434
2026-05-01T15:03:28Z
Exec8
10305
37019577
wikitext
text/x-wiki
{{ihubad}}
{{pilipinas-saha}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle=Province of Cagayan|
sealfile=|
region = [[Lupot sa Cagayan]] (Rehiyon II) |
capital=[[Tuguegarao City]]|
founded=—|
pop2000=993,580|
pop2000rank=ika-25th kinadaghanan |
popden2000=110|
popden2000rank=ika-16th kinaubsan |
areakm2=9,002|
arearank=ika-3rd kinadak-an |
hucities=0|
componentcities=1|
municipalities=28|
barangays=820|
districts=3|
languages=[[Ilokano]], [[Tagalog]], [[Ibanag]], [[Itawit]]|
governor=Edgar R. Lara|
locatormapfile=[[Image:Cagayan in Philippines.svg]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Cagayan}}
{{Lupot sa Cagayan}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
8viq62p267x1mde3df4wip6w310h3e9
Isabela
0
2703
37019576
37019435
2026-05-01T15:03:05Z
Exec8
10305
37019576
wikitext
text/x-wiki
{{ihubad|Isabela province}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Isabela |
sealfile = [[Image:Ph_seal_isabela.png]] |
region = [[Lupot sa Cagayan]] (Rehiyon II) |
capital = [[Ilagan, Isabela|Ilagan]] |
founded = [[May 01]], [[1856]] |
pop2000 = 1,287,575 |
pop2000rank = ika-17 kinadaghanan |
popden2000 = 121 |
popden2000rank= ika-18 kinatas-an |
areakm2 = 10,664.6 |
arearank = ika-2 kinadak-an |
hucities = 0 |
componentcities=2 |
municipalities= 35 |
barangays = 1,055 |
districts = 4 |
languages = [[Ilokano]], [[Tagalog]], [[Ibanag]] |
governor = Ma. Gracia Padaca |
locatormapfile= [[Image:Ph_locator_map_isabela.png]]
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Isabela}}
{{Lupot sa Cagayan}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{saha-Pilipinas}}
sfy0d52xjwlmhpgnf6zymgr94eqgo29
Nueva Vizcaya
0
2704
37019578
37019436
2026-05-01T15:03:47Z
Exec8
10305
37019578
wikitext
text/x-wiki
{{ihubad}}
{{saha}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Nueva Vizcaya |
sealfile = [[Image:Ph_seal_nueva_vizcaya.png]] |
region = [[Lupot sa Cagayan]] (Rehiyon II) |
capital = [[Bayombong, Nueva Vizcaya|Bayombong]] |
founded = — |
pop2000 = 366,962 |
pop2000rank = ika-19 kinagamyan |
popden2000 = 94 |
popden2000rank= ika-14 kinaubsan |
areakm2 = 3,903.9 |
arearank = ika-33 kinadak-an |
hucities = 0 |
componentcities=0 |
municipalities= 15 |
barangays = 275 |
districts = 1 |
languages = [[Ilokano]], [[Tagalog]], [[Gaddang]] |
governor = Luisa Cuaresma |
locatormapfile= [[Image:Ph_locator_map_nueva_vizcaya.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Nueva Vizcaya}}
{{Lupot sa Cagayan}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
ocpp1w39rht5htpllxade6kkhr04joi
Aurora
0
2706
37019582
37019449
2026-05-01T15:06:07Z
Exec8
10305
37019582
wikitext
text/x-wiki
''Para sa penomenon nga kahayag nga makit-an sa polar nga latitud, tan-awa ang [[aurora (astronomiya)]].''
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Aurora |
sealfile =|
region = [[Tunga-tungang Luzon]] (Rehiyon III) |
capital = [[Baler, Aurora|Baler]] |
founded = [[1951]]† |
pop2000 = 173,797 |
pop2000rank = ika-10 kinagamyan |
popden2000 = 54 |
popden2000rank= ika-5 kinaubsan |
areakm2 = 3,239.5 |
arearank = ika-40 kinadak-an |
hucities = 0 |
componentcities= 0 |
municipalities= 8 |
barangays = 151 |
districts = 1 |
languages = [[Tagalog]] |
governor = Bellaflor Angara-Castillo |
locatormapfile= [[Image:Ph_locator_map_aurora.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Aurora}}
{{Tunga-tungang Luzon}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
4bst693pdl54mec3qa3yf2meia0rzxk
Bataan
0
2707
37019583
37019450
2026-05-01T15:06:26Z
Exec8
10305
37019583
wikitext
text/x-wiki
{{ihubad}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Bataan |
region = [[Tunga-tungang Luzon]] (Rehiyon III) |
capital = [[Dakbayan sa Balanga]] |
founded = —[[1754]] |
pop2000 = 557,659 |
pop2000rank = ika-46 kinadaghanan |
popden2000 = 406 |
popden2000rank= ika-12 kinatas-an |
areakm2 = 1,373.0 |
arearank = ika-12 kinagamyan |
hucities = 0 |
componentcities= 1 |
municipalities= 11 |
barangays = 237 |
districts = 2 |
languages = [[Tagalog]], [[Kapampangan]] |
governor = Enrique "Tet" Garcia |
locatormapfile= [[Payl:Ph_locator_map_bataan.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Bataan}}
{{Tunga-tungang Luzon}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{saha-Pilipinas}}
0kyrpvvoeynwrsd9neaohh54clqapks
Bulacan
0
2708
37019584
37019451
2026-05-01T15:06:44Z
Exec8
10305
37019584
wikitext
text/x-wiki
{{ihubad}}
{{pilipinas-saha}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Bulacan |
sealfile = [[Image:Ph seal bulacan.png]] |
region = [[Tunga-tungang Luzon]] (Rehiyon III) |
capital = [[Dakbayan sa Malolos]] |
founded = — |
pop2000 = 2,234,088 |
pop2000rank = ika-4 kinadaghanan |
popden2000 = 851 |
popden2000rank= ika-5 kinatas-an |
areakm2 = 2,625.0 |
arearank = ika-29 kinagamyan |
hucities = 0 |
componentcities=2 |
municipalities= 22 |
barangays = 569 |
districts = 5 (lakip ang distrito sa [[Dakbayan sa San Jose del Monte]]) |
languages = [[Tagalog]], [[Kapampangan]] |
governor = Wilhelmino Sy - Alvarado|
locatormapfile= [[Image:Ph locator map bulacan.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Bulacan}}
{{Tunga-tungang Luzon}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
5atd8nq7q9e3o5geyqwpuc1lievkvaw
Pampanga
0
2710
37019585
37019453
2026-05-01T15:07:10Z
Exec8
10305
37019585
wikitext
text/x-wiki
{{ihubad}}
{{saha}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Pampanga |
sealfile = [[Payl:Ph_seal_pampanga.png|150px]] |
region = [[Tunga-tungang Luzon]] (Rehiyon III) |
capital = [[Dakbayan sa San Fernando, Pampanga|San Fernando]] |
founded = [[Disyembre 11]], [[1571]] |
pop2000 = 1,882,730|
pop2000rank = ika-10 kinadaghanan |
popden2000 = 863 |
popden2000rank= ika-4 kinatas-an |
areakm2 = 2,180.7 |
arearank = ika-23 kinagamyan |
componentcities= 1 |
hucities = 1 |
municipalities= 20 |
barangays = 537 |
districts = 4 |
languages = [[Kinapampangan]], [[Tinagalog]]|
governor = Mark T. Lapid |
locatormapfile= [[Payl:Ph_locator_map_pampanga.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Pampanga}}
{{Tunga-tungang Luzon}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
izg4cy3rcjdawk08d0e2r8782xttunq
Tarlac
0
2711
37019586
37019455
2026-05-01T15:07:27Z
Exec8
10305
37019586
wikitext
text/x-wiki
{{ihubad}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Tarlac |
sealfile = [[Payl:Ph_seal_tarlac.png]] |
region = [[Tunga-tungang Luzon]] (Rehiyon III) |
capital = [[Dakbayan sa Tarlac]] |
founded = [[1872]] |
pop2000 = 1,068,783 |
pop2000rank = ika-23 kinadaghanan |
popden2000 = 350 |
popden2000rank= ika-14 kinatas-an |
areakm2 = 3,053.4 |
arearank = ika-46 kinadak-an |
hucities = 0 |
componentcities= 1 |
municipalities= 17 |
barangays = 510 |
districts = 3 |
languages = [[Tinagalog]], [[Kinapampangan]], [[Ilokano]] |
governor = Jose V. Yap |
locatormapfile= [[Payl:Ph_locator_map_tarlac.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Tarlac}}
{{Tunga-tungang Luzon}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{saha-Pilipinas}}
otdkhfziasc09o1ztuj279gjkrorgv1
Zambales
0
2712
37019587
37019457
2026-05-01T15:07:47Z
Exec8
10305
37019587
wikitext
text/x-wiki
{{ihubad}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle=Lalawigan sa Zambales|
sealfile=[[Image:Ph_seal_zambales.png]]|
region = [[Tunga-tungang Luzon]] (Rehiyon III) |
capital=[[Iba, Zambales|Iba]]|
founded=[[1578]]|
pop2000=627,802|
pop2000rank=ika-39th kinadaghanan |
popden2000=169|
popden2000rank=ika-49th kinatas-an |
areakm2=3,714.4|
arearank=ika-35th kinadak-an |
hucities=1|
componentcities=0|
municipalities=13|
barangays=247|
districts=2|
languages=[[Sinambal]], [[Ininggles]], [[Iniloko]], [[Tinagalog]]|
governor=Amor Deloso|
locatormapfile=[[Image:Ph_locator_map_zambales.png]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
Ang mga [[Sambal]] ([[Kinatsila]]: ''zambal'') ang lumad nga katawhan sa lalawigan.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Zambales}}
{{Tunga-tungang Luzon}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
m317abouuhd10kzw62rcq3xnizbmjdy
Batangas
0
2713
37019618
37019421
2026-05-01T15:49:49Z
Exec8
10305
37019618
wikitext
text/x-wiki
{{ihubad}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Batangas |
sealfile = File:Seal_of_Batangas.png|
region = [[CALABARZON]] (Rehiyon IV-A) |
capital = [[Dakbayan sa Batangas]] |
founded = [[Marso 10]], [[1917]] |
pop2000 = 1,905,348 |
pop2000rank = ika-9 kinadaghanan |
popden2000 = 602 |
popden2000rank= ika-7 kinatas-an |
areakm2 = 3,165.8 |
arearank = ika-41 kinadak-an |
hucities = 0 |
componentcities= 3 |
municipalities= 31 |
barangays = 1,078 |
districts = 4 |
languages = [[Tagalog]]|
governor = Vilma Santos |
locatormapfile= {{PH wikidata|image_map}} |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Batangas}}
{{Calabarzon}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{saha-Pilipinas}}
sicr739vkf1lsoll236wplq7s71cvkj
Cavite
0
2714
37019619
37019419
2026-05-01T15:50:00Z
Exec8
10305
37019619
wikitext
text/x-wiki
{{ihubad}}
{{saha-Pilipinas}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle=Lalawigan sa Cavite|
sealfile=[[Image:Ph seal cavite.png|150px]]|
region = [[CALABARZON]] (Rehiyon IV-A) |
capital= [[Dakbayan sa Trece Martires]]|
founded=[[Marso 10]], [[1917]]|
pop2000=2,063,161|
pop2000rank=ika-5 kinadaghanan |
popden2000=1,607|
popden2000rank=kinatas-an |
areakm2=1,287.6|
arearank=ika-9 kinagamyan |
hucities=0|
componentcities=4|
municipalities=19|
barangays=828|
districts=7|
languages=[[Tagalog]], [[Chabacano]]|
governor=Athena Bryana D. Tolentino (2019-kasamtangan)|
locatormapfile=[[Image:Ph locator map cavite.png]]|
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Cavite}}
{{Calabarzon}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
oanvonqmw9gmbminekgtu6s92n20413
Laguna
0
2715
37019620
37019422
2026-05-01T15:50:11Z
Exec8
10305
37019620
wikitext
text/x-wiki
{{ihubad}}
{{pilipinas-saha}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Laguna |
sealfile = [[Payl:Ph seal laguna.png]] |
region = [[CALABARZON]] (Rehiyon IV-A) |
capital = [[Santa Cruz, Laguna|Santa Cruz]] |
founded = [[Marso 10]], [[1917]] |
pop2000 = 1,965,872 |
pop2000rank = ika-6 kinadaghanan |
popden2000 = 1,117 |
popden2000rank= ika-3 kinatas-an |
areakm2 = 1,759.7 |
arearank = ika-17 kinagamyan |
hucities = 0 |
componentcities= 3 |
municipalities= 27 |
barangays = 674 |
districts = 4 |
languages = [[Tagalog]]|
governor = Ramil L. Hernandez |vice_governor=Katherine C. Agapay}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
Ang '''Laguna''' ([[Kinatsila]]: ''La Laguna''<ref>Rizal, José. 1887. ''Noli Me Tangere''. [[Berlin]]: Setzerinnenschule des Lette-Vereins.</ref>) maoy [[Lalawigan (Pilipinas)|lalawigan]] sa [[Pilipinas]].
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Laguna}}
{{Calabarzon}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
ds0vi4nnhytbswi5ntl79y5w8a1rfib
Quezon
0
2716
37019621
37019417
2026-05-01T15:50:23Z
Exec8
10305
37019621
wikitext
text/x-wiki
[[File:{{PH wikidata|image_map}}|280px|right]]
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Quezon}}
{{Calabarzon}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{saha}}
32z3ii3lf8cbpeyb4a84a4ebbtpdw0v
Marinduque
0
2718
37019648
1963957
2026-05-01T16:21:56Z
Exec8
10305
37019648
wikitext
text/x-wiki
{{ihubad}}
{{saha}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle=Lalawigan sa Marinduque|
sealfile=[[Payl:Ph_seal_marinduque.png]]|
region = [[MIMAROPA]] (Rehiyon IV-B) |
capital=[[Boac, Marinduque|Boac]]|
founded=[[Pebrero 21]], [[1920]]|
pop2000=217,392|
pop2000rank=ika-14 kinagamyan |
popden2000=227|
popden2000rank=ika-35 kinatas-an |
areakm2=959.3|
arearank=ika-6 kinagamyan |
hucities=0|
componentcities=0|
municipalities=6|
barangays=218|
districts=1|
languages=[[Tagalog]]|
governor=Carmencita O. Reyes|
locatormapfile=[[Payl:Ph_locator_map_marinduque.png]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Marinduque}}
{{Mimaropa}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
2yrwkjbgxv8m8sdqnsto6vvx2ardg8x
Kasadpang Mindoro
0
2719
37019649
1949666
2026-05-01T16:22:48Z
Exec8
10305
37019649
wikitext
text/x-wiki
{{ihubad}}
{{saha-Pilipinas}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Occidental Mindoro |
sealfile = [[Payl:Ph_seal_mindoro_occidental.png]] |
region = [[MIMARO]] (Rehiyon IV-B) |
capital = [[Mamburao, Kasadpang Mindoro|Mamburao]] |
founded = — |
pop2000 = 380,250 |
pop2000rank = ika-21 kinagamyan |
popden2000 = 65 |
popden2000rank= ika-9 kinaubsan |
areakm2 = 5,879.9 |
arearank = ika-11 kinadak-an |
hucities = 0 |
componentcities=0 |
municipalities= 11 |
barangays = 162 |
districts = 1 |
languages = [[Tinagalog]], [[Kamangyan]] |
governor = Jose T. Villarosa |
locatormapfile= [[Payl:Ph_locator_map_occidental_mindoro.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
== Mga Reperensya ==
{{reflist|2}}
{{Occidental Mindoro}}
{{Rehiyon sa Ilocos}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
[[Kategoriya:Kasadpang Mindoro| ]]
5oyfr3r4onsxbfcd7cq4org0f0sx4rz
37019650
37019649
2026-05-01T16:22:59Z
Exec8
10305
37019650
wikitext
text/x-wiki
{{ihubad}}
{{saha-Pilipinas}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Occidental Mindoro |
sealfile = [[Payl:Ph_seal_mindoro_occidental.png]] |
region = [[MIMARO]] (Rehiyon IV-B) |
capital = [[Mamburao, Kasadpang Mindoro|Mamburao]] |
founded = — |
pop2000 = 380,250 |
pop2000rank = ika-21 kinagamyan |
popden2000 = 65 |
popden2000rank= ika-9 kinaubsan |
areakm2 = 5,879.9 |
arearank = ika-11 kinadak-an |
hucities = 0 |
componentcities=0 |
municipalities= 11 |
barangays = 162 |
districts = 1 |
languages = [[Tinagalog]], [[Kamangyan]] |
governor = Jose T. Villarosa |
locatormapfile= [[Payl:Ph_locator_map_occidental_mindoro.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Occidental Mindoro}}
{{Rehiyon sa Ilocos}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
[[Kategoriya:Kasadpang Mindoro| ]]
ikbvil366gkngv9zd6eddcq3r3w04fm
Sidlakang Mindoro
0
2720
37019651
33571101
2026-05-01T16:24:20Z
Exec8
10305
37019651
wikitext
text/x-wiki
[[File:{{PH wikidata|image_map}}|280px|right]]
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Oriental Mindoro}}
{{Mimaropa}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
rsuucrvuxjpl323lshbg35v86z2pgv2
Romblon
0
2721
37019653
34909561
2026-05-01T16:26:26Z
Exec8
10305
37019653
wikitext
text/x-wiki
[[File:{{PH wikidata|image_map}}|280px|right]]
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Romblon}}
{{Mimaropa}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
8kwwc6k26gwk9havebesy6nhtb9whtx
Apayao
0
2728
37019612
37019463
2026-05-01T15:47:59Z
Exec8
10305
37019612
wikitext
text/x-wiki
{{ihubad}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle=Lalawigan sa Apayao|
sealfile=[[Image:Ph_seal_apayao.png]]|
region = [[Awtonomong Rehiyon sa Cordillera]] (CAR) |
capital=[[Kabugao, Apayao|Kabugao]]|
founded=[[Pebrero 14]], [[1995]]|
pop2000=97,129|
pop2000rank=ika-4 kinagamyan |
popden2000=25|
popden2000rank=kinaubsan |
areakm2=3,927.9|
arearank=ika-32 kinadak-an |
hucities=0|
componentcities=0|
municipalities=7|
barangays=133|
districts=1|
languages=[[Ilokano]], [[Tagalog]]|
governor=Elias K. Bulut, Sr.|
locatormapfile=[[Image:Ph_locator_map_apayao.png]]}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Katawhan ug Kultura==
==Ekonomiya==
==Heyograpiya==
===Politika===
Ang Apayao
nabahin ngadto sa 7
ka mga [[lungsod]].
====Mga lungsod====
<table border="0"><tr>
<td valign="top">
*[[Calanasan, Apayao|Calanasan]] (Bayag)
*[[Conner, Apayao|Conner]]
*[[Flora, Apayao|Flora]]
*[[Kabugao, Apayao|Kabugao]]
</td><td valign="top">
*[[Luna, Apayao|Luna]]
*[[Pudtol, Apayao|Pudtol]]
*[[Santa Marcela, Apayao|Santa Marcela]]
</td></tr></table>
===Pisikal===
==Kaagi==
==Mga sumpay sa gawas==
== Mga Reperensya ==
{{reflist|2}}
{{Apayao}}
{{Administratibong Rehiyon sa Cordillera}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
s21e5r8eyz2zxjmieeajr3w5cvbn7bt
Benguet
0
2738
37019613
37019464
2026-05-01T15:48:24Z
Exec8
10305
37019613
wikitext
text/x-wiki
{{ihubad}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Benguet |
sealfile = [[Image:ph_seal_benguet.png]] |
region = [[Administratibong Rehiyon sa Cordillera]] (CAR) |
capital = [[La Trinidad, Benguet]] |
founded = — |
pop2000 = 582,515 |
pop2000rank = ika-43 kinadaghanan |
popden2000 = 219 |
popden2000rank= ika-36 kinatas-an |
areakm2 = 2,655.4 |
arearank = ika-49 kinadak-an |
hucities = 1 |
componentcities=0 |
municipalities= 13 |
barangays = 269 |
districts = 2 |
languages = [[Ilokano]] |
governor = Borromeo P. Melchor |
locatormapfile= [[Image:Ph_locator_map_benguet.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Katawhan ug Kultura==
==Ekonomiya==
==Heyograpiya==
===Politikal===
====Mga lungsod====
<table border="0"><tr>
<td valign="top">
*[[Atok, Benguet|Atok]]
*[[Bakun, Benguet|Bakun]]
*[[Bokod, Benguet|Bokod]]
*[[Buguias, Benguet|Buguias]]
*[[Itogon, Benguet|Itogon]]
*[[Kabayan, Benguet|Kabayan]]
*[[Kapangan, Benguet|Kapangan]]
</td><td valign="top">
*[[Kibungan, Benguet|Kibungan]]
*[[La Trinidad, Benguet|La Trinidad]]
*[[Mankayan, Benguet|Mankayan]]
*[[Sablan, Benguet|Sablan]]
*[[Tuba, Benguet|Tuba]]
*[[Tublay, Benguet|Tublay]]
</td></tr></table>
====Dakbayan====
====Mga dakbayan====
===Pisikal===
==Kaagi==
==Mga sumpay sa gawas==
== Mga Reperensya ==
{{reflist|2}}
{{Benguet}}
{{Administratibong Rehiyon sa Cordillera}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{saha-Pilipinas}}
e841o3kb1er1ubhyjgf5rfyl0fxg4zf
Kalinga
0
2740
37019616
37019466
2026-05-01T15:48:39Z
Exec8
10305
37019616
wikitext
text/x-wiki
{{ihubad}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Kalinga |
sealfile = [[Payl:Ph_seal_kalinga.png|150px]] |
region = [[Administratibong Rehiyon sa Cordillera]] (CAR) |
capital = [[Tabuk, Kalinga|Tabuk]] |
founded = [[Pebrero 14]], [[1995]] |
pop2000 = 174,023 |
pop2000rank = ika-11 kinagamyan |
popden2000 = 56 |
popden2000rank= ika-6 kinaubsan |
areakm2 = 3,119.7 |
arearank = ika-42 kinadak-an |
hucities = 0 |
componentcities=0 |
municipalities= 8 |
barangays = 152 |
districts = 1 |
languages = [[Ilokano]], [[Tagalog]] |
governor = Dominador T. Belac |
locatormapfile= [[Payl:Ph_locator_map_kalinga.png]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Katawhan ug Kultura ==
==Ekonomiya==
== Heyograpiya ==
=== Politikal ===
==== Mga lungsod ====
====Dakbayan====
==== Mga dakbayan ====
=== Pisikal ===
== Kaagi ==
==Mga sumpay sa gawas==
== Mga Reperensya ==
{{reflist|2}}
{{Kalinga}}
{{Administratibong Rehiyon sa Cordillera}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{saha-Pilipinas}}
dyd7ixileb6h7hrjkonq73bpvjijkng
Tagum
0
3384
37019683
35043431
2026-05-02T00:34:04Z
~2026-26553-09
142648
/* Mga AM istasyon */
37019683
wikitext
text/x-wiki
[[Payl:Ph_locator_davao_del_norte_tagum.png|right|Mapa sa Davao del Norte nga nagpakita kon asa nahimutang ang Dakbayan sa Tagum]]
Ang '''Dakbayan sa Tagum''' primera klaseng dakbayan nahimutang sa probensya sa [[Davao del Norte]], [[Pilipinas]].. Mao kini ang ulohan sa lalawigan sa Davao del Norte. Adunay kinatibok-an gidak-on nga 195.80 kilometros quadrado ug nahimutang unang distrito. <br>
Sumala sa census ni acting 2010, dunay 242,801 katawo. Ang gitudlo nga kodigo postal mao ang 8100.
== Mga barangay ==
Ang Dakbayan sa Tagum nabahin ngadto sa 23 ka [[barangay]].
<table border=0><tr>
<td valign=top>
* Apokon
* Bincungan
* Busaon
* Canocotan
* Cuambogan
* La Filipina
* Liboganon
* Madaum
* Magdum
* Mankilam
* New Balamban
* Nueva Fuerza
</td><td valign=top>
* Pagsabangan
* Pandapan
* Magugpo Poblacion
* San Agustin
* San Isidro
* San Miguel (Kampo Kwatro)
* Visayan Village
* Magugpo East
* Magugpo North
* Magugpo South
* Magugpo West
</td></tr></table>
== Mga radyo ==
=== Mga AM istasyon ===
*[[DXGB-AM]] 720 kHz (Audiovisual Communicators)
*[[DXDN]] 936 kHz
*[[1359 AM (Tagum)|DX__]] 1359 kHz (Anno Domini Broadcasting Corporation)
*DX__ 1521 kHz (Audiovisual Communicators, Inc.) (TBA)
=== Mga FM istasyon ===
*107.1 XFM (DXHS-FM; Audiovisual Communicators ug Yes2Health Broadcasting Network)
== Mga popular nga tawo gikan sa Dakbayan sa Tagum ==
* [[Justo S. Virtudazo]], [[magsusulat]] sa [[Sinugboanon]]
==Mga sumpay sa gawas==
* [http://www.tagumcity.gov.ph/ Opisyal nga websayt sa Dakbayan sa Tagum]
* [https://web.archive.org/web/20010808093313/http://www.geocities.com/tagumcity_ph/ Laing websayt sa Dakbayan sa Tagum]
* [http://tagumcity.20m.com/ Laing opisyal nga websayt sa Dakbayan sa Tagum]
* [http://www.world66.com/asia/southeastasia/philippines/tagumcity Tagum City travel guide] {{Webarchive|url=https://web.archive.org/web/20111202012414/http://www.world66.com/asia/southeastasia/philippines/tagumcity |date=2011-12-02 }}
* [http://www.nscb.gov.ph/activestats/psgc/default.asp Philippine Standard Geographic Code] {{Webarchive|url=https://web.archive.org/web/20120413163013/http://www.nscb.gov.ph/activestats/psgc/default.asp |date=2012-04-13 }}
* [http://www.census.gov.ph/census2000/index.html 2000 Philippines Census Information] {{Webarchive|url=https://web.archive.org/web/20100130095048/http://www.census.gov.ph/census2000/index.html |date=2010-01-30 }}
{{Metro Davao}}
{{Davao del Norte}}
{{DEFAULTSORT:Tagum}}
[[Kategoriya:Mga lungsod ug dakbayan sa Davao del Norte]]
4sjc5atl0tacilh3pe9f8qmzmskkuz5
Sultan Kudarat
0
3457
37019668
1964043
2026-05-01T16:37:18Z
Exec8
10305
37019668
wikitext
text/x-wiki
[[File:{{PH wikidata|image_map}}|280px|right]]
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Sultan Kudarat}}
{{Soccsksargen}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
{{pilipinas-saha}}
hwn3140ctuiggj0u2k0d99tgvcvbk1j
Malaybalay
0
5990
37019682
37017522
2026-05-02T00:31:19Z
~2026-26553-09
142648
/* AM estasyon */
37019682
wikitext
text/x-wiki
[[Image:Ph_locator_bukidnon_malaybalay.png|right|Mapa sa Bukidnon nga nagapakita kon asa ang Dakbayan sa Malaybalay]]
Ang '''Dakbayan sa Malaybalay''' primera klaseng dakbayan nahimutang sa probensya sa [[Bukidnon]], [[Pilipinas]]. Adunay kinatibok-an gidak-on nga 969.19 kilometros quadrado ug nahimutang ikaduhang distrito. <br>
Sumala sa census ni acting 2024, dunay '''195,046''' katawo. Ang gitudlo nga kodigo postal mao ang 8700.
Mao kini ang ulohang dakbayan sa lalawigan sa [[Bukidnon]]. Maoy nag-unang pamusong atraksiyon ning mabugnawng siyudad sa tunga sa lasang-sa-mga-pino ang [[Kaamulan Festival]].
==Mga barangay==
<table border=0><tr>
<td valign=top width="25%">
* [[Aglayan]]
* Bangcud
* Busdi
* Cabangahan
* Caburacanan
* Canayan
* Capitan Angel
* Casisang
* Dalwangan
* Imbayao
* Indalaza
* Kalasungay
</td><td valign=top width="25%">
* Kabalabag
* Kulaman
* Laguitas
* Patpat (Lapu-lapu)
* Linabo
* Apo Macote
* Miglamin
* Magsaysay
* Maligaya
* Managok
* Manalog
* Mapayag
</td><td valign=top width="25%">
* Mapulo
* Barangay 1 (Pob.)
* Barangay 2 (Pob.)
* Barangay 3 (Pob.)
* Barangay 4 (Pob.)
* Barangay 5 (Pob.)
* Barangay 6 (Pob.)
* Barangay 7 (Pob.)
* Barangay 8 (Pob.)
* Barangay 9 (Pob.)
* Barangay 10 (Pob.)
* Barangay 11 (Pob.)
</td><td valign=top width="25%">
* Saint Peter
* San Jose
* San Martin
* Santo Niño
* Silae
* Simaya
* Sinanglanan
* Sumpong
* Violeta
* Zamboanguita
</td></tr></table>
==Mga Medya==
===AM estasyon===
*[[DXDB-AM]] 594 kHz (Catholic Media Network)
*[[DXMB-AM]] 648 kHz (Radio Mindanao Network)
*[[DXEM]] 720 kHz (Banwag Brodcasting System ug Audiovisual Communicators, Inc.)
*[[DXCB-AM]] 864 kHz (Mareco Broadcasting Network)
*(PA) 909 kHz (Audiovisual Communicators, Inc. ug Herbz Med Pharma Corporation)
*[[DXAN-AM]] 1143 kHz (Bukidnon State University)
*[[DXVK-AM]] 1215 kHz (Quest Broadcasting)
===FM estasyon===
*[[DXNL]] 89.5 MHz (RSV Broadcast Services)
*PA 94.5 MHz (Audiovisual Communicators, Inc.)
*[[DXBU]] 104.5 MHz (Bukidnon State University)
*[[DXIQ]] 106.3 MHz (Manila Broacasting Company)
*[[DXGG]] 107.1 MHz (Iddes Broadcast Group)
{{geobox
| 1 = Region
<!-- *** Header *** -->
| name = Malaybalay
| native_name =
| other_name =
| category = Dakbayan
| official_name =
| etymology =
| motto =
| nickname =
<!-- *** Image *** -->
| image =
| image_caption =
<!-- *** Symbols *** -->
| flag =
| symbol =
<!-- *** Admin *** -->
| country = {{flag|Pilipinas}}
| country_flag =
| state = [[Amihanang Mindanao (rehiyon sa Pilipinas)|Amihanang Mindanao]]
| state_type = Rehiyon
| region = [[Bukidnon]]
| region_type = Lalawigan
| district =
| district_type =
| economic_region =
| economic_region_type =
<!-- *** Associated with *** -->
| border =
| part =
| city =
| landmark =
| river =
<!-- *** Location *** -->
| capital =
| capital_type =
| capital_location =
| capital_region =
| capital_country =
| capital_elevation =
| capital_lat_d =
| capital_lat_m =
| capital_lat_s =
| capital_lat_NS =
| capital_long_d =
| capital_long_m =
| capital_long_s =
| capital_long_EW =
| highest =
| highest_location =
| highest_region =
| highest_country =
| highest_elevation =
| highest_lat_d =
| highest_lat_m =
| highest_lat_s =
| highest_lat_NS =
| highest_long_d =
| highest_long_m =
| highest_long_s =
| highest_long_EW =
| lowest =
| lowest_location =
| lowest_region =
| lowest_country =
| lowest_elevation =
| lowest_lat_d =
| lowest_lat_m =
| lowest_lat_s =
| lowest_lat_NS =
| lowest_long_d =
| lowest_long_m =
| lowest_long_s =
| lowest_long_EW =
<!-- *** Dimensions *** -->
| length =
| length_orientation =
| width =
| width_orientation =
| area =
| area_decimals =
<!-- *** Population *** -->
| population =
| population_date =
| population_density =
<!-- *** History and politics *** -->
| established =
| date =
| government_location =
| government_region =
| government_country =
| government_elevation =
| government_lat_d =
| government_lat_m =
| government_lat_s =
| government_lat_NS =
| government_long_d =
| government_long_m =
| government_long_s =
| government_long_EW =
| leader =
| leader_party =
<!-- *** Codes *** -->
| timezone = [[Philippine Standard Time|PST]]
| utc_offset = +8
| timezone_DST =
| utc_offset_DST =
| postal_code =
| area_code =
| code =
<!-- *** Free *** -->
| free =
| free_type =
<!-- *** Maps *** -->
| map =
| map_size =
| map_caption =
| map_locator_x =
| map_locator_y =
<!-- *** Website *** -->
| website =
<!-- *** Notes *** -->
| footnotes =
| other_name1 = Malaybalay
| lat_d = 8.16278
| long_d = 125.17722
| elevation = 680
| timezone_label = Asia/Manila
| geonames = 6569821
}}
<!--A.ADM2-->[[Dakbayan]] ang '''Malaybalay''' sa [[Pilipinas]].<ref name = "gn6569821"/> Nahimutang ni sa rehiyon sa <!--ADM1-->[[Amihanang Mindanao (rehiyon sa Pilipinas)|Amihanang Mindanao]], sa habagatan-sidlakang bahin sa nasod, {{formatnum:900}} km sa habagatan-sidlakan sa [[Dakbayan sa Manila (ulohang dakbayan sa Pilipinas)|Dakbayan sa Manila]] ang ulohan sa nasod.
{{Location map|Philippines |float = right |width=300 | caption = Nahimutangan sa Dakbayan sa Malaybalay sa Pilipinas. | label = Dakbayan sa Malaybalay|position=left|background=white|lat=8.16278|long=125.17722}}
Hapit nalukop sa [[lasang]] ang palibot sa Dakbayan sa Malaybalay.<ref name = "nasalandcover"/> Dunay mga {{formatnum:134}} ka tawo kada kilometro kwadrado sa palibot sa Dakbayan sa Malaybalay medyo hilabihan populasyon.<ref name = "nasapop"/> Ang klima [[tropikal nga kasalupan]].<ref name = "koppen"/> Ang kasarangang giiniton {{formatnum:21}} [[°C]]. Ang kinainitan nga bulan Hunyo, sa {{formatnum:22}} [[°C]], ug ang kinabugnawan Enero, sa {{formatnum:18}} °C.<ref name = "nasa"/> Ang kasarangang pag-ulan {{formatnum:3510}} milimetro matag tuig. Ang kinabasaan nga bulan Enero, sa {{formatnum:543}} milimetro nga ulan, ug ang kinaugahan Abril, sa {{formatnum:182}} milimetro.<ref name = "nasarain"/>
{|
|-
|{{climate chart
| Dakbayan sa Malaybalay
| 16| 21| 543
| 16| 23| 274
| 17| 24| 232
| 18| 25| 182
| 18| 24| 246
| 19| 26| 302
| 18| 23| 324
| 19| 23| 305
| 18| 24| 242
| 19| 23| 287
| 18| 23| 304
| 18| 23| 270
|float=left
|clear=left
|source = <ref name = "nasa"/>
}}
|}
== Ang mga gi basihan niini ==
<references>
<ref name = "gn6569821">[{{Geonameslink|gnid=6569821|name=city%20of%20malaybalay}} City of Malaybalay] at [{{Geonamesabout}} GeoNames.Org (cc-by)]; post updated 2013-12-08; database download sa 2015-11-25</ref>
<ref name = "nasapop">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/view.php?datasetId=SEDAC_POP|title= NASA Earth Observations: Population Density|access-date = 30 Enero 2016 |publisher= NASA/SEDAC}}</ref>
<ref name = "koppen">{{cite journal |last= Peel|first= M C|last2= Finlayson|first2= B L|date= |title= Updated world map of the Köppen-Geiger climate classification| url = http://www.hydrol-earth-syst-sci.net/11/1633/2007/hess-11-1633-2007.html |journal= Hydrology and Earth System Sciences|publisher= |volume= 11|issue= |pages= 1633-1644|doi= 10.5194/hess-11-1633-2007|access-date=30 Enero 2016}}</ref>
<ref name = "nasa">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/dataset_index.php|title= NASA Earth Observations Data Set Index|access-date = 30 Enero 2016 |publisher= NASA}}</ref>
<ref name = "nasarain">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/view.php?datasetId=TRMM_3B43M&year=2014|title= NASA Earth Observations: Rainfall (1 month - TRMM)|access-date = 30 Enero 2016 |publisher= NASA/Tropical Rainfall Monitoring Mission}}</ref>
<ref name = "nasalandcover">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/view.php?datasetId=MCD12C1_T1|title= NASA Earth Observations: Land Cover Classification|access-date = 30 Enero 2016 |publisher= NASA/MODIS}}</ref>
</references>
{{Bukidnon}}
[[Kategoriya:Mga lungsod ug dakbayan sa Bukidnon|Malaybalay]]
1clytv5eyylq05m11yh0ah5wh5lrtyf
Kapupud-ang Dinagat
0
9572
37019672
37019440
2026-05-01T16:40:32Z
Exec8
10305
37019672
wikitext
text/x-wiki
{{ihubad|Dinagat Islands}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Dinagat Islands |
sealfile = |
region = [[Caraga]] (Rehiyon XIII) |
capital = [[San Jose, Dinagat Islands|San Jose]] |
founded = [[Disyembre 2]], [[2006]] |
pop2000 = 106,951 |
pop2000rank = |
popden2000 = 133.3 |
popden2000rank = |
areakm2 = 802.12 |
arearank = |
hucities = 0 |
componentcities = 0 |
municipalities = 7 |
barangays = 100|
districts = |
languages = |
governor = |
locatormapfile = [[Payl:Ph locator map dinagat islands.png]]
}}
Ang '''Dinagat Islands''' usa ka kapupod-an nga usa ka [[mga Lalawigan sa Pilipinas|lalawigan]] sa [[Pilipinas]], nga nahimutang sa habagatang dapit sa [[Golpo sa Leyte]]. Ang [[Leyte (pulo)|Leyte]] nahimutang sa kasadpan sa lalaiwgan, tabok sa [[Surigao Strait]], ug ang [[Mindanao]] nahimutang sa habagatan. Ang Dinagat mga 60 ka km gikan sa amihanan hangtod sa habagatan.
<!--
Best known for its great rock climbing sites and white sand beaches, it is the country's 81st and newest province and the fifth in the [[Caraga|Caraga Region]].
The province, situated almost entirely on [[Dinagat Island]], is a Shangri-La of adventurers. Its caves, rock formations and mountain lakes provide a perfect ambience for the thrill seeker and highly-strung individuals. It is also the seat of the greatest and historic [[Battle of Surigao Strait]] during the [[World War II]] and the entry point of the American Liberation forces before the momentous return of Gen. [[Douglas MacArthur]] in Leyte.
It is known as one of the holiest sites on the islands in the Pre-christian native religion where the God of Hurricanes was persuaded to relent his attacks on the islands by Da the god of peace.
-->
== Politikal nga Pagbahin ==
Ang Dinagat Islands nabahin ngadto sa pito (7) ka [[mga Lungsod sa Pilipinas|lungsod]].
<!--kining table angay ihubad sa Binisayang Sinugboanon-->
{| class="wikitable"
|- bgcolor=#cccccc
! [[Mga Dakbayan sa Pilipinas|Dakbayan]]/<br />[[Mga Lungsod sa Pilipinas|Lungsod]] !! Pila ka<br /> [[Barangay]] !! Area<br />([[square kilometre|km²]]) !! Populasyon<br />([[2000]]) !! Pop. densidad<br />(per km²)
|-
|[[Basilisa, Dinagat Islands|Basilisa]] (Rizal)
|<div style="text-align: center;">27
|<div style="text-align: center;">
|<div style="text-align: center;">26,489
|<div style="text-align: center;">
|-
|[[Cagdianao, Dinagat Islands|Cagdianao]]
|<div style="text-align: center;">14
|<div style="text-align: center;">
|<div style="text-align: center;">12,886
|<div style="text-align: center;">
|-
|[[Dinagat, Dinagat Islands|Dinagat]]
|<div style="text-align: center;">12
|<div style="text-align: center;">
|<div style="text-align: center;"> 9,883
|
|-
|[[Libjo, Dinagat Islands|Libjo]] (Albor)
|<div style="text-align: center;">16
|<div style="text-align: center;">
|<div style="text-align: center;">16,610
|<div style="text-align: center;">
|-
|[[Loreto, Dinagat Islands|Loreto]]
|<div style="text-align: center;">10
|<div style="text-align: center;">
|<div style="text-align: center;"> 8,751
|<div style="text-align: center;">
|--style="background:#ccccff"
|[[San Jose, Dinagat Islands|San Jose]]
|<div style="text-align: center;">12
|<div style="text-align: center;">
|<div style="text-align: center;">25,532
|<div style="text-align: center;">
|-
|[[Tubajon, Dinagat Islands|Tubajon]]
|<div style="text-align: center;"> 9
|<div style="text-align: center;">
|<div style="text-align: center;"> 6,800
|<div style="text-align: center;">
|}
==Mga sumpay sa gawas==
* [http://fixedreference.org/en/20040424/wikipedia/Surigao_del_Sur] {{Webarchive|url=https://web.archive.org/web/20160304200529/http://fixedreference.org/en/20040424/wikipedia/Surigao_del_Sur |date=2016-03-04 }}
* [http://www.senate.gov.ph/republic_acts/ra%209355.pdf Charter of the Province of Dinagat Islands (Republic Act No. 9355)]
* [http://www.sunstar.com.ph/static/cag/2006/12/05/news/dinagat.isles.land.provincehood.status.html Dinagat isles land provincehood status] {{Webarchive|url=https://web.archive.org/web/20061210023613/http://www.sunstar.com.ph/static/cag/2006/12/05/news/dinagat.isles.land.provincehood.status.html |date=2006-12-10 }}
== Mga Reperensya ==
{{reflist|2}}
{{Dinagat Islands}}
{{Caraga}}
[[Kategoriya:Mga Lalawigan sa Pilipinas|Dinagat]]
k5nhazirk7p9d28ejeygt6kwonm4nt1
Metro Cebu
0
37658
37019680
34910305
2026-05-02T00:26:55Z
~2026-26553-09
142648
37019680
wikitext
text/x-wiki
[[Image:Ph locator cebu metro cebu.png|thumb]]
Ang '''Kaulohang Sugbo''' kun '''Metro Cebu''' sayong pagsulti mao ang urbanong sentro sa pulo-lalawigan sa [[Sugbo]]. Ang [[Dakbayan sa Sugbo]] mao ang sentro, ang nahiunang lungsod sa [[Pilipinas]] nga gitukod sa mga [[Katsila]]. Ang Metro Cebu nahimutang sa tunga-tungang bahin sa sidlakang baybayon sa [[pulo sa Sugbo]] apil ang [[pulo sa Mactan]]. Ang metropolitanong dapit mikabat og 20% sa arya ug 57.5% sa populasyon (2000 census) sa kinatibuk-ang lalawigan sa Sugbo.
Ang Metro Cebu usa sa lima nga metropolitanong dapit sa Pilipinas. Mahimong maingon ang Metro Cebu isip kaulohan ug nangunang urbanisadong dapit sa [[Kabisay-an]] ug [[Mindanao]].
==Mga Medya==
*Radyo Sibya 1512 kHz (Audiovisual Communicators)
{{Metro Cebu}}
[[Kategoriya:Sugbo]]
d59nkephaj6mx9yofqyrznidac7q7jl
Rizal
0
40275
37019622
37019424
2026-05-01T15:50:36Z
Exec8
10305
37019622
wikitext
text/x-wiki
:''Ang [[Rizal (lalawigan)]] moredirek dinhi. Alang sa tao, adtoa ang [[José Rizal]], alang sa ubang gamit adtoa ang [[Rizal (pagklaro)]]''.
: ''Ang [[:EN:Rizal|Ingles]] ug [[:tl:Rizal (lalawigan)|Tinagalog]] nga bersiyon ning maong panid mahimo mong mahubad ngadto sa Binisayang Sinugboanon.''
{{saha}}
{{Infobox Lalawigan sa Pilipinas 3|
infoboxtitle = Lalawigan sa Rizal |
sealfile = [[Image:Ph seal rizal.png]] |
region = [[CALABARZON]] (Rehiyon IV-A) |
capital = [[Dakbayan sa Antipolo]] (apan ang [[Dakbayan sa Pasig]] ang ulohan sa pangagamhanan) |
founded = [[Hunyo 11]], [[1901]] |
pop2000 = 1,707,218 |
pop2000rank = ika-11 kinadaghanan |
popden2000 = 1,304 |
popden2000rank= ika-2 kinatas-an |
areakm2 = 1,308.9 |
arearank = ika-10 kinagamyan |
hucities = 0 |
componentcities= 1 |
municipalities= 13 |
barangays = 187 |
districts = 4 (lakip ang duha ka distrito sa Dakbayan sa Antipolo)|
languages = [[Tagalog]]|
governor = Casimiro M. Ynares, Jr. |
locatormapfile= [[Image:Rizal in Philippines.svg]] |
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
==Mga Siyudad ug lungsod==
{{Div col|colwidth=12em}}
{{wikidata|properties|qualifier|reference|normal+|P150|format=<li>%p[%r][<ul><li>%q</li></ul></ul><]</li>}}</ul>
{{div col end}}
== Mga Reperensya ==
{{reflist|2}}
{{Rizal}}
{{Calabarzon}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
gb99mo6yfqp0s7nn0nsj1vv01uwloog
Plantilya:Infobox settlement
10
51164
37019565
34905207
2026-05-01T14:53:09Z
Exec8
10305
.
37019565
wikitext
text/x-wiki
{{Tfm/dated|page=Infobox settlement|otherpage=Infobox UK place|link=Wikipedia:Templates for discussion/Log/2026 April 25#Template:Infobox settlement|type=sidebar|help=off|bigbox={{#invoke:Noinclude|noinclude|text=yes}}}}
<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">{{if empty|{{{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|upright={{{image_upright|}}}<!--
-->|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 empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}}}<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 empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}|class={{{seal_class|}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{if empty|{{{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 empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}}}<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}}|upright={{{blank_emblem_upright|}}}|alt={{{blank_emblem_alt|}}}|title=Official logo of {{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}}}<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 empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}}}}}}{{#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 empty|{{{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 empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}}} }}
|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|}}}{{{nicknames|}}}|<!--
-->{{Pluralize from text|parse_links=1|{{if empty|{{{nickname|}}}|{{{nicknames|}}}{{force plural}}}}|<!--
-->link={{{nickname_link|}}}|singular=Nickname|likely=Nickname(s)|plural=Nicknames}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{nickname|}}}|{{{nicknames|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|parse_links=1|{{{nickname|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible nickname list]]}}}}}}
<!-- ***Motto*** -->
| rowclass22 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}|mergedrow|mergedtoprow}}
| data22 = {{#if:{{{motto|}}}{{{mottoes|}}}|<!--
-->{{Pluralize from text|{{if empty|{{{motto|}}}|{{{mottoes|}}}{{force plural}}}}|<!--
-->link={{{motto_link|}}}|singular=Motto|likely=Motto(s)|plural=Mottoes}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{motto|}}}|{{{mottoes|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|{{{motto|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible motto list]]}}}}}}
<!-- ***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|upright={{{image_upright|}}}|alt={{{map_alt|}}}|title={{{map_caption|Location of {{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}}}}}}{{#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|upright={{{image_upright|}}}|alt={{{map_alt1|}}}|title={{{map_caption1|Location of {{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}}}}}}{{#if:{{{map_caption1|}}}|<div class="ib-settlement-caption">{{{map_caption1}}}</div>}} }}
| data26 = {{#invoke:Infobox mapframe
| autoWithCaption
| onByDefault = {{#if:{{{pushpin_map|}}}{{{image_map|}}}{{{image_map1|}}}|no|yes}}
| mapframe-frame-width = 250
| mapframe-stroke-width = 2
| mapframe-length_km = {{{length_km|}}}
| mapframe-length_mi = {{{length_mi|}}}
| mapframe-width_km = {{{width_km|}}}
| mapframe-width_mi = {{{width_mi|}}}
| mapframe-area_km2 = {{{area_total_km2|}}}
| mapframe-area_ha = {{{area_total_ha|}}}
| mapframe-area_acre = {{{area_total_acre|}}}
| mapframe-area_sq_mi = {{{area_total_sq_mi|}}}
| mapframe-type = city
| mapframe-population = {{if empty|{{{population_metro|}}}|{{{population_total|}}}}}
| mapframe-marker = town
| mapframe-wikidata = yes
| mapframe-caption = Interactive map of {{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}
}}
<!-- ***Pushpin Map*** -->
| rowclass28 = mergedtoprow
| data28 = {{#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 empty|{{{name|}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
<!-- ***Coordinates*** -->
| data29 = {{#if:{{{coordinates|}}}|{{#if:{{#invoke:string|match|s={{{coordinates|}}}|pattern=geo-inline-hidden|ignore_errors=true|plain=true}}|<!-- Nothing to display -->
|Coordinates{{#if:{{{coor_pinpoint|}}}{{{coor_type|}}}| ({{if empty|{{{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|}}} }}}}
| rowclass30 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|mergedbottomrow|mergedrow}}
| label30 = {{if empty|{{{grid_name|}}}|Grid position}}
| data30 = {{{grid_position|}}}
<!-- ***Subdivisions*** -->
| rowclass31 = mergedtoprow
| label31 = {{{subdivision_type}}}
| data31 = {{#if:{{{subdivision_type|}}}|{{{subdivision_name|}}} }}
| rowclass32 = mergedrow
| label32 = {{{subdivision_type1}}}
| data32 = {{#if:{{{subdivision_type1|}}}|{{{subdivision_name1|}}} }}
| rowclass33 = mergedrow
| label33 = {{{subdivision_type2}}}
| data33 = {{#if:{{{subdivision_type2|}}}|{{{subdivision_name2|}}} }}
| rowclass34 = mergedrow
| label34 = {{{subdivision_type3}}}
| data34 = {{#if:{{{subdivision_type3|}}}|{{{subdivision_name3|}}} }}
| rowclass35 = mergedrow
| label35 = {{{subdivision_type4}}}
| data35 = {{#if:{{{subdivision_type4|}}}|{{{subdivision_name4|}}} }}
| rowclass36 = mergedrow
| label36 = {{{subdivision_type5}}}
| data36 = {{#if:{{{subdivision_type5|}}}|{{{subdivision_name5|}}} }}
| rowclass37 = mergedrow
| label37 = {{{subdivision_type6}}}
| data37 = {{#if:{{{subdivision_type6|}}}|{{{subdivision_name6|}}} }}
<!--***Established*** -->
| rowclass38 = mergedtoprow
| label38 = {{if empty|{{{established_title|}}}|Established}}
| data38 = {{{established_date|}}}
| rowclass39 = mergedrow
| label39 = {{{established_title1}}}
| data39 = {{#if:{{{established_title1|}}}|{{{established_date1|}}} }}
| rowclass40 = mergedrow
| label40 = {{{established_title2}}}
| data40 = {{#if:{{{established_title2|}}}|{{{established_date2|}}} }}
| rowclass41 = mergedrow
| label41 = {{{established_title3}}}
| data41 = {{#if:{{{established_title3|}}}|{{{established_date3|}}} }}
| rowclass42 = mergedrow
| label42 = {{{established_title4}}}
| data42 = {{#if:{{{established_title4|}}}|{{{established_date4|}}} }}
| rowclass43 = mergedrow
| label43 = {{{established_title5}}}
| data43 = {{#if:{{{established_title5|}}}|{{{established_date5|}}} }}
| rowclass44 = mergedrow
| label44 = {{{established_title6}}}
| data44 = {{#if:{{{established_title6|}}}|{{{established_date6|}}} }}
| rowclass45 = mergedrow
| label45 = {{{established_title7}}}
| data45 = {{#if:{{{established_title7|}}}|{{{established_date7|}}} }}
| rowclass46 = mergedrow
| label46 = {{{extinct_title}}}
| data46 = {{#if:{{{extinct_title|}}}|{{{extinct_date|}}} }}
| rowclass47 = mergedrow
| label47 = Founded by
| data47 = {{{founder|}}}
| rowclass48 = mergedrow
| label48 = [[Namesake|Named after]]
| data48 = {{{named_for|}}}
<!-- ***Seat of government and subdivisions within the settlement*** -->
| rowclass49 = mergedtoprow
| label49 = {{if empty|{{{seat_type|}}}|Seat}}
| data49 = {{{seat|}}}
| rowclass50 = mergedrow
| label50 = {{if empty|{{{seat1_type|}}}|Former seat}}
| data50 = {{{seat1|}}}
| rowclass51 = mergedrow
| label51 = {{if empty|{{{seat2_type|}}}|Former seat}}
| data51 = {{{seat2|}}}
| rowclass52 = {{#if:{{{seat|}}}{{{seat1|}}}{{{seat2|}}}|mergedrow|mergedtoprow}}
| label52 = {{if empty|{{{parts_type|}}}|Boroughs}}
| data52 = {{#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*** -->
| rowclass53 = mergedtoprow
| header53 = {{#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*** -->
| rowclass54 = mergedrow
| label54 = • Type
| data54 = {{{government_type|}}}
| rowclass55 = mergedrow
| label55 = • Body
| class55 = agent
| data55 = {{{governing_body|}}}
| rowclass56 = mergedrow
| label56 = • {{{leader_title}}}
| data56 = {{#if:{{{leader_title|}}}|{{{leader_name|}}} {{#if:{{{leader_party|}}}|({{Polparty|{{{subdivision_name}}}|{{{leader_party}}}}})}}}}
| rowclass57 = mergedrow
| label57 = • {{{leader_title1}}}
| data57 = {{#if:{{{leader_title1|}}}|{{{leader_name1|}}}}}
| rowclass58 = mergedrow
| label58 = • {{{leader_title2}}}
| data58 = {{#if:{{{leader_title2|}}}|{{{leader_name2|}}}}}
| rowclass59 = mergedrow
| label59 = • {{{leader_title3}}}
| data59 = {{#if:{{{leader_title3|}}}|{{{leader_name3|}}}}}
| rowclass60 = mergedrow
| label60 = • {{{leader_title4}}}
| data60 = {{#if:{{{leader_title4|}}}|{{{leader_name4|}}}}}
| rowclass61 = mergedrow
| label61 = • {{{leader_title5}}}
| data61 = {{#if:{{{leader_title5|}}}|{{{leader_name5|}}}}}
| rowclass62 = mergedrow
| label62 = {{{government_blank1_title}}}
| data62 = {{#if:{{{government_blank1|}}}|{{{government_blank1|}}}}}
| rowclass63 = mergedrow
| label63 = {{{government_blank2_title}}}
| data63 = {{#if:{{{government_blank2|}}}|{{{government_blank2|}}}}}
| rowclass64 = mergedrow
| label64 = {{{government_blank3_title}}}
| data64 = {{#if:{{{government_blank3|}}}|{{{government_blank3|}}}}}
| rowclass65 = mergedrow
| label65 = {{{government_blank4_title}}}
| data65 = {{#if:{{{government_blank4|}}}|{{{government_blank4|}}}}}
| rowclass66 = mergedrow
| label66 = {{{government_blank5_title}}}
| data66 = {{#if:{{{government_blank5|}}}|{{{government_blank5|}}}}}
| rowclass67 = mergedrow
| label67 = {{{government_blank6_title}}}
| data67 = {{#if:{{{government_blank6|}}}|{{{government_blank6|}}}}}
<!-- ***Geographical characteristics*** -->
<!-- ***Area*** -->
| rowclass68 = mergedtoprow
| header68 = {{#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>
}}
}}
| rowclass69 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}|mergedtoprow|mergedrow}}
| label69 = <div style="white-space:nowrap;">{{#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|}}}|{{if empty|{{{settlement_type|}}}|{{{type}}}}}|City}}|Total}}}}
}}</div>
| data69 = {{#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}}}
}}}}
| rowclass70 = mergedrow
| label70 = • Land
| data70 = {{#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}}}
}}}}
| rowclass71 = mergedrow
| label71 = • Water
| data71 = {{#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}}}{{#ifeq:%|{{#invoke:string|sub|{{{area_water_percent|}}}|-1}}||%}}}}}}
| rowclass72 = mergedrow
| label72 = • Urban<div class="ib-settlement-fn">{{{area_urban_footnotes|}}}</div>
| data72 = {{#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}}}
}}}}
| rowclass73 = mergedrow
| label73 = • Rural<div class="ib-settlement-fn">{{{area_rural_footnotes|}}}</div>
| data73 = {{#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}}}
}}}}
| rowclass74 = mergedrow
| label74 = • Metro<div class="ib-settlement-fn">{{{area_metro_footnotes|}}}</div>
| data74 = {{#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*** -->
| rowclass75 = mergedrow
| label75 = • Rank
| data75 = {{{area_rank|}}}
| rowclass76 = mergedrow
| label76 = • {{{area_blank1_title}}}
| data76 = {{#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}}}
}}}}
| rowclass77 = mergedrow
| label77 = • {{{area_blank2_title}}}
| data77 = {{#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}}}
}}}}
| rowclass78 = mergedrow
| label78 =
| data78 = {{{area_note|}}}
<!-- ***Dimensions*** -->
| rowclass79 = mergedtoprow
| header79 = {{#if:{{{length_km|}}}{{{length_mi|}}}{{{width_km|}}}{{{width_mi|}}}|Dimensions<div class="ib-settlement-fn">{{{dimensions_footnotes|}}}</div>}}
| rowclass80 = mergedrow
| label80 = • Length
| data80 = {{#if:{{{length_km|}}}{{{length_mi|}}}
| {{infobox_settlement/lengthdisp
|km ={{{length_km|}}}
|mi ={{{length_mi|}}}
|pref={{{unit_pref|}}}
|name={{{subdivision_name}}}
}} }}
| rowclass81 = mergedrow
| label81 = • Width
| data81 = {{#if:{{{width_km|}}}{{{width_mi|}}}
|{{infobox_settlement/lengthdisp
|km ={{{width_km|}}}
|mi ={{{width_mi|}}}
|pref={{{unit_pref|}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation*** -->
| rowclass82 = mergedtoprow
| label82 = {{#if:{{{elevation_link|}}}|[[{{{elevation_link|}}}|Elevation]]|Elevation}}<div class="ib-settlement-fn">{{{elevation_footnotes|}}}{{#if:{{{elevation_point|}}}| ({{{elevation_point}}})}}</div>
| data82 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_m|}}}
|ft ={{{elevation_ft|}}}
|pref={{{unit_pref|}}}
|name={{{subdivision_name}}}
}} }}
| rowclass83 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}|mergedrow|mergedtoprow}}
| label83 = Highest elevation<div class="ib-settlement-fn">{{{elevation_max_footnotes|}}}{{#if:{{{elevation_max_point|}}}| ({{{elevation_max_point}}})}}</div>
| data83 = {{#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*** -->
| rowclass84 = mergedrow
| label84 = • Rank
| data84 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}| {{{elevation_max_rank|}}} }}
| rowclass85 = {{#if:{{{elevation_min_rank|}}}|mergedrow|mergedbottomrow}}
| label85 = Lowest elevation<div class="ib-settlement-fn">{{{elevation_min_footnotes|}}}{{#if:{{{elevation_min_point|}}}| ({{{elevation_min_point}}})}}</div>
| data85 = {{#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*** -->
| rowclass86 = mergedrow
| label86 = • Rank
| data86 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}|{{{elevation_min_rank|}}}}}
<!-- ***Population*** -->
| rowclass87 = mergedtoprow
| label87 = Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
| data87 = {{fix comma category|{{#ifeq:{{{total_type}}}|
| {{#if:{{{population_total|}}}
| {{formatnum:{{replace|{{{population_total}}}|,|}}}}
}}
}}
}}
| rowclass88 = mergedtoprow
| header88 ={{#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>
}}
}}
| rowclass89 = mergedrow
| label89 = <div style="white-space:nowrap;"> • {{#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|}}}|{{if empty|{{{settlement_type|}}}|{{{type}}}}}|City}}|Total}}}}</div>
| data89 = {{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}
| {{fix comma category|{{formatnum:{{replace|{{{population_total}}}|,|}}}}}}
}}
}}
| rowclass90 = mergedrow
| label90 = <div style="white-space:nowrap;"> • Estimate {{#if:{{{pop_est_as_of|}}}|<div class="ib-settlement-fn">({{{pop_est_as_of}}}){{{pop_est_footnotes|}}}</div>}}</div>
| data90 = {{#if:{{{population_est|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_est}}}|,|}}}}}} }}
<!-- ***Population rank*** -->
| rowclass91 = mergedrow
| label91 = • Rank
| data91 = {{{population_rank|}}}
| rowclass92 = mergedrow
| label92 = • Density
| data92 = {{#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={{if empty|{{{area_land_dunam|}}}|{{{area_total_dunam|}}}}}
|ha ={{if empty|{{{area_land_ha|}}}|{{{area_total_ha|}}}}}
|km2 ={{if empty|{{{area_land_km2|}}}|{{{area_total_km2|}}}}}
|acre ={{if empty|{{{area_land_acre|}}}|{{{area_total_acre|}}}}}
|sqmi ={{if empty|{{{area_land_sq_mi|}}}|{{{area_total_sq_mi|}}}}}
|pref ={{{unit_pref|}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Population density rank*** -->
| rowclass93 = mergedrow
| label93 = • Rank
| data93 = {{{population_density_rank|}}}
| rowclass94 = mergedrow
| label94 = • [[Urban area|Urban]]<div class="ib-settlement-fn">{{{population_urban_footnotes|}}}</div>
| data94 = {{#if:{{{population_urban|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_urban}}}|,|}}}}}} }}
| rowclass95 = mergedrow
| label95 = • Urban density
| data95 = {{#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}}}
}}}}
| rowclass96 = mergedrow
| label96 = • [[Rural area|Rural]]<div class="ib-settlement-fn">{{{population_rural_footnotes|}}}</div>
| data96 = {{#if:{{{population_rural|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_rural}}}|,|}}}}}}}}
| rowclass97 = mergedrow
| label97 = • Rural density
| data97 = {{#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}}}
}}}}
| rowclass98 = mergedrow
| label98 = • [[Metropolitan area|Metro]]<div class="ib-settlement-fn">{{{population_metro_footnotes|}}}</div>
| data98 = {{#if:{{{population_metro|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_metro}}}|,|}}}}}} }}
| rowclass99 = mergedrow
| label99 = • Metro density
| data99 = {{#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}}}
}}}}
| rowclass100 = mergedrow
| label100 = • {{{population_blank1_title|}}}<div class="ib-settlement-fn">{{{population_blank1_footnotes|}}}</div>
| data100 = {{#if:{{{population_blank1|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank1}}}|,|}}}}}}}}
| rowclass101 = mergedrow
| label101 = • {{#if:{{{population_blank1_title|}}}|{{{population_blank1_title}}} density|Density}}
| data101 = {{#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}}}
}}}}
| rowclass102 = mergedrow
| label102 = • {{{population_blank2_title|}}}<div class="ib-settlement-fn">{{{population_blank2_footnotes|}}}</div>
| data102 = {{#if:{{{population_blank2|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank2}}}|,|}}}}}}}}
| rowclass103 = mergedrow
| label103 = • {{#if:{{{population_blank2_title|}}}|{{{population_blank2_title}}} density|Density}}
| data103 = {{#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}}}
}}}}
| rowclass104 = mergedrow
| label104 =
| data104 = {{{population_note|}}}
| rowclass105 = mergedtoprow
| label105 = {{Pluralize from text|{{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}{{force plural}}}}|<!--
-->link=Demonym|singular=Demonym|likely=Demonym(s)|plural=Demonyms}}
| data105 = {{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}}}{{Main other|{{Pluralize from text|{{{population_demonym|}}}|likely=[[Category:Pages using infobox settlement with possible demonym list]]}}}}
<!-- ***Demographics 1*** -->
| rowclass106 = mergedtoprow
| header106 = {{#if:{{{demographics_type1|}}}
|{{{demographics_type1}}}<div class="ib-settlement-fn">{{{demographics1_footnotes|}}}</div>}}
| rowclass107 = mergedrow
| label107 = • {{{demographics1_title1}}}
| data107 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title1|}}}|{{{demographics1_info1|}}}}}}}
| rowclass108 = mergedrow
| label108 = • {{{demographics1_title2}}}
| data108 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title2|}}}|{{{demographics1_info2|}}}}}}}
| rowclass109 = mergedrow
| label109 = • {{{demographics1_title3}}}
| data109 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title3|}}}|{{{demographics1_info3|}}}}}}}
| rowclass110 = mergedrow
| label110 = • {{{demographics1_title4}}}
| data110 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title4|}}}|{{{demographics1_info4|}}}}}}}
| rowclass111 = mergedrow
| label111 = • {{{demographics1_title5}}}
| data111 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title5|}}}|{{{demographics1_info5|}}}}}}}
| rowclass112 = mergedrow
| label112 = • {{{demographics1_title6}}}
| data112 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title6|}}}|{{{demographics1_info6|}}}}}}}
| rowclass113 = mergedrow
| label113 = • {{{demographics1_title7}}}
| data113 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title7|}}}|{{{demographics1_info7|}}}}}}}
| rowclass114 = mergedrow
| label114 = • {{{demographics1_title8}}}
| data114 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title8|}}}|{{{demographics1_info8|}}}}}}}
| rowclass115 = mergedrow
| label115 = • {{{demographics1_title9}}}
| data115 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title9|}}}|{{{demographics1_info9|}}}}}}}
| rowclass116 = mergedrow
| label116 = • {{{demographics1_title10}}}
| data116 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title10|}}}|{{{demographics1_info10|}}}}}}}
<!-- ***Demographics 2*** -->
| rowclass117 = mergedtoprow
| header117 = {{#if:{{{demographics_type2|}}}
|{{{demographics_type2}}}<div class="ib-settlement-fn">{{{demographics2_footnotes|}}}</div>}}
| rowclass118 = mergedrow
| label118 = • {{{demographics2_title1}}}
| data118 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title1|}}}|{{{demographics2_info1|}}}}}}}
| rowclass119 = mergedrow
| label119 = • {{{demographics2_title2}}}
| data119 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title2|}}}|{{{demographics2_info2|}}}}}}}
| rowclass120 = mergedrow
| label120 = • {{{demographics2_title3}}}
| data120 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title3|}}}|{{{demographics2_info3|}}}}}}}
| rowclass121 = mergedrow
| label121 = • {{{demographics2_title4}}}
| data121 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title4|}}}|{{{demographics2_info4|}}}}}}}
| rowclass122 = mergedrow
| label122 = • {{{demographics2_title5}}}
| data122 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title5|}}}|{{{demographics2_info5|}}}}}}}
| rowclass123 = mergedrow
| label123 = • {{{demographics2_title6}}}
| data123 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title6|}}}|{{{demographics2_info6|}}}}}}}
| rowclass124 = mergedrow
| label124 = • {{{demographics2_title7}}}
| data124 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title7|}}}|{{{demographics2_info7|}}}}}}}
| rowclass125 = mergedrow
| label125 = • {{{demographics2_title8}}}
| data125 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title8|}}}|{{{demographics2_info8|}}}}}}}
| rowclass126 = mergedrow
| label126 = • {{{demographics2_title9}}}
| data126 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title9|}}}|{{{demographics2_info9|}}}}}}}
| rowclass127 = mergedrow
| label127 = • {{{demographics2_title10}}}
| data127 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title10|}}}|{{{demographics2_info10|}}}}}}}
<!-- ***Time Zones*** -->
| rowclass128 = mergedtoprow
| header128 = {{#if:{{{timezone1_location|}}}|{{#if:{{{timezone2|}}}|[[{{if empty|{{{timezone_link|}}}|Time zone}}|Time zone]]s|[[{{if empty|{{{timezone_link|}}}|Time zone}}|Time zone]]}}|}}
| rowclass129 = {{#if:{{{timezone1_location|}}}|mergedrow|mergedtoprow}}
| label129 = {{#if:{{{timezone1_location|}}}|{{{timezone1_location}}}|{{#if:{{{timezone2_location|}}}|{{{timezone2_location}}}|{{#if:{{{timezone2|}}}|[[{{if empty|{{{timezone_link|}}}|Time zone}}|Time zone]]s|[[{{if empty|{{{timezone_link|}}}|Time zone}}|Time zone]]}}}}}}
| data129 = {{#if:{{{utc_offset1|}}}{{{utc_offset|}}}
|[[UTC{{if empty|{{{utc_offset1|}}}|{{{utc_offset}}}}}]] {{#if:{{{timezone1|}}}{{{timezone|}}}|({{if empty|{{{timezone1|}}}|{{{timezone}}}}})}}
|{{if empty|{{{timezone1|}}}|{{{timezone|}}}}}
}}
| rowclass130 = mergedrow
| label130 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data130 = {{#if:{{{utc_offset1_DST|}}}{{{utc_offset_DST|}}}
|[[UTC{{if empty|{{{utc_offset1_DST|}}}|{{{utc_offset_DST|}}}}}]] {{#if:{{{timezone1_DST|}}}{{{timezone_DST|}}}|({{if empty|{{{timezone1_DST|}}}|{{{timezone_DST}}}}})}}
|{{if empty|{{{timezone1_DST|}}}|{{{timezone_DST|}}}}}
}}
| rowclass131 = mergedrow
| label131 = {{if empty|{{{timezone2_location|}}}|<nowiki />}}
| data131 = {{#if:{{{timezone1|}}}{{{timezone|}}}{{{utc_offset1|}}}{{{utc_offset|}}}
|{{#if:{{{utc_offset2|}}}
|[[UTC{{{utc_offset2|}}}]] {{#if:{{{timezone2|}}}|({{{timezone2}}})}}
|{{{timezone2|}}}
}}
}}
| rowclass132 = mergedrow
| label132 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data132 = {{#if:{{{utc_offset2_DST|}}}|[[UTC{{{utc_offset2_DST|}}}]] {{#if:{{{timezone2_DST|}}}|({{{timezone2_DST|}}})}}
|{{{timezone2_DST|}}}
}}
| rowclass133 = mergedrow
| label133 = {{if empty|{{{timezone3_location|}}}|<nowiki />}}
| data133 = {{#if:{{{timezone1|}}}{{{timezone|}}}{{{utc_offset1|}}}{{{utc_offset|}}}
|{{#if:{{{utc_offset3|}}}
|[[UTC{{{utc_offset3|}}}]] {{#if:{{{timezone3|}}}|({{{timezone3}}})}}
|{{{timezone3|}}}
}}
}}
| rowclass134 = mergedrow
| label134 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data134 = {{#if:{{{utc_offset3_DST|}}}|[[UTC{{{utc_offset3_DST|}}}]] {{#if:{{{timezone3_DST|}}}|({{{timezone3_DST|}}})}}
|{{{timezone3_DST|}}}
}}
| rowclass135 = mergedrow
| label135 = {{if empty|{{{timezone4_location|}}}|<nowiki />}}
| data135 = {{#if:{{{timezone1|}}}{{{timezone|}}}{{{utc_offset1|}}}{{{utc_offset|}}}
|{{#if:{{{utc_offset4|}}}
|[[UTC{{{utc_offset4|}}}]] {{#if:{{{timezone4|}}}|({{{timezone4}}})}}
|{{{timezone4|}}}
}}
}}
| rowclass136 = mergedrow
| label136 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data136 = {{#if:{{{utc_offset4_DST|}}}|[[UTC{{{utc_offset4_DST|}}}]] {{#if:{{{timezone4_DST|}}}|({{{timezone4_DST|}}})}}
|{{{timezone4_DST|}}}
}}
| rowclass137 = mergedrow
| label137 = {{if empty|{{{timezone5_location|}}}|<nowiki />}}
| data137 = {{#if:{{{timezone1|}}}{{{timezone|}}}{{{utc_offset1|}}}{{{utc_offset|}}}
|{{#if:{{{utc_offset5|}}}
|[[UTC{{{utc_offset5|}}}]] {{#if:{{{timezone5|}}}|({{{timezone5}}})}}
|{{{timezone5|}}}
}}
}}
| rowclass138 = mergedrow
| label138 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data138 = {{#if:{{{utc_offset5_DST|}}}|[[UTC{{{utc_offset5_DST|}}}]] {{#if:{{{timezone5_DST|}}}|({{{timezone5_DST|}}})}}
|{{{timezone5_DST|}}}
}}
<!-- ***Postal Code(s)*** -->
| rowclass139 = mergedtoprow
| label139 = {{if empty|{{{postal_code_type|}}}|{{Pluralize from text|any_comma=1|parse_links=1|{{{postal_code|}}}|link=Postal code|singular=Postal code|plural=Postal codes}}}}
| class139 = adr
| data139 = {{#if:{{{postal_code|}}}|<div class="postal-code">{{{postal_code}}}</div>}}
| rowclass140 = {{#if:{{{postal_code|}}}|mergedbottomrow|mergedtoprow}}
| label140 = {{if empty|{{{postal2_code_type|}}}|{{Pluralize from text|any_comma=1|parse_links=1|{{{postal2_code|}}}|link=Postal code|singular=Postal code|plural=Postal codes}}}}
| class140 = adr
| data140 = {{#if:{{{postal2_code|}}}|<div class="postal-code">{{{postal2_code}}}</div>}}
<!-- ***Area Code(s)*** -->
| rowclass141 = {{#if:{{{postal_code|}}}{{{postal2_code|}}}|mergedrow|mergedtoprow}}
| label141 = {{if empty|{{{area_code_type|}}}|{{Pluralize from text|any_comma=1|parse_links=1|{{if empty|{{{area_code|}}}|{{{area_codes|}}}{{force plural}}}}|<!--
-->link=Telephone numbering plan|singular=Area code|likely=Area code(s)|plural=Area codes}}}}
| data141 = {{if empty|{{{area_code|}}}|{{{area_codes|}}}}}{{#if:{{{area_code_type|}}}||{{Main other|{{Pluralize from text|any_comma=1|parse_links=1|{{{area_code|}}}|||[[Category:Pages using infobox settlement with possible area code list]]}}}}}}
<!-- Geocode-->
| rowclass142 = {{#if:{{{postal_code|}}}{{{postal2_code|}}}{{{area_code|}}}|mergedrow|mergedtoprow}}
| label142 = [[Geocode]]
| class142 = nickname
| data142 = {{{geocode|}}}
<!-- ISO Code-->
| rowclass143 = {{#if:{{{postal_code|}}}{{{postal2_code|}}}{{{area_code|}}}{{{geocode|}}}|mergedrow|mergedtoprow}}
| label143 = [[ISO 3166|ISO 3166 code]]
| class143 = nickname
| data143 = {{{iso_code|}}}
<!-- Vehicle registration plate-->
| rowclass144 = {{#if:{{{postal_code|}}}{{{postal2_code|}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|mergedrow|mergedtoprow}}
| label144 = {{if empty|{{{registration_plate_type|}}}|[[Vehicle registration plate|Vehicle registration]]}}
| data144 = {{{registration_plate|}}}
<!-- Other codes -->
| rowclass145 = {{#if:{{{postal_code|}}}{{{postal2_code|}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}{{{registration_plate|}}}|mergedrow|mergedtoprow}}
| label145 = {{{code1_name|}}}
| class145 = nickname
| data145 = {{#if:{{{code1_name|}}}|{{{code1_info|}}}}}
| rowclass146 = {{#if:{{{postal_code|}}}{{{postal2_code|}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}{{{registration_plate|}}}{{{code1_name|}}}|mergedrow|mergedtoprow}}
| label146 = {{{code2_name|}}}
| class146 = nickname
| data146 = {{#if:{{{code2_name|}}}|{{{code2_info|}}}}}
<!-- ***Blank Fields (two sections)*** -->
| rowclass147 = mergedtoprow
| label147 = {{if empty|{{{blank_name_sec1|}}}|{{{blank_name|}}}}}
| data147 = {{#if:{{{blank_name_sec1|}}}{{{blank_name|}}}|{{if empty|{{{blank_info_sec1|}}}|{{{blank_info|}}}}}}}
| rowclass148 = mergedrow
| label148 = {{if empty|{{{blank1_name_sec1|}}}|{{{blank1_name|}}}}}
| data148 = {{#if:{{{blank1_name_sec1|}}}{{{blank1_name|}}}|{{if empty|{{{blank1_info_sec1|}}}|{{{blank1_info|}}}}}}}
| rowclass149 = mergedrow
| label149 = {{if empty|{{{blank2_name_sec1|}}}|{{{blank2_name|}}}}}
| data149 = {{#if:{{{blank2_name_sec1|}}}{{{blank2_name|}}}|{{if empty|{{{blank2_info_sec1|}}}|{{{blank2_info|}}}}}}}
| rowclass150 = mergedrow
| label150 = {{if empty|{{{blank3_name_sec1|}}}|{{{blank3_name|}}}}}
| data150 = {{#if:{{{blank3_name_sec1|}}}{{{blank3_name|}}}|{{if empty|{{{blank3_info_sec1|}}}|{{{blank3_info|}}}}}}}
| rowclass151 = mergedrow
| label151 = {{if empty|{{{blank4_name_sec1|}}}|{{{blank4_name|}}}}}
| data151 = {{#if:{{{blank4_name_sec1|}}}{{{blank4_name|}}}|{{if empty|{{{blank4_info_sec1|}}}|{{{blank4_info|}}}}}}}
| rowclass152 = mergedrow
| label152 = {{if empty|{{{blank5_name_sec1|}}}|{{{blank5_name|}}}}}
| data152 = {{#if:{{{blank5_name_sec1|}}}{{{blank5_name|}}}|{{if empty|{{{blank5_info_sec1|}}}|{{{blank5_info|}}}}}}}
| rowclass153 = mergedrow
| label153 = {{if empty|{{{blank6_name_sec1|}}}|{{{blank6_name|}}}}}
| data153 = {{#if:{{{blank6_name_sec1|}}}{{{blank6_name|}}}|{{if empty|{{{blank6_info_sec1|}}}|{{{blank6_info|}}}}}}}
| rowclass154 = mergedrow
| label154 = {{if empty|{{{blank7_name_sec1|}}}|{{{blank7_name|}}}}}
| data154 = {{#if:{{{blank7_name_sec1|}}}{{{blank7_name|}}}|{{if empty|{{{blank7_info_sec1|}}}|{{{blank7_info|}}}}}}}
| rowclass155 = mergedtoprow
| label155 = {{{blank_name_sec2}}}
| data155 = {{#if:{{{blank_name_sec2|}}}|{{{blank_info_sec2|}}}}}
| rowclass156 = mergedrow
| label156 = {{{blank1_name_sec2}}}
| data156 = {{#if:{{{blank1_name_sec2|}}}|{{{blank1_info_sec2|}}}}}
| rowclass157 = mergedrow
| label157 = {{{blank2_name_sec2}}}
| data157 = {{#if:{{{blank2_name_sec2|}}}|{{{blank2_info_sec2|}}}}}
| rowclass158 = mergedrow
| label158 = {{{blank3_name_sec2}}}
| data158 = {{#if:{{{blank3_name_sec2|}}}|{{{blank3_info_sec2|}}}}}
| rowclass159 = mergedrow
| label159 = {{{blank4_name_sec2}}}
| data159 = {{#if:{{{blank4_name_sec2|}}}|{{{blank4_info_sec2|}}}}}
| rowclass160 = mergedrow
| label160 = {{{blank5_name_sec2}}}
| data160 = {{#if:{{{blank5_name_sec2|}}}|{{{blank5_info_sec2|}}}}}
| rowclass161 = mergedrow
| label161 = {{{blank6_name_sec2}}}
| data161 = {{#if:{{{blank6_name_sec2|}}}|{{{blank6_info_sec2|}}}}}
| rowclass162 = mergedrow
| label162 = {{{blank7_name_sec2}}}
| data162 = {{#if:{{{blank7_name_sec2|}}}|{{{blank7_info_sec2|}}}}}
<!-- ***Website*** -->
| rowclass163 = mergedtoprow
| label163 = Website
| data163 = {{#if:{{{website|}}}|{{{website}}}}}
| class164 = maptable
| data164 = {{#if:{{{module|}}}|{{{module}}}}}
<!-- ***Footnotes*** -->
| belowrowclass = mergedtoprow
| below = {{{footnotes|}}}
}}<!-- Check for unknowns
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using {{if empty|{{lcfirst:{{{template_name|}}}}}|infobox settlement}} with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview = Page using [[Template:{{if empty|{{ucfirst:{{{template_name|}}}}}|Infobox settlement}}]] with unknown parameter "_VALUE_"|ignoreblank=y|mapframe_args=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_emblem_upright
| 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 | image_upright
| iso_code | leader_name | leader_name1 | leader_name2 | leader_name3 | leader_name4 | leader_name5 | leader_party | leader_title | leader_title1 | leader_title2 | leader_title3 | leader_title4 | leader_title5 | 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_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_class | 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 <!--used by Module:Settlement 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 | template_name | 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 conflicting parameters|check
| template = [[Template:{{if empty|{{ucfirst:{{{template_name|}}}}}|Infobox settlement}}]]
| cat = {{main other|Category:Pages using {{if empty|{{lcfirst:{{{template_name|}}}}}|infobox settlement}} with conflicting parameters}}
| settlement_type; type
| image_size; imagesize
| image_alt; alt
| image_caption; caption
| nickname; nicknames
| motto; mottoes
| coor_pinpoint; coor_type
| population_demonym; population_demonyms
| utc_offset1; utc_offset
| timezone1; timezone
| utc_offset1_DST; utc_offset_DST
| timezone1_DST; timezone_DST
| area_code; area_codes
| blank_name_sec1; blank_name
| blank_info_sec1; blank_info
| blank1_name_sec1; blank1_name
| blank1_info_sec1; blank1_info
| blank2_name_sec1; blank2_name
| blank2_info_sec1; blank2_info
| blank3_name_sec1; blank3_name
| blank3_info_sec1; blank3_info
| blank4_name_sec1; blank4_name
| blank4_info_sec1; blank4_info
| blank5_name_sec1; blank5_name
| blank5_info_sec1; blank5_info
| blank6_name_sec1; blank6_name
| blank6_info_sec1; blank6_info
| blank7_name_sec1; blank7_name
| blank7_info_sec1; blank7_info
}}<!-- 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:{{{embed|}}}|[[Category:Pages using infobox settlement with embed]]}}
}}<!-- Gathering information on over-use of maps
-->{{#ifexpr:{{#invoke:ParameterCount|main|mapframe|image_map|image_map1|pushpin_map}} >2 |{{main other| [[Category:Pages using infobox settlement with potentially too many maps]]}}}}</includeonly><noinclude>
{{documentation}}
<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
</noinclude>
n6yyp8zqth6s1mc2oh3mku5ztahzgu7
37019639
37019565
2026-05-01T16:07:28Z
Exec8
10305
37019639
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">{{if empty|{{{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|upright={{{image_upright|}}}<!--
-->|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 empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}}}<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 empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}|class={{{seal_class|}}}}}<div class="ib-settlement-caption-link">{{Infobox settlement/link|type={{if empty|{{{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 empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}}}<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}}|upright={{{blank_emblem_upright|}}}|alt={{{blank_emblem_alt|}}}|title=Official logo of {{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}}}<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 empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}}}}}}{{#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 empty|{{{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 empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}}} }}
|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|}}}{{{nicknames|}}}|<!--
-->{{Pluralize from text|parse_links=1|{{if empty|{{{nickname|}}}|{{{nicknames|}}}{{force plural}}}}|<!--
-->link={{{nickname_link|}}}|singular=Nickname|likely=Nickname(s)|plural=Nicknames}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{nickname|}}}|{{{nicknames|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|parse_links=1|{{{nickname|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible nickname list]]}}}}}}
<!-- ***Motto*** -->
| rowclass22 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{nicknames|}}}|mergedrow|mergedtoprow}}
| data22 = {{#if:{{{motto|}}}{{{mottoes|}}}|<!--
-->{{Pluralize from text|{{if empty|{{{motto|}}}|{{{mottoes|}}}{{force plural}}}}|<!--
-->link={{{motto_link|}}}|singular=Motto|likely=Motto(s)|plural=Mottoes}}: <!--
--><div class="ib-settlement-nickname nickname">{{if empty|{{{motto|}}}|{{{mottoes|}}}}}</div><!--
-->{{Main other|{{Pluralize from text|{{{motto|}}}|<!--
-->likely=[[Category:Pages using infobox settlement with possible motto list]]}}}}}}
<!-- ***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|upright={{{image_upright|}}}|alt={{{map_alt|}}}|title={{{map_caption|Location of {{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}}}}}}{{#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|upright={{{image_upright|}}}|alt={{{map_alt1|}}}|title={{{map_caption1|Location of {{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}}}}}}{{#if:{{{map_caption1|}}}|<div class="ib-settlement-caption">{{{map_caption1}}}</div>}} }}
| data26 = {{#invoke:Infobox mapframe
| autoWithCaption
| onByDefault = {{#if:{{{pushpin_map|}}}{{{image_map|}}}{{{image_map1|}}}|no|yes}}
| mapframe-frame-width = 250
| mapframe-stroke-width = 2
| mapframe-length_km = {{{length_km|}}}
| mapframe-length_mi = {{{length_mi|}}}
| mapframe-width_km = {{{width_km|}}}
| mapframe-width_mi = {{{width_mi|}}}
| mapframe-area_km2 = {{{area_total_km2|}}}
| mapframe-area_ha = {{{area_total_ha|}}}
| mapframe-area_acre = {{{area_total_acre|}}}
| mapframe-area_sq_mi = {{{area_total_sq_mi|}}}
| mapframe-type = city
| mapframe-population = {{if empty|{{{population_metro|}}}|{{{population_total|}}}}}
| mapframe-marker = town
| mapframe-wikidata = yes
| mapframe-caption = Interactive map of {{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}
}}
<!-- ***Pushpin Map*** -->
| rowclass28 = mergedtoprow
| data28 = {{#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 empty|{{{name|}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
<!-- ***Coordinates*** -->
| data29 = {{#if:{{{coordinates|}}}|{{#if:{{#invoke:string|match|s={{{coordinates|}}}|pattern=geo-inline-hidden|ignore_errors=true|plain=true}}|<!-- Nothing to display -->
|Coordinates{{#if:{{{coor_pinpoint|}}}{{{coor_type|}}}| ({{if empty|{{{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|}}} }}}}
| rowclass30 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|mergedbottomrow|mergedrow}}
| label30 = {{if empty|{{{grid_name|}}}|Grid position}}
| data30 = {{{grid_position|}}}
<!-- ***Subdivisions*** -->
| rowclass31 = mergedtoprow
| label31 = {{{subdivision_type}}}
| data31 = {{#if:{{{subdivision_type|}}}|{{{subdivision_name|}}} }}
| rowclass32 = mergedrow
| label32 = {{{subdivision_type1}}}
| data32 = {{#if:{{{subdivision_type1|}}}|{{{subdivision_name1|}}} }}
| rowclass33 = mergedrow
| label33 = {{{subdivision_type2}}}
| data33 = {{#if:{{{subdivision_type2|}}}|{{{subdivision_name2|}}} }}
| rowclass34 = mergedrow
| label34 = {{{subdivision_type3}}}
| data34 = {{#if:{{{subdivision_type3|}}}|{{{subdivision_name3|}}} }}
| rowclass35 = mergedrow
| label35 = {{{subdivision_type4}}}
| data35 = {{#if:{{{subdivision_type4|}}}|{{{subdivision_name4|}}} }}
| rowclass36 = mergedrow
| label36 = {{{subdivision_type5}}}
| data36 = {{#if:{{{subdivision_type5|}}}|{{{subdivision_name5|}}} }}
| rowclass37 = mergedrow
| label37 = {{{subdivision_type6}}}
| data37 = {{#if:{{{subdivision_type6|}}}|{{{subdivision_name6|}}} }}
<!--***Established*** -->
| rowclass38 = mergedtoprow
| label38 = {{if empty|{{{established_title|}}}|Established}}
| data38 = {{{established_date|}}}
| rowclass39 = mergedrow
| label39 = {{{established_title1}}}
| data39 = {{#if:{{{established_title1|}}}|{{{established_date1|}}} }}
| rowclass40 = mergedrow
| label40 = {{{established_title2}}}
| data40 = {{#if:{{{established_title2|}}}|{{{established_date2|}}} }}
| rowclass41 = mergedrow
| label41 = {{{established_title3}}}
| data41 = {{#if:{{{established_title3|}}}|{{{established_date3|}}} }}
| rowclass42 = mergedrow
| label42 = {{{established_title4}}}
| data42 = {{#if:{{{established_title4|}}}|{{{established_date4|}}} }}
| rowclass43 = mergedrow
| label43 = {{{established_title5}}}
| data43 = {{#if:{{{established_title5|}}}|{{{established_date5|}}} }}
| rowclass44 = mergedrow
| label44 = {{{established_title6}}}
| data44 = {{#if:{{{established_title6|}}}|{{{established_date6|}}} }}
| rowclass45 = mergedrow
| label45 = {{{established_title7}}}
| data45 = {{#if:{{{established_title7|}}}|{{{established_date7|}}} }}
| rowclass46 = mergedrow
| label46 = {{{extinct_title}}}
| data46 = {{#if:{{{extinct_title|}}}|{{{extinct_date|}}} }}
| rowclass47 = mergedrow
| label47 = Founded by
| data47 = {{{founder|}}}
| rowclass48 = mergedrow
| label48 = [[Namesake|Named after]]
| data48 = {{{named_for|}}}
<!-- ***Seat of government and subdivisions within the settlement*** -->
| rowclass49 = mergedtoprow
| label49 = {{if empty|{{{seat_type|}}}|Seat}}
| data49 = {{{seat|}}}
| rowclass50 = mergedrow
| label50 = {{if empty|{{{seat1_type|}}}|Former seat}}
| data50 = {{{seat1|}}}
| rowclass51 = mergedrow
| label51 = {{if empty|{{{seat2_type|}}}|Former seat}}
| data51 = {{{seat2|}}}
| rowclass52 = {{#if:{{{seat|}}}{{{seat1|}}}{{{seat2|}}}|mergedrow|mergedtoprow}}
| label52 = {{if empty|{{{parts_type|}}}|Boroughs}}
| data52 = {{#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*** -->
| rowclass53 = mergedtoprow
| header53 = {{#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*** -->
| rowclass54 = mergedrow
| label54 = • Type
| data54 = {{{government_type|}}}
| rowclass55 = mergedrow
| label55 = • Body
| class55 = agent
| data55 = {{{governing_body|}}}
| rowclass56 = mergedrow
| label56 = • {{{leader_title}}}
| data56 = {{#if:{{{leader_title|}}}|{{{leader_name|}}} {{#if:{{{leader_party|}}}|({{Polparty|{{{subdivision_name}}}|{{{leader_party}}}}})}}}}
| rowclass57 = mergedrow
| label57 = • {{{leader_title1}}}
| data57 = {{#if:{{{leader_title1|}}}|{{{leader_name1|}}}}}
| rowclass58 = mergedrow
| label58 = • {{{leader_title2}}}
| data58 = {{#if:{{{leader_title2|}}}|{{{leader_name2|}}}}}
| rowclass59 = mergedrow
| label59 = • {{{leader_title3}}}
| data59 = {{#if:{{{leader_title3|}}}|{{{leader_name3|}}}}}
| rowclass60 = mergedrow
| label60 = • {{{leader_title4}}}
| data60 = {{#if:{{{leader_title4|}}}|{{{leader_name4|}}}}}
| rowclass61 = mergedrow
| label61 = • {{{leader_title5}}}
| data61 = {{#if:{{{leader_title5|}}}|{{{leader_name5|}}}}}
| rowclass62 = mergedrow
| label62 = {{{government_blank1_title}}}
| data62 = {{#if:{{{government_blank1|}}}|{{{government_blank1|}}}}}
| rowclass63 = mergedrow
| label63 = {{{government_blank2_title}}}
| data63 = {{#if:{{{government_blank2|}}}|{{{government_blank2|}}}}}
| rowclass64 = mergedrow
| label64 = {{{government_blank3_title}}}
| data64 = {{#if:{{{government_blank3|}}}|{{{government_blank3|}}}}}
| rowclass65 = mergedrow
| label65 = {{{government_blank4_title}}}
| data65 = {{#if:{{{government_blank4|}}}|{{{government_blank4|}}}}}
| rowclass66 = mergedrow
| label66 = {{{government_blank5_title}}}
| data66 = {{#if:{{{government_blank5|}}}|{{{government_blank5|}}}}}
| rowclass67 = mergedrow
| label67 = {{{government_blank6_title}}}
| data67 = {{#if:{{{government_blank6|}}}|{{{government_blank6|}}}}}
<!-- ***Geographical characteristics*** -->
<!-- ***Area*** -->
| rowclass68 = mergedtoprow
| header68 = {{#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>
}}
}}
| rowclass69 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}|mergedtoprow|mergedrow}}
| label69 = <div style="white-space:nowrap;">{{#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|}}}|{{if empty|{{{settlement_type|}}}|{{{type}}}}}|City}}|Total}}}}
}}</div>
| data69 = {{#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}}}
}}}}
| rowclass70 = mergedrow
| label70 = • Land
| data70 = {{#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}}}
}}}}
| rowclass71 = mergedrow
| label71 = • Water
| data71 = {{#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}}}{{#ifeq:%|{{#invoke:string|sub|{{{area_water_percent|}}}|-1}}||%}}}}}}
| rowclass72 = mergedrow
| label72 = • Urban<div class="ib-settlement-fn">{{{area_urban_footnotes|}}}</div>
| data72 = {{#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}}}
}}}}
| rowclass73 = mergedrow
| label73 = • Rural<div class="ib-settlement-fn">{{{area_rural_footnotes|}}}</div>
| data73 = {{#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}}}
}}}}
| rowclass74 = mergedrow
| label74 = • Metro<div class="ib-settlement-fn">{{{area_metro_footnotes|}}}</div>
| data74 = {{#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*** -->
| rowclass75 = mergedrow
| label75 = • Rank
| data75 = {{{area_rank|}}}
| rowclass76 = mergedrow
| label76 = • {{{area_blank1_title}}}
| data76 = {{#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}}}
}}}}
| rowclass77 = mergedrow
| label77 = • {{{area_blank2_title}}}
| data77 = {{#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}}}
}}}}
| rowclass78 = mergedrow
| label78 =
| data78 = {{{area_note|}}}
<!-- ***Dimensions*** -->
| rowclass79 = mergedtoprow
| header79 = {{#if:{{{length_km|}}}{{{length_mi|}}}{{{width_km|}}}{{{width_mi|}}}|Dimensions<div class="ib-settlement-fn">{{{dimensions_footnotes|}}}</div>}}
| rowclass80 = mergedrow
| label80 = • Length
| data80 = {{#if:{{{length_km|}}}{{{length_mi|}}}
| {{infobox_settlement/lengthdisp
|km ={{{length_km|}}}
|mi ={{{length_mi|}}}
|pref={{{unit_pref|}}}
|name={{{subdivision_name}}}
}} }}
| rowclass81 = mergedrow
| label81 = • Width
| data81 = {{#if:{{{width_km|}}}{{{width_mi|}}}
|{{infobox_settlement/lengthdisp
|km ={{{width_km|}}}
|mi ={{{width_mi|}}}
|pref={{{unit_pref|}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation*** -->
| rowclass82 = mergedtoprow
| label82 = {{#if:{{{elevation_link|}}}|[[{{{elevation_link|}}}|Elevation]]|Elevation}}<div class="ib-settlement-fn">{{{elevation_footnotes|}}}{{#if:{{{elevation_point|}}}| ({{{elevation_point}}})}}</div>
| data82 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_m|}}}
|ft ={{{elevation_ft|}}}
|pref={{{unit_pref|}}}
|name={{{subdivision_name}}}
}} }}
| rowclass83 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}|mergedrow|mergedtoprow}}
| label83 = Highest elevation<div class="ib-settlement-fn">{{{elevation_max_footnotes|}}}{{#if:{{{elevation_max_point|}}}| ({{{elevation_max_point}}})}}</div>
| data83 = {{#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*** -->
| rowclass84 = mergedrow
| label84 = • Rank
| data84 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}| {{{elevation_max_rank|}}} }}
| rowclass85 = {{#if:{{{elevation_min_rank|}}}|mergedrow|mergedbottomrow}}
| label85 = Lowest elevation<div class="ib-settlement-fn">{{{elevation_min_footnotes|}}}{{#if:{{{elevation_min_point|}}}| ({{{elevation_min_point}}})}}</div>
| data85 = {{#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*** -->
| rowclass86 = mergedrow
| label86 = • Rank
| data86 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}|{{{elevation_min_rank|}}}}}
<!-- ***Population*** -->
| rowclass87 = mergedtoprow
| label87 = Population<div class="ib-settlement-fn">{{#if:{{{population_as_of|}}}|{{nbsp}}({{{population_as_of}}})}}{{{population_footnotes|}}}</div>
| data87 = {{fix comma category|{{#ifeq:{{{total_type}}}|
| {{#if:{{{population_total|}}}
| {{formatnum:{{replace|{{{population_total}}}|,|}}}}
}}
}}
}}
| rowclass88 = mergedtoprow
| header88 ={{#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>
}}
}}
| rowclass89 = mergedrow
| label89 = <div style="white-space:nowrap;"> • {{#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|}}}|{{if empty|{{{settlement_type|}}}|{{{type}}}}}|City}}|Total}}}}</div>
| data89 = {{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}
| {{fix comma category|{{formatnum:{{replace|{{{population_total}}}|,|}}}}}}
}}
}}
| rowclass90 = mergedrow
| label90 = <div style="white-space:nowrap;"> • Estimate {{#if:{{{pop_est_as_of|}}}|<div class="ib-settlement-fn">({{{pop_est_as_of}}}){{{pop_est_footnotes|}}}</div>}}</div>
| data90 = {{#if:{{{population_est|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_est}}}|,|}}}}}} }}
<!-- ***Population rank*** -->
| rowclass91 = mergedrow
| label91 = • Rank
| data91 = {{{population_rank|}}}
| rowclass92 = mergedrow
| label92 = • Density
| data92 = {{#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={{if empty|{{{area_land_dunam|}}}|{{{area_total_dunam|}}}}}
|ha ={{if empty|{{{area_land_ha|}}}|{{{area_total_ha|}}}}}
|km2 ={{if empty|{{{area_land_km2|}}}|{{{area_total_km2|}}}}}
|acre ={{if empty|{{{area_land_acre|}}}|{{{area_total_acre|}}}}}
|sqmi ={{if empty|{{{area_land_sq_mi|}}}|{{{area_total_sq_mi|}}}}}
|pref ={{{unit_pref|}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Population density rank*** -->
| rowclass93 = mergedrow
| label93 = • Rank
| data93 = {{{population_density_rank|}}}
| rowclass94 = mergedrow
| label94 = • [[Urban area|Urban]]<div class="ib-settlement-fn">{{{population_urban_footnotes|}}}</div>
| data94 = {{#if:{{{population_urban|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_urban}}}|,|}}}}}} }}
| rowclass95 = mergedrow
| label95 = • Urban density
| data95 = {{#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}}}
}}}}
| rowclass96 = mergedrow
| label96 = • [[Rural area|Rural]]<div class="ib-settlement-fn">{{{population_rural_footnotes|}}}</div>
| data96 = {{#if:{{{population_rural|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_rural}}}|,|}}}}}}}}
| rowclass97 = mergedrow
| label97 = • Rural density
| data97 = {{#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}}}
}}}}
| rowclass98 = mergedrow
| label98 = • [[Metropolitan area|Metro]]<div class="ib-settlement-fn">{{{population_metro_footnotes|}}}</div>
| data98 = {{#if:{{{population_metro|}}}| {{fix comma category|{{formatnum:{{replace|{{{population_metro}}}|,|}}}}}} }}
| rowclass99 = mergedrow
| label99 = • Metro density
| data99 = {{#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}}}
}}}}
| rowclass100 = mergedrow
| label100 = • {{{population_blank1_title|}}}<div class="ib-settlement-fn">{{{population_blank1_footnotes|}}}</div>
| data100 = {{#if:{{{population_blank1|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank1}}}|,|}}}}}}}}
| rowclass101 = mergedrow
| label101 = • {{#if:{{{population_blank1_title|}}}|{{{population_blank1_title}}} density|Density}}
| data101 = {{#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}}}
}}}}
| rowclass102 = mergedrow
| label102 = • {{{population_blank2_title|}}}<div class="ib-settlement-fn">{{{population_blank2_footnotes|}}}</div>
| data102 = {{#if:{{{population_blank2|}}}|{{fix comma category|{{formatnum:{{replace|{{{population_blank2}}}|,|}}}}}}}}
| rowclass103 = mergedrow
| label103 = • {{#if:{{{population_blank2_title|}}}|{{{population_blank2_title}}} density|Density}}
| data103 = {{#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}}}
}}}}
| rowclass104 = mergedrow
| label104 =
| data104 = {{{population_note|}}}
| rowclass105 = mergedtoprow
| label105 = {{Pluralize from text|{{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}{{force plural}}}}|<!--
-->link=Demonym|singular=Demonym|likely=Demonym(s)|plural=Demonyms}}
| data105 = {{if empty|{{{population_demonym|}}}|{{{population_demonyms|}}}}}{{Main other|{{Pluralize from text|{{{population_demonym|}}}|likely=[[Category:Pages using infobox settlement with possible demonym list]]}}}}
<!-- ***Demographics 1*** -->
| rowclass106 = mergedtoprow
| header106 = {{#if:{{{demographics_type1|}}}
|{{{demographics_type1}}}<div class="ib-settlement-fn">{{{demographics1_footnotes|}}}</div>}}
| rowclass107 = mergedrow
| label107 = • {{{demographics1_title1}}}
| data107 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title1|}}}|{{{demographics1_info1|}}}}}}}
| rowclass108 = mergedrow
| label108 = • {{{demographics1_title2}}}
| data108 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title2|}}}|{{{demographics1_info2|}}}}}}}
| rowclass109 = mergedrow
| label109 = • {{{demographics1_title3}}}
| data109 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title3|}}}|{{{demographics1_info3|}}}}}}}
| rowclass110 = mergedrow
| label110 = • {{{demographics1_title4}}}
| data110 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title4|}}}|{{{demographics1_info4|}}}}}}}
| rowclass111 = mergedrow
| label111 = • {{{demographics1_title5}}}
| data111 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title5|}}}|{{{demographics1_info5|}}}}}}}
| rowclass112 = mergedrow
| label112 = • {{{demographics1_title6}}}
| data112 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title6|}}}|{{{demographics1_info6|}}}}}}}
| rowclass113 = mergedrow
| label113 = • {{{demographics1_title7}}}
| data113 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title7|}}}|{{{demographics1_info7|}}}}}}}
| rowclass114 = mergedrow
| label114 = • {{{demographics1_title8}}}
| data114 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title8|}}}|{{{demographics1_info8|}}}}}}}
| rowclass115 = mergedrow
| label115 = • {{{demographics1_title9}}}
| data115 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title9|}}}|{{{demographics1_info9|}}}}}}}
| rowclass116 = mergedrow
| label116 = • {{{demographics1_title10}}}
| data116 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title10|}}}|{{{demographics1_info10|}}}}}}}
<!-- ***Demographics 2*** -->
| rowclass117 = mergedtoprow
| header117 = {{#if:{{{demographics_type2|}}}
|{{{demographics_type2}}}<div class="ib-settlement-fn">{{{demographics2_footnotes|}}}</div>}}
| rowclass118 = mergedrow
| label118 = • {{{demographics2_title1}}}
| data118 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title1|}}}|{{{demographics2_info1|}}}}}}}
| rowclass119 = mergedrow
| label119 = • {{{demographics2_title2}}}
| data119 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title2|}}}|{{{demographics2_info2|}}}}}}}
| rowclass120 = mergedrow
| label120 = • {{{demographics2_title3}}}
| data120 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title3|}}}|{{{demographics2_info3|}}}}}}}
| rowclass121 = mergedrow
| label121 = • {{{demographics2_title4}}}
| data121 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title4|}}}|{{{demographics2_info4|}}}}}}}
| rowclass122 = mergedrow
| label122 = • {{{demographics2_title5}}}
| data122 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title5|}}}|{{{demographics2_info5|}}}}}}}
| rowclass123 = mergedrow
| label123 = • {{{demographics2_title6}}}
| data123 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title6|}}}|{{{demographics2_info6|}}}}}}}
| rowclass124 = mergedrow
| label124 = • {{{demographics2_title7}}}
| data124 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title7|}}}|{{{demographics2_info7|}}}}}}}
| rowclass125 = mergedrow
| label125 = • {{{demographics2_title8}}}
| data125 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title8|}}}|{{{demographics2_info8|}}}}}}}
| rowclass126 = mergedrow
| label126 = • {{{demographics2_title9}}}
| data126 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title9|}}}|{{{demographics2_info9|}}}}}}}
| rowclass127 = mergedrow
| label127 = • {{{demographics2_title10}}}
| data127 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title10|}}}|{{{demographics2_info10|}}}}}}}
<!-- ***Time Zones*** -->
| rowclass128 = mergedtoprow
| header128 = {{#if:{{{timezone1_location|}}}|{{#if:{{{timezone2|}}}|[[{{if empty|{{{timezone_link|}}}|Time zone}}|Time zone]]s|[[{{if empty|{{{timezone_link|}}}|Time zone}}|Time zone]]}}|}}
| rowclass129 = {{#if:{{{timezone1_location|}}}|mergedrow|mergedtoprow}}
| label129 = {{#if:{{{timezone1_location|}}}|{{{timezone1_location}}}|{{#if:{{{timezone2_location|}}}|{{{timezone2_location}}}|{{#if:{{{timezone2|}}}|[[{{if empty|{{{timezone_link|}}}|Time zone}}|Time zone]]s|[[{{if empty|{{{timezone_link|}}}|Time zone}}|Time zone]]}}}}}}
| data129 = {{#if:{{{utc_offset1|}}}{{{utc_offset|}}}
|[[UTC{{if empty|{{{utc_offset1|}}}|{{{utc_offset}}}}}]] {{#if:{{{timezone1|}}}{{{timezone|}}}|({{if empty|{{{timezone1|}}}|{{{timezone}}}}})}}
|{{if empty|{{{timezone1|}}}|{{{timezone|}}}}}
}}
| rowclass130 = mergedrow
| label130 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data130 = {{#if:{{{utc_offset1_DST|}}}{{{utc_offset_DST|}}}
|[[UTC{{if empty|{{{utc_offset1_DST|}}}|{{{utc_offset_DST|}}}}}]] {{#if:{{{timezone1_DST|}}}{{{timezone_DST|}}}|({{if empty|{{{timezone1_DST|}}}|{{{timezone_DST}}}}})}}
|{{if empty|{{{timezone1_DST|}}}|{{{timezone_DST|}}}}}
}}
| rowclass131 = mergedrow
| label131 = {{if empty|{{{timezone2_location|}}}|<nowiki />}}
| data131 = {{#if:{{{timezone1|}}}{{{timezone|}}}{{{utc_offset1|}}}{{{utc_offset|}}}
|{{#if:{{{utc_offset2|}}}
|[[UTC{{{utc_offset2|}}}]] {{#if:{{{timezone2|}}}|({{{timezone2}}})}}
|{{{timezone2|}}}
}}
}}
| rowclass132 = mergedrow
| label132 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data132 = {{#if:{{{utc_offset2_DST|}}}|[[UTC{{{utc_offset2_DST|}}}]] {{#if:{{{timezone2_DST|}}}|({{{timezone2_DST|}}})}}
|{{{timezone2_DST|}}}
}}
| rowclass133 = mergedrow
| label133 = {{if empty|{{{timezone3_location|}}}|<nowiki />}}
| data133 = {{#if:{{{timezone1|}}}{{{timezone|}}}{{{utc_offset1|}}}{{{utc_offset|}}}
|{{#if:{{{utc_offset3|}}}
|[[UTC{{{utc_offset3|}}}]] {{#if:{{{timezone3|}}}|({{{timezone3}}})}}
|{{{timezone3|}}}
}}
}}
| rowclass134 = mergedrow
| label134 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data134 = {{#if:{{{utc_offset3_DST|}}}|[[UTC{{{utc_offset3_DST|}}}]] {{#if:{{{timezone3_DST|}}}|({{{timezone3_DST|}}})}}
|{{{timezone3_DST|}}}
}}
| rowclass135 = mergedrow
| label135 = {{if empty|{{{timezone4_location|}}}|<nowiki />}}
| data135 = {{#if:{{{timezone1|}}}{{{timezone|}}}{{{utc_offset1|}}}{{{utc_offset|}}}
|{{#if:{{{utc_offset4|}}}
|[[UTC{{{utc_offset4|}}}]] {{#if:{{{timezone4|}}}|({{{timezone4}}})}}
|{{{timezone4|}}}
}}
}}
| rowclass136 = mergedrow
| label136 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data136 = {{#if:{{{utc_offset4_DST|}}}|[[UTC{{{utc_offset4_DST|}}}]] {{#if:{{{timezone4_DST|}}}|({{{timezone4_DST|}}})}}
|{{{timezone4_DST|}}}
}}
| rowclass137 = mergedrow
| label137 = {{if empty|{{{timezone5_location|}}}|<nowiki />}}
| data137 = {{#if:{{{timezone1|}}}{{{timezone|}}}{{{utc_offset1|}}}{{{utc_offset|}}}
|{{#if:{{{utc_offset5|}}}
|[[UTC{{{utc_offset5|}}}]] {{#if:{{{timezone5|}}}|({{{timezone5}}})}}
|{{{timezone5|}}}
}}
}}
| rowclass138 = mergedrow
| label138 = <span class="nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data138 = {{#if:{{{utc_offset5_DST|}}}|[[UTC{{{utc_offset5_DST|}}}]] {{#if:{{{timezone5_DST|}}}|({{{timezone5_DST|}}})}}
|{{{timezone5_DST|}}}
}}
<!-- ***Postal Code(s)*** -->
| rowclass139 = mergedtoprow
| label139 = {{if empty|{{{postal_code_type|}}}|{{Pluralize from text|any_comma=1|parse_links=1|{{{postal_code|}}}|link=Postal code|singular=Postal code|plural=Postal codes}}}}
| class139 = adr
| data139 = {{#if:{{{postal_code|}}}|<div class="postal-code">{{{postal_code}}}</div>}}
| rowclass140 = {{#if:{{{postal_code|}}}|mergedbottomrow|mergedtoprow}}
| label140 = {{if empty|{{{postal2_code_type|}}}|{{Pluralize from text|any_comma=1|parse_links=1|{{{postal2_code|}}}|link=Postal code|singular=Postal code|plural=Postal codes}}}}
| class140 = adr
| data140 = {{#if:{{{postal2_code|}}}|<div class="postal-code">{{{postal2_code}}}</div>}}
<!-- ***Area Code(s)*** -->
| rowclass141 = {{#if:{{{postal_code|}}}{{{postal2_code|}}}|mergedrow|mergedtoprow}}
| label141 = {{if empty|{{{area_code_type|}}}|{{Pluralize from text|any_comma=1|parse_links=1|{{if empty|{{{area_code|}}}|{{{area_codes|}}}{{force plural}}}}|<!--
-->link=Telephone numbering plan|singular=Area code|likely=Area code(s)|plural=Area codes}}}}
| data141 = {{if empty|{{{area_code|}}}|{{{area_codes|}}}}}{{#if:{{{area_code_type|}}}||{{Main other|{{Pluralize from text|any_comma=1|parse_links=1|{{{area_code|}}}|||[[Category:Pages using infobox settlement with possible area code list]]}}}}}}
<!-- Geocode-->
| rowclass142 = {{#if:{{{postal_code|}}}{{{postal2_code|}}}{{{area_code|}}}|mergedrow|mergedtoprow}}
| label142 = [[Geocode]]
| class142 = nickname
| data142 = {{{geocode|}}}
<!-- ISO Code-->
| rowclass143 = {{#if:{{{postal_code|}}}{{{postal2_code|}}}{{{area_code|}}}{{{geocode|}}}|mergedrow|mergedtoprow}}
| label143 = [[ISO 3166|ISO 3166 code]]
| class143 = nickname
| data143 = {{{iso_code|}}}
<!-- Vehicle registration plate-->
| rowclass144 = {{#if:{{{postal_code|}}}{{{postal2_code|}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|mergedrow|mergedtoprow}}
| label144 = {{if empty|{{{registration_plate_type|}}}|[[Vehicle registration plate|Vehicle registration]]}}
| data144 = {{{registration_plate|}}}
<!-- Other codes -->
| rowclass145 = {{#if:{{{postal_code|}}}{{{postal2_code|}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}{{{registration_plate|}}}|mergedrow|mergedtoprow}}
| label145 = {{{code1_name|}}}
| class145 = nickname
| data145 = {{#if:{{{code1_name|}}}|{{{code1_info|}}}}}
| rowclass146 = {{#if:{{{postal_code|}}}{{{postal2_code|}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}{{{registration_plate|}}}{{{code1_name|}}}|mergedrow|mergedtoprow}}
| label146 = {{{code2_name|}}}
| class146 = nickname
| data146 = {{#if:{{{code2_name|}}}|{{{code2_info|}}}}}
<!-- ***Blank Fields (two sections)*** -->
| rowclass147 = mergedtoprow
| label147 = {{if empty|{{{blank_name_sec1|}}}|{{{blank_name|}}}}}
| data147 = {{#if:{{{blank_name_sec1|}}}{{{blank_name|}}}|{{if empty|{{{blank_info_sec1|}}}|{{{blank_info|}}}}}}}
| rowclass148 = mergedrow
| label148 = {{if empty|{{{blank1_name_sec1|}}}|{{{blank1_name|}}}}}
| data148 = {{#if:{{{blank1_name_sec1|}}}{{{blank1_name|}}}|{{if empty|{{{blank1_info_sec1|}}}|{{{blank1_info|}}}}}}}
| rowclass149 = mergedrow
| label149 = {{if empty|{{{blank2_name_sec1|}}}|{{{blank2_name|}}}}}
| data149 = {{#if:{{{blank2_name_sec1|}}}{{{blank2_name|}}}|{{if empty|{{{blank2_info_sec1|}}}|{{{blank2_info|}}}}}}}
| rowclass150 = mergedrow
| label150 = {{if empty|{{{blank3_name_sec1|}}}|{{{blank3_name|}}}}}
| data150 = {{#if:{{{blank3_name_sec1|}}}{{{blank3_name|}}}|{{if empty|{{{blank3_info_sec1|}}}|{{{blank3_info|}}}}}}}
| rowclass151 = mergedrow
| label151 = {{if empty|{{{blank4_name_sec1|}}}|{{{blank4_name|}}}}}
| data151 = {{#if:{{{blank4_name_sec1|}}}{{{blank4_name|}}}|{{if empty|{{{blank4_info_sec1|}}}|{{{blank4_info|}}}}}}}
| rowclass152 = mergedrow
| label152 = {{if empty|{{{blank5_name_sec1|}}}|{{{blank5_name|}}}}}
| data152 = {{#if:{{{blank5_name_sec1|}}}{{{blank5_name|}}}|{{if empty|{{{blank5_info_sec1|}}}|{{{blank5_info|}}}}}}}
| rowclass153 = mergedrow
| label153 = {{if empty|{{{blank6_name_sec1|}}}|{{{blank6_name|}}}}}
| data153 = {{#if:{{{blank6_name_sec1|}}}{{{blank6_name|}}}|{{if empty|{{{blank6_info_sec1|}}}|{{{blank6_info|}}}}}}}
| rowclass154 = mergedrow
| label154 = {{if empty|{{{blank7_name_sec1|}}}|{{{blank7_name|}}}}}
| data154 = {{#if:{{{blank7_name_sec1|}}}{{{blank7_name|}}}|{{if empty|{{{blank7_info_sec1|}}}|{{{blank7_info|}}}}}}}
| rowclass155 = mergedtoprow
| label155 = {{{blank_name_sec2}}}
| data155 = {{#if:{{{blank_name_sec2|}}}|{{{blank_info_sec2|}}}}}
| rowclass156 = mergedrow
| label156 = {{{blank1_name_sec2}}}
| data156 = {{#if:{{{blank1_name_sec2|}}}|{{{blank1_info_sec2|}}}}}
| rowclass157 = mergedrow
| label157 = {{{blank2_name_sec2}}}
| data157 = {{#if:{{{blank2_name_sec2|}}}|{{{blank2_info_sec2|}}}}}
| rowclass158 = mergedrow
| label158 = {{{blank3_name_sec2}}}
| data158 = {{#if:{{{blank3_name_sec2|}}}|{{{blank3_info_sec2|}}}}}
| rowclass159 = mergedrow
| label159 = {{{blank4_name_sec2}}}
| data159 = {{#if:{{{blank4_name_sec2|}}}|{{{blank4_info_sec2|}}}}}
| rowclass160 = mergedrow
| label160 = {{{blank5_name_sec2}}}
| data160 = {{#if:{{{blank5_name_sec2|}}}|{{{blank5_info_sec2|}}}}}
| rowclass161 = mergedrow
| label161 = {{{blank6_name_sec2}}}
| data161 = {{#if:{{{blank6_name_sec2|}}}|{{{blank6_info_sec2|}}}}}
| rowclass162 = mergedrow
| label162 = {{{blank7_name_sec2}}}
| data162 = {{#if:{{{blank7_name_sec2|}}}|{{{blank7_info_sec2|}}}}}
<!-- ***Website*** -->
| rowclass163 = mergedtoprow
| label163 = Website
| data163 = {{#if:{{{website|}}}|{{{website}}}}}
| class164 = maptable
| data164 = {{#if:{{{module|}}}|{{{module}}}}}
<!-- ***Footnotes*** -->
| belowrowclass = mergedtoprow
| below = {{{footnotes|}}}
}}<!-- Check for unknowns
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using {{if empty|{{lcfirst:{{{template_name|}}}}}|infobox settlement}} with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview = Page using [[Template:{{if empty|{{ucfirst:{{{template_name|}}}}}|Infobox settlement}}]] with unknown parameter "_VALUE_"|ignoreblank=y|mapframe_args=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_emblem_upright
| 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 | image_upright
| iso_code | leader_name | leader_name1 | leader_name2 | leader_name3 | leader_name4 | leader_name5 | leader_party | leader_title | leader_title1 | leader_title2 | leader_title3 | leader_title4 | leader_title5 | 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_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_class | 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 <!--used by Module:Settlement 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 | template_name | 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 conflicting parameters|check
| template = [[Template:{{if empty|{{ucfirst:{{{template_name|}}}}}|Infobox settlement}}]]
| cat = {{main other|Category:Pages using {{if empty|{{lcfirst:{{{template_name|}}}}}|infobox settlement}} with conflicting parameters}}
| settlement_type; type
| image_size; imagesize
| image_alt; alt
| image_caption; caption
| nickname; nicknames
| motto; mottoes
| coor_pinpoint; coor_type
| population_demonym; population_demonyms
| utc_offset1; utc_offset
| timezone1; timezone
| utc_offset1_DST; utc_offset_DST
| timezone1_DST; timezone_DST
| area_code; area_codes
| blank_name_sec1; blank_name
| blank_info_sec1; blank_info
| blank1_name_sec1; blank1_name
| blank1_info_sec1; blank1_info
| blank2_name_sec1; blank2_name
| blank2_info_sec1; blank2_info
| blank3_name_sec1; blank3_name
| blank3_info_sec1; blank3_info
| blank4_name_sec1; blank4_name
| blank4_info_sec1; blank4_info
| blank5_name_sec1; blank5_name
| blank5_info_sec1; blank5_info
| blank6_name_sec1; blank6_name
| blank6_info_sec1; blank6_info
| blank7_name_sec1; blank7_name
| blank7_info_sec1; blank7_info
}}<!-- 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:{{{embed|}}}|[[Category:Pages using infobox settlement with embed]]}}
}}<!-- Gathering information on over-use of maps
-->{{#ifexpr:{{#invoke:ParameterCount|main|mapframe|image_map|image_map1|pushpin_map}} >2 |{{main other| [[Category:Pages using infobox settlement with potentially too many maps]]}}}}</includeonly><noinclude>
{{documentation}}
<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
</noinclude>
pkqsubwyzeehptxrn9z7lec6zup5fve
Juan Diego Cuauhtlatoatzin
0
59623
37019708
34903868
2026-05-02T11:46:53Z
InternetArchiveBot
28475
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5
37019708
wikitext
text/x-wiki
{{infobox tawo WD}}
[[File:Juan-Diego.jpg|thumb|Juan Diego]]
Si '''Juan Diego Cuauhtlatoatzin''' (1474–30 Mayo 1548) kun '''San Juan Diego''' maoy [[Mehikano]]ng nakatan-aw sa aparisyon sa [[Birhen sa Guadalupe]] niadtong 1531. Siya gikanonisar ni [[Juan Pablo II]].
Ang iyang ngalang ''Cuauhtlatoatzin'' naggikan sa iyang orihinal nga ngalang [[Ninawatl]] nga '''Cuāuhtlahtoātzin''' antes siya mabawtisar.
==Mga sumpay sa gawas==
*[http://www.ssjuandiego.org/ Opisyal nga sityo] {{Webarchive|url=https://web.archive.org/web/20231205162843/http://www.ssjuandiego.org/ |date=2023-12-05 }}
{{saha-Kristiyanismo}}
[[Kategoriya:Mga Mehikanong Kristohanon]]
[[Kategoriya:Mga Katoliko]]
[[Kategoriya:Mga santos]]
[[Kategoriya:Mga natawo sa 1474]]
[[Kategoriya:Mga namatay sa 1548]]
[[Kategoriya:Mga natawo sa Hulyo 12]]
[[Kategoriya:Mga namatay sa Mayo 30]]
[[Kategoriya:Mga natawo sa Mayo 5]]
5iifd1zt82qtxa8d2hgoukcawjf0p1u
Plantilya:Location map
10
60999
37019642
34046092
2026-05-01T16:10:15Z
Exec8
10305
.
37019642
wikitext
text/x-wiki
<includeonly>{{#invoke:Location map|main}}</includeonly><noinclude>{{documentation}}</noinclude>
dg6vj3epjyfwx0m7tx62smhp6gs0y2u
Carnivora
0
242330
37019694
34914891
2026-05-02T11:14:46Z
~2026-26632-15
142617
/* */
37019694
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2013-02}}
{{Taxobox
| name = Carnivora
| status =
| image = Carnivora.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Chordata]]
| classis = [[Mammalia]]
| ordo = '''Carnivora'''
| familia =
| genus =
| species =
| binomial = Carnivora
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| synonyms =
}}
<!-- infobox here -->
[[matang (biyolohiya)|Matang]] sa [[mga mamipero]] ang '''''Carnivora'''''<ref name = "COL"/>. Ang Carnivora sakop sa [[klase (biyolohiya)|klase]] nga [[Mammalia|mamipero]], [[punoan (biolohiya)|ka-ulo]] nga [[Chordata|mananap nga adunay kord ang likod]], ug [[ginharian (biyolohiya)|kaginharian]] nga [[Animalia|mananap]].<ref name = "COL"/> Ang [[matang (biyolohiya)|kahanay]] nga Carnivora pagsakop 286 espesye, segun [[Catalogue of Life]]<ref name = "COL"/>.
<!-- katapusan sa gisulat -->
Mao ni ang iyang [[kladogram]] matod sa [[Catalogue of Life]]<ref name = "COL"/>:
{{Clade
| label1 = [[Mammalia|mamipero]]
| 1={{Clade
| label1 = ''' Carnivora '''
| 1={{Clade
| 1=[[Ailuridae]]
| 2=[[Canidae|iro]]
| 3=[[Eupleridae]]
| 4=[[Felidae|iring]]
| 5=[[Herpestidae]]
| 6=[[Hyaenidae]]
| 7=[[Mephitidae]]
| 8=[[Mustelidae]]
| 9=[[Nandiniidae]]
| 10=[[Odobenidae]]
| 11=[[Otariidae]]
| 12=[[Phocidae]]
| 13=[[Prionodontidae]]
| 14=[[Procyonidae]]
| 15=[[Ursidae|oso]]
| 16=[[Viverridae]]
}}
| 2=[[Afrosoricida]]
| 3=[[Artiodactyla]]
| 4=[[Cetacea|balyena]]
| 5=[[Chiroptera|kulaknit]]
| 6=[[Cingulata]]
| 7=[[Dasyuromorphia]]
| 8=[[Dermoptera|kagwang]]
| 9=[[Didelphimorphia]]
| 10=[[Diprotodontia]]
| 11=[[Erinaceomorpha]]
| 12=[[Hyracoidea]]
| 13=[[Lagomorpha|koneho]]
| 14=[[Macroscelidea]]
| 15=[[Microbiotheria]]
| 16=[[Monotremata]]
| 17=[[Notoryctemorphia]]
| 18=[[Paucituberculata]]
| 19=[[Peramelemorphia]]
| 20=[[Perissodactyla]]
| 21=[[Pholidota]]
| 22=[[Pilosa]]
| 23=[[Primates|ungoy]]
| 24=[[Proboscidea]]
| 25=[[Rodentia|mangungutkut]]
| 26=[[Scandentia]]
| 27=[[Sirenia|duyong]]
| 28=[[Soricomorpha]]
| 29=[[Tubulidentata]]
}}
}}
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/annual-checklist/2011/search/all/key/carnivora/match/1|title= Species 2000 & ITIS Catalogue of Life: 2011 Annual Checklist.|author= Bisby F.A., Roskov Y.R., Orrell T.M., Nicolson D., Paglinawan L.E., Bailly N., Kirk P.M., Bourgoin T., Baillargeon G., Ouvrard D. (red.)|year= 2011|publisher= Species 2000: Reading, UK.|accessdate= 24 september 2012}}</ref>
</references>
== Gikan sa gawas nga tinubdan ==
{{commonscat|Carnivora}}
{{wikispecies|Carnivora|''Carnivora''}}
== Galeriya sa hulagway ==
<gallery>
RenardCrâne.jpg
Trillium Poncho cat dog.jpg
Mirounga leonina male.JPG
Mauswiesel.jpg
Brown Bear us fish.jpg
Nandinia binotata, Manchester Museum.jpg
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Carnivora]]
1f5qfcn7cajzmrqnwfo1458xu0p0aie
Coendou
0
329969
37019557
37019117
2026-05-01T14:43:33Z
~2026-26632-15
142617
/* */
37019557
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mangungutkut|date=2020-10}}
{{Taxobox
| name = ''Coendou''
| status =
| image = Coendou prehensilis.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Mangungutkut|Rodentia]]
| familia = [[Erethizontidae]]
| genus = '''Coendou'''
| species =
| binomial = Coendou
| binomial_authority =
| range_map =
| range_map_caption =
| image2 = At The Zoo 10.jpg
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
[[Kahenera]] sa [[mga mangungutkut]] ang '''''Coendou'''''<ref name = "COL"/>. Ang ''Coendou'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Erethizontidae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Erethizontidae]]
| 1={{Clade
| label1 = ''''' Coendou '''''
| 1={{Clade
| 1=''[[Coendou bicolor]]''
| 2=''[[Coendou mexicanus]]''
| 3=''[[Coendou nycthemera]]''
| 4=''[[Coendou prehensilis]]''
| 5=''[[Coendou quichua]]''
| 6=''[[Coendou rothschildi]]''
| 7 =''[[Coendou rufescens]]''
}}
| 2=''[[Chaetomys]]''
| 3=''[[Echinoprocta]]''
| 4=''[[Erethizon]]''
| 5=''[[Sphiggurus]]''
}}
}}
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 54840918|accessdate= 2019-11-11}}</ref>
</references>
<gallery>
Coendou prehensilis 2 - Buffalo Zoo.jpg
</gallery>
[[Kategoriya:Mangungutkut]]
[[Kategoriya:Coendou]]
s9ojex9y4rvoazin6q5eo4c9takpj1z
Oryctolagus cuniculus
0
331523
37019690
37017755
2026-05-02T11:09:12Z
~2026-26632-15
142617
/* */
37019690
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|koneho|date=2020-10}}
{{Taxobox
| name = ''Oryctolagus cuniculus''
| status = EN
| image = Oryctolagus cuniculus Tasmania 2.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Koneho|Lagomorpha]]
| familia = [[Leporidae]]
| genus = [[Oryctolagus]]
| species = '''Oryctolagus cuniculus'''
| binomial = Oryctolagus cuniculus
| binomial_authority = ([[Linnaeus (awtor)|Linnaeus]], 1758)
| range_map = Oryctolagus cuniculus distribution Map.png
| range_map_caption =
| image2 = Rabbit oinks and squeaks.wav
| image2_caption =Tawag ng Koneho
| subphylum = [[Vertebrata]]
| synonyms =
| status_ref = <ref name = "iucn"/>
| status_system = iucn3.1 }}
Kaliwatan sa [[koneho]] ang '''''Oryctolagus cuniculus'''''<ref name = "COL"/>. Una ning gihulagway ni [[Linnaeus (awtor)|Linnaeus]] ni adtong 1758.<ref name = "col35489428"/> Ang ''Oryctolagus cuniculus'' sakop sa [[kahenera]] nga ''[[Oryctolagus]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Leporidae]].<ref name = "COL"/><ref name = "source"/> Giklaseklase sa [[IUCN]] ang kaliwatan sa [[duolang mibahad]].<ref name = "iucn"/>
Kini nga matang hayop na sabwag sa:
* [[Aprika]]
* [[Ostralya]]
* [[Habagatang Amerika]]
* [[Oseyaniya]]
* [[Amihanang Amerika]]
* [[Uropa]] ug amihanang [[Asya]]
== Matang nga nahiubos ==
Ang kaliwatan gibahinbahin ngadto sa matang nga nahiubos:<ref name = "COL"/>
* ''O. c. huxleyi''
* ''O. c. cuniculus''
* ''O. c. algirus''
* ''O. c. brachyotus''
* ''O. c. cnossius''
* ''O. c. habetensis''
<!-- katapusan sa gisulat -->
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 35489428|accessdate= 2019-11-11}}</ref>
<ref name = "col35489428">Banks, R. C., R. W. McDiarmid, and A. L. Gardner (1987) ''Checklist of Vertebrates of the United States, the U.S. Territories, and Canada'' , Resource Publication, no. 166</ref>
<ref name = "source">Tom Orrell (custodian), Dave Nicolson (ed). (2019). ITIS Global: The Integrated Taxonomic Information System (version Jun 2017). In: Species 2000 & ITIS Catalogue of Life, 2019 Annual Checklist (Roskov Y., Ower G., Orrell T., Nicolson D., Bailly N., Kirk P.M., Bourgoin T., DeWalt R.E., Decock W., Nieukerken E. van, Zarucchi J., Penev L., eds.). Digital resource at www.catalogueoflife.org/annual-checklist/2019. Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X.</ref>
<ref name = "iucn">{{IUCN2012.2|assessors= |year= 2008|id= 41291|title= Oryctolagus cuniculus|downloaded= 24/10/2012}}</ref>
</references>
<gallery>
Oryctolagus cuniculus distribution Map.png
Wild black Oryctologus cuniculus.jpg
Kaninchen.jpg
Wild rabbit.jpg
RabbitMyxomatoseHead.JPG
European Rabbit, Lake District, UK - August 2011.jpg
</gallery>
[[Kategoriya:Koneho]]
[[Kategoriya:Koneho sa Aprika]]
[[Kategoriya:Koneho sa Ostralya]]
[[Kategoriya:Koneho sa Habagatang Amerika]]
[[Kategoriya:Koneho sa Oseyaniya]]
[[Kategoriya:Koneho sa Amihanang Amerika]]
[[Kategoriya:Koneho sa Uropa]]
[[Kategoriya:Oryctolagus]]
643vnb77y2xobf2l9om1fmp1p60q0d4
Prionodon
0
335068
37019692
17319685
2026-05-02T11:13:11Z
~2026-26632-15
142617
/* */
37019692
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2013-02}}
{{Taxobox
| name = ''Prionodon''
| status =
| image = Prionodon pardicolor - Kunming Natural History Museum of Zoology - DSC02486.JPG
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Viverridae]]
| genus = '''Prionodon'''
| species =
| binomial = Prionodon
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms =
}}
<!-- infobox here -->
[[Henero]] sa [[mga mamipero]] ang '''''Prionodon'''''<ref name = "COL"/>. Ang ''Prionodon'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Viverridae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Mao ni ang iyang [[kladogram]] matod sa [[Catalogue of Life]]<ref name = "COL"/>:
{{Clade
| label1 = ''''' Prionodon '''''
| 1={{Clade
| 1=''[[Prionodon linsang]]''
| 2=''[[Prionodon pardicolor]]''
}}
}}
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/annual-checklist/2011/search/all/key/prionodon/match/1|title= Species 2000 & ITIS Catalogue of Life: 2011 Annual Checklist.|author= Bisby F.A., Roskov Y.R., Orrell T.M., Nicolson D., Paglinawan L.E., Bailly N., Kirk P.M., Bourgoin T., Baillargeon G., Ouvrard D. (red.)|year= 2011|publisher= Species 2000: Reading, UK.|accessdate= 24 september 2012}}</ref>
</references>
== Gikan sa gawas nga tinubdan ==
{{commonscat|Prionodon}}
{{wikispecies|Prionodon|''Prionodon''}}
[[Kategoriya:Mamipero]]
[[Kategoriya:Prionodon]]
9eg4iodifpn9r1iwq0aj93flv55jt2m
37019693
37019692
2026-05-02T11:13:37Z
~2026-26632-15
142617
/* */
37019693
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2013-02}}
{{Taxobox
| name = ''Prionodon''
| status =
| image = Prionodon pardicolor - Kunming Natural History Museum of Zoology - DSC02486.JPG
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Prionodontidae]]
| genus = '''Prionodon'''
| species =
| binomial = Prionodon
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms =
}}
<!-- infobox here -->
[[Henero]] sa [[mga mamipero]] ang '''''Prionodon'''''<ref name = "COL"/>. Ang ''Prionodon'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Viverridae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Mao ni ang iyang [[kladogram]] matod sa [[Catalogue of Life]]<ref name = "COL"/>:
{{Clade
| label1 = ''''' Prionodon '''''
| 1={{Clade
| 1=''[[Prionodon linsang]]''
| 2=''[[Prionodon pardicolor]]''
}}
}}
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/annual-checklist/2011/search/all/key/prionodon/match/1|title= Species 2000 & ITIS Catalogue of Life: 2011 Annual Checklist.|author= Bisby F.A., Roskov Y.R., Orrell T.M., Nicolson D., Paglinawan L.E., Bailly N., Kirk P.M., Bourgoin T., Baillargeon G., Ouvrard D. (red.)|year= 2011|publisher= Species 2000: Reading, UK.|accessdate= 24 september 2012}}</ref>
</references>
== Gikan sa gawas nga tinubdan ==
{{commonscat|Prionodon}}
{{wikispecies|Prionodon|''Prionodon''}}
[[Kategoriya:Mamipero]]
[[Kategoriya:Prionodon]]
ad0rzt84za0rvg8nlk1830eyjhymjss
Herpestidae
0
335473
37019515
35183462
2026-05-01T13:56:04Z
~2026-26632-15
142617
/* */
37019515
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = Herpestidae
| status =
| image = 20050323 - Suricata Suricatta - La Barben - France.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = '''Herpestidae'''
| genus =
| species =
| binomial = Herpestidae
| binomial_authority =
| range_map =
| range_map_caption =
| image2 = Marsh mongoose or water mongoose, Atilax paludinosus, at Rietvlei Nature Reserve, Gauteng, South Africa (22778472930).jpg
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| subordo = [[Caniformia]]
| synonyms = }}
[[pamilya (biyolohiya)|Kabanay]] sa [[mga mamipero]] ang '''Herpestidae'''<ref name = "COL"/>. Ang Herpestidae sakop sa [[matang (biyolohiya)|kahanay]] nga [[Carnivora]], [[klase (biyolohiya)|kahutong]] nga [[Mammalia|mamipero]], [[punoan (biolohiya)|ka-ulo]] nga [[Maybukobuko (mananap)|maybukobuko]], ug [[ginharian (biyolohiya)|kaginharian]] nga [[Animalia|mananap]].<ref name = "COL"/> Ang [[pamilya (biyolohiya)|kabanay]] nga Herpestidae pagsakop 33 kaliwatan, segun [[Catalogue of Life]]<ref name = "COL"/>.
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Carnivora]]
| 1={{Clade
| label1 = ''' Herpestidae '''
| 1={{Clade
| 1=''[[Atilax]]''
| 2=''[[Bdeogale]]''
| 3=''[[Crossarchus]]''
| 4=''[[Cynictis]]''
| 5=''[[Dologale]]''
| 6=''[[Galerella (mamipero)|Galerella]]''
| 7=''[[Helogale]]''
| 8=''[[Herpestes]]''
| 9=''[[Ichneumia]]''
| 10=''[[Liberiictis]]''
| 11=''[[Mungos]]''
| 12=''[[Paracynictis]]''
| 13=''[[Rhynchogale]]''
| 14=''[[Suricata]]''
| 15=''[[Urva]]''
| 16=''[[Xenogale]]''
}}
| 2=[[Ailuridae]]
| 3=[[Ayam (mamipero)|ayam]]
| 4=[[Eupleridae]]
| 5=[[Murag-iring|murag-iring]]
| 6=[[Hyaenidae]]
| 7=[[Mephitidae]]
| 8=[[Mustelidae]]
| 9=[[Nandiniidae]]
| 10=[[Odobenidae]]
| 11=[[Otariidae]]
| 12=[[Phocidae]]
| 13=[[Procyonidae]]
| 14=[[Uso (mamipero)|uso]]
| 15=[[Viverridae]]
}}
}}
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 54774530|accessdate= 2019-11-11}}</ref>
</references>
<gallery>
Dwarf mongoose Korkeasaari zoo.jpg
Mongoose.jpg
Cusimanse.jpg
Helogale_parvula,_Serengeti.jpg
Vosmangoesten zoo Lille.JPG
Suricata.jpg
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Herpestidae]]
dms53jz36h3jrm26tkf5dilrdy7kcou
37019520
37019515
2026-05-01T14:05:06Z
~2026-26632-15
142617
37019520
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = Herpestidae
| status =
| image = 20050323 - Suricata Suricatta - La Barben - France.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = '''Herpestidae'''
| genus =
| species =
| binomial = Herpestidae
| binomial_authority =
| range_map =
| range_map_caption =
| image2 = Marsh mongoose or water mongoose, Atilax paludinosus, at Rietvlei Nature Reserve, Gauteng, South Africa (22778472930).jpg
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| subordo = [[Feliformia]]
| synonyms = }}
[[pamilya (biyolohiya)|Kabanay]] sa [[mga mamipero]] ang '''Herpestidae'''<ref name = "COL"/>. Ang Herpestidae sakop sa [[matang (biyolohiya)|kahanay]] nga [[Carnivora]], [[klase (biyolohiya)|kahutong]] nga [[Mammalia|mamipero]], [[punoan (biolohiya)|ka-ulo]] nga [[Maybukobuko (mananap)|maybukobuko]], ug [[ginharian (biyolohiya)|kaginharian]] nga [[Animalia|mananap]].<ref name = "COL"/> Ang [[pamilya (biyolohiya)|kabanay]] nga Herpestidae pagsakop 33 kaliwatan, segun [[Catalogue of Life]]<ref name = "COL"/>.
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Carnivora]]
| 1={{Clade
| label1 = ''' Herpestidae '''
| 1={{Clade
| 1=''[[Atilax]]''
| 2=''[[Bdeogale]]''
| 3=''[[Crossarchus]]''
| 4=''[[Cynictis]]''
| 5=''[[Dologale]]''
| 6=''[[Galerella (mamipero)|Galerella]]''
| 7=''[[Helogale]]''
| 8=''[[Herpestes]]''
| 9=''[[Ichneumia]]''
| 10=''[[Liberiictis]]''
| 11=''[[Mungos]]''
| 12=''[[Paracynictis]]''
| 13=''[[Rhynchogale]]''
| 14=''[[Suricata]]''
| 15=''[[Urva]]''
| 16=''[[Xenogale]]''
}}
| 2=[[Ailuridae]]
| 3=[[Ayam (mamipero)|ayam]]
| 4=[[Eupleridae]]
| 5=[[Murag-iring|murag-iring]]
| 6=[[Hyaenidae]]
| 7=[[Mephitidae]]
| 8=[[Mustelidae]]
| 9=[[Nandiniidae]]
| 10=[[Odobenidae]]
| 11=[[Otariidae]]
| 12=[[Phocidae]]
| 13=[[Procyonidae]]
| 14=[[Uso (mamipero)|uso]]
| 15=[[Viverridae]]
}}
}}
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 54774530|accessdate= 2019-11-11}}</ref>
</references>
<gallery>
Dwarf mongoose Korkeasaari zoo.jpg
Mongoose.jpg
Cusimanse.jpg
Helogale_parvula,_Serengeti.jpg
Vosmangoesten zoo Lille.JPG
Suricata.jpg
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Herpestidae]]
09zname8xg66jd40kc5p47wx0a01jj7
37019543
37019520
2026-05-01T14:32:52Z
~2026-26632-15
142617
/* */
37019543
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = Herpestidae
| status =
| image = 20050323 - Suricata Suricatta - La Barben - France.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = '''Herpestidae'''
| genus =
| species =
| binomial = Herpestidae
| binomial_authority =
| range_map =
| range_map_caption =
| image2 = Marsh mongoose or water mongoose, Atilax paludinosus, at Rietvlei Nature Reserve, Gauteng, South Africa (22778472930).jpg
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| subordo = [[Feliformia]]
| synonyms = }}
[[pamilya (biyolohiya)|Kabanay]] sa [[mga mamipero]] ang '''Herpestidae'''<ref name = "COL"/>. Ang Herpestidae sakop sa [[matang (biyolohiya)|kahanay]] nga [[Carnivora]], [[klase (biyolohiya)|kahutong]] nga [[Mammalia|mamipero]], [[punoan (biolohiya)|ka-ulo]] nga [[Maybukobuko (mananap)|maybukobuko]], ug [[ginharian (biyolohiya)|kaginharian]] nga [[Animalia|mananap]].<ref name = "COL"/> Ang [[pamilya (biyolohiya)|kabanay]] nga Herpestidae pagsakop 33 kaliwatan, segun [[Catalogue of Life]]<ref name = "COL"/>.
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Carnivora]]
| 1={{Clade
| label1 = ''' Herpestidae '''
| 1={{Clade
| 1=''[[Atilax]]''
| 2=''[[Bdeogale]]''
| 3=''[[Crossarchus]]''
| 4=''[[Cynictis]]''
| 5=''[[Dologale]]''
| 6=''[[Galerella (mamipero)|Galerella]]''
| 7=''[[Helogale]]''
| 8=''[[Herpestes]]''
| 9=''[[Ichneumia]]''
| 10=''[[Liberiictis]]''
| 11=''[[Mungos]]''
| 12=''[[Paracynictis]]''
| 13=''[[Rhynchogale]]''
| 14=''[[Suricata]]''
| 15=''[[Urva (mamipero)|Urva]]''
| 16=''[[Xenogale]]''
}}
| 2=[[Ailuridae]]
| 3=[[Ayam (mamipero)|ayam]]
| 4=[[Eupleridae]]
| 5=[[Murag-iring|murag-iring]]
| 6=[[Hyaenidae]]
| 7=[[Mephitidae]]
| 8=[[Mustelidae]]
| 9=[[Nandiniidae]]
| 10=[[Odobenidae]]
| 11=[[Otariidae]]
| 12=[[Phocidae]]
| 13=[[Procyonidae]]
| 14=[[Uso (mamipero)|uso]]
| 15=[[Viverridae]]
}}
}}
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 54774530|accessdate= 2019-11-11}}</ref>
</references>
<gallery>
Dwarf mongoose Korkeasaari zoo.jpg
Mongoose.jpg
Cusimanse.jpg
Helogale_parvula,_Serengeti.jpg
Vosmangoesten zoo Lille.JPG
Suricata.jpg
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Herpestidae]]
q2rlruvkikilutrtfs6kxjlk5l5gfpv
Galerella flavescens
0
335477
37019709
35195107
2026-05-02T11:47:33Z
~2026-26632-15
142617
Redirected page to [[Herpestes flavescens]]
37019709
wikitext
text/x-wiki
#REDIRECT [[Herpestes flavescens]]
cftq0j4rbu6rvc11392f18lbkqiy7q0
Herpestes
0
335502
37019529
35195114
2026-05-01T14:25:12Z
~2026-26632-15
142617
/* */
37019529
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Herpestes''
| status =
| image = Herpestes javanicus01.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = '''Herpestes'''
| species =
| binomial = Herpestes
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
[[Kahenera]] sa [[mga mamipero]] ang '''''Herpestes'''''<ref name = "COL"/>. Ang ''Herpestes'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Herpestidae]]
| 1={{Clade
| label1 = ''''' Herpestes '''''
| 1={{Clade
| 1=''[[Herpestes brachyurus]]''
| 2=''[[Herpestes edwardsi]]''
| 3=''[[Herpestes fuscus]]''
| 4=''[[Herpestes ichneumon]]''
| 5=''[[Herpestes javanicus]]''
| 6=''[[Herpestes semitorquatus]]''
| 7=''[[Herpestes smithii]]''
| 8=''[[Herpestes urva]]''
| 10=''[[Herpestes vitticollis]]''
}}
| 2=''[[Atilax]]''
| 3=''[[Bdeogale]]''
| 4=''[[Crossarchus]]''
| 5=''[[Cynictis]]''
| 6=''[[Dologale]]''
| 7=''[[Galerella (mamipero)|Galerella]]''
| 8=''[[Helogale]]''
| 9=''[[Ichneumia]]''
| 10=''[[Liberiictis]]''
| 11=''[[Mungos]]''
| 12=''[[Paracynictis]]''
| 13=''[[Rhynchogale]]''
| 14=''[[Suricata]]''
}}
}}
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 54896850|accessdate= 2019-11-11}}</ref>
</references>
<gallery>
Ruddy mongoose.jpg
StripeneckMongoose.jpg
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Herpestes]]
thd6hcygg947umg22g4balnae7oi7ns
37019536
37019529
2026-05-01T14:29:10Z
~2026-26632-15
142617
/* */
37019536
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Herpestes''
| status =
| image = Herpestes javanicus01.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = '''Herpestes'''
| species =
| binomial = Herpestes
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
[[Kahenera]] sa [[mga mamipero]] ang '''''Herpestes'''''<ref name = "COL"/>. Ang ''Herpestes'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Herpestidae]]
| 1={{Clade
| label1 = ''''' Herpestes '''''
| 1={{Clade
| 1=''[[Herpestes brachyurus]]''
| 2=''[[Herpestes edwardsi]]''
| 3=''[[Herpestes fuscus]]''
| 4=''[[Herpestes ichneumon]]''
| 5=''[[Herpestes javanicus]]''
| 6=''[[Herpestes semitorquatus]]''
| 7=''[[Herpestes smithii]]''
| 8=''[[Herpestes urva]]''
| 9=''[[Herpestes vitticollis]]''
}}
| 2=''[[Atilax]]''
| 3=''[[Bdeogale]]''
| 4=''[[Crossarchus]]''
| 5=''[[Cynictis]]''
| 6=''[[Dologale]]''
| 7=''[[Galerella (mamipero)|Galerella]]''
| 8=''[[Helogale]]''
| 9=''[[Ichneumia]]''
| 10=''[[Liberiictis]]''
| 11=''[[Mungos]]''
| 12=''[[Paracynictis]]''
| 13=''[[Rhynchogale]]''
| 14=''[[Suricata]]''
| 15=''[[Urva (mamipero)|Urva]]''
| 16=''[[Xenogale]]''
}}
}}
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 54896850|accessdate= 2019-11-11}}</ref>
</references>
<gallery>
Ruddy mongoose.jpg
StripeneckMongoose.jpg
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Herpestes]]
nuizeeqq9k745063bkcqx4d002pv8rm
37019702
37019536
2026-05-02T11:35:41Z
~2026-26632-15
142617
/* */
37019702
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Herpestes''
| status =
| image = Herpestes javanicus01.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = '''Herpestes'''
| species =
| binomial = Herpestes
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
[[Kahenera]] sa [[mga mamipero]] ang '''''Herpestes'''''<ref name = "COL"/>. Ang ''Herpestes'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Herpestidae]]
| 1={{Clade
| label1 = ''''' Herpestes '''''
| 1={{Clade
| 1=''[[Herpestes brachyurus]]''
| 2=''[[Herpestes edwardsi]]''
| 3=''[[Herpestes flavescens]]''
| 4=''[[Herpestes ichneumon]]''
| 5=''[[Herpestes javanicus]]''
| 6=''[[Herpestes semitorquatus]]''
| 7=''[[Herpestes smithii]]''
| 8=''[[Herpestes urva]]''
| 9=''[[Herpestes vitticollis]]''
}}
| 2=''[[Atilax]]''
| 3=''[[Bdeogale]]''
| 4=''[[Crossarchus]]''
| 5=''[[Cynictis]]''
| 6=''[[Dologale]]''
| 7=''[[Galerella (mamipero)|Galerella]]''
| 8=''[[Helogale]]''
| 9=''[[Ichneumia]]''
| 10=''[[Liberiictis]]''
| 11=''[[Mungos]]''
| 12=''[[Paracynictis]]''
| 13=''[[Rhynchogale]]''
| 14=''[[Suricata]]''
| 15=''[[Urva (mamipero)|Urva]]''
| 16=''[[Xenogale]]''
}}
}}
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 54896850|accessdate= 2019-11-11}}</ref>
</references>
<gallery>
Ruddy mongoose.jpg
StripeneckMongoose.jpg
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Herpestes]]
1qda1q6re3ok36ok1b957bnbn8qdb7f
37019703
37019702
2026-05-02T11:37:18Z
~2026-26632-15
142617
/* */
37019703
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Herpestes''
| status =
| image = Herpestes javanicus01.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = '''Herpestes'''
| species =
| binomial = Herpestes
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
[[Kahenera]] sa [[mga mamipero]] ang '''''Herpestes'''''<ref name = "COL"/>. Ang ''Herpestes'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Herpestidae]]
| 1={{Clade
| label1 = ''''' Herpestes '''''
| 1={{Clade
| 1=''[[Herpestes flavescens]]''
| 2=''[[Herpestes ichneumon]]''
| 3=''[[Herpestes ochraceus]]''
| 4=''[[Herpestes pulverulentus]]''
| 7=''[[Herpestes smithii]]''
| 8=''[[Herpestes urva]]''
| 9=''[[Herpestes vitticollis]]''
}}
| 2=''[[Atilax]]''
| 3=''[[Bdeogale]]''
| 4=''[[Crossarchus]]''
| 5=''[[Cynictis]]''
| 6=''[[Dologale]]''
| 7=''[[Galerella (mamipero)|Galerella]]''
| 8=''[[Helogale]]''
| 9=''[[Ichneumia]]''
| 10=''[[Liberiictis]]''
| 11=''[[Mungos]]''
| 12=''[[Paracynictis]]''
| 13=''[[Rhynchogale]]''
| 14=''[[Suricata]]''
| 15=''[[Urva (mamipero)|Urva]]''
| 16=''[[Xenogale]]''
}}
}}
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 54896850|accessdate= 2019-11-11}}</ref>
</references>
<gallery>
Ruddy mongoose.jpg
StripeneckMongoose.jpg
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Herpestes]]
gaae0x49px9nv34zyjnanmp2aduura2
37019704
37019703
2026-05-02T11:38:31Z
~2026-26632-15
142617
/* */
37019704
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Herpestes''
| status =
| image = Herpestes javanicus01.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = '''Herpestes'''
| species =
| binomial = Herpestes
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
[[Kahenera]] sa [[mga mamipero]] ang '''''Herpestes'''''<ref name = "COL"/>. Ang ''Herpestes'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Herpestidae]]
| 1={{Clade
| label1 = ''''' Herpestes '''''
| 1={{Clade
| 1=''[[Herpestes flavescens]]''
| 2=''[[Herpestes ichneumon]]''
| 3=''[[Herpestes ochraceus]]''
| 4=''[[Herpestes pulverulentus]]''
| 5=''[[Herpestes sanguineus]]''
}}
| 2=''[[Atilax]]''
| 3=''[[Bdeogale]]''
| 4=''[[Crossarchus]]''
| 5=''[[Cynictis]]''
| 6=''[[Dologale]]''
| 7=''[[Galerella (mamipero)|Galerella]]''
| 8=''[[Helogale]]''
| 9=''[[Ichneumia]]''
| 10=''[[Liberiictis]]''
| 11=''[[Mungos]]''
| 12=''[[Paracynictis]]''
| 13=''[[Rhynchogale]]''
| 14=''[[Suricata]]''
| 15=''[[Urva (mamipero)|Urva]]''
| 16=''[[Xenogale]]''
}}
}}
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 54896850|accessdate= 2019-11-11}}</ref>
</references>
<gallery>
Ruddy mongoose.jpg
StripeneckMongoose.jpg
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Herpestes]]
12oozm4gednoaet0wjv462vj3rr5yni
Herpestes naso
0
335510
37019523
35195119
2026-05-01T14:21:49Z
~2026-26632-15
142617
Replaced content with "{"
37019523
wikitext
text/x-wiki
{
barcc157cfkdqwkh4ctm4cy8nomy3wl
37019526
37019523
2026-05-01T14:23:23Z
~2026-26632-15
142617
Redirected page to [[Xenogale naso]]
37019526
wikitext
text/x-wiki
#REDIRECT [[Xenogale naso]]
chg1yn7tbx6jm4bydbaqhilokp9aeme
Module:InfoboxImage
828
1882598
37019568
35046736
2026-05-01T14:56:41Z
Exec8
10305
.
37019568
Scribunto
text/plain
-- Inputs:
-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link
-- page - page to display for multipage images (DjVu)
-- size - size to display the image
-- maxsize - maximum size for image
-- sizedefault - default size to display the image if size param is blank
-- alt - alt text for image
-- title - title text for image
-- border - set to yes if border
-- center - set to yes, if the image has to be centered
-- upright - upright image param
-- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it
-- link - page to visit when clicking on image
-- class - HTML classes to add to the image
-- Outputs:
-- Formatted image.
-- More details available at the "Module:InfoboxImage/doc" page
local i = {}
-- List of placeholder images and tracking categories stored in [[Module:InfoboxImage/data]]
-- Other constants:
-- the system-wide default thumbnail size (in px)
local defaultThumbnailSize = 250
-- If page is not a user page, return tracking category. Else return empty.
local function trackingCat(cat)
local ns = mw.title.getCurrentTitle().nsText:lower()
local categories = mw.loadData('Module:InfoboxImage/data').categories
return (ns ~= 'user' and ns ~= 'user talk' and categories[cat]) or ""
end
-- Determine whether image is a placeholder
function i.IsPlaceholder(image)
-- change underscores to spaces
image = mw.ustring.gsub(image, "_", " ");
assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil')
-- if image starts with [[ then remove that and anything after |
if mw.ustring.sub(image,1,2) == "[[" then
image = mw.ustring.sub(image,3);
image = mw.ustring.gsub(image, "([^|]*)|.*", "%1");
assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil')
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil")
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
-- capitalise first letter
image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);
local placeholder_image = mw.loadData('Module:InfoboxImage/data').placeholder_image
return placeholder_image[image]
end
local function isempty(x)
return (not x) or x == ""
end
-- Main entry point
function i.InfoboxImage(frame)
local image = frame.args["image"];
if isempty(image) then
return "";
end
if image == " " then
return image;
end
if frame.args["suppressplaceholder"] ~= "no" then
if i.IsPlaceholder(image) == true then
return "";
end
end
if string.find(image, "^%[*https?:") then
-- Error category.
return trackingCat("url_image_links")
end
if mw.ustring.sub(image,1,2) == "[[" then
-- search for thumbnail images and add to tracking cat if found
local cat = "";
if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
cat = trackingCat("thumbnail_images")
end
return image .. cat;
elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then
return image;
elseif mw.ustring.sub(image,1,1) == "<" then
return image;
elseif mw.ustring.sub(image,1,8) == mw.ustring.char(127).."'\"`UNIQ" then
-- Found strip marker at begining, so pass don't process at all
return image;
else
local result = "";
local page = frame.args["page"];
local upright = frame.args["upright"] or ""
local size = frame.args["size"];
local maxsize = frame.args["maxsize"];
local sizedefault = frame.args["sizedefault"];
local alt = frame.args["alt"];
local link = frame.args["link"];
local title = frame.args["title"];
local border = frame.args["border"];
local thumbtime = frame.args["thumbtime"] or "";
local center = frame.args["center"];
local class = frame.args["class"];
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
if not isempty(maxsize) then
-- if no sizedefault nor upright, then set to maxsize
if isempty(sizedefault) and isempty(upright) then
sizedefault = maxsize
end
-- check to see if size bigger than maxsize
local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0;
if not isempty(size) then
local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0;
if sizenumber > maxsizenumber and maxsizenumber > 0 then
size = maxsize;
end
end
-- check to see if upright bigger than maxsize (at default preferred size)
if not isempty(upright) then
local uprightnumber = tonumber(upright) or (upright == "yes" and 0.75) or 0
if uprightnumber*defaultThumbnailSize > maxsizenumber and maxsizenumber > 0 then
upright = tostring(maxsizenumber/defaultThumbnailSize)
end
end
end
-- add px to size if just a number
if (tonumber(size) or 0) > 0 then
size = size .. "px";
end
-- add px to sizedefault if just a number
if (tonumber(sizedefault) or 0) > 0 then
sizedefault = sizedefault .. "px";
end
result = "[[File:" .. image;
if not isempty(page) then
result = result .. "|page=" .. page;
end
if not isempty(size) then
result = result .. "|" .. size;
elseif not isempty(sizedefault) and isempty(upright) then
result = result .. "|" .. sizedefault;
else
result = result .. "|frameless";
end
if center == "yes" then
result = result .. "|center"
end
if not isempty(alt) then
result = result .. "|alt=" .. alt;
end
if not isempty(link) then
result = result .. "|link=" .. link;
end
if border == "yes" then
result = result .. "|border";
end
if upright == "yes" then
result = result .. "|upright";
elseif upright ~= "" then
result = result .. "|upright=" .. upright;
end
if thumbtime ~= "" then
result = result .. "|thumbtime=" .. thumbtime;
end
if not isempty(class) then
result = result .. "|class=" .. class;
end
-- if alt value is a keyword then do not use as a description
if alt == "thumbnail" or alt == "thumb" or alt == "frameless" or alt == "left" or alt == "center" or alt == "right" or alt == "upright" or alt == "border" or mw.ustring.match(alt or "", '^[0-9]*px$', 1) ~= nil then
alt = nil;
end
if not isempty(title) then
-- does title param contain any templatestyles? If yes then set to blank.
if mw.ustring.match(frame:preprocess(title), 'UNIQ%-%-templatestyles', 1) ~= nil then
title = nil;
end
end
if not isempty(title) then
result = result .. "|" .. title;
end
result = result .. "]]";
return result;
end
end
return i;
jhks6vfk9v2iehyrc6dp50ju1s294vf
Module:Infobox
828
1882599
37019567
35046734
2026-05-01T14:55:09Z
Exec8
10305
.
37019567
Scribunto
text/plain
local p = {}
local args = {}
local origArgs = {}
local root
local empty_row_categories = {}
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local has_rows = false
local yesno = require("Module:Yesno")
local lists = {
plainlist_t = {
patterns = {
'^plainlist$',
'%splainlist$',
'^plainlist%s',
'%splainlist%s'
},
found = false,
styles = 'Plainlist/styles.css'
},
hlist_t = {
patterns = {
'^hlist$',
'%shlist$',
'^hlist%s',
'%shlist%s'
},
found = false,
styles = 'Hlist/styles.css'
}
}
local function has_list_class(args_to_check)
for _, list in pairs(lists) do
if not list.found then
for _, arg in pairs(args_to_check) do
for _, pattern in ipairs(list.patterns) do
if mw.ustring.find(arg or '', pattern) then
list.found = true
break
end
end
if list.found then break end
end
end
end
end
local function fixChildBoxes(sval, tt)
local function notempty( s ) return s and s:match( '%S' ) end
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
-- start moving templatestyles and categories inside of table rows
local slast = ''
while slast ~= s do
slast = s
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
end
-- end moving templatestyles and categories inside of table rows
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' ..
subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' ..
subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
-- the next two lines add a newline at the end of lists for the PHP parser
-- [[Special:Diff/849054481]]
-- remove when [[:phab:T191516]] is fixed or OBE
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
else
return sval
end
end
-- Cleans empty tables
local function cleanInfobox()
root = tostring(root)
if has_rows == false then
root = mw.ustring.gsub(root, '<table[^<>]*>%s*</table>', '')
end
end
-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix)
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local function addRow(rowArgs)
if rowArgs.header and rowArgs.header ~= '_BLANK_' then
has_rows = true
has_list_class({ rowArgs.rowclass, rowArgs.class, args.headerclass })
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:tag('th')
:attr('colspan', '2')
:addClass('infobox-header')
:addClass(rowArgs.class)
:addClass(args.headerclass)
-- @deprecated next; target .infobox-<name> .infobox-header
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
if rowArgs.data and not yesno(args.decat) then
root:wikitext(
'[[Category:Pages using infobox templates with ignored data cells]]'
)
end
elseif rowArgs.data and rowArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ rowArgs.rowclass, rowArgs.class })
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:addClass('infobox-label')
-- @deprecated next; target .infobox-<name> .infobox-label
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
dataCell
:attr('colspan', not rowArgs.label and '2' or nil)
:addClass(not rowArgs.label and 'infobox-full-data' or 'infobox-data')
:addClass(rowArgs.class)
-- @deprecated next; target .infobox-<name> .infobox(-full)-data
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
else
table.insert(empty_row_categories, rowArgs.data or '')
end
end
local function renderTitle()
if not args.title then return end
has_rows = true
has_list_class({args.titleclass})
root
:tag('caption')
:addClass('infobox-title')
:addClass(args.titleclass)
-- @deprecated next; target .infobox-<name> .infobox-title
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
has_rows = true
has_list_class({ args.aboveclass })
root
:tag('tr')
:tag('th')
:attr('colspan', '2')
:addClass('infobox-above')
:addClass(args.aboveclass)
-- @deprecated next; target .infobox-<name> .infobox-above
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
has_rows = true
has_list_class({ args.belowclass })
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-below')
:addClass(args.belowclass)
-- @deprecated next; target .infobox-<name> .infobox-below
:cssText(args.belowstyle)
:wikitext(fixChildBoxes(args.below,'td'))
end
local function addSubheaderRow(subheaderArgs)
if subheaderArgs.data and
subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ subheaderArgs.rowclass, subheaderArgs.class })
local row = root:tag('tr')
row:addClass(subheaderArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-subheader')
:addClass(subheaderArgs.class)
:cssText(subheaderArgs.datastyle)
:cssText(subheaderArgs.rowcellstyle)
:wikitext(fixChildBoxes(subheaderArgs.data, 'td'))
else
table.insert(empty_row_categories, subheaderArgs.data or '')
end
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addSubheaderRow({
data = args['subheader' .. tostring(num)],
-- @deprecated next; target .infobox-<name> .infobox-subheader
datastyle = args.subheaderstyle,
rowcellstyle = args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function addImageRow(imageArgs)
if imageArgs.data and
imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ imageArgs.rowclass, imageArgs.class })
local row = root:tag('tr')
row:addClass(imageArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-image')
:addClass(imageArgs.class)
:cssText(imageArgs.datastyle)
:wikitext(fixChildBoxes(imageArgs.data, 'td'))
else
table.insert(empty_row_categories, imageArgs.data or '')
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:addClass('infobox-caption')
-- @deprecated next; target .infobox-<name> .infobox-caption
:cssText(args.captionstyle)
:wikitext(caption)
end
addImageRow({
data = tostring(data),
-- @deprecated next; target .infobox-<name> .infobox-image
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
-- When autoheaders are turned on, preprocesses the rows
local function preprocessRows()
if not args.autoheaders then return end
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
local lastheader
for k, num in ipairs(rownums) do
if args['header' .. tostring(num)] then
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
lastheader = num
elseif args['data' .. tostring(num)] and
args['data' .. tostring(num)]:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
local data = args['data' .. tostring(num)]
if data:gsub(category_in_empty_row_pattern, ''):match('%S') then
lastheader = nil
end
end
end
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
end
-- Gets the union of the header and data argument numbers,
-- and renders them all in order
local function renderRows()
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
-- @deprecated next; target .infobox-<name> rowclass
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
has_rows = true
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-navbar')
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(require('Module:Italic title')._main({}))
end
end
-- Categories in otherwise empty rows are collected in empty_row_categories.
-- This function adds them to the module output. It is not affected by
-- args.decat because this module should not prevent module-external categories
-- from rendering.
local function renderEmptyRowCategories()
for _, s in ipairs(empty_row_categories) do
root:wikitext(s)
end
end
-- Render tracking categories. args.decat == turns off tracking categories.
local function renderTrackingCategories()
if yesno(args.decat) then return end
if args.child == 'yes' then
if args.title then
root:wikitext(
'[[Category:Pages using embedded infobox templates with the title parameter]]'
)
end
elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles using infobox templates with no data rows]]')
end
end
--[=[
Loads the templatestyles for the infobox.
TODO: FINISH loading base templatestyles here rather than in
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.
]=]
local function loadTemplateStyles()
local frame = mw.getCurrentFrame()
local hlist_templatestyles = ''
if lists.hlist_t.found then
hlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.hlist_t.styles }
}
end
local plainlist_templatestyles = ''
if lists.plainlist_t.found then
plainlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.plainlist_t.styles }
}
end
-- See function description
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
}
local templatestyles = ''
if args['templatestyles'] then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] then
child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] then
grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
-- hlist -> plainlist -> base is best-effort to preserve old Common.css ordering.
-- this ordering is not a guarantee because the rows of interest invoking
-- each class may not be on a specific page
hlist_templatestyles,
plainlist_templatestyles,
base_templatestyles,
templatestyles,
child_templatestyles,
grandchild_templatestyles
})
end
-- common functions between the child and non child cases
local function structure_infobox_common()
renderSubheaders()
renderImages()
preprocessRows()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderEmptyRowCategories()
renderTrackingCategories()
cleanInfobox()
end
-- Specify the overall layout of the infobox, with special settings if the
-- infobox is used as a 'child' inside another infobox.
local function _infobox()
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass(args.subbox == 'yes' and 'infobox-subbox' or 'infobox')
:addClass(args.bodyclass)
-- @deprecated next; target .infobox-<name>
:cssText(args.bodystyle)
has_list_class({ args.bodyclass })
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
structure_infobox_common()
return loadTemplateStyles() .. root
end
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
local function preprocessSingleArg(argName)
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
-- Assign the parameters with the given prefixes to the args table, in order, in
-- batches of the step size specified. This is to prevent references etc. from
-- appearing in the wrong order. The prefixTable should be an array containing
-- tables, each of which has two possible fields, a "prefix" string and a
-- "depend" table. The function always parses parameters containing the "prefix"
-- string, but only parses parameters in the "depend" table if the prefix
-- parameter is present and non-blank.
local function preprocessArgs(prefixTable, step)
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or
(v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present
-- and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
-- Do another loop if any arguments are found, even blank ones.
moreArgumentsExist = true
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present
-- and not blank, or we are processing "prefix1" and "prefix" is
-- present and not blank, and if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so
-- that references etc. will display in the expected places. Parameters that
-- depend on another parameter are only processed if that parameter is present,
-- to avoid phantom references appearing in article reference lists.
local function parseDataParameters()
preprocessSingleArg('autoheaders')
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
-- different behaviour for italics if blank or absent
args['italic title'] = origArgs['italic title']
preprocessSingleArg('decat')
preprocessSingleArg('templatestyles')
preprocessSingleArg('child templatestyles')
preprocessSingleArg('grandchild templatestyles')
end
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
function p.infobox(frame)
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
parseDataParameters()
return _infobox()
end
-- For calling via #invoke within a template
function p.infoboxTemplate(frame)
origArgs = {}
for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
parseDataParameters()
return _infobox()
end
return p
bb4pz1h38yoxlugokx6zs6hjugdhkwl
Echinocactus parryi
0
2240629
37019689
35790339
2026-05-02T07:46:01Z
RamsesVII
122819
new better image
37019689
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|tanom nga bulak|date=2022-02}}
{{Taxobox
| name = ''Echinocactus parryi''
| status =
| image = Homalocephala_parryi_4.jpg
| image_caption =
| domain =
| regnum = [[Plantae]]
| divisio = [[Tracheophyta]]
| classis = [[Tanom nga bulak (tanom)|Magnoliopsida]]
| ordo = [[Caryophyllales]]
| familia = [[Cactaceae]]
| genus = ''[[Echinocactus]]''
| species = '''''Echinocactus parryi'''''
| binomial = ''Echinocactus parryi''
| binomial_authority = [[Georg Engelmann|Engelm.]]
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| synonyms = }}
Kaliwatan sa [[tanom nga bulak]] ang '''''Echinocactus parryi'''''.<ref name = "COL"/> Una ning gihulagway ni [[Georg Engelmann|Georg George Engelmann]].<ref name = "col13439151"/> Ang ''Echinocactus parryi'' sakop sa [[kahenera]] nga ''[[Echinocactus]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Cactaceae]].<ref name = "COL"/><ref name = "source"/> Walay nalista nga matang nga sama niini.<ref name = "COL"/>
<!-- katapusan sa gisulat -->
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 13439151|accessdate= 2019-11-11}}</ref>
<ref name = "col13439151"> (2011) , Checklist of CITES Species Part 1 CITES species index</ref>
<ref name = "source">Tom Orrell (custodian), Dave Nicolson (ed). (2019). ITIS Global: The Integrated Taxonomic Information System (version Jun 2017). In: Species 2000 & ITIS Catalogue of Life, 2019 Annual Checklist (Roskov Y., Ower G., Orrell T., Nicolson D., Bailly N., Kirk P.M., Bourgoin T., DeWalt R.E., Decock W., Nieukerken E. van, Zarucchi J., Penev L., eds.). Digital resource at www.catalogueoflife.org/annual-checklist/2019. Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X.</ref>
</references>
[[Kategoriya:Tanom]]
[[Kategoriya:Echinocactus]]
h9o1vuu749elattf3xg58itfw9vc1t9
Echinocactus polycephalus
0
2240641
37019695
35790341
2026-05-02T11:18:02Z
RamsesVII
122819
new better image
37019695
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|tanom nga bulak|date=2022-02}}
{{Taxobox
| name = ''Echinocactus polycephalus''
| status =
| image = Homalocephala_polycephala_polycephala_21.jpg
| image_caption =
| domain =
| regnum = [[Plantae]]
| divisio = [[Tracheophyta]]
| classis = [[Tanom nga bulak (tanom)|Magnoliopsida]]
| ordo = [[Caryophyllales]]
| familia = [[Cactaceae]]
| genus = ''[[Echinocactus]]''
| species = '''''Echinocactus polycephalus'''''
| binomial = ''Echinocactus polycephalus''
| binomial_authority = [[Georg Engelmann|Engelm.]] & J.M. Bigelow
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| synonyms = }}
Kaliwatan sa [[tanom nga bulak]] ang '''''Echinocactus polycephalus'''''.<ref name = "COL"/> Una ning gihulagway ni [[Georg Engelmann|Georg George Engelmann]] ug J.M. Bigelow.<ref name = "col13438228"/> Ang ''Echinocactus polycephalus'' sakop sa [[kahenera]] nga ''[[Echinocactus]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Cactaceae]].<ref name = "COL"/><ref name = "source"/>
Kini nga matang hayop na sabwag sa:
* [[Amerika Sentral]]
* [[Amihanang Amerika]]
== Matang nga nahiubos ==
Ang kaliwatan gibahinbahin ngadto sa matang nga nahiubos:<ref name = "COL"/>
* ''E. p. polycephalus''
* ''E. p. xeranthemoides''
<!-- katapusan sa gisulat -->
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 13438228|accessdate= 2019-11-11}}</ref>
<ref name = "col13438228"> (2001) , database, Comisión Nacional para el Conocimiento y Uso de la Biodiversidad</ref>
<ref name = "source">Tom Orrell (custodian), Dave Nicolson (ed). (2019). ITIS Global: The Integrated Taxonomic Information System (version Jun 2017). In: Species 2000 & ITIS Catalogue of Life, 2019 Annual Checklist (Roskov Y., Ower G., Orrell T., Nicolson D., Bailly N., Kirk P.M., Bourgoin T., DeWalt R.E., Decock W., Nieukerken E. van, Zarucchi J., Penev L., eds.). Digital resource at www.catalogueoflife.org/annual-checklist/2019. Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X.</ref>
</references>
<gallery>
Echinocactus polycephalus (Cotton Top Cactus) above Mesquite Springs Death Valley.jpg
Echinocactus polycephalus 2.jpg
Echinocactus polycephalus 3.jpg
Echinocactus polycephalus 4.jpg
Echinocactus polycephalus 5.jpg
Echinocactus polycephalus 6.jpg
</gallery>
[[Kategoriya:Tanom]]
[[Kategoriya:Tanom sa Amerika Sentral]]
[[Kategoriya:Tanom sa Amihanang Amerika]]
[[Kategoriya:Echinocactus]]
2vst8m4wbeo99jpzs2cjbci1kktv6s6
Davao Occidental
0
2360089
37019625
37019472
2026-05-01T15:51:36Z
Exec8
10305
37019625
wikitext
text/x-wiki
{{Infobox settlement
| name = Davao Occidental
| settlement_type = Lalawigan
| image_skyline =
| image_alt =
| image_caption =
| image_flag =
| flag_size =
| image_seal =
| seal_size =
| image_shield =
| shield_alt =
| nickname =
| motto =
| image_map = Davao Occidental in Philippines.svg
| map_alt =
| map_caption = Mapa sa Pilipinas uban sa Davao Occidental nagpasiugda
| latd = 06 | latm = 05 | latNS = N
| longd = 125 | longm = 40 | longEW = E
| coordinates_region = PH
| coordinates_display = inline,title
| coordinates_footnotes =
| subdivision_type = Bansa
| subdivision_name = {{flag|Philippines}}
| subdivision_type1 = Rehiyon
| subdivision_name1 = [[Rehiyon sa Davao]] (Rehiyon XI)
| established_title = Tukoron
| established_date = 2013
| seat_type = Kapital
| seat = [[Malita, Davao Occidental|Malita]]
| leader_party =
| government_type = Probensya sa Pilipinas
| leader_title = Gobernador
| leader_name =
| leader_title1 = Bise Gobernador
| leader_name1 =
| area_total_km2 = 2163.45
| area_rank =
| area_note =
| population_total = 293780
| population_as_of = 2010
| population_rank =
| population_density_km2 = auto
| population_density_rank =
| population_note =
| elevation_m =
| demographics_type1 = Divisions
| demographics1_footnotes = <!-- for references: use <ref> tags -->
| demographics1_title2 = Dakbayan
| demographics1_info2 = 0
| demographics1_title3 = Lungsod
| demographics1_info3 = 5
| demographics1_title4 = Barangay
| demographics1_info4 = 105
| demographics1_title5 = Distrito
| demographics1_info5 = Nga nag-inusara nga distrito
| blank_name_sec1 = Sinultihan
| blank_info_sec1 = Sinugboanon, Tagalog, English
| timezone = Oras
| utc_offset = +8
| postal_code_type = Kodigo Postal
| postal_code =
| iso_code =
| website =
| footnotes =
}}
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
=== Politikal ===
==== Mga lungsod ====
* [[Don Marcelino, Davao Occidental|Don Marcelino]]
* [[Jose Abad Santos, Davao Occidental|Jose Abad Santos]]
* [[Malita, Davao Occidental|Malita]]
* [[Santa Maria, Davao Occidental|Santa Maria]]
* [[Sarangani, Davao Occidental|Sarangani]]
== Mga sumpay sa gawas ==
* [http://www.nscb.gov.ph/activestats/psgc/default.asp Philippine Standard Geographic Code] {{Webarchive|url=https://web.archive.org/web/20120413163013/http://www.nscb.gov.ph/activestats/psgc/default.asp |date=2012-04-13 }}
== Mga Reperensya ==
{{reflist|2}}
{{Davao de Oro}}
{{Rehiyon sa Davao}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
t9toupvvn60d1b8w1y1e2eudbqhydt7
37019646
37019625
2026-05-01T16:19:36Z
Exec8
10305
37019646
wikitext
text/x-wiki
[[File:{{PH wikidata|image_map}}|280px|right]]
Ang '''{{PH wikidata|name}}''' kay {{PH wikidata|income_class}} sa rehiyon sa {{PH wikidata|province}}, [[Pilipinas]]. Sumala sa senso sa {{wikidata|qualifier|single|P1082|P585}}, kini adunay populasyon nga {{PH wikidata|population_total}} ka tawo ug {{PH wikidata|household}} ka panimalay. Kini adunay gilapdon nga {{PH wikidata|area}} sq. km. km. Ang kodigo sa telepono kay {{PH wikidata|area_code}}. Ang kapital ni ini kay {{#property:P36}}.
=== Politikal ===
==== Mga lungsod ====
* [[Don Marcelino, Davao Occidental|Don Marcelino]]
* [[Jose Abad Santos, Davao Occidental|Jose Abad Santos]]
* [[Malita, Davao Occidental|Malita]]
* [[Santa Maria, Davao Occidental|Santa Maria]]
* [[Sarangani, Davao Occidental|Sarangani]]
== Mga sumpay sa gawas ==
* [http://www.nscb.gov.ph/activestats/psgc/default.asp Philippine Standard Geographic Code] {{Webarchive|url=https://web.archive.org/web/20120413163013/http://www.nscb.gov.ph/activestats/psgc/default.asp |date=2012-04-13 }}
== Mga Reperensya ==
{{reflist|2}}
{{Davao de Oro}}
{{Rehiyon sa Davao}}
[[Kategoriya:Mga Lalawigan sa Pilipinas]]
9m9i5kpczowhq1v9s8aojaq7i4tzcfw
Module:Location map
828
2796135
37019643
35070367
2026-05-01T16:10:59Z
Exec8
10305
37019643
Scribunto
text/plain
require('strict')
local p = {}
local getArgs = require('Module:Arguments').getArgs
local function round(n, decimals)
local pow = 10^(decimals or 0)
return math.floor(n * pow + 0.5) / pow
end
function p.getMapParams(map, frame)
if not map then
error('The name of the location map definition to use must be specified', 2)
end
local moduletitle = mw.title.new('Module:Location map/data/' .. map)
if not moduletitle then
error(string.format('%q is not a valid name for a location map definition', map), 2)
elseif moduletitle.exists then
local mapData = mw.loadData('Module:Location map/data/' .. map)
return function(name, params)
if name == nil then
return 'Module:Location map/data/' .. map
elseif mapData[name] == nil then
return ''
elseif params then
return mw.message.newRawMessage(tostring(mapData[name]), unpack(params)):plain()
else
return mapData[name]
end
end
else
error('Unable to find the specified location map definition: "Module:Location map/data/' .. map .. '" does not exist', 2)
end
end
function p.data(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local params = {}
for k,v in ipairs(args) do
if k > 2 then
params[k-2] = v
end
end
return map(args[2], #params ~= 0 and params)
end
local hemisphereMultipliers = {
longitude = { W = -1, w = -1, E = 1, e = 1 },
latitude = { S = -1, s = -1, N = 1, n = 1 }
}
local function decdeg(degrees, minutes, seconds, hemisphere, decimal, direction)
if decimal then
if degrees then
error('Decimal and DMS degrees cannot both be provided for ' .. direction, 2)
elseif minutes then
error('Minutes can only be provided with DMS degrees for ' .. direction, 2)
elseif seconds then
error('Seconds can only be provided with DMS degrees for ' .. direction, 2)
elseif hemisphere then
error('A hemisphere can only be provided with DMS degrees for ' .. direction, 2)
end
local retval = tonumber(decimal)
if retval then
return retval
end
error('The value "' .. decimal .. '" provided for ' .. direction .. ' is not valid', 2)
elseif seconds and not minutes then
error('Seconds were provided for ' .. direction .. ' without minutes also being provided', 2)
elseif not degrees then
if minutes then
error('Minutes were provided for ' .. direction .. ' without degrees also being provided', 2)
elseif hemisphere then
error('A hemisphere was provided for ' .. direction .. ' without degrees also being provided', 2)
end
return nil
end
decimal = tonumber(degrees)
if not decimal then
error('The degree value "' .. degrees .. '" provided for ' .. direction .. ' is not valid', 2)
elseif minutes and not tonumber(minutes) then
error('The minute value "' .. minutes .. '" provided for ' .. direction .. ' is not valid', 2)
elseif seconds and not tonumber(seconds) then
error('The second value "' .. seconds .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal + (minutes or 0)/60 + (seconds or 0)/3600
if hemisphere then
local multiplier = hemisphereMultipliers[direction][hemisphere]
if not multiplier then
error('The hemisphere "' .. hemisphere .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal * multiplier
end
return decimal
end
-- Finds a parameter in a transclusion of {{Coord}}.
local function coord2text(para,coord) -- this should be changed for languages which do not use Arabic numerals or the degree sign
local lat, long = mw.ustring.match(coord,'<span class="p%-latitude latitude">([^<]+)</span><span class="p%-longitude longitude">([^<]+)</span>')
if lat then
return tonumber(para == 'longitude' and long or lat)
end
local result = mw.text.split(mw.ustring.match(coord,'%-?[%.%d]+°[NS] %-?[%.%d]+°[EW]') or '', '[ °]')
if para == 'longitude' then result = {result[3], result[4]} end
if not tonumber(result[1]) or not result[2] then
mw.log('Malformed coordinates value')
mw.logObject(para, 'para')
mw.logObject(coord, 'coord')
return error('Malformed coordinates value', 2)
end
return tonumber(result[1]) * hemisphereMultipliers[para][result[2]]
end
-- effectively make removeBlanks false for caption and maplink, and true for everything else
-- if useWikidata is present but blank, convert it to false instead of nil
-- p.top, p.bottom, and their callers need to use this
function p.valueFunc(key, value)
if value then
value = mw.text.trim(value)
end
if value ~= '' or key == 'caption' or key == 'maplink' then
return value
elseif key == 'useWikidata' then
return false
end
end
local function getContainerImage(args, map)
if args.AlternativeMap then
return args.AlternativeMap
elseif args.relief then
local digits = mw.ustring.match(args.relief,'^[1-9][0-9]?$') or '1' -- image1 to image99
if map('image' .. digits) ~= '' then
return map('image' .. digits)
end
end
return map('image')
end
function p.top(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true, valueFunc = p.valueFunc})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local width
local default_as_number = tonumber(mw.ustring.match(tostring(args.default_width),"%d*"))
if not args.width then
width = round((default_as_number or 240) * (tonumber(map('defaultscale')) or 1))
elseif mw.ustring.sub(args.width, -2) == 'px' then
width = mw.ustring.sub(args.width, 1, -3)
else
width = args.width
end
local width_as_number = tonumber(mw.ustring.match(tostring(width),"%d*")) or 0;
if width_as_number == 0 then
-- check to see if width is junk. If it is, then use default calculation
width = round((default_as_number or 240) * (tonumber(map('defaultscale')) or 1))
width_as_number = tonumber(mw.ustring.match(tostring(width),"%d*")) or 0;
end
if args.max_width ~= "" and args.max_width ~= nil then
-- check to see if width bigger than max_width
local max_as_number = tonumber(mw.ustring.match(args.max_width,"%d*")) or 0;
if width_as_number>max_as_number and max_as_number>0 then
width = args.max_width;
end
end
local retval = frame:extensionTag{name = 'templatestyles', args = {src = 'Module:Location map/styles.css'}}
if args.float == 'center' then
retval = retval .. '<div class="center">'
end
if args.caption and args.caption ~= '' and args.border ~= 'infobox' then
retval = retval .. '<div class="locmap noresize thumb '
if args.float == '"left"' or args.float == 'left' then
retval = retval .. 'tleft'
elseif args.float == '"center"' or args.float == 'center' or args.float == '"none"' or args.float == 'none' then
retval = retval .. 'tnone'
else
retval = retval .. 'tright'
end
retval = retval .. '"><div class="thumbinner" style="width:' .. (width + 2) .. 'px'
if args.border == 'none' then
retval = retval .. ';border:none'
elseif args.border then
retval = retval .. ';border-color:' .. args.border
end
retval = retval .. '"><div style="position:relative;width:' .. width .. 'px' .. (args.border ~= 'none' and ';border:1px solid lightgray">' or '">')
else
retval = retval .. '<div class="locmap" style="width:' .. width .. 'px;'
if args.float == '"left"' or args.float == 'left' then
retval = retval .. 'float:left;clear:left'
elseif args.float == '"center"' or args.float == 'center' then
retval = retval .. 'float:none;clear:both;margin-left:auto;margin-right:auto'
elseif args.float == '"none"' or args.float == 'none' then
retval = retval .. 'float:none;clear:none'
else
retval = retval .. 'float:right;clear:right'
end
retval = retval .. '"><div style="width:' .. width .. 'px;padding:0"><div style="position:relative;width:' .. width .. 'px">'
end
local image = getContainerImage(args, map)
local currentTitle = mw.title.getCurrentTitle()
retval = string.format(
'%s[[File:%s|%spx|%s%s|class=notpageimage noviewer]]',
retval,
image,
width,
args.alt or ((args.label or currentTitle.text) .. ' is located in ' .. map('name')),
args.maplink and ('|link=' .. args.maplink) or ''
)
if args.caption and args.caption ~= '' then
if (currentTitle.namespace == 0) and mw.ustring.find(args.caption, '##') then
retval = retval .. '[[Category:Pages using location map with a double number sign in the caption]]'
end
end
if args.overlay_image then
return retval .. '<div style="position:absolute;top:0;left:0">[[File:' .. args.overlay_image .. '|' .. width .. 'px|class=notpageimage noviewer]]</div>'
else
return retval
end
end
function p.bottom(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true, valueFunc = p.valueFunc})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local retval = '</div>'
local currentTitle = mw.title.getCurrentTitle()
if not args.caption or args.border == 'infobox' then
if args.border then
retval = retval .. '<div style="padding-top:0.2em">'
else
retval = retval .. '<div style="font-size:91%;padding-top:3px">'
end
retval = retval
.. (args.caption or (args.label or currentTitle.text) .. ' (' .. map('name') .. ')')
.. '</div>'
elseif args.caption ~= '' then
-- This is not the pipe trick. We're creating a link with no text on purpose, so that CSS can give us a nice image
retval = retval .. '<div class="thumbcaption"><div class="magnify">[[:File:' .. getContainerImage(args, map) .. '| ]]</div>' .. args.caption .. '</div>'
end
if args.switcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">' .. args.switcherLabel .. '</span>'
elseif args.autoSwitcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">Show map of ' .. map('name') .. '</span>'
end
retval = retval .. '</div></div>'
if args.caption_undefined then
mw.log('Removed parameter caption_undefined used.')
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
retval = retval .. '[[Category:Location maps with removed parameters|caption_undefined]]'
end
end
if map('skew') ~= '' or map('lat_skew') ~= '' or map('crosses180') ~= '' or map('type') ~= '' then
mw.log('Removed parameter used in map definition ' .. map())
if currentTitle.namespace == 0 then
local key = (map('skew') ~= '' and 'skew' or '') ..
(map('lat_skew') ~= '' and 'lat_skew' or '') ..
(map('crosses180') ~= '' and 'crosses180' or '') ..
(map('type') ~= '' and 'type' or '')
retval = retval .. '[[Category:Location maps with removed parameters|' .. key .. ' ]]'
end
end
if string.find(map('name'), '|', 1, true) then
mw.log('Pipe used in name of map definition ' .. map())
if currentTitle.namespace == 0 then
retval = retval .. '[[Category:Location maps with a name containing a pipe]]'
end
end
if args.float == 'center' then
retval = retval .. '</div>'
end
return retval
end
local function markOuterDiv(x, y, imageDiv, labelDiv, label_size)
return mw.html.create('div')
:addClass('od')
:addClass('notheme') -- T236137
:cssText('top:' .. round(y, 3) .. '%;left:' .. round(x, 3) .. '%;font-size:' .. label_size .. '%')
:node(imageDiv)
:node(labelDiv)
end
local function markImageDiv(mark, marksize, label, link, alt, title)
local builder = mw.html.create('div')
:addClass('id')
:cssText('left:-' .. round(marksize / 2) .. 'px;top:-' .. round(marksize / 2) .. 'px')
:attr('title', title)
if marksize ~= 0 then
builder:wikitext(string.format(
'[[File:%s|%dx%dpx|%s|link=%s%s|class=notpageimage noviewer]]',
mark,
marksize,
marksize,
label,
link,
alt and ('|alt=' .. alt) or ''
))
end
return builder
end
local function markLabelDiv(label, label_size, label_width, position, background, x, marksize)
if tonumber(label_size) == 0 then
return mw.html.create('div'):addClass('l0'):wikitext(label)
end
local builder = mw.html.create('div')
:cssText('width:' .. label_width .. 'em')
local distance = round(marksize / 2 + 1)
if position == 'top' then -- specified top
builder:addClass('pv'):cssText('bottom:' .. distance .. 'px;left:' .. (-label_width / 2) .. 'em')
elseif position == 'bottom' then -- specified bottom
builder:addClass('pv'):cssText('top:' .. distance .. 'px;left:' .. (-label_width / 2) .. 'em')
elseif position == 'left' or (tonumber(x) > 70 and position ~= 'right') then -- specified left or autodetected to left
builder:addClass('pl'):cssText('right:' .. distance .. 'px')
else -- specified right or autodetected to right
builder:addClass('pr'):cssText('left:' .. distance .. 'px')
end
builder = builder:tag('div')
:wikitext(label)
if background then
builder:cssText('background-color:' .. background)
end
return builder:done()
end
local function getX(longitude, left, right)
local width = (right - left) % 360
if width == 0 then
width = 360
end
local distanceFromLeft = (longitude - left) % 360
-- the distance needed past the map to the right equals distanceFromLeft - width. the distance needed past the map to the left equals 360 - distanceFromLeft. to minimize page stretching, go whichever way is shorter
if distanceFromLeft - width / 2 >= 180 then
distanceFromLeft = distanceFromLeft - 360
end
return 100 * distanceFromLeft / width
end
local function getY(latitude, top, bottom)
return 100 * (top - latitude) / (top - bottom)
end
function p.mark(frame, args, map)
if not args then
args = getArgs(frame, {wrappers = 'Template:Location map~'})
end
local mapnames = {}
if not map then
if args[1] then
map = {}
for mapname in mw.text.gsplit(args[1], '#', true) do
map[#map + 1] = p.getMapParams(mw.ustring.gsub(mapname, '^%s*(.-)%s*$', '%1'), frame)
mapnames[#mapnames + 1] = mapname
end
if #map == 1 then map = map[1] end
else
map = p.getMapParams('World', frame)
args[1] = 'World'
end
end
if type(map) == 'table' then
local outputs = {}
local oldargs = args[1]
for k,v in ipairs(map) do
args[1] = mapnames[k]
outputs[k] = tostring(p.mark(frame, args, v))
end
args[1] = oldargs
return table.concat(outputs, '#PlaceList#') .. '#PlaceList#'
end
local x, y, longitude, latitude
longitude = decdeg(args.lon_deg, args.lon_min, args.lon_sec, args.lon_dir, args.long, 'longitude')
latitude = decdeg(args.lat_deg, args.lat_min, args.lat_sec, args.lat_dir, args.lat, 'latitude')
if args.excludefrom then
-- If this mark is to be excluded from certain maps entirely (useful in the context of multiple maps)
for exclusionmap in mw.text.gsplit(args.excludefrom, '#', true) do
-- Check if this map is excluded. If so, return an empty string.
if args[1] == exclusionmap then
return ''
end
end
end
local builder = mw.html.create()
local currentTitle = mw.title.getCurrentTitle()
if args.coordinates then
-- Temporarily removed to facilitate infobox conversion. See [[Wikipedia:Coordinates in infoboxes]]
-- if longitude or latitude then
-- error('Coordinates from [[Module:Coordinates]] and individual coordinates cannot both be provided')
-- end
longitude = coord2text('longitude', args.coordinates)
latitude = coord2text('latitude', args.coordinates)
elseif not longitude and not latitude and args.useWikidata then
-- If they didn't provide either coordinate, try Wikidata. If they provided one but not the other, don't.
local entity = mw.wikibase.getEntity()
if entity and entity.claims and entity.claims.P625 and entity.claims.P625[1].mainsnak.snaktype == 'value' then
local value = entity.claims.P625[1].mainsnak.datavalue.value
longitude, latitude = value.longitude, value.latitude
end
if args.link and (currentTitle.namespace == 0) then
builder:wikitext('[[Category:Location maps with linked markers with coordinates from Wikidata]]')
end
end
if not longitude then
error('No value was provided for longitude')
elseif not latitude then
error('No value was provided for latitude')
end
if currentTitle.namespace > 0 then
if (not args.lon_deg) ~= (not args.lat_deg) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Degrees]]')
elseif (not args.lon_min) ~= (not args.lat_min) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Minutes]]')
elseif (not args.lon_sec) ~= (not args.lat_sec) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Seconds]]')
elseif (not args.lon_dir) ~= (not args.lat_dir) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Hemisphere]]')
elseif (not args.long) ~= (not args.lat) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Decimal]]')
end
end
if ((tonumber(args.lat_deg) or 0) < 0) and ((tonumber(args.lat_min) or 0) ~= 0 or (tonumber(args.lat_sec) or 0) ~= 0 or (args.lat_dir and args.lat_dir ~='')) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if ((tonumber(args.lon_deg) or 0) < 0) and ((tonumber(args.lon_min) or 0) ~= 0 or (tonumber(args.lon_sec) or 0) ~= 0 or (args.lon_dir and args.lon_dir ~= '')) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if (((tonumber(args.lat_min) or 0) < 0) or ((tonumber(args.lat_sec) or 0) < 0)) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if (((tonumber(args.lon_min) or 0) < 0) or ((tonumber(args.lon_sec) or 0) < 0)) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if args.skew or args.lon_shift or args.markhigh then
mw.log('Removed parameter used in invocation.')
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
local key = (args.skew and 'skew' or '') ..
(args.lon_shift and 'lon_shift' or '') ..
(args.markhigh and 'markhigh' or '')
builder:wikitext('[[Category:Location maps with removed parameters|' .. key ..' ]]')
end
end
if map('x') ~= '' then
x = tonumber(mw.ext.ParserFunctions.expr(map('x', { latitude, longitude })))
else
x = tonumber(getX(longitude, map('left'), map('right')))
end
if map('y') ~= '' then
y = tonumber(mw.ext.ParserFunctions.expr(map('y', { latitude, longitude })))
else
y = tonumber(getY(latitude, map('top'), map('bottom')))
end
if (x < 0 or x > 100 or y < 0 or y > 100) and not args.outside then
mw.log('Mark placed outside map boundaries without outside flag set. x = ' .. x .. ', y = ' .. y)
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
local key = currentTitle.prefixedText
builder:wikitext('[[Category:Location maps with marks outside map and outside parameter not set|' .. key .. ' ]]')
end
end
local mark = args.mark or map('mark')
if mark == '' then
mark = 'Red pog.svg'
end
local marksize = tonumber(args.marksize) or tonumber(map('marksize')) or 8
local imageDiv = markImageDiv(mark, marksize, args.label or mw.title.getCurrentTitle().text, args.link or '', args.alt, args[2])
local label_size = args.label_size or 91
local labelDiv
if args.label and args.position ~= 'none' then
labelDiv = markLabelDiv(args.label, label_size, args.label_width or 6, args.position, args.background, x, marksize)
end
return builder:node(markOuterDiv(x, y, imageDiv, labelDiv, label_size))
end
local function switcherSeparate(s)
if s == nil then return {} end
local retval = {}
for i in string.gmatch(s .. '#', '([^#]*)#') do
i = mw.text.trim(i)
retval[#retval + 1] = (i ~= '' and i)
end
return retval
end
function p.main(frame, args, map)
local caption_list = {}
if not args then
args = getArgs(frame, {wrappers = 'Template:Location map', valueFunc = p.valueFunc})
end
if args.useWikidata == nil then
args.useWikidata = true
end
if not map then
if args[1] then
map = {}
for mapname in string.gmatch(args[1], '[^#]+') do
map[#map + 1] = p.getMapParams(mw.ustring.gsub(mapname, '^%s*(.-)%s*$', '%1'), frame)
end
if args['caption'] then
if args['caption'] == "" then
while #caption_list < #map do
caption_list[#caption_list + 1] = args['caption']
end
else
for caption in mw.text.gsplit(args['caption'], '##', true) do
caption_list[#caption_list + 1] = caption
end
end
end
if #map == 1 then map = map[1] end
else
map = p.getMapParams('World', frame)
end
end
if type(map) == 'table' then
local altmaps = switcherSeparate(args.AlternativeMap)
if #altmaps > #map then
error(string.format('%d AlternativeMaps were provided, but only %d maps were provided', #altmaps, #map))
end
local overlays = switcherSeparate(args.overlay_image)
if #overlays > #map then
error(string.format('%d overlay_images were provided, but only %d maps were provided', #overlays, #map))
end
if #caption_list > #map then
error(string.format('%d captions were provided, but only %d maps were provided', #caption_list, #map))
end
local outputs = {}
args.autoSwitcherLabel = true
for k,v in ipairs(map) do
args.AlternativeMap = altmaps[k]
args.overlay_image = overlays[k]
args.caption = caption_list[k]
outputs[k] = p.main(frame, args, v)
end
return '<div class="switcher-container">' .. table.concat(outputs) .. '</div>'
else
return p.top(frame, args, map) .. tostring( p.mark(frame, args, map) ) .. p.bottom(frame, args, map)
end
end
return p
07icxbtq9eg84dyuhbuyo1sfebx4tq4
Module:Wikidata
828
2799984
37019595
35070365
2026-05-01T15:12:36Z
Exec8
10305
.
37019595
Scribunto
text/plain
-- vim: set noexpandtab ft=lua ts=4 sw=4:
require('strict')
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 https://ifaa.unifr.ch/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] = "[https://ifaa.unifr.ch/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
0ut9ea611aebtqxr1j5hmyqvjdhhyh8
37019599
37019595
2026-05-01T15:18:22Z
Exec8
10305
Reverted edit by [[Special:Contributions/Exec8|Exec8]] ([[User talk:Exec8|talk]]) to last revision by [[User:Uzume|Uzume]]
35070365
Scribunto
text/plain
-- vim: set noexpandtab ft=lua ts=4 sw=4:
require('strict')
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
551htl9xz8r648sx0x2bparbmcxk8vx
37019608
37019599
2026-05-01T15:39:13Z
Exec8
10305
37019608
Scribunto
text/plain
-- vim: set noexpandtab ft=lua ts=4 sw=4:
require('strict')
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 https://ifaa.unifr.ch/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] = "[https://ifaa.unifr.ch/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
0ut9ea611aebtqxr1j5hmyqvjdhhyh8
Module:Roman
828
2800002
37019638
5726873
2026-05-01T16:06:08Z
Exec8
10305
37019638
Scribunto
text/plain
-- This module implements {{Roman}}.
require[[strict]]
local p = {}
-- This function implements the {{overline}} template.
local function overline(s)
return mw.ustring.format( '<span style="text-decoration:overline;">%s</span>', s )
end
-- Gets the Roman numerals for a given numeral table. Returns both the string of
-- numerals and the value of the number after it is finished being processed.
local function getLetters(num, t)
local ret = {}
for _, v in ipairs(t) do
local val, letter = unpack(v)
while num >= val do
num = num - val
table.insert(ret, letter)
end
end
return table.concat(ret), num
end
-- The main control flow of the module.
local function _main(args)
-- Get input and exit displaying nothing if the input is empty.
if args[1] == nil then return end
local num = tonumber(args[1])
if not num or num < 0 or num == math.huge then
error('Invalid number ' .. args[1], 2)
elseif num == 0 then
return 'N'
end
-- Return a message for numbers too big to be expressed in Roman numerals.
if num >= 5000000 then
return args[2] or 'N/A'
end
local ret = ''
-- Find the Roman numerals for the large part of numbers.
-- 23 April 2016 - tweaked to >= 4000 to accept big Roman 'IV'
-- The if statement is not strictly necessary, but makes the algorithm
-- more efficient for smaller numbers.
if num >= 4000 then
local bigRomans = {
{ 1000000, 'M' },
{ 900000, 'CM' }, { 500000, 'D' }, { 400000, 'CD' }, { 100000, 'C' },
{ 90000, 'XC' }, { 50000, 'L' }, { 40000, 'XL' }, { 10000, 'X' },
{ 9000, 'IX' }, { 5000, 'V' }, { 4000, 'IV' },
}
local bigLetters
bigLetters, num = getLetters(num, bigRomans)
ret = overline(bigLetters)
end
-- Find the Roman numerals for numbers less than the big Roman threshold.
local smallRomans = {
{ 1000, 'M' },
{ 900, 'CM' }, { 500, 'D' }, { 400, 'CD' }, { 100, 'C' },
{ 90, 'XC' }, { 50, 'L' }, { 40, 'XL' }, { 10, 'X' },
{ 9, 'IX' }, { 5, 'V' }, { 4, 'IV' }, { 1, 'I' }
}
local smallLetters = getLetters( num, smallRomans )
ret = ret .. smallLetters
if args.fraction == 'yes' then
-- Find the Roman numerals for the fractional parts of numbers.
-- If num is not a whole number, add half of 1/1728 (the smallest unit) to equate to rounding.
-- Ensure we're not less than the smallest unit or larger than 1 - smallest unit
-- to avoid getting two "half" symbols or no symbols at all
num = num - math.floor(num)
if num ~= 0 then
num = math.max(1.1/1728, math.min(1727.1/1728, num + 1/3456))
end
local fractionalRomans = {
{ 1/2, 'S' }, { 5/12, "''':'''•''':'''" }, { 1/3, "'''::'''" },
{ 1/4, "''':'''•" }, { 1/6, "''':'''" }, { 1/12, '•' },
{ 1/24, 'Є' }, { 1/36, 'ƧƧ' }, { 1/48, 'Ɔ' }, { 1/72, 'Ƨ' }, { 1/144, '<s>Ƨ</s>' },
{ 1/288, '℈' }, { 1/1728, '»' },
}
local fractionalLetters = getLetters(num, fractionalRomans)
ret = ret .. fractionalLetters
end
return ret
end
function p.main(frame)
-- If called via #invoke, use the args passed into the invoking
-- template, or the args passed to #invoke if any exist. Otherwise
-- assume args are being passed directly in from the debug console
-- or from another Lua module.
local origArgs
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
for k, v in pairs(frame.args) do
origArgs = frame.args
break
end
else
origArgs = frame
end
-- Trim whitespace and remove blank arguments.
local args = {}
for k, v in pairs(origArgs) do
if type( v ) == 'string' then
v = mw.text.trim(v)
end
if v ~= '' then
args[k] = v
end
end
-- exit if not given anything
if args == nil or args == {} then return end
-- Given mathematical expression, simplify to a number
if type(args[1]) == 'string' then
local success, result = pcall(mw.ext.ParserFunctions.expr, args[1])
if success then
args[1] = result
end -- else, pass to _main routine and try to let Lua's tonumber handle it
end
return _main(args)
end
return p
4wa0ln3ffmm2ip5y87j3mrl9kt1i95w
Module:Check for unknown parameters
828
2857477
37019555
35403102
2026-05-01T14:42:28Z
Exec8
10305
.
37019555
Scribunto
text/plain
-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is
-- not on the list
require ('strict');
local p = {}
local mapframe_params = {
'coord',
'coordinates',
'id',
'qid',
'mapframe',
'mapframe-area_km2',
'mapframe-area_mi2',
'mapframe-caption',
'mapframe-coord',
'mapframe-coordinates',
'mapframe-custom',
'mapframe-frame-coord',
'mapframe-frame-coordinates',
'mapframe-frame-height',
'mapframe-frame-width',
'mapframe-geomask',
'mapframe-geomask-fill',
'mapframe-geomask-fill-opacity',
'mapframe-geomask-stroke-color',
'mapframe-geomask-stroke-colour',
'mapframe-geomask-stroke-width',
'mapframe-height',
'mapframe-id',
'mapframe-length_km',
'mapframe-length_mi',
'mapframe-line',
'mapframe-line-stroke-color',
'mapframe-line-stroke-colour',
'mapframe-marker',
'mapframe-marker-color',
'mapframe-marker-colour',
'mapframe-point',
'mapframe-population',
'mapframe-shape',
'mapframe-shape-fill',
'mapframe-shape-fill-opacity',
'mapframe-shape-stroke-color',
'mapframe-shape-stroke-colour',
'mapframe-stroke-color',
'mapframe-stroke-colour',
'mapframe-stroke-width',
'mapframe-switcher',
'mapframe-type',
'mapframe-width',
'mapframe-wikidata',
'mapframe-zoom'
}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and s:match('%S')
end
local function clean(text)
-- Return text cleaned for display and truncated if too long.
-- Strip markers are replaced with dummy text representing the original wikitext.
local pos, truncated
local function truncate(text)
if truncated then
return ''
end
if mw.ustring.len(text) > 25 then
truncated = true
text = mw.ustring.sub(text, 1, 25) .. '...'
end
return mw.text.nowiki(text)
end
local parts = {}
for before, tag, remainder in text:gmatch('([^\127]*)\127[^\127]*%-(%l+)%-[^\127]*\127()') do
pos = remainder
table.insert(parts, truncate(before) .. '<' .. tag .. '>...</' .. tag .. '>')
end
table.insert(parts, truncate(text:sub(pos or 1)))
return table.concat(parts)
end
function p._check(args, pargs)
if type(args) ~= "table" or type(pargs) ~= "table" then
-- TODO: error handling
return
end
-- create the list of known args, regular expressions, and the return string
local knownargs = {}
if isnotempty(args['mapframe_args']) then
for _, v in ipairs(mapframe_params) do
knownargs[v] = 1
end
end
local regexps = {}
for k, v in pairs(args) do
if type(k) == 'number' then
v = trim(v)
knownargs[v] = 1
elseif k:find('^regexp[1-9][0-9]*$') then
table.insert(regexps, '^' .. v .. '$')
end
end
-- loop over the parent args, and make sure they are on the list
local ignoreblank = isnotempty(args['ignoreblank'])
local showblankpos = isnotempty(args['showblankpositional'])
local values = {}
for k, v in pairs(pargs) do
if type(k) == 'string' and knownargs[k] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(k, regexp) then
knownflag = true
break
end
end
if not knownflag and ( not ignoreblank or isnotempty(v) ) then
table.insert(values, clean(k))
end
elseif type(k) == 'number' and knownargs[tostring(k)] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(tostring(k), regexp) then
knownflag = true
break
end
end
if not knownflag and ( showblankpos or isnotempty(v) ) then
table.insert(values, k .. ' = ' .. clean(v))
end
end
end
-- add results to the output tables
local res = {}
if #values > 0 then
local unknown_text = args['unknown'] or 'Found _VALUE_, '
if mw.getCurrentFrame():preprocess( "{{REVISIONID}}" ) == "" then
local preview_text = args['preview']
if isnotempty(preview_text) then
preview_text = require('Module:If preview')._warning({preview_text})
elseif preview_text == nil then
preview_text = unknown_text
end
unknown_text = preview_text
end
for _, v in pairs(values) do
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
if v == '' then v = ' ' end
-- avoid error with v = 'example%2' ("invalid capture index")
local r = unknown_text:gsub('_VALUE_', {_VALUE_ = v})
table.insert(res, r)
end
end
return table.concat(res)
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
return p._check(args, pargs)
end
return p
mf5u017ry3j5wcsi9ctzrqfash3oih5
Module:Math
828
2857482
37019572
35046962
2026-05-01T14:59:12Z
Exec8
10305
.
37019572
Scribunto
text/plain
--[[
This module provides a number of basic mathematical operations.
]]
local yesno, getArgs -- lazily initialized
local p = {} -- Holds functions to be returned from #invoke, and functions to make available to other Lua modules.
local wrap = {} -- Holds wrapper functions that process arguments from #invoke. These act as intemediary between functions meant for #invoke and functions meant for Lua.
--[[
Helper functions used to avoid redundant code.
]]
local function err(msg)
-- Generates wikitext error messages.
return mw.ustring.format('<strong class="error">Formatting error: %s</strong>', msg)
end
local function unpackNumberArgs(args)
-- Returns an unpacked list of arguments specified with numerical keys.
local ret = {}
for k, v in pairs(args) do
if type(k) == 'number' then
table.insert(ret, v)
end
end
return unpack(ret)
end
local function makeArgArray(...)
-- Makes an array of arguments from a list of arguments that might include nils.
local args = {...} -- Table of arguments. It might contain nils or non-number values, so we can't use ipairs.
local nums = {} -- Stores the numbers of valid numerical arguments.
local ret = {}
for k, v in pairs(args) do
v = p._cleanNumber(v)
if v then
nums[#nums + 1] = k
args[k] = v
end
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[#ret + 1] = args[num]
end
return ret
end
local function fold(func, ...)
-- Use a function on all supplied arguments, and return the result. The function must accept two numbers as parameters,
-- and must return a number as an output. This number is then supplied as input to the next function call.
local vals = makeArgArray(...)
local count = #vals -- The number of valid arguments
if count == 0 then return
-- Exit if we have no valid args, otherwise removing the first arg would cause an error.
nil, 0
end
local ret = table.remove(vals, 1)
for _, val in ipairs(vals) do
ret = func(ret, val)
end
return ret, count
end
--[[
Fold arguments by selectively choosing values (func should return when to choose the current "dominant" value).
]]
local function binary_fold(func, ...)
local value = fold((function(a, b) if func(a, b) then return a else return b end end), ...)
return value
end
--[[
random
Generate a random number
Usage:
{{#invoke: Math | random }}
{{#invoke: Math | random | maximum value }}
{{#invoke: Math | random | minimum value | maximum value }}
]]
function wrap.random(args)
local first = p._cleanNumber(args[1])
local second = p._cleanNumber(args[2])
return p._random(first, second)
end
function p._random(first, second)
math.randomseed(mw.site.stats.edits + mw.site.stats.pages + os.time() + math.floor(os.clock() * 1000000000))
-- math.random will throw an error if given an explicit nil parameter, so we need to use if statements to check the params.
if first and second then
if first <= second then -- math.random doesn't allow the first number to be greater than the second.
return math.random(first, second)
end
elseif first then
return math.random(first)
else
return math.random()
end
end
--[[
order
Determine order of magnitude of a number
Usage:
{{#invoke: Math | order | value }}
]]
function wrap.order(args)
local input_string = (args[1] or args.x or '0');
local input_number = p._cleanNumber(input_string);
if input_number == nil then
return err('order of magnitude input appears non-numeric')
else
return p._order(input_number)
end
end
function p._order(x)
if x == 0 then return 0 end
return math.floor(math.log10(math.abs(x)))
end
--[[
precision
Detemines the precision of a number using the string representation
Usage:
{{ #invoke: Math | precision | value }}
]]
function wrap.precision(args)
local input_string = (args[1] or args.x or '0');
local trap_fraction = args.check_fraction;
if not yesno then
yesno = require('Module:Yesno')
end
if yesno(trap_fraction, true) then -- Returns true for all input except nil, false, "no", "n", "0" and a few others. See [[Module:Yesno]].
local pos = string.find(input_string, '/', 1, true);
if pos ~= nil then
if string.find(input_string, '/', pos + 1, true) == nil then
local denominator = string.sub(input_string, pos+1, -1);
local denom_value = tonumber(denominator);
if denom_value ~= nil then
return math.log10(denom_value);
end
end
end
end
local _, clean_string = p._cleanNumber(input_string);
if clean_string == nil then
return err('precision input appears non-numeric')
else
return p._precision(clean_string)
end
end
function p._precision(x)
if type(x) == 'number' then
x = tostring(x)
end
local result = 0;
--subtract exponent
local _, _, coefficient, exponent = x:find("^(.*)[eE](.*)$")
if coefficient then
result = result - (tonumber(exponent) or 0)
x = coefficient
end
--add decimal places
local i, j = x:find('%..*$')
if i then
result = result + (j - i)
return result
end
--subtract trailing zeroes
i, j = x:find('[^0]0+$')
if i then
result = result - (j - i)
end
return result
end
--[[
max
Finds the maximum argument
Usage:
{{#invoke:Math| max | value1 | value2 | ... }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.max(args)
return p._max(unpackNumberArgs(args))
end
function p._max(...)
local max_value = binary_fold((function(a, b) return a > b end), ...)
if max_value then
return max_value
end
end
--[[
median
Find the median of set of numbers
Usage:
{{#invoke:Math | median | number1 | number2 | ...}}
OR
{{#invoke:Math | median }}
]]
function wrap.median(args)
return p._median(unpackNumberArgs(args))
end
function p._median(...)
local vals = makeArgArray(...)
local count = #vals
table.sort(vals)
if count == 0 then
return 0
end
if p._mod(count, 2) == 0 then
return (vals[count/2] + vals[count/2+1])/2
else
return vals[math.ceil(count/2)]
end
end
--[[
min
Finds the minimum argument
Usage:
{{#invoke:Math| min | value1 | value2 | ... }}
OR
{{#invoke:Math| min }}
When used with no arguments, it takes its input from the parent
frame. Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.min(args)
return p._min(unpackNumberArgs(args))
end
function p._min(...)
local min_value = binary_fold((function(a, b) return a < b end), ...)
if min_value then
return min_value
end
end
--[[
sum
Finds the sum
Usage:
{{#invoke:Math| sum | value1 | value2 | ... }}
OR
{{#invoke:Math| sum }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.sum(args)
return p._sum(unpackNumberArgs(args))
end
function p._sum(...)
local sums = fold((function(a, b) return a + b end), ...)
if not sums then
return 0
else
return sums
end
end
--[[
average
Finds the average
Usage:
{{#invoke:Math| average | value1 | value2 | ... }}
OR
{{#invoke:Math| average }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.average(args)
return p._average(unpackNumberArgs(args))
end
function p._average(...)
local sum, count = fold((function(a, b) return a + b end), ...)
if not sum then
return 0
else
return sum / count
end
end
--[[
round
Rounds a number to specified precision
Usage:
{{#invoke:Math | round | value | precision }}
--]]
function wrap.round(args)
local value = p._cleanNumber(args[1] or args.value or 0)
local precision = p._cleanNumber(args[2] or args.precision or 0)
if value == nil or precision == nil then
return err('round input appears non-numeric')
else
return p._round(value, precision)
end
end
function p._round(value, precision)
local rescale = math.pow(10, precision or 0);
return math.floor(value * rescale + 0.5) / rescale;
end
--[[
log10
returns the log (base 10) of a number
Usage:
{{#invoke:Math | log10 | x }}
]]
function wrap.log10(args)
return math.log10(args[1])
end
--[[
mod
Implements the modulo operator
Usage:
{{#invoke:Math | mod | x | y }}
--]]
function wrap.mod(args)
local x = p._cleanNumber(args[1])
local y = p._cleanNumber(args[2])
if not x then
return err('first argument to mod appears non-numeric')
elseif not y then
return err('second argument to mod appears non-numeric')
else
return p._mod(x, y)
end
end
function p._mod(x, y)
local ret = x % y
if not (0 <= ret and ret < y) then
ret = 0
end
return ret
end
--[[
gcd
Calculates the greatest common divisor of multiple numbers
Usage:
{{#invoke:Math | gcd | value 1 | value 2 | value 3 | ... }}
--]]
function wrap.gcd(args)
return p._gcd(unpackNumberArgs(args))
end
function p._gcd(...)
local function findGcd(a, b)
local r = b
local oldr = a
while r ~= 0 do
local quotient = math.floor(oldr / r)
oldr, r = r, oldr - quotient * r
end
if oldr < 0 then
oldr = oldr * -1
end
return oldr
end
local result = fold(findGcd, ...)
return result
end
--[[
precision_format
Rounds a number to the specified precision and formats according to rules
originally used for {{template:Rnd}}. Output is a string.
Usage:
{{#invoke: Math | precision_format | number | precision }}
]]
function wrap.precision_format(args)
local value_string = args[1] or 0
local precision = args[2] or 0
return p._precision_format(value_string, precision)
end
function p._precision_format(value_string, precision)
-- For access to Mediawiki built-in formatter.
local lang = mw.getContentLanguage();
local value
value, value_string = p._cleanNumber(value_string)
precision = p._cleanNumber(precision)
-- Check for non-numeric input
if value == nil or precision == nil then
return err('invalid input when rounding')
end
local abs_value = math.abs(value)
local current_precision = p._precision(value)
local order = p._order(value)
-- Due to round-off effects it is neccesary to limit the returned precision under
-- some circumstances because the terminal digits will be inaccurately reported.
if order + precision >= 14 then
if order + p._precision(value_string) >= 14 then
precision = 13 - order;
end
end
-- If rounding off, truncate extra digits
if precision < current_precision then
value = p._round(value, precision)
abs_value = math.abs(value)
current_precision = p._precision(value)
end
local formatted_num = lang:formatNum(abs_value)
-- Handle cases requiring scientific notation
if math.abs(order) >= 9 or string.find(formatted_num, 'E', 1, true) then
value = value * (10 ^ (-order))
abs_value = math.abs(value)
current_precision = current_precision + order
precision = precision + order
formatted_num = lang:formatNum(abs_value)
else
order = 0;
end
-- Use proper unary minus sign rather than ASCII default
formatted_num = ((value < 0) and '−' or '') .. formatted_num
-- Pad with zeros, if needed
if current_precision < precision then
local padding
if current_precision <= 0 then
if precision > 0 then
local zero_sep = lang:formatNum(1.1)
formatted_num = formatted_num .. zero_sep:sub(2,2)
padding = precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
else
padding = precision - current_precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
end
-- Add exponential notation, if necessary.
if order ~= 0 then
-- Use proper unary minus sign rather than ASCII default
if order < 0 then
order = '−' .. lang:formatNum(math.abs(order))
else
order = lang:formatNum(order)
end
formatted_num = formatted_num .. '<span style="margin:0 .15em 0 .25em">×</span>10<sup>' .. order .. '</sup>'
end
return formatted_num
end
--[[
divide
Implements the division operator
Usage:
{{#invoke:Math | divide | x | y | round= | precision= }}
--]]
function wrap.divide(args)
local x = args[1]
local y = args[2]
local round = args.round
local precision = args.precision
if not yesno then
yesno = require('Module:Yesno')
end
return p._divide(x, y, yesno(round), precision)
end
function p._divide(x, y, round, precision)
if y == nil or y == "" then
return err("Empty divisor")
elseif not tonumber(y) then
if type(y) == 'string' and string.sub(y, 1, 1) == '<' then
return y
else
return err("Not a number: " .. y)
end
elseif x == nil or x == "" then
return err("Empty dividend")
elseif not tonumber(x) then
if type(x) == 'string' and string.sub(x, 1, 1) == '<' then
return x
else
return err("Not a number: " .. x)
end
else
local z = x / y
if round then
return p._round(z, 0)
elseif precision then
return p._round(z, precision)
else
return z
end
end
end
--[[
Helper function that interprets the input numerically. If the
input does not appear to be a number, attempts evaluating it as
a parser functions expression.
]]
function p._cleanNumber(number_string, unformat)
if type(number_string) == 'number' then
-- We were passed a number, so we don't need to do any processing.
return number_string, tostring(number_string)
elseif type(number_string) ~= 'string' or not number_string:find('%S') then
-- We were passed a non-string or a blank string, so exit.
return nil, nil;
end
-- Attempt basic conversion
local number = tonumber(number_string)
-- If failed, try unformatting the number_string
if unformat and number == nil then
-- Cannot use mw.language.getContentLanguage():parseFormattedNumber()
-- because, unlike {{formatnum:|R}}, it won't ignore operators (it
-- would return an error on "1,234+1,234" instead of "1234+1234")
number_string = mw.getCurrentFrame():callParserFunction("formatnum", {number_string, "R"})
number = tonumber(number_string)
end
-- If failed, attempt to evaluate input as an expression
if number == nil then
local success, result = pcall(mw.ext.ParserFunctions.expr, number_string)
if success then
number = tonumber(result)
number_string = tostring(number)
else
number = nil
number_string = nil
end
else
number_string = number_string:match("^%s*(.-)%s*$") -- String is valid but may contain padding, clean it.
number_string = number_string:match("^%+(.*)$") or number_string -- Trim any leading + signs.
if number_string:find('^%-?0[xX]') then
-- Number is using 0xnnn notation to indicate base 16; use the number that Lua detected instead.
number_string = tostring(number)
end
end
return number, number_string
end
--[[
Wrapper function that does basic argument processing. This ensures that all functions from #invoke can use either the current
frame or the parent frame, and it also trims whitespace for all arguments and removes blank arguments.
]]
local mt = { __index = function(_, k)
return function(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return wrap[k](getArgs(frame)) -- Argument processing is left to Module:Arguments. Whitespace is trimmed and blank arguments are removed.
end
end }
return setmetatable(p, mt)
f4r823qxvpkct3eikmvj99wyjq9cjkm
Misamis
0
3152286
37019615
33494796
2026-05-01T15:48:35Z
EmausBot
5266
Kinukumpuni ang nagkadalawang pagpapapunta sa [[Ozamiz]]
37019615
wikitext
text/x-wiki
#REDIRECT [[Ozamiz]]
nk68bs7im07ajoc5bg19cxx31cjds37
Osamis
0
3152287
37019617
33494798
2026-05-01T15:48:46Z
EmausBot
5266
Kinukumpuni ang nagkadalawang pagpapapunta sa [[Ozamiz]]
37019617
wikitext
text/x-wiki
#REDIRECT [[Ozamiz]]
nk68bs7im07ajoc5bg19cxx31cjds37
Lungsod ng Ozamis
0
3152288
37019614
33494775
2026-05-01T15:48:26Z
EmausBot
5266
Kinukumpuni ang nagkadalawang pagpapapunta sa [[Ozamiz]]
37019614
wikitext
text/x-wiki
#REDIRECT [[Ozamiz]]
nk68bs7im07ajoc5bg19cxx31cjds37
Altamira do Paraná
0
3772754
37019687
20380421
2026-05-02T02:30:19Z
Heitor100YT
94745
Adicionada a Bandeira e o Brasão de Altamira do Paraná - PR.
37019687
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|Brasil|date=2016-01}}
{{geobox
| 1 = Region
<!-- *** Header *** -->
| name = Altamira do Paraná
| native_name =
| other_name =
| category = Munisipyo
| official_name =
| etymology =
| motto =
| nickname =
<!-- *** Image *** -->
| image =
| image_caption =
<!-- *** Symbols *** -->
| flag =Altamiradoparanap.jpg
| symbol =
Brasao altamira 1.JPG
| country = {{flag|Brasil}}
| country_flag =
| state = [[Paraná (estado)|Paraná]]
| state_type = Estado
| region =
| region_type =
| district =
| district_type =
| economic_region =
| economic_region_type =
<!-- *** Associated with *** -->
| border =
| part =
| city =
| landmark =
| river =
<!-- *** Location *** -->
| capital =
| capital_type =
| capital_location =
| capital_region =
| capital_country =
| capital_elevation =
| capital_lat_d =
| capital_lat_m =
| capital_lat_s =
| capital_lat_NS =
| capital_long_d =
| capital_long_m =
| capital_long_s =
| capital_long_EW =
| highest =
| highest_location =
| highest_region =
| highest_country =
| highest_elevation =
| highest_lat_d =
| highest_lat_m =
| highest_lat_s =
| highest_lat_NS =
| highest_long_d =
| highest_long_m =
| highest_long_s =
| highest_long_EW =
| lowest =
| lowest_location =
| lowest_region =
| lowest_country =
| lowest_elevation =
| lowest_lat_d =
| lowest_lat_m =
| lowest_lat_s =
| lowest_lat_NS =
| lowest_long_d =
| lowest_long_m =
| lowest_long_s =
| lowest_long_EW =
<!-- *** Dimensions *** -->
| length =
| length_orientation =
| width =
| width_orientation =
| area =
| area_decimals =
<!-- *** Population *** -->
| population = 4306
| population_date = 2011-04-21
| population_density =
<!-- *** History and politics *** -->
| established =
| date =
| government_location =
| government_region =
| government_country =
| government_elevation =
| government_lat_d =
| government_lat_m =
| government_lat_s =
| government_lat_NS =
| government_long_d =
| government_long_m =
| government_long_s =
| government_long_EW =
| leader =
| leader_party =
<!-- *** Codes *** -->
| timezone = [[Fernando de Noronha Time|FNT]]
| utc_offset = -2
| timezone_DST = [[Amazon Summer Time|AMST]]
| utc_offset_DST = -3
| postal_code =
| area_code =
| code =
<!-- *** Free *** -->
| free =
| free_type =
<!-- *** Maps *** -->
| map =
| map_size =
| map_caption =
| map_locator_x =
| map_locator_y =
<!-- *** Website *** -->
| website =
<!-- *** Notes *** -->
| footnotes =
| lat_d = -24.81257
| long_d = -52.7074
| elevation = 575
| population_note = <ref name = "gn6322663"/>
| timezone_label = America/Sao_Paulo
| geonames = 6322663
}}
<!--A.ADM2-->[[administratibo nga mga dibisyon sa Brasil|Munisipyo]] ang '''Altamira do Paraná''' sa [[Brasil]].<ref name = "gn6322663"/> Nahimutang ni sa estado sa <!--ADM1-->[[Paraná (estado)|Paraná]], sa habagatang bahin sa nasod, {{formatnum:1100}} km sa habagatan-kasadpan sa [[Brasília (ulohang dakbayan)|Brasília]] ang ulohan sa nasod. Adunay <!--pop-->{{formatnum:4306}} ka molupyo.<ref name = "gn6322663"/>
{{Location map|Brazil |float = right |width=300 | caption = Nahimutangan sa Altamira do Paraná sa Brasil. | label = Altamira do Paraná|position=right|background=white|lat=-24.81257|long=-52.7074}}
Hapit nalukop sa [[durowan]] ug [[kabugangan]] ang palibot sa Altamira do Paraná.<ref name = "nasalandcover"/> Dunay mga {{formatnum:17}} ka tawo kada kilometro kwadrado sa palibot sa Altamira do Paraná may gamay nga populasyon.<ref name = "nasapop"/> Ang klima [[umogon]] ug [[subtropikal]].<ref name = "koppen"/> Ang kasarangang giiniton {{formatnum:20}} [[°C]]. Ang kinainitan nga bulan Disyembre, sa {{formatnum:24}} [[°C]], ug ang kinabugnawan Hunyo, sa {{formatnum:16}} °C.<ref name = "nasa"/> Ang kasarangang pag-ulan {{formatnum:2468}} milimetro matag tuig. Ang kinabasaan nga bulan Hunyo, sa {{formatnum:372}} milimetro nga ulan, ug ang kinaugahan Agosto, sa {{formatnum:44}} milimetro.<ref name = "nasarain"/>
{|
|-
|{{climate chart
| Altamira do Paraná
| 18| 28| 197
| 18| 26| 264
| 19| 27| 221
| 17| 25| 233
| 13| 21| 231
| 12| 20| 372
| 12| 20| 104
| 13| 24| 44
| 13| 26| 233
| 16| 29| 189
| 17| 28| 157
| 19| 28| 224
|float=left
|clear=left
|source = <ref name = "nasa"/>
}}
|}
== Ang mga gi basihan niini ==
<references>
<ref name = "gn6322663">[{{Geonameslink|gnid=6322663|name=altamira%20do%20parana}} Altamira do Paraná] sa [{{Geonamesabout}} GeoNames.Org (cc-by)]; post updated 2011-04-21; database download sa 2015-12-29</ref>
<ref name = "nasapop">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/view.php?datasetId=SEDAC_POP|title= NASA Earth Observations: Population Density|access-date = 30 Enero 2016 |publisher= NASA/SEDAC}}</ref>
<ref name = "koppen">{{cite journal |last= Peel|first= M C|last2= Finlayson|first2= B L|date= |title= Updated world map of the Köppen-Geiger climate classification| url = http://www.hydrol-earth-syst-sci.net/11/1633/2007/hess-11-1633-2007.html |journal= Hydrology and Earth System Sciences|publisher= |volume= 11|issue= |pages= 1633-1644|doi= 10.5194/hess-11-1633-2007|access-date=30 Enero 2016}}</ref>
<ref name = "nasa">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/dataset_index.php|title= NASA Earth Observations Data Set Index|access-date = 30 Enero 2016 |publisher= NASA}}</ref>
<ref name = "nasarain">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/view.php?datasetId=TRMM_3B43M&year=2014|title= NASA Earth Observations: Rainfall (1 month - TRMM)|access-date = 30 Enero 2016 |publisher= NASA/Tropical Rainfall Monitoring Mission}}</ref>
<ref name = "nasalandcover">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/view.php?datasetId=MCD12C1_T1|title= NASA Earth Observations: Land Cover Classification|access-date = 30 Enero 2016 |publisher= NASA/MODIS}}</ref>
</references>
[[Kategoriya:Mga subdibisyon sa Paraná (estado)]]
lcu5rpopvckr2wxecubxqsuh318pix6
Module:Message box
828
6428958
37019562
35083212
2026-05-01T14:46:05Z
Exec8
10305
.
37019562
Scribunto
text/plain
require('strict')
local getArgs
local yesno = require('Module:Yesno')
local lang = mw.language.getContentLanguage()
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
self.typeImageNeedsLink = typeData.imageNeedsLink
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Set the below row.
self.below = cfg.below and args.below
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
if self.below then
self:addClass('mbox-with-below')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Set image classes.
self.imageRightClass = args.imagerightclass or args.imageclass
self.imageLeftClass = args.imageleftclass or args.imageclass
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. (talk == '#' and '' or '#') .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s' .. (talk == '#' and '' or '#') .. '%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <span class='date-container'><i>(<span class='date'>%s</span>)</i></span>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s%s|alt=]]', self.typeImage
or 'Information icon4.svg', imageSize, self.typeImageNeedsLink and "" or "|link=" )
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
-- set templatestyles
self.base_templatestyles = cfg.templatestyles
self.templatestyles = args.templatestyles
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:exportDiv()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
local frame = mw.getCurrentFrame()
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.base_templatestyles },
})
-- Add support for a single custom templatestyles sheet. Undocumented as
-- need should be limited and many templates using mbox are substed; we
-- don't want to spread templatestyles sheets around to arbitrary places
if self.templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.templatestyles },
})
end
-- Create the box.
local mbox = root:tag('div')
mbox:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
mbox:addClass(class or nil)
end
mbox
:cssText(self.style or nil)
if self.attrs then
mbox:attr(self.attrs)
end
local flex_container
if self.below then
-- we need to wrap the flex components (`image(right)` and `text`) in their
-- own container div to support the `below` parameter
flex_container = mw.html.create('div')
flex_container:addClass('mbox-flex')
else
-- the mbox itself is the parent, so we need no HTML flex_container
flex_container = mw.html.create()
end
-- Add the left-hand image.
if self.imageLeft then
local imageLeftCell = flex_container:tag('div'):addClass('mbox-image')
imageLeftCell
:addClass(self.imageLeftClass)
:wikitext(self.imageLeft or nil)
end
-- Add the text.
local textCell = flex_container:tag('div'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = flex_container:tag('div'):addClass('mbox-imageright')
imageRightCell
:addClass(self.imageRightClass)
:wikitext(self.imageRight or nil)
end
mbox:node(flex_container)
-- Add the below row.
if self.below then
mbox:tag('div')
:addClass('mbox-text mbox-below')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:addClass('mbox-invalid-type')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
local frame = mw.getCurrentFrame()
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.base_templatestyles },
})
-- Add support for a single custom templatestyles sheet. Undocumented as
-- need should be limited and many templates using mbox are substed; we
-- don't want to spread templatestyles sheets around to arbitrary places
if self.templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.templatestyles },
})
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
end
imageLeftCell
:addClass(self.imageLeftClass)
:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):addClass('mbox-image-div')
end
imageRightCell
:addClass(self.imageRightClass)
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:addClass('mbox-invalid-type')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
-- DIV MIGRATION CONDITIONAL
if box.cfg.div_structure then
return box:exportDiv()
end
-- END DIV MIGRATION CONDITIONAL
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
ocboyo877qnpqum2b9fyiquh72vukqa
Module:Coordinates
828
6607518
37019571
35354113
2026-05-01T14:58:32Z
Exec8
10305
.
37019571
Scribunto
text/plain
--[[
This module is intended to replace the functionality of {{Coord}} and related
templates. It provides several methods, including
{{#invoke:Coordinates | coord }} : General function formatting and displaying
coordinate values.
{{#invoke:Coordinates | dec2dms }} : Simple function for converting decimal
degree values to DMS format.
{{#invoke:Coordinates | dms2dec }} : Simple function for converting DMS format
to decimal degree format.
{{#invoke:Coordinates | link }} : Export the link used to reach the tools
]]
require('strict')
local math_mod = require("Module:Math")
local coordinates = {};
local isSandbox = mw.getCurrentFrame():getTitle():find('sandbox', 1, true);
local current_page = mw.title.getCurrentTitle()
local page_name = mw.uri.encode( current_page.prefixedText, 'WIKI' );
local coord_link = 'https://geohack.toolforge.org/geohack.php?pagename=' .. page_name .. '¶ms='
--[[ Helper function, replacement for {{coord/display/title}} ]]
local function displaytitle(coords)
return mw.getCurrentFrame():extensionTag{
name = 'indicator',
args = { name = 'coordinates' },
content = '<span id="coordinates">[[Geographic coordinate system|Coordinates]]: ' .. coords .. '</span>'
}
end
--[[ Helper function, used in detecting DMS formatting ]]
local function dmsTest(first, second)
if type(first) ~= 'string' or type(second) ~= 'string' then
return nil
end
local s = (first .. second):upper()
return s:find('^[NS][EW]$') or s:find('^[EW][NS]$')
end
--[[ Wrapper function to grab args, see Module:Arguments for this function's documentation. ]]
local function makeInvokeFunc(funcName)
return function (frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Coord'
})
return coordinates[funcName](args, frame)
end
end
--[[ Helper function, handle optional args. ]]
local function optionalArg(arg, supplement)
return arg and arg .. supplement or ''
end
--[[
Formats any error messages generated for display
]]
local function errorPrinter(errors)
local result = ""
for i,v in ipairs(errors) do
result = result .. '<strong class="error">Coordinates: ' .. v[2] .. '</strong><br />'
end
return result
end
--[[
Determine the required CSS class to display coordinates
Usually geo-nondefault is hidden by CSS, unless a user has overridden this for himself
default is the mode as specificied by the user when calling the {{coord}} template
mode is the display mode (dec or dms) that we will need to determine the css class for
]]
local function displayDefault(default, mode)
if default == "" then
default = "dec"
end
if default == mode then
return "geo-default"
else
return "geo-nondefault"
end
end
--[[
specPrinter
Output formatter. Takes the structure generated by either parseDec
or parseDMS and formats it for inclusion on Wikipedia.
]]
local function specPrinter(args, coordinateSpec)
local uriComponents = coordinateSpec["param"]
if uriComponents == "" then
-- RETURN error, should never be empty or nil
return "ERROR param was empty"
end
if args["name"] then
uriComponents = uriComponents .. "&title=" .. mw.uri.encode(coordinateSpec["name"])
end
local geodmshtml = '<span class="geo-dms" title="Maps, aerial photos, and other data for this location">'
.. '<span class="latitude">' .. coordinateSpec["dms-lat"] .. '</span> '
.. '<span class="longitude">' ..coordinateSpec["dms-long"] .. '</span>'
.. '</span>'
local lat = tonumber( coordinateSpec["dec-lat"] ) or 0
local geodeclat
if lat < 0 then
-- FIXME this breaks the pre-existing precision
geodeclat = tostring(coordinateSpec["dec-lat"]):sub(2) .. "°S"
else
geodeclat = (coordinateSpec["dec-lat"] or 0) .. "°N"
end
local long = tonumber( coordinateSpec["dec-long"] ) or 0
local geodeclong
if long < 0 then
-- FIXME does not handle unicode minus
geodeclong = tostring(coordinateSpec["dec-long"]):sub(2) .. "°W"
else
geodeclong = (coordinateSpec["dec-long"] or 0) .. "°E"
end
local geodechtml = '<span class="geo-dec" title="Maps, aerial photos, and other data for this location">'
.. geodeclat .. ' '
.. geodeclong
.. '</span>'
local geonumhtml = '<span class="geo">'
.. coordinateSpec["dec-lat"] .. '; '
.. coordinateSpec["dec-long"]
.. '</span>'
local inner = '<span class="' .. displayDefault(coordinateSpec["default"], "dms" ) .. '">' .. geodmshtml .. '</span>'
.. '<span class="geo-multi-punct"> / </span>'
.. '<span class="' .. displayDefault(coordinateSpec["default"], "dec" ) .. '">';
if not args["name"] then
inner = inner .. geodechtml
.. '<span style="display:none"> / ' .. geonumhtml .. '</span></span>'
else
inner = inner .. '<span class="vcard">' .. geodechtml
.. '<span style="display:none"> / ' .. geonumhtml .. '</span>'
.. '<span style="display:none"> (<span class="fn org">'
.. args["name"] .. '</span>)</span></span></span>'
end
local stylesheetLink = 'Module:Coordinates' .. ( isSandbox and '/sandbox' or '' ) .. '/styles.css'
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = stylesheetLink }
} .. '<span class="plainlinks nourlexpansion">[' .. coord_link .. uriComponents ..
' ' .. inner .. ']</span>' .. '[[Category:Pages using gadget WikiMiniAtlas]]'
end
--[[ Helper function, convert decimal to degrees ]]
local function convert_dec2dms_d(coordinate)
local d = math_mod._round( coordinate, 0 ) .. "°"
return d .. ""
end
--[[ Helper function, convert decimal to degrees and minutes ]]
local function convert_dec2dms_dm(coordinate)
coordinate = math_mod._round( coordinate * 60, 0 );
local m = coordinate % 60;
coordinate = math.floor( (coordinate - m) / 60 );
local d = coordinate % 360 .."°"
return d .. string.format( "%02d′", m )
end
--[[ Helper function, convert decimal to degrees, minutes, and seconds ]]
local function convert_dec2dms_dms(coordinate)
coordinate = math_mod._round( coordinate * 60 * 60, 0 );
local s = coordinate % 60
coordinate = math.floor( (coordinate - s) / 60 );
local m = coordinate % 60
coordinate = math.floor( (coordinate - m) / 60 );
local d = coordinate % 360 .."°"
return d .. string.format( "%02d′", m ) .. string.format( "%02d″", s )
end
--[[
Helper function, convert decimal latitude or longitude to
degrees, minutes, and seconds format based on the specified precision.
]]
local function convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
local coord = tonumber(coordinate)
local postfix
if coord >= 0 then
postfix = firstPostfix
else
postfix = secondPostfix
end
precision = precision:lower();
if precision == "dms" then
return convert_dec2dms_dms( math.abs( coord ) ) .. postfix;
elseif precision == "dm" then
return convert_dec2dms_dm( math.abs( coord ) ) .. postfix;
elseif precision == "d" then
return convert_dec2dms_d( math.abs( coord ) ) .. postfix;
end
end
--[[
Convert DMS format into a N or E decimal coordinate
]]
local function convert_dms2dec(direction, degrees_str, minutes_str, seconds_str)
local degrees = tonumber(degrees_str)
local minutes = tonumber(minutes_str) or 0
local seconds = tonumber(seconds_str) or 0
local factor = 1
if direction == "S" or direction == "W" then
factor = -1
end
local precision = 0
if seconds_str then
precision = 5 + math.max( math_mod._precision(seconds_str), 0 );
elseif minutes_str and minutes_str ~= '' then
precision = 3 + math.max( math_mod._precision(minutes_str), 0 );
else
precision = math.max( math_mod._precision(degrees_str), 0 );
end
local decimal = factor * (degrees+(minutes+seconds/60)/60)
return string.format( "%." .. precision .. "f", decimal ) -- not tonumber since this whole thing is string based.
end
--[[
Checks input values to for out of range errors.
]]
local function validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, source, strong )
local errors = {};
lat_d = tonumber( lat_d ) or 0;
lat_m = tonumber( lat_m ) or 0;
lat_s = tonumber( lat_s ) or 0;
long_d = tonumber( long_d ) or 0;
long_m = tonumber( long_m ) or 0;
long_s = tonumber( long_s ) or 0;
if strong then
if lat_d < 0 then
table.insert(errors, {source, "latitude degrees < 0 with hemisphere flag"})
end
if long_d < 0 then
table.insert(errors, {source, "longitude degrees < 0 with hemisphere flag"})
end
--[[
#coordinates is inconsistent about whether this is an error. If globe: is
specified, it won't error on this condition, but otherwise it will.
For not simply disable this check.
if long_d > 180 then
table.insert(errors, {source, "longitude degrees > 180 with hemisphere flag"})
end
]]
end
if lat_d > 90 then
table.insert(errors, {source, "latitude degrees > 90"})
end
if lat_d < -90 then
table.insert(errors, {source, "latitude degrees < -90"})
end
if lat_m >= 60 then
table.insert(errors, {source, "latitude minutes >= 60"})
end
if lat_m < 0 then
table.insert(errors, {source, "latitude minutes < 0"})
end
if lat_s >= 60 then
table.insert(errors, {source, "latitude seconds >= 60"})
end
if lat_s < 0 then
table.insert(errors, {source, "latitude seconds < 0"})
end
if long_d >= 360 then
table.insert(errors, {source, "longitude degrees >= 360"})
end
if long_d <= -360 then
table.insert(errors, {source, "longitude degrees <= -360"})
end
if long_m >= 60 then
table.insert(errors, {source, "longitude minutes >= 60"})
end
if long_m < 0 then
table.insert(errors, {source, "longitude minutes < 0"})
end
if long_s >= 60 then
table.insert(errors, {source, "longitude seconds >= 60"})
end
if long_s < 0 then
table.insert(errors, {source, "longitude seconds < 0"})
end
return errors;
end
--[[
parseDec
Transforms decimal format latitude and longitude into the
structure to be used in displaying coordinates
]]
local function parseDec( lat, long, format )
local coordinateSpec = {}
local errors = {}
if not long then
return nil, {{"parseDec", "Missing longitude"}}
elseif not tonumber(long) then
return nil, {{"parseDec", "Longitude could not be parsed as a number: " .. long}}
end
errors = validate( lat, nil, nil, long, nil, nil, 'parseDec', false );
coordinateSpec["dec-lat"] = lat;
coordinateSpec["dec-long"] = long;
local mode = coordinates.determineMode( lat, long );
coordinateSpec["dms-lat"] = convert_dec2dms( lat, "N", "S", mode) -- {{coord/dec2dms|{{{1}}}|N|S|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
coordinateSpec["dms-long"] = convert_dec2dms( long, "E", "W", mode) -- {{coord/dec2dms|{{{2}}}|E|W|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
if format then
coordinateSpec.default = format
else
coordinateSpec.default = "dec"
end
return coordinateSpec, errors
end
--[[
parseDMS
Transforms degrees, minutes, seconds format latitude and longitude
into the a structure to be used in displaying coordinates
]]
local function parseDMS( lat_d, lat_m, lat_s, lat_f, long_d, long_m, long_s, long_f, format )
local coordinateSpec, errors, backward = {}, {}
lat_f = lat_f:upper();
long_f = long_f:upper();
-- Check if specified backward
if lat_f == 'E' or lat_f == 'W' then
lat_d, long_d, lat_m, long_m, lat_s, long_s, lat_f, long_f, backward = long_d, lat_d, long_m, lat_m, long_s, lat_s, long_f, lat_f, true;
end
errors = validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, 'parseDMS', true );
if not long_d then
return nil, {{"parseDMS", "Missing longitude" }}
elseif not tonumber(long_d) then
return nil, {{"parseDMS", "Longitude could not be parsed as a number:" .. long_d }}
end
if not lat_m and not lat_s and not long_m and not long_s and #errors == 0 then
if math_mod._precision( lat_d ) > 0 or math_mod._precision( long_d ) > 0 then
if lat_f:upper() == 'S' then
lat_d = '-' .. lat_d;
end
if long_f:upper() == 'W' then
long_d = '-' .. long_d;
end
return parseDec( lat_d, long_d, format );
end
end
coordinateSpec["dms-lat"] = lat_d.."°"..optionalArg(lat_m,"′") .. optionalArg(lat_s,"″") .. lat_f
coordinateSpec["dms-long"] = long_d.."°"..optionalArg(long_m,"′") .. optionalArg(long_s,"″") .. long_f
coordinateSpec["dec-lat"] = convert_dms2dec(lat_f, lat_d, lat_m, lat_s) -- {{coord/dms2dec|{{{4}}}|{{{1}}}|0{{{2}}}|0{{{3}}}}}
coordinateSpec["dec-long"] = convert_dms2dec(long_f, long_d, long_m, long_s) -- {{coord/dms2dec|{{{8}}}|{{{5}}}|0{{{6}}}|0{{{7}}}}}
if format then
coordinateSpec.default = format
else
coordinateSpec.default = "dms"
end
return coordinateSpec, errors, backward
end
--[[
Check the input arguments for coord to determine the kind of data being provided
and then make the necessary processing.
]]
local function formatTest(args)
local result, errors
local backward, primary = false, false
local function getParam(args, lim)
local ret = {}
for i = 1, lim do
ret[i] = args[i] or ''
end
return table.concat(ret, '_')
end
if not args[1] then
-- no lat logic
return errorPrinter( {{"formatTest", "Missing latitude"}} )
elseif not tonumber(args[1]) then
-- bad lat logic
return errorPrinter( {{"formatTest", "Unable to parse latitude as a number:" .. args[1]}} )
elseif not args[4] and not args[5] and not args[6] then
-- dec logic
result, errors = parseDec(args[1], args[2], args.format)
if not result then
return errorPrinter(errors);
end
-- formatting for geohack: geohack expects D_N_D_E notation or D;D notation
-- wikiminiatlas doesn't support D;D notation
-- #coordinates parserfunction doesn't support negative decimals with NSWE
result.param = table.concat({
math.abs(tonumber(args[1])),
((tonumber(args[1]) or 0) < 0) and 'S' or 'N',
math.abs(tonumber(args[2])),
((tonumber(args[2]) or 0) < 0) and 'W' or 'E',
args[3] or ''}, '_')
elseif dmsTest(args[4], args[8]) then
-- dms logic
result, errors, backward = parseDMS(args[1], args[2], args[3], args[4],
args[5], args[6], args[7], args[8], args.format)
if args[10] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 9)
elseif dmsTest(args[3], args[6]) then
-- dm logic
result, errors, backward = parseDMS(args[1], args[2], nil, args[3],
args[4], args[5], nil, args[6], args['format'])
if args[8] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 7)
elseif dmsTest(args[2], args[4]) then
-- d logic
result, errors, backward = parseDMS(args[1], nil, nil, args[2],
args[3], nil, nil, args[4], args.format)
if args[6] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 5)
else
-- Error
return errorPrinter({{"formatTest", "Unknown argument format"}}) .. '[[Category:Pages with malformed coordinate tags]]'
end
result.name = args.name
local extra_param = {'dim', 'globe', 'scale', 'region', 'source', 'type'}
for _, v in ipairs(extra_param) do
if args[v] then
table.insert(errors, {'formatTest', 'Parameter: "' .. v .. '=" should be "' .. v .. ':"' })
end
end
local ret = specPrinter(args, result)
if #errors > 0 then
ret = ret .. ' ' .. errorPrinter(errors) .. '[[Category:Pages with malformed coordinate tags]]'
end
return ret, backward
end
--[[
Generate Wikidata tracking categories.
]]
local function makeWikidataCategories(qid)
local ret
local qid = qid or mw.wikibase.getEntityIdForCurrentPage()
if mw.wikibase and current_page.namespace == 0 then
if qid and mw.wikibase.entityExists(qid) and mw.wikibase.getBestStatements(qid, "P625") and mw.wikibase.getBestStatements(qid, "P625")[1] then
local snaktype = mw.wikibase.getBestStatements(qid, "P625")[1].mainsnak.snaktype
if snaktype == 'value' then
-- coordinates exist both here and on Wikidata, and can be compared.
ret = 'Coordinates on Wikidata'
elseif snaktype == 'somevalue' then
ret = 'Coordinates on Wikidata set to unknown value'
elseif snaktype == 'novalue' then
ret = 'Coordinates on Wikidata set to no value'
end
else
-- We have to either import the coordinates to Wikidata or remove them here.
ret = 'Coordinates not on Wikidata'
end
end
if ret then
return string.format('[[Category:%s]]', ret)
else
return ''
end
end
--[[
link
Simple function to export the coordinates link for other uses.
Usage:
{{#invoke:Coordinates | link }}
]]
function coordinates.link(frame)
return coord_link;
end
--[[
dec2dms
Wrapper to allow templates to call dec2dms directly.
Usage:
{{#invoke:Coordinates | dec2dms | decimal_coordinate | positive_suffix |
negative_suffix | precision }}
decimal_coordinate is converted to DMS format. If positive, the positive_suffix
is appended (typical N or E), if negative, the negative suffix is appended. The
specified precision is one of 'D', 'DM', or 'DMS' to specify the level of detail
to use.
]]
coordinates.dec2dms = makeInvokeFunc('_dec2dms')
function coordinates._dec2dms(args)
local coordinate = args[1]
local firstPostfix = args[2] or ''
local secondPostfix = args[3] or ''
local precision = args[4] or ''
return convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
end
--[[
Helper function to determine whether to use D, DM, or DMS
format depending on the precision of the decimal input.
]]
function coordinates.determineMode( value1, value2 )
local precision = math.max( math_mod._precision( value1 ), math_mod._precision( value2 ) );
if precision <= 0 then
return 'd'
elseif precision <= 2 then
return 'dm';
else
return 'dms';
end
end
--[[
dms2dec
Wrapper to allow templates to call dms2dec directly.
Usage:
{{#invoke:Coordinates | dms2dec | direction_flag | degrees |
minutes | seconds }}
Converts DMS values specified as degrees, minutes, seconds too decimal format.
direction_flag is one of N, S, E, W, and determines whether the output is
positive (i.e. N and E) or negative (i.e. S and W).
]]
coordinates.dms2dec = makeInvokeFunc('_dms2dec')
function coordinates._dms2dec(args)
local direction = args[1]
local degrees = args[2]
local minutes = args[3]
local seconds = args[4]
return convert_dms2dec(direction, degrees, minutes, seconds)
end
--[[
coord
Main entry point for Lua function to replace {{coord}}
Usage:
{{#invoke:Coordinates | coord }}
{{#invoke:Coordinates | coord | lat | long }}
{{#invoke:Coordinates | coord | lat | lat_flag | long | long_flag }}
...
Refer to {{coord}} documentation page for many additional parameters and
configuration options.
Note: This function provides the visual display elements of {{coord}}. In
order to load coordinates into the database, the {{#coordinates:}} parser
function must also be called, this is done automatically in the Lua
version of {{coord}}.
]]
coordinates.coord = makeInvokeFunc('_coord')
function coordinates._coord(args)
if not tonumber(args[1]) and not args[2] then
args[3] = args[1]; args[1] = nil
local entity = mw.wikibase.getEntityObject(args.qid)
if entity
and entity.claims
and entity.claims.P625
and entity.claims.P625[1].mainsnak.snaktype == 'value'
then
local precision = entity.claims.P625[1].mainsnak.datavalue.value.precision
args[1] = entity.claims.P625[1].mainsnak.datavalue.value.latitude
args[2] = entity.claims.P625[1].mainsnak.datavalue.value.longitude
if precision then
precision = -math_mod._round(math.log(precision)/math.log(10),0)
args[1] = math_mod._round(args[1],precision)
args[2] = math_mod._round(args[2],precision)
end
end
end
local contents, backward = formatTest(args)
local Notes = args.notes or ''
local Display = args.display and args.display:lower() or 'inline'
-- it and ti are short for inline,title and title,inline
local function isInline(s)
-- Finds whether coordinates are displayed inline.
return s:find('inline') ~= nil or s == 'i' or s == 'it' or s == 'ti'
end
local function isInTitle(s)
-- Finds whether coordinates are displayed in the title.
return s:find('title') ~= nil or s == 't' or s == 'it' or s == 'ti'
end
local function coord_wrapper(in_args)
-- Calls the parser function {{#coordinates:}}.
return mw.getCurrentFrame():callParserFunction('#coordinates', in_args) or ''
end
local text = ''
if isInline(Display) then
text = text .. '<span class="geo-inline">' .. contents .. Notes .. '</span>'
end
if isInTitle(Display) then
-- Add to output since indicator content is invisible to Lua later on
if not isInline(Display) then
text = text .. '<span class="geo-inline-hidden noexcerpt">' .. contents .. Notes .. '</span>'
end
text = text .. displaytitle(contents .. Notes) .. makeWikidataCategories(args.qid)
end
if not args.nosave then
local page_title, count = mw.title.getCurrentTitle(), 1
if backward then
local tmp = {}
while not string.find((args[count-1] or ''), '[EW]') do tmp[count] = (args[count] or ''); count = count+1 end
tmp.count = count; count = 2*(count-1)
while count >= tmp.count do table.insert(tmp, 1, (args[count] or '')); count = count-1 end
for i, v in ipairs(tmp) do args[i] = v end
else
while count <= 9 do args[count] = (args[count] or ''); count = count+1 end
end
if isInTitle(Display) and not page_title.isTalkPage and page_title.subpageText ~= 'doc' and page_title.subpageText ~= 'testcases' then args[10] = 'primary' end
args.notes, args.format, args.display = nil
text = text .. coord_wrapper(args)
end
return text
end
--[[
coord2text
Extracts a single value from a transclusion of {{Coord}}.
IF THE GEOHACK LINK SYNTAX CHANGES THIS FUNCTION MUST BE MODIFIED.
Usage:
{{#invoke:Coordinates | coord2text | {{Coord}} | parameter }}
Valid values for the second parameter are: lat (signed integer), long (signed integer), type, scale, dim, region, globe, source
]]
function coordinates._coord2text(coord,type)
if coord == '' or type == '' or not type then return nil end
type = mw.text.trim(type)
if type == 'lat' or type == 'long' then
local coordString = mw.ustring.match(coord,'[%.%d]+°[NS] [%.%d]+°[EW]')
if not coordString then
return nil
end
local result = mw.text.split(coordString, ' ')
local negative
if type == 'lat' then
result, negative = result[1], 'S'
else
result, negative = result[2], 'W'
end
if not result then
return nil
end
result = mw.text.split(result, '°')
if not result[1] then
return nil
end
if result[2] == negative then result[1] = '-'..result[1] end
return result[1]
else
return mw.ustring.match(coord, 'params=.-_' .. type .. ':(.-)[ _]')
end
end
function coordinates.coord2text(frame)
return coordinates._coord2text(frame.args[1],frame.args[2]) or ''
end
--[[
coordinsert
Injects some text into the Geohack link of a transclusion of {{Coord}} (if that text isn't already in the transclusion). Outputs the modified transclusion of {{Coord}}.
IF THE GEOHACK LINK SYNTAX CHANGES THIS FUNCTION MUST BE MODIFIED.
Usage:
{{#invoke:Coordinates | coordinsert | {{Coord}} | parameter:value | parameter:value | … }}
Do not make Geohack unhappy by inserting something which isn't mentioned in the {{Coord}} documentation.
]]
function coordinates.coordinsert(frame)
-- for the 2nd or later integer parameter (the first is the coord template, as above)
for i, v in ipairs(frame.args) do
if i ~= 1 then
-- if we cannot find in the coord_template the i_th coordinsert parameter e.g. region
if not mw.ustring.find(frame.args[1], (mw.ustring.match(frame.args[i], '^(.-:)') or '')) then
-- find from the params= up to the first possibly-present underscore
-- and append the i_th coordinsert parameter and a space
-- IDK why we're adding a space but it does seem somewhat convenient
frame.args[1] = mw.ustring.gsub(frame.args[1], '(params=.-)_? ', '%1_'..frame.args[i]..' ')
end
end
end
if frame.args.name then
-- if we can't find the vcard class
if not mw.ustring.find(frame.args[1], '<span class="vcard">') then
-- take something that looks like a coord template and add the vcard span with class and fn org class
local namestr = frame.args.name
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(<span class="geo%-default">)(<span[^<>]*>[^<>]*</span><span[^<>]*>[^<>]*<span[^<>]*>[^<>]*</span></span>)(</span>)',
'%1<span class="vcard">%2<span style="display:none"> (<span class="fn org">' .. namestr .. '</span>)</span></span>%3'
)
-- then find anything from coordinates parameters to the 'end' and attach the title parameter
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(¶ms=[^&"<>%[%] ]*) ',
'%1&title=' .. mw.uri.encode(namestr) .. ' '
)
end
end
-- replace the existing indicator with a new indicator using the modified content
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(<span class="geo%-inline[^"]*">(.+)</span>)\127[^\127]*UNIQ%-%-indicator%-%x+%-%-?QINU[^\127]*\127',
function (inline, coord) return inline .. displaytitle(coord) end
)
return frame.args[1]
end
return coordinates
4j0gstvbrnunfsl9d87kcwlvt5s11ed
Arakai San
0
7378028
37019705
32892223
2026-05-02T11:40:13Z
Ultratomio
13680
removed [[Category:Kabukiran sa Hapon]]; added [[Category:Kabukiran sa Fukushima-ken]] using [[Help:Gadget-HotCat|HotCat]]
37019705
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|Hapon|date=2017-02}}
{{geobox
| 1 = Mountain
<!-- *** Header *** -->
| name = Arakai San
| native_name = 荒海山
| other_name = Tarō-dake
| category = Bukid
| etymology =
<!-- *** Image *** -->
| image =
| image_caption =
<!-- *** Administrative *** -->
| country = {{flag|Hapon}}
| country_flag =
| state = [[Fukushima-ken]]<br>[[Tochigi-ken]]
| region =
| district =
| municipality =
<!-- *** Mountain range *** -->
| range =
<!-- *** Position and height *** -->
| location =
| elevation = 1149
| elevation_note =
| prominence =
| prominence_note =
| lat_d = 37.03611
| lat_m =
| lat_s =
| lat_NS =
| long_d = 139.64407
| long_m =
| long_s =
| long_EW =
<!-- *** Properties *** -->
| geology =
| orogeny =
| period =
| biome =
| plant =
| animal =
<!-- *** Access *** -->
| public =
| access =
| ascent =
| ascent_date =
<!-- *** Free *** -->
| free =
| free_type =
<!-- *** Maps *** -->
| map =
| map_caption =
| map_locator_x =
| map_locator_y =
<!-- *** Notes *** -->
| footnotes =
| other_name1 = Arakai-zan
| other_name2 = Arakai-dake
| other_name3 = Arakai-yama
| other_name4 = Arakai-san
| height = 391
| width = {{formatnum:9.4}}
| width_unit = km
| highest_elevation = 1540
| timezone_label = Asia/Tokyo
| utc_offset = +9
| timezone = [[Japan Standard Time|JST]]
| geonames = 1865198
}}
<!--T.MT-->[[Bukid]] ang '''Arakai San''' ([[Hinapones]]: '''荒海山''') sa [[Hapon]].<ref name = "gn1865198"/> Nahimutang ni sa sentro nga bahin sa nasod, {{formatnum:150}} km sa amihanan sa [[Tokyo (ulohang dakbayan sa Hapon)|Tokyo]] ang ulohan sa nasod. {{formatnum:1540}} metros ibabaw sa dagat kahaboga ang nahimutangan sa Arakai San,<ref name = "gn1865198"/> o {{formatnum:391}} ka metros sa ibabaw sa naglibot nga tereyn{{efn|group=saysay|Topograpikong pagkainila, determinado gikan sa DEM 3 "data gikan sa Viewfinder Panoramas.<ref name = "vp"/> Ang bug-os nga algoritmo anaa [https://sv.wikipedia.org/wiki/Wikipedia:Projekt_DotNetWikiBot_Framework/Lsjbot/Make-Geonames dinhi].}}. Mga {{formatnum:9.4}} ka kilometro ang gilapdon sa tiilan niini.{{efn|group=saysay|Ang kinadak-ang extension sa contour sa paghatag sa topographic pagkainila.}}
Ang yuta palibot sa Arakai San kasagaran kabungtoran.{{efn|group=saysay|Kalkulado gikan sa pakigbingkil sa tanan nga gitas-on data (DEM 3") gikan sa Viewfinder Panoramas, sa sulod sa 10 ka kilometro radius.<ref name = "vp"/> Ang bug-os nga algoritmo anaa [https://sv.wikipedia.org/wiki/Wikipedia:Projekt_DotNetWikiBot_Framework/Lsjbot/Make-Geonames dinhi].}} Kinahabogang dapit sa palibot ang [[Taishaku Zan]], {{formatnum:2043}} ka metros ni kahaboga ibabaw sa dagat, {{formatnum:17.9}} km sa kasadpan sa Arakai San.{{efn|group=saysay|Ang punto nga labing taas sa ibabaw sa mga lokal nga kapunawpunawan, sumala sa gihabogon data sa GeoNames.<ref name = "gn1865198"/>}} Dunay mga {{formatnum:5}} ka tawo kada kilometro kwadrado sa palibot sa Arakai San may kaayo gamay nga populasyon.<ref name = "nasapop"/> Hapit nalukop sa [[lasang]] nga [[sagolsagol]] ang palibot sa Arakai San.<ref name = "nasalandcover"/> Sa rehiyon palibot sa Arakai San, kabukiran talagsaon komon.{{efn|group=saysay|Mas sulod sa 20 ka kilometro gilay-on itandi sa average nga densidad sa Yuta, sumala sa GeoNames.<ref name = "gn1865198"/>}}
Ang klima [[hemiboreal]].<ref name = "koppen"/> Ang kasarangang giiniton {{formatnum:8}} [[°C]]. Ang kinainitan nga bulan Hulyo, sa {{formatnum:18}} [[°C]], ug ang kinabugnawan Enero, sa {{formatnum:-4}} °C.<ref name = "nasa"/> Ang kasarangang pag-ulan {{formatnum:1952}} milimetro matag tuig. Ang kinabasaan nga bulan Hunyo, sa {{formatnum:323}} milimetro nga ulan, ug ang kinaugahan Enero, sa {{formatnum:40}} milimetro.<ref name = "nasarain"/>
{|
|-
|{{climate chart
| Arakai San
| -4| -3| 40
| -6| -1| 98
| -3| 3| 83
| 2| 11| 170
| 7| 15| 206
| 12| 18| 323
| 15| 20| 256
| 15| 20| 173
| 12| 18| 220
| 6| 12| 245
| 4| 8| 70
| -2| 1| 68
|float=left
|clear=left
|source = <ref name = "nasa"/>
}}
|}
{{Location map|Japan |float = right |width=300 | caption = Nahimutangan sa Arakai San sa Hapon. | label = Arakai San|position=right|background=white|lat=37.03611|long=139.64407}}
== Saysay ==
<references group="saysay"/>
== Ang mga gi basihan niini ==
<references>
<ref name = "gn1865198">[{{Geonameslink|gnid=1865198|name=arakai%20san}} Arakai San] sa [{{Geonamesabout}} Geonames.org (cc-by)]; post updated 2014-04-30; database download sa 2017-02-07</ref>
<ref name = "vp">{{Cite web |url= {{Viewfinderlink}}|title= Viewfinder Panoramas Digital elevation Model|date= 2015-06-21|format= }}</ref>
<ref name = "nasapop">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/view.php?datasetId=SEDAC_POP|title= NASA Earth Observations: Population Density|access-date = 30 Enero 2016 |publisher= NASA/SEDAC}}</ref>
<ref name = "nasalandcover">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/view.php?datasetId=MCD12C1_T1|title= NASA Earth Observations: Land Cover Classification|access-date = 30 Enero 2016 |publisher= NASA/MODIS}}</ref>
<ref name = "koppen">{{cite journal |last= Peel|first= M C|last2= Finlayson|first2= B L|date= |title= Updated world map of the Köppen-Geiger climate classification| url = http://www.hydrol-earth-syst-sci.net/11/1633/2007/hess-11-1633-2007.html |journal= Hydrology and Earth System Sciences|publisher= |volume= 11|issue= |pages= 1633-1644|doi= 10.5194/hess-11-1633-2007|access-date=30 Enero 2016}}</ref>
<ref name = "nasa">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/dataset_index.php|title= NASA Earth Observations Data Set Index|access-date = 30 Enero 2016 |publisher= NASA}}</ref>
<ref name = "nasarain">{{Cite web |url= http://neo.sci.gsfc.nasa.gov/view.php?datasetId=TRMM_3B43M|title= NASA Earth Observations: Rainfall (1 month - TRMM)|access-date = 30 Enero 2016 |publisher= NASA/Tropical Rainfall Monitoring Mission}}</ref>
</references>
[[Kategoriya:Kabukiran sa Fukushima-ken]]
[[Kategoriya:kabukiran sa Tochigi-ken]]
[[Kategoriya:Kabukiran sa Hapon nga mas taas kay sa 1000 metros ibabaw sa dagat nga lebel]]
hq3cfq0c3d0oh4jb30prnoy82od7b9u
Module:Collapsible list
828
8122849
37019554
33987596
2026-05-01T14:42:00Z
Exec8
10305
37019554
Scribunto
text/plain
local p = {}
local function getListItem( data )
if not type( data ) == 'string' then
return ''
end
return mw.ustring.format( '<li style="line-height: inherit; margin: 0">%s</li>', data )
end
-- Returns an array containing the keys of all positional arguments
-- that contain data (i.e. non-whitespace values).
local function getArgNums( args )
local nums = {}
for k, v in pairs( args ) do
if type( k ) == 'number' and
k >= 1 and
math.floor( k ) == k and
type( v ) == 'string' and
mw.ustring.match( v, '%S' ) then
table.insert( nums, k )
end
end
table.sort( nums )
return nums
end
-- Formats a list of classes, styles or other attributes.
local function formatAttributes( attrType, ... )
local attributes = { ... }
local nums = getArgNums( attributes )
local t = {}
for i, num in ipairs( nums ) do
table.insert( t, attributes[ num ] )
end
if #t == 0 then
return '' -- Return the blank string so concatenation will work.
end
return mw.ustring.format( ' %s="%s"', attrType, table.concat( t, ' ' ) )
end
-- TODO: use Module:List. Since the update for this comment is routine,
-- this is blocked without a consensus discussion by
-- [[MediaWiki_talk:Common.css/Archive_15#plainlist_+_hlist_indentation]]
-- if we decide hlist in plainlist in this template isn't an issue, we can use
-- module:list directly
-- [https://en.wikipedia.org/w/index.php?title=Module:Collapsible_list/sandbox&oldid=1130172480]
-- is an implementation (that will code rot slightly I expect)
local function buildList( args )
-- Get the list items.
local listItems = {}
local argNums = getArgNums( args )
for i, num in ipairs( argNums ) do
table.insert( listItems, getListItem( args[ num ] ) )
end
if #listItems == 0 then
return ''
end
listItems = table.concat( listItems )
-- hack around mw-collapsible show/hide jumpiness by looking for text-alignment
-- by setting a margin if centered
local textAlignmentCentered = 'text%-align%s*:%s*center'
local centeredTitle = (args.title_style and args.title_style:lower():match(textAlignmentCentered)
or args.titlestyle and args.titlestyle:lower():match(textAlignmentCentered))
local centeredTitleSpacing
if centeredTitle then
centeredTitleSpacing = 'margin: 0 4em'
else
centeredTitleSpacing = ''
end
-- Get class, style and title data.
local collapsibleContainerClass = formatAttributes(
'class',
'collapsible-list',
'mw-collapsible',
not args.expand and 'mw-collapsed'
)
local collapsibleContainerStyle = formatAttributes(
'style',
-- mostly work around .infobox-full-data defaulting to centered
'text-align: left;',
args.frame_style,
args.framestyle
)
local collapsibleTitleStyle = formatAttributes(
'style',
'line-height: 1.6em; font-weight: bold;',
args.title_style,
args.titlestyle
)
local jumpyTitleStyle = formatAttributes(
'style',
centeredTitleSpacing
)
local title = args.title or 'List'
local ulclass = formatAttributes( 'class', 'mw-collapsible-content', args.hlist and 'hlist' )
local ulstyle = formatAttributes(
'style',
'margin-top: 0; margin-bottom: 0; line-height: inherit;',
not args.bullets and 'list-style: none; margin-left: 0;',
args.list_style,
args.liststyle
)
local hlist_templatestyles = ''
if args.hlist then
hlist_templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Hlist/styles.css' }
}
end
-- Build the list.
return mw.ustring.format(
'%s<div%s%s>\n<div%s><div%s>%s</div></div>\n<ul%s%s>%s</ul>\n</div>',
hlist_templatestyles, collapsibleContainerClass, collapsibleContainerStyle,
collapsibleTitleStyle, jumpyTitleStyle, title, ulclass, ulstyle, listItems
)
end
function p.main( frame )
local origArgs
local current_frame = mw.getCurrentFrame()
if frame == current_frame then
origArgs = frame:getParent().args
for k, v in pairs( frame.args ) do
origArgs = frame.args
break
end
else
origArgs = frame
frame = current_frame
end
local args = {}
for k, v in pairs( origArgs ) do
if type( k ) == 'number' or v ~= '' then
args[ k ] = v
end
end
local check = require('Module:Check for unknown parameters')._check
local tracking = check({
['unknown'] = frame:expandTemplate{
title = 'main other',
args = {'[[Category:Pages using collapsible list with unknown parameters|_VALUE_ ]]'}
},
['preview'] = 'Page using [[Template:Collapsible list]] with unknown parameter "_VALUE_"',
['ignoreblank'] = 'y',
regexp1 = '%d+',
'title_style', 'titlestyle', 'expand',
'frame_style', 'framestyle', 'title',
'hlist', 'bullets', 'list_style', 'liststyle',
}, frame:getParent().args)
return buildList( args ) .. tracking
end
return p
2kihrrn48do8t8qo3tw5m7j9xei3a1o
Prionodon (mamipero)
0
9867926
37019691
36990329
2026-05-02T11:12:16Z
~2026-26632-15
142617
/* */
37019691
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Prionodon''
| status =
| image =
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Prionodontidae]]
| genus = '''Prionodon'''
| species =
| binomial = Prionodon
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
[[Kahenera]] sa [[mga mamipero]] ang '''''Prionodon'''''<ref name = "COL"/>. Ang ''Prionodon'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Viverridae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Viverridae]]
| 1={{Clade
| label1 = ''''' Prionodon '''''
| 1={{Clade
| 1=''[[Prionodon linsang]]''
| 2=''[[Prionodon pardicolor]]''
}}
| 2=''[[Arctictis]]''
| 3=''[[Arctogalidia]]''
| 4=''[[Chrotogale]]''
| 5=''[[Civettictis]]''
| 6=''[[Cynogale]]''
| 7=''[[Diplogale]]''
| 8=''[[Genetta]]''
| 9=''[[Hemigalus]]''
| 10=''[[Macrogalidia]]''
| 11=''[[Paguma]]''
| 12=''[[Mèlô|mèlô]]''
| 13=''[[Poiana]]''
| 14=''[[Viverra]]''
| 15=''[[Viverricula]]''
}}
}}
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 54993233|accessdate= 2019-11-11}}</ref>
</references>
[[Kategoriya:Mamipero]]
lig9nvfeddqvchfhtaxn0tb7hi5nizj
Module:Wd
828
9869120
37019592
35074655
2026-05-01T15:10:51Z
Exec8
10305
.
37019592
Scribunto
text/plain
-- Original module located at [[:en:Module:Wd]] and [[:en:Module:Wd/i18n]].
require("strict")
local p = {}
local module_arg = ...
local i18n
local i18nPath
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 = module_arg
end
if not i18n then
i18nPath = title .. "/i18n"
i18n = require(i18nPath).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",
globalSiteId = "globalSiteId"
}
local aliasesP = {
coord = "P625",
-----------------------
image = "P18",
author = "P50",
authorNameString = "P2093",
publisher = "P123",
importedFrom = "P143",
wikimediaImportURL = "P4656",
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",
subjectNamedAs = "P1810",
wikidataProperty = "P1687",
publishedIn = "P1433",
lastUpdate = "P5017"
}
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 function replaceAlias(id)
if aliasesP[id] then
id = aliasesP[id]
end
return id
end
local function errorText(code, ...)
local text = i18n["errors"][code]
if arg then text = mw.ustring.format(text, unpack(arg)) end
return text
end
local function throwError(errorMessage, ...)
error(errorText(errorMessage, unpack(arg)))
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
local 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
local 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(dateStr:sub(ptr, i-1), 10) -- 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
local function isValueInTable(searchedItem, inputTable)
for _, item in pairs(inputTable) do
if item == searchedItem then
return true
end
end
return false
end
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
-- 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.getLabel(id)
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://geohack.toolforge.org/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 citeParamMapping = i18n['cite']['param-mapping']
local citeConfig = i18n['cite']['config']
local citeTypes = i18n['cite']['output-types']
-- will hold rendered properties of the reference which are not directly from statement.snaks,
-- Namely, is URL generated from an external ID.
local additionalProcessedProperties = {}
-- for each citation type, there will be an associative array that associates lists of rendered properties
-- to citation-template parameters
local candidateParams = {}
-- like above, but only associates one rendered property to each parameter; if the above variable
-- contains more strings for a parameter, the strings will be assigned to numbered params (e.g. "author1")
local citeParams = {}
local citeErrors = {}
local referenceEmpty = true -- will be set to false if at least one parameter is left unremoved
local version = 12 -- increment this each time the below logic is changed to avoid conflict errors
if not statement.snaks then
return {}
end
-- don't use bot-added references referencing Wikimedia projects or containing "inferred from" (such references are not usable on Wikipedia)
if statement.snaks[aliasesP.importedFrom] or statement.snaks[aliasesP.wikimediaImportURL] or statement.snaks[aliasesP.inferredFrom] then
return {}
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
if statement.snaks[aliasesP.statedIn] and not statement.snaks[aliasesP.referenceURL] then
-- "stated in" was given but "reference URL" was not.
-- get "Wikidata property" properties from the item in "stated in"
-- if any of the returned properties of the external-id datatype is in statement.snaks, generate a link from it and use the link in the reference
-- find the "Wikidata property" properties in the item from "stated in"
local wikidataPropertiesOfSource = mw.text.split(p._properties{p.flags.raw, aliasesP.wikidataProperty, [p.args.eid] = self.conf:getValue(statement.snaks[aliasesP.statedIn][1], true, false)}, ", ", true)
for i, wikidataPropertyOfSource in pairs(wikidataPropertiesOfSource) do
if statement.snaks[wikidataPropertyOfSource] and statement.snaks[wikidataPropertyOfSource][1].datatype == "external-id" then
local tempLink = self:getReferenceDetail(statement.snaks, wikidataPropertyOfSource, false, true) -- not raw, linked
if mw.ustring.match(tempLink, "^%[%Z- %Z+%]$") then -- getValue returned a URL in square brackets.
-- the link is in wiki markup, so strip the square brackets and the display text
-- gsub also returns another, discarted value, therefore the result is assigned to tempLink first
tempLink = mw.ustring.gsub(tempLink, "^%[(%Z-) %Z+%]$", "%1")
additionalProcessedProperties[aliasesP.referenceURL] = {tempLink}
statement.snaks[wikidataPropertyOfSource] = nil
break
end
end
end
end
-- initialize candidateParams and citeParams
for _, citeType in ipairs(citeTypes) do
candidateParams[citeType] = {}
citeParams[citeType] = {}
end
-- fill candidateParams
for _, citeType in ipairs(citeTypes) do
-- This will contain value--priority pairs for each param name.
local candidateValuesAndPriorities = {}
-- fill candidateValuesAndPriorities
for refProperty in pairs(statement.snaks) do
if citeErrors[citeType] then
break
end
repeat -- just a simple wrapper to emulate "continue"
-- set mappingKey and prefix
local mappingKey
local prefix = ""
if statement.snaks[refProperty][1].datatype == 'external-id' then
mappingKey = "external-id"
prefix = self.conf:getLabel(refProperty)
if prefix ~= "" then
prefix = prefix .. " "
end
else
mappingKey = refProperty
end
local paramName = citeParamMapping[citeType][mappingKey]
-- skip properties with empty parameter name
if paramName == "" then
break -- skip this property for this value of citeType
end
-- handle unknown properties in the reference
if not paramName then
referenceEmpty = false
local error_message = errorText("unknown-property-in-ref", refProperty)
assert(error_message) -- Should not be nil
citeErrors[citeType] = error_message
break
end
-- set processedProperty
local processedProperty
local raw = false -- if the value is wanted raw
if isValueInTable(paramName, citeConfig[citeType]["raw-value-params"] or {}) then
raw = true
end
if isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then
-- Multiple values may be given.
processedProperty = self:getReferenceDetails(statement.snaks, refProperty, raw, self.linked, true) -- anyLang = true
else
-- If multiple values are given, all but the first suitable one are discarted.
processedProperty = {self:getReferenceDetail(statement.snaks, refProperty, raw, self.linked and (statement.snaks[refProperty][1].datatype ~= 'url'), true)} -- link = true/false, anyLang = true
end
if #processedProperty == 0 then
break
end
referenceEmpty = false
-- add an empty entry to candidateValuesAndPriorities, if there isn't one already
if not candidateValuesAndPriorities[paramName] then
candidateValuesAndPriorities[paramName] = {}
end
-- find the priority of refProperty
local thisPropertyPriority = -1
local thisParamPrioritization = citeConfig[citeType]["prioritization"][paramName]
if thisParamPrioritization then
for i_priority, i_property in ipairs(thisParamPrioritization) do
if i_property == refProperty then
thisPropertyPriority = i_priority
end
end
end
for _, propertyValue in pairs(processedProperty) do
table.insert(
candidateValuesAndPriorities[paramName],
{prefix .. propertyValue, thisPropertyPriority}
)
end
until true
end
-- fill candidateParams[citeType]
if not citeErrors[citeType] then
local compareValuePriorities = function(pair1, pair2)
if pair1[2] == -1 and pair2[2] ~= -1 then
return false
end
if pair1[2] ~= -1 and pair2[2] == -1 then
return true
end
return pair1[2] < pair2[2]
end
-- fill candidateParams[citeType][paramName] for each used param
for paramName, _ in pairs(candidateValuesAndPriorities) do
table.sort(candidateValuesAndPriorities[paramName], compareValuePriorities)
candidateParams[citeType][paramName] = {}
for _, valuePriorityPair in ipairs(candidateValuesAndPriorities[paramName]) do
table.insert(candidateParams[citeType][paramName], valuePriorityPair[1])
end
end
end
end
-- handle additional properties
for refProperty in pairs(additionalProcessedProperties) do
for _, citeType in ipairs(citeTypes) do
repeat
-- skip if there already have been errors
if citeErrors[citeType] then
break
end
local paramName = citeParamMapping[citeType][refProperty]
-- handle unknown properties in the reference
if not paramName then
-- Skip this additional property, but do not cause an error.
break
end
if paramName == "" then
break
end
referenceEmpty = false
if not candidateParams[citeType][paramName] then
candidateParams[citeType][paramName] = {}
end
for _, propertyValue in pairs(additionalProcessedProperties[refProperty]) do
table.insert(candidateParams[citeType][paramName], propertyValue)
end
until true
end
end
-- fill citeParams
for _, citeType in ipairs(citeTypes) do
for paramName, paramValues in pairs(candidateParams[citeType]) do
if #paramValues == 1 or not isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then
citeParams[citeType][paramName] = paramValues[1]
else
-- There is more than one value for this parameter - the values will
-- go into separate numbered parameters (e.g. "author1", "author2")
for paramNum, paramValue in pairs(paramValues) do
citeParams[citeType][paramName .. paramNum] = paramValue
end
end
end
end
-- handle missing mandatory parameters for the templates
for _, citeType in ipairs(citeTypes) do
for _, requiredCiteParam in pairs(citeConfig[citeType]["mandatory-params"] or {}) do
if not citeParams[citeType][requiredCiteParam] then -- The required param is not present.
if citeErrors[citeType] then -- Do not override the previous error, if it exists.
break
end
local error_message = errorText("missing-mandatory-param", requiredCiteParam)
assert(error_message) -- Should not be nil
citeErrors[citeType] = error_message
end
end
end
local citeTypeToUse = nil
-- choose the output template
for _, citeType in ipairs(citeTypes) do
if not citeErrors[citeType] then
citeTypeToUse = citeType
break
end
end
-- set refContent
local refContent = ""
if citeTypeToUse then
local templateToUse = citeConfig[citeTypeToUse]["template"]
local paramsToUse = citeParams[citeTypeToUse]
if not templateToUse or templateToUse == "" then
throwError("no-such-reference-template", tostring(templateToUse), i18nPath, citeTypeToUse)
end
-- 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(paramsToUse) do
refContent = refContent .. "|" .. i .. "=" .. v
end
refContent = "{{" .. templateToUse .. refContent .. "}}"
else
xpcall(
function () refContent = mw.getCurrentFrame():expandTemplate{title=templateToUse, args=paramsToUse} end,
function () throwError("no-such-reference-template", templateToUse, i18nPath, citeTypeToUse) end
)
end
-- If the citation couldn't be displayed using any template, but is not empty (barring ignored propeties), throw an error.
elseif not referenceEmpty then
refContent = errorText("malformed-reference-header")
for _, citeType in ipairs(citeTypes) do
refContent = refContent .. errorText("template-failure-reason", citeConfig[citeType]["template"], citeErrors[citeType])
end
refContent = refContent .. errorText("malformed-reference-footer")
end
-- wrap refContent
local ref = {}
if refContent ~= "" then
ref = {refContent}
if not self.rawValue then
-- this should become a <ref> tag, so save the reference's hash for later
ref.refHash = "wikidata-" .. statement.hash .. "-v" .. (tonumber(i18n['version']) + version)
end
return {ref}
else
return {}
end
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)
-- 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
local 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, globalSiteId)
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, globalSiteId) 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], false, args[p.args.globalSiteId])
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, args[p.args.globalSiteId])
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
j5a6l03tjwodgrvfnv3lb4x5up93wlv
37019602
37019592
2026-05-01T15:21:02Z
Exec8
10305
Reverted edit by [[Special:Contributions/Exec8|Exec8]] ([[User talk:Exec8|talk]]) to last revision by [[User:Spilltea|Spilltea]]
35074655
Scribunto
text/plain
-- Original module located at [[:en:Module:Wd]] and [[:en:Module:Wd/i18n]].
require("strict")
local p = {}
local module_arg = ...
local i18n
local i18nPath
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 = module_arg
end
if not i18n then
i18nPath = title .. "/i18n"
i18n = require(i18nPath).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",
globalSiteId = "globalSiteId"
}
local aliasesP = {
coord = "P625",
-----------------------
image = "P18",
author = "P50",
authorNameString = "P2093",
publisher = "P123",
importedFrom = "P143",
wikimediaImportURL = "P4656",
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",
subjectNamedAs = "P1810",
wikidataProperty = "P1687",
publishedIn = "P1433"
}
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 function replaceAlias(id)
if aliasesP[id] then
id = aliasesP[id]
end
return id
end
local function errorText(code, ...)
local text = i18n["errors"][code]
if arg then text = mw.ustring.format(text, unpack(arg)) end
return text
end
local function throwError(errorMessage, ...)
error(errorText(errorMessage, unpack(arg)))
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
local 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
local 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(dateStr:sub(ptr, i-1), 10) -- 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
local function isValueInTable(searchedItem, inputTable)
for _, item in pairs(inputTable) do
if item == searchedItem then
return true
end
end
return false
end
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
-- 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.getLabel(id)
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://geohack.toolforge.org/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 citeParamMapping = i18n['cite']['param-mapping']
local citeConfig = i18n['cite']['config']
local citeTypes = i18n['cite']['output-types']
-- will hold rendered properties of the reference which are not directly from statement.snaks,
-- Namely, these are a backup title from "subject named as" and a URL generated from an external ID.
local additionalProcessedProperties = {}
-- for each citation type, there will be an associative array that associates lists of rendered properties
-- to citation-template parameters
local groupedProcessedProperties = {}
-- like above, but only associates one rendered property to each parameter; if the above variable
-- contains more strings for a parameter, the strings will be assigned to numbered params (e.g. "author1")
local citeParams = {}
local citeErrors = {}
local referenceEmpty = true -- will be set to false if at least one parameter is left unremoved
local version = 11 -- increment this each time the below logic is changed to avoid conflict errors
if not statement.snaks then
return {}
end
-- don't use bot-added references referencing Wikimedia projects or containing "inferred from" (such references are not usable on Wikipedia)
if statement.snaks[aliasesP.importedFrom] or statement.snaks[aliasesP.wikimediaImportURL] or statement.snaks[aliasesP.inferredFrom] then
return {}
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
if statement.snaks[aliasesP.statedIn] and not statement.snaks[aliasesP.referenceURL] then
-- "stated in" was given but "reference URL" was not.
-- get "Wikidata property" properties from the item in "stated in"
-- if any of the returned properties of the external-id datatype is in statement.snaks, generate a link from it and use the link in the reference
-- find the "Wikidata property" properties in the item from "stated in"
local wikidataPropertiesOfSource = mw.text.split(p._properties{p.flags.raw, aliasesP.wikidataProperty, [p.args.eid] = self.conf:getValue(statement.snaks[aliasesP.statedIn][1], true, false)}, ", ", true)
for i, wikidataPropertyOfSource in pairs(wikidataPropertiesOfSource) do
if statement.snaks[wikidataPropertyOfSource] and statement.snaks[wikidataPropertyOfSource][1].datatype == "external-id" then
local tempLink = self:getReferenceDetail(statement.snaks, wikidataPropertyOfSource, false, true) -- not raw, linked
if mw.ustring.match(tempLink, "^%[%Z- %Z+%]$") then -- getValue returned a URL in square brackets.
-- the link is in wiki markup, so strip the square brackets and the display text
-- gsub also returns another, discarted value, therefore the result is assigned to tempLink first
tempLink = mw.ustring.gsub(tempLink, "^%[(%Z-) %Z+%]$", "%1")
additionalProcessedProperties[aliasesP.referenceURL] = {tempLink}
statement.snaks[wikidataPropertyOfSource] = nil
break
end
end
end
end
-- don't include "subject named as", but use it as the title when "title" is not present but a URL is
if statement.snaks[aliasesP.subjectNamedAs] then
if not statement.snaks[aliasesP.title] and (statement.snaks[aliasesP.referenceURL] or additionalProcessedProperties[aliasesP.referenceURL]) then
additionalProcessedProperties[aliasesP.title] = {self:getReferenceDetail(statement.snaks, aliasesP.subjectNamedAs, false, false, true)} -- not raw, not linked, anyLang
end
statement.snaks[aliasesP.subjectNamedAs] = nil
end
-- initialize groupedProcessedProperties and citeParams
for _, citeType in ipairs(citeTypes) do
groupedProcessedProperties[citeType] = {}
citeParams[citeType] = {}
end
-- fill groupedProcessedProperties
for refProperty in pairs(statement.snaks) do
-- add the parameter to each matching type of citation
for _, citeType in ipairs(citeTypes) do
repeat -- just a simple wrapper to emulate "continue"
-- skip if there already have been errors
if citeErrors[citeType] then
break
end
-- set mappingKey and prefix
local mappingKey
local prefix = ""
if statement.snaks[refProperty][1].datatype == 'external-id' then
mappingKey = "external-id"
prefix = self.conf:getLabel(refProperty)
if prefix ~= "" then
prefix = prefix .. " "
end
else
mappingKey = refProperty
end
local paramName = citeParamMapping[citeType][mappingKey]
-- skip properties with empty parameter name
if paramName == "" then
break
end
referenceEmpty = false
-- handle unknown properties in the reference
if not paramName then
local error_message = errorText("unknown-property-in-ref", refProperty)
assert(error_message) -- Should not be nil
citeErrors[citeType] = error_message
break
end
-- set processedProperty
local processedProperty
local raw = false -- if the value is wanted raw
if isValueInTable(paramName, citeConfig[citeType]["raw-value-params"] or {}) then
raw = true
end
if isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then
-- Multiple values may be given.
processedProperty = self:getReferenceDetails(statement.snaks, refProperty, raw, self.linked, true) -- anyLang = true
else
-- If multiple values are given, all but the first suitable one are discarted.
processedProperty = {self:getReferenceDetail(statement.snaks, refProperty, raw, self.linked and (statement.snaks[refProperty][1].datatype ~= 'url'), true)} -- link = true/false, anyLang = true
end
if #processedProperty == 0 then
break
end
-- add an entry to groupedProcessedProperties
if not groupedProcessedProperties[citeType][paramName] then
groupedProcessedProperties[citeType][paramName] = {}
end
for _, propertyValue in pairs(processedProperty) do
table.insert(groupedProcessedProperties[citeType][paramName], prefix .. propertyValue)
end
until true
end
end
-- handle additional properties
for refProperty in pairs(additionalProcessedProperties) do
for _, citeType in ipairs(citeTypes) do
repeat
-- skip if there already have been errors
if citeErrors[citeType] then
break
end
local paramName = citeParamMapping[citeType][refProperty]
-- handle unknown properties in the reference
if not paramName then
-- Skip this additional property, but do not cause an error.
break
end
if paramName == "" then
break
end
referenceEmpty = false
if not groupedProcessedProperties[citeType][paramName] then
groupedProcessedProperties[citeType][paramName] = {}
end
for _, propertyValue in pairs(additionalProcessedProperties[refProperty]) do
table.insert(groupedProcessedProperties[citeType][paramName], propertyValue)
end
until true
end
end
-- fill citeParams
for _, citeType in ipairs(citeTypes) do
for paramName, paramValues in pairs(groupedProcessedProperties[citeType]) do
if #paramValues == 1 or not isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then
citeParams[citeType][paramName] = paramValues[1]
else
-- There is more than one value for this parameter - the values will
-- go into separate numbered parameters (e.g. "author1", "author2")
for paramNum, paramValue in pairs(paramValues) do
citeParams[citeType][paramName .. paramNum] = paramValue
end
end
end
end
-- handle missing mandatory parameters for the templates
for _, citeType in ipairs(citeTypes) do
for _, requiredCiteParam in pairs(citeConfig[citeType]["mandatory-params"] or {}) do
if not citeParams[citeType][requiredCiteParam] then -- The required param is not present.
if citeErrors[citeType] then -- Do not override the previous error, if it exists.
break
end
local error_message = errorText("missing-mandatory-param", requiredCiteParam)
assert(error_message) -- Should not be nil
citeErrors[citeType] = error_message
end
end
end
local citeTypeToUse = nil
-- choose the output template
for _, citeType in ipairs(citeTypes) do
if not citeErrors[citeType] then
citeTypeToUse = citeType
break
end
end
-- set refContent
local refContent = ""
if citeTypeToUse then
local templateToUse = citeConfig[citeTypeToUse]["template"]
local paramsToUse = citeParams[citeTypeToUse]
if not templateToUse or templateToUse == "" then
throwError("no-such-reference-template", tostring(templateToUse), i18nPath, citeTypeToUse)
end
-- 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(paramsToUse) do
refContent = refContent .. "|" .. i .. "=" .. v
end
refContent = "{{" .. templateToUse .. refContent .. "}}"
else
xpcall(
function () refContent = mw.getCurrentFrame():expandTemplate{title=templateToUse, args=paramsToUse} end,
function () throwError("no-such-reference-template", templateToUse, i18nPath, citeTypeToUse) end
)
end
-- If the citation couldn't be displayed using any template, but is not empty (barring ignored propeties), throw an error.
elseif not referenceEmpty then
refContent = errorText("malformed-reference-header")
for _, citeType in ipairs(citeTypes) do
refContent = refContent .. errorText("template-failure-reason", citeConfig[citeType]["template"], citeErrors[citeType])
end
refContent = refContent .. errorText("malformed-reference-footer")
end
-- wrap refContent
local ref = {}
if refContent ~= "" then
ref = {refContent}
if not self.rawValue then
-- this should become a <ref> tag, so save the reference's hash for later
ref.refHash = "wikidata-" .. statement.hash .. "-v" .. (tonumber(i18n['version']) + version)
end
return {ref}
else
return {}
end
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, globalSiteId)
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, globalSiteId) 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], false, args[p.args.globalSiteId])
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, args[p.args.globalSiteId])
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
klnosw6qk6m6vbnazowivije405gt0c
37019603
37019602
2026-05-01T15:21:53Z
Exec8
10305
37019603
Scribunto
text/plain
-- Original module located at [[:en:Module:Wd]] and [[:en:Module:Wd/i18n]].
require("strict")
local p = {}
local module_arg = ...
local i18n
local i18nPath
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 = module_arg
end
if not i18n then
i18nPath = title .. "/i18n"
i18n = require(i18nPath).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",
globalSiteId = "globalSiteId"
}
local aliasesP = {
coord = "P625",
-----------------------
image = "P18",
author = "P50",
authorNameString = "P2093",
publisher = "P123",
importedFrom = "P143",
wikimediaImportURL = "P4656",
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",
subjectNamedAs = "P1810",
wikidataProperty = "P1687",
publishedIn = "P1433",
lastUpdate = "P5017"
}
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 function replaceAlias(id)
if aliasesP[id] then
id = aliasesP[id]
end
return id
end
local function errorText(code, ...)
local text = i18n["errors"][code]
if arg then text = mw.ustring.format(text, unpack(arg)) end
return text
end
local function throwError(errorMessage, ...)
error(errorText(errorMessage, unpack(arg)))
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
local 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
local 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(dateStr:sub(ptr, i-1), 10) -- 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
local function isValueInTable(searchedItem, inputTable)
for _, item in pairs(inputTable) do
if item == searchedItem then
return true
end
end
return false
end
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
-- 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.getLabel(id)
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://geohack.toolforge.org/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 citeParamMapping = i18n['cite']['param-mapping']
local citeConfig = i18n['cite']['config']
local citeTypes = i18n['cite']['output-types']
-- will hold rendered properties of the reference which are not directly from statement.snaks,
-- Namely, is URL generated from an external ID.
local additionalProcessedProperties = {}
-- for each citation type, there will be an associative array that associates lists of rendered properties
-- to citation-template parameters
local candidateParams = {}
-- like above, but only associates one rendered property to each parameter; if the above variable
-- contains more strings for a parameter, the strings will be assigned to numbered params (e.g. "author1")
local citeParams = {}
local citeErrors = {}
local referenceEmpty = true -- will be set to false if at least one parameter is left unremoved
local version = 12 -- increment this each time the below logic is changed to avoid conflict errors
if not statement.snaks then
return {}
end
-- don't use bot-added references referencing Wikimedia projects or containing "inferred from" (such references are not usable on Wikipedia)
if statement.snaks[aliasesP.importedFrom] or statement.snaks[aliasesP.wikimediaImportURL] or statement.snaks[aliasesP.inferredFrom] then
return {}
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
if statement.snaks[aliasesP.statedIn] and not statement.snaks[aliasesP.referenceURL] then
-- "stated in" was given but "reference URL" was not.
-- get "Wikidata property" properties from the item in "stated in"
-- if any of the returned properties of the external-id datatype is in statement.snaks, generate a link from it and use the link in the reference
-- find the "Wikidata property" properties in the item from "stated in"
local wikidataPropertiesOfSource = mw.text.split(p._properties{p.flags.raw, aliasesP.wikidataProperty, [p.args.eid] = self.conf:getValue(statement.snaks[aliasesP.statedIn][1], true, false)}, ", ", true)
for i, wikidataPropertyOfSource in pairs(wikidataPropertiesOfSource) do
if statement.snaks[wikidataPropertyOfSource] and statement.snaks[wikidataPropertyOfSource][1].datatype == "external-id" then
local tempLink = self:getReferenceDetail(statement.snaks, wikidataPropertyOfSource, false, true) -- not raw, linked
if mw.ustring.match(tempLink, "^%[%Z- %Z+%]$") then -- getValue returned a URL in square brackets.
-- the link is in wiki markup, so strip the square brackets and the display text
-- gsub also returns another, discarted value, therefore the result is assigned to tempLink first
tempLink = mw.ustring.gsub(tempLink, "^%[(%Z-) %Z+%]$", "%1")
additionalProcessedProperties[aliasesP.referenceURL] = {tempLink}
statement.snaks[wikidataPropertyOfSource] = nil
break
end
end
end
end
-- initialize candidateParams and citeParams
for _, citeType in ipairs(citeTypes) do
candidateParams[citeType] = {}
citeParams[citeType] = {}
end
-- fill candidateParams
for _, citeType in ipairs(citeTypes) do
-- This will contain value--priority pairs for each param name.
local candidateValuesAndPriorities = {}
-- fill candidateValuesAndPriorities
for refProperty in pairs(statement.snaks) do
if citeErrors[citeType] then
break
end
repeat -- just a simple wrapper to emulate "continue"
-- set mappingKey and prefix
local mappingKey
local prefix = ""
if statement.snaks[refProperty][1].datatype == 'external-id' then
mappingKey = "external-id"
prefix = self.conf:getLabel(refProperty)
if prefix ~= "" then
prefix = prefix .. " "
end
else
mappingKey = refProperty
end
local paramName = citeParamMapping[citeType][mappingKey]
-- skip properties with empty parameter name
if paramName == "" then
break -- skip this property for this value of citeType
end
-- handle unknown properties in the reference
if not paramName then
referenceEmpty = false
local error_message = errorText("unknown-property-in-ref", refProperty)
assert(error_message) -- Should not be nil
citeErrors[citeType] = error_message
break
end
-- set processedProperty
local processedProperty
local raw = false -- if the value is wanted raw
if isValueInTable(paramName, citeConfig[citeType]["raw-value-params"] or {}) then
raw = true
end
if isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then
-- Multiple values may be given.
processedProperty = self:getReferenceDetails(statement.snaks, refProperty, raw, self.linked, true) -- anyLang = true
else
-- If multiple values are given, all but the first suitable one are discarted.
processedProperty = {self:getReferenceDetail(statement.snaks, refProperty, raw, self.linked and (statement.snaks[refProperty][1].datatype ~= 'url'), true)} -- link = true/false, anyLang = true
end
if #processedProperty == 0 then
break
end
referenceEmpty = false
-- add an empty entry to candidateValuesAndPriorities, if there isn't one already
if not candidateValuesAndPriorities[paramName] then
candidateValuesAndPriorities[paramName] = {}
end
-- find the priority of refProperty
local thisPropertyPriority = -1
local thisParamPrioritization = citeConfig[citeType]["prioritization"][paramName]
if thisParamPrioritization then
for i_priority, i_property in ipairs(thisParamPrioritization) do
if i_property == refProperty then
thisPropertyPriority = i_priority
end
end
end
for _, propertyValue in pairs(processedProperty) do
table.insert(
candidateValuesAndPriorities[paramName],
{prefix .. propertyValue, thisPropertyPriority}
)
end
until true
end
-- fill candidateParams[citeType]
if not citeErrors[citeType] then
local compareValuePriorities = function(pair1, pair2)
if pair1[2] == -1 and pair2[2] ~= -1 then
return false
end
if pair1[2] ~= -1 and pair2[2] == -1 then
return true
end
return pair1[2] < pair2[2]
end
-- fill candidateParams[citeType][paramName] for each used param
for paramName, _ in pairs(candidateValuesAndPriorities) do
table.sort(candidateValuesAndPriorities[paramName], compareValuePriorities)
candidateParams[citeType][paramName] = {}
for _, valuePriorityPair in ipairs(candidateValuesAndPriorities[paramName]) do
table.insert(candidateParams[citeType][paramName], valuePriorityPair[1])
end
end
end
end
-- handle additional properties
for refProperty in pairs(additionalProcessedProperties) do
for _, citeType in ipairs(citeTypes) do
repeat
-- skip if there already have been errors
if citeErrors[citeType] then
break
end
local paramName = citeParamMapping[citeType][refProperty]
-- handle unknown properties in the reference
if not paramName then
-- Skip this additional property, but do not cause an error.
break
end
if paramName == "" then
break
end
referenceEmpty = false
if not candidateParams[citeType][paramName] then
candidateParams[citeType][paramName] = {}
end
for _, propertyValue in pairs(additionalProcessedProperties[refProperty]) do
table.insert(candidateParams[citeType][paramName], propertyValue)
end
until true
end
end
-- fill citeParams
for _, citeType in ipairs(citeTypes) do
for paramName, paramValues in pairs(candidateParams[citeType]) do
if #paramValues == 1 or not isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then
citeParams[citeType][paramName] = paramValues[1]
else
-- There is more than one value for this parameter - the values will
-- go into separate numbered parameters (e.g. "author1", "author2")
for paramNum, paramValue in pairs(paramValues) do
citeParams[citeType][paramName .. paramNum] = paramValue
end
end
end
end
-- handle missing mandatory parameters for the templates
for _, citeType in ipairs(citeTypes) do
for _, requiredCiteParam in pairs(citeConfig[citeType]["mandatory-params"] or {}) do
if not citeParams[citeType][requiredCiteParam] then -- The required param is not present.
if citeErrors[citeType] then -- Do not override the previous error, if it exists.
break
end
local error_message = errorText("missing-mandatory-param", requiredCiteParam)
assert(error_message) -- Should not be nil
citeErrors[citeType] = error_message
end
end
end
local citeTypeToUse = nil
-- choose the output template
for _, citeType in ipairs(citeTypes) do
if not citeErrors[citeType] then
citeTypeToUse = citeType
break
end
end
-- set refContent
local refContent = ""
if citeTypeToUse then
local templateToUse = citeConfig[citeTypeToUse]["template"]
local paramsToUse = citeParams[citeTypeToUse]
if not templateToUse or templateToUse == "" then
throwError("no-such-reference-template", tostring(templateToUse), i18nPath, citeTypeToUse)
end
-- 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(paramsToUse) do
refContent = refContent .. "|" .. i .. "=" .. v
end
refContent = "{{" .. templateToUse .. refContent .. "}}"
else
xpcall(
function () refContent = mw.getCurrentFrame():expandTemplate{title=templateToUse, args=paramsToUse} end,
function () throwError("no-such-reference-template", templateToUse, i18nPath, citeTypeToUse) end
)
end
-- If the citation couldn't be displayed using any template, but is not empty (barring ignored propeties), throw an error.
elseif not referenceEmpty then
refContent = errorText("malformed-reference-header")
for _, citeType in ipairs(citeTypes) do
refContent = refContent .. errorText("template-failure-reason", citeConfig[citeType]["template"], citeErrors[citeType])
end
refContent = refContent .. errorText("malformed-reference-footer")
end
-- wrap refContent
local ref = {}
if refContent ~= "" then
ref = {refContent}
if not self.rawValue then
-- this should become a <ref> tag, so save the reference's hash for later
ref.refHash = "wikidata-" .. statement.hash .. "-v" .. (tonumber(i18n['version']) + version)
end
return {ref}
else
return {}
end
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)
-- 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
local 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, globalSiteId)
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, globalSiteId) 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], false, args[p.args.globalSiteId])
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, args[p.args.globalSiteId])
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
j5a6l03tjwodgrvfnv3lb4x5up93wlv
37019611
37019603
2026-05-01T15:46:28Z
Exec8
10305
37019611
Scribunto
text/plain
-- Original module located at [[:en:Module:Wd]] and [[:en:Module:Wd/i18n]].
require("strict")
local p = {}
local module_arg = ...
local i18n
local i18nPath
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 = module_arg
end
if not i18n then
i18nPath = title .. "/i18n"
i18n = require(i18nPath).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",
globalSiteId = "globalSiteId"
}
local aliasesP = {
coord = "P625",
-----------------------
image = "P18",
author = "P50",
authorNameString = "P2093",
publisher = "P123",
importedFrom = "P143",
wikimediaImportURL = "P4656",
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",
subjectNamedAs = "P1810",
wikidataProperty = "P1687",
publishedIn = "P1433"
}
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 function replaceAlias(id)
if aliasesP[id] then
id = aliasesP[id]
end
return id
end
local function errorText(code, ...)
local text = i18n["errors"][code]
if arg then text = mw.ustring.format(text, unpack(arg)) end
return text
end
local function throwError(errorMessage, ...)
error(errorText(errorMessage, unpack(arg)))
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
local 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
local 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(dateStr:sub(ptr, i-1), 10) -- 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
local function isValueInTable(searchedItem, inputTable)
for _, item in pairs(inputTable) do
if item == searchedItem then
return true
end
end
return false
end
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
-- 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.getLabel(id)
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://geohack.toolforge.org/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 citeParamMapping = i18n['cite']['param-mapping']
local citeConfig = i18n['cite']['config']
local citeTypes = i18n['cite']['output-types']
-- will hold rendered properties of the reference which are not directly from statement.snaks,
-- Namely, these are a backup title from "subject named as" and a URL generated from an external ID.
local additionalProcessedProperties = {}
-- for each citation type, there will be an associative array that associates lists of rendered properties
-- to citation-template parameters
local groupedProcessedProperties = {}
-- like above, but only associates one rendered property to each parameter; if the above variable
-- contains more strings for a parameter, the strings will be assigned to numbered params (e.g. "author1")
local citeParams = {}
local citeErrors = {}
local referenceEmpty = true -- will be set to false if at least one parameter is left unremoved
local version = 11 -- increment this each time the below logic is changed to avoid conflict errors
if not statement.snaks then
return {}
end
-- don't use bot-added references referencing Wikimedia projects or containing "inferred from" (such references are not usable on Wikipedia)
if statement.snaks[aliasesP.importedFrom] or statement.snaks[aliasesP.wikimediaImportURL] or statement.snaks[aliasesP.inferredFrom] then
return {}
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
if statement.snaks[aliasesP.statedIn] and not statement.snaks[aliasesP.referenceURL] then
-- "stated in" was given but "reference URL" was not.
-- get "Wikidata property" properties from the item in "stated in"
-- if any of the returned properties of the external-id datatype is in statement.snaks, generate a link from it and use the link in the reference
-- find the "Wikidata property" properties in the item from "stated in"
local wikidataPropertiesOfSource = mw.text.split(p._properties{p.flags.raw, aliasesP.wikidataProperty, [p.args.eid] = self.conf:getValue(statement.snaks[aliasesP.statedIn][1], true, false)}, ", ", true)
for i, wikidataPropertyOfSource in pairs(wikidataPropertiesOfSource) do
if statement.snaks[wikidataPropertyOfSource] and statement.snaks[wikidataPropertyOfSource][1].datatype == "external-id" then
local tempLink = self:getReferenceDetail(statement.snaks, wikidataPropertyOfSource, false, true) -- not raw, linked
if mw.ustring.match(tempLink, "^%[%Z- %Z+%]$") then -- getValue returned a URL in square brackets.
-- the link is in wiki markup, so strip the square brackets and the display text
-- gsub also returns another, discarted value, therefore the result is assigned to tempLink first
tempLink = mw.ustring.gsub(tempLink, "^%[(%Z-) %Z+%]$", "%1")
additionalProcessedProperties[aliasesP.referenceURL] = {tempLink}
statement.snaks[wikidataPropertyOfSource] = nil
break
end
end
end
end
-- don't include "subject named as", but use it as the title when "title" is not present but a URL is
if statement.snaks[aliasesP.subjectNamedAs] then
if not statement.snaks[aliasesP.title] and (statement.snaks[aliasesP.referenceURL] or additionalProcessedProperties[aliasesP.referenceURL]) then
additionalProcessedProperties[aliasesP.title] = {self:getReferenceDetail(statement.snaks, aliasesP.subjectNamedAs, false, false, true)} -- not raw, not linked, anyLang
end
statement.snaks[aliasesP.subjectNamedAs] = nil
end
-- initialize groupedProcessedProperties and citeParams
for _, citeType in ipairs(citeTypes) do
groupedProcessedProperties[citeType] = {}
citeParams[citeType] = {}
end
-- fill groupedProcessedProperties
for refProperty in pairs(statement.snaks) do
-- add the parameter to each matching type of citation
for _, citeType in ipairs(citeTypes) do
repeat -- just a simple wrapper to emulate "continue"
-- skip if there already have been errors
if citeErrors[citeType] then
break
end
-- set mappingKey and prefix
local mappingKey
local prefix = ""
if statement.snaks[refProperty][1].datatype == 'external-id' then
mappingKey = "external-id"
prefix = self.conf:getLabel(refProperty)
if prefix ~= "" then
prefix = prefix .. " "
end
else
mappingKey = refProperty
end
local paramName = citeParamMapping[citeType][mappingKey]
-- skip properties with empty parameter name
if paramName == "" then
break
end
referenceEmpty = false
-- handle unknown properties in the reference
if not paramName then
local error_message = errorText("unknown-property-in-ref", refProperty)
assert(error_message) -- Should not be nil
citeErrors[citeType] = error_message
break
end
-- set processedProperty
local processedProperty
local raw = false -- if the value is wanted raw
if isValueInTable(paramName, citeConfig[citeType]["raw-value-params"] or {}) then
raw = true
end
if isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then
-- Multiple values may be given.
processedProperty = self:getReferenceDetails(statement.snaks, refProperty, raw, self.linked, true) -- anyLang = true
else
-- If multiple values are given, all but the first suitable one are discarted.
processedProperty = {self:getReferenceDetail(statement.snaks, refProperty, raw, self.linked and (statement.snaks[refProperty][1].datatype ~= 'url'), true)} -- link = true/false, anyLang = true
end
if #processedProperty == 0 then
break
end
-- add an entry to groupedProcessedProperties
if not groupedProcessedProperties[citeType][paramName] then
groupedProcessedProperties[citeType][paramName] = {}
end
for _, propertyValue in pairs(processedProperty) do
table.insert(groupedProcessedProperties[citeType][paramName], prefix .. propertyValue)
end
until true
end
end
-- handle additional properties
for refProperty in pairs(additionalProcessedProperties) do
for _, citeType in ipairs(citeTypes) do
repeat
-- skip if there already have been errors
if citeErrors[citeType] then
break
end
local paramName = citeParamMapping[citeType][refProperty]
-- handle unknown properties in the reference
if not paramName then
-- Skip this additional property, but do not cause an error.
break
end
if paramName == "" then
break
end
referenceEmpty = false
if not groupedProcessedProperties[citeType][paramName] then
groupedProcessedProperties[citeType][paramName] = {}
end
for _, propertyValue in pairs(additionalProcessedProperties[refProperty]) do
table.insert(groupedProcessedProperties[citeType][paramName], propertyValue)
end
until true
end
end
-- fill citeParams
for _, citeType in ipairs(citeTypes) do
for paramName, paramValues in pairs(groupedProcessedProperties[citeType]) do
if #paramValues == 1 or not isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then
citeParams[citeType][paramName] = paramValues[1]
else
-- There is more than one value for this parameter - the values will
-- go into separate numbered parameters (e.g. "author1", "author2")
for paramNum, paramValue in pairs(paramValues) do
citeParams[citeType][paramName .. paramNum] = paramValue
end
end
end
end
-- handle missing mandatory parameters for the templates
for _, citeType in ipairs(citeTypes) do
for _, requiredCiteParam in pairs(citeConfig[citeType]["mandatory-params"] or {}) do
if not citeParams[citeType][requiredCiteParam] then -- The required param is not present.
if citeErrors[citeType] then -- Do not override the previous error, if it exists.
break
end
local error_message = errorText("missing-mandatory-param", requiredCiteParam)
assert(error_message) -- Should not be nil
citeErrors[citeType] = error_message
end
end
end
local citeTypeToUse = nil
-- choose the output template
for _, citeType in ipairs(citeTypes) do
if not citeErrors[citeType] then
citeTypeToUse = citeType
break
end
end
-- set refContent
local refContent = ""
if citeTypeToUse then
local templateToUse = citeConfig[citeTypeToUse]["template"]
local paramsToUse = citeParams[citeTypeToUse]
if not templateToUse or templateToUse == "" then
throwError("no-such-reference-template", tostring(templateToUse), i18nPath, citeTypeToUse)
end
-- 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(paramsToUse) do
refContent = refContent .. "|" .. i .. "=" .. v
end
refContent = "{{" .. templateToUse .. refContent .. "}}"
else
xpcall(
function () refContent = mw.getCurrentFrame():expandTemplate{title=templateToUse, args=paramsToUse} end,
function () throwError("no-such-reference-template", templateToUse, i18nPath, citeTypeToUse) end
)
end
-- If the citation couldn't be displayed using any template, but is not empty (barring ignored propeties), throw an error.
elseif not referenceEmpty then
refContent = errorText("malformed-reference-header")
for _, citeType in ipairs(citeTypes) do
refContent = refContent .. errorText("template-failure-reason", citeConfig[citeType]["template"], citeErrors[citeType])
end
refContent = refContent .. errorText("malformed-reference-footer")
end
-- wrap refContent
local ref = {}
if refContent ~= "" then
ref = {refContent}
if not self.rawValue then
-- this should become a <ref> tag, so save the reference's hash for later
ref.refHash = "wikidata-" .. statement.hash .. "-v" .. (tonumber(i18n['version']) + version)
end
return {ref}
else
return {}
end
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, globalSiteId)
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, globalSiteId) 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], false, args[p.args.globalSiteId])
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, args[p.args.globalSiteId])
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
klnosw6qk6m6vbnazowivije405gt0c
Trachemys callirostris
0
9886661
37019542
35194173
2026-05-01T14:32:30Z
~2026-26573-81
142622
/* */
37019542
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|pawikag-iwon|date=2020-11}}
{{Taxobox
| name = ''Trachemys callirostris''
| status =
| image =Trachemys callirostris chichiriviche en Zoológico de Paraguaná.jpg
| image_caption = ''Trachemys callirostris chichiriviche''
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Muraghalas (mananap)|Reptilia]]
| ordo = [[Pawikag-iwon (muraghalas)|Testudines]]
| familia = [[Emydidae]]
| genus = [[Trachemys]]
| species = '''Trachemys callirostris'''
| binomial = Trachemys callirostris
| binomial_authority = ([[Gray (awtor)|Gray]], 1855)
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| synonyms = ''Trachemys callirostris callirostris'' <small>Martinez Silvestre & Arias Bernal, 2005</small><br>''Trachemys scripta callirostris'' <small>Martinez Silvestre & Arias Bernal, 2004</small><br>''Trachemys dorbigni callirostris'' <small>[[John B. Iverson|Iverson]], 1992</small><br>''Trachemys scripta callirostris'' <small>Legler, 1990</small><br>''Trachemys ornata callirostris'' <small>[[Heinz Wermuth|Wermuth]] & [[Mertens (awtor)|Mertens]], 1977</small><br>''Trachemys ornata callirostris'' <small>[[George Albert Boulenger|Boulenger]], 1889</small><br>''Trachemys callorostris'' <small>[[Gray (awtor)|Gray]], 1855</small> }}
Kaliwatan sa [[pawikag-iwon]] ang '''''Trachemys callirostris'''''<ref name = "COL"/>. Una ning gihulagway ni [[Gray (awtor)|Gray]] ni adtong 1855.<ref name = "col28901608"/> Ang ''Trachemys callirostris'' sakop sa [[kahenera]] nga ''[[Trachemys]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Emydidae]].<ref name = "COL"/><ref name = "source"/>
Kini nga matang hayop na sabwag sa:
* [[Venezuela]]
* [[Maranhão (estado)]]
* [[Colombia]]
* [[Uruguay]]
== Matang nga nahiubos ==
Ang kaliwatan gibahinbahin ngadto sa matang nga nahiubos:<ref name = "COL"/>
* ''T. c. callirostris''
* ''T. c. chichiriviche''
<!-- katapusan sa gisulat -->
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 28901608|accessdate= 2019-11-11}}</ref>
<ref name = "col28901608">RIVAS, GILSON A.; CE´SAR R. MOLINA, GABRIEL N. UGUETO, TITO R. BARROS, CE´SAR L. BAR- RIO-AMORO´S & PHILIPPE J. R. KOK (2012) ''Reptiles of Venezuela: an updated and commented checklist.'' , Zootaxa 3211: 1–64</ref>
<ref name = "source">Uetz P. & Hošek J. (2019). The Reptile Database (version Dec 2015). In: Species 2000 & ITIS Catalogue of Life, 2019 Annual Checklist (Roskov Y., Ower G., Orrell T., Nicolson D., Bailly N., Kirk P.M., Bourgoin T., DeWalt R.E., Decock W., Nieukerken E. van, Zarucchi J., Penev L., eds.). Digital resource at www.catalogueoflife.org/annual-checklist/2019. Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X.</ref>
</references>
[[Kategoriya:Pawikag-iwon]]
[[Kategoriya:Pawikag-iwon sa Venezuela]]
[[Kategoriya:Pawikag-iwon sa Maranhão (estado)]]
[[Kategoriya:Trachemys]]
[[Kategoriya:Pawikag-iwon sa Kolombiya]]
[[Kategoriya:Pawikag-iwon sa Urugway]]
a0fyprvu1j5euxbqm8qwrg64bgbenvu
Plantilya:Collapse top
10
10741647
37019547
32887018
2026-05-01T14:36:22Z
Exec8
10305
37019547
wikitext
text/x-wiki
{{ safesubst:<noinclude/>ifsubst||<templatestyles src="Template:Collapse_top/styles.css"/>}}
<div style="margin-left:{{{indent|0}}}"><!-- NOTE: width renders incorrectly if added to main STYLE section -->
{| role="presentation" <!-- Template:Collapse top --> class="mw-collapsible mw-archivedtalk {{<includeonly>safesubst:</includeonly>#if:{{{expand|{{{collapse|}}}}}}||mw-collapsed}} {{{class|}}}" style="color:inherit; 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;"
|-
! class="{{main other|cot-header-mainspace|cot-header-other}}" style="{{<includeonly>safesubst:</includeonly>#if:{{{bg|}}}|background:{{{bg}}}|{{ safesubst:<noinclude/>ifsubst|{{main other|background:#F0F2F5|background:#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}}};|{{<includeonly>safesubst:</includeonly>#if:{{{bg|}}}|color:#202122|{{ safesubst:<noinclude/>ifsubst|color:black;|}}}}}}" | <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="color:inherit; border: solid {{{border2|1px Silver}}}; padding: {{{padding|0.6em}}}; background: {{{bg2|var(--background-color-base, #fff)}}};" {{<includeonly>safesubst:</includeonly>!}}<noinclude>
{{lorem ipsum|3}}
{{Collapse bottom}}
{{Documentation}}
</noinclude>
81u93un6q58tt6om5l86tbem971xsxy
Module:Citation/CS1
828
11073428
37019530
35048463
2026-05-01T14:25:47Z
Exec8
10305
.
37019530
Scribunto
text/plain
require ('strict');
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
each of these counts against the Lua upvalue limit
]]
local validation; -- functions in Module:Citation/CS1/Date_validation
local utilities; -- functions in Module:Citation/CS1/Utilities
local z = {}; -- table of tables in Module:Citation/CS1/Utilities
local identifiers; -- functions and tables in Module:Citation/CS1/Identifiers
local metadata; -- functions in Module:Citation/CS1/COinS
local cfg = {}; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
local whitelist = {}; -- table of tables listing valid template parameter names; defined in Module:Citation/CS1/Whitelist
--[[------------------< P A G E S C O P E V A R I A B L E S >---------------
declare variables here that have page-wide scope that are not brought in from
other modules; that are created here and used here
]]
local added_deprecated_cat; -- boolean flag so that the category is added only once
local added_vanc_errs; -- boolean flag so we only emit one Vancouver error / category
local added_generic_name_errs; -- boolean flag so we only emit one generic name error / category and stop testing names once an error is encountered
local added_numeric_name_errs; -- boolean flag so we only emit one numeric name error / category and stop testing names once an error is encountered
local added_numeric_name_maint; -- boolean flag so we only emit one numeric name maint category and stop testing names once a category has been emitted
local is_preview_mode; -- true when article is in preview mode; false when using 'Preview page with this template' (previewing the module)
local is_sandbox; -- true when using sandbox modules to render citation
local url_was_archive_today; -- boolean flag set to true when has_archive_today_url() has unset |url= because it held a deprecated archive.today url
--[[--------------------------< F I R S T _ S E T >------------------------------------------------------------
Locates and returns the first set value in a table of values where the order established in the table,
left-to-right (or top-to-bottom), is the order in which the values are evaluated. Returns nil if none are set.
This version replaces the original 'for _, val in pairs do' and a similar version that used ipairs. With the pairs
version the order of evaluation could not be guaranteed. With the ipairs version, a nil value would terminate
the for-loop before it reached the actual end of the list.
]]
local function first_set (list, count)
local i = 1;
while i <= count do -- loop through all items in list
if utilities.is_set( list[i] ) then
return list[i]; -- return the first set list member
end
i = i + 1; -- point to next
end
end
--[[--------------------------< A D D _ V A N C _ E R R O R >----------------------------------------------------
Adds a single Vancouver system error message to the template's output regardless of how many error actually exist.
To prevent duplication, added_vanc_errs is nil until an error message is emitted.
added_vanc_errs is a Boolean declared in page scope variables above
]]
local function add_vanc_error (source, position)
if added_vanc_errs then return end
added_vanc_errs = true; -- note that we've added this category
utilities.set_message ('err_vancouver', {source, position});
end
--[[--------------------------< I S _ S C H E M E >------------------------------------------------------------
does this thing that purports to be a URI scheme seem to be a valid scheme? The scheme is checked to see if it
is in agreement with http://tools.ietf.org/html/std66#section-3.1 which says:
Scheme names consist of a sequence of characters beginning with a
letter and followed by any combination of letters, digits, plus
("+"), period ("."), or hyphen ("-").
returns true if it does, else false
]]
local function is_scheme (scheme)
return scheme and scheme:match ('^%a[%a%d%+%.%-]*:'); -- true if scheme is set and matches the pattern
end
--[=[-------------------------< I S _ D O M A I N _ N A M E >--------------------------------------------------
Does this thing that purports to be a domain name seem to be a valid domain name?
Syntax defined here: http://tools.ietf.org/html/rfc1034#section-3.5
BNF defined here: https://tools.ietf.org/html/rfc4234
Single character names are generally reserved; see https://tools.ietf.org/html/draft-ietf-dnsind-iana-dns-01#page-15;
see also [[Single-letter second-level domain]]
list of TLDs: https://www.iana.org/domains/root/db
RFC 952 (modified by RFC 1123) requires the first and last character of a hostname to be a letter or a digit. Between
the first and last characters the name may use letters, digits, and the hyphen.
Also allowed are IPv4 addresses. IPv6 not supported
domain is expected to be stripped of any path so that the last character in the last character of the TLD. tld
is two or more alpha characters. Any preceding '//' (from splitting a URL with a scheme) will be stripped
here. Perhaps not necessary but retained in case it is necessary for IPv4 dot decimal.
There are several tests:
the first character of the whole domain name including subdomains must be a letter or a digit
internationalized domain name (ASCII characters with .xn-- ASCII Compatible Encoding (ACE) prefix xn-- in the TLD) see https://tools.ietf.org/html/rfc3490
single-letter/digit second-level domains in the .org, .cash, and .today TLDs
q, x, and z SL domains in the .com TLD
i and q SL domains in the .net TLD
single-letter SL domains in the ccTLDs (where the ccTLD is two letters)
two-character SL domains in gTLDs (where the gTLD is two or more letters)
three-plus-character SL domains in gTLDs (where the gTLD is two or more letters)
IPv4 dot-decimal address format; TLD not allowed
returns true if domain appears to be a proper name and TLD or IPv4 address, else false
]=]
local function is_domain_name (domain)
if not domain then
return false; -- if not set, abandon
end
domain = domain:gsub ('^//', ''); -- strip '//' from domain name if present; done here so we only have to do it once
if not domain:match ('^[%w]') then -- first character must be letter or digit
return false;
end
if domain:match ('^%a+:') then -- hack to detect things that look like s:Page:Title where Page: is namespace at Wikisource
return false;
end
local patterns = { -- patterns that look like URLs
'%f[%w][%w][%w%-]+[%w]%.%a%a+$', -- three or more character hostname.hostname or hostname.tld
'%f[%w][%w][%w%-]+[%w]%.xn%-%-[%w]+$', -- internationalized domain name with ACE prefix
'%f[%a][qxz]%.com$', -- assigned one character .com hostname (x.com times out 2015-12-10)
'%f[%a][iq]%.net$', -- assigned one character .net hostname (q.net registered but not active 2015-12-10)
'%f[%w][%w]%.%a%a$', -- one character hostname and ccTLD (2 chars)
'%f[%w][%w][%w]%.%a%a+$', -- two character hostname and TLD
'^%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?', -- IPv4 address
'[%a%d]+%:?' -- IPv6 address
}
for _, pattern in ipairs (patterns) do -- loop through the patterns list
if domain:match (pattern) then
return true; -- if a match then we think that this thing that purports to be a URL is a URL
end
end
for _, d in ipairs (cfg.single_letter_2nd_lvl_domains_t) do -- look for single letter second level domain names for these top level domains
if domain:match ('%f[%w][%w]%.' .. d) then
return true
end
end
return false; -- no matches, we don't know what this thing is
end
--[[--------------------------< I S _ U R L >------------------------------------------------------------------
returns true if the scheme and domain parts of a URL appear to be a valid URL; else false.
This function is the last step in the validation process. This function is separate because there are cases that
are not covered by split_url(), for example is_parameter_ext_wikilink() which is looking for bracketted external
wikilinks.
]]
local function is_url (scheme, domain)
if utilities.is_set (scheme) then -- if scheme is set check it and domain
return is_scheme (scheme) and is_domain_name (domain);
else
return is_domain_name (domain); -- scheme not set when URL is protocol-relative
end
end
--[[--------------------------< S P L I T _ U R L >------------------------------------------------------------
Split a URL into a scheme, authority indicator, and domain.
First remove Fully Qualified Domain Name terminator (a dot following TLD) (if any) and any path(/), query(?) or fragment(#).
If protocol-relative URL, return nil scheme and domain else return nil for both scheme and domain.
When not protocol-relative, get scheme, authority indicator, and domain. If there is an authority indicator (one
or more '/' characters immediately following the scheme's colon), make sure that there are only 2.
Any URL that does not have news: scheme must have authority indicator (//). TODO: are there other common schemes
like news: that don't use authority indicator?
Strip off any port and path;
]]
local function split_url (url_str)
local scheme, authority, domain;
url_str = url_str:gsub ('([%a%d])%.?[/%?#].*$', '%1'); -- strip FQDN terminator and path(/), query(?), fragment (#) (the capture prevents false replacement of '//')
if url_str:match ('^//%S*') then -- if there is what appears to be a protocol-relative URL
domain = url_str:match ('^//(%S*)')
elseif url_str:match ('%S-:/*%S+') then -- if there is what appears to be a scheme, optional authority indicator, and domain name
scheme, authority, domain = url_str:match ('(%S-:)(/*)(%S+)'); -- extract the scheme, authority indicator, and domain portions
if utilities.is_set (authority) then
authority = authority:gsub ('//', '', 1); -- replace place 1 pair of '/' with nothing;
if utilities.is_set(authority) then -- if anything left (1 or 3+ '/' where authority should be) then
return scheme; -- return scheme only making domain nil which will cause an error message
end
else
if not scheme:match ('^news:') then -- except for news:..., MediaWiki won't link URLs that do not have authority indicator; TODO: a better way to do this test?
return scheme; -- return scheme only making domain nil which will cause an error message
end
end
domain = domain:gsub ('(%a):%d+', '%1'); -- strip port number if present
end
return scheme, domain;
end
--[[--------------------------< L I N K _ P A R A M _ O K >---------------------------------------------------
checks the content of |title-link=, |series-link=, |author-link=, etc. for properly formatted content: no wikilinks, no URLs
Link parameters are to hold the title of a Wikipedia article, so none of the WP:TITLESPECIALCHARACTERS are allowed:
# < > [ ] | { } _
except the underscore which is used as a space in wiki URLs and # which is used for section links
returns false when the value contains any of these characters.
When there are no illegal characters, this function returns TRUE if value DOES NOT appear to be a valid URL (the
|<param>-link= parameter is ok); else false when value appears to be a valid URL (the |<param>-link= parameter is NOT ok).
]]
local function link_param_ok (value)
local scheme, domain;
if value:find ('[<>%[%]|{}]') then -- if any prohibited characters
return false;
end
scheme, domain = split_url (value); -- get scheme or nil and domain or nil from URL;
return not is_url (scheme, domain); -- return true if value DOES NOT appear to be a valid URL
end
--[[--------------------------< L I N K _ T I T L E _ O K >---------------------------------------------------
Use link_param_ok() to validate |<param>-link= value and its matching |<title>= value.
|<title>= may be wiki-linked but not when |<param>-link= has a value. This function emits an error message when
that condition exists
check <link> for inter-language interwiki-link prefix. prefix must be a MediaWiki-recognized language
code and must begin with a colon.
]]
local function link_title_ok (link, lorig, title, torig)
local orig;
if utilities.is_set (link) then -- don't bother if <param>-link doesn't have a value
if not link_param_ok (link) then -- check |<param>-link= markup
orig = lorig; -- identify the failing link parameter
elseif title:find ('%[%[') then -- check |title= for wikilink markup
orig = torig; -- identify the failing |title= parameter
elseif link:match ('^%a+:') then -- if the link is what looks like an interwiki
local prefix = link:match ('^(%a+):'):lower(); -- get the interwiki prefix
if cfg.inter_wiki_map[prefix] then -- if prefix is in the map, must have preceding colon
orig = lorig; -- flag as error
end
end
end
if utilities.is_set (orig) then
link = ''; -- unset
utilities.set_message ('err_bad_paramlink', orig); -- URL or wikilink in |title= with |title-link=;
end
return link; -- link if ok, empty string else
end
--[[--------------------------< C H E C K _ U R L >------------------------------------------------------------
Determines whether a URL string appears to be valid.
First we test for space characters. If any are found, return false. Then split the URL into scheme and domain
portions, or for protocol-relative (//example.com) URLs, just the domain. Use is_url() to validate the two
portions of the URL. If both are valid, or for protocol-relative if domain is valid, return true, else false.
Because it is different from a standard URL, and because this module used external_link() to make external links
that work for standard and news: links, we validate newsgroup names here. The specification for a newsgroup name
is at https://tools.ietf.org/html/rfc5536#section-3.1.4
]]
local function check_url( url_str )
if nil == url_str:match ("^%S+$") then -- if there are any spaces in |url=value it can't be a proper URL
return false;
end
local scheme, domain;
scheme, domain = split_url (url_str); -- get scheme or nil and domain or nil from URL;
if 'news:' == scheme then -- special case for newsgroups
return domain:match('^[%a%d%+%-_]+%.[%a%d%+%-_%.]*[%a%d%+%-_]$');
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[=[-------------------------< I S _ P A R A M E T E R _ E X T _ W I K I L I N K >----------------------------
Return true if a parameter value has a string that begins and ends with square brackets [ and ] and the first
non-space characters following the opening bracket appear to be a URL. The test will also find external wikilinks
that use protocol-relative URLs. Also finds bare URLs.
The frontier pattern prevents a match on interwiki-links which are similar to scheme:path URLs. The tests that
find bracketed URLs are required because the parameters that call this test (currently |title=, |chapter=, |work=,
and |publisher=) may have wikilinks and there are articles or redirects like '//Hus' so, while uncommon, |title=[[//Hus]]
is possible as might be [[en://Hus]].
]=]
local function is_parameter_ext_wikilink (value)
local scheme, domain;
if value:match ('%f[%[]%[%a%S*:%S+.*%]') then -- if ext. wikilink with scheme and domain: [xxxx://yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(%a%S*:%S+).*%]'));
elseif value:match ('%f[%[]%[//%S+.*%]') then -- if protocol-relative ext. wikilink: [//yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(//%S+).*%]'));
elseif value:match ('%a%S*:%S+') then -- if bare URL with scheme; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(%a%S*:%S+)'));
elseif value:match ('^//%S+') or value:match ('%s//%S+') then -- if protocol-relative bare URL: //yyyyy.zzz; authority indicator (//) must be be preceded nothing or by whitespace
scheme, domain = split_url (value:match ('(//%S+)')); -- what is left should be the domain
else
return false; -- didn't find anything that is obviously a URL
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[[--------------------------< I S _ A R C H I V E _ T O D A Y _ U R L >--------------------------------------
archive.today (and .ph, .is, .md, .li, .fo, .vn) are deprecated. See Wikipedia:Requests_for_comment/Archive.is_RFC_5
(Special:Permalink/1339352976)
<val> is a string that may or may not be a url
]]
local function is_archive_today_url (val)
if is_parameter_ext_wikilink (val) then -- is <val> a url?
local tld = val:match ('archive%.(%l+)'); -- get the tld
return tld and cfg.archive_today_tlds_t[tld]; -- return true if <tld> is one of the archive.today tlds; nil else
end
end
--[[--------------------------< H A S _ A R C H I V E _ T O D A Y _ U R L >------------------------------------
blank any parameter that holds one of the archive.today tlds (.today, .ph, .is, .md, .li, .fo, .vn) and also
blank parameters that are dependent on the offending parameter.
input <cite_args_t> is a table of all of this template's parameters This function modifies <cite_args_t>
when |url= or its alias |URL= hold an archive.today url, this function sets the flag <url_was_archive_today>
which is used later to suppress the missing url error message from {{citation}} when it has |website=<summat>
or from the templates {{cite web}}, {{cite podcast}}, {{cite mailing list}} which all require a url.
returns nothing
]]
local function has_archive_today_url (cite_args_t)
local unset_params_t = {}; -- to hold a sequence of parameters to unset from cite_args_t
for p, v in pairs (cite_args_t) do -- look at each parameter in the template
if is_archive_today_url (v:lower()) then -- if it has a parameter with an archive.today url
table.insert (unset_params_t, p); -- add the url-holding parameter name to our list of parameters to unset (may or may not be a legitimate url parameter)
if 'url' == p:lower() then -- if this parameter is |url= or |URL=
url_was_archive_today = true; -- set a flag so that cite web / podcast / mailinglist don't emit a missing url error message
end
if cfg.dependencies_t[p] then -- if this url-holding parameter (<p>) has dependencies
for _, dependent in ipairs (cfg.dependencies_t[p]) do -- loop through the url-holding parameter's dependency sequence
table.insert (unset_params_t, dependent); -- add dependent parameter to the list to be unset
end
end
end
end
if 0 < #unset_params_t then -- when there are parameters to unset
if not is_preview_mode then -- when in preview mode do not suppress any parameters
for _, unset_param in ipairs (unset_params_t) do -- loop through the sequence
cite_args_t[unset_param] = nil; -- and unset the url-holding parameter and its dependent parameters to avoid parameter-requires-other-parameter errors
end
end
utilities.set_message ('maint_deprecated_archive'); -- add a maintenance message
end
end
--[[-------------------------< C H E C K _ F O R _ U R L >-----------------------------------------------------
loop through a list of parameters and their values. Look at the value and if it has an external link, emit an error message.
]]
local function check_for_url (parameter_list, error_list)
for k, v in pairs (parameter_list) do -- for each parameter in the list
if is_parameter_ext_wikilink (v) then -- look at the value; if there is a URL add an error message
table.insert (error_list, utilities.wrap_style ('parameter', k));
end
end
end
--[[--------------------------< S A F E _ F O R _ U R L >------------------------------------------------------
Escape sequences for content that will be used for URL descriptions
]]
local function safe_for_url( str )
if str:match( "%[%[.-%]%]" ) ~= nil then
utilities.set_message ('err_wikilink_in_url', {});
end
return str:gsub( '[%[%]\n]', {
['['] = '[',
[']'] = ']',
['\n'] = ' ' } );
end
--[[--------------------------< E X T E R N A L _ L I N K >----------------------------------------------------
Format an external link with error checking
]]
local function external_link (URL, label, source, access)
local err_msg = '';
local domain;
local path;
local base_url;
if not utilities.is_set (label) then
label = URL;
if utilities.is_set (source) then
utilities.set_message ('err_bare_url_missing_title', {utilities.wrap_style ('parameter', source)});
else
error (cfg.messages["bare_url_no_origin"]); -- programmer error; valid parameter name does not have matching meta-parameter
end
end
if not check_url (URL) then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)});
end
domain, path = URL:match ('^([/%.%-%+:%a%d]+)([/%?#].*)$'); -- split the URL into scheme plus domain and path
if path then -- if there is a path portion
path = path:gsub ('[%[%]]', {['['] = '%5b', [']'] = '%5d'}); -- replace '[' and ']' with their percent-encoded values
URL = table.concat ({domain, path}); -- and reassemble
end
base_url = table.concat ({ "[", URL, " ", safe_for_url (label), "]" }); -- assemble a wiki-markup URL
if utilities.is_set (access) then -- access level (subscription, registration, limited)
base_url = utilities.substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[access].class, cfg.presentation[access].title, base_url}); -- add the appropriate icon
end
return base_url;
end
--[[--------------------------< D E P R E C A T E D _ P A R A M E T E R >--------------------------------------
Categorize and emit an error message when the citation contains one or more deprecated parameters. The function includes the
offending parameter name to the error message. Only one error message is emitted regardless of the number of deprecated
parameters in the citation.
added_deprecated_cat is a Boolean declared in page scope variables above
]]
local function deprecated_parameter(name)
if not added_deprecated_cat then
added_deprecated_cat = true; -- note that we've added this category
utilities.set_message ('err_deprecated_params', {name}); -- add error message
end
end
--[=[-------------------------< K E R N _ Q U O T E S >--------------------------------------------------------
Apply kerning to open the space between the quote mark provided by the module and a leading or trailing quote
mark contained in a |title= or |chapter= parameter's value.
This function will positive kern either single or double quotes:
"'Unkerned title with leading and trailing single quote marks'"
" 'Kerned title with leading and trailing single quote marks' " (in real life the kerning isn't as wide as this example)
Double single quotes (italic or bold wiki-markup) are not kerned.
Replaces Unicode quote marks in plain text or in the label portion of a [[L|D]] style wikilink with typewriter
quote marks regardless of the need for kerning. Unicode quote marks are not replaced in simple [[D]] wikilinks.
Call this function for chapter titles, for website titles, etc.; not for book titles.
]=]
local function kern_quotes (str)
local cap = '';
local wl_type, label, link;
wl_type, label, link = utilities.is_wikilink (str); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
if 1 == wl_type then -- [[D]] simple wikilink with or without quote marks
if mw.ustring.match (str, '%[%[[\"“”\'‘’].+[\"“”\'‘’]%]%]') then -- leading and trailing quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
str = utilities.substitute (cfg.presentation['kern-right'], str);
elseif mw.ustring.match (str, '%[%[[\"“”\'‘’].+%]%]') then -- leading quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
elseif mw.ustring.match (str, '%[%[.+[\"“”\'‘’]%]%]') then -- trailing quote marks
str = utilities.substitute (cfg.presentation['kern-right'], str);
end
else -- plain text or [[L|D]]; text in label variable
label = mw.ustring.gsub (label, '[“”]', '\"'); -- replace “” (U+201C & U+201D) with " (typewriter double quote mark)
label = mw.ustring.gsub (label, '[‘’]', '\''); -- replace ‘’ (U+2018 & U+2019) with ' (typewriter single quote mark)
cap = mw.ustring.match (label, "^([\"\'][^\'].+)"); -- match leading double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-left'], cap);
end
cap = mw.ustring.match (label, "^(.+[^\'][\"\'])$") -- match trailing double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-right'], cap);
end
if 2 == wl_type then
str = utilities.make_wikilink (link, label); -- reassemble the wikilink
else
str = label;
end
end
return str;
end
--[[--------------------------< F O R M A T _ S C R I P T _ V A L U E >----------------------------------------
|script-title= holds title parameters that are not written in Latin-based scripts: Chinese, Japanese, Arabic, Hebrew, etc. These scripts should
not be italicized and may be written right-to-left. The value supplied by |script-title= is concatenated onto Title after Title has been wrapped
in italic markup.
Regardless of language, all values provided by |script-title= are wrapped in <bdi>...</bdi> tags to isolate RTL languages from the English left to right.
|script-title= provides a unique feature. The value in |script-title= may be prefixed with a two-character ISO 639-1 language code and a colon:
|script-title=ja:*** *** (where * represents a Japanese character)
Spaces between the two-character code and the colon and the colon and the first script character are allowed:
|script-title=ja : *** ***
|script-title=ja: *** ***
|script-title=ja :*** ***
Spaces preceding the prefix are allowed: |script-title = ja:*** ***
The prefix is checked for validity. If it is a valid ISO 639-1 language code, the lang attribute (lang="ja") is added to the <bdi> tag so that browsers can
know the language the tag contains. This may help the browser render the script more correctly. If the prefix is invalid, the lang attribute
is not added. At this time there is no error message for this condition.
Supports |script-title=, |script-chapter=, |script-<periodical>=
]]
local function format_script_value (script_value, script_param)
local lang=''; -- initialize to empty string
local name;
if script_value:match('^%l%l%l?%s*:') then -- if first 3 or 4 non-space characters are script language prefix
lang = script_value:match('^(%l%l%l?)%s*:%s*%S.*'); -- get the language prefix or nil if there is no script
if not utilities.is_set (lang) then
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing title part']}); -- prefix without 'title'; add error message
return ''; -- script_value was just the prefix so return empty string
end
-- if we get this far we have prefix and script
name = cfg.lang_tag_remap[lang] or mw.language.fetchLanguageName( lang, cfg.this_wiki_code ); -- get language name so that we can use it to categorize
if utilities.is_set (name) then -- is prefix a proper ISO 639-1 language code?
script_value = script_value:gsub ('^%l+%s*:%s*', ''); -- strip prefix from script
-- is prefix one of these language codes?
if utilities.in_array (lang, cfg.script_lang_codes) then
utilities.add_prop_cat ('script', {name, lang})
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['unknown language code']}); -- unknown script-language; add error message
end
lang = ' lang="' .. lang .. '" '; -- convert prefix into a lang attribute
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['invalid language code']}); -- invalid language code; add error message
lang = ''; -- invalid so set lang to empty string
end
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing prefix']}); -- no language code prefix; add error message
end
script_value = utilities.substitute (cfg.presentation['bdi'], {lang, script_value}); -- isolate in case script is RTL
return script_value;
end
--[[--------------------------< S C R I P T _ C O N C A T E N A T E >------------------------------------------
Initially for |title= and |script-title=, this function concatenates those two parameter values after the script
value has been wrapped in <bdi> tags.
]]
local function script_concatenate (title, script, script_param)
if utilities.is_set (script) then
script = format_script_value (script, script_param); -- <bdi> tags, lang attribute, categorization, etc.; returns empty string on error
if utilities.is_set (script) then
title = title .. ' ' .. script; -- concatenate title and script title
end
end
return title;
end
--[[--------------------------< W R A P _ M S G >--------------------------------------------------------------
Applies additional message text to various parameter values. Supplied string is wrapped using a message_list
configuration taking one argument. Supports lower case text for {{citation}} templates. Additional text taken
from citation_config.messages - the reason this function is similar to but separate from wrap_style().
]]
local function wrap_msg (key, str, lower)
if not utilities.is_set ( str ) then
return "";
end
if true == lower then
local msg;
msg = cfg.messages[key]:lower(); -- set the message to lower case before
return utilities.substitute ( msg, str ); -- including template text
else
return utilities.substitute ( cfg.messages[key], str );
end
end
--[[----------------< W I K I S O U R C E _ U R L _ M A K E >-------------------
Makes a Wikisource URL from Wikisource interwiki-link. Returns the URL and appropriate
label; nil else.
str is the value assigned to |chapter= (or aliases) or |title= or |title-link=
]]
local function wikisource_url_make (str)
local wl_type, D, L;
local ws_url, ws_label;
local wikisource_prefix = table.concat ({'https://', cfg.this_wiki_code, '.wikisource.org/wiki/'});
wl_type, D, L = utilities.is_wikilink (str); -- wl_type is 0 (not a wikilink), 1 (simple wikilink), 2 (complex wikilink)
if 0 == wl_type then -- not a wikilink; might be from |title-link=
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 1 == wl_type then -- simple wikilink: [[Wikisource:ws article]]
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 2 == wl_type then -- non-so-simple wikilink: [[Wikisource:ws article|displayed text]] ([[L|D]])
str = L:match ('^[Ww]ikisource:(.+)') or L:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_label = D; -- get ws article name from display portion of interwiki link
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title without namespace from link portion of wikilink
});
end
end
if ws_url then
ws_url = mw.uri.encode (ws_url, 'WIKI'); -- make a usable URL
ws_url = ws_url:gsub ('%%23', '#'); -- undo percent-encoding of fragment marker
end
return ws_url, ws_label, L or D; -- return proper URL or nil and a label or nil
end
--[[----------------< F O R M A T _ P E R I O D I C A L >-----------------------
Format the three periodical parameters: |script-<periodical>=, |<periodical>=,
and |trans-<periodical>= into a single Periodical meta-parameter.
]]
local function format_periodical (script_periodical, script_periodical_source, periodical, trans_periodical)
if not utilities.is_set (periodical) then
periodical = ''; -- to be safe for concatenation
else
periodical = utilities.wrap_style ('italic-title', periodical); -- style
end
periodical = script_concatenate (periodical, script_periodical, script_periodical_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (trans_periodical) then
trans_periodical = utilities.wrap_style ('trans-italic-title', trans_periodical);
if utilities.is_set (periodical) then
periodical = periodical .. ' ' .. trans_periodical;
else -- here when trans-periodical without periodical or script-periodical
periodical = trans_periodical;
utilities.set_message ('err_trans_missing_title', {'periodical'});
end
end
return periodical;
end
--[[------------------< F O R M A T _ C H A P T E R _ T I T L E >---------------
Format the four chapter parameters: |script-chapter=, |chapter=, |trans-chapter=,
and |chapter-url= into a single chapter meta- parameter (chapter_url_source used
for error messages).
]]
local function format_chapter_title (script_chapter, script_chapter_source, chapter, chapter_source, trans_chapter, trans_chapter_source, chapter_url, chapter_url_source, no_quotes, access)
local ws_url, ws_label, L = wikisource_url_make (chapter); -- make a wikisource URL and label from a wikisource interwiki link
if ws_url then
ws_label = ws_label:gsub ('_', ' '); -- replace underscore separators with space characters
chapter = ws_label;
end
if not utilities.is_set (chapter) then
chapter = ''; -- to be safe for concatenation
else
if false == no_quotes then
chapter = kern_quotes (chapter); -- if necessary, separate chapter title's leading and trailing quote marks from module provided quote marks
chapter = utilities.wrap_style ('quoted-title', chapter);
end
end
chapter = script_concatenate (chapter, script_chapter, script_chapter_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (chapter_url) then
chapter = external_link (chapter_url, chapter, chapter_url_source, access); -- adds bare_url_missing_title error if appropriate
elseif ws_url then
chapter = external_link (ws_url, chapter .. ' ', 'ws link in chapter'); -- adds bare_url_missing_title error if appropriate; space char to move icon away from chap text; TODO: better way to do this?
chapter = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, chapter});
end
if utilities.is_set (trans_chapter) then
trans_chapter = utilities.wrap_style ('trans-quoted-title', trans_chapter);
if utilities.is_set (chapter) then
chapter = chapter .. ' ' .. trans_chapter;
else -- here when trans_chapter without chapter or script-chapter
chapter = trans_chapter;
chapter_source = trans_chapter_source:match ('trans%-?(.+)'); -- when no chapter, get matching name from trans-<param>
utilities.set_message ('err_trans_missing_title', {chapter_source});
end
end
return chapter;
end
--[[----------------< H A S _ I N V I S I B L E _ C H A R S >-------------------
This function searches a parameter's value for non-printable or invisible characters.
The search stops at the first match.
This function will detect the visible replacement character when it is part of the Wikisource.
Detects but ignores nowiki and math stripmarkers. Also detects other named stripmarkers
(gallery, math, pre, ref) and identifies them with a slightly different error message.
See also coins_cleanup().
Output of this function is an error message that identifies the character or the
Unicode group, or the stripmarker that was detected along with its position (or,
for multi-byte characters, the position of its first byte) in the parameter value.
]]
local function has_invisible_chars (param, v)
local position = ''; -- position of invisible char or starting position of stripmarker
local capture; -- used by stripmarker detection to hold name of the stripmarker
local stripmarker; -- boolean set true when a stripmarker is found
capture = string.match (v, '[%w%p ]*'); -- test for values that are simple ASCII text and bypass other tests if true
if capture == v then -- if same there are no Unicode characters
return;
end
for _, invisible_char in ipairs (cfg.invisible_chars) do
local char_name = invisible_char[1]; -- the character or group name
local pattern = invisible_char[2]; -- the pattern used to find it
position, _, capture = mw.ustring.find (v, pattern); -- see if the parameter value contains characters that match the pattern
if position and (cfg.invisible_defs.zwj == capture) then -- if we found a zero-width joiner character
if mw.ustring.find (v, cfg.indic_script) then -- it's ok if one of the Indic scripts
position = nil; -- unset position
elseif cfg.emoji_t[mw.ustring.codepoint (v, position+1)] then -- is zwj followed by a character listed in emoji{}?
position = nil; -- unset position
end
end
if position then
if 'nowiki' == capture or 'math' == capture or -- nowiki and math stripmarkers (not an error condition)
('templatestyles' == capture and utilities.in_array (param, {'id', 'quote'})) then -- templatestyles stripmarker allowed in these parameters
stripmarker = true; -- set a flag
elseif true == stripmarker and cfg.invisible_defs.del == capture then -- because stripmakers begin and end with the delete char, assume that we've found one end of a stripmarker
position = nil; -- unset
else
local err_msg;
if capture and not (cfg.invisible_defs.del == capture or cfg.invisible_defs.zwj == capture) then
err_msg = utilities.substitute (cfg.messages.invisible_1, {capture, char_name}); -- <capture> here is stripmarker name
else
err_msg = utilities.substitute (cfg.messages.invisible_2, char_name);
end
utilities.set_message ('err_invisible_char', {err_msg, utilities.wrap_style ('parameter', param), position}); -- add error message
return; -- and done with this parameter
end
end
end
end
--[[-------------------< A R G U M E N T _ W R A P P E R >----------------------
Argument wrapper. This function provides support for argument mapping defined
in the configuration file so that multiple names can be transparently aliased to
single internal variable.
]]
local function argument_wrapper ( args )
local origin = {};
return setmetatable({
ORIGIN = function ( self, k )
local dummy = self[k]; -- force the variable to be loaded.
return origin[k];
end
},
{
__index = function ( tbl, k )
if origin[k] ~= nil then
return nil;
end
local args, list, v = args, cfg.aliases[k];
if type( list ) == 'table' then
v, origin[k] = utilities.select_one ( args, list, 'err_redundant_parameters' );
if origin[k] == nil then
origin[k] = ''; -- Empty string, not nil
end
elseif list ~= nil then
v, origin[k] = args[list], list;
else
-- maybe let through instead of raising an error?
-- v, origin[k] = args[k], k;
error( cfg.messages['unknown_argument_map'] .. ': ' .. k);
end
-- Empty strings, not nil;
if v == nil then
v = '';
origin[k] = '';
end
tbl = rawset( tbl, k, v );
return v;
end,
});
end
--[[--------------------------< N O W R A P _ D A T E >-------------------------
When date is YYYY-MM-DD format wrap in nowrap span: <span ...>YYYY-MM-DD</span>.
When date is DD MMMM YYYY or is MMMM DD, YYYY then wrap in nowrap span:
<span ...>DD MMMM</span> YYYY or <span ...>MMMM DD,</span> YYYY
DOES NOT yet support MMMM YYYY or any of the date ranges.
]]
local function nowrap_date (date)
local cap = '';
local cap2 = '';
if date:match("^%d%d%d%d%-%d%d%-%d%d$") then
date = utilities.substitute (cfg.presentation['nowrap1'], date);
elseif date:match("^%a+%s*%d%d?,%s+%d%d%d%d$") or date:match ("^%d%d?%s*%a+%s+%d%d%d%d$") then
cap, cap2 = string.match (date, "^(.*)%s+(%d%d%d%d)$");
date = utilities.substitute (cfg.presentation['nowrap2'], {cap, cap2});
end
return date;
end
--[[--------------------------< S E T _ T I T L E T Y P E >---------------------
This function sets default title types (equivalent to the citation including
|type=<default value>) for those templates that have defaults. Also handles the
special case where it is desirable to omit the title type from the rendered citation
(|type=none).
]]
local function set_titletype (cite_class, title_type)
if utilities.is_set (title_type) then
if 'none' == cfg.keywords_xlate[title_type] then
title_type = ''; -- if |type=none then type parameter not displayed
end
return title_type; -- if |type= has been set to any other value use that value
end
return cfg.title_types [cite_class] or ''; -- set template's default title type; else empty string for concatenation
end
--[[--------------------------< S A F E _ J O I N >-----------------------------
Joins a sequence of strings together while checking for duplicate separation characters.
]]
local function safe_join( tbl, duplicate_char )
local f = {}; -- create a function table appropriate to type of 'duplicate character'
if 1 == #duplicate_char then -- for single byte ASCII characters use the string library functions
f.gsub = string.gsub
f.match = string.match
f.sub = string.sub
else -- for multi-byte characters use the ustring library functions
f.gsub = mw.ustring.gsub
f.match = mw.ustring.match
f.sub = mw.ustring.sub
end
local str = ''; -- the output string
local comp = ''; -- what does 'comp' mean?
local end_chr = '';
local trim;
for _, value in ipairs( tbl ) do
if value == nil then value = ''; end
if str == '' then -- if output string is empty
str = value; -- assign value to it (first time through the loop)
elseif value ~= '' then
if value:sub(1, 1) == '<' then -- special case of values enclosed in spans and other markup.
comp = value:gsub( "%b<>", "" ); -- remove HTML markup (<span>string</span> -> string)
else
comp = value;
end
-- typically duplicate_char is sepc
if f.sub(comp, 1, 1) == duplicate_char then -- is first character same as duplicate_char? why test first character?
-- Because individual string segments often (always?) begin with terminal punct for the
-- preceding segment: 'First element' .. 'sepc next element' .. etc.?
trim = false;
end_chr = f.sub(str, -1, -1); -- get the last character of the output string
-- str = str .. "<HERE(enchr=" .. end_chr .. ")" -- debug stuff?
if end_chr == duplicate_char then -- if same as separator
str = f.sub(str, 1, -2); -- remove it
elseif end_chr == "'" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "''" then -- if last three chars of str are sepc''
str = f.sub(str, 1, -4) .. "''"; -- remove them and add back ''
elseif f.sub(str, -5, -1) == duplicate_char .. "]]''" then -- if last five chars of str are sepc]]''
trim = true; -- why? why do this and next differently from previous?
elseif f.sub(str, -4, -1) == duplicate_char .. "]''" then -- if last four chars of str are sepc]''
trim = true; -- same question
end
elseif end_chr == "]" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "]]" then -- if last three chars of str are sepc]] wikilink
trim = true;
elseif f.sub(str, -3, -1) == duplicate_char .. '"]' then -- if last three chars of str are sepc"] quoted external link
trim = true;
elseif f.sub(str, -2, -1) == duplicate_char .. "]" then -- if last two chars of str are sepc] external link
trim = true;
elseif f.sub(str, -4, -1) == duplicate_char .. "'']" then -- normal case when |url=something & |title=Title.
trim = true;
end
elseif end_chr == " " then -- if last char of output string is a space
if f.sub(str, -2, -1) == duplicate_char .. " " then -- if last two chars of str are <sepc><space>
str = f.sub(str, 1, -3); -- remove them both
end
end
if trim then
if value ~= comp then -- value does not equal comp when value contains HTML markup
local dup2 = duplicate_char;
if f.match(dup2, "%A" ) then dup2 = "%" .. dup2; end -- if duplicate_char not a letter then escape it
value = f.gsub(value, "(%b<>)" .. dup2, "%1", 1 ) -- remove duplicate_char if it follows HTML markup
else
value = f.sub(value, 2, -1 ); -- remove duplicate_char when it is first character
end
end
end
str = str .. value; -- add it to the output string
end
end
return str;
end
--[[--------------------------< I S _ S U F F I X >-----------------------------
returns true if suffix is properly formed Jr, Sr, or ordinal in the range 1–9.
Puncutation not allowed.
]]
local function is_suffix (suffix)
if utilities.in_array (suffix, {'Jr', 'Sr', 'Jnr', 'Snr', '1st', '2nd', '3rd'}) or suffix:match ('^%dth$') then
return true;
end
return false;
end
--[[--------------------< I S _ G O O D _ V A N C _ N A M E >-------------------
For Vancouver style, author/editor names are supposed to be rendered in Latin
(read ASCII) characters. When a name uses characters that contain diacritical
marks, those characters are to be converted to the corresponding Latin
character. When a name is written using a non-Latin alphabet or logogram, that
name is to be transliterated into Latin characters. The module doesn't do this
so editors may/must.
This test allows |first= and |last= names to contain any of the letters defined
in the four Unicode Latin character sets
[http://www.unicode.org/charts/PDF/U0000.pdf C0 Controls and Basic Latin] 0041–005A, 0061–007A
[http://www.unicode.org/charts/PDF/U0080.pdf C1 Controls and Latin-1 Supplement] 00C0–00D6, 00D8–00F6, 00F8–00FF
[http://www.unicode.org/charts/PDF/U0100.pdf Latin Extended-A] 0100–017F
[http://www.unicode.org/charts/PDF/U0180.pdf Latin Extended-B] 0180–01BF, 01C4–024F
|lastn= also allowed to contain hyphens, spaces, and apostrophes.
(http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
|firstn= also allowed to contain hyphens, spaces, apostrophes, and periods
This original test:
if nil == mw.ustring.find (last, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%']*$")
or nil == mw.ustring.find (first, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%'%.]+[2-6%a]*$") then
was written outside of the code editor and pasted here because the code editor
gets confused between character insertion point and cursor position. The test has
been rewritten to use decimal character escape sequence for the individual bytes
of the Unicode characters so that it is not necessary to use an external editor
to maintain this code.
\195\128-\195\150 – À-Ö (U+00C0–U+00D6 – C0 controls)
\195\152-\195\182 – Ø-ö (U+00D8-U+00F6 – C0 controls)
\195\184-\198\191 – ø-ƿ (U+00F8-U+01BF – C0 controls, Latin extended A & B)
\199\132-\201\143 – DŽ-ɏ (U+01C4-U+024F – Latin extended B)
]]
local function is_good_vanc_name (last, first, suffix, position)
if not suffix then
if first:find ('[,%s]') then -- when there is a space or comma, might be first name/initials + generational suffix
first = first:match ('(.-)[,%s]+'); -- get name/initials
suffix = first:match ('[,%s]+(.+)$'); -- get generational suffix
end
end
if utilities.is_set (suffix) then
if not is_suffix (suffix) then
add_vanc_error (cfg.err_msg_supl.suffix, position);
return false; -- not a name with an appropriate suffix
end
end
if nil == mw.ustring.find (last, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143\225\184\128-\225\187\191%-%s%']*$") or
nil == mw.ustring.find (first, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143\225\184\128-\225\187\191%-%s%'%.]*$") then
add_vanc_error (cfg.err_msg_supl['non-Latin char'], position);
return false; -- not a string of Latin characters; Vancouver requires Romanization
end;
return true;
end
--[[--------------------------< R E D U C E _ T O _ I N I T I A L S >------------------------------------------
Attempts to convert names to initials in support of |name-list-style=vanc.
Names in |firstn= may be separated by spaces or hyphens, or for initials, a period.
See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35062/.
Vancouver style requires family rank designations (Jr, II, III, etc.) to be rendered
as Jr, 2nd, 3rd, etc. See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35085/.
This code only accepts and understands generational suffix in the Vancouver format
because Roman numerals look like, and can be mistaken for, initials.
This function uses ustring functions because firstname initials may be any of the
Unicode Latin characters accepted by is_good_vanc_name ().
]]
local function reduce_to_initials (first, position)
if first:find (',', 1, true) then
return first; -- commas not allowed; abandon
end
local name, suffix = mw.ustring.match (first, "^(%u+) ([%dJS][%drndth]+)$");
if not name then -- if not initials and a suffix
name = mw.ustring.match (first, "^(%u+)$"); -- is it just initials?
end
if name then -- if first is initials with or without suffix
if 3 > mw.ustring.len (name) then -- if one or two initials
if suffix then -- if there is a suffix
if is_suffix (suffix) then -- is it legitimate?
return first; -- one or two initials and a valid suffix so nothing to do
else
add_vanc_error (cfg.err_msg_supl.suffix, position); -- one or two initials with invalid suffix so error message
return first; -- and return first unmolested
end
else
return first; -- one or two initials without suffix; nothing to do
end
end
end -- if here then name has 3 or more uppercase letters so treat them as a word
local initials_t, names_t = {}, {}; -- tables to hold name parts and initials
local i = 1; -- counter for number of initials
names_t = mw.text.split (first, '[%s%-]+'); -- split into a sequence of names and possible suffix
while names_t[i] do -- loop through the sequence
if 1 < i and names_t[i]:match ('[%dJS][%drndth]+%.?$') then -- if not the first name, and looks like a suffix (may have trailing dot)
names_t[i] = names_t[i]:gsub ('%.', ''); -- remove terminal dot if present
if is_suffix (names_t[i]) then -- if a legitimate suffix
table.insert (initials_t, ' ' .. names_t[i]); -- add a separator space, insert at end of initials sequence
break; -- and done because suffix must fall at the end of a name
end -- no error message if not a suffix; possibly because of Romanization
end
if 3 > i then
table.insert (initials_t, mw.ustring.sub (names_t[i], 1, 1)); -- insert the initial at end of initials sequence
end
i = i + 1; -- bump the counter
end
return table.concat (initials_t); -- Vancouver format does not include spaces.
end
--[[--------------------------< I N T E R W I K I _ P R E F I X E N _ G E T >----------------------------------
extract interwiki prefixen from <value>. Returns two one or two values:
false – no prefixen
nil – prefix exists but not recognized
project prefix, language prefix – when value has either of:
:<project>:<language>:<article>
:<language>:<project>:<article>
project prefix, nil – when <value> has only a known single-letter prefix
nil, language prefix – when <value> has only a known language prefix
accepts single-letter project prefixen: 'd' (wikidata), 's' (wikisource), and 'w' (wikipedia) prefixes; at this
writing, the other single-letter prefixen (b (wikibook), c (commons), m (meta), n (wikinews), q (wikiquote), and
v (wikiversity)) are not supported.
]]
local function interwiki_prefixen_get (value, is_link)
if not value:find (':%l+:') then -- if no prefix
return false; -- abandon; boolean here to distinguish from nil fail returns later
end
local prefix_patterns_linked_t = { -- sequence of valid interwiki and inter project prefixen
'^%[%[:([dsw]):(%l%l+):', -- wikilinked; project and language prefixes
'^%[%[:(%l%l+):([dsw]):', -- wikilinked; language and project prefixes
'^%[%[:([dsw]):', -- wikilinked; project prefix
'^%[%[:(%l%l+):', -- wikilinked; language prefix
}
local prefix_patterns_unlinked_t = { -- sequence of valid interwiki and inter project prefixen
'^:([dsw]):(%l%l+):', -- project and language prefixes
'^:(%l%l+):([dsw]):', -- language and project prefixes
'^:([dsw]):', -- project prefix
'^:(%l%l+):', -- language prefix
}
local cap1, cap2;
for _, pattern in ipairs ((is_link and prefix_patterns_linked_t) or prefix_patterns_unlinked_t) do
cap1, cap2 = value:match (pattern);
if cap1 then
break; -- found a match so stop looking
end
end
if cap1 and cap2 then -- when both then :project:language: or :language:project: (both forms allowed)
if 1 == #cap1 then -- length == 1 then :project:language:
if cfg.inter_wiki_map[cap2] then -- is language prefix in the interwiki map?
return cap1, cap2; -- return interwiki project and interwiki language
end
else -- here when :language:project:
if cfg.inter_wiki_map[cap1] then -- is language prefix in the interwiki map?
return cap2, cap1; -- return interwiki project and interwiki language
end
end
return nil; -- unknown interwiki language
elseif not (cap1 or cap2) then -- both are nil?
return nil; -- we got something that looks like a project prefix but isn't; return fail
elseif 1 == #cap1 then -- here when one capture
return cap1, nil; -- length is 1 so return project, nil language
else -- here when one capture and its length it more than 1
if cfg.inter_wiki_map[cap1] then -- is language prefix in the interwiki map?
return nil, cap1; -- return nil project, language
end
end
end
--[[--------------------------< L I S T _ P E O P L E >--------------------------
Formats a list of people (authors, contributors, editors, interviewers, translators)
names in the list will be linked when
|<name>-link= has a value
|<name>-mask- does NOT have a value; masked names are presumed to have been
rendered previously so should have been linked there
when |<name>-mask=0, the associated name is not rendered
]]
local function list_people (control, people, etal)
local sep;
local namesep;
local format = control.format;
local maximum = control.maximum;
local name_list = {};
if 'vanc' == format then -- Vancouver-like name styling?
sep = cfg.presentation['sep_nl_vanc']; -- name-list separator between names is a comma
namesep = cfg.presentation['sep_name_vanc']; -- last/first separator is a space
else
sep = cfg.presentation['sep_nl']; -- name-list separator between names is a semicolon
namesep = cfg.presentation['sep_name']; -- last/first separator is <comma><space>
end
if sep:sub (-1, -1) ~= " " then sep = sep .. " " end
if utilities.is_set (maximum) and maximum < 1 then return "", 0; end -- returned 0 is for EditorCount; not used for other names
for i, person in ipairs (people) do
if utilities.is_set (person.last) then
local mask = person.mask;
local one;
local sep_one = sep;
if utilities.is_set (maximum) and i > maximum then
etal = true;
break;
end
if mask then
local n = tonumber (mask); -- convert to a number if it can be converted; nil else
if n then
one = 0 ~= n and string.rep("—", n) or nil; -- make a string of (n > 0) mdashes, nil else, to replace name
person.link = nil; -- don't create link to name if name is replaces with mdash string or has been set nil
else
one = mask; -- replace name with mask text (must include name-list separator)
sep_one = " "; -- modify name-list separator
end
else
one = person.last; -- get surname
local first = person.first -- get given name
if utilities.is_set (first) then
if ("vanc" == format) then -- if Vancouver format
one = one:gsub ('%.', ''); -- remove periods from surnames (http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
if not person.corporate and is_good_vanc_name (one, first, nil, i) then -- and name is all Latin characters; corporate authors not tested
first = reduce_to_initials (first, i); -- attempt to convert first name(s) to initials
end
end
one = one .. namesep .. first;
end
end
if utilities.is_set (person.link) then
one = utilities.make_wikilink (person.link, one); -- link author/editor
end
if one then -- if <one> has a value (name, mdash replacement, or mask text replacement)
local proj, tag = interwiki_prefixen_get (one, true); -- get the interwiki prefixen if present
if 'w' == proj and ('Wikipedia' == mw.site.namespaces.Project['name']) then
proj = nil; -- for stuff like :w:de:<article>, :w is unnecessary TODO: maint cat?
end
if proj then
local proj_name = ({['d'] = cfg.messages.wikidata, ['s'] = cfg.messages.wikisource, ['w'] = cfg.messages.wikipedia})[proj]; -- :w (wikipedia) for linking from a non-wikipedia project
if proj_name then
one = one .. utilities.wrap_style ('interproj', proj_name); -- add resized leading space, brackets, static text, language name
utilities.add_prop_cat ('interproj-linked-name', proj); -- categorize it; <proj> is sort key
tag = nil; -- unset; don't do both project and language
end
end
if tag == cfg.this_wiki_code then
tag = nil; -- stuff like :en:<article> at en.wiki is pointless TODO: maint cat?
end
if tag then
local lang = cfg.lang_tag_remap[tag] or cfg.mw_languages_by_tag_t[tag];
if lang then -- error messaging done in extract_names() where we know parameter names
one = one .. utilities.wrap_style ('interwiki', lang); -- add resized leading space, brackets, static text, language name
utilities.add_prop_cat ('interwiki-linked-name', tag); -- categorize it; <tag> is sort key
end
end
table.insert (name_list, one); -- add it to the list of names
table.insert (name_list, sep_one); -- add the proper name-list separator
end
end
end
local count = #name_list / 2; -- (number of names + number of separators) divided by 2
if 0 < count then
if 1 < count and not etal then
if 'amp' == format then
name_list[#name_list-2] = " & "; -- replace last separator with ampersand text
elseif 'and' == format then
if 2 == count then
name_list[#name_list-2] = cfg.presentation.sep_nl_and; -- replace last separator with 'and' text
else
name_list[#name_list-2] = cfg.presentation.sep_nl_end; -- replace last separator with '(sep) and' text
end
end
end
name_list[#name_list] = nil; -- erase the last separator
end
local result = table.concat (name_list); -- construct list
if etal and utilities.is_set (result) then -- etal may be set by |display-authors=etal but we might not have a last-first list
result = result .. sep .. cfg.messages['et al']; -- we've got a last-first list and etal so add et al.
end
return result, count; -- return name-list string and count of number of names (count used for editor names only)
end
--[[--------------------< M A K E _ C I T E R E F _ I D >-----------------------
Generates a CITEREF anchor ID if we have at least one name or a date. Otherwise
returns an empty string.
namelist is one of the contributor-, author-, or editor-name lists chosen in that
order. year is Year or anchor_year.
]]
local function make_citeref_id (namelist, year)
local names={}; -- a table for the one to four names and year
for i,v in ipairs (namelist) do -- loop through the list and take up to the first four last names
names[i] = v.last
if i == 4 then break end -- if four then done
end
table.insert (names, year); -- add the year at the end
local id = table.concat(names); -- concatenate names and year for CITEREF id
if utilities.is_set (id) then -- if concatenation is not an empty string
return "CITEREF" .. id; -- add the CITEREF portion
else
return ''; -- return an empty string; no reason to include CITEREF id in this citation
end
end
--[[--------------------------< C I T E _ C L A S S _A T T R I B U T E _M A K E >------------------------------
construct <cite> tag class attribute for this citation.
<cite_class> – config.CitationClass from calling template
<mode> – value from |mode= parameter
]]
local function cite_class_attribute_make (cite_class, mode)
local class_t = {};
table.insert (class_t, 'citation'); -- required for blue highlight
if 'citation' ~= cite_class then
table.insert (class_t, cite_class); -- identify this template for user css
table.insert (class_t, utilities.is_set (mode) and mode or 'cs1'); -- identify the citation style for user css or javascript
else
table.insert (class_t, utilities.is_set (mode) and mode or 'cs2'); -- identify the citation style for user css or javascript
end
for _, prop_key in ipairs (z.prop_keys_t) do
table.insert (class_t, prop_key); -- identify various properties for user css or javascript
end
return table.concat (class_t, ' '); -- make a big string and done
end
--[[---------------------< N A M E _ H A S _ E T A L >--------------------------
Evaluates the content of name parameters (author, editor, etc.) for variations on
the theme of et al. If found, the et al. is removed, a flag is set to true and
the function returns the modified name and the flag.
This function never sets the flag to false but returns its previous state because
it may have been set by previous passes through this function or by the associated
|display-<names>=etal parameter
]]
local function name_has_etal (name, etal, nocat, param)
if utilities.is_set (name) then -- name can be nil in which case just return
local patterns = cfg.et_al_patterns; -- get patterns from configuration
for _, pattern in ipairs (patterns) do -- loop through all of the patterns
if name:match (pattern) then -- if this 'et al' pattern is found in name
name = name:gsub (pattern, ''); -- remove the offending text
etal = true; -- set flag (may have been set previously here or by |display-<names>=etal)
if not nocat then -- no categorization for |vauthors=
utilities.set_message ('err_etal', {param}); -- and set an error if not added
end
end
end
end
return name, etal;
end
--[[---------------------< N A M E _ I S _ N U M E R I C >----------------------
Add an error message and category when <name> parameter value does not contain letters.
Add a maintenance category when <name> parameter value has numeric characters mixed with characters that are
not numeric characters; could be letters and/or punctuation characters.
This function will only emit one error and one maint message for the current template. Does not emit both error
and maint messages/categories for the same parameter value.
returns nothing
]]
local function name_is_numeric (name, name_alias, list_name)
local patterns = {
'^%D+%d', -- <name> must have digits preceded by other characters
'^%D*%d+%D+', -- <name> must have digits followed by other characters
}
if not added_numeric_name_errs and mw.ustring.match (name, '^[%A]+$') then -- if we have not already set an error message and <name> does not have any alpha characters
utilities.set_message ('err_numeric_names', name_alias); -- add an error message
added_numeric_name_errs = true; -- set the flag so we emit only one error message
return; -- when here no point in further testing; abandon
end
if not added_numeric_name_maint then -- if we have already set a maint message
for _, pattern in ipairs (patterns) do -- spin through list of patterns
if mw.ustring.match (name, pattern) then -- digits preceded or followed by anything but digits; %D+ includes punctuation
utilities.set_message ('maint_numeric_names', cfg.special_case_translation [list_name]); -- add a maint cat for this template
added_numeric_name_maint = true; -- set the flag so we emit only one maint message
return; -- when here no point in further testing; abandon
end
end
end
end
--[[-----------------< N A M E _ H A S _ M U L T _ N A M E S >------------------
Evaluates the content of last/surname (authors etc.) parameters for multiple names.
Multiple names are indicated if there is more than one comma or any "unescaped"
semicolons. Escaped semicolons are ones used as part of selected HTML entities.
If the condition is met, the function adds the multiple name maintenance category.
Same test for first except that commas should not appear in given names (MOS:JR says
that the generational suffix does not take a separator character). Titles, degrees,
postnominals, affiliations, all normally comma separated don't belong in a citation.
<name> – name parameter value
<list_name> – AuthorList, EditorList, etc
<limit> – number of allowed commas; 1 (default) for surnames; 0 for given names
returns nothing
]]
local function name_has_mult_names (name, list_name, limit)
local _, commas, semicolons, nbsps;
limit = limit and limit or 1;
if utilities.is_set (name) then
_, commas = name:gsub (',', ''); -- count the number of commas
_, semicolons = name:gsub (';', ''); -- count the number of semicolons
-- nbsps probably should be its own separate count rather than merged in
-- some way with semicolons because Lua patterns do not support the
-- grouping operator that regex does, which means there is no way to add
-- more entities to escape except by adding more counts with the new
-- entities
_, nbsps = name:gsub (' ',''); -- count nbsps
-- There is exactly 1 semicolon per entity, so subtract nbsps
-- from semicolons to 'escape' them. If additional entities are added,
-- they also can be subtracted.
if limit < commas or 0 < (semicolons - nbsps) then
utilities.set_message ('maint_mult_names', cfg.special_case_translation [list_name]); -- add a maint message
end
end
end
--[=[-------------------------< I S _ G E N E R I C >----------------------------------------------------------
Compares values assigned to various parameters according to the string provided as <item> in the function call.
<item> can have on of two values:
'generic_names' – for name-holding parameters: |last=, |first=, |editor-last=, etc
'generic_titles' – for |title=
There are two types of generic tests. The 'accept' tests look for a pattern that should not be rejected by the
'reject' test. For example,
|author=[[John Smith (author)|Smith, John]]
would be rejected by the 'author' reject test. But piped wikilinks with 'author' disambiguation should not be
rejected so the 'accept' test prevents that from happening. Accept tests are always performed before reject
tests.
Each of the 'accept' and 'reject' sequence tables hold tables for en.wiki (['en']) and local.wiki (['local'])
that each can hold a test sequence table The sequence table holds, at index [1], a test pattern, and, at index
[2], a boolean control value. The control value tells string.find() or mw.ustring.find() to do plain-text search (true)
or a pattern search (false). The intent of all this complexity is to make these searches as fast as possible so
that we don't run out of processing time on very large articles.
Returns
true when a reject test finds the pattern or string
false when an accept test finds the pattern or string
nil else
]=]
local function is_generic (item, value, wiki)
local test_val;
local str_lower = { -- use string.lower() for en.wiki (['en']) and use mw.ustring.lower() or local.wiki (['local'])
['en'] = string.lower,
['local'] = mw.ustring.lower,
}
local str_find = { -- use string.find() for en.wiki (['en']) and use mw.ustring.find() or local.wiki (['local'])
['en'] = string.find,
['local'] = mw.ustring.find,
}
local function test (val, test_t, wiki) -- local function to do the testing; <wiki> selects lower() and find() functions
val = test_t[2] and str_lower[wiki](value) or val; -- when <test_t[2]> set to 'true', plaintext search using lowercase value
return str_find[wiki] (val, test_t[1], 1, test_t[2]); -- return nil when not found or matched
end
local test_types_t = {'accept', 'reject'}; -- test accept patterns first, then reject patterns
local wikis_t = {'en', 'local'}; -- do tests for each of these keys; en.wiki first, local.wiki second
for _, test_type in ipairs (test_types_t) do -- for each test type
for _, generic_value in pairs (cfg.special_case_translation[item][test_type]) do -- spin through the list of generic value fragments to accept or reject
for _, wiki in ipairs (wikis_t) do
if generic_value[wiki] then
if test (value, generic_value[wiki], wiki) then -- go do the test
return ('reject' == test_type); -- param value rejected, return true; false else
end
end
end
end
end
end
--[[--------------------------< N A M E _ I S _ G E N E R I C >------------------------------------------------
calls is_generic() to determine if <name> is a 'generic name' listed in cfg.generic_names; <name_alias> is the
parameter name used in error messaging
]]
local function name_is_generic (name, name_alias)
if not added_generic_name_errs and is_generic ('generic_names', name) then
utilities.set_message ('err_generic_name', name_alias); -- set an error message
added_generic_name_errs = true;
end
end
--[[--------------------------< N A M E _ C H E C K S >--------------------------------------------------------
This function calls various name checking functions used to validate the content of the various name-holding parameters.
]]
local function name_checks (last, first, list_name, last_alias, first_alias)
local accept_name;
if utilities.is_set (last) then
last, accept_name = utilities.has_accept_as_written (last); -- remove accept-this-as-written markup when it wraps all of <last>
if not accept_name then -- <last> not wrapped in accept-as-written markup
name_has_mult_names (last, list_name); -- check for multiple names in the parameter
name_is_numeric (last, last_alias, list_name); -- check for names that have no letters or are a mix of digits and other characters
name_is_generic (last, last_alias); -- check for names found in the generic names list
end
end
if utilities.is_set (first) then
first, accept_name = utilities.has_accept_as_written (first); -- remove accept-this-as-written markup when it wraps all of <first>
if not accept_name then -- <first> not wrapped in accept-as-written markup
name_has_mult_names (first, list_name, 0); -- check for multiple names in the parameter; 0 is number of allowed commas in a given name
name_is_numeric (first, first_alias, list_name); -- check for names that have no letters or are a mix of digits and other characters
name_is_generic (first, first_alias); -- check for names found in the generic names list
end
local wl_type, D = utilities.is_wikilink (first);
if 0 ~= wl_type then
first = D;
utilities.set_message ('err_bad_paramlink', first_alias);
end
end
return last, first; -- done
end
--[[----------------------< E X T R A C T _ N A M E S >-------------------------
Gets name list from the input arguments
Searches through args in sequential order to find |lastn= and |firstn= parameters
(or their aliases), and their matching link and mask parameters. Stops searching
when both |lastn= and |firstn= are not found in args after two sequential attempts:
found |last1=, |last2=, and |last3= but doesn't find |last4= and |last5= then the
search is done.
This function emits an error message when there is a |firstn= without a matching
|lastn=. When there are 'holes' in the list of last names, |last1= and |last3=
are present but |last2= is missing, an error message is emitted. |lastn= is not
required to have a matching |firstn=.
When an author or editor parameter contains some form of 'et al.', the 'et al.'
is stripped from the parameter and a flag (etal) returned that will cause list_people()
to add the static 'et al.' text from Module:Citation/CS1/Configuration. This keeps
'et al.' out of the template's metadata. When this occurs, an error is emitted.
]]
local function extract_names(args, list_name)
local names = {}; -- table of names
local last; -- individual name components
local first;
local link;
local mask;
local i = 1; -- loop counter/indexer
local n = 1; -- output table indexer
local count = 0; -- used to count the number of times we haven't found a |last= (or alias for authors, |editor-last or alias for editors)
local etal = false; -- return value set to true when we find some form of et al. in an author parameter
local last_alias, first_alias, link_alias; -- selected parameter aliases used in error messaging
while true do
last, last_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'err_redundant_parameters', i ); -- search through args for name components beginning at 1
first, first_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'err_redundant_parameters', i );
link, link_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i );
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
if last then -- error check |lastn= alias for unknown interwiki link prefix; done here because this is where we have the parameter name
local project, language = interwiki_prefixen_get (last, true); -- true because we expect interwiki links in |lastn= to be wikilinked
if nil == project and nil == language then -- when both are nil
utilities.set_message ('err_bad_paramlink', last_alias); -- not known, emit an error message -- TODO: err_bad_interwiki?
last = utilities.remove_wiki_link (last); -- remove wikilink markup; show display value only
end
end
if link then -- error check |linkn= alias for unknown interwiki link prefix
local project, language = interwiki_prefixen_get (link, false); -- false because wiki links in |author-linkn= is an error
if nil == project and nil == language then -- when both are nil
utilities.set_message ('err_bad_paramlink', link_alias); -- not known, emit an error message -- TODO: err_bad_interwiki?
link = nil; -- unset so we don't link
link_alias = nil;
end
end
last, etal = name_has_etal (last, etal, false, last_alias); -- find and remove variations on et al.
first, etal = name_has_etal (first, etal, false, first_alias); -- find and remove variations on et al.
last, first = name_checks (last, first, list_name, last_alias, first_alias); -- multiple names, extraneous annotation, etc. checks
if first and not last then -- if there is a firstn without a matching lastn
local alias = first_alias:find ('given', 1, true) and 'given' or 'first'; -- get first or given form of the alias
utilities.set_message ('err_first_missing_last', {
first_alias, -- param name of alias missing its mate
first_alias:gsub (alias, {['first'] = 'last', ['given'] = 'surname'}), -- make param name appropriate to the alias form
}); -- add this error message
elseif not first and not last then -- if both firstn and lastn aren't found, are we done?
count = count + 1; -- number of times we haven't found last and first
if 2 <= count then -- two missing names and we give up
break; -- normal exit or there is a two-name hole in the list; can't tell which
end
else -- we have last with or without a first
local result;
link = link_title_ok (link, link_alias, last, last_alias); -- check for improper wiki-markup
if first then
link = link_title_ok (link, link_alias, first, first_alias); -- check for improper wiki-markup
end
names[n] = {last = last, first = first, link = link, mask = mask, corporate = false}; -- add this name to our names list (corporate for |vauthors= only)
n = n + 1; -- point to next location in the names table
if 1 == count then -- if the previous name was missing
utilities.set_message ('err_missing_name', {list_name:match ("(%w+)List"):lower(), i - 1}); -- add this error message
end
count = 0; -- reset the counter, we're looking for two consecutive missing names
end
i = i + 1; -- point to next args location
end
return names, etal; -- all done, return our list of names and the etal flag
end
--[[--------------------------< N A M E _ T A G _ G E T >------------------------------------------------------
attempt to decode |language=<lang_param> and return language name and matching tag; nil else.
This function looks for:
<lang_param> as a tag in cfg.lang_tag_remap{}
<lang_param> as a name in cfg.lang_name_remap{}
<lang_param> as a name in cfg.mw_languages_by_name_t
<lang_param> as a tag in cfg.mw_languages_by_tag_t
when those fail, presume that <lang_param> is an IETF-like tag that MediaWiki does not recognize. Strip all
script, region, variant, whatever subtags from <lang_param> to leave just a two or three character language tag
and look for the new <lang_param> in cfg.mw_languages_by_tag_t{}
on success, returns name (in properly capitalized form) and matching tag (in lowercase); on failure returns nil
]]
local function name_tag_get (lang_param)
local lang_param_lc = mw.ustring.lower (lang_param); -- use lowercase as an index into the various tables
local name;
local tag;
name = cfg.lang_tag_remap[lang_param_lc]; -- assume <lang_param_lc> is a tag; attempt to get remapped language name
if name then -- when <name>, <lang_param> is a tag for a remapped language name
if cfg.lang_name_remap[name:lower()][2] ~= lang_param_lc then
utilities.set_message ('maint_unknown_lang'); -- add maint category if not already added
return name, cfg.lang_name_remap[name:lower()][2]; -- so return name and tag from lang_name_remap[name]; special case to xlate sr-ec and sr-el to sr-cyrl and sr-latn
end
return name, lang_param_lc; -- so return <name> from remap and <lang_param_lc>
end
tag = lang_param_lc:match ('^(%a%a%a?)%-.*'); -- still assuming that <lang_param_lc> is a tag; strip script, region, variant subtags
name = cfg.lang_tag_remap[tag]; -- attempt to get remapped language name with language subtag only
if name then -- when <name>, <tag> is a tag for a remapped language name
return name, tag; -- so return <name> from remap and <tag>
end
if cfg.lang_name_remap[lang_param_lc] then -- not a remapped tag, assume <lang_param_lc> is a name; attempt to get remapped language tag
return cfg.lang_name_remap[lang_param_lc][1], cfg.lang_name_remap[lang_param_lc][2]; -- for this <lang_param_lc>, return a (possibly) new name and appropriate tag
end
name = cfg.mw_languages_by_tag_t[lang_param_lc]; -- assume that <lang_param_lc> is a tag; attempt to get its matching language name
if name then
return name, lang_param_lc; -- <lang_param_lc> is a tag so return it and <name>
end
tag = cfg.mw_languages_by_name_t[lang_param_lc]; -- assume that <lang_param_lc> is a language name; attempt to get its matching tag
if tag then
return cfg.mw_languages_by_tag_t[tag], tag; -- <lang_param_lc> is a name so return the name from the table and <tag>
end
tag = lang_param_lc:match ('^(%a%a%a?)%-.*'); -- is <lang_param_lc> an IETF-like tag that MediaWiki doesn't recognize? <tag> gets the language subtag; nil else
if tag then
name = cfg.mw_languages_by_tag_t[tag]; -- attempt to get a language name using the shortened <tag>
if name then
return name, tag; -- <lang_param_lc> is an unrecognized IETF-like tag so return <name> and language subtag
end
end
end
--[[-------------------< L A N G U A G E _ P A R A M E T E R >------------------
Gets language name from a provided two- or three-character ISO 639 code. If a code
is recognized by MediaWiki, use the returned name; if not, then use the value that
was provided with the language parameter.
When |language= contains a recognized language (either code or name), the page is
assigned to the category for that code: Category:Norwegian-language sources (no).
For valid three-character code languages, the page is assigned to the single category
for '639-2' codes: Category:CS1 ISO 639-2 language sources.
Languages that are the same as the local wiki are not categorized. MediaWiki does
not recognize three-character equivalents of two-character codes: code 'ar' is
recognized but code 'ara' is not.
This function supports multiple languages in the form |language=nb, French, th
where the language names or codes are separated from each other by commas with
optional space characters.
]]
local function language_parameter (lang)
local tag; -- some form of IETF-like language tag; language subtag with optional region, sript, vatiant, etc subtags
local lang_subtag; -- ve populates |language= with mostly unecessary region subtags the MediaWiki does not recognize; this is the base language subtag
local name; -- the language name
local language_list = {}; -- table of language names to be rendered
local names_t = {}; -- table made from the value assigned to |language=
local this_wiki_name = mw.language.fetchLanguageName (cfg.this_wiki_code, cfg.this_wiki_code); -- get this wiki's language name
names_t = mw.text.split (lang, '%s*,%s*'); -- names should be a comma separated list
for _, lang in ipairs (names_t) do -- reuse lang here because we don't yet know if lang is a language name or a language tag
name, tag = name_tag_get (lang); -- attempt to get name/tag pair for <lang>; <name> has proper capitalization; <tag> is lowercase
if utilities.is_set (tag) then
lang_subtag = tag:gsub ('^(%a%a%a?)%-.*', '%1'); -- for categorization, strip any IETF-like tags from language tag
if cfg.this_wiki_code ~= lang_subtag then -- when the language is not the same as this wiki's language
if 2 == lang_subtag:len() then -- and is a two-character tag
utilities.add_prop_cat ('foreign-lang-source', {name, tag}, lang_subtag); -- categorize it; tag appended to allow for multiple language categorization
else -- or is a recognized language (but has a three-character tag)
utilities.add_prop_cat ('foreign-lang-source-2', {lang_subtag}, lang_subtag); -- categorize it differently TODO: support multiple three-character tag categories per cs1|2 template?
end
elseif cfg.local_lang_cat_enable then -- when the language and this wiki's language are the same and categorization is enabled
utilities.add_prop_cat ('local-lang-source', {name, lang_subtag}); -- categorize it
end
else
name = lang; -- return whatever <lang> has so that we show something
utilities.set_message ('maint_unknown_lang'); -- add maint category if not already added
end
table.insert (language_list, name);
name = ''; -- so we can reuse it
end
name = utilities.make_sep_list (#language_list, language_list);
if (1 == #language_list) and (lang_subtag == cfg.this_wiki_code) then -- when only one language, find lang name in this wiki lang name; for |language=en-us, 'English' in 'American English'
return ''; -- if one language and that language is this wiki's return an empty string (no annotation)
end
return (" " .. wrap_msg ('language', name)); -- otherwise wrap with '(in ...)'
--[[ TODO: should only return blank or name rather than full list
so we can clean up the bunched parenthetical elements Language, Type, Format
]]
end
--[[-----------------------< S E T _ C S _ S T Y L E >--------------------------
Gets the default CS style configuration for the given mode.
Returns default separator and either postscript as passed in or the default.
In CS1, the default postscript and separator are '.'.
In CS2, the default postscript is the empty string and the default separator is ','.
]]
local function set_cs_style (postscript, mode)
if utilities.is_set(postscript) then
-- emit a maintenance message if user postscript is the default cs1 postscript
-- we catch the opposite case for cs2 in set_style
if mode == 'cs1' and postscript == cfg.presentation['ps_' .. mode] then
utilities.set_message ('maint_postscript');
end
else
postscript = cfg.presentation['ps_' .. mode];
end
return cfg.presentation['sep_' .. mode], postscript;
end
--[[--------------------------< S E T _ S T Y L E >-----------------------------
Sets the separator and postscript styles. Checks the |mode= first and the
#invoke CitationClass second. Removes the postscript if postscript == none.
]]
local function set_style (mode, postscript, cite_class)
local sep;
if 'cs2' == mode then
sep, postscript = set_cs_style (postscript, 'cs2');
elseif 'cs1' == mode then
sep, postscript = set_cs_style (postscript, 'cs1');
elseif 'citation' == cite_class then
sep, postscript = set_cs_style (postscript, 'cs2');
else
sep, postscript = set_cs_style (postscript, 'cs1');
end
if cfg.keywords_xlate[postscript:lower()] == 'none' then
-- emit a maintenance message if user postscript is the default cs2 postscript
-- we catch the opposite case for cs1 in set_cs_style
if 'cs2' == mode or ('cs1' ~= mode and 'citation' == cite_class) then -- {{citation |title=Title |mode=cs1 |postscript=none}} should not emit maint message
utilities.set_message ('maint_postscript');
end
postscript = '';
end
return sep, postscript
end
--[=[-------------------------< I S _ P D F >-----------------------------------
Determines if a URL has the file extension that is one of the PDF file extensions
used by [[MediaWiki:Common.css]] when applying the PDF icon to external links.
returns true if file extension is one of the recognized extensions, else false
]=]
local function is_pdf (url)
return url:match ('%.pdf$') or url:match ('%.PDF$') or
url:match ('%.pdf[%?#]') or url:match ('%.PDF[%?#]') or
url:match ('%.PDF#') or url:match ('%.pdf#');
end
--[[--------------------------< S T Y L E _ F O R M A T >-----------------------
Applies CSS style to |format=, |chapter-format=, etc. Also emits an error message
if the format parameter does not have a matching URL parameter. If the format parameter
is not set and the URL contains a file extension that is recognized as a PDF document
by MediaWiki's commons.css, this code will set the format parameter to (PDF) with
the appropriate styling.
]]
local function style_format (format, url, fmt_param, url_param)
if utilities.is_set (format) then
format = utilities.wrap_style ('format', format); -- add leading space, parentheses, resize
if not utilities.is_set (url) then
utilities.set_message ('err_format_missing_url', {fmt_param, url_param}); -- add an error message
end
elseif is_pdf (url) then -- format is not set so if URL is a PDF file then
format = utilities.wrap_style ('format', 'PDF'); -- set format to PDF
else
format = ''; -- empty string for concatenation
end
return format;
end
--[[---------------------< G E T _ D I S P L A Y _ N A M E S >------------------
Returns a number that defines the number of names displayed for author and editor
name lists and a Boolean flag to indicate when et al. should be appended to the name list.
When the value assigned to |display-xxxxors= is a number greater than or equal to zero,
return the number and the previous state of the 'etal' flag (false by default
but may have been set to true if the name list contains some variant of the text 'et al.').
When the value assigned to |display-xxxxors= is the keyword 'etal', return a number
that is one greater than the number of authors in the list and set the 'etal' flag true.
This will cause the list_people() to display all of the names in the name list followed by 'et al.'
In all other cases, returns nil and the previous state of the 'etal' flag.
inputs:
max: A['DisplayAuthors'] or A['DisplayEditors'], etc; a number or some flavor of etal
count: #a or #e
list_name: 'authors' or 'editors'
etal: author_etal or editor_etal
This function sets an error message when |display-xxxxors= value greater than or equal to number of names but
not when <max> comes from {{cs1 config}} global settings. When using global settings, <param> is set to the
keyword 'cs1 config' which is used to supress the normal error. Error is suppressed because it is to be expected
that some citations in an article will have the same or fewer names that the limit specified in {{cs1 config}}.
]]
local function get_display_names (max, count, list_name, etal, param)
if utilities.is_set (max) then
if 'etal' == max:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
max = count + 1; -- number of authors + 1 so display all author name plus et al.
etal = true; -- overrides value set by extract_names()
elseif max:match ('^%d+$') then -- if is a string of numbers
max = tonumber (max); -- make it a number
if (max >= count) and ('cs1 config' ~= param) then -- error when local |display-xxxxors= value greater than or equal to number of names; not an error when using global setting
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil;
end
else -- not a valid keyword or number
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil; -- unset; as if |display-xxxxors= had not been set
end
end
return max, etal;
end
--[[----------< E X T R A _ T E X T _ I N _ P A G E _ C H E C K >---------------
Adds error if |page=, |pages=, |quote-page=, |quote-pages= has what appears to be
some form of p. or pp. abbreviation in the first characters of the parameter content.
check page for extraneous p, p., pp, pp., pg, pg. at start of parameter value:
good pattern: '^P[^%.P%l]' matches when page begins PX or P# but not Px
where x and X are letters and # is a digit
bad pattern: '^[Pp][PpGg]' matches when page begins pp, pP, Pp, PP, pg, pG, Pg, PG
]]
local function extra_text_in_page_check (val, name)
if not val:match (cfg.vol_iss_pg_patterns.good_ppattern) then
for _, pattern in ipairs (cfg.vol_iss_pg_patterns.bad_ppatterns) do -- spin through the selected sequence table of patterns
if val:match (pattern) then -- when a match, error so
utilities.set_message ('err_extra_text_pages', name); -- add error message
return; -- and done
end
end
end
end
--[[--------------------------< E X T R A _ T E X T _ I N _ V O L _ I S S _ C H E C K >------------------------
Adds error if |volume= or |issue= has what appears to be some form of redundant 'type' indicator. Applies to
both; this function looks for issue text in both |issue= and |volume= and looks for volume-like text in |voluem=
and |issue=.
For |volume=:
'V.', or 'Vol.' (with or without the dot) abbreviations or 'Volume' in the first characters of the parameter
content (all case insensitive). 'V' and 'v' (without the dot) are presumed to be roman numerals so
are allowed.
For |issue=:
'No.', 'I.', 'Iss.' (with or without the dot) abbreviations, or 'Issue' in the first characters of the
parameter content (all case insensitive); numero styling: 'n°' with degree sign U+00B0, and № precomposed
numero sign U+2116.
Single character values ('v', 'i', 'n') allowed when not followed by separator character ('.', ':', '=', or
whitespace character) – param values are trimmed of whitespace by MediaWiki before delivered to the module.
<val> is |volume= or |issue= parameter value
<name> is |volume= or |issue= parameter name for error message
<selector> is 'v' for |volume=, 'i' for |issue=
sets error message on failure; returns nothing
]]
local function extra_text_in_vol_iss_check (val, name, selector)
if not utilities.is_set (val) then
return;
end
local handler = 'v' == selector and 'err_extra_text_volume' or 'err_extra_text_issue';
local accept_val;
val, accept_val = utilities.has_accept_as_written (val);
--if accept_val then -- if uncomment this, |volume=((vol. 1)) suppresses error
-- return;
--end
--val = mw.text.unstripNoWiki (val); -- if uncomment this, |volume=<nowiki>vol. 1</nowiki> shows error
val = val:lower(); -- force parameter value to lower case
for _, pattern in ipairs (cfg.vol_iss_pg_patterns.vi_patterns_t) do -- spin through the sequence table of patterns
if val:match (pattern) then -- when a match, error so
utilities.set_message (handler, name); -- add error message
return; -- and done
end
end
end
--[=[-------------------------< G E T _ V _ N A M E _ T A B L E >----------------------------------------------
split apart a |vauthors= or |veditors= parameter. This function allows for corporate names, wrapped in doubled
parentheses to also have commas; in the old version of the code, the doubled parentheses were included in the
rendered citation and in the metadata. Individual author names may be wikilinked
|vauthors=Jones AB, [[E. B. White|White EB]], ((Black, Brown, and Co.))
]=]
local function get_v_name_table (vparam, output_table, output_link_table)
local _, accept = utilities.has_accept_as_written (vparam);
if accept then
utilities.add_prop_cat ('vanc-accept'); -- add properties category
end
local name_table = mw.text.split(vparam, "%s*,%s*"); -- names are separated by commas
local wl_type, label, link; -- wl_type not used here; just a placeholder
local i = 1;
while name_table[i] do
if name_table[i]:match ('^%(%(.*[^%)][^%)]$') then -- first segment of corporate with one or more commas; this segment has the opening doubled parentheses
local name = name_table[i];
i = i + 1; -- bump indexer to next segment
while name_table[i] do
name = name .. ', ' .. name_table[i]; -- concatenate with previous segments
if name_table[i]:match ('^.*%)%)$') then -- if this table member has the closing doubled parentheses
break; -- and done reassembling so
end
i = i + 1; -- bump indexer
end
table.insert (output_table, name); -- and add corporate name to the output table
table.insert (output_link_table, ''); -- no wikilink
else
wl_type, label, link = utilities.is_wikilink (name_table[i]); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
table.insert (output_table, label); -- add this name
if 1 == wl_type then
table.insert (output_link_table, label); -- simple wikilink [[D]]
else
table.insert (output_link_table, link); -- no wikilink or [[L|D]]; add this link if there is one, else empty string
end
end
i = i + 1;
end
return output_table;
end
--[[--------------------------< P A R S E _ V A U T H O R S _ V E D I T O R S >--------------------------------
This function extracts author / editor names from |vauthors= or |veditors= and finds matching |xxxxor-maskn= and
|xxxxor-linkn= in args. It then returns a table of assembled names just as extract_names() does.
Author / editor names in |vauthors= or |veditors= must be in Vancouver system style. Corporate or institutional names
may sometimes be required and because such names will often fail the is_good_vanc_name() and other format compliance
tests, are wrapped in doubled parentheses ((corporate name)) to suppress the format tests.
Supports generational suffixes Jr, 2nd, 3rd, 4th–6th.
This function sets the Vancouver error when a required comma is missing and when there is a space between an author's initials.
]]
local function parse_vauthors_veditors (args, vparam, list_name)
local names = {}; -- table of names assembled from |vauthors=, |author-maskn=, |author-linkn=
local v_name_table = {};
local v_link_table = {}; -- when name is wikilinked, targets go in this table
local etal = false; -- return value set to true when we find some form of et al. vauthors parameter
local last, first, link, mask, suffix;
local corporate = false;
vparam, etal = name_has_etal (vparam, etal, true); -- find and remove variations on et al. do not categorize (do it here because et al. might have a period)
v_name_table = get_v_name_table (vparam, v_name_table, v_link_table); -- names are separated by commas
for i, v_name in ipairs(v_name_table) do
first = ''; -- set to empty string for concatenation and because it may have been set for previous author/editor
local accept_name;
v_name, accept_name = utilities.has_accept_as_written (v_name); -- remove accept-this-as-written markup when it wraps all of <v_name>
if accept_name then
last = v_name;
corporate = true; -- flag used in list_people()
elseif string.find(v_name, "%s") then
if v_name:find('[;%.]') then -- look for commonly occurring punctuation characters;
add_vanc_error (cfg.err_msg_supl.punctuation, i);
end
local lastfirstTable = {}
lastfirstTable = mw.text.split(v_name, "%s+")
first = table.remove(lastfirstTable); -- removes and returns value of last element in table which should be initials or generational suffix
if not mw.ustring.match (first, '^%u+$') then -- mw.ustring here so that later we will catch non-Latin characters
suffix = first; -- not initials so assume that whatever we got is a generational suffix
first = table.remove(lastfirstTable); -- get what should be the initials from the table
end
last = table.concat(lastfirstTable, ' ') -- returns a string that is the concatenation of all other names that are not initials and generational suffix
if not utilities.is_set (last) then
first = ''; -- unset
last = v_name; -- last empty because something wrong with first
add_vanc_error (cfg.err_msg_supl.name, i);
end
if mw.ustring.match (last, '%a+%s+%u+%s+%a+') then
add_vanc_error (cfg.err_msg_supl['missing comma'], i); -- matches last II last; the case when a comma is missing
end
if mw.ustring.match (v_name, ' %u %u$') then -- this test is in the wrong place TODO: move or replace with a more appropriate test
add_vanc_error (cfg.err_msg_supl.initials, i); -- matches a space between two initials
end
else
last = v_name; -- last name or single corporate name? Doesn't support multiword corporate names? do we need this?
end
if utilities.is_set (first) then
if not mw.ustring.match (first, "^%u?%u$") then -- first shall contain one or two upper-case letters, nothing else
add_vanc_error (cfg.err_msg_supl.initials, i); -- too many initials; mixed case initials (which may be ok Romanization); hyphenated initials
end
is_good_vanc_name (last, first, suffix, i); -- check first and last before restoring the suffix which may have a non-Latin digit
if utilities.is_set (suffix) then
first = first .. ' ' .. suffix; -- if there was a suffix concatenate with the initials
suffix = ''; -- unset so we don't add this suffix to all subsequent names
end
else
if not corporate then
is_good_vanc_name (last, '', nil, i);
end
end
link = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i ) or v_link_table[i];
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
names[i] = {last = last, first = first, link = link, mask = mask, corporate = corporate}; -- add this assembled name to our names list
end
return names, etal; -- all done, return our list of names
end
--[[--------------------------< S E L E C T _ A U T H O R _ E D I T O R _ S O U R C E >------------------------
Select one of |authors=, |authorn= / |lastn / firstn=, or |vauthors= as the source of the author name list or
select one of |editorn= / editor-lastn= / |editor-firstn= or |veditors= as the source of the editor name list.
Only one of these appropriate three will be used. The hierarchy is: |authorn= (and aliases) highest and |authors= lowest;
|editorn= (and aliases) highest and |veditors= lowest (support for |editors= withdrawn)
When looking for |authorn= / |editorn= parameters, test |xxxxor1= and |xxxxor2= (and all of their aliases); stops after the second
test which mimicks the test used in extract_names() when looking for a hole in the author name list. There may be a better
way to do this, I just haven't discovered what that way is.
Emits an error message when more than one xxxxor name source is provided.
In this function, vxxxxors = vauthors or veditors; xxxxors = authors as appropriate.
]]
local function select_author_editor_source (vxxxxors, xxxxors, args, list_name)
local lastfirst = false;
if utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 1 ) or -- do this twice in case we have a |first1= without a |last1=; this ...
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 1 ) or -- ... also catches the case where |first= is used with |vauthors=
utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 2 ) or
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 2 ) then
lastfirst = true;
end
if (utilities.is_set (vxxxxors) and true == lastfirst) or -- these are the three error conditions
(utilities.is_set (vxxxxors) and utilities.is_set (xxxxors)) or
(true == lastfirst and utilities.is_set (xxxxors)) then
utilities.set_message ('err_redundant_parameters',
utilities.substitute (cfg.special_case_translation.name_list_params,
('AuthorList' == list_name) and cfg.special_case_translation.author or cfg.special_case_translation.editor)); -- add error message
end
if true == lastfirst then return 1 end; -- return a number indicating which author name source to use
if utilities.is_set (vxxxxors) then return 2 end;
if utilities.is_set (xxxxors) then return 3 end;
return 1; -- no authors so return 1; this allows missing author name test to run in case there is a first without last
end
--[[--------------------------< I S _ V A L I D _ P A R A M E T E R _ V A L U E >------------------------------
This function is used to validate a parameter's assigned value for those parameters that have only a limited number
of allowable values (yes, y, true, live, dead, etc.). When the parameter value has not been assigned a value (missing
or empty in the source template) the function returns the value specified by ret_val. If the parameter value is one
of the list of allowed values returns the translated value; else, emits an error message and returns the value
specified by ret_val.
TODO: explain <invert>
]]
local function is_valid_parameter_value (value, name, possible, ret_val, invert)
if not utilities.is_set (value) then
return ret_val; -- an empty parameter is ok
end
if (not invert and utilities.in_array (value, possible)) then -- normal; <value> is in <possible> table
return cfg.keywords_xlate[value]; -- return translation of parameter keyword
elseif invert and not utilities.in_array (value, possible) then -- invert; <value> is not in <possible> table
return value; -- return <value> as it is
else
utilities.set_message ('err_invalid_param_val', {name, value}); -- not an allowed value so add error message
return ret_val;
end
end
--[[--------------------------< T E R M I N A T E _ N A M E _ L I S T >----------------------------------------
This function terminates a name list (author, contributor, editor) with a separator character (sepc) and a space
when the last character is not a sepc character or when the last three characters are not sepc followed by two
closing square brackets (close of a wikilink). When either of these is true, the name_list is terminated with a
single space character.
]]
local function terminate_name_list (name_list, sepc)
if (string.sub (name_list, -3, -1) == sepc .. '. ') then -- if already properly terminated
return name_list; -- just return the name list
elseif (string.sub (name_list, -1, -1) == sepc) or (string.sub (name_list, -3, -1) == sepc .. ']]') then -- if last name in list ends with sepc char
return name_list .. " "; -- don't add another
else
return name_list .. sepc .. ' '; -- otherwise terminate the name list
end
end
--[[-------------------------< F O R M A T _ V O L U M E _ I S S U E >-----------------------------------------
returns the concatenation of the formatted volume and issue (or journal article number) parameters as a single
string; or formatted volume or formatted issue, or an empty string if neither are set.
]]
local function format_volume_issue (volume, issue, article, cite_class, origin, sepc, lower)
if not utilities.is_set (volume) and not utilities.is_set (issue) and not utilities.is_set (article) then
return '';
end
-- same condition as in format_pages_sheets()
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
local is_numeric_vol = volume and (volume:match ('^[MDCLXVI]+$') or volume:match ('^%d+$')); -- is only uppercase roman numerals or only digits?
local is_long_vol = volume and (4 < mw.ustring.len(volume)); -- is |volume= value longer than 4 characters?
if volume and (not is_numeric_vol and is_long_vol) then -- when not all digits or Roman numerals, is |volume= longer than 4 characters?
utilities.add_prop_cat ('long-vol'); -- yes, add properties cat
end
if is_journal then -- journal-style formatting
local vol = '';
if utilities.is_set (volume) then
if is_numeric_vol then -- |volume= value all digits or all uppercase Roman numerals?
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, volume}); -- render in bold face
elseif is_long_vol then -- not all digits or Roman numerals; longer than 4 characters?
vol = utilities.substitute (cfg.messages['j-vol'], {sepc, utilities.hyphen_to_dash (volume)}); -- not bold
else -- four or fewer characters
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, utilities.hyphen_to_dash (volume)}); -- bold
end
end
vol = vol .. (utilities.is_set (issue) and utilities.substitute (cfg.messages['j-issue'], issue) or '')
vol = vol .. (utilities.is_set (article) and utilities.substitute (cfg.messages['j-article-num'], article) or '')
return vol;
end
if 'podcast' == cite_class and utilities.is_set (issue) then
return wrap_msg ('issue', {sepc, issue}, lower);
end
if 'conference' == cite_class and utilities.is_set (article) then -- |article-number= supported only in journal and conference cites
if utilities.is_set (volume) and utilities.is_set (article) then -- both volume and article number
return wrap_msg ('vol-art', {sepc, utilities.hyphen_to_dash (volume), article}, lower);
elseif utilities.is_set (article) then -- article number alone; when volume alone, handled below
return wrap_msg ('art', {sepc, article}, lower);
end
end
-- all other types of citation
if utilities.is_set (volume) and utilities.is_set (issue) then
return wrap_msg ('vol-no', {sepc, utilities.hyphen_to_dash (volume), issue}, lower);
elseif utilities.is_set (volume) then
return wrap_msg ('vol', {sepc, utilities.hyphen_to_dash (volume)}, lower);
else
return wrap_msg ('issue', {sepc, issue}, lower);
end
end
--[[-------------------------< F O R M A T _ P A G E S _ S H E E T S >-----------------------------------------
adds static text to one of |page(s)= or |sheet(s)= values and returns it with all of the others set to empty strings.
The return order is:
page, pages, sheet, sheets
Singular has priority over plural when both are provided.
]]
local function format_pages_sheets (page, pages, sheet, sheets, cite_class, origin, sepc, nopp, lower)
if 'map' == cite_class then -- only cite map supports sheet(s) as in-source locators
if utilities.is_set (sheet) then
if 'journal' == origin then
return '', '', wrap_msg ('j-sheet', sheet, lower), '';
else
return '', '', wrap_msg ('sheet', {sepc, sheet}, lower), '';
end
elseif utilities.is_set (sheets) then
if 'journal' == origin then
return '', '', '', wrap_msg ('j-sheets', sheets, lower);
else
return '', '', '', wrap_msg ('sheets', {sepc, sheets}, lower);
end
end
end
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
if utilities.is_set (page) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], page), '', '', '';
elseif not nopp then
return utilities.substitute (cfg.messages['p-prefix'], {sepc, page}), '', '', '';
else
return utilities.substitute (cfg.messages['nopp'], {sepc, page}), '', '', '';
end
elseif utilities.is_set (pages) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], pages), '', '', '';
elseif tonumber(pages) ~= nil and not nopp then -- if pages is only digits, assume a single page number
return '', utilities.substitute (cfg.messages['p-prefix'], {sepc, pages}), '', '';
elseif not nopp then
return '', utilities.substitute (cfg.messages['pp-prefix'], {sepc, pages}), '', '';
else
return '', utilities.substitute (cfg.messages['nopp'], {sepc, pages}), '', '';
end
end
return '', '', '', ''; -- return empty strings
end
--[[--------------------------< I N S O U R C E _ L O C _ G E T >----------------------------------------------
returns one of the in-source locators: page, pages, or at.
If any of these are interwiki links to Wikisource, returns the label portion of the interwiki-link as plain text
for use in COinS. This COinS thing is done because here we convert an interwiki-link to an external link and
add an icon span around that; get_coins_pages() doesn't know about the span. TODO: should it?
TODO: add support for sheet and sheets?; streamline;
TODO: make it so that this function returns only one of the three as the single in-source (the return value assigned
to a new name)?
]]
local function insource_loc_get (page, page_orig, pages, pages_orig, at)
local ws_url, ws_label, coins_pages, L; -- for Wikisource interwiki-links; TODO: this corrupts page metadata (span remains in place after cleanup; fix there?)
if utilities.is_set (page) then
if utilities.is_set (pages) or utilities.is_set (at) then
pages = ''; -- unset the others
at = '';
end
extra_text_in_page_check (page, page_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (page); -- make ws URL from |page= interwiki link; link portion L becomes tooltip label
if ws_url then
page = external_link (ws_url, ws_label .. ' ', 'ws link in page'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
page = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, page});
coins_pages = ws_label;
end
elseif utilities.is_set (pages) then
if utilities.is_set (at) then
at = ''; -- unset
end
extra_text_in_page_check (pages, pages_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (pages); -- make ws URL from |pages= interwiki link; link portion L becomes tooltip label
if ws_url then
pages = external_link (ws_url, ws_label .. ' ', 'ws link in pages'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
pages = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, pages});
coins_pages = ws_label;
end
elseif utilities.is_set (at) then
ws_url, ws_label, L = wikisource_url_make (at); -- make ws URL from |at= interwiki link; link portion L becomes tooltip label
if ws_url then
at = external_link (ws_url, ws_label .. ' ', 'ws link in at'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
at = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, at});
coins_pages = ws_label;
end
end
return page, pages, at, coins_pages;
end
--[[--------------------------< I S _ U N I Q U E _ A R C H I V E _ U R L >------------------------------------
add error message when |archive-url= value is same as |url= or chapter-url= (or alias...) value
]]
local function is_unique_archive_url (archive, url, c_url, source, date)
if utilities.is_set (archive) then
if archive == url or archive == c_url then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)}); -- add error message
return '', ''; -- unset |archive-url= and |archive-date= because same as |url= or |chapter-url=
end
end
return archive, date;
end
--[=[-------------------------< A R C H I V E _ U R L _ C H E C K >--------------------------------------------
Check archive.org URLs to make sure they at least look like they are pointing at valid archives and not to the
save snapshot URL or to calendar pages. When the archive URL is 'https://web.archive.org/save/' (or http://...)
archive.org saves a snapshot of the target page in the URL. That is something that Wikipedia should not allow
unwitting readers to do.
When the archive.org URL does not have a complete timestamp, archive.org chooses a snapshot according to its own
algorithm or provides a calendar 'search' result. [[WP:ELNO]] discourages links to search results.
This function looks at the value assigned to |archive-url= and returns empty strings for |archive-url= and
|archive-date= and an error message when:
|archive-url= holds an archive.org save command URL
|archive-url= is an archive.org URL that does not have a complete timestamp (YYYYMMDDhhmmss 14 digits) in the
correct place
otherwise returns |archive-url= and |archive-date=
There are two mostly compatible archive.org URLs:
//web.archive.org/<timestamp>... -- the old form
//web.archive.org/web/<timestamp>... -- the new form
The old form does not support or map to the new form when it contains a display flag. There are four identified flags
('id_', 'js_', 'cs_', 'im_') but since archive.org ignores others following the same form (two letters and an underscore)
we don't check for these specific flags but we do check the form.
This function supports a preview mode. When the article is rendered in preview mode, this function may return a modified
archive URL:
for save command errors, return undated wildcard (/*/)
for timestamp errors when the timestamp has a wildcard, return the URL unmodified
for timestamp errors when the timestamp does not have a wildcard, return with timestamp limited to six digits plus wildcard (/yyyymm*/)
A secondary function is to return an archive-url timestamp from those archive urls that have them. The timestamp
is used by validation.archive_date_check() to see if the value in |archive-date= matches the timestamp in the
archive url.
]=]
local function archive_url_check (url, date)
local err_msg = ''; -- start with the error message empty
local path, timestamp, flag; -- portions of the archive.org URL
local function is_ts_date_valid (timestamp, origin_date) -- local function to validate archive url taimestamp date; time ignored
local y, m, d = timestamp:match ('(%d%d%d%d)(%d%d)(%d%d)'); -- split into parts
if y and validation.is_valid_date (y, m, d) and (tonumber (y) >= 1996) then
return true, tonumber (y) >= origin_date; -- <origin_date> is 1996 for archive.org
end
end
if (not url:match('//web%.archive%.org/')) and (not url:match('//liveweb%.archive%.org/')) then -- also deprecated liveweb Wayback machine URL
return url, date; -- not an archive.org archive, return ArchiveURL and ArchiveDate
end
if url:match('//web%.archive%.org/save/') then -- if a save command URL, we don't want to allow saving of the target page
err_msg = cfg.err_msg_supl.save;
url = url:gsub ('(//web%.archive%.org)/save/', '%1/*/', 1); -- for preview mode: modify ArchiveURL
elseif url:match('//liveweb%.archive%.org/') then
err_msg = cfg.err_msg_supl.liveweb;
else
path, timestamp, flag = url:match('//web%.archive%.org/([^%d]*)(%d+)([^/]*)/'); -- split out some of the URL parts for evaluation
if not path then -- malformed in some way; pattern did not match
err_msg = cfg.err_msg_supl.timestamp;
elseif 14 ~= timestamp:len() then -- path and flag optional, must have 14-digit timestamp here
err_msg = cfg.err_msg_supl.timestamp;
if '*' ~= flag then
local replacement = timestamp:match ('^%d%d%d%d%d%d') or timestamp:match ('^%d%d%d%d'); -- get the first 6 (YYYYMM) or first 4 digits (YYYY)
if replacement then -- nil if there aren't at least 4 digits (year)
replacement = replacement .. string.rep ('0', 14 - replacement:len()); -- year or yearmo (4 or 6 digits) zero-fill to make 14-digit timestamp
url=url:gsub ('(//web%.archive%.org/[^%d]*)%d[^/]*', '%1' .. replacement .. '*', 1) -- for preview, modify ts to 14 digits plus splat for calendar display
end
end
elseif not is_ts_date_valid (timestamp, 1996) then -- is ymd portion of timestamp a valid date?
err_msg = cfg.err_msg_supl.timestamp;
timestamp = nil; -- unset because invalid
elseif utilities.is_set (path) and 'web/' ~= path then -- older archive URLs do not have the extra 'web/' path element
err_msg = cfg.err_msg_supl.path;
elseif utilities.is_set (flag) and not utilities.is_set (path) then -- flag not allowed with the old form URL (without the 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
elseif utilities.is_set (flag) and not flag:match ('%a%a_') then -- flag if present must be two alpha characters and underscore (requires 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
else
return url, date, timestamp; -- return ArchiveURL, ArchiveDate, and timestamp from |archive-url=
end
end
-- if here, something not right so
utilities.set_message ('err_archive_url', {err_msg}); -- add error message and
if is_preview_mode then
return url, date, timestamp; -- preview mode so return ArchiveURL, ArchiveDate, and timestamp from |archive-url=
else
return '', ''; -- return empty strings for ArchiveURL and ArchiveDate
end
end
--[[--------------------------< P L A C E _ C H E C K >--------------------------------------------------------
check |place=, |publication-place=, |location= to see if these params include digits. This function added because
many editors misuse location to specify the in-source location (|page(s)= and |at= are supposed to do that)
returns the original parameter value without modification; added maint cat when parameter value contains digits
]]
local function place_check (param_val)
if not utilities.is_set (param_val) then -- parameter empty or omitted
return param_val; -- return that empty state
end
if mw.ustring.find (param_val, '%d') then -- not empty, are there digits in the parameter value
utilities.set_message ('maint_location'); -- yep, add maint cat
end
return param_val; -- and done
end
--[[--------------------------< I S _ A R C H I V E D _ C O P Y >----------------------------------------------
compares |title= to 'Archived copy' (placeholder added by bots that can't find proper title); if matches, return true; nil else
]]
local function is_archived_copy (title)
title = mw.ustring.lower(title); -- switch title to lower case
if title:find (cfg.special_case_translation.archived_copy.en) then -- if title is 'Archived copy'
return true;
elseif cfg.special_case_translation.archived_copy['local'] then
if mw.ustring.find (title, cfg.special_case_translation.archived_copy['local']) then -- mw.ustring() because might not be Latin script
return true;
end
end
end
--[[--------------------------< D I S P L A Y _ N A M E S _ S E L E C T >--------------------------------------
for any of the |display-authors=, |display-editors=, etc parameters, select either the local or global setting.
When both are present, look at <local_display_names> value. When the value is some sort of 'et al.'string,
special handling is required.
When {{cs1 config}} has |display-<namelist>= AND this template has |display-<namelist>=etal AND:
the number of names specified by <number_of_names> is:
greater than the number specified in the global |display-<namelist>= parameter (<global_display_names>)
use global |display-<namelist>= parameter value
set overridden maint category
less than or equal to the number specified in the global |display-<namelist>= parameter
use local |display-<namelist>= parameter value
The purpose of this function is to prevent categorizing a template that has fewer names than the global setting
to keep the etal annotation specified by <local_display_names>.
]]
local function display_names_select (global_display_names, local_display_names, param_name, number_of_names, test)
if global_display_names and utilities.is_set (local_display_names) then -- when both
if 'etal' == local_display_names:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
number_of_names = tonumber (number_of_names); -- convert these to numbers for comparison
local global_display_names_num = tonumber (global_display_names); -- <global_display_names> not set when parameter value is not digits
if number_of_names > global_display_names_num then -- template has more names than global config allows to be displayed?
utilities.set_message ('maint_overridden_setting'); -- set a maint message because global is overriding local |display-<namelist>=etal
return global_display_names, 'cs1 config'; -- return global with spoof parameter name (for get_display_names())
else
return local_display_names, param_name; -- return local because fewer names so let <local_display_names> control
end
end
-- here when <global_display_names> and <local_display_names> both numbers; <global_display_names> controls
utilities.set_message ('maint_overridden_setting'); -- set a maint message
return global_display_names, 'cs1 config'; -- return global with spoof parameter name (for get_display_names())
end
-- here when only one of <global_display_names> or <local_display_names> set
if global_display_names then
return global_display_names, 'cs1 config'; -- return global with spoof parameter name (for get_display_names())
else
return local_display_names, param_name; -- return local
end
end
--[[--------------------------< M O D E _ S E T >--------------------------------------------------------------
fetch global mode setting from {{cs1 config}} (if present) or from |mode= (if present); global setting overrides
local |mode= parameter value. When both are present, emit maintenance message
]]
local function mode_set (Mode, Mode_origin)
local mode;
if cfg.global_cs1_config_t['Mode'] then -- global setting in {{cs1 config}}; nil when empty or assigned value invalid
mode = is_valid_parameter_value (cfg.global_cs1_config_t['Mode'], 'cs1 config: mode', cfg.keywords_lists['mode'], ''); -- error messaging 'param' here is a hoax
else
mode = is_valid_parameter_value (Mode, Mode_origin, cfg.keywords_lists['mode'], '');
end
if cfg.global_cs1_config_t['Mode'] and utilities.is_set (Mode) then -- when template has |mode=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
return mode;
end
--[[--------------------------< Q U O T E _ M A K E >----------------------------------------------------------
create quotation from |quote=, |trans-quote=, and/or script-quote= with or without |quote-page= or |quote-pages=
when any of those three quote parameters are set, this function unsets <PostScript>. When none of those parameters
are set, |quote-page= and |quote-pages= are unset to nil so that they are not included in the template's metadata
]]
local function quote_make (quote, trans_quote, script_quote, quote_page, quote_pages, nopp, sepc, postscript)
if utilities.is_set (quote) or utilities.is_set (trans_quote) or utilities.is_set (script_quote) then
if utilities.is_set (quote) then
if quote:sub(1, 1) == '"' and quote:sub(-1, -1) == '"' then -- if first and last characters of quote are quote marks
quote = quote:sub(2, -2); -- strip them off
end
end
quote = kern_quotes (quote); -- kern if needed
quote = utilities.wrap_style ('quoted-text', quote ); -- wrap in <q>...</q> tags
if utilities.is_set (script_quote) then
quote = script_concatenate (quote, script_quote, 'script-quote'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after quote is wrapped
end
if utilities.is_set (trans_quote) then
if trans_quote:sub(1, 1) == '"' and trans_quote:sub(-1, -1) == '"' then -- if first and last characters of |trans-quote are quote marks
trans_quote = trans_quote:sub(2, -2); -- strip them off
end
quote = quote .. " " .. utilities.wrap_style ('trans-quoted-title', trans_quote );
end
if utilities.is_set (quote_page) or utilities.is_set (quote_pages) then -- add page prefix
local quote_prefix = '';
if utilities.is_set (quote_page) then
extra_text_in_page_check (quote_page, 'quote-page'); -- add to maint cat if |quote-page= value begins with what looks like p., pp., etc.
if not nopp then
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, quote_page}), '', '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, quote_page}), '', '', '';
end
elseif utilities.is_set (quote_pages) then
extra_text_in_page_check (quote_pages, 'quote-pages'); -- add to maint cat if |quote-pages= value begins with what looks like p., pp., etc.
if tonumber(quote_pages) ~= nil and not nopp then -- if only digits, assume single page
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, quote_pages}), '', '';
elseif not nopp then
quote_prefix = utilities.substitute (cfg.messages['pp-prefix'], {sepc, quote_pages}), '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, quote_pages}), '', '';
end
end
quote = quote_prefix .. ": " .. quote;
else
quote = sepc .. " " .. quote;
end
postscript = ""; -- cs1|2 does not supply terminal punctuation when |quote= is set
elseif utilities.is_set (quote_page) or utilities.is_set (quote_pages) then
quote_page = nil; -- unset; these require |quote=; TODO: error message?
quote_pages = nil;
end
return quote, quote_page, quote_pages, postscript;
end
--[[--------------------------< C H E C K _ P U B L I S H E R _ N A M E >--------------------------------------
look for variations of '<text>: <text>' that might be '<location>: <publisher>' in |publisher= parameter value.
when found, emit a maintenance message; return nil else
<publisher> is the value assigned to |publisher= or |institution=
]]
local function check_publisher_name (publisher)
local patterns_t = {
'^[%w%s]+%s*:%s*[%w%s]+$', -- plain text <location>: <publisher>
'^%[+[%w%s:|]+%]+%s*:%s*[%w%s]+$', -- partially wikilinked [[<location>]]: <publisher>
'^[%w%s]+%s*:%s*%[+[%w%s:|]+%]+$', -- partially wikilinked <location>: [[<publisher>]]
'^%[+[%w%s:|]+%]+%s*:%s*%[+[%w%s:|]+%]+$', -- wikilinked [[<location>]]: [[<publisher>]]
}
for _, pattern in ipairs (patterns_t) do -- spin through the patterns_t sequence
if mw.ustring.match (publisher, pattern) then -- does this pattern match?
utilities.set_message ('maint_publisher_location'); -- set a maint message
return; -- and done
end
end
end
--[[--------------------------< I S _ P A G E _ A R T _ N U M >------------------------------------------------
compare the trailing (rightmost) characters of the |doi= value against the whole value assigned to |page(s)=.
return boolean true when:
|page(s)= has exactly 8 digits and a dot between the fourth and fifth digits matches the trailing 9 characters
of the |doi= value: |page=12345678 → |page=1234.5678 matches |doi=10.xxxx/yyyy1234.5678
|page(s)= is 5 or more characters and matches |doi= values's trailing characters
|page(s)= begins with a lowercase 'e' and |page(s)= without the 'e' matches |doi= values's trailing
characters: |page=e12345 → |page=12345 matches |doi=10.xxxx/yyyy12345
|page(s)= begins with a uppercase 'CD' followed by (typically) six digits matches |doi= values that ends with
'CDxxxxxx.pubx' (where 'x' is any single digit)
return nil when |page(s)= values:
are ranges separated by underscore, hyphen, emdash, endash, figure dash, or minus character
are comma- or semicolon-separated lists of pages
have external urls (has text 'http')
are digit-only values less than 10000
do not match |doi= values's trailing characters
]]
local function is_page_art_num (page, doi)
if not (utilities.is_set (page) and utilities.is_set (doi)) then -- both required
return; -- abandon; nothing to do
end
if page:match ('[,;_−–—‒%-]') then -- when |page(s)= might be a page range or a separated list of pages
return; -- abandon
end
page = page:lower(); -- because doi names are case insensitive
doi = doi:lower(); -- force these to lowercase for testing
if page:match ('http') then -- when |page(s)= appears to hold a url
return; -- abandon
end
if tonumber (page) then -- is |page(s)= digits only
if 10000 > tonumber (page) then -- when |page(s)= less than 10000
return; -- abandon
end
if doi:match (page .. '$') then -- digits only page number match the last digits in |doi=?
return true;
end
if 8 == page:len() then -- special case when |page(s)= is exactly 8 digits
local dot_page = page:gsub ('(%d%d%d%d)(%d%d%d%d)', '%1.%2'); -- make a |page=xxxx.yyyy version commonly used in |doi=
if doi:match (dot_page .. '$') then -- 8-digit dotted page number match the last characters in |doi=?
return true;
end
end
else -- here when |page(s)= is alpha-numeric
if 4 < page:len() then -- when |page(s)= is five or more characters
if doi:match (page .. '$') then -- alpha-numeric page match the last characters in |doi=?
return true;
end
local epage = page:match ('^e([%w]+)$'); -- if first character of |page= is 'e', remove it
if epage and doi:match (epage .. '$') then -- page number match the last characters in |doi=?
return true;
end
local cdpage = page:match ('^cd%d+$'); -- if first characters of |page= are 'CD' and last characters are digits (typically 6 digits)
if cdpage and doi:match (cdpage .. '%.pub%d$') then -- page number matches doi 'CDxxxxxx.pubx' where 'x' is a digit
return true;
end
end
end
end
--[[--------------------------< C I T A T I O N 0 >------------------------------------------------------------
This is the main function doing the majority of the citation formatting.
]]
local function citation0( config, args )
--[[
Load Input Parameters
The argument_wrapper facilitates the mapping of multiple aliases to single internal variable.
]]
local A = argument_wrapper ( args );
local i
-- Pick out the relevant fields from the arguments. Different citation templates
-- define different field names for the same underlying things.
local author_etal;
local a = {}; -- authors list from |lastn= / |firstn= pairs or |vauthors=
local Authors;
local NameListStyle;
if cfg.global_cs1_config_t['NameListStyle'] then -- global setting in {{cs1 config}} overrides local |name-list-style= parameter value; nil when empty or assigned value invalid
NameListStyle = is_valid_parameter_value (cfg.global_cs1_config_t['NameListStyle'], 'cs1 config: name-list-style', cfg.keywords_lists['name-list-style'], ''); -- error messaging 'param' here is a hoax
else
NameListStyle = is_valid_parameter_value (A['NameListStyle'], A:ORIGIN('NameListStyle'), cfg.keywords_lists['name-list-style'], '');
end
if cfg.global_cs1_config_t['NameListStyle'] and utilities.is_set (A['NameListStyle']) then -- when template has |name-list-style=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
local Collaboration = A['Collaboration'];
do -- to limit scope of selected
local selected = select_author_editor_source (A['Vauthors'], A['Authors'], args, 'AuthorList');
if 1 == selected then
a, author_etal = extract_names (args, 'AuthorList'); -- fetch author list from |authorn= / |lastn= / |firstn=, |author-linkn=, and |author-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
a, author_etal = parse_vauthors_veditors (args, A['Vauthors'], 'AuthorList'); -- fetch author list from |vauthors=, |author-linkn=, and |author-maskn=
elseif 3 == selected then
Authors = A['Authors']; -- use content of |people= or |credits=; |authors= is deprecated; TODO: constrain |people= and |credits= to cite av media, episode, serial?
end
if utilities.is_set (Collaboration) then
author_etal = true; -- so that |display-authors=etal not required
end
end
local editor_etal;
local e = {}; -- editors list from |editor-lastn= / |editor-firstn= pairs or |veditors=
do -- to limit scope of selected
local selected = select_author_editor_source (A['Veditors'], nil, args, 'EditorList'); -- support for |editors= withdrawn
if 1 == selected then
e, editor_etal = extract_names (args, 'EditorList'); -- fetch editor list from |editorn= / |editor-lastn= / |editor-firstn=, |editor-linkn=, and |editor-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
e, editor_etal = parse_vauthors_veditors (args, args.veditors, 'EditorList'); -- fetch editor list from |veditors=, |editor-linkn=, and |editor-maskn=
end
end
local Chapter = A['Chapter']; -- done here so that we have access to |contribution= from |chapter= and |script-chapter= aliases
local Chapter_origin = A:ORIGIN ('Chapter');
local ScriptChapter = A['ScriptChapter'];
local ScriptChapter_origin = A:ORIGIN ('ScriptChapter');
local Contribution; -- because contribution is required for contributor(s)
if 'contribution' == Chapter_origin then -- is there a |contribution= parameter?
Contribution = Chapter; -- get the name of the contribution
elseif 'script-contribution' == ScriptChapter_origin then -- no, so is there a |script-contribution= parameter?
Contribution = ScriptChapter; -- get the name of the contribution
end
local c = {}; -- contributors list from |contributor-lastn= / contributor-firstn= pairs
if utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (A['Periodical']) then -- |contributor= and |contribution= only supported in book cites
c = extract_names (args, 'ContributorList'); -- fetch contributor list from |contributorn= / |contributor-lastn=, -firstn=, -linkn=, -maskn=
if 0 < #c then
if not utilities.is_set (Contribution) then -- |contributor= requires |contribution=
utilities.set_message ('err_contributor_missing_required_param', 'contribution'); -- add missing contribution error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
if 0 == #a then -- |contributor= requires |author=
utilities.set_message ('err_contributor_missing_required_param', 'author'); -- add missing author error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
end
else -- if not a book cite
if utilities.select_one (args, cfg.aliases['ContributorList-Last'], 'err_redundant_parameters', 1 ) then -- are there contributor name list parameters?
utilities.set_message ('err_contributor_ignored'); -- add contributor ignored error message
end
Contribution = nil; -- unset
end
local Title = A['Title'];
local TitleLink = A['TitleLink'];
local auto_select = ''; -- default is auto
local accept_link;
TitleLink, accept_link = utilities.has_accept_as_written (TitleLink, true); -- test for accept-this-as-written markup
if (not accept_link) and utilities.in_array (TitleLink, {'none', 'pmc', 'doi'}) then -- check for special keywords
auto_select = TitleLink; -- remember selection for later
TitleLink = ''; -- treat as if |title-link= would have been empty
end
TitleLink = link_title_ok (TitleLink, A:ORIGIN ('TitleLink'), Title, 'title'); -- check for wiki-markup in |title-link= or wiki-markup in |title= when |title-link= is set
local Section = ''; -- {{cite map}} only; preset to empty string for concatenation if not used
if 'map' == config.CitationClass and 'section' == Chapter_origin then
Section = A['Chapter']; -- get |section= from |chapter= alias list; |chapter= and the other aliases not supported in {{cite map}}
Chapter = ''; -- unset for now; will be reset later from |map= if present
end
local Periodical = A['Periodical'];
local Periodical_origin = A:ORIGIN('Periodical');
local ScriptPeriodical = A['ScriptPeriodical'];
local ScriptPeriodical_origin = A:ORIGIN('ScriptPeriodical');
local TransPeriodical = A['TransPeriodical'];
local TransPeriodical_origin = A:ORIGIN ('TransPeriodical');
if (utilities.in_array (config.CitationClass, {'book', 'encyclopaedia'}) and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (TransPeriodical))) then
local param;
if utilities.is_set (Periodical) then -- get a parameter name from one of these periodical related meta-parameters
Periodical = ''; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = Periodical_origin -- get parameter name for error messaging
elseif utilities.is_set (TransPeriodical) then
TransPeriodical = ''; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = TransPeriodical_origin; -- get parameter name for error messaging
elseif utilities.is_set (ScriptPeriodical) then
ScriptPeriodical = ''; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = ScriptPeriodical_origin; -- get parameter name for error messaging
end
if utilities.is_set (param) then -- if we found one
utilities.set_message ('err_periodical_ignored', {param}); -- emit an error message
end
end
if utilities.is_set (Periodical) then
local i;
Periodical, i = utilities.strip_apostrophe_markup (Periodical); -- strip apostrophe markup so that metadata isn't contaminated
if i then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {Periodical_origin});
end
end
if 'mailinglist' == config.CitationClass then -- special case for {{cite mailing list}}
if utilities.is_set (Periodical) and utilities.is_set (A ['MailingList']) then -- both set emit an error TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', Periodical_origin) .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'mailinglist')});
end
Periodical = A ['MailingList']; -- error or no, set Periodical to |mailinglist= value because this template is {{cite mailing list}}
Periodical_origin = A:ORIGIN('MailingList');
end
-- web and news not tested for now because of
-- Wikipedia:Administrators%27_noticeboard#Is_there_a_semi-automated_tool_that_could_fix_these_annoying_"Cite_Web"_errors?
if not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) then -- 'periodical' templates require periodical parameter
-- local p = {['journal'] = 'journal', ['magazine'] = 'magazine', ['news'] = 'newspaper', ['web'] = 'website'}; -- for error message
local p = {['journal'] = 'journal', ['magazine'] = 'magazine'}; -- for error message
if p[config.CitationClass] then
utilities.set_message ('err_missing_periodical', {config.CitationClass, p[config.CitationClass]});
end
end
local Volume;
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) then
if not utilities.in_array (Periodical_origin, cfg.citation_no_volume_t) then -- {{citation}} does not render |volume= when these parameters are used
Volume = A['Volume']; -- but does for all other 'periodicals'
end
elseif utilities.is_set (ScriptPeriodical) then
if 'script-website' ~= ScriptPeriodical_origin then -- {{citation}} does not render volume for |script-website=
Volume = A['Volume']; -- but does for all other 'periodicals'
end
else
Volume = A['Volume']; -- and does for non-'periodical' cites
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_volume) then -- render |volume= for cs1 according to the configuration settings
Volume = A['Volume'];
end
extra_text_in_vol_iss_check (Volume, A:ORIGIN ('Volume'), 'v');
local Issue;
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) and utilities.in_array (Periodical_origin, cfg.citation_issue_t) then -- {{citation}} may render |issue= when these parameters are used
Issue = A['Issue'];
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_issue) then -- conference & map books do not support issue; {{citation}} listed here because included in settings table
if not (utilities.in_array (config.CitationClass, {'conference', 'map', 'citation'}) and not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical))) then
Issue = A['Issue'];
end
end
local ArticleNumber;
if utilities.in_array (config.CitationClass, {'journal', 'conference'}) or ('citation' == config.CitationClass and utilities.is_set (Periodical) and 'journal' == Periodical_origin) then
ArticleNumber = A['ArticleNumber'];
end
extra_text_in_vol_iss_check (Issue, A:ORIGIN ('Issue'), 'i');
Issue = utilities.hyphen_to_dash (Issue);
local Page;
local Pages;
local At;
local QuotePage;
local QuotePages;
if not utilities.in_array (config.CitationClass, cfg.templates_not_using_page) then -- TODO: rewrite to emit ignored parameter error message?
Page = A['Page'];
Pages = utilities.hyphen_to_dash (A['Pages']);
At = A['At'];
QuotePage = A['QuotePage'];
QuotePages = utilities.hyphen_to_dash (A['QuotePages']);
end
local NoPP = is_valid_parameter_value (A['NoPP'], A:ORIGIN('NoPP'), cfg.keywords_lists['yes_true_y'], nil);
local Mode = mode_set (A['Mode'], A:ORIGIN('Mode'));
-- separator character and postscript
local sepc, PostScript = set_style (Mode:lower(), A['PostScript'], config.CitationClass);
local Quote;
Quote, QuotePage, QuotePages, PostScript = quote_make (A['Quote'], A['TransQuote'], A['ScriptQuote'], QuotePage, QuotePages, NoPP, sepc, PostScript);
local Edition = A['Edition'];
local PublicationPlace = place_check (A['PublicationPlace'], A:ORIGIN('PublicationPlace'));
local Place = place_check (A['Place'], A:ORIGIN('Place'));
local PublisherName = A['PublisherName'];
local PublisherName_origin = A:ORIGIN('PublisherName');
if utilities.is_set (PublisherName) and (cfg.keywords_xlate['none'] ~= PublisherName) then
local i = 0;
PublisherName, i = utilities.strip_apostrophe_markup (PublisherName); -- strip apostrophe markup so that metadata isn't contaminated; publisher is never italicized
if i and (0 < i) then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {PublisherName_origin});
end
end
if ('document' == config.CitationClass) and not utilities.is_set (PublisherName) then
utilities.set_message ('err_missing_publisher', {config.CitationClass, 'publisher'});
end
local Newsgroup = A['Newsgroup']; -- TODO: strip apostrophe markup?
local Newsgroup_origin = A:ORIGIN('Newsgroup');
if 'newsgroup' == config.CitationClass then
if utilities.is_set (PublisherName) and (cfg.keywords_xlate['none'] ~= PublisherName) then -- general use parameter |publisher= not allowed in cite newsgroup
utilities.set_message ('err_parameter_ignored', {PublisherName_origin});
end
PublisherName = nil; -- ensure that this parameter is unset for the time being; will be used again after COinS
end
if 'book' == config.CitationClass or 'encyclopaedia' == config.CitationClass or ('citation' == config.CitationClass and not utilities.is_set (Periodical)) then
local accept;
PublisherName, accept = utilities.has_accept_as_written (PublisherName); -- check for and remove accept-as-written markup from |publisher= wrapped
if not accept then -- when no accept-as-written markup
check_publisher_name (PublisherName); -- emit maint message when |publisher= might be prefixed with publisher's location
end
end
local URL = A['URL']; -- TODO: better way to do this for URL, ChapterURL, and MapURL?
local UrlAccess = is_valid_parameter_value (A['UrlAccess'], A:ORIGIN('UrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (URL) and utilities.is_set (UrlAccess) then
UrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', 'url');
end
local ChapterURL = A['ChapterURL'];
local ChapterUrlAccess = is_valid_parameter_value (A['ChapterUrlAccess'], A:ORIGIN('ChapterUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (ChapterURL) and utilities.is_set (ChapterUrlAccess) then
ChapterUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {A:ORIGIN('ChapterUrlAccess'):gsub ('%-access', '')});
end
local MapUrlAccess = is_valid_parameter_value (A['MapUrlAccess'], A:ORIGIN('MapUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (A['MapURL']) and utilities.is_set (MapUrlAccess) then
MapUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {'map-url'});
end
local this_page = mw.title.getCurrentTitle(); -- also used for COinS and for language
local no_tracking_cats = is_valid_parameter_value (A['NoTracking'], A:ORIGIN('NoTracking'), cfg.keywords_lists['yes_true_y'], nil);
-- check this page to see if it is in one of the namespaces that cs1 is not supposed to add to the error categories
if not utilities.is_set (no_tracking_cats) then -- ignore if we are already not going to categorize this page
if cfg.uncategorized_namespaces[this_page.namespace] then -- is this page's namespace id one of the uncategorized namespace ids?
no_tracking_cats = "true"; -- set no_tracking_cats
end
for _, v in ipairs (cfg.uncategorized_subpages) do -- cycle through page name patterns
if this_page.text:match (v) then -- test page name against each pattern
no_tracking_cats = "true"; -- set no_tracking_cats
break; -- bail out if one is found
end
end
end
-- check for extra |page=, |pages= or |at= parameters. (also sheet and sheets while we're at it)
utilities.select_one (args, {'page', 'p', 'pp', 'pages', 'at', 'sheet', 'sheets'}, 'err_redundant_parameters'); -- this is a dummy call simply to get the error message and category
local coins_pages;
Page, Pages, At, coins_pages = insource_loc_get (Page, A:ORIGIN('Page'), Pages, A:ORIGIN('Pages'), At);
if utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- both |publication-place= and |place= (|location=) allowed if different
utilities.add_prop_cat ('location-test'); -- add property cat to evaluate how often PublicationPlace and Place are used together
if PublicationPlace == Place then
Place = ''; -- unset; don't need both if they are the same
end
elseif not utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- when only |place= (|location=) is set ...
PublicationPlace = Place; -- promote |place= (|location=) to |publication-place
end
if PublicationPlace == Place then Place = ''; end -- don't need both if they are the same
local URL_origin = A:ORIGIN('URL'); -- get name of parameter that holds URL
local ChapterURL_origin = A:ORIGIN('ChapterURL'); -- get name of parameter that holds ChapterURL
-- local ScriptChapter = A['ScriptChapter'];
-- local ScriptChapter_origin = A:ORIGIN ('ScriptChapter');
local Format = A['Format'];
local ChapterFormat = A['ChapterFormat'];
local TransChapter = A['TransChapter'];
local TransChapter_origin = A:ORIGIN ('TransChapter');
local TransTitle = A['TransTitle'];
local ScriptTitle = A['ScriptTitle'];
--[[
Parameter remapping for cite encyclopedia:
When the citation has these parameters:
|encyclopedia= and |title= then map |title= to |article= and |encyclopedia= to |title= for rendering
|encyclopedia= and |article= then map |encyclopedia= to |title= for rendering
|trans-title= maps to |trans-chapter= when |title= is re-mapped
|url= maps to |chapter-url= when |title= is remapped
All other combinations of |encyclopedia=, |title=, and |article= are not modified
]]
local Encyclopedia = A['Encyclopedia']; -- used as a flag by this module and by ~/COinS
local ScriptEncyclopedia = A['ScriptEncyclopedia'];
local TransEncyclopedia = A['TransEncyclopedia'];
if utilities.is_set (Encyclopedia) or utilities.is_set (ScriptEncyclopedia) then -- emit error message when Encyclopedia set but template is other than {{cite encyclopedia}} or {{citation}}
if 'encyclopaedia' ~= config.CitationClass and 'citation' ~= config.CitationClass then
if utilities.is_set (Encyclopedia) then
utilities.set_message ('err_parameter_ignored', {A:ORIGIN ('Encyclopedia')});
else
utilities.set_message ('err_parameter_ignored', {A:ORIGIN ('ScriptEncyclopedia')});
end
Encyclopedia = nil; -- unset these because not supported by this template
ScriptEncyclopedia = nil;
TransEncyclopedia = nil;
end
elseif utilities.is_set (TransEncyclopedia) then
utilities.set_message ('err_trans_missing_title', {'encyclopedia'});
end
if ('encyclopaedia' == config.CitationClass) or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Periodical) and utilities.is_set (Encyclopedia) then -- when both parameters set emit an error message; {{citation}} only; Periodical not allowed in {{cite encyclopedia}}
utilities.set_message ('err_periodical_ignored', {Periodical_origin});
end
if utilities.is_set (Encyclopedia) or utilities.is_set (ScriptEncyclopedia) then
Periodical = Encyclopedia; -- error or no, set Periodical to Encyclopedia for rendering; {{citation}} could (not legitimately) have both; use Encyclopedia
Periodical_origin = A:ORIGIN ('Encyclopedia');
ScriptPeriodical = ScriptEncyclopedia;
ScriptPeriodical_origin = A:ORIGIN ('ScriptEncyclopedia');
if utilities.is_set (Title) or utilities.is_set (ScriptTitle) then
if not utilities.is_set (Chapter) then
Chapter = Title; -- |encyclopedia= and |title= are set so map |title= params to |article= params for rendering
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle')
TransChapter = TransTitle;
ChapterURL = URL;
ChapterURL_origin = URL_origin;
ChapterUrlAccess = UrlAccess;
ChapterFormat = Format;
if not utilities.is_set (ChapterURL) and utilities.is_set (TitleLink) then
Chapter = utilities.make_wikilink (TitleLink, Chapter);
end
Title = Periodical; -- now map |encyclopedia= params to |title= params for rendering
ScriptTitle = ScriptPeriodical or '';
TransTitle = TransEncyclopedia or '';
Periodical = ''; -- redundant so unset
ScriptPeriodical = '';
URL = '';
Format = '';
TitleLink = '';
end
elseif utilities.is_set (Chapter) or utilities.is_set (ScriptChapter) then -- |title= not set
Title = Periodical; -- |encyclopedia= set and |article= set so map |encyclopedia= to |title= for rendering
ScriptTitle = ScriptPeriodical or '';
TransTitle = TransEncyclopedia or '';
Periodical = ''; -- redundant so unset
ScriptPeriodical = '';
end
end
end
-- special case for cite techreport.
local ID = A['ID'];
if (config.CitationClass == "techreport") then -- special case for cite techreport
if utilities.is_set (A['Number']) then -- cite techreport uses 'number', which other citations alias to 'issue'
if not utilities.is_set (ID) then -- can we use ID for the "number"?
ID = A['Number']; -- yes, use it
else -- ID has a value so emit error message
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'id') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'number')});
end
end
end
-- Account for the oddity that is {{cite conference}}, before generation of COinS data.
local ChapterLink -- = A['ChapterLink']; -- deprecated as a parameter but still used internally by cite episode
local Conference = A['Conference'];
local BookTitle = A['BookTitle'];
local TransTitle_origin = A:ORIGIN ('TransTitle');
if 'conference' == config.CitationClass then
if utilities.is_set (BookTitle) then
Chapter = Title;
Chapter_origin = 'title';
-- ChapterLink = TitleLink; -- |chapter-link= is deprecated
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
URL_origin = '';
ChapterFormat = Format;
TransChapter = TransTitle;
TransChapter_origin = TransTitle_origin;
Title = BookTitle;
Format = '';
-- TitleLink = '';
TransTitle = '';
URL = '';
end
elseif 'speech' ~= config.CitationClass then
Conference = ''; -- not cite conference or cite speech so make sure this is empty string
end
local cs2_lower = function (text) -- if mode is cs2, use lower case
if (sepc ~= '.') then
return text:lower();
end
return text;
end
local use_lowercase = ( sepc == ',' ); -- controls capitalization of certain static text
-- cite map oddities
local Cartography = "";
local Scale = "";
local Sheet = A['Sheet'] or '';
local Sheets = A['Sheets'] or '';
if config.CitationClass == "map" then
if utilities.is_set (Chapter) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'map') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', Chapter_origin)}); -- add error message
end
Chapter = A['Map'];
Chapter_origin = A:ORIGIN('Map');
ChapterURL = A['MapURL'];
ChapterURL_origin = A:ORIGIN('MapURL');
TransChapter = A['TransMap'];
ScriptChapter = A['ScriptMap']
ScriptChapter_origin = A:ORIGIN('ScriptMap')
ChapterUrlAccess = MapUrlAccess;
ChapterFormat = A['MapFormat'];
Cartography = A['Cartography'];
if utilities.is_set ( Cartography ) then
Cartography = sepc .. " " .. wrap_msg ('cartography', Cartography, use_lowercase);
end
Scale = A['Scale'];
if utilities.is_set ( Scale ) then
Scale = sepc .. " " .. Scale;
end
end
-- Account for the oddities that are {{cite episode}} and {{cite serial}}, before generation of COinS data.
local Series = A['Series'];
if 'episode' == config.CitationClass or 'serial' == config.CitationClass then
local SeriesLink = A['SeriesLink'];
SeriesLink = link_title_ok (SeriesLink, A:ORIGIN ('SeriesLink'), Series, 'series'); -- check for wiki-markup in |series-link= or wiki-markup in |series= when |series-link= is set
local Network = A['Network'];
local Station = A['Station'];
local s, n = {}, {};
-- do common parameters first
if utilities.is_set (Network) then table.insert(n, Network); end
if utilities.is_set (Station) then table.insert(n, Station); end
ID = table.concat(n, sepc .. ' ');
if 'episode' == config.CitationClass then -- handle the oddities that are strictly {{cite episode}}
local Season = A['Season'];
local SeriesNumber = A['SeriesNumber'];
if utilities.is_set (Season) and utilities.is_set (SeriesNumber) then -- these are mutually exclusive so if both are set TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'season') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'seriesno')}); -- add error message
SeriesNumber = ''; -- unset; prefer |season= over |seriesno=
end
-- assemble a table of parts concatenated later into Series
if utilities.is_set (Season) then table.insert(s, wrap_msg ('season', Season, use_lowercase)); end
if utilities.is_set (SeriesNumber) then table.insert(s, wrap_msg ('seriesnum', SeriesNumber, use_lowercase)); end
if utilities.is_set (Issue) then table.insert(s, wrap_msg ('episode', Issue, use_lowercase)); end
Issue = ''; -- unset because this is not a unique parameter
Chapter = Title; -- promote title parameters to chapter
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle');
ChapterLink = TitleLink; -- alias |episode-link=
TransChapter = TransTitle;
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
ChapterFormat = Format;
Title = Series; -- promote series to title
TitleLink = SeriesLink;
Series = table.concat(s, sepc .. ' '); -- this is concatenation of season, seriesno, episode number
if utilities.is_set (ChapterLink) and not utilities.is_set (ChapterURL) then -- link but not URL
Chapter = utilities.make_wikilink (ChapterLink, Chapter);
elseif utilities.is_set (ChapterLink) and utilities.is_set (ChapterURL) then -- if both are set, URL links episode;
Series = utilities.make_wikilink (ChapterLink, Series);
end
URL = ''; -- unset
TransTitle = '';
ScriptTitle = '';
Format = '';
else -- now oddities that are cite serial
Issue = ''; -- unset because this parameter no longer supported by the citation/core version of cite serial
Chapter = A['Episode']; -- TODO: make |episode= available to cite episode someday?
if utilities.is_set (Series) and utilities.is_set (SeriesLink) then
Series = utilities.make_wikilink (SeriesLink, Series);
end
Series = utilities.wrap_style ('italic-title', Series); -- series is italicized
end
end
-- end of {{cite episode}} stuff
-- handle type parameter for those CS1 citations that have default values
local TitleType = A['TitleType'];
local Degree = A['Degree'];
if utilities.in_array (config.CitationClass, {'AV-media-notes', 'document', 'interview', 'mailinglist', 'map', 'podcast', 'pressrelease', 'report', 'speech', 'techreport', 'thesis'}) then
TitleType = set_titletype (config.CitationClass, TitleType);
if utilities.is_set (Degree) and "Thesis" == TitleType then -- special case for cite thesis
TitleType = Degree .. ' ' .. cfg.title_types ['thesis']:lower();
end
end
if utilities.is_set (TitleType) then -- if type parameter is specified
TitleType = utilities.substitute ( cfg.messages['type'], TitleType); -- display it in parentheses
-- TODO: Hack on TitleType to fix bunched parentheses problem
end
-- legacy: promote PublicationDate to Date if neither Date nor Year are set.
local Date = A['Date'];
local Date_origin; -- to hold the name of parameter promoted to Date; required for date error messaging
local PublicationDate = A['PublicationDate'];
local Year = A['Year'];
if utilities.is_set (Year) then
validation.year_check (Year); -- returns nothing; emits maint message when |year= doesn't hold a 'year' value
end
if not utilities.is_set (Date) then
Date = Year; -- promote Year to Date
Year = nil; -- make nil so Year as empty string isn't used for CITEREF
if not utilities.is_set (Date) and utilities.is_set (PublicationDate) then -- use PublicationDate when |date= and |year= are not set
Date = PublicationDate; -- promote PublicationDate to Date
PublicationDate = ''; -- unset, no longer needed
Date_origin = A:ORIGIN('PublicationDate'); -- save the name of the promoted parameter
else
Date_origin = A:ORIGIN('Year'); -- save the name of the promoted parameter
end
else
Date_origin = A:ORIGIN('Date'); -- not a promotion; name required for error messaging
end
if PublicationDate == Date then PublicationDate = ''; end -- if PublicationDate is same as Date, don't display in rendered citation
--[[
Go test all of the date-holding parameters for valid MOS:DATE format and make sure that dates are real dates. This must be done before we do COinS because here is where
we get the date used in the metadata.
Date validation supporting code is in Module:Citation/CS1/Date_validation
]]
local DF = is_valid_parameter_value (A['DF'], A:ORIGIN('DF'), cfg.keywords_lists['df'], '');
if not utilities.is_set (DF) then
DF = cfg.global_df; -- local |df= if present overrides global df set by {{use xxx date}} template
end
local ArchiveURL;
local ArchiveDate;
local ArchiveFormat = A['ArchiveFormat'];
local archive_url_timestamp; -- timestamp from wayback machine url
ArchiveURL, ArchiveDate, archive_url_timestamp = archive_url_check (A['ArchiveURL'], A['ArchiveDate'])
ArchiveFormat = style_format (ArchiveFormat, ArchiveURL, 'archive-format', 'archive-url');
ArchiveURL, ArchiveDate = is_unique_archive_url (ArchiveURL, URL, ChapterURL, A:ORIGIN('ArchiveURL'), ArchiveDate); -- add error message when URL or ChapterURL == ArchiveURL
local AccessDate = A['AccessDate'];
local COinS_date = {}; -- holds date info extracted from |date= for the COinS metadata by Module:Date verification
local DoiBroken = A['DoiBroken'];
local Embargo = A['Embargo'];
local anchor_year; -- used in the CITEREF identifier
do -- create defined block to contain local variables error_message, date_parameters_list, mismatch
local error_message = '';
-- AirDate has been promoted to Date so not necessary to check it
local date_parameters_list = {
['access-date'] = {val = AccessDate, name = A:ORIGIN ('AccessDate')},
['archive-date'] = {val = ArchiveDate, name = A:ORIGIN ('ArchiveDate')},
['date'] = {val = Date, name = Date_origin},
['doi-broken-date'] = {val = DoiBroken, name = A:ORIGIN ('DoiBroken')},
['pmc-embargo-date'] = {val = Embargo, name = A:ORIGIN ('Embargo')},
['publication-date'] = {val = PublicationDate, name = A:ORIGIN ('PublicationDate')},
['year'] = {val = Year, name = A:ORIGIN ('Year')},
};
local error_list = {};
anchor_year, Embargo = validation.dates(date_parameters_list, COinS_date, error_list);
if utilities.is_set (Year) and utilities.is_set (Date) then -- both |date= and |year= not normally needed;
validation.year_date_check (Year, A:ORIGIN ('Year'), Date, A:ORIGIN ('Date'), error_list);
end
if 0 == #error_list then -- error free dates only; 0 when error_list is empty
local modified = false; -- flag
if utilities.is_set (DF) then -- if we need to reformat dates
modified = validation.reformat_dates (date_parameters_list, DF); -- reformat to DF format, use long month names if appropriate
end
if true == validation.date_hyphen_to_dash (date_parameters_list) then -- convert hyphens to dashes where appropriate
modified = true;
utilities.set_message ('maint_date_format'); -- hyphens were converted so add maint category
end
-- for those wikis that can and want to have English date names translated to the local language; not supported at en.wiki
if cfg.date_name_auto_xlate_enable and validation.date_name_xlate (date_parameters_list, cfg.date_digit_auto_xlate_enable ) then
utilities.set_message ('maint_date_auto_xlated'); -- add maint cat
modified = true;
end
if modified then -- if the date_parameters_list values were modified
AccessDate = date_parameters_list['access-date'].val; -- overwrite date holding parameters with modified values
ArchiveDate = date_parameters_list['archive-date'].val;
Date = date_parameters_list['date'].val;
DoiBroken = date_parameters_list['doi-broken-date'].val;
PublicationDate = date_parameters_list['publication-date'].val;
end
if archive_url_timestamp and utilities.is_set (ArchiveDate) then
validation.archive_date_check (ArchiveDate, archive_url_timestamp, DF); -- does YYYYMMDD in archive_url_timestamp match date in ArchiveDate
end
else
utilities.set_message ('err_bad_date', {utilities.make_sep_list (#error_list, error_list)}); -- add this error message
end
end -- end of do
if utilities.in_array (config.CitationClass, {'book', 'encyclopaedia'}) or -- {{cite book}}, {{cite encyclopedia}}; TODO: {{cite conference}} and others?
('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) or -- {{citation}} as an encylopedia citation
('citation' == config.CitationClass and not utilities.is_set (Periodical)) then -- {{citation}} as a book citation
if utilities.is_set (PublicationPlace) then
if not utilities.is_set (PublisherName) then
local date = COinS_date.rftdate and tonumber (COinS_date.rftdate:match ('%d%d%d%d')); -- get year portion of COinS date (because in Arabic numerals); convert string to number
if date and (1850 <= date) then -- location has no publisher; if date is 1850 or later
utilities.set_message ('maint_location_no_publisher'); -- add maint cat
end
else -- PublisherName has a value
if cfg.keywords_xlate['none'] == PublisherName then -- if that value is 'none' (only for book and encyclopedia citations)
PublisherName = ''; -- unset
end
end
end
end
local ID_list = {}; -- sequence table of rendered identifiers
local ID_list_coins = {}; -- table of identifiers and their values from args; key is same as cfg.id_handlers's key
local Class = A['Class']; -- arxiv class identifier
local ID_support = {
{A['ASINTLD'], 'ASIN', 'err_asintld_missing_asin', A:ORIGIN ('ASINTLD')},
{DoiBroken, 'DOI', 'err_doibroken_missing_doi', A:ORIGIN ('DoiBroken')},
{Embargo, 'PMC', 'err_embargo_missing_pmc', A:ORIGIN ('Embargo')},
}
ID_list, ID_list_coins = identifiers.identifier_lists_get (args, {
DoiBroken = DoiBroken, -- for |doi=
ASINTLD = A['ASINTLD'], -- for |asin=
Embargo = Embargo, -- for |pmc=
Class = Class, -- for |arxiv=
CitationClass = config.CitationClass, -- for |arxiv=
Year=anchor_year, -- for |isbn=
}, ID_support);
if 'citation' == config.CitationClass then -- catch ve/citoid malformed book cites in {{citation}} templates
for _, id in ipairs (ID_list) do -- search through the ID_list sequence looking for an ISBN identifier string
if id:find ('ISBN', 3, true) then -- plain find, start at index 3 ([[ISBN)
if utilities.is_set (Periodical) then -- when a |work= alias is set
utilities.set_message ('maint_work_isbn'); -- add maint cat
end
end
end
end
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite medrxiv}}, {{cite ssrn}}, before generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list_t) then -- |arxiv= or |eprint= required for cite arxiv; |biorxiv=, |citeseerx=, |medrxiv=, |ssrn= required for their templates
if not (args[cfg.id_handlers[config.CitationClass:upper()].parameters[1]] or -- can't use ID_list_coins k/v table here because invalid parameters omitted
args[cfg.id_handlers[config.CitationClass:upper()].parameters[2]]) then -- which causes unexpected parameter missing error message
utilities.set_message ('err_' .. config.CitationClass .. '_missing'); -- add error message
end
Periodical = ({['arxiv'] = 'arXiv', ['biorxiv'] = 'bioRxiv', ['citeseerx'] = 'CiteSeerX', ['medrxiv'] = 'medRxiv', ['ssrn'] = 'Social Science Research Network'})[config.CitationClass];
end
-- Link the title of the work if no |url= was provided, but we have a |pmc= or a |doi= with |doi-access=free
if config.CitationClass == "journal" and not utilities.is_set (URL) and not utilities.is_set (TitleLink) and not utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) then -- TODO: remove 'none' once existing citations have been switched to 'off', so 'none' can be used as token for "no title" instead
if 'none' ~= cfg.keywords_xlate[auto_select] then -- if auto-linking not disabled
if identifiers.auto_link_urls[auto_select] then -- manual selection
URL = identifiers.auto_link_urls[auto_select]; -- set URL to be the same as identifier's external link
URL_origin = cfg.id_handlers[auto_select:upper()].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['pmc'] then -- auto-select PMC
URL = identifiers.auto_link_urls['pmc']; -- set URL to be the same as the PMC external link if not embargoed
URL_origin = cfg.id_handlers['PMC'].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['doi'] then -- auto-select DOI
URL = identifiers.auto_link_urls['doi'];
URL_origin = cfg.id_handlers['DOI'].parameters[1];
end
end
if utilities.is_set (URL) then -- set when using an identifier-created URL
if utilities.is_set (AccessDate) then -- |access-date= requires |url=; identifier-created URL is not |url=
utilities.set_message ('err_accessdate_missing_url'); -- add an error message
AccessDate = ''; -- unset
end
if utilities.is_set (ArchiveURL) then -- |archive-url= requires |url=; identifier-created URL is not |url=
utilities.set_message ('err_archive_missing_url'); -- add an error message
ArchiveURL = ''; -- unset
end
end
end
-- At this point fields may be nil if they weren't specified in the template use. We can use that fact.
-- Test if citation has no title
if not utilities.is_set (Title) and not utilities.is_set (TransTitle) and not utilities.is_set (ScriptTitle) then -- has special case for cite episode
utilities.set_message ('err_citation_missing_title', {'episode' == config.CitationClass and 'series' or 'title'});
end
if utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) and
utilities.in_array (config.CitationClass, {'journal', 'citation'}) and
(utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and
('journal' == Periodical_origin or 'script-journal' == ScriptPeriodical_origin) then -- special case for journal cites
Title = ''; -- set title to empty string
utilities.set_message ('maint_untitled'); -- add maint cat
end
if 'journal' == config.CitationClass or ('citation' == config.CitationClass and utilities.is_set (Periodical) and 'journal' == Periodical_origin) then
if is_page_art_num (((utilities.is_set (Page) and Page) or (utilities.is_set (Pages) and Pages)) or nil, ID_list_coins['DOI']) then -- does |page(s)= look like it holds an article number
utilities.set_message ('maint_page_art_num'); -- add maint cat
end
end
-- COinS metadata (see <http://ocoins.info/>) for automated parsing of citation information.
-- handle the oddity that is cite encyclopedia and {{citation |encyclopedia=something}}. Here we presume that
-- when Periodical, Title, and Chapter are all set, then Periodical is the book (encyclopedia) title, Title
-- is the article title, and Chapter is a section within the article. So, we remap
local coins_chapter = Chapter; -- default assuming that remapping not required
local coins_title = Title; -- et tu
if 'encyclopaedia' == config.CitationClass or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Chapter) and utilities.is_set (Title) and utilities.is_set (Periodical) then -- if all are used then
coins_chapter = Title; -- remap
coins_title = Periodical;
end
end
local coins_author = a; -- default for coins rft.au
if 0 < #c then -- but if contributor list
coins_author = c; -- use that instead
end
-- this is the function call to COinS()
local OCinSoutput = metadata.COinS({
['Periodical'] = utilities.strip_apostrophe_markup (Periodical), -- no markup in the metadata
['Encyclopedia'] = Encyclopedia, -- just a flag; content ignored by ~/COinS
['Chapter'] = metadata.make_coins_title (coins_chapter, ScriptChapter), -- Chapter and ScriptChapter stripped of bold / italic / accept-as-written markup
['Degree'] = Degree; -- cite thesis only
['Title'] = metadata.make_coins_title (coins_title, ScriptTitle), -- Title and ScriptTitle stripped of bold / italic / accept-as-written markup
['PublicationPlace'] = PublicationPlace,
['Date'] = COinS_date.rftdate, -- COinS_date.* has correctly formatted date values if Date is valid;
['Season'] = COinS_date.rftssn,
['Quarter'] = COinS_date.rftquarter,
['Chron'] = COinS_date.rftchron,
['Series'] = Series,
['Volume'] = Volume,
['Issue'] = Issue,
['ArticleNumber'] = ArticleNumber,
['Pages'] = coins_pages or metadata.get_coins_pages (first_set ({Sheet, Sheets, Page, Pages, At, QuotePage, QuotePages}, 7)), -- pages stripped of external links
['Edition'] = Edition,
['PublisherName'] = PublisherName or Newsgroup, -- any apostrophe markup already removed from PublisherName
['URL'] = first_set ({ChapterURL, URL}, 2),
['Authors'] = coins_author,
['ID_list'] = ID_list_coins,
['RawPage'] = this_page.prefixedText,
}, config.CitationClass);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite medrxiv}}, and {{cite ssrn}} AFTER generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list_t) then -- we have set rft.jtitle in COinS to arXiv, bioRxiv, CiteSeerX, medRxiv, or ssrn now unset so it isn't displayed
Periodical = ''; -- periodical not allowed in these templates; if article has been published, use cite journal
end
-- special case for cite newsgroup. Do this after COinS because we are modifying Publishername to include some static text
if 'newsgroup' == config.CitationClass and utilities.is_set (Newsgroup) then
PublisherName = utilities.substitute (cfg.messages['newsgroup'], external_link( 'news:' .. Newsgroup, Newsgroup, Newsgroup_origin, nil ));
end
local Editors;
local EditorCount; -- used only for choosing {ed.) or (eds.) annotation at end of editor name-list
local Contributors; -- assembled contributors name list
local contributor_etal;
local Translators; -- assembled translators name list
local translator_etal;
local t = {}; -- translators list from |translator-lastn= / translator-firstn= pairs
t = extract_names (args, 'TranslatorList'); -- fetch translator list from |translatorn= / |translator-lastn=, -firstn=, -linkn=, -maskn=
local Interviewers;
local interviewers_list = {};
interviewers_list = extract_names (args, 'InterviewerList'); -- process preferred interviewers parameters
local interviewer_etal;
-- Now perform various field substitutions.
-- We also add leading spaces and surrounding markup and punctuation to the
-- various parts of the citation, but only when they are non-nil.
do
local last_first_list;
local control = {
format = NameListStyle, -- empty string, '&', 'amp', 'and', or 'vanc'
maximum = nil, -- as if display-authors or display-editors not set
mode = Mode
};
do -- do editor name list first because the now unsupported coauthors used to modify control table
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayEditors'], A['DisplayEditors'], A:ORIGIN ('DisplayEditors'), #e);
control.maximum, editor_etal = get_display_names (display_names, #e, 'editors', editor_etal, param);
Editors, EditorCount = list_people (control, e, editor_etal);
if 1 == EditorCount and (true == editor_etal or 1 < #e) then -- only one editor displayed but includes etal then
EditorCount = 2; -- spoof to display (eds.) annotation
end
end
do -- now do interviewers
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayInterviewers'], A['DisplayInterviewers'], A:ORIGIN ('DisplayInterviewers'), #interviewers_list);
control.maximum, interviewer_etal = get_display_names (display_names, #interviewers_list, 'interviewers', interviewer_etal, param);
Interviewers = list_people (control, interviewers_list, interviewer_etal);
end
do -- now do translators
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayTranslators'], A['DisplayTranslators'], A:ORIGIN ('DisplayTranslators'), #t);
control.maximum, translator_etal = get_display_names (display_names, #t, 'translators', translator_etal, param);
Translators = list_people (control, t, translator_etal);
end
do -- now do contributors
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayContributors'], A['DisplayContributors'], A:ORIGIN ('DisplayContributors'), #c);
control.maximum, contributor_etal = get_display_names (display_names, #c, 'contributors', contributor_etal, param);
Contributors = list_people (control, c, contributor_etal);
end
do -- now do authors
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayAuthors'], A['DisplayAuthors'], A:ORIGIN ('DisplayAuthors'), #a, author_etal);
control.maximum, author_etal = get_display_names (display_names, #a, 'authors', author_etal, param);
last_first_list = list_people (control, a, author_etal);
if utilities.is_set (Authors) then
Authors, author_etal = name_has_etal (Authors, author_etal, false, 'authors'); -- find and remove variations on et al.
if author_etal then
Authors = Authors .. ' ' .. cfg.messages['et al']; -- add et al. to authors parameter
end
else
Authors = last_first_list; -- either an author name list or an empty string
end
end -- end of do
if utilities.is_set (Authors) and utilities.is_set (Collaboration) then
Authors = Authors .. ' (' .. Collaboration .. ')'; -- add collaboration after et al.
end
end
local ConferenceFormat = A['ConferenceFormat'];
local ConferenceURL = A['ConferenceURL'];
ConferenceFormat = style_format (ConferenceFormat, ConferenceURL, 'conference-format', 'conference-url');
Format = style_format (Format, URL, 'format', 'url');
-- special case for chapter format so no error message or cat when chapter not supported
if not (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia))) then
ChapterFormat = style_format (ChapterFormat, ChapterURL, 'chapter-format', 'chapter-url');
end
if not utilities.is_set (URL) then
if utilities.in_array (config.CitationClass, {"web", "podcast", "mailinglist"}) or -- |url= required for {{cite web}}, {{cite podcast}}, and {{cite mailing list}}
('citation' == config.CitationClass and ('website' == Periodical_origin or 'script-website' == ScriptPeriodical_origin)) then -- and required for {{citation}} with |website= or |script-website=
if not url_was_archive_today then -- is <URL> empty/missing because it was a deprecated archive.today url
utilities.set_message ('err_cite_web_url'); -- no; emit an error message for an empty/ missing |url=
end
end
-- do we have |accessdate= without either |url= or |chapter-url=?
if utilities.is_set (AccessDate) and not utilities.is_set (ChapterURL) then -- ChapterURL may be set when URL is not set;
utilities.set_message ('err_accessdate_missing_url');
AccessDate = '';
end
end
local UrlStatus = is_valid_parameter_value (A['UrlStatus'], A:ORIGIN('UrlStatus'), cfg.keywords_lists['url-status'], '');
local OriginalURL
local OriginalURL_origin
local OriginalFormat
local OriginalAccess;
UrlStatus = UrlStatus:lower(); -- used later when assembling archived text
if utilities.is_set ( ArchiveURL ) then
if utilities.is_set (ChapterURL) then -- if chapter-url= is set apply archive url to it
OriginalURL = ChapterURL; -- save copy of source chapter's url for archive text
OriginalURL_origin = ChapterURL_origin; -- name of |chapter-url= parameter for error messages
OriginalFormat = ChapterFormat; -- and original |chapter-format=
if 'live' ~= UrlStatus then
ChapterURL = ArchiveURL -- swap-in the archive's URL
ChapterURL_origin = A:ORIGIN('ArchiveURL') -- name of |archive-url= parameter for error messages
ChapterFormat = ArchiveFormat or ''; -- swap in archive's format
ChapterUrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
elseif utilities.is_set (URL) then
OriginalURL = URL; -- save copy of original source URL
OriginalURL_origin = URL_origin; -- name of URL parameter for error messages
OriginalFormat = Format; -- and original |format=
OriginalAccess = UrlAccess;
if 'live' ~= UrlStatus then -- if URL set then |archive-url= applies to it
URL = ArchiveURL -- swap-in the archive's URL
URL_origin = A:ORIGIN('ArchiveURL') -- name of archive URL parameter for error messages
Format = ArchiveFormat or ''; -- swap in archive's format
UrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
end
elseif utilities.is_set (UrlStatus) then -- if |url-status= is set when |archive-url= is not set
utilities.set_message ('maint_url_status'); -- add maint cat
end
if utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or -- if any of the 'periodical' cites except encyclopedia
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) then
local chap_param;
if utilities.is_set (Chapter) then -- get a parameter name from one of these chapter related meta-parameters
chap_param = A:ORIGIN ('Chapter')
elseif utilities.is_set (TransChapter) then
chap_param = A:ORIGIN ('TransChapter')
elseif utilities.is_set (ChapterURL) then
chap_param = A:ORIGIN ('ChapterURL')
elseif utilities.is_set (ScriptChapter) then
chap_param = ScriptChapter_origin;
else utilities.is_set (ChapterFormat)
chap_param = A:ORIGIN ('ChapterFormat')
end
if utilities.is_set (chap_param) then -- if we found one
utilities.set_message ('err_chapter_ignored', {chap_param}); -- add error message
Chapter = ''; -- and set them to empty string to be safe with concatenation
TransChapter = '';
ChapterURL = '';
ScriptChapter = '';
ChapterFormat = '';
end
else -- otherwise, format chapter / article title
local no_quotes = false; -- default assume that we will be quoting the chapter parameter value
if utilities.is_set (Contribution) and 0 < #c then -- if this is a contribution with contributor(s)
if utilities.in_array (Contribution:lower(), cfg.keywords_lists.contribution) then -- and a generic contribution title
no_quotes = true; -- then render it unquoted
end
end
Chapter = format_chapter_title (ScriptChapter, ScriptChapter_origin, Chapter, Chapter_origin, TransChapter, TransChapter_origin, ChapterURL, ChapterURL_origin, no_quotes, ChapterUrlAccess); -- Contribution is also in Chapter
if utilities.is_set (Chapter) then
Chapter = Chapter .. ChapterFormat ;
if 'map' == config.CitationClass and utilities.is_set (TitleType) then
Chapter = Chapter .. ' ' .. TitleType; -- map annotation here; not after title
end
Chapter = Chapter .. sepc .. ' ';
elseif utilities.is_set (ChapterFormat) then -- |chapter= not set but |chapter-format= is so ...
Chapter = ChapterFormat .. sepc .. ' '; -- ... ChapterFormat has error message, we want to see it
end
end
-- Format main title
local plain_title = false;
local accept_title;
Title, accept_title = utilities.has_accept_as_written (Title, true); -- remove accept-this-as-written markup when it wraps all of <Title>
if accept_title and ('' == Title) then -- only support forced empty for now "(())"
Title = cfg.messages['notitle']; -- replace by predefined "No title" message
-- TODO: utilities.set_message ( 'err_redundant_parameters', ...); -- issue proper error message instead of muting
ScriptTitle = ''; -- just mute for now
TransTitle = ''; -- just mute for now
plain_title = true; -- suppress text decoration for descriptive title
utilities.set_message ('maint_untitled'); -- add maint cat
end
if not accept_title then -- <Title> not wrapped in accept-as-written markup
if '...' == Title:sub (-3) then -- if ellipsis is the last three characters of |title=
Title = Title:gsub ('(%.%.%.)%.+$', '%1'); -- limit the number of dots to three
elseif not mw.ustring.find (Title, '%.%s*%a%.$') and -- end of title is not a 'dot-(optional space-)letter-dot' initialism ...
not mw.ustring.find (Title, '%s+%a%.$') then -- ...and not a 'space-letter-dot' initial (''Allium canadense'' L.)
Title = mw.ustring.gsub(Title, '%' .. sepc .. '$', ''); -- remove any trailing separator character; sepc and ms.ustring() here for languages that use multibyte separator characters
end
if utilities.is_set (ArchiveURL) and is_archived_copy (Title) then
utilities.set_message ('maint_archived_copy'); -- add maintenance category before we modify the content of Title
end
if is_generic ('generic_titles', Title) then
utilities.set_message ('err_generic_title'); -- set an error message
end
end
if (not plain_title) and (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'document', 'pressrelease', 'podcast', 'newsgroup', 'mailinglist', 'interview', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) or
('map' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)))) then -- special case for cite map when the map is in a periodical treat as an article
Title = kern_quotes (Title); -- if necessary, separate title's leading and trailing quote marks from module provided quote marks
Title = utilities.wrap_style ('quoted-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle );
elseif plain_title or ('report' == config.CitationClass) then -- no styling for cite report and descriptive titles (otherwise same as above)
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle ); -- for cite report, use this form for trans-title
else
Title = utilities.wrap_style ('italic-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-italic-title', TransTitle);
end
if utilities.is_set (TransTitle) then
if utilities.is_set (Title) then
TransTitle = " " .. TransTitle;
else
utilities.set_message ('err_trans_missing_title', {'title'});
end
end
if utilities.is_set (Title) then -- TODO: is this the right place to be making Wikisource URLs?
if utilities.is_set (TitleLink) and utilities.is_set (URL) then
utilities.set_message ('err_wikilink_in_url'); -- set an error message because we can't have both
TitleLink = ''; -- unset
end
if not utilities.is_set (TitleLink) and utilities.is_set (URL) then
Title = external_link (URL, Title, URL_origin, UrlAccess) .. TransTitle .. Format;
URL = ''; -- unset these because no longer needed
Format = "";
elseif utilities.is_set (TitleLink) and not utilities.is_set (URL) then
local ws_url;
ws_url = wikisource_url_make (TitleLink); -- ignore ws_label return; not used here
if ws_url then
Title = external_link (ws_url, Title .. ' ', 'ws link in title-link'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], TitleLink, Title});
Title = Title .. TransTitle;
else
Title = utilities.make_wikilink (TitleLink, Title) .. TransTitle;
end
else
local ws_url, ws_label, L; -- Title has italic or quote markup by the time we get here which causes is_wikilink() to return 0 (not a wikilink)
ws_url, ws_label, L = wikisource_url_make (Title:gsub('^[\'"]*(.-)[\'"]*$', '%1')); -- make ws URL from |title= interwiki link (strip italic or quote markup); link portion L becomes tooltip label
if ws_url then
Title = Title:gsub ('%b[]', ws_label); -- replace interwiki link with ws_label to retain markup
Title = external_link (ws_url, Title .. ' ', 'ws link in title'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, Title});
Title = Title .. TransTitle;
else
Title = Title .. TransTitle;
end
end
else
Title = TransTitle;
end
if utilities.is_set (Place) then
Place = " " .. wrap_msg ('written', Place, use_lowercase) .. sepc .. " ";
end
local ConferenceURL_origin = A:ORIGIN('ConferenceURL'); -- get name of parameter that holds ConferenceURL
if utilities.is_set (Conference) then
if utilities.is_set (ConferenceURL) then
Conference = external_link( ConferenceURL, Conference, ConferenceURL_origin, nil );
end
Conference = sepc .. " " .. Conference .. ConferenceFormat;
elseif utilities.is_set (ConferenceURL) then
Conference = sepc .. " " .. external_link( ConferenceURL, nil, ConferenceURL_origin, nil );
end
local Position = '';
if not utilities.is_set (Position) then
local Minutes = A['Minutes'];
local Time = A['Time'];
if utilities.is_set (Minutes) then
if utilities.is_set (Time) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'minutes') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'time')});
end
Position = utilities.substitute (cfg.messages.minutes, Minutes);
else
if utilities.is_set (Time) then
local TimeCaption = A['TimeCaption']
if not utilities.is_set (TimeCaption) then
TimeCaption = cs2_lower(cfg.messages['event']);
end
Position = " " .. TimeCaption .. " " .. Time;
end
end
else
Position = " " .. Position;
At = '';
end
Page, Pages, Sheet, Sheets = format_pages_sheets (Page, Pages, Sheet, Sheets, config.CitationClass, Periodical_origin, sepc, NoPP, use_lowercase);
At = utilities.is_set (At) and (sepc .. " " .. At) or "";
Position = utilities.is_set (Position) and (sepc .. " " .. Position) or "";
if config.CitationClass == 'map' then
local Sections = A['Sections']; -- Section (singular) is an alias of Chapter so set earlier
local Inset = A['Inset'];
if utilities.is_set ( Inset ) then
Inset = sepc .. " " .. wrap_msg ('inset', Inset, use_lowercase);
end
if utilities.is_set ( Sections ) then
Section = sepc .. " " .. wrap_msg ('sections', Sections, use_lowercase);
elseif utilities.is_set ( Section ) then
Section = sepc .. " " .. wrap_msg ('section', Section, use_lowercase);
end
At = At .. Inset .. Section;
end
local Others = A['Others'];
if utilities.is_set (Others) and 0 == #a and 0 == #e then -- add maint cat when |others= has value and used without |author=, |editor=
if config.CitationClass == "AV-media-notes"
or config.CitationClass == "audio-visual" then -- special maint for AV/M which has a lot of 'false' positives right now
utilities.set_message ('maint_others_avm')
else
utilities.set_message ('maint_others');
end
end
Others = utilities.is_set (Others) and (sepc .. " " .. Others) or "";
if utilities.is_set (Translators) then
Others = safe_join ({sepc .. ' ', wrap_msg ('translated', Translators, use_lowercase), Others}, sepc);
end
if utilities.is_set (Interviewers) then
Others = safe_join ({sepc .. ' ', wrap_msg ('interview', Interviewers, use_lowercase), Others}, sepc);
end
local TitleNote = A['TitleNote'];
TitleNote = utilities.is_set (TitleNote) and (sepc .. " " .. TitleNote) or "";
if utilities.is_set (Edition) then
if Edition:match ('%f[%a][Ee]d%n?%.?$') or Edition:match ('%f[%a][Ee]dition$') then -- Ed, ed, Ed., ed., Edn, edn, Edn., edn.
utilities.set_message ('err_extra_text_edition'); -- add error message
end
Edition = " " .. wrap_msg ('edition', Edition);
else
Edition = '';
end
Series = utilities.is_set (Series) and wrap_msg ('series', {sepc, Series}) or ""; -- not the same as SeriesNum
local Agency = A['Agency'] or ''; -- |agency= is supported by {{cite magazine}}, {{cite news}}, {{cite press release}}, {{cite web}}, and certain {{citation}} templates
if utilities.is_set (Agency) then -- this testing done here because {{citation}} supports 'news' citations
if utilities.in_array (config.CitationClass, {'magazine', 'news', 'pressrelease', 'web'}) or ('citation' == config.CitationClass and utilities.in_array (Periodical_origin, {"magazine", "newspaper", "work"})) then
Agency = wrap_msg ('agency', {sepc, Agency}); -- format for rendering
else
Agency = ''; -- unset; not supported
utilities.set_message ('err_parameter_ignored', {'agency'}); -- add error message
end
end
Volume = format_volume_issue (Volume, Issue, ArticleNumber, config.CitationClass, Periodical_origin, sepc, use_lowercase);
if utilities.is_set (AccessDate) then
local retrv_text = " " .. cfg.messages['retrieved'];
AccessDate = nowrap_date (AccessDate); -- wrap in nowrap span if date in appropriate format
retrv_text = cs2_lower(retrv_text); -- if mode is cs2, lower case
AccessDate = utilities.substitute (retrv_text, AccessDate); -- add retrieved text
AccessDate = utilities.substitute (cfg.presentation['accessdate'], {sepc, AccessDate}); -- allow editors to hide accessdates
end
if utilities.is_set (ID) then ID = sepc .. " " .. ID; end
local Docket = A['Docket'];
if "thesis" == config.CitationClass and utilities.is_set (Docket) then
ID = sepc .. " Docket " .. Docket .. ID;
end
if "report" == config.CitationClass and utilities.is_set (Docket) then -- for cite report when |docket= is set
ID = sepc .. ' ' .. Docket; -- overwrite ID even if |id= is set
end
if utilities.is_set (URL) then
URL = " " .. external_link( URL, nil, URL_origin, UrlAccess );
end
-- We check length of PostScript here because it will have been nuked by
-- the quote parameters. We'd otherwise emit a message even if there wasn't
-- a displayed postscript.
-- TODO: Should the max size (1) be configurable?
-- TODO: Should we check a specific pattern?
if utilities.is_set(PostScript) and mw.ustring.len(PostScript) > 1 then
utilities.set_message ('maint_postscript')
end
local Archived;
if utilities.is_set (ArchiveURL) then
if not utilities.is_set (ArchiveDate) then -- ArchiveURL set but ArchiveDate not set
utilities.set_message ('err_archive_missing_date'); -- emit an error message
ArchiveURL = ''; -- empty string for concatenation
ArchiveDate = ''; -- empty string for concatenation
end
else
if utilities.is_set (ArchiveDate) then -- ArchiveURL not set but ArchiveDate is set
utilities.set_message ('err_archive_date_missing_url'); -- emit an error message
ArchiveURL = ''; -- empty string for concatenation
ArchiveDate = ''; -- empty string for concatenation
end
end
if utilities.is_set (ArchiveURL) then
local arch_text;
if "live" == UrlStatus then
if utilities.is_set (ArchiveDate) then
Archived = sepc .. ' ' .. utilities.substitute ( cfg.messages['archived-live'],
{ external_link( ArchiveURL, cs2_lower(cfg.messages['archived']), A:ORIGIN('ArchiveURL'), nil) .. ArchiveFormat, ArchiveDate } );
else
Archived = '';
end
if not utilities.is_set (OriginalURL) then
utilities.set_message ('err_archive_missing_url');
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (OriginalURL) then -- UrlStatus is empty, 'dead', 'unfit', 'usurped', 'bot: unknown'
if utilities.in_array (UrlStatus, {'unfit', 'usurped', 'bot: unknown'}) then
Archived = sepc .. ' ' .. utilities.substitute ( cs2_lower(cfg.messages['archived-unfit']), ArchiveDate);
if 'bot: unknown' == UrlStatus then
utilities.set_message ('maint_bot_unknown'); -- and add a category if not already added
else
utilities.add_prop_cat ('unfit'); -- and add a category if not already added
end
else -- UrlStatus is empty, 'dead'
if utilities.is_set (ArchiveDate) then
Archived = sepc .. ' ' .. utilities.substitute ( cs2_lower(cfg.messages['archived-dead']),
{ external_link( OriginalURL, cfg.messages['original'], OriginalURL_origin, OriginalAccess ) .. OriginalFormat, ArchiveDate } );
else
Archived = ''; -- unset for concatenation
end
end
else -- OriginalUrl not set
utilities.set_message ('err_archive_missing_url');
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (ArchiveFormat) then
Archived = ArchiveFormat; -- if set and ArchiveURL not set ArchiveFormat has error message
else
Archived = '';
end
local TranscriptURL = A['TranscriptURL']
local TranscriptFormat = A['TranscriptFormat'];
TranscriptFormat = style_format (TranscriptFormat, TranscriptURL, 'transcript-format', 'transcripturl');
local Transcript = A['Transcript'];
local TranscriptURL_origin = A:ORIGIN('TranscriptURL'); -- get name of parameter that holds TranscriptURL
if utilities.is_set (Transcript) then
if utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, Transcript, TranscriptURL_origin, nil );
end
Transcript = sepc .. ' ' .. Transcript .. TranscriptFormat;
elseif utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, nil, TranscriptURL_origin, nil );
end
local Publisher;
if utilities.is_set (PublicationDate) then
PublicationDate = wrap_msg ('published', PublicationDate);
end
if utilities.is_set (PublisherName) then
if utilities.is_set (PublicationPlace) then
Publisher = sepc .. " " .. PublicationPlace .. ": " .. PublisherName .. PublicationDate;
else
Publisher = sepc .. " " .. PublisherName .. PublicationDate;
end
elseif utilities.is_set (PublicationPlace) then
Publisher= sepc .. " " .. PublicationPlace .. PublicationDate;
else
Publisher = PublicationDate;
end
-- Several of the above rely upon detecting this as nil, so do it last.
if (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (TransPeriodical)) then
if utilities.is_set (Title) or utilities.is_set (TitleNote) then
Periodical = sepc .. " " .. format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
else
Periodical = format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
end
end
local Language = A['Language'];
if utilities.is_set (Language) then
Language = language_parameter (Language); -- format, categories, name from ISO639-1, etc.
else
Language=''; -- language not specified so make sure this is an empty string;
--[[ TODO: need to extract the wrap_msg from language_parameter
so that we can solve parentheses bunching problem with Format/Language/TitleType
]]
end
--[[
Handle the oddity that is cite speech. This code overrides whatever may be the value assigned to TitleNote (through |department=) and forces it to be " (Speech)" so that
the annotation directly follows the |title= parameter value in the citation rather than the |event= parameter value (if provided).
]]
if "speech" == config.CitationClass then -- cite speech only
TitleNote = TitleType; -- move TitleType to TitleNote so that it renders ahead of |event=
TitleType = ''; -- and unset
if utilities.is_set (Periodical) then -- if Periodical, perhaps because of an included |website= or |journal= parameter
if utilities.is_set (Conference) then -- and if |event= is set
Conference = Conference .. sepc .. " "; -- then add appropriate punctuation to the end of the Conference variable before rendering
end
end
end
-- Piece all bits together at last. Here, all should be non-nil.
-- We build things this way because it is more efficient in LUA
-- not to keep reassigning to the same string variable over and over.
local tcommon;
local tcommon2; -- used for book cite when |contributor= is set
local pgtext = Position .. Sheet .. Sheets .. Page .. Pages .. At;
-- Volume = safe_join ({Volume, pgtext}, sepc);
if utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (Periodical) then -- special cases for book cites
if utilities.is_set (Contributors) then -- when we are citing foreword, preface, introduction, etc.
tcommon = safe_join ({Title, TitleNote}, sepc); -- author and other stuff will come after this and before tcommon2
tcommon2 = safe_join ({TitleType, Series, Language, Volume, Others, Edition, Publisher}, sepc);
else
tcommon = safe_join ({Title, TitleNote, TitleType, Series, Language, Volume, Others, Edition, Publisher}, sepc);
end
elseif 'map' == config.CitationClass then -- special cases for cite map
if utilities.is_set (Chapter) then -- map in a book; TitleType is part of Chapter
tcommon = safe_join ({Title, Edition, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc);
elseif utilities.is_set (Periodical) then -- map in a periodical
tcommon = safe_join ({Title, TitleType, Periodical, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc);
else -- a sheet or stand-alone map
tcommon = safe_join ({Title, TitleType, Edition, Scale, Series, Language, Cartography, Others, Publisher}, sepc);
end
elseif 'episode' == config.CitationClass then -- special case for cite episode
tcommon = safe_join ({Title, TitleNote, TitleType, Series, Language, Edition, Publisher}, sepc);
else -- all other CS1 templates
tcommon = safe_join ({Title, TitleNote, Conference, Periodical, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc);
end
if #ID_list > 0 then
ID_list = safe_join( { sepc .. " ", table.concat( ID_list, sepc .. " " ), ID }, sepc );
else
ID_list = ID;
end
local Via = A['Via'];
Via = utilities.is_set (Via) and wrap_msg ('via', Via) or '';
local idcommon;
if 'audio-visual' == config.CitationClass or 'episode' == config.CitationClass then -- special case for cite AV media & cite episode position transcript
idcommon = safe_join( { ID_list, URL, Archived, Transcript, AccessDate, Via, Quote }, sepc );
else
idcommon = safe_join( { ID_list, URL, Archived, AccessDate, Via, Quote }, sepc );
end
local text;
-- local pgtext = Position .. Sheet .. Sheets .. Page .. Pages .. At;
local OrigDate = A['OrigDate'];
OrigDate = utilities.is_set (OrigDate) and wrap_msg ('origdate', OrigDate) or '';
if utilities.is_set (Date) then
if utilities.is_set (Authors) or utilities.is_set (Editors) then -- date follows authors or editors when authors not set
Date = " (" .. Date .. ")" .. OrigDate .. sepc .. " "; -- in parentheses
else -- neither of authors and editors set
if (string.sub(tcommon, -1, -1) == sepc) then -- if the last character of tcommon is sepc
Date = " " .. Date .. OrigDate; -- Date does not begin with sepc
else
Date = sepc .. " " .. Date .. OrigDate; -- Date begins with sepc
end
end
end
if utilities.is_set (Authors) then
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Authors termination
Authors = terminate_name_list (Authors, sepc); -- when no date, terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Editors) then
local in_text = '';
local post_text = '';
if utilities.is_set (Chapter) and 0 == #c then
in_text = cfg.messages['in'] .. ' ';
in_text = cs2_lower(in_text); -- lowercase for cs2
end
if EditorCount <= 1 then
post_text = ' (' .. cfg.messages['editor'] .. ')'; -- be consistent with no-author, no-date case
else
post_text = ' (' .. cfg.messages['editors'] .. ')';
end
Editors = terminate_name_list (in_text .. Editors .. post_text, sepc); -- terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Contributors) then -- book cite and we're citing the intro, preface, etc.
local by_text = sepc .. ' ' .. cfg.messages['by'] .. ' ';
by_text = cs2_lower(by_text); -- lowercase for cs2
Authors = by_text .. Authors; -- author follows title so tweak it here
if utilities.is_set (Editors) and utilities.is_set (Date) then -- when Editors make sure that Authors gets terminated
Authors = terminate_name_list (Authors, sepc); -- terminate with 0 or 1 sepc and a space
end
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Contributors termination
Contributors = terminate_name_list (Contributors, sepc); -- terminate with 0 or 1 sepc and a space
end
text = safe_join( {Contributors, Date, Chapter, tcommon, Authors, Place, Editors, tcommon2, pgtext, idcommon }, sepc );
-- text = safe_join( {Contributors, Date, Chapter, tcommon, Authors, Place, Editors, tcommon2, idcommon }, sepc );
else
text = safe_join( {Authors, Date, Chapter, Place, Editors, tcommon, pgtext, idcommon }, sepc );
-- text = safe_join( {Authors, Date, Chapter, Place, Editors, tcommon, idcommon }, sepc );
end
elseif utilities.is_set (Editors) then
if utilities.is_set (Date) then
if EditorCount <= 1 then
Editors = Editors .. cfg.presentation['sep_name'] .. cfg.messages['editor'];
else
Editors = Editors .. cfg.presentation['sep_name'] .. cfg.messages['editors'];
end
else
if EditorCount <= 1 then
Editors = Editors .. " (" .. cfg.messages['editor'] .. ")" .. sepc .. " "
else
Editors = Editors .. " (" .. cfg.messages['editors'] .. ")" .. sepc .. " "
end
end
text = safe_join( {Editors, Date, Chapter, Place, tcommon, pgtext, idcommon}, sepc );
-- text = safe_join( {Editors, Date, Chapter, Place, tcommon, idcommon}, sepc );
else
if utilities.in_array (config.CitationClass, {"journal", "citation"}) and utilities.is_set (Periodical) then
text = safe_join( {Chapter, Place, tcommon, pgtext, Date, idcommon}, sepc );
-- text = safe_join( {Chapter, Place, tcommon, Date, idcommon}, sepc );
else
text = safe_join( {Chapter, Place, tcommon, Date, pgtext, idcommon}, sepc );
-- text = safe_join( {Chapter, Place, tcommon, Date, idcommon}, sepc );
end
end
if utilities.is_set (PostScript) and PostScript ~= sepc then
text = safe_join( {text, sepc}, sepc ); -- Deals with italics, spaces, etc.
if '.' == sepc then -- remove final seperator if present
text = text:gsub ('%' .. sepc .. '$', ''); -- dot must be escaped here
else
text = mw.ustring.gsub (text, sepc .. '$', ''); -- using ustring for non-dot sepc (likely a non-Latin character)
end
end
text = safe_join( {text, PostScript}, sepc );
-- Now enclose the whole thing in a <cite> element
local options_t = {};
options_t.class = cite_class_attribute_make (config.CitationClass, Mode);
local Ref = is_valid_parameter_value (A['Ref'], A:ORIGIN('Ref'), cfg.keywords_lists['ref'], nil, true); -- nil when |ref=harv; A['Ref'] else
if 'none' ~= cfg.keywords_xlate[(Ref and Ref:lower()) or ''] then
local namelist_t = {}; -- holds selected contributor, author, editor name list
local year = first_set ({Year, anchor_year}, 2); -- Year first for legacy citations and for YMD dates that require disambiguation
if #c > 0 then -- if there is a contributor list
namelist_t = c; -- select it
elseif #a > 0 then -- or an author list
namelist_t = a;
elseif #e > 0 then -- or an editor list
namelist_t = e;
end
local citeref_id;
if #namelist_t > 0 then -- if there are names in namelist_t
citeref_id = make_citeref_id (namelist_t, year); -- go make the CITEREF anchor
if mw.uri.anchorEncode (citeref_id) == ((Ref and mw.uri.anchorEncode (Ref)) or '') then -- Ref may already be encoded (by {{sfnref}}) so citeref_id must be encoded before comparison
utilities.set_message ('maint_ref_duplicates_default');
end
else
citeref_id = ''; -- unset
end
options_t.id = Ref or citeref_id;
end
if string.len (text:gsub('%b<>', '')) <= 2 then -- remove html and html-like tags; then get length of what remains;
z.error_cats_t = {}; -- blank the categories list
z.error_msgs_t = {}; -- blank the error messages list
OCinSoutput = nil; -- blank the metadata string
text = ''; -- blank the the citation
utilities.set_message ('err_empty_citation'); -- set empty citation message and category
end
local render_t = {}; -- here we collect the final bits for concatenation into the rendered citation
if is_preview_mode and (0 ~= #z.error_msgs_t or 0 ~= #z.maint_cats_t) then -- when in preview mode
if not utilities.is_set (options_t.id) then -- and when this template has not created an anchor ID
math.randomseed (tonumber (mw.getLanguage ('en'):formatDate ('U')) * 10000 + os.clock() * 10000);
options_t.id = 'CITEREF_temp_preview_id_' .. math.random (100000, 999999); -- create temporary anchor ID for preview mode
end
end
if utilities.is_set (options_t.id) then -- here we wrap the rendered citation in <cite ...>...</cite> tags
options_t.id = mw.uri.anchorEncode(options_t.id); -- do this here; also used when adding preview warning messages
table.insert (render_t, utilities.substitute (cfg.presentation['cite-id'], {options_t.id, mw.text.nowiki(options_t.class), text})); -- when |ref= is set or when there is a namelist
else
table.insert (render_t, utilities.substitute (cfg.presentation['cite'], {mw.text.nowiki(options_t.class), text})); -- when |ref=none or when namelist_t empty and |ref= is missing or is empty
end
if OCinSoutput then -- blanked when citation is 'empty' so don't bother to add boilerplate metadata span
table.insert (render_t, utilities.substitute (cfg.presentation['ocins'], OCinSoutput)); -- format and append metadata to the citation
end
local template_name = cfg.citation_class_map_t[config.CitationClass];
local template_link = '[[Template:' .. template_name .. '|' .. template_name .. ']]';
local msg_prefix = '<code class="cs1-code">{{' .. template_link .. '}}</code>: ';
if 0 ~= #z.error_msgs_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_e, {template_link, options_t.id}));
table.insert (render_t, ' '); -- insert a space between citation and its error messages
table.sort (z.error_msgs_t); -- sort the error messages list; sorting includes wrapping <span> and <code> tags; hidden-error sorts ahead of visible-error
local hidden = true; -- presume that the only error messages emited by this template are hidden
for _, v in ipairs (z.error_msgs_t) do -- spin through the list of error messages
if v:find ('cs1-visible-error', 1, true) then -- look for the visible error class name
hidden = false; -- found one; so don't hide the error message prefix
break; -- and done because no need to look further
end
end
z.error_msgs_t[1] = table.concat ({utilities.error_comment (msg_prefix, hidden), z.error_msgs_t[1]}); -- add error message prefix to first error message to prevent extraneous punctuation
table.insert (render_t, table.concat (z.error_msgs_t, '; ')); -- make a big string of error messages and add it to the rendering
end
if 0 ~= #z.maint_cats_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_m, {template_link, options_t.id}));
table.sort (z.maint_cats_t); -- sort the maintenance messages list
local maint_msgs_t = {}; -- here we collect all of the maint messages
if 0 == #z.error_msgs_t then -- if no error messages
table.insert (maint_msgs_t, msg_prefix); -- insert message prefix in maint message livery
end
for _, v in ipairs( z.maint_cats_t ) do -- append maintenance categories
table.insert (maint_msgs_t, -- assemble new maint message and add it to the maint_msgs_t table
table.concat ({v, ' (', utilities.substitute (cfg.messages[':cat wikilink'], v), ')'})
);
end
table.insert (render_t, utilities.substitute (cfg.presentation['hidden-maint'], table.concat (maint_msgs_t, ' '))); -- wrap the group of maint messages with proper presentation and save
end
if not no_tracking_cats then
local sort_key;
local cat_wikilink = 'cat wikilink';
if cfg.enable_sort_keys then -- when namespace sort keys enabled
local namespace_number = mw.title.getCurrentTitle().namespace; -- get namespace number for this wikitext
sort_key = (0 ~= namespace_number and (cfg.name_space_sort_keys[namespace_number] or cfg.name_space_sort_keys.other)) or nil; -- get sort key character; nil for mainspace
cat_wikilink = (not sort_key and 'cat wikilink') or 'cat wikilink sk'; -- make <cfg.messages> key
end
for _, v in ipairs (z.error_cats_t) do -- append error categories
table.insert (render_t, utilities.substitute (cfg.messages[cat_wikilink], {v, sort_key}));
end
if cfg.id_limits_data_load_fail then -- boolean true when load failed
utilities.set_message ('maint_id_limit_load_fail'); -- done here because this maint cat emits no message
end
for _, v in ipairs (z.maint_cats_t) do -- append maintenance categories
table.insert (render_t, utilities.substitute (cfg.messages[cat_wikilink], {v, sort_key}));
end
for _, v in ipairs (z.prop_cats_t) do -- append properties categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v)); -- no sort keys
end
end
return table.concat (render_t); -- make a big string and done
end
--[[--------------------------< V A L I D A T E >--------------------------------------------------------------
Looks for a parameter's name in one of several whitelists.
Parameters in the whitelist can have three values:
true - active, supported parameters
false - deprecated, supported parameters
nil - unsupported parameters
]]
local function validate (name, cite_class, empty)
local name = tostring (name);
local enum_name; -- parameter name with enumerator (if any) replaced with '#'
local state;
local function state_test (state, name) -- local function to do testing of state values
if true == state then return true; end -- valid actively supported parameter
if false == state then
if empty then return nil; end -- empty deprecated parameters are treated as unknowns
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
if 'tracked' == state then
local base_name = name:gsub ('%d', ''); -- strip enumerators from parameter names that have them to get the base name
utilities.add_prop_cat ('tracked-param', {base_name}, base_name); -- add a properties category; <base_name> modifies <key>
return true;
end
return nil;
end
if name:find ('#') then -- # is a cs1|2 reserved character so parameters with # not permitted
return nil;
end
-- replace enumerator digit(s) with # (|last25= becomes |last#=) (mw.ustring because non-Western 'local' digits)
enum_name = mw.ustring.gsub (name, '%d+$', '#'); -- where enumerator is last charaters in parameter name (these to protect |s2cid=)
enum_name = mw.ustring.gsub (enum_name, '%d+([%-l])', '#%1'); -- where enumerator is in the middle of the parameter name; |author#link= is the oddity
if 'document' == cite_class then -- special case for {{cite document}}
state = whitelist.document_parameters_t[enum_name]; -- this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
return false;
end
if utilities.in_array (cite_class, whitelist.preprint_template_list_t) then -- limited parameter sets allowed for these templates
state = whitelist.limited_parameters_t[enum_name]; -- this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
state = whitelist.preprint_arguments_t[cite_class][name]; -- look in the parameter-list for the template identified by cite_class
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end -- end limited parameter-set templates
if utilities.in_array (cite_class, whitelist.unique_param_template_list_t) then -- template-specific parameters for templates that accept parameters from the basic argument list
state = whitelist.unique_arguments_t[cite_class][name]; -- look in the template-specific parameter-lists for the template identified by cite_class
if true == state_test (state, name) then return true; end
end -- if here, fall into general validation
state = whitelist.common_parameters_t[enum_name]; -- all other templates; all normal parameters allowed; this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end
--[=[-------------------------< I N T E R _ W I K I _ C H E C K >----------------------------------------------
check <value> for inter-language interwiki-link markup. <prefix> must be a MediaWiki-recognized language
code. when these values have the form (without leading colon):
[[<prefix>:link|label]] return label as plain-text
[[<prefix>:link]] return <prefix>:link as plain-text
return value as is else
]=]
local function inter_wiki_check (parameter, value)
local prefix = value:match ('%[%[(%a+):'); -- get an interwiki prefix if one exists
local _;
if prefix and cfg.inter_wiki_map[prefix:lower()] then -- if prefix is in the map, needs preceding colon so
utilities.set_message ('err_bad_paramlink', parameter); -- emit an error message
_, value, _ = utilities.is_wikilink (value); -- extract label portion from wikilink
end
return value;
end
--[[--------------------------< M I S S I N G _ P I P E _ C H E C K >------------------------------------------
Look at the contents of a parameter. If the content has a string of characters and digits followed by an equal
sign, compare the alphanumeric string to the list of cs1|2 parameters. If found, then the string is possibly a
parameter that is missing its pipe. There are two tests made:
{{cite ... |title=Title access-date=2016-03-17}} -- the first parameter has a value and whitespace separates that value from the missing pipe parameter name
{{cite ... |title=access-date=2016-03-17}} -- the first parameter has no value (whitespace after the first = is trimmed by MediaWiki)
cs1|2 shares some parameter names with XML/HTML attributes: class=, title=, etc. To prevent false positives XML/HTML
tags are removed before the search.
If a missing pipe is detected, this function adds the missing pipe maintenance category.
]]
local function missing_pipe_check (parameter, value)
local capture;
value = value:gsub ('%b<>', ''); -- remove XML/HTML tags because attributes: class=, title=, etc.
capture = value:match ('%s+(%a[%w%-]+)%s*=') or value:match ('^(%a[%w%-]+)%s*='); -- find and categorize parameters with possible missing pipes
if capture and validate (capture) then -- if the capture is a valid parameter name
utilities.set_message ('err_missing_pipe', parameter);
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ P U N C T >--------------------------------------
look for extraneous terminal punctuation in most parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_punc (param, value)
if 'number' == type (param) then
return;
end
param = param:gsub ('%d+', '#'); -- enumerated name-list mask params allow terminal punct; normalize
if cfg.punct_skip[param] then
return; -- parameter name found in the skip table so done
end
if value:match ('[,;:]$') then
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
if value:match ('^=') then -- sometimes an extraneous '=' character appears ...
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
end
--[[--------------------------< H A S _ T W L _ U R L >--------------------------------------------------------
look for The Wikipedia Library urls in url-holding parameters. TWL urls are accessible only for readers who are
active extended confirmed Wikipedia editors. This function sets an error message when such urls are discovered
and when appropriate, sets the |<param>-url-access=subscription. returns nothing.
looks for: '.wikipedialibrary.idm.oclc.org'
]]
local function has_twl_url (url_params_t, cite_args_t)
local url_error_t = {}; -- sequence of url-holding parameters that have a TWL url
for param, value in pairs (url_params_t) do
if value:find ('%.wikipedialibrary%.idm%.oclc%.org') then -- has the TWL base url?
table.insert (url_error_t, param); -- add parameter name to the error list
end
end
if 0 ~= #url_error_t then -- non-zero when there are errors
table.sort (url_error_t); -- sor for error messaging
for i, param in ipairs (url_error_t) do
if cfg.url_access_map_t[param] then -- if <param> has a matching -access parameter
cite_args_t[cfg.url_access_map_t[param]] = cfg.keywords_xlate.subscription; -- set |<param>-url-access=subscription
end
url_error_t[i] = utilities.wrap_style ('parameter', param); -- make the parameter pretty for error message
end
utilities.set_message ('err_param_has_twl_url', {utilities.make_sep_list (#url_error_t, url_error_t)}); -- add this error message
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ U R L >------------------------------------------
look for extraneous url parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_url (non_url_param_t)
local url_error_t = {};
check_for_url (non_url_param_t, url_error_t); -- extraneous url check
if 0 ~= #url_error_t then -- non-zero when there are errors
table.sort (url_error_t);
utilities.set_message ('err_param_has_ext_link', {utilities.make_sep_list (#url_error_t, url_error_t)}); -- add this error message
end
end
--[[--------------------------< _ C I T A T I O N >------------------------------------------------------------
Module entry point
frame – from template call (citation()); may be nil when called from another module
args_t – table of all cs1|2 parameters in the template (the parent frame)
config_t – table of template-supplied parameter (the #invoke frame)
]]
local function _citation (frame, args_t, config_t) -- save a copy in case we need to display an error message in preview mode
if not frame then
frame = mw.getCurrentFrame(); -- if called from another module, get a frame for frame-provided functions
end
-- i18n: set the name that your wiki uses to identify sandbox subpages from sandbox template invoke (or can be set here)
local sandbox = ((config_t.SandboxPath and '' ~= config_t.SandboxPath) and config_t.SandboxPath) or '/sandbox'; -- sandbox path from {{#invoke:Citation/CS1/sandbox|citation|SandboxPath=/...}}
is_sandbox = nil ~= string.find (frame:getTitle(), sandbox, 1, true); -- is this invoke the sandbox module?
sandbox = is_sandbox and sandbox or ''; -- use i18n sandbox to load sandbox modules when this module is the sandox; live modules else
cfg = mw.loadData ('Module:Citation/CS1/Configuration' .. sandbox); -- load sandbox versions of support modules when {{#invoke:Citation/CS1/sandbox|...}}; live modules else
whitelist = mw.loadData ('Module:Citation/CS1/Whitelist' .. sandbox);
utilities = require ('Module:Citation/CS1/Utilities' .. sandbox);
validation = require ('Module:Citation/CS1/Date_validation' .. sandbox);
identifiers = require ('Module:Citation/CS1/Identifiers' .. sandbox);
metadata = require ('Module:Citation/CS1/COinS' .. sandbox);
utilities.set_selected_modules (cfg); -- so that functions in Utilities can see the selected cfg tables
identifiers.set_selected_modules (cfg, utilities); -- so that functions in Identifiers can see the selected cfg tables and selected Utilities module
validation.set_selected_modules (cfg, utilities); -- so that functions in Date validataion can see selected cfg tables and the selected Utilities module
metadata.set_selected_modules (cfg, utilities); -- so that functions in COinS can see the selected cfg tables and selected Utilities module
z = utilities.z; -- table of error and category tables in Module:Citation/CS1/Utilities
local cite_args_t = {}; -- because args_t is the parent (template) frame args (which cannot be modified); params and their values will be placed here
is_preview_mode = not utilities.is_set (frame:preprocess ('{{REVISIONID}}'));
local suggestions = {}; -- table where we store suggestions if we need to loadData them
local error_text; -- used as a flag
local capture; -- the single supported capture when matching unknown parameters using patterns
local empty_unknowns = {}; -- sequence table to hold empty unknown params for error message listing
for k, v in pairs (args_t) do -- get parameters from the parent (template) frame
v = mw.ustring.gsub (v, '^%s*(.-)%s*$', '%1'); -- trim leading/trailing whitespace; when v is only whitespace, becomes empty string
if v ~= '' then
if cfg.enum_needs_xlation and 'string' == type (k) then -- for wikis that set date_names['local_digits'] to non-western digits
k = mw.ustring.gsub (k, '%d', cfg.date_names.local_digits); -- translate 'local' digits enumerators to Western 0-9
end
if not validate( k, config_t.CitationClass ) then
if type (k) ~= 'string' then -- exclude empty numbered parameters
if v:match("%S+") ~= nil then
error_text = utilities.set_message ('err_text_ignored', {v});
end
elseif validate (k:lower(), config_t.CitationClass) then
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, k:lower()}); -- suggest the lowercase version of the parameter
else
if nil == suggestions.suggestions then -- if this table is nil then we need to load it
suggestions = mw.loadData ('Module:Citation/CS1/Suggestions' .. sandbox); --load sandbox version of suggestion module when {{#invoke:Citation/CS1/sandbox|...}}; live module else
end
for pattern, param in pairs (suggestions.patterns) do -- loop through the patterns to see if we can suggest a proper parameter
capture = k:match (pattern); -- the whole match if no capture in pattern else the capture if a match
if capture then -- if the pattern matches
param = utilities.substitute (param, capture); -- add the capture to the suggested parameter (typically the enumerator)
if validate (param, config_t.CitationClass) then -- validate the suggestion to make sure that the suggestion is supported by this template (necessary for limited parameter lists)
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, param}); -- set the suggestion error message
else
error_text = utilities.set_message ('err_parameter_ignored', {k}); -- suggested param not supported by this template
v = ''; -- unset
end
end
end
if not utilities.is_set (error_text) then -- couldn't match with a pattern, is there an explicit suggestion?
if (suggestions.suggestions[ k:lower() ] ~= nil) and validate (suggestions.suggestions[ k:lower() ], config_t.CitationClass) then
utilities.set_message ('err_parameter_ignored_suggest', {k, suggestions.suggestions[ k:lower() ]});
else
utilities.set_message ('err_parameter_ignored', {k});
v = ''; -- unset value assigned to unrecognized parameters (this for the limited parameter lists)
end
end
end
end
cite_args_t[k] = v; -- save this parameter and its value
elseif not utilities.is_set (v) then -- for empty parameters
if not validate (k, config_t.CitationClass, true) then -- is this empty parameter a valid parameter
k = ('' == k) and cfg.err_msg_supl.empty_str or k; -- when k is empty string (or was space(s) trimmed to empty string), replace with descriptive text
table.insert (empty_unknowns, utilities.wrap_style ('parameter', k)); -- format for error message and add to the list
end
end
end
if 0 ~= #empty_unknowns then -- create empty unknown error message
utilities.set_message ('err_param_unknown_empty', {
1 == #empty_unknowns and '' or 's',
utilities.make_sep_list (#empty_unknowns, empty_unknowns)
});
end
local non_url_param_t = {}; -- table of parameters and values that are not url-holding parameters
local url_param_t = {}; -- table of url-holding paramters and their values
for k, v in pairs (cite_args_t) do
if 'string' == type (k) then -- don't evaluate positional parameters
has_invisible_chars (k, v); -- look for invisible characters
end
has_extraneous_punc (k, v); -- look for extraneous terminal punctuation in parameter values
missing_pipe_check (k, v); -- do we think that there is a parameter that is missing a pipe?
cite_args_t[k] = inter_wiki_check (k, v); -- when language interwiki-linked parameter missing leading colon replace with wiki-link label
if 'string' == type (k) then -- when parameter k is not positional
if not cfg.url_skip[k] then -- and not in url skip table
non_url_param_t[k] = v; -- make a parameter/value list for extraneous url check
else -- and is in url skip table (a url-holding parameter)
url_param_t[k] = v; -- make a parameter/value list to check for values that are The Wikipedia Library url
end
end
end
if cfg.suppress_archive_today_urls then
has_archive_today_url (cite_args_t); -- look for and suppress archive.today urls and dependent parameters for all templates
end
has_extraneous_url (non_url_param_t); -- look for url in parameter values where a url does not belong
has_twl_url (url_param_t, cite_args_t); -- look for url-holding parameters that hold a The Wikipedia Library url
return table.concat ({
frame:extensionTag ('templatestyles', '', {src='Module:Citation/CS1' .. sandbox .. '/styles.css'}),
citation0 (config_t, cite_args_t)
});
end
--[[--------------------------< C I T A T I O N >--------------------------------------------------------------
Template entry point
]]
local function citation (frame)
local config_t = {}; -- table to store parameters from the module {{#invoke:}}
local args_t = frame:getParent().args; -- get template's preset parameters
for k, v in pairs (frame.args) do -- get parameters from the {{#invoke}} frame
config_t[k] = v;
-- args_t[k] = v; -- crude debug support that allows us to render a citation from module {{#invoke:}}; skips parameter validation; TODO: keep?
end
return _citation (frame, args_t, config_t)
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
citation = citation, -- template entry point
_citation = _citation, -- module entry point
}
o0mp7ygqu5bibs2dabkkkkneiickrfx
Module:Citation/CS1/Date validation
828
11073768
37019532
35046682
2026-05-01T14:27:29Z
Exec8
10305
.
37019532
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local add_prop_cat, is_set, in_array, set_message, substitute, wrap_style; -- imported functions from selected Module:Citation/CS1/Utilities
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< F I L E - S C O P E D E C L A R A T I O N S >--------------------------------
File-scope variables are declared here
]]
local lang_object = mw.getContentLanguage(); -- used by is_valid_accessdate(), is_valid_year(), date_name_xlate(); TODO: move to ~/Configuration?
local year_limit; -- used by is_valid_year()
--[=[-------------------------< I S _ V A L I D _ A C C E S S D A T E >----------------------------------------
returns true if:
Wikipedia start date <= accessdate < today + 2 days
Wikipedia start date is 2001-01-15T00:00:00 UTC which is 979516800 seconds after 1970-01-01T00:00:00 UTC (the start of Unix time)
accessdate is the date provided in |access-date= at time 00:00:00 UTC
today is the current date at time 00:00:00 UTC plus 48 hours
if today is 2015-01-01T00:00:00 then
adding 24 hours gives 2015-01-02T00:00:00 – one second more than today
adding 24 hours gives 2015-01-03T00:00:00 – one second more than tomorrow
This function does not work if it is fed month names for languages other than English. Wikimedia #time: parser
apparently doesn't understand non-English date month names. This function will always return false when the date
contains a non-English month name because good1 is false after the call to lang.formatDate(). To get around that
call this function with YYYY-MM-DD format dates.
]=]
local function is_valid_accessdate (accessdate)
local good1, good2;
local access_ts, tomorrow_ts; -- to hold Unix time stamps representing the dates
good1, access_ts = pcall (lang_object.formatDate, lang_object, 'U', accessdate ); -- convert accessdate value to Unix timestamp
good2, tomorrow_ts = pcall (lang_object.formatDate, lang_object, 'U', 'today + 2 days' ); -- today midnight + 2 days is one second more than all day tomorrow
if good1 and good2 then -- lang.formatDate() returns a timestamp in the local script which which tonumber() may not understand
access_ts = tonumber (access_ts) or lang_object:parseFormattedNumber (access_ts); -- convert to numbers for the comparison;
tomorrow_ts = tonumber (tomorrow_ts) or lang_object:parseFormattedNumber (tomorrow_ts);
else
return false; -- one or both failed to convert to Unix time stamp
end
if 979516800 <= access_ts and access_ts < tomorrow_ts then -- Wikipedia start date <= accessdate < tomorrow's date
return true;
else
return false; -- accessdate out of range
end
end
--[[--------------------------< G E T _ M O N T H _ N U M B E R >----------------------------------------------
returns a number according to the month in a date: 1 for January, etc. Capitalization and spelling must be correct.
If not a valid month, returns 0
]]
local function get_month_number (month)
return cfg.date_names['local'].long[month] or cfg.date_names['local'].short[month] or -- look for local names first
cfg.date_names['en'].long[month] or cfg.date_names['en'].short[month] or -- failing that, look for English names
0; -- not a recognized month name
end
--[[--------------------------< G E T _ S E A S O N _ N U M B E R >--------------------------------------------
returns a number according to the sequence of seasons in a year: 21 for Spring, etc. Capitalization and spelling
must be correct. If not a valid season, returns 0.
21-24 = Spring, Summer, Autumn, Winter, independent of “Hemisphere”
returns 0 when <param> is not |date=
Season numbering is defined by Extended Date/Time Format (EDTF) specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019. See '§Sub-year groupings'. The standard defines various divisions using
numbers 21-41. cs1|2 only supports generic seasons. EDTF does support the distinction between north and south
hemisphere seasons but cs1|2 has no way to make that distinction.
These additional divisions not currently supported:
25-28 = Spring - Northern Hemisphere, Summer- Northern Hemisphere, Autumn - Northern Hemisphere, Winter - Northern Hemisphere
29-32 = Spring – Southern Hemisphere, Summer– Southern Hemisphere, Autumn – Southern Hemisphere, Winter - Southern Hemisphere
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
37-39 = Quadrimester 1, Quadrimester 2, Quadrimester 3 (4 months each)
40-41 = Semestral 1, Semestral-2 (6 months each)
]]
local function get_season_number (season, param)
if 'date' ~= param then
return 0; -- season dates only supported by |date=
end
return cfg.date_names['local'].season[season] or -- look for local names first
cfg.date_names['en'].season[season] or -- failing that, look for English names
0; -- not a recognized season name
end
--[[--------------------------< G E T _ Q U A R T E R _ N U M B E R >------------------------------------------
returns a number according to the sequence of quarters in a year: 33 for first quarter, etc. Capitalization and spelling
must be correct. If not a valid quarter, returns 0.
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
returns 0 when <param> is not |date=
Quarter numbering is defined by Extended Date/Time Format (EDTF) specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019. See '§Sub-year groupings'. The standard defines various divisions using
numbers 21-41. cs1|2 only supports generic seasons and quarters.
These additional divisions not currently supported:
37-39 = Quadrimester 1, Quadrimester 2, Quadrimester 3 (4 months each)
40-41 = Semestral 1, Semestral-2 (6 months each)
]]
local function get_quarter_number (quarter, param)
if 'date' ~= param then
return 0; -- quarter dates only supported by |date=
end
quarter = mw.ustring.gsub (quarter, ' +', ' '); -- special case replace multiple space chars with a single space char
return cfg.date_names['local'].quarter[quarter] or -- look for local names first
cfg.date_names['en'].quarter[quarter] or -- failing that, look for English names
0; -- not a recognized quarter name
end
--[[--------------------------< G E T _ P R O P E R _ N A M E _ N U M B E R >----------------------------------
returns a non-zero number if date contains a recognized proper-name. Capitalization and spelling must be correct.
returns 0 when <param> is not |date=
]]
local function get_proper_name_number (name, param)
if 'date' ~= param then
return 0; -- proper-name dates only supported by |date=
end
return cfg.date_names['local'].named[name] or -- look for local names dates first
cfg.date_names['en'].named[name] or -- failing that, look for English names
0; -- not a recognized named date
end
--[[--------------------------< G E T _ E L E M E N T _ N U M B E R <------------------------------------------
returns true if month or season or quarter or proper name is valid (properly spelled, capitalized, abbreviated)
]]
local function get_element_number (element, param)
local num;
local funcs = {get_month_number, get_season_number, get_quarter_number, get_proper_name_number}; -- list of functions to execute in order
for _, func in ipairs (funcs) do -- spin through the function list
num = func (element, param); -- call the function and get the returned number
if 0 ~= num then -- non-zero when valid month season quarter
return num; -- return that number
end
end
return nil; -- not valid
end
--[[--------------------------< I S _ V A L I D _ Y E A R >----------------------------------------------------
Function gets current year from the server and compares it to year from a citation parameter. Years more than one
year in the future are not acceptable.
Special case for |pmc-embargo-date=: years more than two years in the future are not acceptable
]]
local function is_valid_year (year, param)
if not is_set (year_limit) then
year_limit = tonumber(os.date("%Y"))+1; -- global variable so we only have to fetch it once
end
year = tonumber (year) or lang_object:parseFormattedNumber (year); -- convert to number for the comparison
if year and (100 > year) then -- years less than 100 not supported
return false;
end
if 'pmc-embargo-date' == param then -- special case for |pmc-embargo-date=
return year and (year <= tonumber(os.date("%Y"))+2) or false; -- years more than two years in the future are not accepted
end
return year and (year <= year_limit) or false;
end
--[[--------------------------< I S _ V A L I D _ D A T E >----------------------------------------------------
Returns true if day is less than or equal to the number of days in month and year is no farther into the future
than next year; else returns false.
Assumes Julian calendar prior to year 1582 and Gregorian calendar thereafter. Accounts for Julian calendar leap
years before 1582 and Gregorian leap years after 1582. Where the two calendars overlap (1582 to approximately
1923) dates are assumed to be Gregorian.
]]
local function is_valid_date (year, month, day, param)
local days_in_month = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
local month_length;
if not is_valid_year (year, param) then -- no farther into the future than next year except |pmc-embargo-date= no more than two years in the future
return false;
end
month = tonumber (month); -- required for YYYY-MM-DD dates
if (2 == month) then -- if February
month_length = 28; -- then 28 days unless
if 1582 > tonumber(year) then -- Julian calendar
if 0 == (year%4) then -- is a leap year?
month_length = 29; -- if leap year then 29 days in February
end
else -- Gregorian calendar
if (0 == (year%4) and (0 ~= (year%100) or 0 == (year%400))) then -- is a leap year?
month_length = 29; -- if leap year then 29 days in February
end
end
else
month_length = days_in_month[month] or 0; -- invalid month number is nil so default <month_length> to 0
end
if tonumber (day) > month_length then
return false;
end
return true;
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ R A N G E _ S T Y L E >--------------------------
Months in a range are expected to have the same style: Jan–Mar or October–December but not February–Mar or Jul–August.
This function looks in cfg.date_names{} to see if both month names are listed in the long subtable or both are
listed in the short subtable. When both have the same style (both are listed in the same table), returns true; false else
]]
local function is_valid_month_range_style (month1, month2)
if (cfg.date_names.en.long[month1] and cfg.date_names.en.long[month2]) or -- are both English names listed in the long subtable?
(cfg.date_names.en.short[month1] and cfg.date_names.en.short[month2]) or -- are both English names listed in the short subtable?
(cfg.date_names['local'].long[month1] and cfg.date_names['local'].long[month2]) or -- are both local names listed in the long subtable?
(cfg.date_names['local'].short[month1] and cfg.date_names['local'].short[month2]) then -- are both local names listed in the short subtable?
return true;
end
return false; -- names are mixed
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ S E A S O N _ R A N G E >------------------------
Check a pair of months or seasons to see if both are valid members of a month or season pair.
Month pairs are expected to be left to right, earliest to latest in time.
All season ranges are accepted as valid because there are publishers out there who have published a Summer–Spring YYYY issue, hence treat as ok
]]
local function is_valid_month_season_range(range_start, range_end, param)
local range_start_number = get_month_number (range_start);
local range_end_number;
if 0 == range_start_number then -- is this a month range?
range_start_number = get_season_number (range_start, param); -- not a month; is it a season? get start season number
range_end_number = get_season_number (range_end, param); -- get end season number
if (0 ~= range_start_number) and (0 ~= range_end_number) and (range_start_number ~= range_end_number) then
return true; -- any season pairing is accepted except when both are the same
end
return false; -- range_start and/or range_end is not a season
end
-- here when range_start is a month
range_end_number = get_month_number (range_end); -- get end month number
if range_start_number < range_end_number and -- range_start is a month; does range_start precede range_end?
is_valid_month_range_style (range_start, range_end) then -- do months have the same style?
return true; -- proper order and same style
end
return false; -- range_start month number is greater than or equal to range end number; or range end isn't a month
end
--[[--------------------------< M A K E _ C O I N S _ D A T E >------------------------------------------------
This function receives a table of date parts for one or two dates and an empty table reference declared in
Module:Citation/CS1. The function is called only for |date= parameters and only if the |date=<value> is
determined to be a valid date format. The question of what to do with invalid date formats is not answered here.
The date parts in the input table are converted to an ISO 8601 conforming date string:
single whole dates: yyyy-mm-dd
month and year dates: yyyy-mm
year dates: yyyy
ranges: yyyy-mm-dd/yyyy-mm-dd
yyyy-mm/yyyy-mm
yyyy/yyyy
Dates in the Julian calendar are reduced to year or year/year so that we don't have to do calendar conversion from
Julian to Proleptic Gregorian.
The input table has:
year, year2 – always present; if before 1582, ignore months and days if present
month, month2 – 0 if not provided, 1-12 for months, 21-24 for seasons; 99 Christmas
day, day2 – 0 if not provided, 1-31 for days
the output table receives:
rftdate: an ISO 8601 formatted date
rftchron: a free-form version of the date, usually without year which is in rftdate (season ranges and proper-name dates)
rftssn: one of four season keywords: winter, spring, summer, fall (lowercase)
rftquarter: one of four values: 1, 2, 3, 4
]]
local function make_COinS_date (input, tCOinS_date)
local date; -- one date or first date in a range
local date2 = ''; -- end of range date
input.year = tonumber (input.year) or lang_object:parseFormattedNumber (input.year); -- language-aware tonumber()
input.year2 = tonumber (input.year2) or lang_object:parseFormattedNumber (input.year2); -- COinS dates are pseudo-ISO 8601 so convert to Arabic numerals
if ((1582 == input.year) and (10 > tonumber(input.month))) or (1582 > input.year) then -- if a Julian calendar date
tCOinS_date.rftdate = tostring (input.year); -- &rft.date gets year only
return; -- done
end
-- here for all forms of Gregorian dates
if 20 < tonumber (input.month) then -- if season, quarter, or proper-name date
date = input.year; -- &rft.date gets year only
if 0 ~= input.year2 and input.year ~= input.year2 then -- if a range, only the second year portion when not the same as range start year
date = string.format ('%.4d/%.4d', input.year, input.year2) -- assemble the date range
end
local season = {[24] = 'winter', [21] = 'spring', [22] = 'summer', [23] = 'fall', [33] = '1', [34] = '2', [35] = '3', [36] = '4', [98] = 'Easter', [99] = 'Christmas'}; -- seasons lowercase, no autumn; proper-names use title case
if 0 == input.month2 then -- single season, quarter, or proper-name date
if 40 < tonumber(input.month) then
tCOinS_date.rftchron = season[input.month]; -- proper-name date; used in journal metadata only
elseif 30 < tonumber(input.month) then
tCOinS_date.rftquarter = season[input.month]; -- quarter date; used in journal metadata only
else
tCOinS_date.rftssn = season[input.month]; -- season date; used in journal metadata only
end
else -- season ranges are lumped into &rft.chron; &rft.ssn and &rft.quarter are left blank
if input.year ~= input.year2 then -- season year – season year range or season year–year
if 0 ~= input.month2 then
tCOinS_date.rftchron = string.format ('%s %s – %s %s', season[input.month], input.year, season[input.month2], input.year2); -- used in journal metadata only
end
else -- season–season year range
tCOinS_date.rftchron = season[input.month] .. '–' .. season[input.month2]; -- season–season year range; used in journal metadata only
end
end
tCOinS_date.rftdate = tostring (date);
return; -- done
end
-- here for gregorian calendar dates
if 0 ~= input.day then
date = string.format ('%s-%.2d-%.2d', input.year, tonumber(input.month), tonumber(input.day)); -- whole date
elseif 0 ~= input.month then
date = string.format ('%s-%.2d', input.year, tonumber(input.month)); -- year and month
else
date = string.format ('%s', input.year); -- just year
end
if 0 ~= input.year2 then
if 0 ~= input.day2 then
date2 = string.format ('/%s-%.2d-%.2d', input.year2, tonumber(input.month2), tonumber(input.day2)); -- whole date
elseif 0 ~= input.month2 then
date2 = string.format ('/%s-%.2d', input.year2, tonumber(input.month2)); -- year and month
else
date2 = string.format ('/%s', input.year2); -- just year
end
end
tCOinS_date.rftdate = date .. date2; -- date2 has the '/' separator
return;
end
--[[--------------------------< P A T T E R N S _ T >----------------------------------------------------------
this is the list of patterns for date formats that this module recognizes. Approximately the first half of these
patterns represent formats that might be reformatted into another format. Those that might be reformatted have
'indicator' letters that identify the content of the matching capture: 'd' (day), 'm' (month), 'a' (anchor year),
'y' (year); second day, month, year have a '2' suffix.
These patterns are used for both date validation and for reformatting. This table should not be moved to ~/Configuration
because changes to this table require changes to check_date() and to reformatter() and reformat_date()
]]
local patterns_t = {
-- year-initial numerical year-month-day
['ymd'] = {'^([1-9]%d%d%d)%-(%d%d)%-(%d%d)$', 'y', 'm', 'd'},
-- month-initial: month day, year
['Mdy'] = {'^(%D-) +([1-9]%d?), +(([1-9]%d%d%d?)%a?)$', 'm', 'd', 'a', 'y'},
-- month-initial day range: month day–day, year; days are separated by endash
['Md-dy'] = {'^(%D-) +([1-9]%d?)[%-–]([1-9]%d?), +(([1-9]%d%d%d?)%a?)$', 'm', 'd', 'd2', 'a', 'y'},
-- day-initial: day month year
['dMy'] = {'^([1-9]%d?) +(%D-) +(([1-9]%d%d%d?)%a?)$', 'd', 'm', 'a', 'y'},
-- year-initial: year month day; day: 1 or 2 two digits, leading zero allowed; not supported at en.wiki
-- ['yMd'] = {'^(([1-9]%d%d%d?)%a?) +(%D-) +(%d%d?)$', 'a', 'y', 'm', 'd'},
-- day-range-initial: day–day month year; days are separated by endash
['d-dMy'] = {'^([1-9]%d?)[%-–]([1-9]%d?) +(%D-) +(([1-9]%d%d%d?)%a?)$', 'd', 'd2', 'm', 'a', 'y'},
-- day initial month-day-range: day month - day month year; uses spaced endash
['dM-dMy'] = {'^([1-9]%d?) +(%D-) +[%-–] +([1-9]%d?) +(%D-) +(([1-9]%d%d%d?)%a?)$', 'd', 'm', 'd2', 'm2', 'a', 'y'},
-- month initial month-day-range: month day – month day, year; uses spaced endash
['Md-Mdy'] = {'^(%D-) +([1-9]%d?) +[%-–] +(%D-) +([1-9]%d?), +(([1-9]%d%d%d?)%a?)$','m', 'd', 'm2', 'd2', 'a', 'y'},
-- day initial month-day-year-range: day month year - day month year; uses spaced endash
['dMy-dMy'] = {'^([1-9]%d?) +(%D-) +([1-9]%d%d%d?) +[%-–] +([1-9]%d?) +(%D-) +(([1-9]%d%d%d?)%a?)$', 'd', 'm', 'y', 'd2', 'm2', 'a', 'y2'},
-- month initial month-day-year-range: month day, year – month day, year; uses spaced endash
['Mdy-Mdy'] = {'^(%D-) +([1-9]%d?), +([1-9]%d%d%d?) +[%-–] +(%D-) +([1-9]%d?), +(([1-9]%d%d%d?)%a?)$', 'm', 'd', 'y', 'm2', 'd2', 'a', 'y2'},
-- these date formats cannot be converted, per se, but month name can be rendered short or long
-- month/season year - month/season year; separated by spaced endash
['My-My'] = {'^(%D-) +([1-9]%d%d%d?) +[%-–] +(%D-) +(([1-9]%d%d%d?)%a?)$', 'm', 'y', 'm2', 'a', 'y2'},
-- month/season range year; months separated by endash
['M-My'] = {'^(%D-)[%-–](%D-) +(([1-9]%d%d%d?)%a?)$', 'm', 'm2', 'a', 'y'},
-- month/season year or proper-name year; quarter year when First Quarter YYYY etc.
['My'] = {'^([^%d–]-) +(([1-9]%d%d%d?)%a?)$', 'm', 'a', 'y'}, -- this way because endash is a member of %D; %D- will match January–March 2019 when it shouldn't
-- these date formats cannot be converted
['Sy4-y2'] = {'^(%D-) +(([1-9]%d)%d%d)[%-–]((%d%d)%a?)$'}, -- special case Winter/Summer year-year (YYYY-YY); year separated with unspaced endash
['Sy-y'] = {'^(%D-) +([1-9]%d%d%d?)[%-–](([1-9]%d%d%d?)%a?)$'}, -- special case Winter/Summer year-year; year separated with unspaced endash
['y-y'] = {'^([1-9]%d%d%d?)[%-–](([1-9]%d%d%d?)%a?)$'}, -- year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999
['y4-y2'] = {'^(([1-9]%d)%d%d)[%-–]((%d%d)%a?)$'}, -- year range: YYYY–YY; separated by unspaced endash
['y'] = {'^(([1-9]%d%d%d?)%a?)$'}, -- year; here accept either YYY or YYYY
}
--[[--------------------------< I S _ V A L I D _ E M B A R G O _ D A T E >------------------------------------
returns true and date value if that value has proper dmy, mdy, ymd format.
returns false and 9999 (embargoed forever) when date value is not proper format; assumes that when |pmc-embargo-date= is
set, the editor intended to embargo a PMC but |pmc-embargo-date= does not hold a single date.
]]
local function is_valid_embargo_date (v)
if v:match (patterns_t['ymd'][1]) or -- ymd
v:match (patterns_t['Mdy'][1]) or -- dmy
v:match (patterns_t['dMy'][1]) then -- mdy
return true, v;
end
return false, '9999'; -- if here not good date so return false and set embargo date to long time in future
end
--[[--------------------------< C H E C K _ D A T E >----------------------------------------------------------
Check date format to see that it is one of the formats approved by WP:DATESNO or WP:DATERANGE. Exception: only
allowed range separator is endash. Additionally, check the date to see that it is a real date: no 31 in 30-day
months; no 29 February when not a leap year. Months, both long-form and three character abbreviations, and seasons
must be spelled correctly. Future years beyond next year are not allowed.
If the date fails the format tests, this function returns false and does not return values for anchor_year and
COinS_date. When this happens, the date parameter is (DEBUG: not?) used in the COinS metadata and the CITEREF identifier gets
its year from the year parameter if present otherwise CITEREF does not get a date value.
Inputs:
date_string - date string from date-holding parameters (date, year, publication-date, access-date, pmc-embargo-date, archive-date, lay-date)
Returns:
false if date string is not a real date; else
true, anchor_year, COinS_date
anchor_year can be used in CITEREF anchors
COinS_date is ISO 8601 format date; see make_COInS_date()
]]
local function check_date (date_string, param, tCOinS_date)
local year; -- assume that year2, months, and days are not used;
local year2 = 0; -- second year in a year range
local month = 0;
local month2 = 0; -- second month in a month range
local day = 0;
local day2 = 0; -- second day in a day range
local anchor_year;
local coins_date;
if date_string:match (patterns_t['ymd'][1]) then -- year-initial numerical year month day format
year, month, day = date_string:match (patterns_t['ymd'][1]);
if 12 < tonumber(month) or 1 > tonumber(month) or 1582 > tonumber(year) or 0 == tonumber(day) then return false; end -- month or day number not valid or not Gregorian calendar
anchor_year = year;
elseif mw.ustring.match(date_string, patterns_t['Mdy'][1]) then -- month-initial: month day, year
month, day, anchor_year, year = mw.ustring.match(date_string, patterns_t['Mdy'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
elseif mw.ustring.match(date_string, patterns_t['Md-dy'][1]) then -- month-initial day range: month day–day, year; days are separated by endash
month, day, day2, anchor_year, year = mw.ustring.match(date_string, patterns_t['Md-dy'][1]);
if tonumber(day) >= tonumber(day2) then return false; end -- date range order is left to right: earlier to later; dates may not be the same;
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
month2=month; -- for metadata
year2 = year;
elseif mw.ustring.match(date_string, patterns_t['dMy'][1]) then -- day-initial: day month year
day, month, anchor_year, year = mw.ustring.match(date_string, patterns_t['dMy'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
--[[ NOT supported at en.wiki
elseif mw.ustring.match(date_string, patterns_t['yMd'][1]) then -- year-initial: year month day; day: 1 or 2 two digits, leading zero allowed
anchor_year, year, month, day = mw.ustring.match(date_string, patterns_t['yMd'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
-- end NOT supported at en.wiki ]]
elseif mw.ustring.match(date_string, patterns_t['d-dMy'][1]) then -- day-range-initial: day–day month year; days are separated by endash
day, day2, month, anchor_year, year = mw.ustring.match(date_string, patterns_t['d-dMy'][1]);
if tonumber(day) >= tonumber(day2) then return false; end -- date range order is left to right: earlier to later; dates may not be the same;
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
month2 = month; -- for metadata
year2 = year;
elseif mw.ustring.match(date_string, patterns_t['dM-dMy'][1]) then -- day initial month-day-range: day month - day month year; uses spaced endash
day, month, day2, month2, anchor_year, year = mw.ustring.match(date_string, patterns_t['dM-dMy'][1]);
if (not is_valid_month_season_range(month, month2)) or not is_valid_year(year) then return false; end -- date range order is left to right: earlier to later;
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
year2 = year;
elseif mw.ustring.match(date_string, patterns_t['Md-Mdy'][1]) then -- month initial month-day-range: month day – month day, year; uses spaced endash
month, day, month2, day2, anchor_year, year = mw.ustring.match(date_string, patterns_t['Md-Mdy'][1]);
if (not is_valid_month_season_range(month, month2, param)) or not is_valid_year(year) then return false; end
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
year2 = year;
elseif mw.ustring.match(date_string, patterns_t['dMy-dMy'][1]) then -- day initial month-day-year-range: day month year - day month year; uses spaced endash
day, month, year, day2, month2, anchor_year, year2 = mw.ustring.match(date_string, patterns_t['dMy-dMy'][1]);
if tonumber(year2) <= tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) or not is_valid_month_range_style(month, month2) then return false; end -- year2 no more than one year in the future; months same style
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
if 0 == month or 0 == month2 then return false; end -- both must be valid
elseif mw.ustring.match(date_string, patterns_t['Mdy-Mdy'][1]) then -- month initial month-day-year-range: month day, year – month day, year; uses spaced endash
month, day, year, month2, day2, anchor_year, year2 = mw.ustring.match(date_string, patterns_t['Mdy-Mdy'][1]);
if tonumber(year2) <= tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) or not is_valid_month_range_style(month, month2) then return false; end -- year2 no more than one year in the future; months same style
month = get_month_number (month); -- for metadata
month2 = get_month_number(month2);
if 0 == month or 0 == month2 then return false; end -- both must be valid
elseif mw.ustring.match(date_string, patterns_t['Sy4-y2'][1]) then -- special case Winter/Summer year-year (YYYY-YY); year separated with unspaced endash
local century;
month, year, century, anchor_year, year2 = mw.ustring.match(date_string, patterns_t['Sy4-y2'][1]);
if 'Winter' ~= month and 'Summer' ~= month then return false end; -- 'month' can only be Winter or Summer
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
year2 = century..year2; -- add the century to year2 for comparisons
if 1 ~= tonumber(year2) - tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
month = get_season_number(month, param);
elseif mw.ustring.match(date_string, patterns_t['Sy-y'][1]) then -- special case Winter/Summer year-year; year separated with unspaced endash
month, year, anchor_year, year2 = mw.ustring.match(date_string, patterns_t['Sy-y'][1]);
month = get_season_number (month, param); -- <month> can only be winter or summer; also for metadata
if (month ~= cfg.date_names['en'].season['Winter']) and (month ~= cfg.date_names['en'].season['Summer']) then
return false; -- not Summer or Winter; abandon
end
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
if 1 ~= tonumber(year2) - tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match(date_string, patterns_t['My-My'][1]) then -- month/season year - month/season year; separated by spaced endash
month, year, month2, anchor_year, year2 = mw.ustring.match(date_string, patterns_t['My-My'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
if 0 ~= get_month_number(month) and 0 ~= get_month_number(month2) and is_valid_month_range_style(month, month2) then -- both must be month year, same month style
month = get_month_number(month);
month2 = get_month_number(month2);
elseif 0 ~= get_season_number(month, param) and 0 ~= get_season_number(month2, param) then -- both must be season year, not mixed
month = get_season_number(month, param);
month2 = get_season_number(month2, param);
else
return false;
end
elseif mw.ustring.match(date_string, patterns_t['M-My'][1]) then -- month/season range year; months separated by endash
month, month2, anchor_year, year = mw.ustring.match(date_string, patterns_t['M-My'][1]);
if (not is_valid_month_season_range(month, month2, param)) or (not is_valid_year(year)) then return false; end
if 0 ~= get_month_number(month) then -- determined to be a valid range so just check this one to know if month or season
month = get_month_number(month);
month2 = get_month_number(month2);
if 0 == month or 0 == month2 then return false; end
else
month = get_season_number(month, param);
month2 = get_season_number(month2, param);
end
year2 = year;
elseif mw.ustring.match(date_string, patterns_t['My'][1]) then -- month/season/quarter/proper-name year
month, anchor_year, year = mw.ustring.match(date_string, patterns_t['My'][1]);
if not is_valid_year(year) then return false; end
month = get_element_number(month, param); -- get month season quarter proper-name number or nil
if not month then return false; end -- not valid whatever it is
elseif mw.ustring.match(date_string, patterns_t['y-y'][1]) then -- Year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999
year, anchor_year, year2 = mw.ustring.match(date_string, patterns_t['y-y'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor year from both years
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match(date_string, patterns_t['y4-y2'][1]) then -- Year range: YYYY–YY; separated by unspaced endash
local century;
year, century, anchor_year, year2 = mw.ustring.match(date_string, patterns_t['y4-y2'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor year from both years
if 13 > tonumber(year2) then return false; end -- don't allow 2003-05 which might be May 2003
year2 = century .. year2; -- add the century to year2 for comparisons
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
if in_array (param, {'date', 'publication-date', 'year'}) then -- here when 'valid' abbreviated year range; if one of these parameters
add_prop_cat ('year-range-abbreviated'); -- add properties cat
end
elseif mw.ustring.match(date_string, patterns_t['y'][1]) then -- year; here accept either YYY or YYYY
anchor_year, year = mw.ustring.match(date_string, patterns_t['y'][1]);
if false == is_valid_year(year) then
return false;
end
else
return false; -- date format not one of the MOS:DATE approved formats
end
if param ~= 'date' then -- CITEREF disambiguation only allowed in |date=; |year= & |publication-date= promote to date
if anchor_year:match ('%l$') then
return false;
end
end
if 'access-date' == param then -- test access-date here because we have numerical date parts
if 0 ~= year and 0 ~= month and 0 ~= day and -- all parts of a single date required
0 == year2 and 0 == month2 and 0 == day2 then -- none of these; access-date must not be a range
if not is_valid_accessdate(year .. '-' .. month .. '-' .. day) then
return false; -- return false when access-date out of bounds
end
else
return false; -- return false when access-date is a range of two dates
end
end
if 'archive-date' == param then -- test archive-date here because we have numerical date parts
if not (0 ~= year and 0 ~= month and 0 ~= day and -- all parts of a single date required
0 == year2 and 0 == month2 and 0 == day2) then -- none of these; archive-date must not be a range
return false; -- return false when archive-date is a range of two dates
end
end
local result=true; -- check whole dates for validity; assume true because not all dates will go through this test
if 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 == day2 then -- YMD (simple whole date)
result = is_valid_date (year, month, day, param); -- <param> for |pmc-embargo-date=
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 ~= day2 then -- YMD-d (day range)
result = is_valid_date (year, month, day);
result = result and is_valid_date (year, month, day2);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 ~= month2 and 0 ~= day2 then -- YMD-md (day month range)
result = is_valid_date (year, month, day);
result = result and is_valid_date (year, month2, day2);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 ~= year2 and 0 ~= month2 and 0 ~= day2 then -- YMD-ymd (day month year range)
result = is_valid_date(year, month, day);
result = result and is_valid_date(year2, month2, day2);
end
if false == result then return false; end
if nil ~= tCOinS_date then -- this table only passed into this function when testing |date= parameter values
make_COinS_date ({year = year, month = month, day = day, year2 = year2, month2 = month2, day2 = day2}, tCOinS_date); -- make an ISO 8601 date string for COinS
end
return true, anchor_year; -- format is good and date string represents a real date
end
--[[--------------------------< D A T E S >--------------------------------------------------------------------
Cycle the date-holding parameters in passed table date_parameters_list through check_date() to check compliance with MOS:DATE. For all valid dates, check_date() returns
true. The |date= parameter test is unique, it is the only date holding parameter from which values for anchor_year (used in CITEREF identifiers) and COinS_date (used in
the COinS metadata) are derived. The |date= parameter is the only date-holding parameter that is allowed to contain the no-date keywords "n.d." or "nd" (without quotes).
Unlike most error messages created in this module, only one error message is created by this function. Because all of the date holding parameters are processed serially,
parameters with errors are added to the <error_list> sequence table as the dates are tested.
]]
local function dates(date_parameters_list, tCOinS_date, error_list)
local anchor_year; -- will return as nil if the date being tested is not |date=
local COinS_date; -- will return as nil if the date being tested is not |date=
local embargo_date; -- if embargo date is a good dmy, mdy, ymd date then holds original value else reset to 9999
local good_date = false;
for k, v in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set(v.val) then -- if the parameter has a value
v.val = mw.ustring.gsub(v.val, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
if v.val:match("^c%. [1-9]%d%d%d?%a?$") then -- special case for c. year or with or without CITEREF disambiguator - only |date= and |year=
local year = v.val:match("c%. ([1-9]%d%d%d?)%a?"); -- get the year portion so it can be tested
if 'date' == k then
anchor_year, COinS_date = v.val:match("((c%. [1-9]%d%d%d?)%a?)"); -- anchor year and COinS_date only from |date= parameter
good_date = is_valid_year(year);
elseif 'year' == k then
good_date = is_valid_year(year);
else
good_date = false;
end
elseif 'date' == k then -- if the parameter is |date=
if v.val:match("^n%.d%.%a?$") then -- ToDo: I18N -- if |date=n.d. with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((n%.d%.)%a?)"); -- ToDo: I18N -- "n.d."; no error when date parameter is set to no date
elseif v.val:match("^nd%a?$") then -- ToDo: I18N -- if |date=nd with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((nd)%a?)"); -- ToDo: I18N -- "nd"; no error when date parameter is set to no date
else
good_date, anchor_year, COinS_date = check_date (v.val, k, tCOinS_date); -- go test the date
end
elseif 'year' == k then -- if the parameter is |year= it should hold only a year value
if v.val:match("^[1-9]%d%d%d?%a?$") then -- if |year = 3 or 4 digits only with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((%d+)%a?)");
else
good_date = false;
end
elseif 'pmc-embargo-date' == k then -- if the parameter is |pmc-embargo-date=
good_date = check_date (v.val, k); -- go test the date
if true == good_date then -- if the date is a valid date
good_date, embargo_date = is_valid_embargo_date (v.val); -- is |pmc-embargo-date= date a single dmy, mdy, or ymd formatted date? yes: returns embargo date; no: returns 9999
end
else -- any other date-holding parameter
good_date = check_date (v.val, k); -- go test the date
end
if false == good_date then -- assemble one error message so we don't add the tracking category multiple times
table.insert (error_list, wrap_style ('parameter', v.name)); -- make parameter name suitable for error message list
end
end
end
return anchor_year, embargo_date; -- and done
end
--[[--------------------------< Y E A R _ C H E C K >----------------------------------------------------------
Temporary function to test |year= for acceptable values:
YYY, YYYY, year-only ranges, their circa forms, with or without CITEREF disambiguators.
When |year= holds some form of date that is not one of these year-only dates, emit a maintenance message.
This function necessary because many non-cs1|2 templates have a |year= parameter so cirrus searches are more-or-
less useless
]]
local function year_check (year)
year = year:gsub ('c%. *', ''); -- remove circa annotation (if present) before testing <year>
for _, index in ipairs ({'y-y', 'y4-y2', 'y'}) do -- spin through these indexes into patterns_t
if mw.ustring.match (year, patterns_t[index][1]) then
return; -- if a match then |year= holds a valid 'year'
end
end
set_message ('maint_year'); -- if here, |year= value is not an accepted value; add a maint cat
end
--[[--------------------------< Y E A R _ D A T E _ C H E C K >------------------------------------------------
Compare the value provided in |year= with the year value(s) provided in |date=. This function sets a local numeric value:
0 - year value does not match the year value in date
1 - (default) year value matches the year value in date or one of the year values when date contains two years
2 - year value matches the year value in date when date is in the form YYYY-MM-DD and year is disambiguated (|year=YYYYx)
the numeric value in <result> determines the 'output' if any from this function:
0 – adds error message to error_list sequence table
1 – adds maint cat
2 – does nothing
]]
local function year_date_check (year_string, year_origin, date_string, date_origin, error_list)
local year;
local date1;
local date2;
local result = 1; -- result of the test; assume that the test passes
year = year_string:match ('(%d%d%d%d?)');
if date_string:match ('%d%d%d%d%-%d%d%-%d%d') then --special case where both date and year are required YYYY-MM-DD and YYYYx
date1 = date_string:match ('(%d%d%d%d)');
year = year_string:match ('(%d%d%d%d)');
if year ~= date1 then
result = 0; -- years don't match
elseif year_string:match ('%d%d%d%d%a') then
result = 2; -- years match; but because disambiguated, don't add to maint cat
end
elseif date_string:match ("%d%d%d%d?.-%d%d%d%d?") then -- any of the standard range formats of date with two three- or four-digit years
date1, date2 = date_string:match ("(%d%d%d%d?).-(%d%d%d%d?)");
if year ~= date1 and year ~= date2 then
result = 0;
end
elseif mw.ustring.match(date_string, "%d%d%d%d[%-–]%d%d") then -- YYYY-YY date ranges
local century;
date1, century, date2 = mw.ustring.match(date_string, "((%d%d)%d%d)[%-–]+(%d%d)");
date2 = century..date2; -- convert YY to YYYY
if year ~= date1 and year ~= date2 then
result = 0;
end
elseif date_string:match ("%d%d%d%d?") then -- any of the standard formats of date with one year
date1 = date_string:match ("(%d%d%d%d?)");
if year ~= date1 then
result = 0;
end
else -- should never get here; this function called only when no other date errors
result = 0; -- no recognizable year in date
end
if 0 == result then -- year / date mismatch
table.insert (error_list, substitute (cfg.messages['mismatch'], {year_origin, date_origin})); -- add error message to error_list sequence table
elseif 1 == result then -- redundant year / date
set_message ('maint_date_year'); -- add a maint cat
end
end
--[[--------------------------< R E F O R M A T T E R >--------------------------------------------------------
reformat 'date' into new format specified by format_param if pattern_idx (the current format of 'date') can be
reformatted. Does the grunt work for reformat_dates().
The table re_formats maps pattern_idx (current format) and format_param (desired format) to a table that holds:
format string used by string.format()
identifier letters ('d', 'm', 'y', 'd2', 'm2', 'y2') that serve as indexes into a table t{} that holds captures
from mw.ustring.match() for the various date parts specified by patterns_t[pattern_idx][1]
Items in patterns_t{} have the general form:
['ymd'] = {'^(%d%d%d%d)%-(%d%d)%-(%d%d)$', 'y', 'm', 'd'}, where:
['ymd'] is pattern_idx
patterns_t['ymd'][1] is the match pattern with captures for mw.ustring.match()
patterns_t['ymd'][2] is an indicator letter identifying the content of the first capture
patterns_t['ymd'][3] ... the second capture etc.
when a pattern matches a date, the captures are loaded into table t{} in capture order using the idemtifier
characters as indexes into t{} For the above, a ymd date is in t{} as:
t.y = first capture (year), t.m = second capture (month), t.d = third capture (day)
To reformat, this function is called with the pattern_idx that matches the current format of the date and with
format_param set to the desired format. This function loads table t{} as described and then calls string.format()
with the format string specified by re_format[pattern_idx][format_param][1] using values taken from t{} according
to the capture identifier letters specified by patterns_t[pattern_idx][format_param][n] where n is 2..
]]
local re_formats = {
['ymd'] = { -- date format is ymd; reformat to:
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['Mdy'] = { -- date format is Mdy; reformat to:
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- for long/short reformatting
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['dMy'] = { -- date format is dMy; reformat to:
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['Md-dy'] = { -- date format is Md-dy; reformat to:
['mdy'] = {'%s %s–%s, %s', 'm', 'd', 'd2', 'y'}, -- for long/short reformatting
['dmy'] = {'%s–%s %s %s', 'd', 'd2', 'm', 'y'}, -- |df=dmy -> d-dMy
},
['d-dMy'] = { -- date format is d-d>y; reformat to:
['dmy'] = {'%s–%s %s %s', 'd', 'd2', 'm', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s–%s, %s', 'm', 'd', 'd2', 'y'}, -- |df=mdy -> Md-dy
},
['dM-dMy'] = { -- date format is dM-dMy; reformat to:
['dmy'] = {'%s %s – %s %s %s', 'd', 'm', 'd2', 'm2', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s – %s %s, %s', 'm', 'd', 'm2', 'd2', 'y'}, -- |df=mdy -> Md-Mdy
},
['Md-Mdy'] = { -- date format is Md-Mdy; reformat to:
['mdy'] = {'%s %s – %s %s, %s', 'm', 'd', 'm2', 'd2', 'y'}, -- for long/short reformatting
['dmy'] = {'%s %s – %s %s %s', 'd', 'm', 'd2', 'm2', 'y'}, -- |df=dmy -> dM-dMy
},
['dMy-dMy'] = { -- date format is dMy-dMy; reformat to:
['dmy'] = {'%s %s %s – %s %s %s', 'd', 'm', 'y', 'd2', 'm2', 'y2'}, -- for long/short reformatting
['mdy'] = {'%s %s, %s – %s %s, %s', 'm', 'd', 'y', 'm2', 'd2', 'y2'}, -- |df=mdy -> Mdy-Mdy
},
['Mdy-Mdy'] = { -- date format is Mdy-Mdy; reformat to:
['mdy'] = {'%s %s, %s – %s %s, %s', 'm', 'd', 'y', 'm2', 'd2', 'y2'}, -- for long/short reformatting
['dmy'] = {'%s %s %s – %s %s %s', 'd', 'm', 'y', 'd2', 'm2', 'y2'}, -- |df=dmy -> dMy-dMy
},
['My-My'] = { -- these for long/short reformatting
['any'] = {'%s %s – %s %s', 'm', 'y', 'm2', 'y2'}, -- dmy/mdy agnostic
},
['M-My'] = { -- these for long/short reformatting
['any'] = {'%s–%s %s', 'm', 'm2', 'y'}, -- dmy/mdy agnostic
},
['My'] = { -- these for long/short reformatting
['any'] = {'%s %s', 'm', 'y'}, -- dmy/mdy agnostic
},
-- ['yMd'] = { -- not supported at en.wiki
-- ['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
-- ['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
-- ['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- },
}
local function reformatter (date, pattern_idx, format_param, mon_len)
if not in_array (pattern_idx, {'ymd', 'Mdy', 'Md-dy', 'dMy', 'yMd', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy', 'My-My', 'M-My', 'My'}) then
return; -- not in this set of date format patterns_t then not a reformattable date
end
if 'ymd' == format_param and in_array (pattern_idx, {'ymd', 'Md-dy', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy', 'My-My', 'M-My', 'My'}) then
return; -- ymd date ranges not supported at en.wiki; no point in reformatting ymd to ymd
end
if in_array (pattern_idx, {'My', 'M-My', 'My-My'}) then -- these are not dmy/mdy so can't be 'reformatted' into either
format_param = 'any'; -- so format-agnostic
end
-- yMd is not supported at en.wiki; when yMd is supported at your wiki, uncomment the next line
-- if 'yMd' == format_param and in_array (pattern_idx, {'yMd', 'Md-dy', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy'}) then -- these formats not convertable; yMd not supported at en.wiki
if 'yMd' == format_param then -- yMd not supported at en.wiki; when yMd is supported at your wiki, remove or comment-out this line
return; -- not a reformattable date
end
local c1, c2, c3, c4, c5, c6, c7; -- these hold the captures specified in patterns_t[pattern_idx][1]
c1, c2, c3, c4, c5, c6, c7 = mw.ustring.match (date, patterns_t[pattern_idx][1]); -- get the captures
local t = { -- table that holds k/v pairs of date parts from the captures and patterns_t[pattern_idx][2..]
[patterns_t[pattern_idx][2]] = c1; -- at minimum there is always one capture with a matching indicator letter
[patterns_t[pattern_idx][3] or 'x'] = c2; -- patterns_t can have a variable number of captures; each capture requires an indicator letter;
[patterns_t[pattern_idx][4] or 'x'] = c3; -- where there is no capture, there is no indicator letter so n in patterns_t[pattern_idx][n] will be nil;
[patterns_t[pattern_idx][5] or 'x'] = c4; -- the 'x' here spoofs an indicator letter to prevent 'table index is nil' error
[patterns_t[pattern_idx][6] or 'x'] = c5;
[patterns_t[pattern_idx][7] or 'x'] = c6;
[patterns_t[pattern_idx][8] or 'x'] = c7;
};
if t.a then -- if this date has an anchor year capture (all convertable date formats except ymd)
if t.y2 then -- for year range date formats
t.y2 = t.a; -- use the anchor year capture when reassembling the date
else -- here for single date formats (except ymd)
t.y = t.a; -- use the anchor year capture when reassembling the date
end
end
if tonumber(t.m) then -- if raw month is a number (converting from ymd)
if 's' == mon_len then -- if we are to use abbreviated month names
t.m = cfg.date_names['inv_local_short'][tonumber(t.m)]; -- convert it to a month name
else
t.m = cfg.date_names['inv_local_long'][tonumber(t.m)]; -- convert it to a month name
end
t.d = t.d:gsub ('0(%d)', '%1'); -- strip leading '0' from day if present
elseif 'ymd' == format_param then -- when converting to ymd
t.y = t.y:gsub ('%a', ''); -- strip CITREF disambiguator if present; anchor year already known so process can proceed; TODO: maint message?
if 1582 > tonumber (t.y) then -- ymd format dates not allowed before 1582
return;
end
t.m = string.format ('%02d', get_month_number (t.m)); -- make sure that month and day are two digits
t.d = string.format ('%02d', t.d);
elseif mon_len then -- if mon_len is set to either 'short' or 'long'
for _, mon in ipairs ({'m', 'm2'}) do -- because there can be two month names, check both
if t[mon] then
t[mon] = get_month_number (t[mon]); -- get the month number for this month (is length agnostic)
if 0 == t[mon] then return; end -- seasons and named dates can't be converted
t[mon] = (('s' == mon_len) and cfg.date_names['inv_local_short'][t[mon]]) or cfg.date_names['inv_local_long'][t[mon]]; -- fetch month name according to length
end
end
end
local new_date = string.format (re_formats[pattern_idx][format_param][1], -- format string
t[re_formats[pattern_idx][format_param][2]], -- named captures from t{}
t[re_formats[pattern_idx][format_param][3]],
t[re_formats[pattern_idx][format_param][4]],
t[re_formats[pattern_idx][format_param][5]],
t[re_formats[pattern_idx][format_param][6]],
t[re_formats[pattern_idx][format_param][7]],
t[re_formats[pattern_idx][format_param][8]]
);
return new_date;
end
--[[-------------------------< R E F O R M A T _ D A T E S >--------------------------------------------------
Reformats existing dates into the format specified by format.
format is one of several manual keywords: dmy, dmy-all, mdy, mdy-all, ymd, ymd-all. The -all version includes
access- and archive-dates; otherwise these dates are not reformatted.
This function allows automatic date formatting. In ~/Configuration, the article source is searched for one of
the {{use xxx dates}} templates. If found, xxx becomes the global date format as xxx-all. If |cs1-dates= in
{{use xxx dates}} has legitimate value then that value determines how cs1|2 dates will be rendered. Legitimate
values for |cs1-dates= are:
l - all dates are rendered with long month names
ls - publication dates use long month names; access-/archive-dates use abbreviated month names
ly - publication dates use long month names; access-/archive-dates rendered in ymd format
s - all dates are rendered with abbreviated (short) month names
sy - publication dates use abbreviated month names; access-/archive-dates rendered in ymd format
y - all dates are rendered in ymd format
the format argument for automatic date formatting will be the format specified by {{use xxx dates}} with the
value supplied by |cs1-dates so one of: xxx-l, xxx-ls, xxx-ly, xxx-s, xxx-sy, xxx-y, or simply xxx (|cs1-dates=
empty, omitted, or invalid) where xxx shall be either of dmy or mdy.
dates are extracted from date_parameters_list, reformatted (if appropriate), and then written back into the
list in the new format. Dates in date_parameters_list are presumed here to be valid (no errors). This function
returns true when a date has been reformatted, false else. Actual reformatting is done by reformatter().
]]
local function reformat_dates (date_parameters_list, format)
local all = false; -- set to false to skip access- and archive-dates
local len_p = 'l'; -- default publication date length shall be long
local len_a = 'l'; -- default access-/archive-date length shall be long
local result = false;
local new_date;
if format:match('%a+%-all') then -- manual df keyword; auto df keyword when length not specified in {{use xxx dates}};
format = format:match('(%a+)%-all'); -- extract the format
all = true; -- all dates are long format dates because this keyword doesn't specify length
elseif format:match('%a+%-[lsy][sy]?') then -- auto df keywords; internal only
all = true; -- auto df applies to all dates; use length specified by capture len_p for all dates
format, len_p, len_a = format:match('(%a+)%-([lsy])([sy]?)'); -- extract the format and length keywords
if 'y' == len_p then -- because allowed by MOS:DATEUNIFY (sort of) range dates and My dates not reformatted
format = 'ymd'; -- override {{use xxx dates}}
elseif (not is_set(len_a)) or (len_p == len_a) then -- no access-/archive-date length specified or same length as publication dates then
len_a = len_p; -- in case len_a not set
end
end -- else only publication dates and they are long
for param_name, param_val in pairs (date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) then -- if the parameter has a value
if not (not all and in_array (param_name, {'access-date', 'archive-date'})) then -- skip access- or archive-date unless format is xxx-all; yeah, ugly; TODO: find a better way
for pattern_idx, pattern in pairs (patterns_t) do
if mw.ustring.match (param_val.val, pattern[1]) then
if all and in_array (param_name, {'access-date', 'archive-date'}) then -- if this date is an access- or archive-date
new_date = reformatter (param_val.val, pattern_idx, (('y' == len_a) and 'ymd') or format, len_a); -- choose ymd or dmy/mdy according to len_a setting
else -- all other dates
new_date = reformatter (param_val.val, pattern_idx, format, len_p);
end
if new_date then -- set when date was reformatted
date_parameters_list[param_name].val = new_date; -- update date in date list
result = true; -- and announce that changes have been made
break;
end
end -- if
end -- for
end -- if
end -- if
end -- for
return result; -- declare boolean result and done
end
--[[--------------------------< D A T E _ H Y P H E N _ T O _ D A S H >----------------------------------------
Loops through the list of date-holding parameters and converts any hyphen to an ndash. Not called if the cs1|2
template has any date errors.
Modifies the date_parameters_list and returns true if hyphens are replaced, else returns false.
]]
local function date_hyphen_to_dash (date_parameters_list)
local result = false;
local n;
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) and
not mw.ustring.match (param_val.val, patterns_t.ymd[1]) then -- for those that are not ymd dates (ustring because here digits may not be Western)
param_val.val, n = param_val.val:gsub ('%-', '–'); -- replace any hyphen with ndash
if 0 ~= n then
date_parameters_list[param_name].val = param_val.val; -- update the list
result = true;
end
end
end
return result; -- so we know if any hyphens were replaced
end
--[[-------------------------< D A T E _ N A M E _ X L A T E >------------------------------------------------
Attempts to translate English date names to local-language date names using names supplied by MediaWiki's
date parser function. This is simple name-for-name replacement and may not work for all languages.
if xlat_dig is true, this function will also translate Western (English) digits to the local language's digits.
This will also translate ymd dates.
]]
local function date_name_xlate (date_parameters_list, xlt_dig)
local xlate;
local mode; -- long or short month names
local modified = false;
local date;
local sources_t = {
{cfg.date_names.en.long, cfg.date_names.inv_local_long}, -- for translating long English month names to long local month names
{cfg.date_names.en.short, cfg.date_names.inv_local_short}, -- short month names
{cfg.date_names.en.quarter, cfg.date_names.inv_local_quarter}, -- quarter date names
{cfg.date_names.en.season, cfg.date_names.inv_local_season}, -- season date nam
{cfg.date_names.en.named, cfg.date_names.inv_local_named}, -- named dates
}
local function is_xlateable (month) -- local function to get local date name that replaces existing English-language date name
for _, date_names_t in ipairs (sources_t) do -- for each sequence table in date_names_t
if date_names_t[1][month] then -- if date name is English month (long or short), quarter, season or named and
if date_names_t[2][date_names_t[1][month]] then -- if there is a matching local date name
return date_names_t[2][date_names_t[1][month]]; -- return the local date name
end
end
end
end
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set(param_val.val) then -- if the parameter has a value
date = param_val.val;
for month in mw.ustring.gmatch (date, '[%a ]+') do -- iterate through all date names in the date (single date or date range)
month = mw.text.trim (month); -- this because quarterly dates contain whitespace
xlate = is_xlateable (month); -- get translate <month>; returns translation or nil
if xlate then
date = mw.ustring.gsub (date, month, xlate); -- replace the English with the translation
date_parameters_list[param_name].val = date; -- save the translated date
modified = true;
end
end
if xlt_dig then -- shall we also translate digits?
date = date:gsub ('%d', cfg.date_names.xlate_digits); -- translate digits from Western to 'local digits'
date_parameters_list[param_name].val = date; -- save the translated date
modified = true;
end
end
end
return modified;
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
add_prop_cat = utilities_page_ptr.add_prop_cat ; -- import functions from selected Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
set_message = utilities_page_ptr.set_message;
substitute = utilities_page_ptr.substitute;
wrap_style = utilities_page_ptr.wrap_style;
cfg = cfg_table_ptr; -- import tables from selected Module:Citation/CS1/Configuration
end
--[[--------------------------< A R C H I V E _ D A T E _ C H E C K >------------------------------------------
Compare value in |archive-date= with the timestamp in Wayback machine urls. Emits an error message with suggested
date from the |archive-url= timestamp in an appropriate format when the value in |archive-date= does not match
the timestamp.
this function never called when any date in a cs1|2 template has errors
error message suggests new |archive-date= value in an appropriate format specified by <df>. <df> is either
|df= or cfg.global_df in that order. If <df> is nil, suggested date has format from |archive-date=. There is
a caveat: when |df=dmy or |df=mdy, the reformatter leaves |access-date= and |archive-date= formats as they are.
The error message suggested date is passed to the formatter as YYYY-MM-DD so when |df=dmy or |df=mdy, the format
is not changed.
]]
local function archive_date_check (archive_date, archive_url_timestamp, df)
local archive_date_format = 'dmy-y'; -- holds the date format of date in |archive-date; default to ymd; 'dmy' used here to spoof reformat_dates()
for _, v_t in ipairs ({{'dMy', 'dmy-all'}, {'Mdy', 'mdy-all'}}) do -- is |archive-date= format dmy or mdy?
if archive_date:match (patterns_t[v_t[1]][1]) then -- does the pattern match?
archive_date_format = cfg.keywords_xlate[v_t[2]]; -- get appropriate |df= supported keyword from the i18n translator table
break;
end
end
local dates_t = {};
dates_t['archive-date'] = {val=archive_date, name=''}; -- setup to call reformat_dates(); never called when errors so <name> unset as not needed
reformat_dates (dates_t, 'dmy-y'); -- reformat |archive-date= to ymd; 'dmy' used here to spoof reformat_dates()
local archive_url_date = archive_url_timestamp:gsub ('(%d%d%d%d)(%d%d)(%d%d)%d*', '%1-%2-%3'); -- make ymd format date from timestamp
if dates_t['archive-date'].val == archive_url_date then -- are the two dates the same
return; -- yes, done
else
dates_t['archive-date'] = {val=archive_url_date, name=''}; -- setup to call reformat_dates() with the timestamp date
reformat_dates (dates_t, df or archive_date_format); -- reformat timestamp to format specified by <df> or format used in |archive-date=
archive_url_date = dates_t['archive-date'].val;
set_message ('err_archive_date_url_ts_mismatch', archive_url_date); -- emit an error message
end
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return { -- return exported functions
archive_date_check = archive_date_check,
date_hyphen_to_dash = date_hyphen_to_dash,
date_name_xlate = date_name_xlate,
dates = dates,
is_valid_date = is_valid_date,
reformat_dates = reformat_dates,
set_selected_modules = set_selected_modules,
year_check = year_check,
year_date_check = year_date_check,
}
039z8dc7ugbbv8w4tsnejz5bfud8dgw
Module:Citation/CS1/Whitelist
828
11074202
37019531
35046678
2026-05-01T14:26:51Z
Exec8
10305
37019531
Scribunto
text/plain
--[[--------------------------< S U P P O R T E D P A R A M E T E R S >--------------------------------------
Because a steady-state signal conveys no useful information, whitelist.basic_arguments[] list items can have three values:
true - these parameters are valid and supported parameters
false - these parameters are deprecated but still supported
tracked - these parameters are valid and supported parameters tracked in an eponymous properties category
nil - these parameters are no longer supported. remove entirely
]]
local basic_arguments_t = {
['accessdate'] = true,
['access-date'] = true,
['agency'] = true,
['archivedate'] = true,
['archive-date'] = true,
['archive-format'] = true,
['archiveurl'] = true,
['archive-url'] = true,
['article'] = true,
['article-format'] = true,
['article-number'] = true, -- {{cite journal}}, {{cite conference}}; {{citation}} when |journal= has a value
['article-url'] = true,
['article-url-access'] = true,
['arxiv'] = true, -- cite arxiv; here because allowed in cite ... as identifier
['asin'] = true,
['ASIN'] = true,
['asin-tld'] = true,
['at'] = true,
['author'] = true,
['author-first'] = true,
['author-given'] = true,
['author-last'] = true,
['author-surname'] = true,
['authorlink'] = true,
['author-link'] = true,
['author-mask'] = true,
['bibcode'] = true,
['bibcode-access'] = true,
['biorxiv'] = true, -- cite biorxiv; here because allowed in cite ... as identifier
['chapter'] = true,
['chapter-format'] = true,
['chapter-url'] = true,
['chapter-url-access'] = true,
['citeseerx'] = true, -- cite citeseerx; here because allowed in cite ... as identifier
['collaboration'] = true,
['contribution'] = true,
['contribution-format'] = true,
['contribution-url'] = true,
['contribution-url-access'] = true,
['contributor'] = true,
['contributor-first'] = true,
['contributor-given'] = true,
['contributor-last'] = true,
['contributor-surname'] = true,
['contributor-link'] = true,
['contributor-mask'] = true,
['date'] = true,
['department'] = true,
['df'] = true,
['dictionary'] = true,
['display-authors'] = true,
['display-contributors'] = true,
['display-editors'] = true,
['display-interviewers'] = true,
['display-subjects'] = true,
['display-translators'] = true,
['doi'] = true,
['DOI'] = true,
['doi-access'] = true,
['doi-broken-date'] = true,
['edition'] = true,
['editor'] = true,
['editor-first'] = true,
['editor-given'] = true,
['editor-last'] = true,
['editor-surname'] = true,
['editor-link'] = true,
['editor-mask'] = true,
['eissn'] = true,
['EISSN'] = true,
['encyclopaedia'] = true,
['encyclopedia'] = true,
['entry'] = true,
['entry-format'] = true,
['entry-url'] = true,
['entry-url-access'] = true,
['eprint'] = true, -- cite arxiv; here because allowed in cite ... as identifier
['first'] = true,
['format'] = true,
['given'] = true,
['hdl'] = true,
['HDL'] = true,
['hdl-access'] = true,
['host'] = true, -- unique to certain templates?
['id'] = true,
['ID'] = true,
['institution'] = true, -- constrain to cite thesis?
['interviewer'] = true,
['interviewer-first'] = true,
['interviewer-given'] = true,
['interviewer-last'] = true,
['interviewer-surname'] = true,
['interviewer-link'] = true,
['interviewer-mask'] = true,
['isbn'] = true,
['ISBN'] = true,
['ismn'] = true,
['ISMN'] = true,
['issn'] = true,
['ISSN'] = true,
['issue'] = true,
['jfm'] = true,
['JFM'] = true,
['journal'] = true,
['jstor'] = true,
['JSTOR'] = true,
['jstor-access'] = true,
['lang'] = true,
['language'] = true,
['last'] = true,
['lccn'] = true,
['LCCN'] = true,
['location'] = true,
['magazine'] = true,
['medium'] = true,
['medrxiv'] = true, -- cite medrxiv; here because allowed in cite ... as identifier
['minutes'] = true, -- constrain to cite AV media and podcast?
['mode'] = true,
['mr'] = true,
['MR'] = true,
['name-list-style'] = true,
['newspaper'] = true,
['no-pp'] = true,
['no-tracking'] = true,
['number'] = true,
['oclc'] = true,
['OCLC'] = true,
['ol'] = true,
['OL'] = true,
['ol-access'] = true,
['orig-date'] = true,
['origyear'] = true,
['orig-year'] = true,
['osti'] = true,
['OSTI'] = true,
['osti-access'] = true,
['others'] = true,
['p'] = true,
['page'] = true,
['pages'] = true,
['periodical'] = true,
['place'] = true,
['pmc'] = true,
['PMC'] = true,
['pmc-embargo-date'] = true,
['pmid'] = true,
['PMID'] = true,
['postscript'] = true,
['pp'] = true,
['publication-date'] = true,
['publication-place'] = true,
['publisher'] = true,
['quotation'] = true,
['quote'] = true,
['quote-page'] = true,
['quote-pages'] = true,
['ref'] = true,
['rfc'] = true,
['RFC'] = true,
['sbn'] = true,
['SBN'] = true,
['scale'] = true,
['script-article'] = true,
['script-chapter'] = true,
['script-contribution'] = true,
['script-encyclopaedia'] = true,
['script-encyclopedia'] = true,
['script-entry'] = true,
['script-journal'] = true,
['script-magazine'] = true,
['script-newspaper'] = true,
['script-periodical'] = true,
['script-quote'] = true,
['script-section'] = true,
['script-title'] = true,
['script-website'] = true,
['script-work'] = true,
['section'] = true,
['section-format'] = true,
['section-url'] = true,
['section-url-access'] = true,
['series'] = true,
['ssrn'] = true, -- cite ssrn; these three here because allowed in cite ... as identifier
['SSRN'] = true,
['ssrn-access'] = true,
['subject'] = true,
['subject-first'] = true,
['subject-given'] = true,
['subject-last'] = true,
['subject-link'] = true,
['subject-mask'] = true,
['subject-surname'] = true,
['surname'] = true,
['s2cid'] = true,
['S2CID'] = true,
['s2cid-access'] = true,
['template-doc-demo'] = true,
['time'] = true, -- constrain to cite av media and podcast?
['time-caption'] = true, -- constrain to cite av media and podcast?
['title'] = true,
['title-link'] = true,
['title-note'] = true,
['translator'] = true,
['translator-first'] = true,
['translator-given'] = true,
['translator-last'] = true,
['translator-surname'] = true,
['translator-link'] = true,
['translator-mask'] = true,
['trans-article'] = true,
['trans-chapter'] = true,
['trans-contribution'] = true,
['trans-encyclopaedia'] = true,
['trans-encyclopedia'] = true,
['trans-entry'] = true,
['trans-journal'] = true,
['trans-magazine'] = true,
['trans-newspaper'] = true,
['trans-periodical'] = true,
['trans-quote'] = true,
['trans-section'] = true,
['trans-title'] = true,
['trans-website'] = true,
['trans-work'] = true,
['type'] = true,
['url'] = true,
['URL'] = true,
['url-access'] = true,
['url-status'] = true,
['vauthors'] = true,
['veditors'] = true,
['version'] = true,
['via'] = true,
['volume'] = true,
['website'] = true,
['work'] = true,
['year'] = true,
['zbl'] = true,
['ZBL'] = true,
}
local numbered_arguments_t = {
['author#'] = true,
['author-first#'] = true,
['author#-first'] = true,
['author-given#'] = true,
['author#-given'] = true,
['author-last#'] = true,
['author#-last'] = true,
['author-surname#'] = true,
['author#-surname'] = true,
['author-link#'] = true,
['author#-link'] = true,
['authorlink#'] = true,
['author#link'] = true,
['author-mask#'] = true,
['author#-mask'] = true,
['contributor#'] = true,
['contributor-first#'] = true,
['contributor#-first'] = true,
['contributor-given#'] = true,
['contributor#-given'] = true,
['contributor-last#'] = true,
['contributor#-last'] = true,
['contributor-surname#'] = true,
['contributor#-surname'] = true,
['contributor-link#'] = true,
['contributor#-link'] = true,
['contributor-mask#'] = true,
['contributor#-mask'] = true,
['editor#'] = true,
['editor-first#'] = true,
['editor#-first'] = true,
['editor-given#'] = true,
['editor#-given'] = true,
['editor-last#'] = true,
['editor#-last'] = true,
['editor-surname#'] = true,
['editor#-surname'] = true,
['editor-link#'] = true,
['editor#-link'] = true,
['editor-mask#'] = true,
['editor#-mask'] = true,
['first#'] = true,
['given#'] = true,
['host#'] = true,
['interviewer#'] = true,
['interviewer-first#'] = true,
['interviewer#-first'] = true,
['interviewer-given#'] = true,
['interviewer#-given'] = true,
['interviewer-last#'] = true,
['interviewer#-last'] = true,
['interviewer-surname#'] = true,
['interviewer#-surname'] = true,
['interviewer-link#'] = true,
['interviewer#-link'] = true,
['interviewer-mask#'] = true,
['interviewer#-mask'] = true,
['last#'] = true,
['subject#'] = true,
['subject-first#'] = true,
['subject#-first'] = true,
['subject-given#'] = true,
['subject#-given'] = true,
['subject-last#'] = true,
['subject#-last'] = true,
['subject-link#'] = true,
['subject#-link'] = true,
['subject-mask#'] = true,
['subject#-mask'] = true,
['subject-surname#'] = true,
['subject#-surname'] = true,
['surname#'] = true,
['translator#'] = true,
['translator-first#'] = true,
['translator#-first'] = true,
['translator-given#'] = true,
['translator#-given'] = true,
['translator-last#'] = true,
['translator#-last'] = true,
['translator-surname#'] = true,
['translator#-surname'] = true,
['translator-link#'] = true,
['translator#-link'] = true,
['translator-mask#'] = true,
['translator#-mask'] = true,
}
--[[--------------------------< P R E P R I N T S U P P O R T E D P A R A M E T E R S >--------------------
Cite arXiv, cite biorxiv, cite citeseerx, cite medrxiv, and cite ssrn are preprint templates that use the limited
set of parameters defined in the limited_basic_arguments and limited_numbered_arguments tables. Those lists are
supplemented with a template-specific list of parameters that are required by the particular template and may be
exclusive to one of the preprint templates. Some of these parameters may also be available to the general cs1|2
templates.
Same conventions for true/false/tracked/nil as above.
]]
local preprint_arguments_t = {
arxiv = {
['arxiv'] = true, -- cite arxiv and arxiv identifiers
['class'] = true,
['eprint'] = true, -- cite arxiv and arxiv identifiers
},
biorxiv = {
['biorxiv'] = true,
},
citeseerx = {
['citeseerx'] = true,
},
medrxiv = {
['medrxiv'] = true,
},
ssrn = {
['ssrn'] = true,
['SSRN'] = true,
['ssrn-access'] = true,
},
}
--[[--------------------------< L I M I T E D S U P P O R T E D P A R A M E T E R S >----------------------
cite arxiv, cite biorxiv, cite citeseerx, cite medrxiv, and cite ssrn templates are preprint templates so are
allowed only a limited subset of parameters allowed to all other cs1|2 templates. The limited subset is defined
here.
This list of parameters also used by {{cite document}}
Same conventions for true/false/tracked/nil as above.
]]
local limited_basic_arguments_t = {
['at'] = true,
['author'] = true,
['author-first'] = true,
['author-given'] = true,
['author-last'] = true,
['author-surname'] = true,
['author-link'] = true,
['authorlink'] = true,
['author-mask'] = true,
['collaboration'] = true,
['date'] = true,
['df'] = true,
['display-authors'] = true,
['first'] = true,
['given'] = true,
['language'] = true,
['last'] = true,
['mode'] = true,
['name-list-style'] = true,
['no-tracking'] = true,
['p'] = true,
['page'] = true,
['pages'] = true,
['postscript'] = true,
['pp'] = true,
['quotation'] = true,
['quote'] = true,
['ref'] = true,
['surname'] = true,
['template-doc-demo'] = true,
['title'] = true,
['trans-title'] = true,
['vauthors'] = true,
['year'] = true,
}
local limited_numbered_arguments_t = {
['author#'] = true,
['author-first#'] = true,
['author#-first'] = true,
['author-given#'] = true,
['author#-given'] = true,
['author-last#'] = true,
['author#-last'] = true,
['author-surname#'] = true,
['author#-surname'] = true,
['author-link#'] = true,
['author#-link'] = true,
['authorlink#'] = true,
['author#link'] = true,
['author-mask#'] = true,
['author#-mask'] = true,
['first#'] = true,
['given#'] = true,
['last#'] = true,
['surname#'] = true,
}
--[[--------------------------< U N I Q U E _ A R G U M E N T S >----------------------------------------------
Some templates have unique parameters. Those templates and their unique parameters are listed here. Keys in this
table are the template's CitationClass parameter value
Same conventions for true/false/tracked/nil as above.
]]
local unique_arguments_t = {
['audio-visual'] = {
['people'] = true,
['transcript'] = true,
['transcript-format'] = true,
['transcript-url'] = true,
},
conference = {
['book-title'] = true,
['conference'] = true,
['conference-format'] = true,
['conference-url'] = true,
['event'] = true,
},
episode = {
['airdate'] = true,
['air-date'] = true,
['credits'] = true,
['episode-link'] = true, -- alias of |title-link=
['network'] = true,
['people'] = true,
['season'] = true,
['series-link'] = true,
['series-no'] = true,
['series-number'] = true,
['station'] = true,
['transcript'] = true,
['transcript-format'] = true,
['transcript-url'] = true,
},
mailinglist = {
['mailing-list'] = true,
},
map = {
['cartography'] = true,
['inset'] = true,
['map'] = true,
['map-format'] = true,
['map-url'] = true,
['map-url-access'] = true,
['script-map'] = true,
['sections'] = true,
['sheet'] = true,
['sheets'] = true,
['trans-map'] = true,
},
newsgroup = {
['message-id'] = true,
['newsgroup'] = true,
},
report = {
['docket'] = true,
},
serial = {
['airdate'] = true,
['air-date'] = true,
['credits'] = true,
['episode'] = true, -- cite serial only TODO: make available to cite episode?
['episode-link'] = true, -- alias of |title-link=
['network'] = true,
['people'] = true,
['series-link'] = true,
['station'] = true,
},
speech = {
['conference'] = true,
['conference-format'] = true,
['conference-url'] = true,
['event'] = true,
},
thesis = {
['degree'] = true,
['docket'] = true,
},
}
--[[--------------------------< C I T E _ D O C U M E N T >----------------------------------------------------
Special case for cite document. This template takes the limited basic and limited enumerated parameters plus
others that are apply only to standalone published sources that cannot be cited any other way; no url, book,
periodical, etc parameters; limited support for name lists and named identifiers.
when validating parameters in {{cite document}} templates, the basic and
]]
local document_arguments_t = {
['bibcode'] = true,
['bibcode-access'] = true,
['doi'] = true,
['DOI'] = true,
['doi-access'] = true,
['doi-broken-date'] = true,
['hdl'] = true,
['HDL'] = true,
['hdl-access'] = true,
['id'] = true,
['ID'] = true,
['jfm'] = true,
['JFM'] = true,
['lang'] = true,
['location'] = true,
['mr'] = true,
['MR'] = true,
['no-pp'] = true,
['orig-date'] = true,
['origyear'] = true,
['orig-year'] = true,
['osti'] = true,
['OSTI'] = true,
['osti-access'] = true,
['place'] = true,
['publisher'] = true,
['quote-page'] = true,
['quote-pages'] = true,
['script-quote'] = true,
['script-title'] = true,
['title-link'] = true,
['translator'] = true,
['translator-first'] = true,
['translator-given'] = true,
['translator-last'] = true,
['translator-surname'] = true,
['translator-link'] = true,
['translator-mask'] = true,
['trans-quote'] = true,
['type'] = true,
['zbl'] = true,
['ZBL'] = true,
}
local document_numbered_arguments_t = {
['translator#'] = true,
['translator-first#'] = true,
['translator#-first'] = true,
['translator-given#'] = true,
['translator#-given'] = true,
['translator-last#'] = true,
['translator#-last'] = true,
['translator-surname#'] = true,
['translator#-surname'] = true,
['translator-link#'] = true,
['translator#-link'] = true,
['translator-mask#'] = true,
['translator#-mask'] = true,
}
--[[--------------------------< L I S T _ C O M B I N E >------------------------------------------------------
makes one table from a list of tables. <lists_t> is a sequence of tables to be combined
]]
local function list_combine (lists_t)
local out_t = {};
for _, list_t in ipairs (lists_t) do -- for each list in <lists_t>
for k, v in pairs (list_t) do -- extract each k/v pair
out_t[k] = v; -- add to <out_t>
end
end
return out_t; -- and done
end
--[[--------------------------< T E M P L A T E _ L I S T _ G E T >--------------------------------------------
gets a list of the templates from table t
]]
local function template_list_get (t)
local out_t = {}; -- a table for output
for k, _ in pairs (t) do -- spin through the table and collect the keys
table.insert (out_t, k) -- add each key to the output table
end
return out_t; -- and done
end
--[[--------------------------< E X P O R T E D T A B L E S >------------------------------------------------
]]
return {
preprint_arguments_t = preprint_arguments_t,
preprint_template_list_t = template_list_get (preprint_arguments_t), -- make a template list from preprint_arguments{} table
unique_arguments_t = unique_arguments_t,
unique_param_template_list_t = template_list_get (unique_arguments_t), -- make a template list from unique_arguments{} table
document_parameters_t = list_combine ({limited_basic_arguments_t, limited_numbered_arguments_t, document_arguments_t, document_numbered_arguments_t});
common_parameters_t = list_combine ({basic_arguments_t, numbered_arguments_t});
limited_parameters_t = list_combine ({limited_basic_arguments_t, limited_numbered_arguments_t});
};
baub5v4d976tff8ebf3konhoua4ojgu
Module:Citation/CS1/Utilities
828
11074207
37019534
35048465
2026-05-01T14:28:30Z
Exec8
10305
37019534
Scribunto
text/plain
local z = {
error_cats_t = {}; -- for categorizing citations that contain errors
error_ids_t = {}; -- list of error identifiers; used to prevent duplication of certain errors; local to this module
error_msgs_t = {}; -- sequence table of error messages
maint_cats_t = {}; -- for categorizing citations that aren't erroneous per se, but could use a little work
prop_cats_t = {}; -- for categorizing citations based on certain properties, language of source for instance
prop_keys_t = {}; -- for adding classes to the citation's <cite> tag
};
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set (var)
return not (var == nil or var == '');
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array (needle, haystack)
if needle == nil then
return false;
end
for n, v in ipairs (haystack) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< H A S _ A C C E P T _ A S _ W R I T T E N >------------------------------------
When <str> is wholly wrapped in accept-as-written markup, return <str> without markup and true; return <str> and false else
with allow_empty = false, <str> must have at least one character inside the markup
with allow_empty = true, <str> the markup frame can be empty like (()) to distinguish an empty template parameter from the specific condition "has no applicable value" in citation-context.
After further evaluation the two cases might be merged at a later stage, but should be kept separated for now.
]]
local function has_accept_as_written (str, allow_empty)
if not is_set (str) then
return str, false;
end
local count;
if true == allow_empty then
str, count = str:gsub ('^%(%((.*)%)%)$', '%1'); -- allows (()) to be an empty set
else
str, count = str:gsub ('^%(%((.+)%)%)$', '%1');
end
return str, 0 ~= count;
end
--[[--------------------------< S U B S T I T U T E >----------------------------------------------------------
Populates numbered arguments in a message string using an argument table. <args> may be a single string or a
sequence table of multiple strings.
]]
local function substitute (msg, args)
return args and mw.message.newRawMessage (msg, args):plain() or msg;
end
--[[--------------------------< E R R O R _ C O M M E N T >----------------------------------------------------
Wraps error messages with CSS markup according to the state of hidden. <content> may be a single string or a
sequence table of multiple strings.
]]
local function error_comment (content, hidden)
return substitute (hidden and cfg.presentation['hidden-error'] or cfg.presentation['visible-error'], content);
end
--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------
Converts a hyphen, endash, emdash to endash under certain conditions. The hyphen/en/em must separate
like items; unlike items are returned unmodified. These forms are modified:
letter - letter (A-B)
digit - digit (4-5)
digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)
letterdigit - letterdigit (A1-A5) (an optional separator between letter and
digit is supported – a.1-a.5 or a-1-a-5)
digitletter - digitletter (5a-5d) (an optional separator between letter and
digit is supported – 5.a-5.d or 5-a-5-d)
any other forms are returned unmodified.
str may be a comma- or semicolon-separated list of page ranges with/without single pages
]]
local function hyphen_to_dash (str)
if not is_set (str) then
return str;
end
str = str:gsub ("(%(%(.-%)%))", function(m) return m:gsub(",", ","):gsub(";", ";") end) -- replace commas and semicolons in accept-as-written markup with similar unicode characters so they'll be ignored during the split
str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—'] = '—'}); -- replace — and – entities with their characters; semicolon mucks up the text.split
str = str:gsub ('-', '-'); -- replace HTML numeric entity with hyphen character
str = str:gsub (' ', ' '); -- replace entity with generic keyboard space character
local out = {};
local list = mw.text.split (str, '%s*[,;]%s*'); -- split str at comma or semicolon separators if there are any
local accept; -- boolean
for _, item in ipairs (list) do -- for each item in the list
item, accept = has_accept_as_written (item); -- remove accept-this-as-written markup when it wraps all of item
if not accept and mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[—–-]%s*%w*[%.%-]?%w+$') then -- if pagination uses <hyphen|dot> separators with hyphen/endash/emdash <range separator>
if mw.ustring.match (item, '^%a+[%.%-]%d+%s*[—–-]%s*%a+[%.%-]%d+$') or -- letter<hyphen|dot>digit <range separator> letter<hyphen|dot>digit (requires <hyphen|dot> separator between letter and digit)
mw.ustring.match (item, '^%d+[%.%-]%a+%s*[—–-]%s*%d+[%.%-]%a+$') or -- digit<hyphen|dot>letter <range separator> digit<hyphen|dot>letter (requires <hyphen|dot> separator between digit and letter)
mw.ustring.match (item, '^%d+[%.%-]%d+%s*[—–-]%s*%d+[%.%-]%d+$') then -- digit<hyphen|dot>digit <range separator> digit<hyphen|dot>digit (requires <hyphen|dot> separator between digit and digit)
item = mw.ustring.gsub (item, '(%w*[%.%-]%w+)%s*[—–-]%s*(%w*[%.%-]%w+)', '<span class="nowrap">%1 –</span> <span class="nowrap">%2</span>'); -- replace <range separator>, with spaced endash
elseif mw.ustring.match (item, '^%d+%a+%s*[—–-]%s*%d+%a+$') or -- digitletter <range separator> digitletter
mw.ustring.match (item, '^%a+%d+%s*[—–-]%s*%a+%d+$') or -- letterdigit <range separator> letterdigit
mw.ustring.match (item, '^%d+%s*[—–-]%s*%d+$') or -- digit <range separator> digit
mw.ustring.match (item, '^%a+%s*[—–-]%s*%a+$') then -- letter<range separator> letter
item = mw.ustring.gsub (item, '(%w+)%s*[—–-]%s*(%w+)', '<span class="nowrap">%1–</span>%2'); -- replace <range separator> with endash, remove extraneous space characters
else
-- item = mw.ustring.gsub (item, '%s*[—–-]%s*', '–'); -- disabled; here when 'unlike' items so return <item> as is
end
end
table.insert (out, item); -- add the (possibly modified) item to the output table
end
local temp_str = ''; -- concatenate the output table into a comma separated string
temp_str, accept = has_accept_as_written (table.concat (out, ', ')); -- remove accept-this-as-written markup when it wraps all of concatenated out
if accept then
temp_str = has_accept_as_written (str); -- when global markup removed, return original str; do it this way to suppress boolean second return value
return temp_str:gsub(",", ","):gsub(";", ";");
else
return temp_str:gsub(",", ","):gsub(";", ";"); -- else, return assembled temp_str
end
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided (or link and display are the same), returns a wikilink in the form [[L]]; if neither are
provided or link is omitted, returns an empty string.
]=]
local function make_wikilink (link, display)
if not is_set (link) then return '' end
if is_set (display) and link ~= display then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
end
--[[--------------------------< S E T _ M E S S A G E >----------------------------------------------------------
Sets an error message using the ~/Configuration error_conditions{} table along with arguments supplied in the function
call, inserts the resulting message in z.error_msgs_t{} sequence table, and returns the error message.
<error_id> – key value for appropriate error handler in ~/Configuration error_conditions{} table
<arguments> – may be a single string or a sequence table of multiple strings to be subsititued into error_conditions[error_id].message
<raw> – boolean
true – causes this function to return the error message not wrapped in visible-error, hidden-error span tag;
returns error_conditions[error_id].hidden as a second return value
does not add message to z.error_msgs_t sequence table
false, nil – adds message wrapped in visible-error, hidden-error span tag to z.error_msgs_t
returns the error message wrapped in visible-error, hidden-error span tag; there is no second return value
<prefix> – string to be prepended to <message> -- TODO: remove support for these unused(?) arguments?
<suffix> – string to be appended to <message>
TODO: change z.error_cats_t and z.maint_cats_t to have the form cat_name = true? this to avoid dups without having to have an extra table
]]
local added_maint_cats = {} -- list of maintenance categories that have been added to z.maint_cats_t; TODO: figure out how to delete this table
local function set_message (error_id, arguments, raw, prefix, suffix)
local error_state = cfg.error_conditions[error_id];
prefix = prefix or '';
suffix = suffix or '';
if error_state == nil then
error (cfg.messages['undefined_error'] .. ': ' .. error_id); -- because missing error handler in Module:Citation/CS1/Configuration
elseif is_set (error_state.category) then
if error_state.message then -- when error_state.message defined, this is an error message
table.insert (z.error_cats_t, error_state.category);
else
if not added_maint_cats[error_id] then
added_maint_cats[error_id] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (error_state.category, arguments)); -- make cat name then add to table
end
return; -- because no message, nothing more to do
end
end
local message = substitute (error_state.message, arguments);
message = table.concat (
{
message,
' (',
make_wikilink (
table.concat (
{
cfg.messages['help page link'],
'#',
error_state.anchor
}),
cfg.messages['help page label']),
')'
});
z.error_ids_t[error_id] = true;
if z.error_ids_t['err_citation_missing_title'] and -- if missing-title error already noted
in_array (error_id, {'err_bare_url_missing_title', 'err_trans_missing_title'}) then -- and this error is one of these
return '', false; -- don't bother because one flavor of missing title is sufficient
end
message = table.concat ({prefix, message, suffix});
if true == raw then
return message, error_state.hidden; -- return message not wrapped in visible-error, hidden-error span tag
end
message = error_comment (message, error_state.hidden); -- wrap message in visible-error, hidden-error span tag
table.insert (z.error_msgs_t, message); -- add it to the messages sequence table
return message; -- and done; return value generally not used but is used as a flag in various functions of ~/Identifiers
end
--[[-------------------------< I S _ A L I A S _ U S E D >-----------------------------------------------------
This function is used by select_one() to determine if one of a list of alias parameters is in the argument list
provided by the template.
Input:
args – pointer to the arguments table from calling template
alias – one of the list of possible aliases in the aliases lists from Module:Citation/CS1/Configuration
index – for enumerated parameters, identifies which one
enumerated – true/false flag used to choose how enumerated aliases are examined
value – value associated with an alias that has previously been selected; nil if not yet selected
selected – the alias that has previously been selected; nil if not yet selected
error_list – list of aliases that are duplicates of the alias already selected
Returns:
value – value associated with alias we selected or that was previously selected or nil if an alias not yet selected
selected – the alias we selected or the alias that was previously selected or nil if an alias not yet selected
]]
local function is_alias_used (args, alias, index, enumerated, value, selected, error_list)
if enumerated then -- is this a test for an enumerated parameters?
alias = alias:gsub ('#', index); -- replace '#' with the value in index
else
alias = alias:gsub ('#', ''); -- remove '#' if it exists
end
if is_set (args[alias]) then -- alias is in the template's argument list
if value ~= nil and selected ~= alias then -- if we have already selected one of the aliases
local skip;
for _, v in ipairs (error_list) do -- spin through the error list to see if we've added this alias
if v == alias then
skip = true;
break; -- has been added so stop looking
end
end
if not skip then -- has not been added so
table.insert (error_list, alias); -- add error alias to the error list
end
else
value = args[alias]; -- not yet selected an alias, so select this one
selected = alias;
end
end
return value, selected; -- return newly selected alias, or previously selected alias
end
--[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
Adds a category to z.maint_cats_t using names from the configuration file with additional text if any.
To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maint_cats_t.
]]
local function add_maint_cat (key, arguments)
if not added_maint_cats [key] then
added_maint_cats [key] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< A D D _ P R O P _ C A T >--------------------------------------------------------
Adds a category to z.prop_cats_t using names from the configuration file with additional text if any.
foreign_lang_source and foreign_lang_source_2 keys have a language code appended to them so that multiple languages
may be categorized but multiples of the same language are not categorized.
added_prop_cats is a table declared in page scope variables above
]]
local added_prop_cats = {}; -- list of property categories that have been added to z.prop_cats_t
local function add_prop_cat (key, arguments, key_modifier)
local key_modified = key .. ((key_modifier and key_modifier) or ''); -- modify <key> with <key_modifier> if present and not nil
if not added_prop_cats [key_modified] then
added_prop_cats [key_modified] = true; -- note that we've added this category
table.insert (z.prop_cats_t, substitute (cfg.prop_cats [key], arguments)); -- make name then add to table
table.insert (z.prop_keys_t, 'cs1-prop-' .. key); -- convert key to class for use in the citation's <cite> tag
end
end
--[[--------------------------< S A F E _ F O R _ I T A L I C S >----------------------------------------------
Protects a string that will be wrapped in wiki italic markup '' ... ''
Note: We cannot use <i> for italics, as the expected behavior for italics specified by ''...'' in the title is that
they will be inverted (i.e. unitalicized) in the resulting references. In addition, <i> and '' tend to interact
poorly under Mediawiki's HTML tidy.
]]
local function safe_for_italics (str)
if not is_set (str) then return str end
if str:sub (1, 1) == "'" then str = "<span></span>" .. str; end
if str:sub (-1, -1) == "'" then str = str .. "<span></span>"; end
return str:gsub ('\n', ' '); -- Remove newlines as they break italics.
end
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
Applies styling to various parameters. Supplied string is wrapped using a message_list configuration taking one
argument; protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
]]
local function wrap_style (key, str)
if not is_set (str) then
return "";
elseif in_array (key, {'italic-title', 'trans-italic-title'}) then
str = safe_for_italics (str);
end
return substitute (cfg.presentation[key], {str});
end
--[[--------------------------< M A K E _ S E P _ L I S T >------------------------------------------------------------
make a separated list of items using provided separators.
<sep_list> - typically '<comma><space>'
<sep_list_pair> - typically '<space>and<space>'
<sep_list_end> - typically '<comma><space>and<space>' or '<comma><space>&<space>'
defaults to cfg.presentation['sep_list'], cfg.presentation['sep_list_pair'], and cfg.presentation['sep_list_end']
if <sep_list_end> is specified, <sep_list> and <sep_list_pair> must also be supplied
]]
local function make_sep_list (count, list_seq, sep_list, sep_list_pair, sep_list_end)
local list = '';
if not sep_list then -- set the defaults
sep_list = cfg.presentation['sep_list'];
sep_list_pair = cfg.presentation['sep_list_pair'];
sep_list_end = cfg.presentation['sep_list_end'];
end
if 2 >= count then
list = table.concat (list_seq, sep_list_pair); -- insert separator between two items; returns list_seq[1] then only one item
elseif 2 < count then
list = table.concat (list_seq, sep_list, 1, count - 1); -- concatenate all but last item with plain list separator
list = table.concat ({list, list_seq[count]}, sep_list_end); -- concatenate last item onto end of <list> with final separator
end
return list;
end
--[[--------------------------< S E L E C T _ O N E >----------------------------------------------------------
Chooses one matching parameter from a list of parameters to consider. The list of parameters to consider is just
names. For parameters that may be enumerated, the position of the numerator in the parameter name is identified
by the '#' so |author-last1= and |author1-last= are represented as 'author-last#' and 'author#-last'.
Because enumerated parameter |<param>1= is an alias of |<param>= we must test for both possibilities.
Generates an error if more than one match is present.
]]
local function select_one (args, aliases_list, error_condition, index)
local value = nil; -- the value assigned to the selected parameter
local selected = ''; -- the name of the parameter we have chosen
local error_list = {};
if index ~= nil then index = tostring(index); end
for _, alias in ipairs (aliases_list) do -- for each alias in the aliases list
if alias:match ('#') then -- if this alias can be enumerated
if '1' == index then -- when index is 1 test for enumerated and non-enumerated aliases
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- first test for non-enumerated alias
end
value, selected = is_alias_used (args, alias, index, true, value, selected, error_list); -- test for enumerated alias
else
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- test for non-enumerated alias
end
end
if #error_list > 0 and 'none' ~= error_condition then -- for cases where this code is used outside of extract_names()
for i, v in ipairs (error_list) do
error_list[i] = wrap_style ('parameter', v);
end
table.insert (error_list, wrap_style ('parameter', selected));
set_message (error_condition, {make_sep_list (#error_list, error_list)});
end
return value, selected;
end
--[=[-------------------------< R E M O V E _ W I K I _ L I N K >----------------------------------------------
Gets the display text from a wikilink like [[A|B]] or [[B]] gives B
The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink markup).
In l(), l:gsub() removes the link and pipe (if they exist); the second :gsub() trims whitespace from the label
if str was wrapped in wikilink markup. Presumably, this is because without wikimarkup in str, there is no match
in the initial gsub, the replacement function l() doesn't get called.
]=]
local function remove_wiki_link (str)
return (str:gsub ("%[%[([^%[%]]*)%]%]", function(l)
return l:gsub ("^[^|]*|(.*)$", "%1" ):gsub ("^%s*(.-)%s*$", "%1");
end));
end
--[=[-------------------------< I S _ W I K I L I N K >--------------------------------------------------------
Determines if str is a wikilink, extracts, and returns the wikilink type, link text, and display text parts.
If str is a complex wikilink ([[L|D]]):
returns wl_type 2 and D and L from [[L|D]];
if str is a simple wikilink ([[D]])
returns wl_type 1 and D from [[D]] and L as empty string;
if not a wikilink:
returns wl_type 0, str as D, and L as empty string.
trims leading and trailing whitespace and pipes from L and D ([[L|]] and [[|D]] are accepted by MediaWiki and
treated like [[D]]; while [[|D|]] is not accepted by MediaWiki, here, we accept it and return D without the pipes).
]=]
local function is_wikilink (str)
local D, L
local wl_type = 2; -- assume that str is a complex wikilink [[L|D]]
if not str:match ('^%[%[[^%]]+%]%]$') then -- is str some sort of a wikilink (must have some sort of content)
return 0, str, ''; -- not a wikilink; return wl_type as 0, str as D, and empty string as L
end
L, D = str:match ('^%[%[([^|]+)|([^%]]+)%]%]$'); -- get L and D from [[L|D]]
if not is_set (D) then -- if no separate display
D = str:match ('^%[%[([^%]]*)|*%]%]$'); -- get D from [[D]] or [[D|]]
wl_type = 1;
end
D = mw.text.trim (D, '%s|'); -- trim white space and pipe characters
return wl_type, D, L or '';
end
--[[--------------------------< S T R I P _ A P O S T R O P H E _ M A R K U P >--------------------------------
Strip wiki italic and bold markup from argument so that it doesn't contaminate COinS metadata.
This function strips common patterns of apostrophe markup. We presume that editors who have taken the time to
markup a title have, as a result, provided valid markup. When they don't, some single apostrophes are left behind.
Returns the argument without wiki markup and a number; the number is more-or-less meaningless except as a flag
to indicate that markup was replaced; do not rely on it as an indicator of how many of any kind of markup was
removed; returns the argument and nil when no markup removed
]]
local function strip_apostrophe_markup (argument)
if not is_set (argument) then
return argument, nil; -- no argument, nothing to do
end
if nil == argument:find ( "''", 1, true ) then -- Is there at least one double apostrophe? If not, exit.
return argument, nil;
end
local flag;
while true do
if argument:find ("'''''", 1, true) then -- bold italic (5)
argument, flag = argument:gsub ("%'%'%'%'%'", ""); -- remove all instances of it
elseif argument:find ("''''", 1, true) then -- italic start and end without content (4)
argument, flag=argument:gsub ("%'%'%'%'", "");
elseif argument:find ("'''", 1, true) then -- bold (3)
argument, flag=argument:gsub ("%'%'%'", "");
elseif argument:find ("''", 1, true) then -- italic (2)
argument, flag = argument:gsub ("%'%'", "");
else
break;
end
end
return argument, flag; -- done
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr)
cfg = cfg_table_ptr;
end
--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]
return {
add_maint_cat = add_maint_cat, -- exported functions
add_prop_cat = add_prop_cat,
error_comment = error_comment,
has_accept_as_written = has_accept_as_written,
hyphen_to_dash = hyphen_to_dash,
in_array = in_array,
is_set = is_set,
is_wikilink = is_wikilink,
make_sep_list = make_sep_list,
make_wikilink = make_wikilink,
remove_wiki_link = remove_wiki_link,
safe_for_italics = safe_for_italics,
select_one = select_one,
set_message = set_message,
set_selected_modules = set_selected_modules,
strip_apostrophe_markup = strip_apostrophe_markup,
substitute = substitute,
wrap_style = wrap_style,
z = z, -- exported table
}
ipuk2skv52zxnbboa2zzah6ug9yuin7
Module:Citation/CS1/Identifiers
828
11074209
37019533
35046684
2026-05-01T14:28:05Z
Exec8
10305
37019533
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local has_accept_as_written, is_set, in_array, set_message, select_one, -- functions in Module:Citation/CS1/Utilities
substitute, make_wikilink;
local z; -- table of tables defined in Module:Citation/CS1/Utilities
local cfg; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
--[[--------------------------< P A G E S C O P E V A R I A B L E S >--------------------------------------
declare variables here that have page-wide scope that are not brought in from other modules; that are created here and used here
]]
local auto_link_urls = {}; -- holds identifier URLs for those identifiers that can auto-link |title=
--============================<< H E L P E R F U N C T I O N S >>============================================
--[[--------------------------< W I K I D A T A _ A R T I C L E _ N A M E _ G E T >----------------------------
as an aid to internationalizing identifier-label wikilinks, gets identifier article names from Wikidata.
returns w:<lang code>:<article title> when <q> has an <article title> for <lang code>; nil else. 'w:<lang code>'
ensures that sister project (like wiktionary) will link to the <lang code>.wikipedia article.
for identifiers that do not have <q>, returns nil
for wikis that do not have mw.wikibase installed, returns nil
]]
local function wikidata_article_name_get (q)
if not is_set (q) or (q and not mw.wikibase) then -- when no q number or when a q number but mw.wikibase not installed on this wiki
return nil; -- abandon
end
local wd_article;
local this_wiki_code = cfg.this_wiki_code; -- Wikipedia subdomain; 'en' for en.wikipedia.org
wd_article = mw.wikibase.getSitelink (q, this_wiki_code .. 'wiki'); -- fetch article title from WD; nil when no title available at this wiki
if wd_article then
wd_article = table.concat ({'w:', this_wiki_code, ':', wd_article}); -- interwiki-style link without brackets if taken from WD; leading 'w:' required
end
return wd_article; -- article title from WD; nil else
end
--[[--------------------------< L A B E L _ L I N K _ M A K E >------------------------------------------------
common function to create a link for an identifier label from handler table or from Wikidata
returns the first available of:
1. redirect from local wiki's handler table (if enabled)
2. Wikidata sitelink to the local language wikipedia article (if there is a Wikidata entry for this identifier in the local language)
3. link to wikipedia article specified in the local wiki's handler table
]]
local function label_link_make (handler)
local wd_article;
if not (cfg.use_identifier_redirects and is_set (handler.redirect)) then -- redirect has priority so if enabled and available don't fetch from Wikidata because expensive
wd_article = wikidata_article_name_get (handler.q); -- if Wikidata has an article title for this wiki, get it;
end
return (cfg.use_identifier_redirects and is_set (handler.redirect) and handler.redirect) or wd_article or handler.link;
end
--[[--------------------------< E X T E R N A L _ L I N K _ I D >----------------------------------------------
Formats a wiki-style external link
]]
local function external_link_id (options)
local url_string = options.id;
local ext_link;
local this_wiki_code = cfg.this_wiki_code; -- Wikipedia subdomain; 'en' for en.wikipedia.org
local wd_article; -- article title from Wikidata
if options.encode == true or options.encode == nil then
url_string = mw.uri.encode (url_string, 'PATH');
end
if options.auto_link and is_set (options.access) then
auto_link_urls[options.auto_link] = table.concat ({options.prefix, url_string, options.suffix});
end
ext_link = mw.ustring.format ('[%s%s%s %s]', options.prefix, url_string, options.suffix or "", mw.text.nowiki (options.id));
if is_set (options.access) then
ext_link = substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[options.access].class, cfg.presentation[options.access].title, ext_link}); -- add the free-to-read / paywall lock
end
return table.concat ({
make_wikilink (label_link_make (options), options.label), -- redirect, Wikidata link, or locally specified link (in that order)
options.separator or ' ',
ext_link
});
end
--[[--------------------------< I N T E R N A L _ L I N K _ I D >----------------------------------------------
Formats a wiki-style internal link
TODO: Does not currently need to support options.access, options.encode, auto-linking and COinS (as in external_link_id),
but may be needed in the future for :m:Interwiki_map custom-prefixes like :arxiv:, :bibcode:, :DOI:, :hdl:, :ISSN:,
:JSTOR:, :Openlibrary:, :PMID:, :RFC:.
]]
local function internal_link_id (options)
local id = mw.ustring.gsub (options.id, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
return table.concat (
{
make_wikilink (label_link_make (options), options.label), -- wiki-link the identifier label
options.separator or ' ', -- add the separator
make_wikilink (
table.concat (
{
options.prefix,
id, -- translated to Western digits
options.suffix or ''
}),
substitute (cfg.presentation['bdi'], {'', mw.text.nowiki (options.id)}) -- bdi tags to prevent Latin script identifiers from being reversed at RTL language wikis
); -- nowiki because MediaWiki still has magic links for ISBN and the like; TODO: is it really required?
});
end
--[[--------------------------< I S _ E M B A R G O E D >------------------------------------------------------
Determines if a PMC identifier's online version is embargoed. Compares the date in |pmc-embargo-date= against
today's date. If embargo date is in the future, returns the content of |pmc-embargo-date=; otherwise, returns
an empty string because the embargo has expired or because |pmc-embargo-date= was not set in this cite.
]]
local function is_embargoed (embargo)
if is_set (embargo) then
local lang = mw.getContentLanguage();
local good1, embargo_date, todays_date;
good1, embargo_date = pcall (lang.formatDate, lang, 'U', embargo);
todays_date = lang:formatDate ('U');
if good1 then -- if embargo date is a good date
if tonumber (embargo_date) >= tonumber (todays_date) then -- is embargo date is in the future?
return embargo; -- still embargoed
else
set_message ('maint_pmc_embargo'); -- embargo has expired; add main cat
return ''; -- unset because embargo has expired
end
end
end
return ''; -- |pmc-embargo-date= not set return empty string
end
--[=[-------------------------< I S _ V A L I D _ R X I V _ D A T E >------------------------------------------
for biorxiv, returns true if:
2019-12-11T00:00Z <= biorxiv_date < today + 2 days
for medrxiv, returns true if:
2020-01-01T00:00Z <= medrxiv_date < today + 2 days
The dated form of biorxiv identifier has a start date of 2019-12-11. The Unix timestamp for that date is {{#time:U|2019-12-11}} = 1576022400
The medrxiv identifier has a start date of 2020-01-01. The Unix timestamp for that date is {{#time:U|2020-01-01}} = 1577836800
<rxiv_date> is the date provided in those |biorxiv= parameter values that are dated and in |medrxiv= parameter values at time 00:00:00 UTC
<today> is the current date at time 00:00:00 UTC plus 48 hours
if today's date is 2023-01-01T00:00:00 then
adding 24 hours gives 2023-01-02T00:00:00 – one second more than today
adding 24 hours gives 2023-01-03T00:00:00 – one second more than tomorrow
inputs:
<y>, <m>, <d> – year, month, day parts of the date from the birxiv or medrxiv identifier
<select> 'b' for biorxiv, 'm' for medrxiv; defaults to 'b'
]=]
local function is_valid_rxiv_date (y, m, d, select)
if 0 == tonumber (m) and 12 < tonumber (m) then -- <m> must be a number 1–12
return false;
end
if 0 == tonumber (d) and 31 < tonumber (d) then -- <d> must be a number 1–31; TODO: account for month length and leap yer?
return false;
end
local rxiv_date = table.concat ({y, m, d}, '-'); -- make ymd date string
local good1, good2;
local rxiv_ts, tomorrow_ts; -- to hold Unix timestamps representing the dates
local lang_object = mw.getContentLanguage();
good1, rxiv_ts = pcall (lang_object.formatDate, lang_object, 'U', rxiv_date); -- convert rxiv_date value to Unix timestamp
good2, tomorrow_ts = pcall (lang_object.formatDate, lang_object, 'U', 'today + 2 days' ); -- today midnight + 2 days is one second more than all day tomorrow
if good1 and good2 then -- lang.formatDate() returns a timestamp in the local script which tonumber() may not understand
rxiv_ts = tonumber (rxiv_ts) or lang_object:parseFormattedNumber (rxiv_ts); -- convert to numbers for the comparison;
tomorrow_ts = tonumber (tomorrow_ts) or lang_object:parseFormattedNumber (tomorrow_ts);
else
return false; -- one or both failed to convert to Unix timestamp
end
local limit_ts = ((select and ('m' == select)) and 1577836800) or 1576022400; -- choose the appropriate limit timesatmp
return ((limit_ts <= rxiv_ts) and (rxiv_ts < tomorrow_ts)) -- limit_ts <= rxiv_date < tomorrow's date
end
--[[--------------------------< IS _ V A L I D _ I S X N >-----------------------------------------------------
ISBN-10 and ISSN validator code calculates checksum across all ISBN/ISSN digits including the check digit.
ISBN-13 is checked in isbn().
If the number is valid the result will be 0. Before calling this function, ISBN/ISSN must be checked for length
and stripped of dashes, spaces and other non-ISxN characters.
]]
local function is_valid_isxn (isxn_str, len)
local temp = 0;
isxn_str = { isxn_str:byte(1, len) }; -- make a table of byte values '0' → 0x30 .. '9' → 0x39, 'X' → 0x58
len = len + 1; -- adjust to be a loop counter
for i, v in ipairs (isxn_str) do -- loop through all of the bytes and calculate the checksum
if v == string.byte ("X" ) then -- if checkdigit is X (compares the byte value of 'X' which is 0x58)
temp = temp + 10 * (len - i); -- it represents 10 decimal
else
temp = temp + tonumber (string.char (v) )*(len-i);
end
end
return temp % 11 == 0; -- returns true if calculation result is zero
end
--[[--------------------------< IS _ V A L I D _ I S X N _ 1 3 >-----------------------------------------------
ISBN-13 and ISMN validator code calculates checksum across all 13 ISBN/ISMN digits including the check digit.
If the number is valid, the result will be 0. Before calling this function, ISBN-13/ISMN must be checked for length
and stripped of dashes, spaces and other non-ISxN-13 characters.
]]
local function is_valid_isxn_13 (isxn_str)
local temp=0;
isxn_str = { isxn_str:byte(1, 13) }; -- make a table of byte values '0' → 0x30 .. '9' → 0x39
for i, v in ipairs (isxn_str) do
temp = temp + (3 - 2*(i % 2)) * tonumber (string.char (v) ); -- multiply odd index digits by 1, even index digits by 3 and sum; includes check digit
end
return temp % 10 == 0; -- sum modulo 10 is zero when ISBN-13/ISMN is correct
end
--[[--------------------------< N O R M A L I Z E _ L C C N >--------------------------------------------------
LCCN normalization (https://www.loc.gov/marc/lccn-namespace.html#normalization)
1. Remove all blanks.
2. If there is a forward slash (/) in the string, remove it, and remove all characters to the right of the forward slash.
3. If there is a hyphen in the string:
a. Remove it.
b. Inspect the substring following (to the right of) the (removed) hyphen. Then (and assuming that steps 1 and 2 have been carried out):
1. All these characters should be digits, and there should be six or less. (not done in this function)
2. If the length of the substring is less than 6, left-fill the substring with zeroes until the length is six.
Returns a normalized LCCN for lccn() to validate. There is no error checking (step 3.b.1) performed in this function.
]]
local function normalize_lccn (lccn)
lccn = lccn:gsub ("%s", ""); -- 1. strip whitespace
if nil ~= string.find (lccn, '/') then
lccn = lccn:match ("(.-)/"); -- 2. remove forward slash and all character to the right of it
end
local prefix
local suffix
prefix, suffix = lccn:match ("(.+)%-(.+)"); -- 3.a remove hyphen by splitting the string into prefix and suffix
if nil ~= suffix then -- if there was a hyphen
suffix = string.rep("0", 6-string.len (suffix)) .. suffix; -- 3.b.2 left fill the suffix with 0s if suffix length less than 6
lccn = prefix..suffix; -- reassemble the LCCN
end
return lccn;
end
--============================<< I D E N T I F I E R F U N C T I O N S >>====================================
--[[--------------------------< A R X I V >--------------------------------------------------------------------
See: https://arxiv.org/help/arxiv_identifier
format and error check arXiv identifier. There are three valid forms of the identifier:
the first form, valid only between date codes 9107 and 0703, is:
arXiv:<archive>.<class>/<date code><number><version>
where:
<archive> is a string of alpha characters - may be hyphenated; no other punctuation
<class> is a string of alpha characters - may be hyphenated; no other punctuation; not the same as |class= parameter which is not supported in this form
<date code> is four digits in the form YYMM where YY is the last two digits of the four-digit year and MM is the month number January = 01
first digit of YY for this form can only 9 and 0
<number> is a three-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces (undocumented)
the second form, valid from April 2007 through December 2014 is:
arXiv:<date code>.<number><version>
where:
<date code> is four digits in the form YYMM where YY is the last two digits of the four-digit year and MM is the month number January = 01
<number> is a four-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces
the third form, valid from January 2015 is:
arXiv:<date code>.<number><version>
where:
<date code> and <version> are as defined for 0704-1412
<number> is a five-digit number
]]
local function arxiv (options)
local id = options.id;
local class = options.Class; -- TODO: lowercase?
local handler = options.handler;
local year, month, version;
local err_msg = false; -- assume no error message
local text; -- output text
if id:match("^%a[%a%.%-]+/[90]%d[01]%d%d%d%d$") or id:match("^%a[%a%.%-]+/[90]%d[01]%d%d%d%dv%d+$") then -- test for the 9107-0703 format with or without version
year, month = id:match("^%a[%a%.%-]+/([90]%d)([01]%d)%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((not (90 < year or 8 > year)) or (1 > month or 12 < month)) or -- if invalid year or invalid month
((91 == year and 7 > month) or (7 == year and 3 < month)) then -- if years ok, are starting and ending months ok?
err_msg = true; -- flag for error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%dv%d+$") then -- test for the 0704-1412 with or without version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((7 > year) or (14 < year) or (1 > month or 12 < month)) or -- is year invalid or is month invalid? (doesn't test for future years)
((7 == year) and (4 > month)) then -- when year is 07, is month invalid (before April)?
err_msg = true; -- flag for error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%d%dv%d+$") then -- test for the 1501- format with or without version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((15 > year) or (1 > month or 12 < month)) then -- is year invalid or is month invalid? (doesn't test for future years)
err_msg = true; -- flag for error message
end
else
err_msg = true; -- not a recognized format; flag for error message
end
if err_msg then
options.coins_list_t['ARXIV'] = nil; -- when error, unset so not included in COinS
end
local err_msg_t = {};
if err_msg then
set_message ('err_bad_arxiv');
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access});
if is_set (class) then
if id:match ('^%d+') then
text = table.concat ({text, ' [[https://arxiv.org/archive/', class, ' ', class, ']]'}); -- external link within square brackets, not wikilink
else
set_message ('err_class_ignored');
end
else -- class not set
if id:match ('^%d+') and options.CitationClass == 'arxiv' then -- new (post 2007) format; {{cite arxiv}} only
set_message ('maint_missing_class'); -- add maint cat
end
end
return text;
end
--[[--------------------------< B I B C O D E >--------------------------------------------------------------------
Validates (sort of) and formats a bibcode ID.
Format for bibcodes is specified here: https://adsabs.harvard.edu/abs_doc/help_pages/data.html#bibcodes
But, this: 2015arXiv151206696F is apparently valid so apparently, the only things that really matter are length, 19 characters
and first four digits must be a year. This function makes these tests:
length must be 19 characters
characters in position
1–4 must be digits and must represent a year in the range of 1000 – next year
5 must be a letter
6–8 must be letter, digit, ampersand, or dot (ampersand cannot directly precede a dot; &. )
9–18 must be letter, digit, or dot
19 must be a letter or dot
]]
local function bibcode (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local ignore_invalid = options.accept;
local err_type;
local err_msg = '';
local year;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode,
access = access});
if 19 ~= id:len() then
err_type = cfg.err_msg_supl.length;
else
year = id:match ("^(%d%d%d%d)[%a][%w&%.][%w&%.][%w&%.][%w.]+[%a%.]$");
if not year then -- if nil then no pattern match
err_type = cfg.err_msg_supl.value; -- so value error
else
local next_year = tonumber (os.date ('%Y')) + 1; -- get the current year as a number and add one for next year
year = tonumber (year); -- convert year portion of bibcode to a number
if (1000 > year) or (year > next_year) then
err_type = cfg.err_msg_supl.year; -- year out of bounds
end
if id:find('&%.') then
err_type = cfg.err_msg_supl.journal; -- journal abbreviation must not have '&.' (if it does it's missing a letter)
end
if id:match ('.........%.tmp%.') then -- temporary bibcodes when positions 10–14 are '.tmp.'
set_message ('maint_bibcode');
end
end
end
if is_set (err_type) and not ignore_invalid then -- if there was an error detected and accept-as-written markup not used
set_message ('err_bad_bibcode', {err_type});
options.coins_list_t['BIBCODE'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< B I O R X I V >-----------------------------------------------------------------
Format bioRxiv ID and do simple error checking. Before 2019-12-11, biorXiv IDs were 10.1101/ followed by exactly
6 digits. After 2019-12-11, biorXiv IDs retained the six-digit identifier but prefixed that with a yyyy.mm.dd.
date and suffixed with an optional version identifier.
From December 2025 biorxiv added a new 'doi' prefix: 10.64898:
10.64898/2025.12.10.693067
The bioRxiv ID is the string of characters:
https://doi.org/10.1101/078733 -> 10.1101/078733
or a date followed by a six-digit number followed by an optional version indicator 'v' and one or more digits:
https://www.biorxiv.org/content/10.1101/2019.12.11.123456v2 -> 10.1101/2019.12.11.123456v2
see https://www.biorxiv.org/about-biorxiv
]]
local function biorxiv (options)
local id = options.id;
local handler = options.handler;
local err_msg = true; -- flag; assume that there will be an error
local patterns = {
'^10%.1101/%d%d%d%d%d%d$', -- simple 6-digit identifier (before 2019-12-11)
'^10%.1101/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%dv%d+$', -- y.m.d. date + 6-digit identifier + version (after 2019-12-11)
'^10%.1101/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%d$', -- y.m.d. date + 6-digit identifier (after 2019-12-11)
'^10%.64898/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%dv%d+$', -- y.m.d. date + 6-digit identifier + version (from December 2025)
'^10%.64898/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%d$', -- y.m.d. date + 6-digit identifier (from December 2025)
}
for _, pattern in ipairs (patterns) do -- spin through the patterns looking for a match
if id:match (pattern) then
local y, m, d = id:match (pattern); -- found a match, attempt to get year, month and date from the identifier
if m then -- m is nil when id is the six-digit form
if not is_valid_rxiv_date (y, m, d, 'b') then -- validate the encoded date; 'b' for biorxiv limit
break; -- date fail; break out early so we don't unset the error message
end
end
err_msg = nil; -- we found a match so unset the error message
break; -- and done
end
end -- err_cat remains set here when no match
if err_msg then
options.coins_list_t['BIORXIV'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_biorxiv'); -- and set the error message
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator,
encode = handler.encode, access = handler.access});
end
--[[--------------------------< C I T E S E E R X >------------------------------------------------------------
CiteSeerX use their own notion of "doi" (not to be confused with the identifiers resolved via doi.org).
The description of the structure of this identifier can be found at Help_talk:Citation_Style_1/Archive_26#CiteSeerX_id_structure
]]
local function citeseerx (options)
local id = options.id;
local handler = options.handler;
local matched;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode,
access = handler.access});
matched = id:match ("^10%.1%.1%.[1-9]%d?%d?%d?%.[1-9]%d?%d?%d?$");
if not matched then
set_message ('err_bad_citeseerx' );
options.coins_list_t['CITESEERX'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< D O I >------------------------------------------------------------------------
Formats a DOI and checks for DOI errors.
DOI names contain two parts: prefix and suffix separated by a forward slash.
Prefix: directory indicator '10.' followed by a registrant code
Suffix: character string of any length chosen by the registrant
This function checks a DOI name for: prefix/suffix. If the DOI name contains spaces or endashes, or, if it ends
with a period or a comma, this function will emit a bad_doi error message.
DOI names are case-insensitive and can incorporate any printable Unicode characters so the test for spaces, endash,
and terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely
if ever used in DOI names.
https://www.doi.org/doi_handbook/2_Numbering.html -- 2.2 Syntax of a DOI name
https://www.doi.org/doi_handbook/2_Numbering.html#2.2.2 -- 2.2.2 DOI prefix
]]
local function doi (options)
local id = options.id;
local inactive = options.DoiBroken
local access = options.access;
local ignore_invalid = options.accept;
local handler = options.handler;
local err_flag;
local function is_extended_free (registrant, suffix) -- local function to check those few registrants that are mixed; identifiable by the doi suffix <incipit>
suffix = suffix:lower(); -- ascii [a-z] same as [A-Z] in doi names; see §3.4.4 Case Insensitivity of the Doi Name
if cfg.extended_registrants_t[registrant] then -- if this registrant has known free-to-read extentions
for _, incipit in ipairs (cfg.extended_registrants_t[registrant]) do -- loop through the registrant's incipits
if mw.ustring.find (suffix, '^' .. incipit:lower()) then -- ascii [a-z] same as [A-Z] in doi names
return true; -- if foundm done
end
end
end
end
local text;
if is_set (inactive) then
local inactive_year = inactive:match("%d%d%d%d"); -- try to get the year portion from the inactive date
local inactive_month, good;
if is_set (inactive_year) then
if 4 < inactive:len() then -- inactive date has more than just a year (could be anything)
local lang_obj = mw.getContentLanguage(); -- get a language object for this wiki
good, inactive_month = pcall (lang_obj.formatDate, lang_obj, 'F', inactive); -- try to get the month name from the inactive date
if not good then
inactive_month = nil; -- something went wrong so make sure this is unset
end
end
end -- otherwise, |doi-broken-date= has something but it isn't a date
if is_set (inactive_year) and is_set (inactive_month) then
set_message ('maint_doi_inactive_dated', {inactive_year, inactive_month, ' '});
elseif is_set (inactive_year) then
set_message ('maint_doi_inactive_dated', {inactive_year, '', ''});
else
set_message ('maint_doi_inactive');
end
inactive = substitute (cfg.messages['inactive'], inactive );
end
local suffix;
local registrant, suffix = mw.ustring.match (id, '^10%.([^/]+)/([^%s–]-[^%.,])$'); -- registrant and suffix set when DOI has the proper basic form; both nil else
local registrant_err_patterns = { -- these patterns are for code ranges that are not supported
'^[^1-3]%d%d%d%d%.%d+$', -- 5 digits with subcode (reject 0xxxx, 40000+); accepts: 10000–39999
'^[^1-8]%d%d%d%d$', -- 5 digits without subcode (reject 0xxxx, 90000+); accepts: 10000–89999
'^[^1-9]%d%d%d%.%d+$', -- 4 digits with subcode (reject 0xxx); accepts: 1000–9999
'^[^1-9]%d%d%d$', -- 4 digits without subcode (reject 0xxx); accepts: 1000–9999
'^%d%d%d%d%d%d+', -- 6 or more digits
'^%d%d?%d?$', -- less than 4 digits without subcode (3 digits with subcode is legitimate)
'^%d%d?%.[%d%.]+', -- 1 or 2 digits with subcode
'^5555$', -- test registrant will never resolve
'[^%d%.]', -- any character that isn't a digit or a dot
}
if not ignore_invalid then
if registrant then -- when DOI has proper form
for i, pattern in ipairs (registrant_err_patterns) do -- spin through error patterns
if registrant:match (pattern) then -- to validate registrant codes
err_flag = set_message ('err_bad_doi'); -- when found, mark this DOI as bad
break; -- and done
end
end
else
err_flag = set_message ('err_bad_doi'); -- invalid directory or malformed
end
else
set_message ('maint_doi_ignore');
end
if err_flag then
options.coins_list_t['DOI'] = nil; -- when error, unset so not included in COinS
else -- here when doi has no errors or has been wrapped in accept-as-written markup
suffix = mw.ustring.match (id, '^10%.[^/]+/(.+)'); -- refetch suffix because doi may have been wrapped in accept-as-written markup
if not access and (cfg.known_free_doi_registrants_t[registrant] or is_extended_free (registrant, suffix)) then -- |doi-access=free not set and <registrant> is known to be free
set_message ('maint_doi_unflagged_free'); -- set a maint cat
end
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access,
auto_link = not (err_flag or is_set (inactive) or ignore_invalid) and 'doi' or nil -- do not auto-link when |doi-broken-date= has a value or when there is a DOI error or (to play it safe, after all, auto-linking is not essential) when invalid DOIs are ignored
}) .. (inactive or '');
return text;
end
--[[--------------------------< H D L >------------------------------------------------------------------------
Formats an HDL with minor error checking.
HDL names contain two parts: prefix and suffix separated by a forward slash.
Prefix: character string using any character in the UCS-2 character set except '/'
Suffix: character string of any length using any character in the UCS-2 character set chosen by the registrant
This function checks a HDL name for: prefix/suffix. If the HDL name contains spaces, endashes, or, if it ends
with a period or a comma, this function will emit a bad_hdl error message.
HDL names are case-insensitive and can incorporate any printable Unicode characters so the test for endashes and
terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely
if ever used in HDLs.
Query string parameters are named here: https://www.handle.net/proxy_servlet.html. query strings are not displayed
but since '?' is an allowed character in an HDL, '?' followed by one of the query parameters is the only way we
have to detect the query string so that it isn't URL-encoded with the rest of the identifier.
]]
local function hdl (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local query_params = { -- list of known query parameters from https://www.handle.net/proxy_servlet.html
'noredirect',
'ignore_aliases',
'auth',
'cert',
'index',
'type',
'urlappend',
'locatt',
'action',
}
local hdl, suffix, param = id:match ('(.-)(%?(%a+).+)$'); -- look for query string
local found;
if hdl then -- when there are query strings, this is the handle identifier portion
for _, q in ipairs (query_params) do -- spin through the list of query parameters
if param:match ('^' .. q) then -- if the query string begins with one of the parameters
found = true; -- announce a find
break; -- and stop looking
end
end
end
if found then
id = hdl; -- found so replace id with the handle portion; this will be URL-encoded, suffix will not
else
suffix = ''; -- make sure suffix is empty string for concatenation else
end
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, suffix = suffix, separator = handler.separator, encode = handler.encode, access = access})
if nil == id:match("^[^%s–]-/[^%s–]-[^%.,]$") then -- HDL must contain a forward slash, must not contain spaces, endashes, and must not end with period or comma
set_message ('err_bad_hdl' );
options.coins_list_t['HDL'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< I S B N >----------------------------------------------------------------------
Determines whether an ISBN string is valid
]]
local function isbn (options_t)
local isbn_str = options_t.id;
local ignore_invalid = options_t.accept;
local handler = options_t.handler;
local year = options_t.Year; -- when set, valid anchor_year; may have a disambiguator which must be removed
local function return_result (check, err_type) -- local function to handle the various returns
local ISBN = internal_link_id ({link = handler.link, label = handler.label, redirect = handler.redirect,
prefix = handler.prefix, id = isbn_str, separator = handler.separator});
if ignore_invalid then -- if ignoring ISBN errors
set_message ('maint_isbn_ignore'); -- add a maint category even when there is no error
else -- here when not ignoring
if not check then -- and there is an error
options_t.coins_list_t['ISBN'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_isbn', err_type); -- set an error message
return ISBN; -- return id text
end
end
return ISBN; -- return id text
end
if year and not ignore_invalid then --
year = year:match ('%d%d%d%d?'); -- strip disambiguator if present
if year and (1965 > tonumber(year)) then -- <year> will be nil here when |year=n.d. or |year=nd
set_message ('err_invalid_isbn_date'); -- set an error message
return internal_link_id ({link = handler.link, label = handler.label, redirect = handler.redirect,
prefix = handler.prefix, id = isbn_str, separator = handler.separator});
end
end
if nil ~= isbn_str:match ('[^%s-0-9X]') then
return return_result (false, cfg.err_msg_supl.char); -- fail if isbn_str contains anything but digits, hyphens, or the uppercase X
end
local id = isbn_str:gsub ('[%s-]', ''); -- remove hyphens and whitespace
local len = id:len();
if len ~= 10 and len ~= 13 then
return return_result (false, cfg.err_msg_supl.length); -- fail if incorrect length
end
if len == 10 then
if id:match ('^%d*X?$') == nil then -- fail if isbn_str has 'X' anywhere but last position
return return_result (false, cfg.err_msg_supl.form);
end
if not is_valid_isxn (id, 10) then -- test isbn-10 for numerical validity
return return_result (false, cfg.err_msg_supl.check); -- fail if isbn-10 is not numerically valid
end
if id:find ('^63[01]') then -- 630xxxxxxx and 631xxxxxxx are (apparently) not valid isbn group ids but are used by amazon as numeric identifiers (asin)
return return_result (false, cfg.err_msg_supl.group); -- fail if isbn-10 begins with 630/1
end
return return_result (true, cfg.err_msg_supl.check); -- pass if isbn-10 is numerically valid
else
if id:match ('^%d+$') == nil then
return return_result (false, cfg.err_msg_supl.char); -- fail if ISBN-13 is not all digits
end
if id:match ('^97[89]%d*$') == nil then
return return_result (false, cfg.err_msg_supl.prefix); -- fail when ISBN-13 does not begin with 978 or 979
end
if id:match ('^9790') then
return return_result (false, cfg.err_msg_supl.group); -- group identifier '0' is reserved to ISMN
end
return return_result (is_valid_isxn_13 (id), cfg.err_msg_supl.check);
end
end
--[[--------------------------< A S I N >----------------------------------------------------------------------
Formats a link to Amazon. Do simple error checking: ASIN must be mix of 10 numeric or uppercase alpha
characters. If a mix, first character must be uppercase alpha; if all numeric, ASINs must be 10-digit
ISBN. If 10-digit ISBN, add a maintenance category so a bot or AWB script can replace |asin= with |isbn=.
Error message if not 10 characters, if not ISBN-10, if mixed and first character is a digit.
|asin=630....... and |asin=631....... are (apparently) not a legitimate ISBN though it checksums as one; these
do not cause this function to emit the maint_asin message
This function is positioned here because it calls isbn()
]]
local function asin (options)
local id = options.id;
local domain = options.ASINTLD;
local err_flag;
if not id:match("^[%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u]$") then
err_flag = set_message ('err_bad_asin'); -- ASIN is not a mix of 10 uppercase alpha and numeric characters
else
if id:match("^%d%d%d%d%d%d%d%d%d[%dX]$") then -- if 10-digit numeric (or 9 digits with terminal X)
if is_valid_isxn (id, 10) then -- see if ASIN value is or validates as ISBN-10
if not id:find ('^63[01]') then -- 630xxxxxxx and 631xxxxxxx are (apparently) not a valid isbn prefixes but are used by amazon as a numeric identifier
err_flag = set_message ('err_bad_asin'); -- ASIN has ISBN-10 form but begins with something other than 630/1 so probably an isbn
end
elseif not is_set (err_flag) then
err_flag = set_message ('err_bad_asin'); -- ASIN is not ISBN-10
end
elseif not id:match("^%u[%d%u]+$") then
err_flag = set_message ('err_bad_asin'); -- asin doesn't begin with uppercase alpha
end
end
if (not is_set (domain)) or in_array (domain, {'us'}) then -- default: United States
domain = "com";
elseif in_array (domain, {'jp', 'uk'}) then -- Japan, United Kingdom
domain = "co." .. domain;
elseif in_array (domain, {'z.cn'}) then -- China
domain = "cn";
elseif in_array (domain, {'au', 'br', 'mx', 'sg', 'tr'}) then -- Australia, Brazil, Mexico, Singapore, Turkey
domain = "com." .. domain;
elseif not in_array (domain, {'ae', 'ca', 'cn', 'de', 'es', 'fr', 'in', 'it', 'nl', 'pl', 'sa', 'se', 'co.jp', 'co.uk', 'com', 'com.au', 'com.br', 'com.mx', 'com.sg', 'com.tr'}) then -- Arabic Emirates, Canada, China, Germany, Spain, France, Indonesia, Italy, Netherlands, Poland, Saudi Arabia, Sweden (as of 2021-03 Austria (.at), Liechtenstein (.li) and Switzerland (.ch) still redirect to the German site (.de) with special settings, so don't maintain local ASINs for them)
err_flag = set_message ('err_bad_asin_tld'); -- unsupported asin-tld value
end
local handler = options.handler;
if not is_set (err_flag) then
options.coins_list_t['ASIN'] = handler.prefix .. domain .. "/dp/" .. id; -- asin for coins
else
options.coins_list_t['ASIN'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix .. domain .. "/dp/",
id = id, encode = handler.encode, separator = handler.separator})
end
--[[--------------------------< I S M N >----------------------------------------------------------------------
Determines whether an ISMN string is valid. Similar to ISBN-13, ISMN is 13 digits beginning 979-0-... and uses the
same check digit calculations. See https://www.ismn-international.org/download/Web_ISMN_Users_Manual_2008-6.pdf
section 2, pages 9–12.
ismn value not made part of COinS metadata because we don't have a url or isn't a COinS-defined identifier (rft.xxx)
or an identifier registered at info-uri.info (info:)
]]
local function ismn (options)
local id = options.id;
local handler = options.handler;
local text;
local valid_ismn = true;
local id_copy;
id_copy = id; -- save a copy because this testing is destructive
id = id:gsub ('[%s-]', ''); -- remove hyphens and white space
if 13 ~= id:len() or id:match ("^9790%d*$" ) == nil then -- ISMN must be 13 digits and begin with 9790
valid_ismn = false;
else
valid_ismn=is_valid_isxn_13 (id); -- validate ISMN
end
-- text = internal_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect, -- use this (or external version) when there is some place to link to
-- prefix = handler.prefix, id = id_copy, separator = handler.separator, encode = handler.encode})
text = table.concat ( -- because no place to link to yet
{
make_wikilink (label_link_make (handler), handler.label),
handler.separator,
id_copy
});
if false == valid_ismn then
options.coins_list_t['ISMN'] = nil; -- when error, unset so not included in COinS; not really necessary here because ismn not made part of COinS
set_message ('err_bad_ismn'); -- create an error message if the ISMN is invalid
end
return text;
end
--[[--------------------------< I S S N >----------------------------------------------------------------------
Validate and format an ISSN. This code fixes the case where an editor has included an ISSN in the citation but
has separated the two groups of four digits with a space. When that condition occurred, the resulting link looked
like this:
|issn=0819 4327 gives: [https://www.worldcat.org/issn/0819 4327 0819 4327] -- can't have spaces in an external link
This code now prevents that by inserting a hyphen at the ISSN midpoint. It also validates the ISSN for length
and makes sure that the checkdigit agrees with the calculated value. Incorrect length (8 digits), characters
other than 0-9 and X, or checkdigit / calculated value mismatch will all cause a check ISSN error message. The
ISSN is always displayed with a hyphen, even if the ISSN was given as a single group of 8 digits.
]]
local function issn (options)
local id = options.id;
local handler = options.handler;
local ignore_invalid = options.accept;
local issn_copy = id; -- save a copy of unadulterated ISSN; use this version for display if ISSN does not validate
local text;
local valid_issn = true;
id = id:gsub ('[%s-]', ''); -- remove hyphens and whitespace
if 8 ~= id:len() or nil == id:match ("^%d*X?$" ) then -- validate the ISSN: 8 digits long, containing only 0-9 or X in the last position
valid_issn = false; -- wrong length or improper character
else
valid_issn = is_valid_isxn (id, 8); -- validate ISSN
end
if true == valid_issn then
id = string.sub (id, 1, 4 ) .. "-" .. string.sub (id, 5 ); -- if valid, display correctly formatted version
else
id = issn_copy; -- if not valid, show the invalid ISSN with error message
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode})
if ignore_invalid then
set_message ('maint_issn_ignore');
else
if false == valid_issn then
options.coins_list_t['ISSN'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_issn', (options.hkey == 'EISSN') and 'e' or ''); -- create an error message if the ISSN is invalid
end
end
return text;
end
--[[--------------------------< J F M >-----------------------------------------------------------------------
A numerical identifier in the form nn.nnnn.nn
]]
local function jfm (options)
local id = options.id;
local handler = options.handler;
local id_num;
id_num = id:match ('^[Jj][Ff][Mm](.*)$'); -- identifier with jfm prefix; extract identifier
if is_set (id_num) then
set_message ('maint_jfm_format');
else -- plain number without JFM prefix
id_num = id; -- if here id does not have prefix
end
if id_num and id_num:match('^%d%d%.%d%d%d%d%.%d%d$') then
id = id_num; -- jfm matches pattern
else
set_message ('err_bad_jfm' ); -- set an error message
options.coins_list_t['JFM'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< J S T O R >--------------------------------------------------------------------
Format a JSTOR with some error checking
]]
local function jstor (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
if id:find ('[Jj][Ss][Tt][Oo][Rr]') or id:find ('^https?://') or id:find ('%s') then
set_message ('err_bad_jstor'); -- set an error message
options.coins_list_t['JSTOR'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
end
--[[--------------------------< L C C N >----------------------------------------------------------------------
Format LCCN link and do simple error checking. LCCN is a character string 8-12 characters long. The length of
the LCCN dictates the character type of the first 1-3 characters; the rightmost eight are always digits.
https://oclc-research.github.io/infoURI-Frozen/info-uri.info/info:lccn/reg.html
length = 8 then all digits
length = 9 then lccn[1] is lowercase alpha
length = 10 then lccn[1] and lccn[2] are both lowercase alpha or both digits
length = 11 then lccn[1] is lower case alpha, lccn[2] and lccn[3] are both lowercase alpha or both digits
length = 12 then lccn[1] and lccn[2] are both lowercase alpha
]]
local function lccn (options)
local lccn = options.id;
local handler = options.handler;
local err_flag; -- presume that LCCN is valid
local id = lccn; -- local copy of the LCCN
id = normalize_lccn (id); -- get canonical form (no whitespace, hyphens, forward slashes)
local len = id:len(); -- get the length of the LCCN
if 8 == len then
if id:match("[^%d]") then -- if LCCN has anything but digits (nil if only digits)
err_flag = set_message ('err_bad_lccn'); -- set an error message
end
elseif 9 == len then -- LCCN should be adddddddd
if nil == id:match("%l%d%d%d%d%d%d%d%d") then -- does it match our pattern?
err_flag = set_message ('err_bad_lccn'); -- set an error message
end
elseif 10 == len then -- LCCN should be aadddddddd or dddddddddd
if id:match("[^%d]") then -- if LCCN has anything but digits (nil if only digits) ...
if nil == id:match("^%l%l%d%d%d%d%d%d%d%d") then -- ... see if it matches our pattern
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
end
elseif 11 == len then -- LCCN should be aaadddddddd or adddddddddd
if not (id:match("^%l%l%l%d%d%d%d%d%d%d%d") or id:match("^%l%d%d%d%d%d%d%d%d%d%d")) then -- see if it matches one of our patterns
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
elseif 12 == len then -- LCCN should be aadddddddddd
if not id:match("^%l%l%d%d%d%d%d%d%d%d%d%d") then -- see if it matches our pattern
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
else
err_flag = set_message ('err_bad_lccn'); -- wrong length, set an error message
end
if not is_set (err_flag) and nil ~= lccn:find ('%s') then
err_flag = set_message ('err_bad_lccn'); -- lccn contains a space, set an error message
end
if is_set (err_flag) then
options.coins_list_t['LCCN'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = lccn, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< M E D R X I V >-----------------------------------------------------------------
Format medRxiv ID and do simple error checking. Similar to later bioRxiv IDs, medRxiv IDs are prefixed with a
yyyy.mm.dd. date and suffixed with an optional version identifier. Ealiest date accepted is 2020.01.01
The medRxiv ID is a date followed by an eight-digit number followed by an optional version indicator 'v' and one or more digits:
https://www.medrxiv.org/content/10.1101/2020.11.16.20232009v2 -> 10.1101/2020.11.16.20232009v2
]]
local function medrxiv (options)
local id = options.id;
local handler = options.handler;
local err_msg_flag = true; -- flag; assume that there will be an error
local patterns = {
'^%d%d%d%d%d%d%d%d$', -- simple 8-digit identifier; these should be relatively rare
'^10%.1101/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%d%d%dv%d+$', -- y.m.d. date + 8-digit identifier + version (2020-01-01 and later)
'^10%.1101/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%d%d%d$', -- y.m.d. date + 8-digit identifier (2020-01-01 and later)
'^10%.64898/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%d%d%dv%d+$', -- y.m.d. date + 8-digit identifier + version (2025-12-01 and later)
'^10%.64898/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%d%d%d$', -- y.m.d. date + 8-digit identifier (2025-12-01 and later)
}
for _, pattern in ipairs (patterns) do -- spin through the patterns looking for a match
if id:match (pattern) then
local y, m, d = id:match (pattern); -- found a match, attempt to get year, month and date from the identifier
if m then -- m is nil when id is the 8-digit form
if not is_valid_rxiv_date (y, m, d, 'b') then -- validate the encoded date; 'b' for medrxiv limit
break; -- date fail; break out early so we don't unset the error message
end
end
err_msg_flag = nil; -- we found a match so unset the error message
break; -- and done
end
end -- <err_msg_flag> remains set here when no match
if err_msg_flag then
options.coins_list_t['MEDRXIV'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_medrxiv'); -- and set the error message
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator,
encode = handler.encode, access = handler.access});
end
--[[--------------------------< M R >--------------------------------------------------------------------------
A seven digit number; if not seven digits, zero-fill leading digits to make seven digits.
]]
local function mr (options)
local id = options.id;
local handler = options.handler;
local id_num;
local id_len;
id_num = id:match ('^[Mm][Rr](%d+)$'); -- identifier with mr prefix
if is_set (id_num) then
set_message ('maint_mr_format'); -- add maint cat
else -- plain number without mr prefix
id_num = id:match ('^%d+$'); -- if here id is all digits
end
id_len = id_num and id_num:len() or 0;
if (7 >= id_len) and (0 ~= id_len) then
id = string.rep ('0', 7-id_len) .. id_num; -- zero-fill leading digits
else
set_message ('err_bad_mr'); -- set an error message
options.coins_list_t['MR'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< O C L C >----------------------------------------------------------------------
Validate and format an OCLC ID. https://www.oclc.org/batchload/controlnumber.en.html {{dead link}}
archived at: https://web.archive.org/web/20161228233804/https://www.oclc.org/batchload/controlnumber.en.html
]]
local function oclc (options)
local id = options.id;
local handler = options.handler;
local number;
if id:match('^ocm%d%d%d%d%d%d%d%d$') then -- ocm prefix and 8 digits; 001 field (12 characters)
number = id:match('ocm(%d+)'); -- get the number
elseif id:match('^ocn%d%d%d%d%d%d%d%d%d$') then -- ocn prefix and 9 digits; 001 field (12 characters)
number = id:match('ocn(%d+)'); -- get the number
elseif id:match('^on%d%d%d%d%d%d%d%d%d%d+$') then -- on prefix and 10 or more digits; 001 field (12 characters)
number = id:match('^on(%d%d%d%d%d%d%d%d%d%d+)$'); -- get the number
elseif id:match('^%(OCoLC%)[1-9]%d*$') then -- (OCoLC) prefix and variable number digits; no leading zeros; 035 field
number = id:match('%(OCoLC%)([1-9]%d*)'); -- get the number
if 9 < number:len() then
number = nil; -- constrain to 1 to 9 digits; change this when OCLC issues 10-digit numbers
end
elseif id:match('^%d+$') then -- no prefix
number = id; -- get the number
if tonumber (id) > handler.id_limit then
number = nil; -- unset when id value exceeds the limit
end
end
if number then -- proper format
id = number; -- exclude prefix, if any, from external link
else
set_message ('err_bad_oclc') -- add an error message if the id is malformed
options.coins_list_t['OCLC'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< O P E N L I B R A R Y >--------------------------------------------------------
Formats an OpenLibrary link, and checks for associated errors.
]]
local function openlibrary (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local ident, code = id:gsub('^OL', ''):match("^(%d+([AMW]))$"); -- strip optional OL prefix followed immediately by digits followed by 'A', 'M', or 'W';
local err_flag;
local prefix = { -- these are appended to the handler.prefix according to code
['A']='authors/OL',
['M']='books/OL',
['W']='works/OL',
['X']='OL' -- not a code; spoof when 'code' in id is invalid
};
if not ident then
code = 'X'; -- no code or id completely invalid
ident = id; -- copy id to ident so that we display the flawed identifier
err_flag = set_message ('err_bad_ol');
end
if not is_set (err_flag) then
options.coins_list_t['OL'] = handler.prefix .. prefix[code] .. ident; -- experiment for ol coins
else
options.coins_list_t['OL'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix .. prefix[code],
id = ident, separator = handler.separator, encode = handler.encode,
access = access});
end
--[[--------------------------< O S T I >----------------------------------------------------------------------
Format OSTI and do simple error checking. OSTIs are sequential numbers beginning at 1 and counting up. This
code checks the OSTI to see that it contains only digits and is less than test_limit specified in the configuration;
the value in test_limit will need to be updated periodically as more OSTIs are issued.
NB. 1018 is the lowest OSTI number found in the wild (so far) and resolving OK on the OSTI site
]]
local function osti (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
if id:match("[^%d]") then -- if OSTI has anything but digits
set_message ('err_bad_osti'); -- set an error message
options.coins_list_t['OSTI'] = nil; -- when error, unset so not included in COinS
else -- OSTI is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1018 > id_num or handler.id_limit < id_num then -- if OSTI is outside test limit boundaries
set_message ('err_bad_osti'); -- set an error message
options.coins_list_t['OSTI'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
end
--[[--------------------------< P M C >------------------------------------------------------------------------
Format a PMC, do simple error checking, and check for embargoed articles.
The embargo parameter takes a date for a value. If the embargo date is in the future the PMC identifier will not
be linked to the article. If the embargo date is today or in the past, or if it is empty or omitted, then the
PMC identifier is linked to the article through the link at cfg.id_handlers['PMC'].prefix.
PMC embargo date testing is done in function is_embargoed () which is called earlier because when the citation
has |pmc=<value> but does not have a |url= then |title= is linked with the PMC link. Function is_embargoed ()
returns the embargo date if the PMC article is still embargoed, otherwise it returns an empty string.
PMCs are sequential numbers beginning at 1 and counting up. This code checks the PMC to see that it contains only digits and is less
than test_limit; the value in local variable test_limit will need to be updated periodically as more PMCs are issued.
]]
local function pmc (options)
local id = options.id;
local embargo = options.Embargo; -- TODO: lowercase?
local handler = options.handler;
local err_flag;
local id_num;
local text;
id_num = id:match ('^[Pp][Mm][Cc](%d+)$'); -- identifier with PMC prefix
if is_set (id_num) then
set_message ('maint_pmc_format');
else -- plain number without PMC prefix
id_num = id:match ('^%d+$'); -- if here id is all digits
end
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if PMC is outside test limit boundaries
err_flag = set_message ('err_bad_pmc'); -- set an error message
else
id = tostring (id_num); -- make sure id is a string
end
else -- when id format incorrect
err_flag = set_message ('err_bad_pmc'); -- set an error message
end
if is_set (embargo) and is_set (is_embargoed (embargo)) then -- is PMC is still embargoed?
text = table.concat ( -- still embargoed so no external link
{
make_wikilink (label_link_make (handler), handler.label),
handler.separator,
id,
});
else
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect, -- no embargo date or embargo has expired, ok to link to article
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access,
auto_link = not err_flag and 'pmc' or nil -- do not auto-link when PMC has error
});
end
if err_flag then
options.coins_list_t['PMC'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< P M I D >----------------------------------------------------------------------
Format PMID and do simple error checking. PMIDs are sequential numbers beginning at 1 and counting up. This
code checks the PMID to see that it contains only digits and is less than test_limit; the value in local variable
test_limit will need to be updated periodically as more PMIDs are issued.
]]
local function pmid (options)
local id = options.id;
local handler = options.handler;
if id:match("[^%d]") then -- if PMID has anything but digits
set_message ('err_bad_pmid'); -- set an error message
options.coins_list_t['PMID'] = nil; -- when error, unset so not included in COinS
else -- PMID is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if PMID is outside test limit boundaries
set_message ('err_bad_pmid'); -- set an error message
options.coins_list_t['PMID'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< R F C >------------------------------------------------------------------------
Format RFC and do simple error checking. RFCs are sequential numbers beginning at 1 and counting up. This
code checks the RFC to see that it contains only digits and is less than test_limit specified in the configuration;
the value in test_limit will need to be updated periodically as more RFCs are issued.
An index of all RFCs is here: https://tools.ietf.org/rfc/
]]
local function rfc (options)
local id = options.id;
local handler = options.handler;
if id:match("[^%d]") then -- if RFC has anything but digits
set_message ('err_bad_rfc'); -- set an error message
options.coins_list_t['RFC'] = nil; -- when error, unset so not included in COinS
else -- RFC is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if RFC is outside test limit boundaries
set_message ('err_bad_rfc'); -- set an error message
options.coins_list_t['RFC'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access});
end
--[[--------------------------< S 2 C I D >--------------------------------------------------------------------
Format an S2CID, do simple error checking
S2CIDs are sequential numbers beginning at 1 and counting up. This code checks the S2CID to see that it is only
digits and is less than test_limit; the value in local variable test_limit will need to be updated periodically
as more S2CIDs are issued.
]]
local function s2cid (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local id_num;
local text;
id_num = id:match ('^[1-9]%d*$'); -- id must be all digits; must not begin with 0; no open access flag
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if handler.id_limit < id_num then -- if S2CID is outside test limit boundaries
set_message ('err_bad_s2cid'); -- set an error message
options.coins_list_t['S2CID'] = nil; -- when error, unset so not included in COinS
end
else -- when id format incorrect
set_message ('err_bad_s2cid'); -- set an error message
options.coins_list_t['S2CID'] = nil; -- when error, unset so not included in COinS
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
return text;
end
--[[--------------------------< S B N >------------------------------------------------------------------------
9-digit form of ISBN-10; uses same check-digit validation when SBN is prefixed with an additional '0' to make 10 digits
sbn value not made part of COinS metadata because we don't have a url or isn't a COinS-defined identifier (rft.xxx)
or an identifier registered at info-uri.info (info:)
]]
local function sbn (options)
local id = options.id;
local ignore_invalid = options.accept;
local handler = options.handler;
local function return_result (check, err_type) -- local function to handle the various returns
local SBN = internal_link_id ({link = handler.link, label = handler.label, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator});
if not ignore_invalid then -- if not ignoring SBN errors
if not check then
options.coins_list_t['SBN'] = nil; -- when error, unset so not included in COinS; not really necessary here because sbn not made part of COinS
set_message ('err_bad_sbn', {err_type}); -- display an error message
return SBN;
end
else
set_message ('maint_isbn_ignore'); -- add a maint category even when there is no error (ToDo: Possibly switch to separate message for SBNs only)
end
return SBN;
end
if id:match ('[^%s-0-9X]') then
return return_result (false, cfg.err_msg_supl.char); -- fail if SBN contains anything but digits, hyphens, or the uppercase X
end
local ident = id:gsub ('[%s-]', ''); -- remove hyphens and whitespace; they interfere with the rest of the tests
if 9 ~= ident:len() then
return return_result (false, cfg.err_msg_supl.length); -- fail if incorrect length
end
if ident:match ('^%d*X?$') == nil then
return return_result (false, cfg.err_msg_supl.form); -- fail if SBN has 'X' anywhere but last position
end
return return_result (is_valid_isxn ('0' .. ident, 10), cfg.err_msg_supl.check);
end
--[[--------------------------< S S R N >----------------------------------------------------------------------
Format an SSRN, do simple error checking
SSRNs are sequential numbers beginning at 100? and counting up. This code checks the SSRN to see that it is
only digits and is greater than 99 and less than test_limit; the value in local variable test_limit will need
to be updated periodically as more SSRNs are issued.
]]
local function ssrn (options)
local id = options.id;
local handler = options.handler;
local id_num;
local text;
id_num = id:match ('^%d+$'); -- id must be all digits
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if 100 > id_num or handler.id_limit < id_num then -- if SSRN is outside test limit boundaries
set_message ('err_bad_ssrn'); -- set an error message
options.coins_list_t['SSRN'] = nil; -- when error, unset so not included in COinS
end
else -- when id format incorrect
set_message ('err_bad_ssrn'); -- set an error message
options.coins_list_t['SSRN'] = nil; -- when error, unset so not included in COinS
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = options.access});
return text;
end
--[[--------------------------< U S E N E T _ I D >------------------------------------------------------------
Validate and format a usenet message id. Simple error checking, looks for 'id-left@id-right' not enclosed in
'<' and/or '>' angle brackets.
]]
local function usenet_id (options)
local id = options.id;
local handler = options.handler;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode})
if not id:match('^.+@.+$') or not id:match('^[^<].*[^>]$') then -- doesn't have '@' or has one or first or last character is '< or '>'
set_message ('err_bad_usenet_id') -- add an error message if the message id is invalid
options.coins_list_t['USENETID'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< Z B L >-----------------------------------------------------------------------
A numerical identifier in the form nnnn.nnnnn - leading zeros in the first quartet optional
format described here: http://emis.mi.sanu.ac.rs/ZMATH/zmath/en/help/search/
temporary format is apparently eight digits. Anything else is an error
]]
local function zbl (options)
local id = options.id;
local handler = options.handler;
if id:match('^%d%d%d%d%d%d%d%d$') then -- is this identifier using temporary format?
set_message ('maint_zbl'); -- yes, add maint cat
elseif not id:match('^%d?%d?%d?%d%.%d%d%d%d%d$') then -- not temporary, is it normal format?
set_message ('err_bad_zbl'); -- no, set an error message
options.coins_list_t['ZBL'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--============================<< I N T E R F A C E F U N C T I O N S >>==========================================
--[[--------------------------< E X T R A C T _ I D S >------------------------------------------------------------
Populates ID table from arguments using configuration settings. Loops through cfg.id_handlers and searches args for
any of the parameters listed in each cfg.id_handlers['...'].parameters. If found, adds the parameter and value to
the identifier list. Emits redundant error message if more than one alias exists in args
]]
local function extract_ids (args)
local id_list = {}; -- list of identifiers found in args
for k, v in pairs (cfg.id_handlers) do -- k is uppercase identifier name as index to cfg.id_handlers; e.g. cfg.id_handlers['ISBN'], v is a table
v = select_one (args, v.parameters, 'err_redundant_parameters' ); -- v.parameters is a table of aliases for k; here we pick one from args if present
if is_set (v) then id_list[k] = v; end -- if found in args, add identifier to our list
end
return id_list;
end
--[[--------------------------< E X T R A C T _ I D _ A C C E S S _ L E V E L S >--------------------------------------
Fetches custom id access levels from arguments using configuration settings. Parameters which have a predefined access
level (e.g. arxiv) do not use this function as they are directly rendered as free without using an additional parameter.
returns a table of k/v pairs where k is same as the identifier's key in cfg.id_handlers and v is the assigned (valid) keyword
access-level values must match the case used in cfg.keywords_lists['id-access'] (lowercase unless there is some special reason for something else)
]]
local function extract_id_access_levels (args, id_list)
local id_accesses_list = {};
for k, v in pairs (cfg.id_handlers) do
local access_param = v.custom_access; -- name of identifier's access-level parameter
if is_set (access_param) then
local access_level = args[access_param]; -- get the assigned value if there is one
if is_set (access_level) then
if not in_array (access_level, cfg.keywords_lists['id-access']) then -- exact match required
set_message ('err_invalid_param_val', {access_param, access_level});
access_level = nil; -- invalid so unset
end
if not is_set (id_list[k]) then -- identifier access-level must have a matching identifier
set_message ('err_param_access_requires_param', {k:lower()}); -- parameter name is uppercase in cfg.id_handlers (k); lowercase for error message
end
id_accesses_list[k] = cfg.keywords_xlate[access_level]; -- get translated keyword
end
end
end
return id_accesses_list;
end
--[[--------------------------< B U I L D _ I D _ L I S T >----------------------------------------------------
render the identifiers into a sorted sequence table
<ID_list_coins_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value
<options_t> is a table of various k/v option pairs provided in the call to new_build_id_list();
modified by this function and passed to all identifier rendering functions
<access_levels_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value (if valid)
returns a sequence table of sorted (by hkey - 'handler' key) rendered identifier strings
]]
local function build_id_list (ID_list_coins_t, options_t, access_levels_t)
local ID_list_t = {};
local accept;
local func_map = { --function map points to functions associated with hkey identifier
['ARXIV'] = arxiv,
['ASIN'] = asin,
['BIBCODE'] = bibcode,
['BIORXIV'] = biorxiv,
['CITESEERX'] = citeseerx,
['DOI'] = doi,
['EISSN'] = issn,
['HDL'] = hdl,
['ISBN'] = isbn,
['ISMN'] = ismn,
['ISSN'] = issn,
['JFM'] = jfm,
['JSTOR'] = jstor,
['LCCN'] = lccn,
['MEDRXIV'] = medrxiv,
['MR'] = mr,
['OCLC'] = oclc,
['OL'] = openlibrary,
['OSTI'] = osti,
['PMC'] = pmc,
['PMID'] = pmid,
['RFC'] = rfc,
['S2CID'] = s2cid,
['SBN'] = sbn,
['SSRN'] = ssrn,
['USENETID'] = usenet_id,
['ZBL'] = zbl,
}
for hkey, v in pairs (ID_list_coins_t) do
v, accept = has_accept_as_written (v); -- remove accept-as-written markup if present; accept is boolean true when markup removed; false else
-- every function gets the options table with value v and accept boolean
options_t.hkey = hkey; -- ~/Configuration handler key
options_t.id = v; -- add that identifier value to the options table
options_t.accept = accept; -- add the accept boolean flag
options_t.access = access_levels_t[hkey]; -- add the access level for those that have an |<identifier-access= parameter
options_t.handler = cfg.id_handlers[hkey];
options_t.coins_list_t = ID_list_coins_t; -- pointer to ID_list_coins_t; for |asin= and |ol=; also to keep erroneous values out of the citation's metadata
options_t.coins_list_t[hkey] = v; -- id value without accept-as-written markup for metadata
if options_t.handler.access and not in_array (options_t.handler.access, cfg.keywords_lists['id-access']) then
error (cfg.messages['unknown_ID_access'] .. options_t.handler.access); -- here when handler access key set to a value not listed in list of allowed id access keywords
end
if func_map[hkey] then
local id_text = func_map[hkey] (options_t); -- call the function to get identifier text and any error message
table.insert (ID_list_t, {hkey, id_text}); -- add identifier text to the output sequence table
else
error (cfg.messages['unknown_ID_key'] .. hkey); -- here when func_map doesn't have a function for hkey
end
end
local function comp (a, b) -- used by following table.sort()
return a[1]:lower() < b[1]:lower(); -- sort by hkey
end
table.sort (ID_list_t, comp); -- sequence table of tables sort
for k, v in ipairs (ID_list_t) do -- convert sequence table of tables to simple sequence table of strings
ID_list_t[k] = v[2]; -- v[2] is the identifier rendering from the call to the various functions in func_map{}
end
return ID_list_t;
end
--[[--------------------------< O P T I O N S _ C H E C K >----------------------------------------------------
check that certain option parameters have their associated identifier parameters with values
<ID_list_coins_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value
<ID_support_t> is a sequence table of tables created in citation0() where each subtable has four elements:
[1] is the support parameter's assigned value; empty string if not set
[2] is a text string same as key in cfg.id_handlers
[3] is cfg.error_conditions key used to create error message
[4] is original ID support parameter name used to create error message
returns nothing; on error emits an appropriate error message
]]
local function options_check (ID_list_coins_t, ID_support_t)
for _, v in ipairs (ID_support_t) do
if is_set (v[1]) and not ID_list_coins_t[v[2]] then -- when support parameter has a value but matching identifier parameter is missing or empty
set_message (v[3], (v[4])); -- emit the appropriate error message
end
end
end
--[[--------------------------< I D E N T I F I E R _ L I S T S _ G E T >--------------------------------------
Creates two identifier lists: a k/v table of identifiers and their values to be used locally and for use in the
COinS metadata, and a sequence table of the rendered identifier strings that will be included in the rendered
citation.
]]
local function identifier_lists_get (args_t, options_t, ID_support_t)
local ID_list_coins_t = extract_ids (args_t); -- get a table of identifiers and their values for use locally and for use in COinS
options_check (ID_list_coins_t, ID_support_t); -- ID support parameters must have matching identifier parameters
local ID_access_levels_t = extract_id_access_levels (args_t, ID_list_coins_t); -- get a table of identifier access levels
local ID_list_t = build_id_list (ID_list_coins_t, options_t, ID_access_levels_t); -- get a sequence table of rendered identifier strings
return ID_list_t, ID_list_coins_t; -- return the tables
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table and imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
cfg = cfg_table_ptr;
has_accept_as_written = utilities_page_ptr.has_accept_as_written; -- import functions from select Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
set_message = utilities_page_ptr.set_message;
select_one = utilities_page_ptr.select_one;
substitute = utilities_page_ptr.substitute;
make_wikilink = utilities_page_ptr.make_wikilink;
z = utilities_page_ptr.z; -- table of tables in Module:Citation/CS1/Utilities
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
auto_link_urls = auto_link_urls, -- table of identifier URLs to be used when auto-linking |title=
identifier_lists_get = identifier_lists_get, -- experiment to replace individual calls to build_id_list(), extract_ids, extract_id_access_levels
is_embargoed = is_embargoed;
set_selected_modules = set_selected_modules;
}
e4jc9mw0kujge8fok9aztk214jmz0lr
Module:Citation/CS1/COinS
828
11074211
37019535
35046686
2026-05-01T14:28:58Z
Exec8
10305
37019535
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local has_accept_as_written, is_set, in_array, remove_wiki_link, strip_apostrophe_markup; -- functions in Module:Citation/CS1/Utilities
local cfg; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
--[[--------------------------< M A K E _ C O I N S _ T I T L E >----------------------------------------------
Makes a title for COinS from Title and / or ScriptTitle (or any other name-script pairs)
Apostrophe markup (bold, italics) is stripped from each value so that the COinS metadata isn't corrupted with strings
of %27%27...
]]
local function make_coins_title (title, script)
title = has_accept_as_written (title);
if is_set (title) then
title = strip_apostrophe_markup (title); -- strip any apostrophe markup
else
title = ''; -- if not set, make sure title is an empty string
end
if is_set (script) then
script = script:gsub ('^%l%l%s*:%s*', ''); -- remove language prefix if present (script value may now be empty string)
script = strip_apostrophe_markup (script); -- strip any apostrophe markup
else
script = ''; -- if not set, make sure script is an empty string
end
if is_set (title) and is_set (script) then
script = ' ' .. script; -- add a space before we concatenate
end
return title .. script; -- return the concatenation
end
--[[--------------------------< E S C A P E _ L U A _ M A G I C _ C H A R S >----------------------------------
Returns a string where all of Lua's magic characters have been escaped. This is important because functions like
string.gsub() treat their pattern and replace strings as patterns, not literal strings.
]]
local function escape_lua_magic_chars (argument)
argument = argument:gsub("%%", "%%%%"); -- replace % with %%
argument = argument:gsub("([%^%$%(%)%.%[%]%*%+%-%?])", "%%%1"); -- replace all other Lua magic pattern characters
return argument;
end
--[[--------------------------< G E T _ C O I N S _ P A G E S >------------------------------------------------
Extract page numbers from external wikilinks in any of the |page=, |pages=, or |at= parameters for use in COinS.
]]
local function get_coins_pages (pages)
local pattern;
if not is_set (pages) then return pages; end -- if no page numbers then we're done
while true do
pattern = pages:match("%[(%w*:?//[^ ]+%s+)[%w%d].*%]"); -- pattern is the opening bracket, the URL and following space(s): "[url "
if nil == pattern then break; end -- no more URLs
pattern = escape_lua_magic_chars (pattern); -- pattern is not a literal string; escape Lua's magic pattern characters
pages = pages:gsub(pattern, ""); -- remove as many instances of pattern as possible
end
pages = pages:gsub("[%[%]]", ""); -- remove the brackets
pages = pages:gsub("–", "-" ); -- replace endashes with hyphens
pages = pages:gsub("&%w+;", "-" ); -- and replace HTML entities (– etc.) with hyphens; do we need to replace numerical entities like   and the like?
pages = pages:gsub ('%b<>', ''); -- remove html-like tags; spans are added to <Pages> by utilities.hyphen_to_dash() which should not appear in COinS metadata
return pages;
end
--[=[-------------------------< C O I N S _ R E P L A C E _ M A T H _ S T R I P M A R K E R >------------------
There are three options for math markup rendering that depend on the editor's math preference settings. These
settings are at [[Special:Preferences#mw-prefsection-rendering]] and are
PNG images
TeX source
MathML with SVG or PNG fallback
All three are heavy with HTML and CSS which doesn't belong in the metadata.
Without this function, the metadata saved in the raw wikitext contained the rendering determined by the settings
of the last editor to save the page.
This function gets the rendered form of an equation according to the editor's preference before the page is saved. It
then searches the rendering for the text equivalent of the rendered equation and replaces the rendering with that so
that the page is saved without extraneous HTML/CSS markup and with a reasonably readable text form of the equation.
When a replacement is made, this function returns true and the value with replacement; otherwise false and the initial
value. To replace multipe equations it is necessary to call this function from within a loop.
]=]
local function coins_replace_math_stripmarker (value)
local stripmarker = cfg.stripmarkers['math'];
local rendering = value:match (stripmarker); -- is there a math stripmarker
if not rendering then -- when value doesn't have a math stripmarker, abandon this test
return false, value;
end
rendering = mw.text.unstripNoWiki (rendering); -- convert stripmarker into rendered value (or nil? ''? when math render error)
if rendering:match ('alt="[^"]+"') then -- if PNG math option
rendering = rendering:match ('alt="([^"]+)"'); -- extract just the math text
elseif rendering:match ('$%s+.+%s+%$') then -- if TeX math option; $ is legit character that is escapes as \$
rendering = rendering:match ('$%s+(.+)%s+%$') -- extract just the math text
elseif rendering:match ('<annotation[^>]+>.+</annotation>') then -- if MathML math option
rendering = rendering:match ('<annotation[^>]+>(.+)</annotation>') -- extract just the math text
else
return false, value; -- had math stripmarker but not one of the three defined forms
end
return true, value:gsub (stripmarker, rendering, 1);
end
--[[--------------------------< C O I N S _ C L E A N U P >----------------------------------------------------
Cleanup parameter values for the metadata by removing or replacing invisible characters and certain HTML entities.
2015-12-10: there is a bug in mw.text.unstripNoWiki (). It replaces math stripmarkers with the appropriate content
when it shouldn't. See https://phabricator.wikimedia.org/T121085 and Wikipedia_talk:Lua#stripmarkers_and_mw.text.unstripNoWiki.28.29
TODO: move the replacement patterns and replacement values into a table in /Configuration similar to the invisible
characters table?
]]
local function coins_cleanup (value)
local replaced = true; -- default state to get the do loop running
while replaced do -- loop until all math stripmarkers replaced
replaced, value = coins_replace_math_stripmarker (value); -- replace math stripmarker with text representation of the equation
end
value = value:gsub (cfg.stripmarkers['math'], "MATH RENDER ERROR"); -- one or more couldn't be replaced; insert vague error message
value = mw.text.unstripNoWiki (value); -- replace nowiki stripmarkers with their content
value = value:gsub ('<span class="nowrap" style="padding%-left:0%.1em;">'(s?)</span>', "'%1"); -- replace {{'}} or {{'s}} with simple apostrophe or apostrophe-s
value = value:gsub (' ', ' '); -- replace entity with plain space
value = value:gsub ('\226\128\138', ' '); -- replace hair space with plain space
if not mw.ustring.find (value, cfg.indic_script) then -- don't remove zero-width joiner characters from indic script
value = value:gsub ('‍', ''); -- remove ‍ entities
value = mw.ustring.gsub (value, '[\226\128\141\226\128\139\194\173]', ''); -- remove zero-width joiner, zero-width space, soft hyphen
end
value = value:gsub ('[\009\010\013 ]+', ' '); -- replace horizontal tab, line feed, carriage return with plain space
return value;
end
--[[--------------------------< C O I N S >--------------------------------------------------------------------
COinS metadata (see <http://ocoins.info/>) allows automated tools to parse the citation information.
]]
local function COinS(data, class)
if 'table' ~= type(data) or nil == next(data) then
return '';
end
for k, v in pairs (data) do -- spin through all of the metadata parameter values
if 'ID_list' ~= k and 'Authors' ~= k then -- except the ID_list and Author tables (author nowiki stripmarker done when Author table processed)
data[k] = coins_cleanup (v);
end
end
local ctx_ver = "Z39.88-2004";
-- treat table strictly as an array with only set values.
local OCinSoutput = setmetatable( {}, {
__newindex = function(self, key, value)
if is_set(value) then
rawset( self, #self+1, table.concat{ key, '=', mw.uri.encode( remove_wiki_link( value ) ) } );
end
end
});
if in_array (class, {'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn', 'journal', 'news', 'magazine'}) or
(in_array (class, {'conference', 'interview', 'map', 'press release', 'web'}) and is_set(data.Periodical)) or
('citation' == class and is_set(data.Periodical) and not is_set (data.Encyclopedia)) then
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:journal"; -- journal metadata identifier
if in_array (class, {'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) then -- set genre according to the type of citation template we are rendering
OCinSoutput["rft.genre"] = "preprint"; -- cite arxiv, cite biorxiv, cite citeseerx, cite medrxiv, cite ssrn
elseif 'conference' == class then
OCinSoutput["rft.genre"] = "conference"; -- cite conference (when Periodical set)
elseif 'web' == class then
OCinSoutput["rft.genre"] = "unknown"; -- cite web (when Periodical set)
else
OCinSoutput["rft.genre"] = "article"; -- journal and other 'periodical' articles
end
OCinSoutput["rft.jtitle"] = data.Periodical; -- journal only
OCinSoutput["rft.atitle"] = data.Title; -- 'periodical' article titles
-- these used only for periodicals
OCinSoutput["rft.ssn"] = data.Season; -- keywords: winter, spring, summer, fall
OCinSoutput["rft.quarter"] = data.Quarter; -- single digits 1->first quarter, etc.
OCinSoutput["rft.chron"] = data.Chron; -- free-form date components
OCinSoutput["rft.volume"] = data.Volume; -- does not apply to books
OCinSoutput["rft.issue"] = data.Issue;
OCinSoutput['rft.artnum'] = data.ArticleNumber; -- {{cite journal}} only
OCinSoutput["rft.pages"] = data.Pages; -- also used in book metadata
elseif 'thesis' ~= class then -- all others except cite thesis are treated as 'book' metadata; genre distinguishes
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:book"; -- book metadata identifier
if 'report' == class or 'techreport' == class then -- cite report and cite techreport
OCinSoutput["rft.genre"] = "report";
elseif 'conference' == class then -- cite conference when Periodical not set
OCinSoutput["rft.genre"] = "conference";
OCinSoutput["rft.atitle"] = data.Chapter; -- conference paper as chapter in proceedings (book)
elseif in_array (class, {'book', 'citation', 'encyclopaedia', 'interview', 'map'}) then
if is_set (data.Chapter) then
OCinSoutput["rft.genre"] = "bookitem";
OCinSoutput["rft.atitle"] = data.Chapter; -- book chapter, encyclopedia article, interview in a book, or map title
else
if 'map' == class or 'interview' == class then
OCinSoutput["rft.genre"] = 'unknown'; -- standalone map or interview
else
OCinSoutput["rft.genre"] = 'book'; -- book and encyclopedia
end
end
else -- {'audio-visual', 'AV-media-notes', 'DVD-notes', 'episode', 'interview', 'mailinglist', 'map', 'newsgroup', 'podcast', 'press release', 'serial', 'sign', 'speech', 'web'}
OCinSoutput["rft.genre"] = "unknown";
end
OCinSoutput["rft.btitle"] = data.Title; -- book only
OCinSoutput["rft.place"] = data.PublicationPlace; -- book only
OCinSoutput["rft.series"] = data.Series; -- book only
OCinSoutput["rft.pages"] = data.Pages; -- book, journal
OCinSoutput["rft.edition"] = data.Edition; -- book only
OCinSoutput["rft.pub"] = data.PublisherName; -- book and dissertation
else -- cite thesis
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:dissertation"; -- dissertation metadata identifier
OCinSoutput["rft.title"] = data.Title; -- dissertation (also patent but that is not yet supported)
OCinSoutput["rft.degree"] = data.Degree; -- dissertation only
OCinSoutput['rft.inst'] = data.PublisherName; -- book and dissertation
end
-- NB. Not currently supported are "info:ofi/fmt:kev:mtx:patent", "info:ofi/fmt:kev:mtx:dc", "info:ofi/fmt:kev:mtx:sch_svc", "info:ofi/fmt:kev:mtx:ctx"
-- and now common parameters (as much as possible)
OCinSoutput["rft.date"] = data.Date; -- book, journal, dissertation
for k, v in pairs( data.ID_list ) do -- what to do about these? For now assume that they are common to all?
if k == 'ISBN' then v = v:gsub( "[^-0-9X]", "" ); end
local id = cfg.id_handlers[k].COinS;
if string.sub( id or "", 1, 4 ) == 'info' then -- for ids that are in the info:registry
OCinSoutput["rft_id"] = table.concat{ id, "/", v };
elseif string.sub (id or "", 1, 3 ) == 'rft' then -- for isbn, issn, eissn, etc. that have defined COinS keywords
OCinSoutput[ id ] = v;
elseif 'url' == id then -- for urls that are assembled in ~/Identifiers; |asin= and |ol=
OCinSoutput["rft_id"] = table.concat ({data.ID_list[k], "#id-name=", cfg.id_handlers[k].label});
elseif id then -- when cfg.id_handlers[k].COinS is not nil so urls created here
OCinSoutput["rft_id"] = table.concat{ cfg.id_handlers[k].prefix, v, cfg.id_handlers[k].suffix or '', "#id-name=", cfg.id_handlers[k].label }; -- others; provide a URL and indicate identifier name as #fragment (human-readable, but transparent to browsers)
end
end
local last, first;
for k, v in ipairs( data.Authors ) do
last, first = coins_cleanup (v.last), coins_cleanup (v.first or ''); -- replace any nowiki stripmarkers, non-printing or invisible characters
if k == 1 then -- for the first author name only
if is_set(last) and is_set(first) then -- set these COinS values if |first= and |last= specify the first author name
OCinSoutput["rft.aulast"] = last; -- book, journal, dissertation
OCinSoutput["rft.aufirst"] = first; -- book, journal, dissertation
elseif is_set(last) then
OCinSoutput["rft.au"] = last; -- book, journal, dissertation -- otherwise use this form for the first name
end
else -- for all other authors
if is_set(last) and is_set(first) then
OCinSoutput["rft.au"] = table.concat{ last, ", ", first }; -- book, journal, dissertation
elseif is_set(last) then
OCinSoutput["rft.au"] = last; -- book, journal, dissertation
end
-- TODO: At present we do not report "et al.". Add anything special if this condition applies?
end
end
OCinSoutput.rft_id = data.URL;
OCinSoutput.rfr_id = table.concat{ "info:sid/", mw.site.server:match( "[^/]*$" ), ":", data.RawPage };
-- TODO: Add optional extra info:
-- rfr_dat=#REVISION<version> (referrer private data)
-- ctx_id=<data.RawPage>#<ref> (identifier for the context object)
-- ctx_tim=<ts> (timestamp in format yyyy-mm-ddThh:mm:ssTZD or yyyy-mm-dd)
-- ctx_enc=info:ofi/enc:UTF-8 (character encoding)
OCinSoutput = setmetatable( OCinSoutput, nil );
-- sort with version string always first, and combine.
-- table.sort( OCinSoutput );
table.insert( OCinSoutput, 1, "ctx_ver=" .. ctx_ver ); -- such as "Z39.88-2004"
return table.concat(OCinSoutput, "&");
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table and imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
cfg = cfg_table_ptr;
has_accept_as_written = utilities_page_ptr.has_accept_as_written; -- import functions from selected Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
remove_wiki_link = utilities_page_ptr.remove_wiki_link;
strip_apostrophe_markup = utilities_page_ptr.strip_apostrophe_markup;
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
make_coins_title = make_coins_title,
get_coins_pages = get_coins_pages,
COinS = COinS,
set_selected_modules = set_selected_modules,
}
2eba9cn0u4yseyeujt1vmrglxrgcllo
Module:Citation/CS1/styles.css
828
11074212
37019537
36259623
2026-05-01T14:29:15Z
Exec8
10305
37019537
sanitized-css
text/css
/* Protection icon
the following line controls the page-protection icon in the upper right corner
it must remain within this comment
{{sandbox other||{{pp-template}}}}
*/
/* Overrides
Some wikis do not override user agent default styles for HTML <cite> and <q>,
unlike en.wp. On en.wp, keep these the same as [[MediaWiki:Common.css]].
The word-wrap and :target styles were moved here from Common.css.
On en.wp, keep these the same as [[Template:Citation/styles.css]].
*/
cite.citation {
font-style: inherit; /* Remove italics for <cite> */
/* Break long urls, etc., rather than overflowing box */
word-wrap: break-word;
}
.citation q {
quotes: '"' '"' "'" "'"; /* Straight quote marks for <q> */
}
/* Highlight linked elements (such as clicked references) in blue */
.citation:target {
/* ignore the linter - all browsers of interest implement this */
background-color: rgba(0, 127, 255, 0.133);
}
/* ID and URL access
Both core and Common.css have selector .mw-parser-output a[href$=".pdf"].external
for PDF pages. All TemplateStyles pages are hoisted to .mw-parser-output. We need
to have specificity equal to a[href$=".pdf"].external for locks to override PDF icon.
That's essentially 2 classes and 1 element.
the .id-lock-... selectors are for use by non-citation templates like
{{Catalog lookup link}}
bg-size `contain` in Minerva and Timeless is too large, so we set a size for them
and then exclude them later
*/
.id-lock-free.id-lock-free a {
background: url(//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg)
right 0.1em center/9px no-repeat;
}
.id-lock-limited.id-lock-limited a,
.id-lock-registration.id-lock-registration a {
background: url(//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg)
right 0.1em center/9px no-repeat;
}
.id-lock-subscription.id-lock-subscription a {
background: url(//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg)
right 0.1em center/9px no-repeat;
}
/* Wikisource
Wikisource icon when |chapter= or |title= is wikilinked to Wikisource
as in cite wikisource
*/
.cs1-ws-icon a {
background: url(//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg)
right 0.1em center/12px no-repeat;
}
body:not(.skin-timeless):not(.skin-minerva) .id-lock-free a,
body:not(.skin-timeless):not(.skin-minerva) .id-lock-limited a,
body:not(.skin-timeless):not(.skin-minerva) .id-lock-registration a,
body:not(.skin-timeless):not(.skin-minerva) .id-lock-subscription a,
body:not(.skin-timeless):not(.skin-minerva) .cs1-ws-icon a {
background-size: contain;
/* Common.css has a padding set for PDF URLs. bg-contain expands to the
* size of the padding which makes the icons very large. we "reset" the
* padding here. 1em picked out of a hat based on console having a similar
* rule from elsewhere
*/
padding: 0 1em 0 0;
}
/* Errors and maintenance */
.cs1-code {
/* <code>...</code> style override: mediawiki's css definition is specified here:
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/
69cd73811f7aadd093050dbf20ed70ef0b42a713/skins%2Fcommon%2FcommonElements.css#L199
*/
color: inherit;
background: inherit;
border: none;
padding: inherit;
}
.cs1-hidden-error {
display: none;
color: var(--color-error, #bf3c2c);
}
.cs1-visible-error {
color: var(--color-error, #bf3c2c);
}
.cs1-maint {
display: none;
color: #085;
margin-left: 0.3em;
}
/* kerning */
.cs1-kern-left {
padding-left: 0.2em;
}
.cs1-kern-right {
padding-right: 0.2em;
}
/* selflinks – avoid bold font style when cs1|2 template links to the current page */
.citation .mw-selflink {
font-weight: inherit;
}
@media screen {
/* Small text size
Set small text size in one place. 0.95 (here) * 0.9 (from references list) is
~0.85, which is the lower bound for size for accessibility. Old styling for this
was just 0.85. We could write the rule so that when this template is inside
references/reflist, only then does it multiply by 0.95; else multiply by 0.85 */
.cs1-format {
font-size: 95%;
}
html.skin-theme-clientpref-night .cs1-maint {
color: #18911f;
}
}
@media screen and (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os .cs1-maint {
color: #18911f;
}
}
2wrho6o1q12cvwhaslan5n9g140q3wl
Module:Infobox3cols
828
11102278
37019590
33646787
2026-05-01T15:09:18Z
Exec8
10305
.
37019590
Scribunto
text/plain
local check_for_unknown_parameters = require("Module:Check for unknown parameters")._check
local p = {}
local args = {}
local origArgs = {}
local root
local lists = {
plainlist_t = {
patterns = {
'^plainlist$',
'%splainlist$',
'^plainlist%s',
'%splainlist%s'
},
found = false,
styles = 'Plainlist/styles.css'
},
hlist_t = {
patterns = {
'^hlist$',
'%shlist$',
'^hlist%s',
'%shlist%s'
},
found = false,
styles = 'Hlist/styles.css'
}
}
local function has_list_class(args_to_check)
for _, list in pairs(lists) do
if not list.found then
for _, arg in pairs(args_to_check) do
for _, pattern in ipairs(list.patterns) do
if mw.ustring.find(arg or '', pattern) then
list.found = true
break
end
end
if list.found then break end
end
end
end
end
-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix, suffix)
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([0-9]%d*)' .. suffix .. '$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local function addRow(rowArgs)
if rowArgs.header then
has_list_class({rowArgs.rowclass, rowArgs.class, args.headerclass})
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:tag('th')
:attr('colspan', '4')
:addClass('infobox-header')
:addClass(rowArgs.class)
:addClass(args.headerclass)
-- @deprecated next; target .infobox-<name> .infobox-header
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:cssText(args.extracellstyles[rowArgs.num .. 'h'])
:wikitext(rowArgs.header)
elseif rowArgs.label then
if rowArgs.data then
has_list_class({rowArgs.rowclass, rowArgs.class})
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
row
:tag('th')
:attr('scope', 'row')
:addClass('infobox-label')
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:cssText(args.extracellstyles[rowArgs.num .. 'l'])
:wikitext(rowArgs.label)
:done()
local dataCell = row:tag('td')
dataCell
:attr('colspan', '3')
:addClass('infobox-data')
:addClass(rowArgs.class)
-- @deprecated next; target .infobox-<name> .infobox-data
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:cssText(args.extracellstyles[rowArgs.num])
:newline()
:wikitext(rowArgs.data)
elseif rowArgs.dataa or rowArgs.datab or rowArgs.datac then
has_list_class({rowArgs.rowclass, rowArgs.classa})
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
row
:tag('th')
:attr('scope', 'row')
:addClass('infobox-label')
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:cssText(args.extracellstyles[rowArgs.num .. 'l'])
:wikitext(rowArgs.label)
:done()
local dataCella = row:tag('td')
dataCella
:addClass('infobox-data infobox-data-a')
:addClass(rowArgs.classa)
-- @deprecated next; target .infobox-<name> .infobox-data-a
:cssText(rowArgs.dataastyle)
:cssText(rowArgs.rowcellstyle)
:cssText(args.extracellstyles[rowArgs.num .. 'a'])
:newline()
:wikitext(rowArgs.dataa)
if rowArgs.renderb then
has_list_class({rowArgs.classb})
local dataCellb = row:tag('td')
dataCellb
:addClass('infobox-data infobox-data-b')
:addClass(rowArgs.classb)
-- @deprecated next; target .infobox-<name> .infobox-data-b
:cssText(rowArgs.databstyle)
:cssText(rowArgs.rowcellstyle)
:cssText(args.extracellstyles[rowArgs.num .. 'b'])
:newline()
:wikitext(rowArgs.datab)
end
if rowArgs.renderc then
has_list_class({rowArgs.classc})
local dataCellc = row:tag('td')
dataCellc
:addClass('infobox-data infobox-data-c')
:addClass(rowArgs.classc)
-- @deprecated next; target .infobox-<name> .infobox-data-c
:cssText(rowArgs.datacstyle)
:cssText(rowArgs.rowcellstyle)
:cssText(args.extracellstyles[rowArgs.num .. 'c'])
:newline()
:wikitext(rowArgs.datac)
end
end
elseif rowArgs.data then
has_list_class({rowArgs.rowclass, rowArgs.class})
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '4')
:addClass('infobox-full-data')
:addClass(rowArgs.class)
-- @deprecated next; target .infobox-<name> .infobox-full-data
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:cssText(args.extracellstyles[rowArgs.num])
:newline()
:wikitext(rowArgs.data)
end
end
local function renderTitle()
if not args.title then return end
has_list_class({args.titleclass})
root
:tag('caption')
:addClass('infobox-title')
:addClass(args.titleclass)
-- @deprecated next; target .infobox-<name> .infobox-title
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
has_list_class({args.aboveclass})
root
:tag('tr')
:tag('th')
:attr('colspan', '4')
:addClass('infobox-above')
:addClass(args.aboveclass)
-- @deprecated next; target .infobox-<name> .infobox-above
:cssText(args.abovestyle)
:wikitext(args.above)
end
local function renderBelowRow()
if not args.below then return end
has_list_class({args.belowclass})
root
:tag('tr')
:tag('td')
:attr('colspan', '4')
:addClass('infobox-below')
:addClass(args.belowclass)
-- @deprecated next; target .infobox-<name> .infobox-below
:cssText(args.belowstyle)
:newline()
:wikitext(args.below)
end
local function addSubheaderRow(subheaderArgs)
if not subheaderArgs.data then return end
has_list_class({subheaderArgs.rowclass, subheaderArgs.class})
local row = root:tag('tr')
row:addClass(subheaderArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '4')
:addClass('infobox-subheader')
:addClass(subheaderArgs.class)
:cssText(subheaderArgs.datastyle)
:cssText(subheaderArgs.rowcellstyle)
:newline()
:wikitext(subheaderArgs.data)
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader','')
for k, num in ipairs(subheadernums) do
addSubheaderRow({
data = args['subheader' .. tostring(num)],
-- @deprecated next; target .infobox-<name> .infobox-subheader
datastyle = args.subheaderstyle,
rowcellstyle = args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function addImageRow(imageArgs)
if not imageArgs.data then return end
has_list_class({imageArgs.rowclass, imageArgs.class})
local row = root:tag('tr')
row:addClass(imageArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '4')
:addClass('infobox-image')
:addClass(imageArgs.class)
:cssText(imageArgs.datastyle)
:newline()
:wikitext(imageArgs.data)
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image','')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:addClass('infobox-caption')
-- @deprecated next; target .infobox-<name> .infobox-caption
:cssText(args.captionstyle)
:wikitext(caption)
end
addImageRow({
data = tostring(data),
-- @deprecated next; target .infobox-<name> .infobox-image
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
-- Gets the union of the header and data argument numbers,
-- and renders them all in order
local function renderRows()
local rownums = union(getArgNums('header',''), getArgNums('data','[abc]?'))
local datab_count = #(getArgNums('data','b'))
local datac_count = #(getArgNums('data','c'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
num = tostring(num),
renderb = datab_count > 0,
renderc = datac_count > 0,
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
dataa = args['data' .. tostring(num) .. 'a'],
dataastyle = args.datastylea,
classa = args['class' .. tostring(num) .. 'a'],
datab = args['data' .. tostring(num) .. 'b'],
databstyle = args.datastyleb,
classb = args['class' .. tostring(num) .. 'b'],
datac = args['data' .. tostring(num) .. 'c'],
datacstyle = args.datastylec,
classc = args['class' .. tostring(num) .. 'c'],
rowclass = args['rowclass' .. tostring(num)],
-- @deprecated next; target .infobox-<name> rowclass
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)],
})
end
end
local function renderNavBar()
if not args.name then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '4')
:addClass('infobox-navbar')
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(require('Module:Italic title')._main({}))
end
end
-- Render tracking categories. args.decat == turns off tracking categories.
local function renderTrackingCategories()
local title = mw.title.getCurrentTitle()
if args.decat == 'yes' then return end
if #(getArgNums('data','[abc]?')) == 0 and title.namespace == 0 then
root:wikitext('[[Category:Articles using infobox templates with no data rows]]')
end
root:wikitext(check_for_unknown_parameters({
checkpositional = "y",
ignoreblank = "y",
regexp1 = "header[%d]+",
regexp2 = "label[%d]+",
regexp3 = "data[%d]+[abc]?",
regexp4 = "class[%d]+[abc]?",
regexp5 = "rowclass[%d]+",
regexp6 = "rowstyle[%d]+",
regexp7 = "rowcellstyle[%d]+",
unknown = "[[Category:Pages using infobox3cols with unknown parameters|_VALUE_" .. title.text .. "]]",
"above", "aboveclass", "aboverowclass", "abovestyle", "below", "belowclass",
"belowrowclass", "belowstyle", "bodyclass", "bodystyle", "caption", "caption1",
"caption2", "captionstyle", "child", "datastyle", "datastylea", "datastyleb",
"datastylec", "extracellstyles", "headerstyle", "image", "image1", "image2",
"imageclass", "imagerowclass1", "imagerowclass2", "imagestyle", "labelstyle",
"name", "subbox", "subheader", "subheader2", "subheaderclass",
"subheaderrowclass1", "subheaderrowclass2", "subheaderstyle", "templatestyles",
"title", "titleclass", "titlestyle",
}, origArgs))
if origArgs.header0 or origArgs.label0 or origArgs.data0 or origArgs.data0a
or origArgs.data0b or origArgs.data0c or origArgs.class0 or origArgs.rowclass0 then
root:wikitext("[[Category:Pages using infobox3cols with header0 or label0 or data0]]")
end
if title.namespace == 10 and mw.ustring.sub(title.text, 1, 7) == "Infobox" then
root:wikitext("[[Category:Infobox templates|" .. mw.ustring.sub(title.text, 9) .. "]]")
end
end
--[=[
Loads the templatestyles for the infobox.
TODO: FINISH loading base templatestyles here rather than in
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.
]=]
local function loadTemplateStyles()
local frame = mw.getCurrentFrame()
local hlist_templatestyles = ''
if lists.hlist_t.found then
hlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.hlist_t.styles }
}
end
local plainlist_templatestyles = ''
if lists.plainlist_t.found then
plainlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.plainlist_t.styles }
}
end
-- See function description
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
}
local templatestyles = ''
if args['templatestyles'] then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] then
child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] then
grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
-- hlist -> plainlist -> base is best-effort to preserve old Common.css ordering.
-- this ordering is not a guarantee because the rows of interest invoking
-- each class may not be on a specific page
hlist_templatestyles,
plainlist_templatestyles,
base_templatestyles,
templatestyles,
child_templatestyles,
grandchild_templatestyles
})
end
-- common functions between the child and non child cases
local function structure_infobox_common()
renderSubheaders()
renderImages()
-- preprocessRows()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
-- renderEmptyRowCategories()
renderTrackingCategories()
-- cleanInfobox()
end
-- Specify the overall layout of the infobox, with special settings if the
-- infobox is used as a 'child' inside another infobox.
local function _infobox()
root = mw.html.create('table')
has_list_class({args.bodyclass})
root
:addClass((args.child == 'yes' or args.subbox == 'yes') and 'infobox-subbox' or 'infobox')
:addClass(args.child == 'yes' and 'infobox-3cols-child' or nil)
-- avoid https://phabricator.wikimedia.org/F55300125
:addClass('infobox-table')
:addClass(args.bodyclass)
-- @deprecated next; target .infobox-<name>
:cssText(args.bodystyle)
renderTitle()
renderAboveRow()
structure_infobox_common()
return loadTemplateStyles() .. tostring(root)
end
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
local function preprocessSingleArg(argName)
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
-- Assign the parameters with the given prefixes to the args table, in order, in
-- batches of the step size specified. This is to prevent references etc. from
-- appearing in the wrong order. The prefixTable should be an array containing
-- tables, each of which has two possible fields, a "prefix" string and a
-- "depend" table. The function always parses parameters containing the "prefix"
-- string, but only parses parameters in the "depend" table if the prefix
-- parameter is present and non-blank.
local function preprocessArgs(prefixTable, step)
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or
(v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present
-- and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 0 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i) .. (v.suffix or '')
if origArgs[prefixArgName] then
-- Do another loop if any arguments are found, even blank ones.
moreArgumentsExist = true
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present
-- and not blank, or we are processing "prefix1" and "prefix" is
-- present and not blank, and if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i) .. (v.dependsuffix or '')
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so
-- that references etc. will display in the expected places. Parameters that
-- depend on another parameter are only processed if that parameter is present,
-- to avoid phantom references appearing in article reference lists.
local function parseDataParameters()
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessSingleArg('image')
preprocessSingleArg('caption')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'data', suffix = 'a', depend = {'label'}},
{prefix = 'data', suffix = 'a'},
{prefix = 'data', suffix = 'b', depend = {'label'}},
{prefix = 'data', suffix = 'b'},
{prefix = 'data', suffix = 'c', depend = {'label'}},
{prefix = 'data', suffix = 'c'},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'},
{prefix = 'class', suffix = 'a'},
{prefix = 'class', suffix = 'b'},
{prefix = 'class', suffix = 'c'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('datastylea')
preprocessSingleArg('datastyleb')
preprocessSingleArg('datastylec')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
-- different behaviour for italics if blank or absent
args['italic title'] = origArgs['italic title']
preprocessSingleArg('decat')
preprocessSingleArg('templatestyles')
preprocessSingleArg('child templatestyles')
preprocessSingleArg('grandchild templatestyles')
args['extracellstyles'] = {}
for line in mw.text.gsplit(origArgs['extracellstyles'] or '', '\n') do
local equals = line:find('=')
if equals then
for i in mw.text.gsplit(line:sub(1, equals - 1), '%s*,%s*') do
args.extracellstyles[i] = line:sub(equals + 1)
end
end
end
end
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
function p.infobox(frame)
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
parseDataParameters()
return _infobox()
end
-- For calling via #invoke within a template
function p.infoboxTemplate(frame, extra_args)
origArgs = extra_args or {}
for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
parseDataParameters()
return _infobox()
end
-- Shortcut for making child infoboxes via #invoke.
function p.child(frame)
return p.infoboxTemplate(frame, {child = "yes"})
end
return p
sk5ap8wbwh8cvojtf2cmz0sctagsocr
Module:Sidebar/styles.css
828
11110357
37019553
33658934
2026-05-01T14:41:17Z
Exec8
10305
.
37019553
sanitized-css
text/css
/* {{pp-template}} */
/* TODO: Invert width design to be "mobile first" */
.sidebar {
/* TODO: Ask if we should have max-width 22em instead */
width: 22em;
/* @noflip */
float: right;
/* @noflip */
clear: right;
/* @noflip */
margin: 0.5em 0 1em 1em;
background: var(--background-color-neutral-subtle, #f8f9fa);
border: 1px solid var(--border-color-base, #a2a9b1);
padding: 0.2em;
text-align: center;
line-height: 1.4em;
font-size: 88%;
border-collapse: collapse;
/* Timeless has display: none on .nomobile at mobile resolutions, so we
* unhide it with display: table and let precedence and proximity win.
*/
display: table;
}
/* Unfortunately, so does Minerva desktop, except Minerva drops an
* !important on the declaration. So we have to be mean for Minerva users.
* Mobile removes the element entirely with `wgMFRemovableClasses` in
* https://github.com/wikimedia/operations-mediawiki-config/blob/master/
wmf-config/InitialiseSettings.php#L16992
* which is why displaying it categorically with display: table works.
* We don't really want to expose the generic user in the wild on mobile to have
* to deal with sidebars. (Maybe the ones with collapsible lists, so that
* might be an improvement. That is blocked on [[:phab:T111565]].)
*/
body.skin-minerva .sidebar {
display: table !important;
/* also, minerva is way too aggressive about other stylings on tables.
* TODO remove when this template gets moved to a div. plans on talk page.
* We always float right on Minerva because that's a lot of extra CSS
* otherwise. */
float: right !important;
margin: 0.5em 0 1em 1em !important;
}
.sidebar-subgroup {
width: 100%;
margin: 0;
border-spacing: 0;
}
.sidebar-left {
/* @noflip */
float: left;
/* @noflip */
clear: left;
/* @noflip */
margin: 0.5em 1em 1em 0;
}
.sidebar-none {
float: none;
clear: both;
/* @noflip */
margin: 0.5em 1em 1em 0;
}
.sidebar-outer-title {
padding: 0 0.4em 0.2em;
font-size: 125%;
line-height: 1.2em;
font-weight: bold;
}
.sidebar-top-image {
padding: 0.4em;
}
.sidebar-top-caption,
.sidebar-pretitle-with-top-image,
.sidebar-caption {
padding: 0.2em 0.4em 0;
line-height: 1.2em;
}
.sidebar-pretitle {
padding: 0.4em 0.4em 0;
line-height: 1.2em;
}
.sidebar-title,
.sidebar-title-with-pretitle {
padding: 0.2em 0.8em;
font-size: 145%;
line-height: 1.2em;
}
.sidebar-title-with-pretitle {
padding: 0.1em 0.4em;
}
.sidebar-image {
padding: 0.2em 0.4em 0.4em;
}
.sidebar-heading {
padding: 0.1em 0.4em;
}
.sidebar-content {
padding: 0 0.5em 0.4em;
}
.sidebar-content-with-subgroup {
padding: 0.1em 0.4em 0.2em;
}
.sidebar-above,
.sidebar-below {
padding: 0.3em 0.8em;
font-weight: bold;
}
.sidebar-collapse .sidebar-above,
.sidebar-collapse .sidebar-below {
border-top: 1px solid #aaa;
border-bottom: 1px solid #aaa;
}
.sidebar-navbar {
text-align: right;
font-size: 115%;
padding: 0 0.4em 0.4em;
}
.sidebar-list-title {
padding: 0 0.4em;
text-align: left;
font-weight: bold;
line-height: 1.6em;
font-size: 105%;
}
/* centered text with mw-collapsible headers is finicky */
.sidebar-list-title-c {
padding: 0 0.4em;
text-align: center;
margin: 0 3.3em;
}
@media (max-width: 640px) {
/* users have wide latitude to set arbitrary width and margin :(
"Super-specific" selector to prevent overriding this appearance by
lower level sidebars too */
body.mediawiki .sidebar {
width: 100% !important;
clear: both;
float: none !important; /* Remove when we div based; Minerva is dumb */
margin-left: 0 !important;
margin-right: 0 !important;
}
/* TODO: We might consider making all links wrap at small resolutions and then
* only introduce nowrap at higher resolutions. Do when we invert the media
* query.
*/
}
/* Fixes: T367463 */
body.skin--responsive .sidebar a > img {
max-width: none !important;
}
/* Disable backgrounds via style attribute in night mode Eg.https://phabricator.wikimedia.org/F55243859
* https://en.wikipedia.org/w/index.php?title=Laissez-faire
*/
@media screen {
html.skin-theme-clientpref-night .sidebar:not( .notheme ) .sidebar-list-title,
html.skin-theme-clientpref-night .sidebar:not( .notheme ) .sidebar-title-with-pretitle {
background: transparent !important;
}
html.skin-theme-clientpref-night .sidebar:not( .notheme ) .sidebar-title-with-pretitle a {
color: var( --color-progressive ) !important;
}
}
@media screen and (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os .sidebar:not( .notheme ) .sidebar-list-title,
html.skin-theme-clientpref-os .sidebar:not( .notheme ) .sidebar-title-with-pretitle {
background: transparent !important;
}
html.skin-theme-clientpref-os .sidebar:not( .notheme ) .sidebar-title-with-pretitle a {
color: var( --color-progressive ) !important;
}
}
@media print {
body.ns-0 .sidebar {
display: none !important;
}
}
j9rltrco0eevefcj27cgv3uari248t0
Module:If preview
828
11110663
37019556
33659274
2026-05-01T14:42:55Z
Exec8
10305
.
37019556
Scribunto
text/plain
local p = {}
local getArgs = require("Module:Arguments").getArgs
local yn = require("Module:Yesno")
local cfg = mw.loadData('Module:If preview/configuration')
--[[
main
This function returns either the first argument or second argument passed to
this module, depending on whether the page is being previewed.
]]
function p.main(frame)
local args = getArgs(frame)
if cfg.preview then
return args[1] or ''
else
return args[2] or ''
end
end
--[[
pmain
This function returns either the first argument or second argument passed to
this module's parent (i.e. template using this module), depending on whether it
is being previewed.
]]
function p.pmain(frame)
return p.main(frame:getParent())
end
local function warning_text(warning)
return mw.ustring.format(
cfg.warning_infrastructure,
cfg.templatestyles,
warning
)
end
function p._warning(args)
local warning = args[1] and args[1]:match('^%s*(.-)%s*$') or ''
if warning == '' then
return warning_text(cfg.missing_warning)
end
if not cfg.preview then return '' end
if yn(args['consolewarning']) then mw.addWarning(args[1] or cfg.missing_warning) end
return warning_text(warning)
end
--[[
warning
This function returns a "preview warning", which is the first argument marked
up with HTML and some supporting text, depending on whether the page is being previewed.
]]
-- function p.warning(frame)
-- mw.addWarning(frame.args[1] or cfg.missing_warning)
-- return p._warning(frame.args)
-- end
--[[
warning, but for pass-through templates like {{preview warning}}
]]
function p.pwarning(frame)
local args = getArgs(frame)
return p._warning(args)
end
--[[
Does both mw.addWarning and preview warning
]]
function p.warn(text)
if text == nil or text == "" then return "" end
mw.addWarning(text)
return p._warning({text})
end
--[[
Console warning
]]
function p.consoleWarning(frame)
local args = getArgs(frame)
mw.addWarning(args[1] or cfg.missing_warning)
return ''
end
return p
9xxiwh6yksz0t17svyd7nlq7rj3f5rk
Module:If preview/configuration
828
11110668
37019558
33659279
2026-05-01T14:44:01Z
Exec8
10305
.
37019558
Scribunto
text/plain
--[[
We perform the actual check for whether this is a preview here since
preprocessing is relatively expensive.
]]
local frame = mw.getCurrentFrame()
local function is_preview()
local revision_id = frame:preprocess('{{REVISIONID}}')
-- {{REVISIONID}} is usually the empty string when previewed.
-- I don't know why we're checking for nil but hey, maybe someday things
-- would have broken
return revision_id == nil or revision_id == ''
end
local function templatestyles()
return frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:If preview/styles.css' }
}
end
return {
preview = is_preview(),
templatestyles = templatestyles(),
warning_infrastructure = '%s<div class="preview-warning"><strong>Preview warning:</strong> %s</div>',
missing_warning = 'The template has no warning text. Please add a warning.'
}
7ccf9c7e3yxw9p4ke6iw4ndcfniweno
Module:If preview/styles.css
828
11110674
37019559
33659285
2026-05-01T14:44:40Z
Exec8
10305
37019559
sanitized-css
text/css
/* {{pp|small=yes}} */
.preview-warning {
font-style: italic;
/* @noflip */
padding-left: 1.6em;
margin-bottom: 0.5em;
color: var(--color-error, red);
}
/* The templatestyles element inserts a link element before hatnotes.
* TODO: Remove link if/when WMF resolves T200206 */
.preview-warning + link + .preview-warning {
margin-top: -0.5em;
}
kbqg0kqnlzjfzk8vwkk7ykx0gblj5y8
Module:Citation/CS1/Suggestions
828
11178344
37019538
33780511
2026-05-01T14:29:37Z
Exec8
10305
37019538
Scribunto
text/plain
-- Please insert new suggestions in alphabetical order
-- The form is ['incorrect'] = 'correct',
suggestions = {
['ASIN-TLD'] = 'asin-tld', -- old parameter name
['abruf'] = 'access-date', -- German
['abruf-verborgen'] = 'access-date', -- German
['accessmonth'] = 'access-date',
['accesso'] = 'access-date', -- Italian
['accessyear'] = 'access-date',
['acessodata'] = 'access-date', -- Brazilian Portuguese
['ad'] = 'first', -- Turkish
['address'] = 'location',
['anno'] = 'date', -- Italian
['annoaccesso'] = 'access-date', -- Italian
['annodiaccesso'] = 'access-date', -- Italian
['annooriginale'] = 'orig-date', -- Italian
['année'] = 'date', -- French
['apellido'] = 'last', -- Spanish
['apellidos'] = 'last', -- Spanish
['archiv-datum'] = 'archive-date', -- German
['archiv-url'] = 'archive-url', -- German
['archive date'] = 'archive-date', -- misspelling
['archive url'] = 'archive-url', -- misspelling
['archive-link'] = 'archive-url', -- old parameter name
['archiv-url'] = 'archive-url', -- German
['arkivdatum'] = 'archive-date', -- Swedish, Norwegian
['arkivurl'] = 'archive-url', -- Swedish, Norwegian
['artist'] = 'others',
['arşiv-tarihi'] = 'archive-date', -- Turkish
['arşiv-url'] = 'archive-url', -- Turkish
['arşivtarihi'] = 'archive-date', -- Turkish
['arşivurl'] = 'archive-url', -- Turkish
['auflage'] = 'edition', -- German
['auteur'] = 'author', -- French
['auther'] = 'author', -- misspelling
['author link'] = 'author-link', -- Polish
['authorfirst'] = 'author-first', -- old parameter name
['authorgiven'] = 'author-given', -- old parameter name
['authorlast'] = 'author-last', -- old parameter name
['authormask'] = 'author-mask', -- old parameter name
['authorsurname'] = 'author-surname', -- old parameter name
['autor'] = 'author', -- Spanish, German (singular and plural)
['autore'] = 'author', -- Italian
['autthor'] = 'author', -- misspelling
['ay'] = 'month', -- Turkish
['año'] = 'date', -- Spanish
['año-original'] = 'orig-date', -- Spanish
['añoacceso'] = 'access-date', -- Spanish
['añooriginal'] = 'orig-date', -- Spanish
['band'] = 'volume', -- German
['bandreihe'] = 'volume', -- German
['baskı'] = 'edition', -- Turkish
['başlık'] = 'title', -- Turkish
['began'] = 'date', -- old parameter name (cite serial only); or orig-date=
['booktitle'] = 'book-title', -- old parameter name
['ch'] = 'language', -- German (as 'language=de-CH')
['chapter_title'] = 'chapter',
['chapterurl'] = 'chapter-url', -- old parameter name
['cid'] = 'ref', -- Italian
['cilt'] = 'volume', -- Turkish
['cita'] = 'quote', -- Spanish
['citazione'] = 'quote', -- Italian
['città'] = 'location', -- Italian
['city'] = 'location', -- old parameter name (cite serial only)
['coauthor'] = 'author',
['coauthors'] = 'author',
['coautores'] = 'author', -- Spanish
['coautori'] = 'author', -- Italian
['cognome'] = 'last', -- Italian
['conferenceurl'] = 'conference-url', -- old parameter name
['consulté le'] = 'access-date', -- French
['contributionurl'] = 'contribution-url', -- old parameter name
['curatore'] = 'publisher', -- Italian
['czasopismo'] = 'journal', -- Polish
['data dostępu'] = 'access-date', -- Polish
['data'] = 'date', -- Polish, Italian
['dataaccesso'] = 'access-date', -- Italian
['dataarchivio'] = 'archive-date', -- Italian
['datum'] = 'date', -- German, Swedish
['dead-url'] = 'url-status', -- old parameter name
['deadlink'] = 'url-status', -- old parameter name
['deadurl'] = 'url-status', -- old parameter name
['dergi'] = 'work', -- Turkish
['dil'] = 'language', -- Turkish
['displayauthors'] = 'display-authors', -- old parameter name
['displayeditors'] = 'display-editors', -- old parameter name
['distributor'] = 'publisher',
['dnb'] = 'id', -- German (as 'id={{DNB-IDN|...}}')
['doi-broken'] = 'doi-broken-date', -- old parameter alias
['doi-inactive'] = 'doi-broken-date', -- invalid name found in mainspace
['doi-inactive-date'] = 'doi-broken-date', -- old parameter alias
['doi_brokendate'] = 'doi-broken-date', -- old parameter alias
['doi_inactivedate'] = 'doi-inactive-date', -- old parameter alias
['doibroken'] = 'doi-broken-date', -- invalid name found in mainspace
['doiinactive'] = 'doi-broken-date', -- invalid name found in mainspace
['e-print'] = 'eprint', -- misspelling
-- ['ed'] = 'edition', -- avoid suggestion as in English this could be short for editor or edition
-- ['editora'] = 'publisher', -- can be either editor or publisher
-- ['editore'] = 'agency', -- can be either publisher or agency
-- ['editori'] = 'editor', -- can be either editor or publisher
-- ['editorial'] = 'publisher', -- can be either publisher or work
['editoin'] = 'edition', -- misspelling
['editon'] = 'edition', -- misspelling
['editorfirst'] = 'editor-first', -- old parameter name
['editorgiven'] = 'editor-given', -- old parameter name
['editorlast'] = 'editor-last', -- old parameter name
['editorlink'] = 'editor-link', -- old parameter name
['editormask'] = 'editor-mask', -- old parameter name
['editors'] = 'editor', -- old parameter name (can be emulated using multiple singular |editor= params)
['editorsurname'] = 'editor-surname', -- old parameter name
['edizione'] = 'edition', -- Italian
['embargo'] = 'pmc-embargo-date', -- old parameter name
['ended'] = 'date', -- old parameter name (cite serial only)
['en ligne le'] = 'archive-date', -- French
['encyclopædia'] = 'encyclopedia',
['enlaceautor'] = 'author-link', -- Spanish
['enlaceroto'] = 'url-status', -- Spanish
['episodelink'] = 'episode-link', -- old parameter name
['erişimtarihi'] = 'access-date', -- Turkish
['eser'] = 'work', -- Turkish
['family'] = 'surname', -- misguess
['fecha'] = 'date', -- Spanish
['fechaacceso'] = 'access-date', -- Spanish
['fechaarchivo'] = 'archive-date', -- Spanish
['filetype'] = 'format',
['foramt'] = 'format', -- misspelling
['fore-name'] = 'given', -- misguess/misspelling
['forename'] = 'given', -- misguess
['författare'] = 'author', -- Swedish, Norwegian
['formato'] = 'format', -- Spanish, Italian, Polish
['frist'] = 'first', -- misspelling
['fundstelle'] = 'at', -- German
['gazete'] = 'work', -- Turkish
['giornale'] = 'journal', -- Italian
['hämtdatum'] = 'access-date', -- Swedish
['herausgeber'] = 'editor', -- German (singular and plural)
['hrsg'] = 'publisher', -- German
['hrsgreihe'] = 'editor', -- German
['idioma'] = 'language', -- Spanish
['ignore-isbn-error'] = 'isbn', -- old parameter (can be fully emulated using ((syntax)))
['ignoreisbnerror'] = 'isbn', -- old parameter alias (suggest |isbn as |ignore-isbn-error is deprecated), not a direct replacement, but can be fully emulated using ((syntax))
['imię'] = 'first', -- Polish
['in-set'] = 'inset', -- misspelling
['interviewerlink'] = 'interviewer-link', -- old parameter alias
['interviewermask'] = 'interviewer-mask', -- old parameter alias
['isbndefekt'] = 'isbn', -- German (suggest |isbn as |ignore-isbn-error is deprecated), not a direct replacement, but can be fully emulated using ((syntax))
['isbnformalfalsch'] = 'isbn', -- German (suggest |isbn as |ignore-isbn-error is deprecated), not a direct replacement, but can be fully emulated using ((syntax))
['isbnistformalfalsch'] = 'isbn', -- German (suggest |isbn as |ignore-isbn-error is deprecated), not a direct replacement, but can be fully emulated using ((syntax))
['isnb'] = 'isbn', -- misspelling
['issnformalfalsch'] = 'issn', -- German (can be fully emulated using ((syntax)))
['jahr'] = 'date', -- German
['jahrea'] = 'orig-date', -- German (not a direct replacement, but can be emulated)
['kapitel'] = 'chapter', -- German
['langauge'] = 'language', -- misspelling
['langue'] = 'language', -- French
['last-author-amp'] = 'name-list-style', -- old parameter name (as |name-list-style=amp)
['lastauthoramp'] = 'name-list-style', -- old parameter name (as |name-list-style=amp)
['lieu'] = 'location', -- French
['lingua'] = 'language', -- Italian
['lire en ligne'] = 'url', -- French
['lizenznummer'] = 'id', -- German (as 'id=License No. ...')
['loaction'] = 'location', -- misspelling
['local'] = 'location', -- Brazilian Portuguese
['locatoin'] = 'location', -- misspelling
['lugar'] = 'location', -- Spanish
['mailinglist'] = 'mailing-list', -- old parameter name
['mapurl'] = 'map-url', -- old parameter name
['mes'] = 'date', -- Spanish (not a direct replacement)
['mese'] = 'date', -- Italian (not a direct replacement)
['miejsce'] = 'location', -- Polish
['miesiąc'] = 'date', -- Polish
['mois'] = 'date', -- French
['monat'] = 'date', -- German
-- ['name'] = 'author', -- 'name' is often erroneously used for 'title' and 'work' as well, so no suggestion is better than a wrong suggestion
['name-list-format'] = 'name-list-style', -- old parameter name (as |name-list-style=amp)
['nazwisko'] = 'last', -- Polish
['nespaper'] = 'newspaper', -- misspelling
['net-work'] = 'network', -- misspelling
['newpaper'] = 'newspaper', -- misspelling
['news'] = 'newspaper',
['news-group'] = 'newsgroup', -- misspelling
['news-paper'] = 'newspaper', -- misspelling
['no-cat'] = 'no-tracking', -- old parameter
['nocat'] = 'no-tracking', -- old parameter
['nom'] = 'last', -- French
['nombre'] = 'first', -- Spanish
['nome'] = 'first', -- Italian
['nopp'] = 'no-pp', -- old parameter name
['notracking'] = 'no-tracking', -- old parameter
['numero'] = 'number', -- Italian, Spanish
['nummer'] = 'number', -- German
['nummerreihe'] = 'number', -- German
['obra'] = 'work', -- Spanish
['odpowiedzialność'] = 'agency', -- Polish
['offline'] = 'url-status', -- German (as 'url-status=dead')
['online'] = 'url', -- German (not a direct replacement, but can be emulated)
['opera'] = 'work', -- Italian
['opublikowany'] = 'agency', -- Polish
['origdate'] = 'orig-date', -- misspelling
['originaljahr'] = 'orig-date', -- German
['originalort'] = 'publication-place', -- German
['originalsprache'] = 'language', -- German
['originaltitel'] = 'title', -- German (if 'originaltitel' is specified, any possible contents of 'title' should be put in 'trans-title')
['ort'] = 'publication-place', -- German
['ortea'] = 'publication-place', -- German (not a direct replacement, but can be emulated)
['other'] = 'others',
['oznaczenie'] = 'agency', -- Polish
['pagees'] = 'pages', -- misspelling
['pagina'] = 'page', -- Italian
['pagina'] = 'pages', -- Italian
['pagine'] = 'pages', -- Italian
['pagine'] = 'pages', -- Italian
['passage'] = 'pages', -- French
['periodico'] = 'magazine', -- Spanish
['plublisher'] = 'publisher', -- misspelling
['pmcid'] = 'pmc',
['post-script'] = 'postscript', -- misspelling
['praca'] = 'work', -- Polish
['primero'] = 'first', -- Spanish
['prénom'] = 'first', -- French
['prénom1'] = 'first1', -- French
['ps'] = 'postscript',
['pub'] = 'publisher',
-- ['pubblicazione'] = 'magazine', -- could be any kind of work
-- ['publicación'] = 'journal', -- could be any kind of work
['publicationdate'] = 'publication-date', -- old parameter name
-- ['published'] = 'publisher', -- could be date, location, or name of publisher
['publicationplace'] = 'publication-place', -- old parameter name
['pulbication-place'] = 'publication-place', -- misspelling
['página'] = 'page', -- Spanish
['páginas'] = 'pages', -- Spanish
['périodique'] = 'publisher', -- French
['registration'] = 'url-access', -- old parameter name
['reihe'] = 'series', -- German
['retrieved'] = 'access-date', -- old parameter name
['richiestasottoscrizione'] = 'url-access', -- Italian (as |url-access=subscription)
['rivista'] = 'magazine', -- Italian
['rok'] = 'date', -- Polish
['rubrik'] = 'title', -- Swedish
['sammelwerk'] = 'work', -- German
['sayfa'] = 'page', -- Turkish
['sayfalar'] = 'pages', -- Turkish
['sayı'] = 'issue', -- Turkish
['script-post'] = 'postscript', -- misspelling
['script-trans'] = 'transcript', -- misspelling
['season'] = 'date', -- old parameter name (cite serial only)
['sectionurl'] = 'section-url', -- old parameter name
['seiten'] = 'pages', -- German
['seria'] = 'series', -- Spanish, Polish
['serie'] = 'series', -- Italian
['série'] = 'series', -- French
['serieslink'] = 'series-link', -- old parameter name
['seriesno'] = 'series-number', -- old parameter name
['service'] = 'agency',
['sitioweb'] = 'website', -- Spanish
['sito'] = 'website', -- Italian
['soyadı'] = 'last', -- Turkish
['spalten'] = 'at', -- German (not a direct replacement, but can be emulated)
['sprache'] = 'language', -- German
['språk'] = 'language', -- Swedish, Norwegian
['stron'] = 'page', -- Polish
['strony'] = 'pages', -- Polish
['subjectlink'] = 'subject-link', -- old parameter name
['subscription'] = 'url-access', -- old parameter name (emulated as |url-access=subscription)
['sur-name'] = 'surname', -- misspelling
['suscripción'] = 'url-access', -- Spanish, Polish (as |url-access=subscription)
['tag'] = 'date', -- German
['tarih'] = 'date', -- Turkish
['template doc demo'] = 'no-tracking', -- old parameter alias
['tidning'] = 'work', -- Swedish
['tile'] = 'title', -- misspelling
['timecaption'] = 'time-caption', -- old parameter name
['titlelink'] = 'title-link', -- old parameter name
['tipo'] = 'type', -- Italian
['tite'] = 'title', -- misspelling
['titel'] = 'title', -- German
['titel-p'] = 'title', -- German ('postscript=none' should be added as well)
['titelerg'] = 'contribution', -- German (not a direct replacement, but can be emulated)
['titled'] = 'title', -- Brazilian Portuguese
['titolo'] = 'title', -- Italian
['titre'] = 'title', -- French
['trans-script'] = 'transcript', -- misspelling
['trans_chapter'] = 'trans-chapter', -- old parameter alias
['trans_title'] = 'trans-title', -- old parameter alias
['transchapter'] = 'trans-chapter',
['transcripturl'] = 'transcript-url', -- old parameter name
['transscript'] = 'transcript', -- misspelling
['transscript-format'] = 'transcript-format', -- misspelling
['transscript-url'] = 'transcript-url', -- misspelling
['transscripturl'] = 'transcript-url', -- misspelling
['transtitle'] = 'trans-title',
['typ'] = 'author-mask', -- German (not a direct replacement, but the only valid argument 'typ=wl' can be emulated using 'author-mask')
['tytuł'] = 'title', -- Polish
['títle'] = 'title',
['título'] = 'title', -- Spanish
['ubicación'] = 'location', -- Spanish
['urlarchivio'] = 'archive-url', -- Italian
['urlarchivo'] = 'archive-url', -- Spanish
['urlmorto'] = 'url-status', -- Italian
['urn'] = 'id', -- German (as 'id={{URN|...}}')
['v-authors'] = 'vauthors', -- misspelling
['v-editors'] = 'veditors', -- misspelling
['verlag'] = 'publisher', -- German
['verlagea'] = 'publisher', -- German (not a direct replacement, but can be emulated)
['vol'] = 'volume',
['volumen'] = 'volume', -- Spanish
['werk'] = 'work', -- German
['werkerg'] = 'contribution', -- German (not a direct replacement, but can be emulated)
['wkautore'] = 'author-link', -- Italian
['wolumin'] = 'volume', -- Polish
['wydanie'] = 'number', -- Polish
['wydawca'] = 'publisher', -- French
['yardımcıyazarlar'] = 'author', -- Turkish
['yayımcı'] = 'publisher', -- Turkish
['yayıncı'] = 'publisher', -- Turkish
['yazar'] = 'author', -- Turkish
['yazarbağı'] = 'author-link', -- Turkish
['yer'] = 'location', -- Turkish
['yıl'] = 'date', -- Turkish
['zaprezentowany'] = 'publisher', -- French
['zdb'] = 'id', -- German (as 'id={{ZDB|...}}')
['zitat'] = 'quote', -- German
['zugriff'] = 'access-date', -- German
['éditeur'] = 'editor', -- French
['ölüurl'] = 'url-status', -- Turkish
['übersetzer'] = 'translator', -- German (singular and plural)
}
--[[--------------------------< P A T T E R N S >--------------------------------------------------------------
Here we use Lua patterns to make suggestions. The form is
['pattern'] = 'correct',
Lua patterns are not REGEX though they are similar. The escape character is '%', not '\'.
For more information about Lua patterns, see: Extension:Scribunto/Lua_reference_manual#Patterns
Patterns should probably always include the '^' and '$' anchor assertions to prevent a partial
match from incorrectly suggesting the wrong parameter name. For instance, the pattern 'a[utho]+r'
matches 'author' in the no-longer-supported parameter |author-separator= so the code suggests
'|author='; the same pattern also matches the no-longer-supported parameter |separator= (returning 'ator')
so again, the code suggests '|author='.
One capture is supported, typically the enumerator from an enumerated parameter (the '6' in |author6=, etc.)
The value from the capture replaces $1 in the 'correct' value.
]]
local patterns = {
['^ac+es+ ?d?a?t?e?$'] = 'access-date', -- misspelling
['^apellido[s]?(%d+)$'] = 'last$1', -- Spanish, enumerated
['^a[utho]+r$'] = 'author', -- misspelling
['^a[utho]+r(%d+)$'] = 'author$1', -- misspelling, enumerated
['^author link(%d+)$'] = 'author-link$1', -- Polish, enumerated
['^autor[e]?(%d+)$'] = 'author$1', -- Italian/Spanish/German, enumerated
['^authorfirst(%d+)$'] = 'author-first$1', -- old parameter name, enumerated
['^author(%d+)first$'] = 'author-first$1', -- old parameter name, enumerated
['^authorgiven(%d+)$'] = 'author-given$1', -- old parameter name, enumerated
['^author(%d+)given$'] = 'author-given$1', -- old parameter name, enumerated
['^authorlast(%d+)$'] = 'author-last$1', -- old parameter name, enumerated
['^author(%d+)last$'] = 'author-last$1', -- old parameter name, enumerated
['^authormask(%d+)$'] = 'author-mask$1', -- old parameter name, enumerated
['^author(%d+)mask$'] = 'author-mask$1', -- old parameter name, enumerated
['^authorsurname(%d+)$'] = 'author-surname$1', -- old parameter name, enumerated
['^author(%d+)surname$'] = 'author-surname$1', -- old parameter name, enumerated
['^cognome(%d+)$'] = 'last$1', -- Italian, enumerated
['^editorfirst(%d+)$'] = 'editor-first$1', -- old parameter name, enumerated
['^editor(%d+)first$'] = 'editor-first$1', -- old parameter name, enumerated
['^editorgiven(%d+)$'] = 'editor-given$1', -- old parameter name, enumerated
['^editor(%d+)given$'] = 'editor-given$1', -- old parameter name, enumerated
['^editorlast(%d+)$'] = 'editor-last$1', -- old parameter name, enumerated
['^editor(%d+)last$'] = 'editor-last$1', -- old parameter name, enumerated
['^editorlink(%d+)$'] = 'editor-link$1', -- old parameter name, enumerated
['^editor(%d+)link$'] = 'editor-link$1', -- old parameter name, enumerated
['^editormask(%d+)$'] = 'editor-mask$1', -- old parameter name, enumerated
['^editor(%d+)mask$'] = 'editor-mask$1', -- old parameter name, enumerated
['^editorsurname(%d+)$'] = 'editor-surname$1', -- old parameter name, enumerated
['^editor(%d+)surname$'] = 'editor-surname$1', -- old parameter name, enumerated
['^enlaceautore(%d+)$'] = 'author-link$1', -- Spanish, enumerated
['^first (%d+)$'] = 'first$1', -- enumerated
['^last (%d+)$'] = 'last$1', -- enumerated
['^nom[e]?(%d+)$'] = 'last$1', -- Italian/French, enumerated
['^nombre(%d+)$'] = 'first$1', -- Spanish, enumerated
['^primero(%d+)$'] = 'first$1', -- Spanish, enumerated
['^pu[blish]+ers?$'] = 'publisher', -- misspelling
['^subjectlink(%d+)$'] = 'subject-link$1', -- old parameter name, enumerated
['^subject(%d+)link$'] = 'subject-link$1', -- old parameter name, enumerated
['^wkautore(%d+)$'] = 'author-link$1', -- Italian, enumerated
}
return {suggestions = suggestions, patterns=patterns};
2ijnwqp0v6qxv0w5m0mwrt72z46ubhu
Plantilya:Collapse
10
11185576
37019546
33795706
2026-05-01T14:35:45Z
Exec8
10305
.
37019546
wikitext
text/x-wiki
{| role="presentation" <!-- Template:Collapse --> class="mw-collapsible mw-archivedtalk {{#switch:{{lc:{{{expand|no}}}}}|uncollapse|uncollapsed|expand|expanded|yes|y=mw-uncollapsed|#default=mw-collapsed}} {{{class|}}}" style="{{{{{|safesubst:}}}#ifeq:{{NAMESPACEE}}|{{ns:0}}|display: none;}}{{#if:{{{bg1|}}}|background-color: {{{bg1}}};color:inherit;}} text-align: left; border: {{{border|1px}}} solid {{{b-color|var(--border-color-subtle, #c8ccd1)}}}; {{{{{|safesubst:}}}#switch:{{{float|}}}
| left = margin:0.2em 0.5em 0.2em 0; width:{{{{{|safesubst:}}}#if:{{{width|}}}|{{{width}}}|auto}}; float: left; clear: {{{clear|left}}}
| right = margin:0.2em 0 0.2em 0.5em; width:{{{{{|safesubst:}}}#if:{{{width|}}}|{{{width}}}|auto}}; float: right; clear: {{{clear|right}}}
| none = margin:0.2em 0; width:{{{{{|safesubst:}}}#if:{{{width|}}}|{{{width}}}|auto}}; clear: {{{clear|none}}}
| center | centre = margin:0.2em auto; width:{{{{{|safesubst:}}}#if:{{{width|}}}|{{{width}}}|auto}}; clear: {{{clear|both}}}
| #default = margin: 0.2em auto auto; width:{{{{{|safesubst:}}}#if:{{{width|}}}|{{{width}}}|100%}}; clear: {{{clear|both}}}
}}; padding: 1px;"
|-
! style="background-color: {{{background|{{{bg|var(--background-color-interactive, #eaecf0)}}}}}};color:inherit; font-size:87%; padding:0.2em 0.3em; text-align: {{{{{|safesubst:}}}#if:{{{left|}}}|left|{{{{{|safesubst:}}}#if:{{{center|}}}|center|left}}}}; {{{{{|safesubst:}}}#if:{{{fc|}}}|color: {{{fc}}};|}}" | <div style="display: inline; font-size: 115%; color: {{{fc|{{{{{|safesubst:}}}#if:{{{bg|}}}|#202122|var(--color-base, #202122)}}}}};">{{{2|{{{title|{{{reason|{{{header|{{{heading|{{{result|Extended content}}}}}}}}}}}}}}}}}}</div>
|-
| style="border: solid {{{border2|1px var(--border-color-subtle, #c8ccd1)}}}; padding: {{{padding|8px}}}; background-color: {{{bg2|var(--background-color-base, #fff)}}}; color: {{{fc2|{{{{{|safesubst:}}}#if:{{{bg2|}}}|#202122|var(--color-base, #202122)}}}}};" |
<div>{{{content|{{{text|{{{1<noinclude>|{{lorem ipsum|3}}</noinclude>}}}}}}}}}</div>
|}{{{{{|safesubst:}}}#ifeq:{{NAMESPACEE}}|{{ns:0}}|<span class="error noprint">[[Template:collapse]] is not available for use in articles (see [[MOS:COLLAPSE]]).</span>}}<noinclude>
{{Documentation}}
</noinclude>
hnhh2eomhhq3gyg7vt33w4c0dkzj9b9
Module:WikidataIB
828
11200789
37019596
34255598
2026-05-01T15:13:29Z
Exec8
10305
.
37019596
Scribunto
text/plain
-- Version: 2023-07-10
-- 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)
require("strict")
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: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():callParserFunction('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 or args.sn
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, mw.language.FALLBACK_STRICT )
table.insert( fbtbl, 1, args.lang )
table.insert( fbtbl, "mul" )
table.insert( fbtbl, "en" )
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
end -- loop through fallback table
if found then break end
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, not usable in infoboxes because the 2018 RFC requires sources
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
elseif paraset == 2 then
-- equivalent to raw, not usable in infoboxes because the 2018 RFC requires sources
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
args.linked = "no"
args.pd = "true"
elseif paraset == 3 then
-- parameterset 1, but usable in infoboxes because the 2018 RFC requires sources
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "yes"
args.noicon = "true"
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: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
-------------------------------------------------------------------------------
-- 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: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
-------------------------------------------------------------------------------
-- 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 urls = {}
local quals = {}
local qid = frame.args.qid or ""
if url and url ~= "" then
urls[1] = url
else
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
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)
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
--]]
-------------------------------------------------------------------------------
ql7i3j6aywa93pfslfr0svyicj7ctkn
37019600
37019596
2026-05-01T15:19:17Z
Exec8
10305
Reverted edit by [[Special:Contributions/Exec8|Exec8]] ([[User talk:Exec8|talk]]) to last revision by [[User:Kamingáwan|Kamingáwan]]
34255598
Scribunto
text/plain
-- 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 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.",
["unknown-datetime-format"] = "Unknown datetime format.",
["local-article-not-found"] = "Article is available on Wikidata, but not on Wikipedia",
["dab-page"] = " (dab)",
},
["months"] =
{
"Enero", "Pebrero", "Marso", "Abril", "Mayo", "Hunyo", "Hulyo",
"Agosto", "Septiyembre", "Oktubre", "Nobiyembre", "Disyembre"
},
["century"] = "nga gatosay",
["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"] = ", ",
["abbr"] =
{
["Q828224"] = "km",
["Q11573"] = "m",
["Q174728"] = "cm",
["Q174789"] = "mm",
["Q712226"] = "sq km",
["Q11570"] = "kg",
["Q41803"] = "g",
["Q3241121"] = "mg",
["Q2332346"] = "ml",
["Q7727"] = "min",
["Q11574"] = "s",
},
}
-- 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}}">'
-------------------------------------------------------------------------------
-- Private functions
-------------------------------------------------------------------------------
--
-------------------------------------------------------------------------------
-- makeOrdinal 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.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
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
-------------------------------------------------------------------------------
-- findLang takes a "langcode" parameter if supplied
-- 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 function findLang(langcode)
local langobj
if not langcode or langcode == "" then
langcode = mw.getCurrentFrame():preprocess( '{{int:lang}}' )
end
if mw.language.isKnownLanguageTag(langcode) then
langobj = mw.language.new( langcode )
else
langobj = mw.language.getContentLanguage()
end
return langobj
end
-------------------------------------------------------------------------------
-- roundto takes a positive number (x)
-- and returns it rounded to (sf) significant figures
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local function roundto(x, sf)
if x == 0 then return 0 end
x = math.abs(x)
if sf < 1 then sf = 1 end
local e = math.floor(math.log10(x)) - sf + 1
local m = math.floor(x / 10^e + 0.5)
x = m * 10^e
-- 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 function decimalToDMS(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 function decimalPrecision(x, p)
-- if p is not supplied, pick an arbitrary precision
if not tonumber(p) then p = 1e-4 end
if p > 1 then p = 1 end
if p < 1e-6 then p = 1e-6 end
local e = math.floor(math.log10(p))
local m = math.floor(x / 10^e + 0.5)
x = m * 10^e
-- 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
-------------------------------------------------------------------------------
-- 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.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local parseParam = function(param, default)
if param and param ~= "" then
param = param:lower()
if (param == "false") or (param == "no") or (param == "0") then
return false
else
return true
end
else
return default
end
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)
local label = mw.wikibase.label(id)
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
-------------------------------------------------------------------------------
-- Dependencies: labelOrId()
-------------------------------------------------------------------------------
local linkedItem = function(id, lprefix, lpostfix)
local disp
local sitelink = mw.wikibase.sitelink(id)
local label, islabel = labelOrId(id)
if mw.site.siteName ~= "Wikimedia Commons" then
if sitelink then
-- strip any namespace or dab from the sitelink and use that as label
local pos = sitelink:find(":") or 0
label = sitelink:sub(pos+1):gsub("%s%(.+%)$", ""):gsub(",.+$", "")
disp = "[[" .. lprefix .. sitelink .. lpostfix .. "|" .. label .. "]]"
elseif islabel then
-- no sitelink, label exists, so check if a redirect with that title exists
local artitle = mw.title.new(label, 0)
if 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 .. "|" .. label .. "]]"
else
-- no sitelink, label exists, not a redirect, so output the plain label
disp = label
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]]
disp = label .. i18n.missinginfocat
end
else
local ccat = mw.wikibase.getBestStatements(id, "P373")[1]
if ccat then
ccat = ccat.mainsnak.datavalue.value
disp = "[[" .. lprefix .. "Category:" .. ccat .. lpostfix .. "|" .. label .. "]]"
elseif sitelink then
-- this asumes that if a sitelink exists, then a label also exists
disp = "[[" .. lprefix .. sitelink .. lpostfix .. "|" .. label .. "]]"
else
-- no sitelink and no Commons cat, so return label from labelOrId for now
disp = label
end
end
return disp
end
-------------------------------------------------------------------------------
-- sourced takes a table representing a statement that may or may not have references
-- it counts how many references are sourced to something not containing the word "wikipedia"
-- it returns a boolean = true if there are any sourced references.
-------------------------------------------------------------------------------
-- 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("Wikipedia") 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 function setRanks(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
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
-- The whitelist is passed in named parameter |fetchwikidata
local whitelist = args.fetchwikidata or args.fwd
if not whitelist or 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 not fieldname or 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
-- 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
-------------------------------------------------------------------------------
-- assembleoutput takes the sequence table containing the property values
-- and formats it according to switches given
-- it needs the entityID and propertyID to link from the pen icon
-------------------------------------------------------------------------------
-- Dependencies: parseParam();
-------------------------------------------------------------------------------
local function assembleoutput(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
-- 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 a pen icon is wanted add it the end of the last value
if not noic then
local icon = " [[" .. i18n["filespace"]
icon = icon .. ":Blue pencil.svg |frameless |text-top |10px |alt="
icon = icon .. i18n["editonwikidata"]
icon = icon .. "|link=https://www.wikidata.org/wiki/" .. entityID
icon = icon .. "?uselang=" .. args.langobj.code
icon = icon .. "#" .. propertyID .. "|" .. i18n["editonwikidata"] .. "]]"
out[#out] = out[#out] .. icon
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
return strout
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)
-- 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 ""):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, 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
-- 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 values for this property
-- mlt holds the language code if the datatype is monolingual text
local out = {}
local mlt = {}
for k, v in pairs(objproperty) do
local snak = v.mainsnak or v
local datavalue = snak.datavalue
datavalue = datavalue and datavalue.value
if onlysrc and not sourced(v) then
-- nothing added to 'out': it isn't sourced when onlysourced=true
------------------------------------
elseif v.rank and not args.reqranks[v.rank:sub(1, 1)] then
-- nothing added to 'out': value has a rank that isn't requested
------------------------------------
elseif snak.snaktype == "somevalue" then -- value is unknown
out[#out + 1] = i18n["Unknown"]
------------------------------------
elseif snak.snaktype == "novalue" then -- value is none
-- out[#out + 1] = "No value" -- don't return anything
------------------------------------
elseif datatype == "wikibase-item" then -- data type is a wikibase item:
-- it's wiki-linked value, so output as link if enabled and possible
local qnumber = datavalue.id
if linked then
out[#out + 1] = linkedItem(qnumber, lprefix, lpostfix)
else -- no link wanted so test for lang code
local label, islabel = labelOrId(qnumber)
local lang = args.lang or ""
if lang == "" then
-- there's a language code given, so look for label and sanitise it
label = mw.text.nowiki( mw.wikibase.getLabelByLang(qnumber, lang) or label )
end
out[#out + 1] = label
end -- test for link required
-- If the property has a qualifier of latest date, add that in all cases:
if v.qualifiers then
local quals = v.qualifiers["P1326"] -- latest date qualifier
if quals then
local ldq = i18n.latestdatequalifier(mw.wikibase.renderSnaks(quals))
out[#out] = out[#out] .. " (" .. ldq .. ")"
end
end
------------------------------------
elseif datatype == "time" then -- data type is time:
-- it's a date value, so output according to formatting preferences
local timestamp = datavalue.time
-- 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")
local dateprecision = datavalue.precision
local fpvdate = tonumber(timestamp:sub(2, 5))
local fdate
if dateprecision >= 9 then -- precision is year or shorter
local dateformat = "y"
if dateprecision >= 10 then -- prepend month
fpvdate = i18n.months[tonumber(timestamp:sub(7, 8))] .. " " .. fpvdate
dateformat = args.df
if dateprecision >= 11 then -- prepend day
fpvdate = tonumber(timestamp:sub(10, 11)) .. " " .. fpvdate
end
end
if timestamp:sub(1, 1) == "-" then
fpvdate = fpvdate .. " BCE"
end
fdate = format_Date(fpvdate, dateformat, args.bc)
-- testing the ability to add "circa" from P1480 "sourcing circumstances"
-- just testing on years for now
if dateprecision == 9 and v.qualifiers then
local sc = v.qualifiers.P1480
if sc then
local circa = ""
for k1, v1 in pairs(sc) do
if v1.datavalue.value.id == "Q5727902" then
circa = '<abbr title="circa">c.</abbr> '
break
end
end
fdate = circa .. fdate
end
end
elseif dateprecision == 7 then -- century
local century = math.floor((fpvdate - 1) / 100) + 1
fdate = makeOrdinal(century) .. " " .. i18n["century"]
if timestamp:sub(1, 1) == "-" then -- date is BC
local bc = string.upper(args.bc or "") -- can't use nil for bc
-- we only want to accept two possibilities: BC or default to BCE
if bc == "BC" then
fdate = fdate .. " " .. i18n["BC"] -- use non-breaking space.
else
fdate = fdate .. " " .. i18n["BCE"]
end
end
else
-- date precisions 0 to 6 (billion years to millenium) TODO:
--
end
out[#out+1] = fdate
------------------------------------
-- data types which are strings:
elseif datatype == "commonsMedia" or datatype == "external-id" or datatype == "string" or datatype == "url" then
-- commonsMedia or external-id or string or url
-- all have mainsnak.datavalue.value as string
if lprefix == "" and lpostfix == "" then
out[#out+1] = prefix .. datavalue .. postfix
else
out[#out+1] = "[[" .. lprefix .. datavalue .. lpostfix
out[#out] = out[#out] .. "|" .. prefix .. datavalue .. postfix .. "]]"
end -- check for link requested (i.e. either linkprefix or linkpostfix exists)
------------------------------------
-- data types which are quantities:
elseif datatype == "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
--
-- get the language object as 'lang' to format the numerical value
local lang = args.langobj
--
-- implement a switch to turn on/off numerical formatting later
local fnum = true
-- convert amount to a number
local amount = tonumber(datavalue.amount) or i18n["NaN"]
-- check if upper and/or lower bounds are given and significant
local upb = tonumber(datavalue.upperBound)
local lowb = tonumber(datavalue.lowerBound)
if upb and lowb then
-- differences rounded to 2 sig fig:
local posdif = roundto(upb - amount, 2)
local negdif = roundto(amount - lowb, 2)
if fnum then amount = lang:formatNum( amount ) end
if posdif ~= negdif then
-- non-symmetrical
amount = amount .. " +" .. posdif .. " -" .. negdif
elseif posdif ~= 0 then
-- symmetrical and significant
amount = amount .. " ±" .. posdif
else
-- otherwise range is zero, so leave it off: amount = amount
end
else
if fnum then amount = lang:formatNum( amount ) end
end
-- extract the qid in the form 'Qnnn' from the value.unit url
-- and then fetch the label from that
local unit = ""
local unitqid = string.match( datavalue.unit, "(Q%d+)" )
if unitqid then
if uabbr and i18n.abbr[unitqid] then
-- it's on the list of common abbreviations, so use that
unit = " " .. i18n.abbr[unitqid]
else
-- otherwise use the label (i.e. unit name) if it exists
local uname = mw.wikibase.label( unitqid )
if uname then unit = " " .. uname end
end
end
out[#out+1] = amount .. unit
------------------------------------
-- datatypes which are global coordinates:
elseif datatype == "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
--
-- show parameter allows just the latitude or longitude to be shown
local show = (args.show or ""):lower()
if show ~= "longlat" then show = show:sub(1,3) end
--
local lat, long, prec = datavalue.latitude, datavalue.longitude, datavalue.precision
if show == "lat" then
out[#out+1] = decimalPrecision(lat, prec)
elseif show == "lon" then
out[#out+1] = decimalPrecision(long, prec)
elseif show == "longlat" then
out[#out+1] = 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)
out[#out+1] = 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
out[#out+1] = latdeg .. "°" .. ns .. " " .. longdeg .. "°" .. ew
else
out[#out+1] = latdeg .. "°" .. latmin .. "′" .. ns .. " "
out[#out] = out[#out] .. longdeg .. "°".. longmin .. "′" .. ew
end
else
out[#out+1] = latdeg .. "°" .. latmin .. "′" .. latsec .. "″" .. ns .. " "
out[#out] = out[#out] .. longdeg .. "°" .. longmin .. "′" .. longsec .. "″" .. ew
end
end
end
------------------------------------
elseif datatype == "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
out[#out+1] = prefix .. datavalue.text .. postfix
mlt[#out] = datavalue.language
------------------------------------
else
-- some other data type so write a specific handler
out[#out+1] = "unknown data type: " .. datatype
end -- of datatype/unknown value/sourced check
-- See if qualifiers are to be returned:
if v.qualifiers and qualID and snak.snaktype=="value" then
local qsep = (args.qsep or ""):gsub('"', '')
local qargs = {
["osd"] = "false",
["linked"] = tostring(linked),
["prefix"] = args.qprefix,
["postfix"] = args.qpostfix,
["linkprefix"] = args.qlinkprefix,
["linkpostfix"] = args.qlinkpostfix,
["wdl"] = "false",
["unitabbr"] = tostring(uabbr),
["maxvals"] = 0,
["sorted"] = args.qsorted,
["noicon"] = "true",
["list"] = "",
["sep"] = qsep,
["langobj"] = args.langobj,
}
if qualID == "DATES" then qargs.maxvals = 1 end
local qlist = {}
local t1, t2, dsep = "", "", ""
-- see if we want all
if qualID == "ALL" and v["qualifiers-order"] then
-- the values in the order table are the keys for the qualifiers table:
for k1, v1 in ipairs(v["qualifiers-order"]) do
qlist[#qlist + 1] = assembleoutput(propertyvalueandquals(v.qualifiers[v1], qargs), qargs)
end
else
for k1, v1 in pairs(v.qualifiers) do
-- look for date range:
if qualID == "DATES" then
if k1 == "P580" then -- P580 is "start time"
t1 = propertyvalueandquals(v1, qargs)[1] or ""
elseif k1 == "P582" then -- P582 is "end time"
t2 = propertyvalueandquals(v1, qargs)[1] or ""
end
-- check for latest date qualifier:
elseif k1 == "P1326" then
-- do nothing - this is handled already
-- otherwise see if we want just this qualifier
-- or we want all, but there's no order specified
elseif k1 == qualID or qualID == "ALL" then
local ql = propertyvalueandquals(v1, qargs)
for k2, v2 in ipairs(ql) do
qlist[#qlist + 1] = v2
end
end
end -- of loop through qualifiers
end -- of testing for all
local t = t1 .. t2
-- *** internationalise date separators later ***
if t:find("%s") or t:find(" ") then dsep = " – " else dsep = "–" end
if #qlist > 0 then
local qstr = assembleoutput(qlist, qargs)
out[#out] = out[#out] .. " (" .. qstr .. ")"
elseif t > "" then
out[#out] = out[#out] .. " (" .. t1 .. dsep .. t2 .. ")"
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
local langcode = args.langobj.code
langcode = mw.text.split( langcode, '-', true )[1]
local fbtbl = mw.language.getFallbacksFor( langcode )
table.insert( fbtbl, 1, langcode )
bestval = ""
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 function _getvaluebyqual(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)
-- 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 "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 pairs(props) do
if v1.mainsnak.snaktype == "value" and v1.mainsnak.datavalue.type == "string" then
-- We'll only deal with returning strings for now
-- so 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 for now
if v1q[qualID][1].datatype == "wikibase-item" then
if checkvalue(v1q[qualID][1].datavalue.value.id) then
out[#out + 1] = v1.mainsnak.datavalue.value
end
end
end -- of check for sourced
end -- of check for matching required value and has qualifiers
else
return "not string"
end -- of check for string
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 P131 (located in the administrative teritorial entity)
-- from the initial item to higher level territories until it reaches the highest.
-- It can use an optional boolean, 'first', to determine whether the first item is returned.
-- It returns a table containing the locations - linked where possible, except for the highest.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); labelOrId(); linkedItem
-------------------------------------------------------------------------------
local _location = function(qid, first)
first = parseParam(first, false)
local out = {}
local langcode = findLang():getCode()
local finished = false
repeat
local prop = mw.wikibase.getBestStatements(qid, "P131")[1]
if prop then
out[#out+1] = linkedItem(qid, ":", "") -- get a linked value if we can
qid = prop.mainsnak.datavalue.value.id
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
props = mw.wikibase.getAllStatements(qid, "P1813")
-- if there's a short name and this isn't the only item
if props[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(props) 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)
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
until finished
if not first then table.remove(out, 1) end
return out
end
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Public functions
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- 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: setRanks; parseInput; propertyvalueandquals; assembleoutput; parseParam; sourced;
-- labelOrId; i18n.latestdatequalifier; format_Date; makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p.getValue = function(frame)
if not frame.args[1] then
frame.args = frame:getParent().args
if not frame.args[1] then return i18n.errors["No property supplied"] end
end
local propertyID = mw.text.trim(frame.args[1] or "")
frame.args.reqranks = setRanks(frame.args.rank)
local entityid, props = parseInput(frame, frame.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(frame.args.qual or ""):upper()
if qualID == "" then qualID = nil end
-- set a language object in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
-- table 'out' stores the return value(s):
local out = propertyvalueandquals(props, frame.args, qualID)
-- format the table of values and return it as a string:
return assembleoutput(out, frame.args, entityid, propertyID)
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 "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 "inline, title"
local disp = frame.args.display or ""
if disp == "" then
disp = "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
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
-- 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 in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
-- 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 find the value(s) of the qualifier we want
local quals = v1.qualifiers[qualifierID]
if quals then
-- can't reference qualifer, so set onlysourced = "no" (not boolean)
local qargs = frame.args
qargs.onlysourced = "no"
local vals = propertyvalueandquals(quals, qargs, qid)
for k, v in pairs(vals) do
out[#out + 1] = v
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
-------------------------------------------------------------------------------
-- 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)
-- the Wikibase-entity ID of a value for that qualifier (qvalue=Qzzz)
-- 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 = frame.args.lang or ""
if langcode == "" then
langcode = frame:callParserFunction{ name = "int", args = "lang" }
end
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
-------------------------------------------------------------------------------
-- 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.sitelink(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 label = labelOrId(itemID)
return label
end
-------------------------------------------------------------------------------
-- 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.
-- If there is no sitelink, 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.sitelink(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.description(itemID)
elseif desc:lower() == 'none' then
return nil
else
return desc
end
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
-------------------------------------------------------------------------------
function p.pageId(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 a single parameter: the entity-id as qid or the first unnamed parameter
-------------------------------------------------------------------------------
-- Dependencies: _location();
-------------------------------------------------------------------------------
p.location = function(frame)
local qid = mw.text.trim(frame.args.qid or frame.args[1] or ""):upper()
if qid == "" then return "No id supplied" end
first = mw.text.trim(frame.args.first or "")
return table.concat( _location(qid, first), ", " )
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)
local label = labelOrId( frame.args.qid or frame.args[1] )
return label
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
-------------------------------------------------------------------------------
-- 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 asociated with the curent 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)":
local 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
-------------------------------------------------------------------------------
-- 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
if pid:sub(1,1) ~= "P" then return "No property supplied" end
if qid:sub(1,1) ~= "Q" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return "No item for this page" end
return mw.dumpObject( mw.wikibase.getAllStatements( qid, pid ) )
end
return p
bqo3tfd54pi96r9clrqqxqsdgbygrrn
37019601
37019600
2026-05-01T15:20:32Z
Exec8
10305
37019601
Scribunto
text/plain
-- Version: 2023-07-10
-- 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)
require("strict")
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: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():callParserFunction('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 or args.sn
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, mw.language.FALLBACK_STRICT )
table.insert( fbtbl, 1, args.lang )
table.insert( fbtbl, "mul" )
table.insert( fbtbl, "en" )
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
end -- loop through fallback table
if found then break end
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, not usable in infoboxes because the 2018 RFC requires sources
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
elseif paraset == 2 then
-- equivalent to raw, not usable in infoboxes because the 2018 RFC requires sources
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
args.linked = "no"
args.pd = "true"
elseif paraset == 3 then
-- parameterset 1, but usable in infoboxes because the 2018 RFC requires sources
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "yes"
args.noicon = "true"
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: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
-------------------------------------------------------------------------------
-- 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: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
-------------------------------------------------------------------------------
-- 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 urls = {}
local quals = {}
local qid = frame.args.qid or ""
if url and url ~= "" then
urls[1] = url
else
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
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)
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
--]]
-------------------------------------------------------------------------------
ql7i3j6aywa93pfslfr0svyicj7ctkn
Module:I18n
828
11288150
37019591
34046058
2026-05-01T15:10:01Z
Exec8
10305
.
37019591
Scribunto
text/plain
--- I18n library for message storage in Lua datastores.
-- The module is designed to enable message separation from modules &
-- templates. It has support for handling language fallbacks. This
-- module is a Lua port of [[wikia:dev:I18n-js]] and i18n modules that can be loaded
-- by it are editable through [[wikia:dev:I18nEdit]].
--
-- On Wikimedia projects, i18n messages are editable
-- through [[c:Special:PrefixIndex/Data:i18n/|Data:i18n/]] subpages on
-- Wikimedia Commons.
--
-- @module i18n
-- @version 1.4.0
-- @require Module:Entrypoint
-- @require Module:Fallbacklist
-- @author [[wikia:dev:User:KockaAdmiralac|KockaAdmiralac]] (original Fandom implementation)
-- @author [[wikia:dev:User:Speedit|Speedit]] (original Fandom implementation)
-- @author [[User:Awesome Aasim|Awesome Aasim]] (Wikimedia port)
-- @attribution [[wikia:dev:User:Cqm|Cqm]]
-- @release beta
-- @see [[wikia:dev:I18n|I18n guide]]
-- @see [[wikia:dev:I18n-js]]
-- @see [[wikia:dev:I18nEdit]]
-- <nowiki>
local i18n, _i18n = {}, {}
-- Module variables & dependencies.
local title = mw.title.getCurrentTitle()
local fallbacks = require('Module:Fallbacklist')
local entrypoint = require('Module:Entrypoint')
local uselang
--- Argument substitution as $n where n > 0.
-- @function _i18n.handleArgs
-- @param {string} msg Message to substitute arguments into.
-- @param {table} args Arguments table to substitute.
-- @return {string} Resulting message.
-- @local
function _i18n.handleArgs(msg, args)
for i, a in ipairs(args) do
msg = (string.gsub(msg, '%$' .. tostring(i), tostring(a)))
end
return msg
end
--- Checks whether a language code is valid.
-- @function _i18n.isValidCode
-- @param {string} code Language code to check.
-- @return {boolean} Whether the language code is valid.
-- @local
function _i18n.isValidCode(code)
return type(code) == 'string' and #mw.language.fetchLanguageName(code) ~= 0
end
--- Checks whether a message contains unprocessed wikitext.
-- Used to optimise message getter by not preprocessing pure text.
-- @function _i18n.isWikitext
-- @param {string} msg Message to check.
-- @return {boolean} Whether the message contains wikitext.
function _i18n.isWikitext(msg)
return
type(msg) == 'string' and
(
msg:find('%-%-%-%-') or
msg:find('%f[^\n%z][;:*#] ') or
msg:find('%f[^\n%z]==* *[^\n|]+ =*=%f[\n]') or
msg:find('%b<>') or msg:find('\'\'') or
msg:find('%[%b[]%]') or msg:find('{%b{}}')
)
end
--- I18n datastore class.
-- This is used to control language translation and access to individual
-- messages. The datastore instance provides language and message
-- getter-setter methods, which can be used to internationalize Lua modules.
-- The language methods (any ending in `Lang`) are all **chainable**.
-- @type Data
local Data = {}
Data.__index = Data
--- Datastore message getter utility.
-- This method returns localized messages from the datastore corresponding
-- to a `key`. These messages may have `$n` parameters, which can be
-- replaced by optional argument strings supplied by the `msg` call.
--
-- This function supports [[mw:Extension:Scribunto/Lua reference manual#named_arguments|named
-- arguments]]. The named argument syntax is more versatile despite its
-- verbosity; it can be used to select message language & source(s).
-- @function Data:msg
-- @usage
--
-- ds:msg{
-- key = 'message-name',
-- lang = '',
-- args = {...},
-- sources = {}
-- }
--
-- @usage
--
-- ds:msg('message-name', ...)
--
-- @param {string|table} opts Message configuration or key.
-- @param[opt] {string} opts.key Message key to return from the
-- datastore.
-- @param[opt] {table} opts.args Arguments to substitute into the
-- message (`$n`).
-- @param[opt] {table} opts.sources Source names to limit to (see
-- `Data:fromSources`).
-- @param[opt] {table} opts.lang Temporary language to use (see
-- `Data:inLang`).
-- @param[opt] {string} ... Arguments to substitute into the message
-- (`$n`).
-- @error[115] {string} 'missing arguments in Data:msg'
-- @return {string} Localised datastore message or `'<key>'`.
function Data:msg(opts, ...)
local frame = mw.getCurrentFrame()
-- Argument normalization.
if not self or not opts then
error('missing arguments in Data:msg')
end
local key = type(opts) == 'table' and opts.key or opts
local args = opts.args or {...}
-- Configuration parameters.
if opts.sources then
self:fromSources(unpack(opts.sources))
end
if opts.lang then
self:inLang(opts.lang)
end
-- Source handling.
local source_n = self.tempSources or self._sources
local source_i = {}
for n, i in pairs(source_n) do
source_i[i] = n
end
self.tempSources = nil
-- Language handling.
local lang = self.tempLang or self.defaultLang
self.tempLang = nil
-- Message fetching.
local msg
for i, messages in ipairs(self._messages) do
-- Message data.
local msg = (messages[lang] or {})[key]
-- Fallback support (experimental).
for _, l in ipairs((fallbacks[lang] or {})) do
if msg == nil then
msg = (messages[l] or {})[key]
end
end
-- Internal fallback to 'en'.
msg = msg ~= nil and msg or messages.en[key]
-- Handling argument substitution from Lua.
if msg and source_i[i] and #args > 0 then
msg = _i18n.handleArgs(msg, args)
end
if msg and source_i[i] and lang ~= 'qqx' then
return frame and _i18n.isWikitext(msg)
and frame:preprocess(mw.text.trim(msg))
or mw.text.trim(msg)
end
end
return '⧼' .. mw.text.nowiki(key) .. '⧽'
end
--- Datastore template parameter getter utility.
-- This method, given a table of arguments, tries to find a parameter's
-- localized name in the datastore and returns its value, or nil if
-- not present.
--
-- This method always uses the wiki's content language.
-- @function Data:parameter
-- @param {string} parameter Parameter's key in the datastore
-- @param {table} args Arguments to find the parameter in
-- @error[176] {string} 'missing arguments in Data:parameter'
-- @return {string|nil} Parameter's value or nil if not present
function Data:parameter(key, args)
-- Argument normalization.
if not self or not key or not args then
error('missing arguments in Data:parameter')
end
local contentLang = mw.language.getContentLanguage():getCode()
-- Message fetching.
for i, messages in ipairs(self._messages) do
local msg = (messages[contentLang] or {})[key]
if msg ~= nil and args[msg] ~= nil then
return args[msg]
end
for _, l in ipairs((fallbacks[contentLang] or {})) do
if msg == nil or args[msg] == nil then
-- Check next fallback.
msg = (messages[l] or {})[key]
else
-- A localized message was found.
return args[msg]
end
end
-- Fallback to English.
msg = messages.en[key]
if msg ~= nil and args[msg] ~= nil then
return args[msg]
end
end
end
--- Datastore temporary source setter to a specificed subset of datastores.
-- By default, messages are fetched from the datastore in the same
-- order of priority as `i18n.loadMessages`.
-- @function Data:fromSource
-- @param {string} ... Source name(s) to use.
-- @return {Data} Datastore instance.
function Data:fromSource(...)
local c = select('#', ...)
if c ~= 0 then
self.tempSources = {}
for i = 1, c do
local n = select(i, ...)
if type(n) == 'string' and type(self._sources[n]) == 'number' then
self.tempSources[n] = self._sources[n]
end
end
end
return self
end
--- Datastore default language getter.
-- @function Data:getLang
-- @return {string} Default language to serve datastore messages in.
function Data:getLang()
return self.defaultLang
end
--- Datastore language setter to `wgUserLanguage`.
-- @function Data:useUserLang
-- @return {Data} Datastore instance.
-- @note Scribunto only registers `wgUserLanguage` when an
-- invocation is at the top of the call stack.
function Data:useUserLang()
self.defaultLang = i18n.getLang() or self.defaultLang
return self
end
--- Datastore language setter to `wgContentLanguage`.
-- @function Data:useContentLang
-- @return {Data} Datastore instance.
function Data:useContentLang()
self.defaultLang = mw.language.getContentLanguage():getCode()
return self
end
--- Datastore language setter to specificed language.
-- @function Data:useLang
-- @param {string} code Language code to use.
-- @return {Data} Datastore instance.
function Data:useLang(code)
self.defaultLang = _i18n.isValidCode(code)
and code
or self.defaultLang
return self
end
--- Temporary datastore language setter to `wgUserLanguage`.
-- The datastore language reverts to the default language in the next
-- @{Data:msg} call.
-- @function Data:inUserLang
-- @return {Data} Datastore instance.
function Data:inUserLang()
self.tempLang = i18n.getLang() or self.tempLang
return self
end
--- Temporary datastore language setter to `wgContentLanguage`.
-- Only affects the next @{Data:msg} call.
-- @function Data:inContentLang
-- @return {Data} Datastore instance.
function Data:inContentLang()
self.tempLang = mw.language.getContentLanguage():getCode()
return self
end
--- Temporary datastore language setter to a specificed language.
-- Only affects the next @{Data:msg} call.
-- @function Data:inLang
-- @param {string} code Language code to use.
-- @return {Data} Datastore instance.
function Data:inLang(code)
self.tempLang = _i18n.isValidCode(code)
and code
or self.tempLang
return self
end
-- Package functions.
--- Localized message getter by key.
-- Can be used to fetch messages in a specific language code through `uselang`
-- parameter. Extra numbered parameters can be supplied for substitution into
-- the datastore message.
-- @function i18n.getMsg
-- @param {table} frame Frame table from invocation.
-- @param {table} frame.args Metatable containing arguments.
-- @param {string} frame.args[1] ROOTPAGENAME of i18n submodule.
-- @param {string} frame.args[2] Key of i18n message.
-- @param[opt] {string} frame.args.lang Default language of message.
-- @error[271] {string} 'missing arguments in i18n.getMsg'
-- @return {string} I18n message in localised language.
function i18n.getMsg(frame)
if
not frame or
not frame.args or
not frame.args[1] or
not frame.args[2]
then
error('missing arguments in i18n.getMsg')
end
local source = frame.args[1]
local key = frame.args[2]
-- Pass through extra arguments.
local repl = {}
for i, a in ipairs(frame.args) do
if i >= 3 then
repl[i-2] = a
end
end
-- Load message data.
local ds = i18n.loadMessages(source)
-- Pass through language argument.
ds:inLang(frame.args.uselang)
-- Return message.
return ds:msg { key = key, args = repl }
end
--- I18n message datastore loader.
-- @function i18n.loadMessages
-- @param {string} ... ROOTPAGENAME/path for target i18n
-- submodules.
-- @error[322] {string} 'no source supplied to i18n.loadMessages'
-- @return {table} I18n datastore instance.
-- @usage require('Module:I18n').loadMessages('1', '2')
function i18n.loadMessages(...)
local ds
local i = 0
local s = {}
for j = 1, select('#', ...) do
local source = select(j, ...)
if type(source) == 'string' and source ~= '' then
i = i + 1
s[source] = i
if not ds then
-- Instantiate datastore.
ds = {}
ds._messages = {}
-- Set default language.
setmetatable(ds, Data)
ds:useUserLang()
end
source = string.gsub(source, '^.', mw.ustring.upper)
local success, messages = pcall(mw.loadData, mw.ustring.find(source, ':')
and source
or 'Module:' .. source .. '/i18n')
if success then
local msgCopy = {}
local langSecond = nil
for lang_id, msgtbl in pairs(messages) do
if langSecond == nil then
if lang_id == "qqq" or fallbacks[lang_id] ~= nil then
langSecond = false
else
langSecond = true
end
end
for id_lang, msg in pairs(msgtbl) do
if langSecond then
msgCopy[id_lang] = msgCopy[id_lang] or {}
msgCopy[id_lang][lang_id] = msg
else
msgCopy[lang_id] = msgCopy[lang_id] or {}
msgCopy[lang_id][id_lang] = msg
end
end
end
ds._messages[i] = msgCopy
end
local tab = mw.ext.data.get('I18n/' .. source .. '.tab', '_')
local T = {}
if not success and not tab then error("i18n for " .. source .. " is missing") end
for _, row in pairs(tab.data) do -- convert the output into a dictionary table
local id, t = unpack(row)
for lang, msg in pairs(t) do
if not T[lang] then T[lang] = {} end
T[lang][id] = msg
end
end
if not success then
ds._messages[i] = T
else
for lang, msgTbl in pairs(T) do
ds._messages[i][lang] = ds._messages[i][lang] or msgTbl
end
end
end
end
if not ds then
error('no source supplied to i18n.loadMessages')
else
-- Attach source index map.
ds._sources = s
-- Return datastore instance.
return ds
end
end
--- Language code getter.
-- Can validate a template's language code through `uselang` parameter.
-- @function i18n.getLang
-- @return {string} Language code.
function i18n.getLang()
local frame = mw.getCurrentFrame() or {}
local parentFrame = frame.getParent and frame:getParent() or {}
local code = mw.language.getContentLanguage():getCode()
local subPage = title.subpageText
-- Language argument test.
local langOverride =
(frame.args or {}).uselang or
(parentFrame.args or {}).uselang
if _i18n.isValidCode(langOverride) then
code = langOverride
-- Subpage language test.
elseif title.isSubpage and _i18n.isValidCode(subPage) then
code = _i18n.isValidCode(subPage) and subPage or code
-- User language test.
elseif parentFrame.preprocess or frame.preprocess then
uselang = uselang
or parentFrame.preprocess
and parentFrame:preprocess('{{int:lang}}')
or frame:preprocess('{{int:lang}}')
local decodedLang = mw.text.decode(uselang)
if decodedLang ~= '<lang>' and decodedLang ~= '⧼lang⧽' then
code = decodedLang == '(lang)'
and 'qqx'
or uselang
end
end
return code
end
-- Credit to http://stackoverflow.com/a/1283608/2644759
-- cc-by-sa 3.0
local function tableMerge(t1, t2, overwrite)
for k,v in pairs(t2) do
if type(v) == "table" and type(t1[k]) == "table" then
-- since type(t1[k]) == type(v) == "table", so t1[k] and v is true
tableMerge(t1[k], v, overwrite) -- t2[k] == v
else
if overwrite or t1[k] == nil then t1[k] = v end
end
end
return t1
end
--- Given an i18n table instantiates the values (deprecated)
-- @function i18n.loadI18n
-- @param {string} name name of module with i18n
-- @param {table} i18n_arg existing i18n
function i18n.loadI18n(name, i18n_arg)
local exist, res = pcall(require, name)
if exist and next(res) ~= nil then
if i18n_arg then
tableMerge(i18n_arg, res.i18n, true)
end
end
end
--- Loads an i18n for a specific frame (deprecated)
-- @function i18n.loadI18nFrame
-- @param {string} name name of module with i18n
-- @param {table} i18n_arg existing i18n
function i18n.loadI18nFrame(frame, i18n_arg)
return i18n.loadI18n(frame:getTitle().."/i18n", i18n_arg)
end
--- Wrapper for the module.
-- @function i18n.main
-- @param {table} frame Frame invocation object.
-- @return {string} Module output in template context.
-- @usage {{#invoke:i18n|main}}
i18n.main = entrypoint(i18n)
return require("Module:Deprecated")(i18n,
{
["loadI18n"] = {
deprecated = true,
replacement = "use <code>i18n.loadMessages</code>"
},
["loadI18nFrame"] = {
deprecated = true,
replacement = "use <code>i18n.loadMessages</code>"
}
}
)
-- </nowiki>
mgfuyxvne0w09w2187b5onpo2rwoh53
37019610
37019591
2026-05-01T15:41:17Z
Exec8
10305
Replaced content with "local p = {} -- Credit to http://stackoverflow.com/a/1283608/2644759 -- cc-by-sa 3.0 local function tableMerge(t1, t2, overwrite) for k,v in pairs(t2) do if type(v) == "table" and type(t1[k]) == "table" then -- since type(t1[k]) == type(v) == "table", so t1[k] and v is true tableMerge(t1[k], v, overwrite) -- t2[k] == v else if overwrite or t1[k] == nil then t1[k] = v end end end return t1 end function p.loadI18n(name, i18n_arg) local exist, res =..."
37019610
Scribunto
text/plain
local p = {}
-- Credit to http://stackoverflow.com/a/1283608/2644759
-- cc-by-sa 3.0
local function tableMerge(t1, t2, overwrite)
for k,v in pairs(t2) do
if type(v) == "table" and type(t1[k]) == "table" then
-- since type(t1[k]) == type(v) == "table", so t1[k] and v is true
tableMerge(t1[k], v, overwrite) -- t2[k] == v
else
if overwrite or t1[k] == nil then t1[k] = v end
end
end
return t1
end
function p.loadI18n(name, i18n_arg)
local exist, res = pcall(require, name)
if exist and next(res) ~= nil then
if i18n_arg then
tableMerge(i18n_arg, res.i18n, true)
elseif type(i18n) == "table" then
-- merge to global i18n
tableMerge(i18n, res.i18n, true)
end
end
end
function p.loadI18nFrame(frame, i18n_arg)
p.loadI18n(frame:getTitle().."/i18n", i18n_arg)
end
return p
pggbb6d78fzqixjoboirtmh9ljkxsuq
Module:Location map/styles.css
828
11288155
37019644
34046078
2026-05-01T16:11:23Z
Exec8
10305
37019644
sanitized-css
text/css
/* {{pp|small=yes}} */
.locmap .od {
position: absolute;
}
.locmap .id {
position: absolute;
line-height: 0;
}
.locmap .l0 {
font-size: 0;
position: absolute;
}
.locmap .pv {
line-height: 110%;
position: absolute;
text-align: center;
}
.locmap .pl {
line-height: 110%;
position: absolute;
top: -0.75em;
text-align: right;
}
.locmap .pr {
line-height: 110%;
position: absolute;
top: -0.75em;
text-align: left;
}
.locmap .pv > div {
display: inline;
padding: 1px;
}
.locmap .pl > div {
display: inline; /* inline does not impact floated elements */
padding: 1px;
float: right;
}
.locmap .pr > div {
display: inline; /* inline does not impact floated elements */
padding: 1px;
float: left;
}
/* Dark mode theme: */
@media screen {
html.skin-theme-clientpref-night .od,
html.skin-theme-clientpref-night .od .pv > div,
html.skin-theme-clientpref-night .od .pl > div,
html.skin-theme-clientpref-night .od .pr > div {
/* Use !important to override any infobox rules */
background: #fff !important;
color: #000 !important;
}
html.skin-theme-clientpref-night .locmap img {
filter: grayscale(0.6);
}
/* Special handling for maps inside infoboxes
* [[Module talk:Location map#Map label background bug in dark mode]]
*/
html.skin-theme-clientpref-night .infobox-full-data .locmap div {
background: transparent !important;
}
}
@media screen and (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os .locmap img {
filter: grayscale(0.6);
}
html.skin-theme-clientpref-os .od,
html.skin-theme-clientpref-os .od .pv > div,
html.skin-theme-clientpref-os .od .pl > div,
html.skin-theme-clientpref-os .od .pr > div {
/* Use !important to override any infobox rules */
background: white !important;
color: #000 !important;
}
html.skin-theme-clientpref-os .infobox-full-data .locmap div {
background: transparent !important;
}
}
rs1zb23dpoja6q2k5yakw4kskmcnf7l
Module:Infobox/styles.css
828
11311087
37019589
35046738
2026-05-01T15:08:45Z
Exec8
10305
.
37019589
sanitized-css
text/css
/* {{pp|small=y}} */
/*
* This TemplateStyles sheet deliberately does NOT include the full set of
* infobox styles. We are still working to migrate all of the manual
* infoboxes. See [[MediaWiki talk:Common.css/to do#Infobox]]
* DO NOT ADD THEM HERE
*/
/*
* not strictly certain these styles are necessary since the modules now
* exclusively output infobox-subbox or infobox, not both
* just replicating the module faithfully
*/
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
color:inherit;
}
.infobox-3cols-child {
margin: -3px;
}
.infobox .navbar {
font-size: 100%;
}
/* Dark theme: [[William_Wragg]], [[Coral_Castle]] */
@media screen {
html.skin-theme-clientpref-night .infobox-full-data:not(.notheme) > div:not(.notheme)[style] {
background: #1f1f23 !important;
/* switch with var( --color-base ) when supported. */
color: #f8f9fa;
}
}
@media screen and ( prefers-color-scheme: dark) {
html.skin-theme-clientpref-os .infobox-full-data:not(.notheme) > div:not(.notheme)[style] {
background: #1f1f23 !important;
/* switch with var( --color-base ) when supported. */
color: #f8f9fa;
}
}
/* Since infobox is a table, many infobox templates take advantage of this to
* add columns and rows to the infobox itself rather than as part of a new table
* inside them. This class should be discouraged and removed on the long term,
* but allows us to at least identify these tables going forward
* Currently in use on: [[Module:Infobox3cols]]
* Fixes issue described in [[phab:F55300125]] on Vector 2022.
*/
@media (min-width: 640px) {
body.skin--responsive .infobox-table {
display: table !important;
}
body.skin--responsive .infobox-table > caption {
display: table-caption !important;
}
body.skin--responsive .infobox-table > tbody {
display: table-row-group;
}
body.skin--responsive .infobox-table th,
body.skin--responsive .infobox-table td {
padding-left: inherit;
padding-right: inherit;
}
}
et19aj2zpnqpz3yxaypsrg4fv3vb8t6
Plantilya:PH wikidata
10
11330115
37019605
37016382
2026-05-01T15:35:36Z
Exec8
10305
37019605
wikitext
text/x-wiki
<includeonly>{{safesubst:#switch:{{safesubst:lc:{{{1|}}}}}
| settlement_type = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q61878 = [[Barangay]]
| Q24764 = [[Municipalities of the Philippines|Municipality]]
| Q106078286 = [[Cities of the Philippines#Legal classification|Component city]]
| Q104157 = [[Cities of the Philippines|City]]
| Q29946056 = [[Cities of the Philippines#Legal classification|Highly urbanized city]]
| Q106079704 = [[Cities of the Philippines#Legal classification|Independent component city]]
| Q24746 = [[Provinces of the Philippines|Province]]
| Q7261368 = [[Purok]]
| Q572784 = [[Sitio]]
}}
| settlement_text = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q61878 = barangay
| Q24764 = municipality
| Q104157 = city
| Q106078286 = component city
| Q29946056 = highly urbanized city
| Q106079704 = independent component city
| Q24746 = province
| Q7261368 = purok
| Q572784 = sitio
}}
| government_type = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q24746 = [[Sangguniang Panlalawigan]]
| Q104157 = [[Sangguniang Panlungsod]]
| Q29946056 = [[Sangguniang Panlungsod]]
| Q106079704 = [[Sangguniang Panlungsod]]
| Q106078286 = [[Sangguniang Panlungsod]]
| Q24764 = [[Sangguniang Bayan]]
| Q61878 = [[Sangguniang Barangay]]
}}
| council_title = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q24746 = [[Sangguniang Panlalawigan|Provincial Board]]
| Q104157 = [[Sangguniang Panlungsod|City Council]]
| Q29946056 = [[Sangguniang Panlungsod|City Council]]
| Q106079704 = [[Sangguniang Panlungsod|City Council]]
| Q106078286 = [[Sangguniang Panlungsod|City Council]]
| Q24764 = [[Sangguniang Bayan|Municipal Council]]
| Q61878 = [[Sangguniang Barangay|Barangay Council]]
| Q7261368 = Council
| Q572784 = Council
}}
| nickname1 = {{safesubst:#if:{{safesubst:#property:P1449}}|{{safesubst:replace|{{safesubst:#property:P1449}}|,|{{safesubst:#invoke:String|rep|<br />|{{safesubst:#if:{{{lflf|}}}|{{{lflf|}}}|1}}}}}}}}
| motto = {{safesubst:#property:P1451}}
| image_skyline = {{safesubst:#invoke:Wikidata|claim|P18}}
| image_caption = {{safesubst:#invoke:Wikidata |getImageLegend|FETCH_WIKIDATA}}
| image_flag = {{safesubst:#property:P41}}
| image_seal = {{safesubst:#property:P158}}
| image_shield = {{safesubst:#property:P94}}
| image_map = {{safesubst:#property:P242}}
| map_caption = {{safesubst:#if:{{safesubst:#property:P131}}|Map of {{safesubst:#invoke:string|replace|{{safesubst:#property:P131}}|%s+%([^%(]-%)$||plain=false}} with {{safesubst:#invoke:string|replace|{{safesubst:PAGENAME}}|, .*||plain=false}} highlighted}}
| image_map1 = {{safesubst:#property:P1621}}
| map_caption1 = {{safesubst:#if:{{safesubst:#property:P131}}|Map of {{safesubst:#invoke:string|replace|{{safesubst:PAGENAME}}|, .*||plain=false}} showing barangays {{safesubst:#switch:{{{prefix}}}| coastal = and islands}}}}
| official_name = {{safesubst:#property:P1448}}
| iso_region | iso_code | coordinates_region = {{safesubst:#property:P300}}
| coord | coordinates = {{safesubst:#if:{{safesubst:#property:P625}}|{{coord|region:{{safesubst:PH wikidata/iso}}{{safesubst:#ifeq:{{safesubst:lc:{{safesubst:#property:P31}}}}|province of the philippines|_type:adm1st}}{{safesubst:#if:{{{dim|}}}|_dim:{{{dim}}}}}|format=dms|display=it}} }}
| country = {{safesubst:#invoke:Wikidata|getValue|P17|FETCH_WIKIDATA}}
| region = {{safesubst:PH wikidata/regionlink|{{safesubst:PH wikidata/region|{{safesubst:#property:P131}}}}}}
| province = [[{{safesubst:wikidata|property|preferred|P131}}]]{{safesubst:#invoke:Wikidata|getValue|P131|FETCH_WIKIDATA}} }}
| district = {{safesubst:#property:P7938}}
| seat = {{safesubst:#if:{{safesubst:#property:P36}}|{{safesubst:#invoke:Wikidata|getValue|P36|FETCH_WIKIDATA}}}}
| capital_of = {{safesubst:#if:{{safesubst:#property:P1376}}|{{safesubst:#invoke:Wikidata|getValue|P1376|FETCH_WIKIDATA}}}}
| municipalities | barangays = {{safesubst:#if:{{safesubst:#property:P150}}|{{safesubst:#invoke:sorted plain list|ascd|propertyID=P150}}}}
| established_date | founded = {{safesubst:#if:{{safesubst:#property:P571}}|{{safesubst:replace|{{safesubst:#property:P571}}|,|{{safesubst:#invoke:String|rep|<br />|{{safesubst:#if:{{{lflf|}}}|{{{lflf|}}}|1}}}}}}}}
| founder = {{safesubst:#property:P112}}
| leader_title | mayor_title = {{safesubst:#switch:{{safesubst:lc:{{safesubst:#property:P1313}}}}
|=[[Category:Pages using PH wikidata incorrectly|B]]Mayor
|mayor = [[Mayor]]
|punong barangay = [[Punong Barangay|Brgy Captain]]
| governor = [[Governor]]
|#default = {{safesubst:#invoke:Wikidata|getValue|P1313|FETCH_WIKIDATA}}
}}
| vicemayor_title = {{safesubst:#if:{{safesubst:#property:P1313}}|Vice {{safesubst:#property:P1313}}|[[Category:Pages using PH wikidata incorrectly|B]]Vice mayor}}
| elevation_m = {{safesubst:convert|input=P2044|3=m|disp=number}}
| elevation_ft = {{safesubst:convert|input=P2044|3=ft|disp=number}}
| elevation_footnotes = {{safesubst:#if:{{safesubst:#invoke:wd|reference|raw|P2044}}|{{safesubst:#tag:ref|{{safesubst:#invoke:wd|reference|raw|P2044}}}}|}}
| population_as_of = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}}}} | ? }} {{safesubst:lc:{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P459|FETCH_WIKIDATA}}}}
| population_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}}}} | ? }}
| population_total = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1082|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1082|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1082|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1082|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| population_reference = {{safesubst:#if:{{safesubst:#invoke:wd|reference|raw|P1082}}|{{safesubst:#tag:ref|{{safesubst:#invoke:wd|reference|raw|P1082}}}}|}}
| population_female = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1539|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1539|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1539|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1539|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| population_male = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1540|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1540|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1540|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1540|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| household = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1538|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1538|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1538|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1538|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| household_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1538|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1538|qualifier=P585}}}} | ? }}
| poverty_incidence = <!--{{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P8843|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P8843|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P8843|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P8843|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}--->
{{PH composition bar<!--
--->|{{safesubst:#invoke:WikidataIB | getValue | showunits=no | P8843 | rank=best |fetchwikidata=ALL | noicon=yes}}<!--
--->}}
| poverty_incidence_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P8843|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P8843|qualifier=P585}}}} | ? }}
| poverty_incidence_footnotes = {{safesubst:#if:{{safesubst:#invoke:wd|reference|raw|P8843}}|{{safesubst:#tag:ref|{{safesubst:#invoke:wd|reference|raw|P8843}}}}|}}
| electorate_title = {{safesubst:nowrap|Voter{{safesubst:font|css=font-weight:normal;|{{safesubst:thinsp|{{safesubst:PH Comelec roll|({{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}} |{{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}}}} | ? }})}}}}}}}}
| electorate = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1831|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1831|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1831|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1831|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| electorate_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}}}} | ? }}
| language = {{safesubst:#if:{{safesubst:#property:P2936}}|{{safesubst:replace|{{safesubst:#property:P2936}}|,|<br />}}}}
| area = {{safesubst:#invoke:String|replace|{{safesubst:#invoke:String|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P2046|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P2046|FETCH_WIKIDATA}}
}}| %D+||plain=false}}|±[%d%.][%d%.]*||plain=false}}
| population_demonym | demonym = {{safesubst:#if:{{safesubst:#property:P1549}}|{{safesubst:replace|{{safesubst:#property:P1549}}|,|<br />}}}}
| postal_code = {{safesubst:#property:P281}}
| located_on | located_in = {{safesubst:#if:{{safesubst:#property:P706}}|{{safesubst:#invoke:Wikidata|getValue|P706|FETCH_WIKIDATA}}}}
| area_code = {{safesubst:#if:{{safesubst:#property:P473}}|{{safesubst:#if:{{safesubst:#property:P474}}|{{safesubst:#property:P474}}|+63}} (0)}}{{safesubst:replace|{{safesubst:#property:P473}}|, |<br />{{safesubst:#if:{{safesubst:#property:P473}}|{{safesubst:#if:{{safesubst:#property:P474}}|{{safesubst:#property:P474}}|+63}}}} (0)}}
| income_class | income_class_text = {{safesubst:#if:{{safesubst:#property:P1879}}
|{{safesubst:ifnumber|{{safesubst:#property:P1879}}
|{{safesubst:Ordinal to word/0 to 19|{{safesubst:#property:P1879}}}} income class
|{{safesubst:#invoke:string|replace|{{safesubst:#property:P1879}}|no value|}}
}}
}}
| electoral_district = {{safesubst:#if:{{safesubst:#property:P7938}}|{{safesubst:Ordinal|{{safesubst:#property:P7938}}}}}}
| number_of_divisions = {{safesubst:#if:{{safesubst:#property:P4253}}|{{safesubst:#property:P4253}}}}
| short name = {{safesubst:#property:P1813}}
| timezone = [[Philippine Standard Time|PST]]
| utc_offset = +08:00
|income_class_title = [[Municipalities_of_the_Philippines#Income_classification|Income class]]
|income_class_ordinal = {{safesubst:#ifeq:{{safesubst:#property:P1879}}|no value|—|{{safesubst:#ifeq:{{safesubst:#property:P1879}}|unknown|''Unknown''|{{safesubst:#if:{{safesubst:#property:P1879}}|{{safesubst:str left|{{safesubst:#property:P1879}}|3}}}} class}}}}
| psgc_title = [[:wikidata:Property:P988|PSGC]]
| psgc = {{safesubst:#property:P988}}
| icao = {{safesubst:uc:{{safesubst:#property:P239}}}}
| iata = {{safesubst:uc:{{safesubst:#property:P238}}}}
| diocese = {{safesubst:#invoke:Wikidata|getValue|P708|FETCH_WIKIDATA}}
| patron_saint = {{safesubst:ucfirst:{{safesubst:#property:P417}}}}
| website = {{safesubst:#if:{{safesubst:#property:P856}}|{{safesubst:URL|1={{safesubst:#property:P856}}}}}}
| facebook = @{{safesubst:#property:P2013}}
| twitter = @{{safesubst:#property:P2002}}
| instagram = @{{safesubst:#property:P2003}}
| youtube = @{{safesubst:#property:P2397}}
| commons = {{safesubst:#if:{{safesubst:#property:P373}} | {{safesubst:#property:P373}} | {{safesubst:PH wikidata/check wikidata commons link}} }}
| name = {{safesubst:#invoke:string|replace|{{safesubst:PAGENAME}}|, .*||plain=false}}
| revenue = {{PH wikidata/balance sheet item|revenue}}
| assets = {{PH wikidata/balance sheet item|assets}}
| liabilities = {{PH wikidata/balance sheet item|liabilities}}
| expenditure = {{PH wikidata/balance sheet item|expenditure}}
| revenue_point_in_time = {{PH wikidata/balance sheet item|revenue_point_in_time}}
| assets_point_in_time = {{PH wikidata/balance sheet item|assets_point_in_time}}
| liabilities_point_in_time = {{PH wikidata/balance sheet item|liabilities_point_in_time}}
| expenditure_point_in_time = {{PH wikidata/balance sheet item|expenditure_point_in_time}}
| osm = {{safesubst:#property:P402}}
| climate_title = [[Köppen climate classification|Climate type]]
| climate_type = {{safesubst:ucfirst:{{safesubst:#invoke:WikidataIB |getPreferredValue |P2564|fetchwikidata=ALL|onlysourced=yes|noicon=true}} }}
| operator = {{safesubst:ucfirst:{{safesubst:#invoke:WikidataIB |getPreferredValue |P137|fetchwikidata=ALL|onlysourced=no|noicon=true}} }}
| has_part = {{safesubst:#if:{{safesubst:#property:P527}}|{{safesubst:#invoke:sorted plain list|ascd|propertyID=P527}}}}
| hdi = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1081|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1081|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1081|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1081|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| hdi_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1081|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1081|qualifier=P585}}}} | ? }}
<!-- Infobox lighthouse -->
| admiralty = {{safesubst:#property:P3562}}
| ARLHS = {{safesubst:#property:P2980}}
| focalheight = {{safesubst:#property:P2923}}
| range = {{safesubst:#property:P2929}}
| characteristic = {{safesubst:#property:P1030}}
| height = {{safesubst:#property:P2048}}
| NGA = {{safesubst:#property:P3563}}
| light_sector = {{safesubst:#property:P3922}}
| #default = {{safesubst:PH wikidata/deprecated parameter}} <span class="error">[[Template:PH wikidata]] called with unsupported input "{{{1}}}"</span>
}}</includeonly><noinclude>
{{documentation}}</noinclude>
3eime0x3btpoo9pmdetj0bke4brh6v1
37019606
37019605
2026-05-01T15:36:14Z
Exec8
10305
37019606
wikitext
text/x-wiki
<includeonly>{{safesubst:#switch:{{safesubst:lc:{{{1|}}}}}
| settlement_type = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q61878 = [[Barangay]]
| Q24764 = [[Municipalities of the Philippines|Municipality]]
| Q106078286 = [[Cities of the Philippines#Legal classification|Component city]]
| Q104157 = [[Cities of the Philippines|City]]
| Q29946056 = [[Cities of the Philippines#Legal classification|Highly urbanized city]]
| Q106079704 = [[Cities of the Philippines#Legal classification|Independent component city]]
| Q24746 = [[Provinces of the Philippines|Province]]
| Q7261368 = [[Purok]]
| Q572784 = [[Sitio]]
}}
| settlement_text = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q61878 = barangay
| Q24764 = municipality
| Q104157 = city
| Q106078286 = component city
| Q29946056 = highly urbanized city
| Q106079704 = independent component city
| Q24746 = province
| Q7261368 = purok
| Q572784 = sitio
}}
| government_type = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q24746 = [[Sangguniang Panlalawigan]]
| Q104157 = [[Sangguniang Panlungsod]]
| Q29946056 = [[Sangguniang Panlungsod]]
| Q106079704 = [[Sangguniang Panlungsod]]
| Q106078286 = [[Sangguniang Panlungsod]]
| Q24764 = [[Sangguniang Bayan]]
| Q61878 = [[Sangguniang Barangay]]
}}
| council_title = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q24746 = [[Sangguniang Panlalawigan|Provincial Board]]
| Q104157 = [[Sangguniang Panlungsod|City Council]]
| Q29946056 = [[Sangguniang Panlungsod|City Council]]
| Q106079704 = [[Sangguniang Panlungsod|City Council]]
| Q106078286 = [[Sangguniang Panlungsod|City Council]]
| Q24764 = [[Sangguniang Bayan|Municipal Council]]
| Q61878 = [[Sangguniang Barangay|Barangay Council]]
| Q7261368 = Council
| Q572784 = Council
}}
| nickname1 = {{safesubst:#if:{{safesubst:#property:P1449}}|{{safesubst:replace|{{safesubst:#property:P1449}}|,|{{safesubst:#invoke:String|rep|<br />|{{safesubst:#if:{{{lflf|}}}|{{{lflf|}}}|1}}}}}}}}
| motto = {{safesubst:#property:P1451}}
| image_skyline = {{safesubst:#invoke:Wikidata|claim|P18}}
| image_caption = {{safesubst:#invoke:Wikidata |getImageLegend|FETCH_WIKIDATA}}
| image_flag = {{safesubst:#property:P41}}
| image_seal = {{safesubst:#property:P158}}
| image_shield = {{safesubst:#property:P94}}
| image_map = {{safesubst:#property:P242}}
| map_caption = {{safesubst:#if:{{safesubst:#property:P131}}|Map of {{safesubst:#invoke:string|replace|{{safesubst:#property:P131}}|%s+%([^%(]-%)$||plain=false}} with {{safesubst:#invoke:string|replace|{{safesubst:PAGENAME}}|, .*||plain=false}} highlighted}}
| image_map1 = {{safesubst:#property:P1621}}
| map_caption1 = {{safesubst:#if:{{safesubst:#property:P131}}|Map of {{safesubst:#invoke:string|replace|{{safesubst:PAGENAME}}|, .*||plain=false}} showing barangays {{safesubst:#switch:{{{prefix}}}| coastal = and islands}}}}
| official_name = {{safesubst:#property:P1448}}
| iso_region | iso_code | coordinates_region = {{safesubst:#property:P300}}
| coord | coordinates = {{safesubst:#if:{{safesubst:#property:P625}}|{{coord|region:{{safesubst:PH wikidata/iso}}{{safesubst:#ifeq:{{safesubst:lc:{{safesubst:#property:P31}}}}|province of the philippines|_type:adm1st}}{{safesubst:#if:{{{dim|}}}|_dim:{{{dim}}}}}|format=dms|display=it}} }}
| country = {{safesubst:#invoke:Wikidata|getValue|P17|FETCH_WIKIDATA}}
| region = {{safesubst:PH wikidata/regionlink|{{safesubst:PH wikidata/region|{{safesubst:#property:P131}}}}}}
| province = {{safesubst:ifnotempty| {{safesubst:wikidata|property|preferred|P131}} | {{safesubst:wikidata|property|preferred|linked|P131}} | {{safesubst:#invoke:Wikidata|getValue|P131|FETCH_WIKIDATA}} }}
| district = {{safesubst:#property:P7938}}
| seat = {{safesubst:#if:{{safesubst:#property:P36}}|{{safesubst:#invoke:Wikidata|getValue|P36|FETCH_WIKIDATA}}}}
| capital_of = {{safesubst:#if:{{safesubst:#property:P1376}}|{{safesubst:#invoke:Wikidata|getValue|P1376|FETCH_WIKIDATA}}}}
| municipalities | barangays = {{safesubst:#if:{{safesubst:#property:P150}}|{{safesubst:#invoke:sorted plain list|ascd|propertyID=P150}}}}
| established_date | founded = {{safesubst:#if:{{safesubst:#property:P571}}|{{safesubst:replace|{{safesubst:#property:P571}}|,|{{safesubst:#invoke:String|rep|<br />|{{safesubst:#if:{{{lflf|}}}|{{{lflf|}}}|1}}}}}}}}
| founder = {{safesubst:#property:P112}}
| leader_title | mayor_title = {{safesubst:#switch:{{safesubst:lc:{{safesubst:#property:P1313}}}}
|=[[Category:Pages using PH wikidata incorrectly|B]]Mayor
|mayor = [[Mayor]]
|punong barangay = [[Punong Barangay|Brgy Captain]]
| governor = [[Governor]]
|#default = {{safesubst:#invoke:Wikidata|getValue|P1313|FETCH_WIKIDATA}}
}}
| vicemayor_title = {{safesubst:#if:{{safesubst:#property:P1313}}|Vice {{safesubst:#property:P1313}}|[[Category:Pages using PH wikidata incorrectly|B]]Vice mayor}}
| elevation_m = {{safesubst:convert|input=P2044|3=m|disp=number}}
| elevation_ft = {{safesubst:convert|input=P2044|3=ft|disp=number}}
| elevation_footnotes = {{safesubst:#if:{{safesubst:#invoke:wd|reference|raw|P2044}}|{{safesubst:#tag:ref|{{safesubst:#invoke:wd|reference|raw|P2044}}}}|}}
| population_as_of = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}}}} | ? }} {{safesubst:lc:{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P459|FETCH_WIKIDATA}}}}
| population_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}}}} | ? }}
| population_total = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1082|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1082|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1082|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1082|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| population_reference = {{safesubst:#if:{{safesubst:#invoke:wd|reference|raw|P1082}}|{{safesubst:#tag:ref|{{safesubst:#invoke:wd|reference|raw|P1082}}}}|}}
| population_female = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1539|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1539|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1539|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1539|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| population_male = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1540|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1540|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1540|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1540|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| household = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1538|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1538|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1538|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1538|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| household_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1538|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1538|qualifier=P585}}}} | ? }}
| poverty_incidence = <!--{{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P8843|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P8843|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P8843|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P8843|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}--->
{{PH composition bar<!--
--->|{{safesubst:#invoke:WikidataIB | getValue | showunits=no | P8843 | rank=best |fetchwikidata=ALL | noicon=yes}}<!--
--->}}
| poverty_incidence_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P8843|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P8843|qualifier=P585}}}} | ? }}
| poverty_incidence_footnotes = {{safesubst:#if:{{safesubst:#invoke:wd|reference|raw|P8843}}|{{safesubst:#tag:ref|{{safesubst:#invoke:wd|reference|raw|P8843}}}}|}}
| electorate_title = {{safesubst:nowrap|Voter{{safesubst:font|css=font-weight:normal;|{{safesubst:thinsp|{{safesubst:PH Comelec roll|({{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}} |{{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}}}} | ? }})}}}}}}}}
| electorate = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1831|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1831|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1831|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1831|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| electorate_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}}}} | ? }}
| language = {{safesubst:#if:{{safesubst:#property:P2936}}|{{safesubst:replace|{{safesubst:#property:P2936}}|,|<br />}}}}
| area = {{safesubst:#invoke:String|replace|{{safesubst:#invoke:String|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P2046|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P2046|FETCH_WIKIDATA}}
}}| %D+||plain=false}}|±[%d%.][%d%.]*||plain=false}}
| population_demonym | demonym = {{safesubst:#if:{{safesubst:#property:P1549}}|{{safesubst:replace|{{safesubst:#property:P1549}}|,|<br />}}}}
| postal_code = {{safesubst:#property:P281}}
| located_on | located_in = {{safesubst:#if:{{safesubst:#property:P706}}|{{safesubst:#invoke:Wikidata|getValue|P706|FETCH_WIKIDATA}}}}
| area_code = {{safesubst:#if:{{safesubst:#property:P473}}|{{safesubst:#if:{{safesubst:#property:P474}}|{{safesubst:#property:P474}}|+63}} (0)}}{{safesubst:replace|{{safesubst:#property:P473}}|, |<br />{{safesubst:#if:{{safesubst:#property:P473}}|{{safesubst:#if:{{safesubst:#property:P474}}|{{safesubst:#property:P474}}|+63}}}} (0)}}
| income_class | income_class_text = {{safesubst:#if:{{safesubst:#property:P1879}}
|{{safesubst:ifnumber|{{safesubst:#property:P1879}}
|{{safesubst:Ordinal to word/0 to 19|{{safesubst:#property:P1879}}}} income class
|{{safesubst:#invoke:string|replace|{{safesubst:#property:P1879}}|no value|}}
}}
}}
| electoral_district = {{safesubst:#if:{{safesubst:#property:P7938}}|{{safesubst:Ordinal|{{safesubst:#property:P7938}}}}}}
| number_of_divisions = {{safesubst:#if:{{safesubst:#property:P4253}}|{{safesubst:#property:P4253}}}}
| short name = {{safesubst:#property:P1813}}
| timezone = [[Philippine Standard Time|PST]]
| utc_offset = +08:00
|income_class_title = [[Municipalities_of_the_Philippines#Income_classification|Income class]]
|income_class_ordinal = {{safesubst:#ifeq:{{safesubst:#property:P1879}}|no value|—|{{safesubst:#ifeq:{{safesubst:#property:P1879}}|unknown|''Unknown''|{{safesubst:#if:{{safesubst:#property:P1879}}|{{safesubst:str left|{{safesubst:#property:P1879}}|3}}}} class}}}}
| psgc_title = [[:wikidata:Property:P988|PSGC]]
| psgc = {{safesubst:#property:P988}}
| icao = {{safesubst:uc:{{safesubst:#property:P239}}}}
| iata = {{safesubst:uc:{{safesubst:#property:P238}}}}
| diocese = {{safesubst:#invoke:Wikidata|getValue|P708|FETCH_WIKIDATA}}
| patron_saint = {{safesubst:ucfirst:{{safesubst:#property:P417}}}}
| website = {{safesubst:#if:{{safesubst:#property:P856}}|{{safesubst:URL|1={{safesubst:#property:P856}}}}}}
| facebook = @{{safesubst:#property:P2013}}
| twitter = @{{safesubst:#property:P2002}}
| instagram = @{{safesubst:#property:P2003}}
| youtube = @{{safesubst:#property:P2397}}
| commons = {{safesubst:#if:{{safesubst:#property:P373}} | {{safesubst:#property:P373}} | {{safesubst:PH wikidata/check wikidata commons link}} }}
| name = {{safesubst:#invoke:string|replace|{{safesubst:PAGENAME}}|, .*||plain=false}}
| revenue = {{PH wikidata/balance sheet item|revenue}}
| assets = {{PH wikidata/balance sheet item|assets}}
| liabilities = {{PH wikidata/balance sheet item|liabilities}}
| expenditure = {{PH wikidata/balance sheet item|expenditure}}
| revenue_point_in_time = {{PH wikidata/balance sheet item|revenue_point_in_time}}
| assets_point_in_time = {{PH wikidata/balance sheet item|assets_point_in_time}}
| liabilities_point_in_time = {{PH wikidata/balance sheet item|liabilities_point_in_time}}
| expenditure_point_in_time = {{PH wikidata/balance sheet item|expenditure_point_in_time}}
| osm = {{safesubst:#property:P402}}
| climate_title = [[Köppen climate classification|Climate type]]
| climate_type = {{safesubst:ucfirst:{{safesubst:#invoke:WikidataIB |getPreferredValue |P2564|fetchwikidata=ALL|onlysourced=yes|noicon=true}} }}
| operator = {{safesubst:ucfirst:{{safesubst:#invoke:WikidataIB |getPreferredValue |P137|fetchwikidata=ALL|onlysourced=no|noicon=true}} }}
| has_part = {{safesubst:#if:{{safesubst:#property:P527}}|{{safesubst:#invoke:sorted plain list|ascd|propertyID=P527}}}}
| hdi = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1081|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1081|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1081|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1081|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| hdi_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1081|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1081|qualifier=P585}}}} | ? }}
<!-- Infobox lighthouse -->
| admiralty = {{safesubst:#property:P3562}}
| ARLHS = {{safesubst:#property:P2980}}
| focalheight = {{safesubst:#property:P2923}}
| range = {{safesubst:#property:P2929}}
| characteristic = {{safesubst:#property:P1030}}
| height = {{safesubst:#property:P2048}}
| NGA = {{safesubst:#property:P3563}}
| light_sector = {{safesubst:#property:P3922}}
| #default = {{safesubst:PH wikidata/deprecated parameter}} <span class="error">[[Template:PH wikidata]] called with unsupported input "{{{1}}}"</span>
}}</includeonly><noinclude>
{{documentation}}</noinclude>
mcpgp6zvhuptf52alwcx78msh1kr0b7
37019607
37019606
2026-05-01T15:36:46Z
Exec8
10305
37019607
wikitext
text/x-wiki
<includeonly>{{safesubst:#switch:{{safesubst:lc:{{{1|}}}}}
| settlement_type = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q61878 = [[Barangay]]
| Q24764 = [[Municipalities of the Philippines|Municipality]]
| Q106078286 = [[Cities of the Philippines#Legal classification|Component city]]
| Q104157 = [[Cities of the Philippines|City]]
| Q29946056 = [[Cities of the Philippines#Legal classification|Highly urbanized city]]
| Q106079704 = [[Cities of the Philippines#Legal classification|Independent component city]]
| Q24746 = [[Provinces of the Philippines|Province]]
| Q7261368 = [[Purok]]
| Q572784 = [[Sitio]]
}}
| settlement_text = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q61878 = barangay
| Q24764 = municipality
| Q104157 = city
| Q106078286 = component city
| Q29946056 = highly urbanized city
| Q106079704 = independent component city
| Q24746 = province
| Q7261368 = purok
| Q572784 = sitio
}}
| government_type = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q24746 = [[Sangguniang Panlalawigan]]
| Q104157 = [[Sangguniang Panlungsod]]
| Q29946056 = [[Sangguniang Panlungsod]]
| Q106079704 = [[Sangguniang Panlungsod]]
| Q106078286 = [[Sangguniang Panlungsod]]
| Q24764 = [[Sangguniang Bayan]]
| Q61878 = [[Sangguniang Barangay]]
}}
| council_title = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q24746 = [[Sangguniang Panlalawigan|Provincial Board]]
| Q104157 = [[Sangguniang Panlungsod|City Council]]
| Q29946056 = [[Sangguniang Panlungsod|City Council]]
| Q106079704 = [[Sangguniang Panlungsod|City Council]]
| Q106078286 = [[Sangguniang Panlungsod|City Council]]
| Q24764 = [[Sangguniang Bayan|Municipal Council]]
| Q61878 = [[Sangguniang Barangay|Barangay Council]]
| Q7261368 = Council
| Q572784 = Council
}}
| nickname1 = {{safesubst:#if:{{safesubst:#property:P1449}}|{{safesubst:replace|{{safesubst:#property:P1449}}|,|{{safesubst:#invoke:String|rep|<br />|{{safesubst:#if:{{{lflf|}}}|{{{lflf|}}}|1}}}}}}}}
| motto = {{safesubst:#property:P1451}}
| image_skyline = {{safesubst:#invoke:Wikidata|claim|P18}}
| image_caption = {{safesubst:#invoke:Wikidata |getImageLegend|FETCH_WIKIDATA}}
| image_flag = {{safesubst:#property:P41}}
| image_seal = {{safesubst:#property:P158}}
| image_shield = {{safesubst:#property:P94}}
| image_map = {{safesubst:#property:P242}}
| map_caption = {{safesubst:#if:{{safesubst:#property:P131}}|Map of {{safesubst:#invoke:string|replace|{{safesubst:#property:P131}}|%s+%([^%(]-%)$||plain=false}} with {{safesubst:#invoke:string|replace|{{safesubst:PAGENAME}}|, .*||plain=false}} highlighted}}
| image_map1 = {{safesubst:#property:P1621}}
| map_caption1 = {{safesubst:#if:{{safesubst:#property:P131}}|Map of {{safesubst:#invoke:string|replace|{{safesubst:PAGENAME}}|, .*||plain=false}} showing barangays {{safesubst:#switch:{{{prefix}}}| coastal = and islands}}}}
| official_name = {{safesubst:#property:P1448}}
| iso_region | iso_code | coordinates_region = {{safesubst:#property:P300}}
| coord | coordinates = {{safesubst:#if:{{safesubst:#property:P625}}|{{coord|region:{{safesubst:PH wikidata/iso}}{{safesubst:#ifeq:{{safesubst:lc:{{safesubst:#property:P31}}}}|province of the philippines|_type:adm1st}}{{safesubst:#if:{{{dim|}}}|_dim:{{{dim}}}}}|format=dms|display=it}} }}
| country = {{safesubst:#invoke:Wikidata|getValue|P17|FETCH_WIKIDATA}}
| region = {{safesubst:PH wikidata/regionlink|{{safesubst:PH wikidata/region|{{safesubst:#property:P131}}}}}}
| province = {{safesubst:#property:P7131}}
| district = {{safesubst:#property:P7938}}
| seat = {{safesubst:#if:{{safesubst:#property:P36}}|{{safesubst:#invoke:Wikidata|getValue|P36|FETCH_WIKIDATA}}}}
| capital_of = {{safesubst:#if:{{safesubst:#property:P1376}}|{{safesubst:#invoke:Wikidata|getValue|P1376|FETCH_WIKIDATA}}}}
| municipalities | barangays = {{safesubst:#if:{{safesubst:#property:P150}}|{{safesubst:#invoke:sorted plain list|ascd|propertyID=P150}}}}
| established_date | founded = {{safesubst:#if:{{safesubst:#property:P571}}|{{safesubst:replace|{{safesubst:#property:P571}}|,|{{safesubst:#invoke:String|rep|<br />|{{safesubst:#if:{{{lflf|}}}|{{{lflf|}}}|1}}}}}}}}
| founder = {{safesubst:#property:P112}}
| leader_title | mayor_title = {{safesubst:#switch:{{safesubst:lc:{{safesubst:#property:P1313}}}}
|=[[Category:Pages using PH wikidata incorrectly|B]]Mayor
|mayor = [[Mayor]]
|punong barangay = [[Punong Barangay|Brgy Captain]]
| governor = [[Governor]]
|#default = {{safesubst:#invoke:Wikidata|getValue|P1313|FETCH_WIKIDATA}}
}}
| vicemayor_title = {{safesubst:#if:{{safesubst:#property:P1313}}|Vice {{safesubst:#property:P1313}}|[[Category:Pages using PH wikidata incorrectly|B]]Vice mayor}}
| elevation_m = {{safesubst:convert|input=P2044|3=m|disp=number}}
| elevation_ft = {{safesubst:convert|input=P2044|3=ft|disp=number}}
| elevation_footnotes = {{safesubst:#if:{{safesubst:#invoke:wd|reference|raw|P2044}}|{{safesubst:#tag:ref|{{safesubst:#invoke:wd|reference|raw|P2044}}}}|}}
| population_as_of = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}}}} | ? }} {{safesubst:lc:{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P459|FETCH_WIKIDATA}}}}
| population_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}}}} | ? }}
| population_total = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1082|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1082|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1082|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1082|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| population_reference = {{safesubst:#if:{{safesubst:#invoke:wd|reference|raw|P1082}}|{{safesubst:#tag:ref|{{safesubst:#invoke:wd|reference|raw|P1082}}}}|}}
| population_female = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1539|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1539|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1539|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1539|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| population_male = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1540|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1540|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1540|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1540|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| household = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1538|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1538|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1538|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1538|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| household_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1538|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1538|qualifier=P585}}}} | ? }}
| poverty_incidence = <!--{{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P8843|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P8843|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P8843|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P8843|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}--->
{{PH composition bar<!--
--->|{{safesubst:#invoke:WikidataIB | getValue | showunits=no | P8843 | rank=best |fetchwikidata=ALL | noicon=yes}}<!--
--->}}
| poverty_incidence_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P8843|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P8843|qualifier=P585}}}} | ? }}
| poverty_incidence_footnotes = {{safesubst:#if:{{safesubst:#invoke:wd|reference|raw|P8843}}|{{safesubst:#tag:ref|{{safesubst:#invoke:wd|reference|raw|P8843}}}}|}}
| electorate_title = {{safesubst:nowrap|Voter{{safesubst:font|css=font-weight:normal;|{{safesubst:thinsp|{{safesubst:PH Comelec roll|({{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}} |{{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}}}} | ? }})}}}}}}}}
| electorate = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1831|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1831|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1831|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1831|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| electorate_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}}}} | ? }}
| language = {{safesubst:#if:{{safesubst:#property:P2936}}|{{safesubst:replace|{{safesubst:#property:P2936}}|,|<br />}}}}
| area = {{safesubst:#invoke:String|replace|{{safesubst:#invoke:String|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P2046|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P2046|FETCH_WIKIDATA}}
}}| %D+||plain=false}}|±[%d%.][%d%.]*||plain=false}}
| population_demonym | demonym = {{safesubst:#if:{{safesubst:#property:P1549}}|{{safesubst:replace|{{safesubst:#property:P1549}}|,|<br />}}}}
| postal_code = {{safesubst:#property:P281}}
| located_on | located_in = {{safesubst:#if:{{safesubst:#property:P706}}|{{safesubst:#invoke:Wikidata|getValue|P706|FETCH_WIKIDATA}}}}
| area_code = {{safesubst:#if:{{safesubst:#property:P473}}|{{safesubst:#if:{{safesubst:#property:P474}}|{{safesubst:#property:P474}}|+63}} (0)}}{{safesubst:replace|{{safesubst:#property:P473}}|, |<br />{{safesubst:#if:{{safesubst:#property:P473}}|{{safesubst:#if:{{safesubst:#property:P474}}|{{safesubst:#property:P474}}|+63}}}} (0)}}
| income_class | income_class_text = {{safesubst:#if:{{safesubst:#property:P1879}}
|{{safesubst:ifnumber|{{safesubst:#property:P1879}}
|{{safesubst:Ordinal to word/0 to 19|{{safesubst:#property:P1879}}}} income class
|{{safesubst:#invoke:string|replace|{{safesubst:#property:P1879}}|no value|}}
}}
}}
| electoral_district = {{safesubst:#if:{{safesubst:#property:P7938}}|{{safesubst:Ordinal|{{safesubst:#property:P7938}}}}}}
| number_of_divisions = {{safesubst:#if:{{safesubst:#property:P4253}}|{{safesubst:#property:P4253}}}}
| short name = {{safesubst:#property:P1813}}
| timezone = [[Philippine Standard Time|PST]]
| utc_offset = +08:00
|income_class_title = [[Municipalities_of_the_Philippines#Income_classification|Income class]]
|income_class_ordinal = {{safesubst:#ifeq:{{safesubst:#property:P1879}}|no value|—|{{safesubst:#ifeq:{{safesubst:#property:P1879}}|unknown|''Unknown''|{{safesubst:#if:{{safesubst:#property:P1879}}|{{safesubst:str left|{{safesubst:#property:P1879}}|3}}}} class}}}}
| psgc_title = [[:wikidata:Property:P988|PSGC]]
| psgc = {{safesubst:#property:P988}}
| icao = {{safesubst:uc:{{safesubst:#property:P239}}}}
| iata = {{safesubst:uc:{{safesubst:#property:P238}}}}
| diocese = {{safesubst:#invoke:Wikidata|getValue|P708|FETCH_WIKIDATA}}
| patron_saint = {{safesubst:ucfirst:{{safesubst:#property:P417}}}}
| website = {{safesubst:#if:{{safesubst:#property:P856}}|{{safesubst:URL|1={{safesubst:#property:P856}}}}}}
| facebook = @{{safesubst:#property:P2013}}
| twitter = @{{safesubst:#property:P2002}}
| instagram = @{{safesubst:#property:P2003}}
| youtube = @{{safesubst:#property:P2397}}
| commons = {{safesubst:#if:{{safesubst:#property:P373}} | {{safesubst:#property:P373}} | {{safesubst:PH wikidata/check wikidata commons link}} }}
| name = {{safesubst:#invoke:string|replace|{{safesubst:PAGENAME}}|, .*||plain=false}}
| revenue = {{PH wikidata/balance sheet item|revenue}}
| assets = {{PH wikidata/balance sheet item|assets}}
| liabilities = {{PH wikidata/balance sheet item|liabilities}}
| expenditure = {{PH wikidata/balance sheet item|expenditure}}
| revenue_point_in_time = {{PH wikidata/balance sheet item|revenue_point_in_time}}
| assets_point_in_time = {{PH wikidata/balance sheet item|assets_point_in_time}}
| liabilities_point_in_time = {{PH wikidata/balance sheet item|liabilities_point_in_time}}
| expenditure_point_in_time = {{PH wikidata/balance sheet item|expenditure_point_in_time}}
| osm = {{safesubst:#property:P402}}
| climate_title = [[Köppen climate classification|Climate type]]
| climate_type = {{safesubst:ucfirst:{{safesubst:#invoke:WikidataIB |getPreferredValue |P2564|fetchwikidata=ALL|onlysourced=yes|noicon=true}} }}
| operator = {{safesubst:ucfirst:{{safesubst:#invoke:WikidataIB |getPreferredValue |P137|fetchwikidata=ALL|onlysourced=no|noicon=true}} }}
| has_part = {{safesubst:#if:{{safesubst:#property:P527}}|{{safesubst:#invoke:sorted plain list|ascd|propertyID=P527}}}}
| hdi = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1081|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1081|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1081|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1081|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| hdi_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1081|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1081|qualifier=P585}}}} | ? }}
<!-- Infobox lighthouse -->
| admiralty = {{safesubst:#property:P3562}}
| ARLHS = {{safesubst:#property:P2980}}
| focalheight = {{safesubst:#property:P2923}}
| range = {{safesubst:#property:P2929}}
| characteristic = {{safesubst:#property:P1030}}
| height = {{safesubst:#property:P2048}}
| NGA = {{safesubst:#property:P3563}}
| light_sector = {{safesubst:#property:P3922}}
| #default = {{safesubst:PH wikidata/deprecated parameter}} <span class="error">[[Template:PH wikidata]] called with unsupported input "{{{1}}}"</span>
}}</includeonly><noinclude>
{{documentation}}</noinclude>
3h3yklrqw51yvegjfu6nss7o9cr7az3
37019609
37019607
2026-05-01T15:39:48Z
Exec8
10305
37019609
wikitext
text/x-wiki
<includeonly>{{safesubst:#switch:{{safesubst:lc:{{{1|}}}}}
| settlement_type = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q61878 = [[Barangay]]
| Q24764 = [[Municipalities of the Philippines|Municipality]]
| Q106078286 = [[Cities of the Philippines#Legal classification|Component city]]
| Q104157 = [[Cities of the Philippines|City]]
| Q29946056 = [[Cities of the Philippines#Legal classification|Highly urbanized city]]
| Q106079704 = [[Cities of the Philippines#Legal classification|Independent component city]]
| Q24746 = [[Provinces of the Philippines|Province]]
| Q7261368 = [[Purok]]
| Q572784 = [[Sitio]]
}}
| settlement_text = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q61878 = barangay
| Q24764 = municipality
| Q104157 = city
| Q106078286 = component city
| Q29946056 = highly urbanized city
| Q106079704 = independent component city
| Q24746 = province
| Q7261368 = purok
| Q572784 = sitio
}}
| government_type = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q24746 = [[Sangguniang Panlalawigan]]
| Q104157 = [[Sangguniang Panlungsod]]
| Q29946056 = [[Sangguniang Panlungsod]]
| Q106079704 = [[Sangguniang Panlungsod]]
| Q106078286 = [[Sangguniang Panlungsod]]
| Q24764 = [[Sangguniang Bayan]]
| Q61878 = [[Sangguniang Barangay]]
}}
| council_title = {{safesubst:#switch:{{safesubst:Wikidata|property|raw|P31}}
| Q24746 = [[Sangguniang Panlalawigan|Provincial Board]]
| Q104157 = [[Sangguniang Panlungsod|City Council]]
| Q29946056 = [[Sangguniang Panlungsod|City Council]]
| Q106079704 = [[Sangguniang Panlungsod|City Council]]
| Q106078286 = [[Sangguniang Panlungsod|City Council]]
| Q24764 = [[Sangguniang Bayan|Municipal Council]]
| Q61878 = [[Sangguniang Barangay|Barangay Council]]
| Q7261368 = Council
| Q572784 = Council
}}
| nickname1 = {{safesubst:#if:{{safesubst:#property:P1449}}|{{safesubst:replace|{{safesubst:#property:P1449}}|,|{{safesubst:#invoke:String|rep|<br />|{{safesubst:#if:{{{lflf|}}}|{{{lflf|}}}|1}}}}}}}}
| motto = {{safesubst:#property:P1451}}
| image_skyline = {{safesubst:#invoke:Wikidata|claim|P18}}
| image_caption = {{safesubst:#invoke:Wikidata |getImageLegend|FETCH_WIKIDATA}}
| image_flag = {{safesubst:#property:P41}}
| image_seal = {{safesubst:#property:P158}}
| image_shield = {{safesubst:#property:P94}}
| image_map = {{safesubst:#property:P242}}
| map_caption = {{safesubst:#if:{{safesubst:#property:P131}}|Map of {{safesubst:#invoke:string|replace|{{safesubst:#property:P131}}|%s+%([^%(]-%)$||plain=false}} with {{safesubst:#invoke:string|replace|{{safesubst:PAGENAME}}|, .*||plain=false}} highlighted}}
| image_map1 = {{safesubst:#property:P1621}}
| map_caption1 = {{safesubst:#if:{{safesubst:#property:P131}}|Map of {{safesubst:#invoke:string|replace|{{safesubst:PAGENAME}}|, .*||plain=false}} showing barangays {{safesubst:#switch:{{{prefix}}}| coastal = and islands}}}}
| official_name = {{safesubst:#property:P1448}}
| iso_region | iso_code | coordinates_region = {{safesubst:#property:P300}}
| coord | coordinates = {{safesubst:#if:{{safesubst:#property:P625}}|{{coord|region:{{safesubst:PH wikidata/iso}}{{safesubst:#ifeq:{{safesubst:lc:{{safesubst:#property:P31}}}}|province of the philippines|_type:adm1st}}{{safesubst:#if:{{{dim|}}}|_dim:{{{dim}}}}}|format=dms|display=it}} }}
| country = {{safesubst:#invoke:Wikidata|getValue|P17|FETCH_WIKIDATA}}
| region = {{safesubst:PH wikidata/regionlink|{{safesubst:PH wikidata/region|{{safesubst:#property:P131}}}}}}
| province = {{safesubst:ifnotempty| {{safesubst:wikidata|property|preferred|P131}} | {{safesubst:wikidata|property|preferred|linked|P131}} | {{safesubst:#invoke:Wikidata|getValue|P131|FETCH_WIKIDATA}} }}
| district = {{safesubst:#property:P7938}}
| seat = {{safesubst:#if:{{safesubst:#property:P36}}|{{safesubst:#invoke:Wikidata|getValue|P36|FETCH_WIKIDATA}}}}
| capital_of = {{safesubst:#if:{{safesubst:#property:P1376}}|{{safesubst:#invoke:Wikidata|getValue|P1376|FETCH_WIKIDATA}}}}
| municipalities | barangays = {{safesubst:#if:{{safesubst:#property:P150}}|{{safesubst:#invoke:sorted plain list|ascd|propertyID=P150}}}}
| established_date | founded = {{safesubst:#if:{{safesubst:#property:P571}}|{{safesubst:replace|{{safesubst:#property:P571}}|,|{{safesubst:#invoke:String|rep|<br />|{{safesubst:#if:{{{lflf|}}}|{{{lflf|}}}|1}}}}}}}}
| founder = {{safesubst:#property:P112}}
| leader_title | mayor_title = {{safesubst:#switch:{{safesubst:lc:{{safesubst:#property:P1313}}}}
|=[[Category:Pages using PH wikidata incorrectly|B]]Mayor
|mayor = [[Mayor]]
|punong barangay = [[Punong Barangay|Brgy Captain]]
| governor = [[Governor]]
|#default = {{safesubst:#invoke:Wikidata|getValue|P1313|FETCH_WIKIDATA}}
}}
| vicemayor_title = {{safesubst:#if:{{safesubst:#property:P1313}}|Vice {{safesubst:#property:P1313}}|[[Category:Pages using PH wikidata incorrectly|B]]Vice mayor}}
| elevation_m = {{safesubst:convert|input=P2044|3=m|disp=number}}
| elevation_ft = {{safesubst:convert|input=P2044|3=ft|disp=number}}
| elevation_footnotes = {{safesubst:#if:{{safesubst:#invoke:wd|reference|raw|P2044}}|{{safesubst:#tag:ref|{{safesubst:#invoke:wd|reference|raw|P2044}}}}|}}
| population_as_of = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}}}} | ? }} {{safesubst:lc:{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P459|FETCH_WIKIDATA}}}}
| population_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1082|qualifier=P585}}}} | ? }}
| population_total = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1082|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1082|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1082|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1082|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| population_reference = {{safesubst:#if:{{safesubst:#invoke:wd|reference|raw|P1082}}|{{safesubst:#tag:ref|{{safesubst:#invoke:wd|reference|raw|P1082}}}}|}}
| population_female = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1539|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1539|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1539|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1539|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| population_male = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1540|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1540|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1540|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1540|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| household = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1538|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1538|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1538|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1538|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| household_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1538|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1538|qualifier=P585}}}} | ? }}
| poverty_incidence = <!--{{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P8843|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P8843|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P8843|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P8843|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}--->
{{PH composition bar<!--
--->|{{safesubst:#invoke:WikidataIB | getValue | showunits=no | P8843 | rank=best |fetchwikidata=ALL | noicon=yes}}<!--
--->}}
| poverty_incidence_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P8843|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P8843|qualifier=P585}}}} | ? }}
| poverty_incidence_footnotes = {{safesubst:#if:{{safesubst:#invoke:wd|reference|raw|P8843}}|{{safesubst:#tag:ref|{{safesubst:#invoke:wd|reference|raw|P8843}}}}|}}
| electorate_title = {{safesubst:nowrap|Voter{{safesubst:font|css=font-weight:normal;|{{safesubst:thinsp|{{safesubst:PH Comelec roll|({{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}} |{{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}}}} | ? }})}}}}}}}}
| electorate = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1831|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1831|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1831|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1831|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| electorate_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1831|qualifier=P585}}}} | ? }}
| language = {{safesubst:#if:{{safesubst:#property:P2936}}|{{safesubst:replace|{{safesubst:#property:P2936}}|,|<br />}}}}
| area = {{safesubst:#invoke:String|replace|{{safesubst:#invoke:String|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P2046|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P2046|FETCH_WIKIDATA}}
}}| %D+||plain=false}}|±[%d%.][%d%.]*||plain=false}}
| population_demonym | demonym = {{safesubst:#if:{{safesubst:#property:P1549}}|{{safesubst:replace|{{safesubst:#property:P1549}}|,|<br />}}}}
| postal_code = {{safesubst:#property:P281}}
| located_on | located_in = {{safesubst:#if:{{safesubst:#property:P706}}|{{safesubst:#invoke:Wikidata|getValue|P706|FETCH_WIKIDATA}}}}
| area_code = {{safesubst:#if:{{safesubst:#property:P473}}|{{safesubst:#if:{{safesubst:#property:P474}}|{{safesubst:#property:P474}}|+63}} (0)}}{{safesubst:replace|{{safesubst:#property:P473}}|, |<br />{{safesubst:#if:{{safesubst:#property:P473}}|{{safesubst:#if:{{safesubst:#property:P474}}|{{safesubst:#property:P474}}|+63}}}} (0)}}
| income_class | income_class_text = {{safesubst:#if:{{safesubst:#property:P1879}}
|{{safesubst:ifnumber|{{safesubst:#property:P1879}}
|{{safesubst:Ordinal to word/0 to 19|{{safesubst:#property:P1879}}}} income class
|{{safesubst:#invoke:string|replace|{{safesubst:#property:P1879}}|no value|}}
}}
}}
| electoral_district = {{safesubst:#if:{{safesubst:#property:P7938}}|{{safesubst:Ordinal|{{safesubst:#property:P7938}}}}}}
| number_of_divisions = {{safesubst:#if:{{safesubst:#property:P4253}}|{{safesubst:#property:P4253}}}}
| short name = {{safesubst:#property:P1813}}
| timezone = [[Philippine Standard Time|PST]]
| utc_offset = +08:00
|income_class_title = [[Municipalities_of_the_Philippines#Income_classification|Income class]]
|income_class_ordinal = {{safesubst:#ifeq:{{safesubst:#property:P1879}}|no value|—|{{safesubst:#ifeq:{{safesubst:#property:P1879}}|unknown|''Unknown''|{{safesubst:#if:{{safesubst:#property:P1879}}|{{safesubst:str left|{{safesubst:#property:P1879}}|3}}}} class}}}}
| psgc_title = [[:wikidata:Property:P988|PSGC]]
| psgc = {{safesubst:#property:P988}}
| icao = {{safesubst:uc:{{safesubst:#property:P239}}}}
| iata = {{safesubst:uc:{{safesubst:#property:P238}}}}
| diocese = {{safesubst:#invoke:Wikidata|getValue|P708|FETCH_WIKIDATA}}
| patron_saint = {{safesubst:ucfirst:{{safesubst:#property:P417}}}}
| website = {{safesubst:#if:{{safesubst:#property:P856}}|{{safesubst:URL|1={{safesubst:#property:P856}}}}}}
| facebook = @{{safesubst:#property:P2013}}
| twitter = @{{safesubst:#property:P2002}}
| instagram = @{{safesubst:#property:P2003}}
| youtube = @{{safesubst:#property:P2397}}
| commons = {{safesubst:#if:{{safesubst:#property:P373}} | {{safesubst:#property:P373}} | {{safesubst:PH wikidata/check wikidata commons link}} }}
| name = {{safesubst:#invoke:string|replace|{{safesubst:PAGENAME}}|, .*||plain=false}}
| revenue = {{PH wikidata/balance sheet item|revenue}}
| assets = {{PH wikidata/balance sheet item|assets}}
| liabilities = {{PH wikidata/balance sheet item|liabilities}}
| expenditure = {{PH wikidata/balance sheet item|expenditure}}
| revenue_point_in_time = {{PH wikidata/balance sheet item|revenue_point_in_time}}
| assets_point_in_time = {{PH wikidata/balance sheet item|assets_point_in_time}}
| liabilities_point_in_time = {{PH wikidata/balance sheet item|liabilities_point_in_time}}
| expenditure_point_in_time = {{PH wikidata/balance sheet item|expenditure_point_in_time}}
| osm = {{safesubst:#property:P402}}
| climate_title = [[Köppen climate classification|Climate type]]
| climate_type = {{safesubst:ucfirst:{{safesubst:#invoke:WikidataIB |getPreferredValue |P2564|fetchwikidata=ALL|onlysourced=yes|noicon=true}} }}
| operator = {{safesubst:ucfirst:{{safesubst:#invoke:WikidataIB |getPreferredValue |P137|fetchwikidata=ALL|onlysourced=no|noicon=true}} }}
| has_part = {{safesubst:#if:{{safesubst:#property:P527}}|{{safesubst:#invoke:sorted plain list|ascd|propertyID=P527}}}}
| hdi = {{safesubst:#invoke:string|replace|{{safesubst:#invoke:string|replace|{{safesubst:#if:{{{2|}}}
|{{safesubst:#invoke:Wikidata|getValueFromID|{{{2}}}|P1081|FETCH_WIKIDATA}}
|{{safesubst:#invoke:Wikidata|getValue|P1081|FETCH_WIKIDATA}}
}}|([%d]), .*|%1|plain=false}}|±0|}} {{safesubst:#ifeq:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:Wikidata|getValue|P1081|FETCH_WIKIDATA}}|([%d]), .*|%1|plain=false}}|{{safesubst:#invoke:Wikidata|getValue|P1081|FETCH_WIKIDATA}}|| {{safesubst:PH wikidata/deprecated parameter}}}}
| hdi_point_in_time = {{safesubst:#if:{{safesubst:#invoke:Wikidata|claim|P1081|qualifier=P585}} | {{safesubst:#time:Y|{{safesubst:#invoke:Wikidata|claim|P1081|qualifier=P585}}}} | ? }}
<!-- Infobox lighthouse -->
| admiralty = {{safesubst:#property:P3562}}
| ARLHS = {{safesubst:#property:P2980}}
| focalheight = {{safesubst:#property:P2923}}
| range = {{safesubst:#property:P2929}}
| characteristic = {{safesubst:#property:P1030}}
| height = {{safesubst:#property:P2048}}
| NGA = {{safesubst:#property:P3563}}
| light_sector = {{safesubst:#property:P3922}}
| #default = {{safesubst:PH wikidata/deprecated parameter}} <span class="error">[[Template:PH wikidata]] called with unsupported input "{{{1}}}"</span>
}}</includeonly><noinclude>
{{documentation}}</noinclude>
mcpgp6zvhuptf52alwcx78msh1kr0b7
Module:Sidebar
828
11337693
37019551
35070362
2026-05-01T14:40:26Z
Exec8
10305
.
37019551
Scribunto
text/plain
require('strict')
local cfg = mw.loadData('Module:Sidebar/configuration')
local p = {}
local getArgs = require('Module:Arguments').getArgs
--[[
Categorizes calling templates and modules with a 'style' parameter of any sort
for tracking to convert to TemplateStyles.
TODO after a long cleanup: Catch sidebars in other namespaces than Template and Module.
TODO would probably want to remove /log and /archive as CS1 does
]]
local function categorizeTemplatesWithInlineStyles(args)
local title = mw.title.getCurrentTitle()
if title.namespace ~= 10 and title.namespace ~= 828 then return '' end
for _, pattern in ipairs (cfg.i18n.pattern.uncategorized_conversion_titles) do
if title.text:match(pattern) then return '' end
end
for key, _ in pairs(args) do
if mw.ustring.find(key, cfg.i18n.pattern.style_conversion) or key == 'width' then
return cfg.i18n.category.conversion
end
end
end
--[[
For compatibility with the original {{sidebar with collapsible lists}}
implementation, which passed some parameters through {{#if}} to trim their
whitespace. This also triggered the automatic newline behavior.
]]
-- See ([[meta:Help:Newlines and spaces#Automatic newline]])
local function trimAndAddAutomaticNewline(s)
s = mw.ustring.gsub(s, "^%s*(.-)%s*$", "%1")
if mw.ustring.find(s, '^[#*:;]') or mw.ustring.find(s, '^{|') then
return '\n' .. s
else
return s
end
end
--[[
Finds whether a sidebar has a subgroup sidebar.
]]
local function detectChild(s)
if mw.ustring.find(s, cfg.i18n.pattern.subgroup) then
return true
else
return false
end
end
local function has_navbar(navbar_mode, sidebar_name)
return navbar_mode ~= cfg.i18n.navbar_none and
navbar_mode ~= cfg.i18n.navbar_off and
(
sidebar_name or
mw.getCurrentFrame():getParent():getTitle():gsub(cfg.i18n.pattern.sandbox, '') ~=
cfg.i18n.title_not_to_add_navbar
)
end
local function has_list_class(args, htmlclass)
local patterns = {
'^' .. htmlclass .. '$',
'%s' .. htmlclass .. '$',
'^' .. htmlclass .. '%s',
'%s' .. htmlclass .. '%s'
}
for arg, value in pairs(args) do
if type(arg) == 'string' and mw.ustring.find(arg, 'class') then
for _, pattern in ipairs(patterns) do
if mw.ustring.find(args[arg] or '', pattern) then
return true
end
end
end
end
return false
end
-- there are a lot of list classes in the wild, so we add their TemplateStyles
local function add_list_styles(args)
local frame = mw.getCurrentFrame()
local function add_list_templatestyles(htmlclass, templatestyles)
if has_list_class(args, htmlclass) then
return frame:extensionTag{
name = 'templatestyles', args = { src = templatestyles }
}
else
return ''
end
end
local plainlist_styles = add_list_templatestyles('plainlist', cfg.i18n.templatestyles.plainlist)
local hlist_styles = add_list_templatestyles('hlist', cfg.i18n.templatestyles.hlist)
-- a second workaround for [[phab:T303378]]
-- when that issue is fixed, we can actually use has_navbar not to emit the
-- tag here if we want
if has_navbar(args.navbar, args.name) and hlist_styles == '' then
hlist_styles = frame:extensionTag{
name = 'templatestyles', args = { src = cfg.i18n.templatestyles.hlist}
}
end
-- hlist -> plainlist is best-effort to preserve old Common.css ordering. [hlist_note]
return hlist_styles .. plainlist_styles
end
-- work around [[phab:T303378]]
-- for each arg: find all the templatestyles strip markers, insert them into a
-- table. then remove all templatestyles markers from the arg
local function move_hiding_templatestyles(args)
local gmatch = string.gmatch
local gsub = string.gsub
local templatestyles_markers = {}
local strip_marker_pattern = '(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)'
for k, arg in pairs(args) do
for marker in gmatch(arg, strip_marker_pattern) do
table.insert(templatestyles_markers, marker)
end
args[k] = gsub(arg, strip_marker_pattern, '')
end
return templatestyles_markers
end
--[[
Main sidebar function. Takes the frame, args, and an optional collapsibleClass.
The collapsibleClass is and should be used only for sidebars with collapsible
lists, as in p.collapsible.
]]
function p.sidebar(frame, args, collapsibleClass)
if not args then
args = getArgs(frame)
end
local hiding_templatestyles = table.concat(move_hiding_templatestyles(args))
local root = mw.html.create()
local child = args.child and mw.text.trim(args.child) == cfg.i18n.child_yes
root = root:tag('table')
if not child then
root
:addClass(cfg.i18n.class.sidebar)
-- force collapsibleClass to be sidebar-collapse otherwise output nothing
:addClass(collapsibleClass == cfg.i18n.class.collapse and cfg.i18n.class.collapse or nil)
:addClass('nomobile')
:addClass(args.float == cfg.i18n.float_none and cfg.i18n.class.float_none or nil)
:addClass(args.float == cfg.i18n.float_left and cfg.i18n.class.float_left or nil)
:addClass(args.wraplinks ~= cfg.i18n.wrap_true and cfg.i18n.class.wraplinks or nil)
:addClass(args.bodyclass or args.class)
:attr('role', 'navigation')
:css('width', args.width or nil)
:cssText(args.bodystyle or args.style)
if args.outertitle then
root
:tag('caption')
:addClass(cfg.i18n.class.outer_title)
:addClass(args.outertitleclass)
:cssText(args.outertitlestyle)
:wikitext(args.outertitle)
end
if args.topimage then
local imageCell = root:tag('tr'):tag('td')
imageCell
:addClass(cfg.i18n.class.top_image)
:addClass(args.topimageclass)
:cssText(args.topimagestyle)
:wikitext(args.topimage)
if args.topcaption then
imageCell
:tag('div')
:addClass(cfg.i18n.class.top_caption)
:cssText(args.topcaptionstyle)
:wikitext(args.topcaption)
end
end
if args.pretitle then
root
:tag('tr')
:tag('td')
:addClass(args.topimage and cfg.i18n.class.pretitle_with_top_image
or cfg.i18n.class.pretitle)
:addClass(args.pretitleclass)
:cssText(args.basestyle)
:cssText(args.pretitlestyle)
:wikitext(args.pretitle)
end
else
root
:addClass(cfg.i18n.class.subgroup)
:addClass(args.bodyclass or args.class)
:cssText(args.bodystyle or args.style)
end
if args.title then
if child then
root
:wikitext(args.title)
else
root
:tag('tr')
:tag('th')
:addClass(args.pretitle and cfg.i18n.class.title_with_pretitle
or cfg.i18n.class.title)
:addClass(args.titleclass)
:cssText(args.basestyle)
:cssText(args.titlestyle)
:wikitext(args.title)
end
end
if args.image then
local imageCell = root:tag('tr'):tag('td')
imageCell
:addClass(cfg.i18n.class.image)
:addClass(args.imageclass)
:cssText(args.imagestyle)
:wikitext(args.image)
if args.caption then
imageCell
:tag('div')
:addClass(cfg.i18n.class.caption)
:cssText(args.captionstyle)
:wikitext(args.caption)
end
end
if args.above then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.above)
:addClass(args.aboveclass)
:cssText(args.abovestyle)
:newline() -- newline required for bullet-points to work
:wikitext(args.above)
end
local rowNums = {}
for k, v in pairs(args) do
k = '' .. k
local num = k:match('^heading(%d+)$') or k:match('^content(%d+)$')
if num then table.insert(rowNums, tonumber(num)) end
end
table.sort(rowNums)
-- remove duplicates from the list (e.g. 3 will be duplicated if both heading3
-- and content3 are specified)
for i = #rowNums, 1, -1 do
if rowNums[i] == rowNums[i - 1] then
table.remove(rowNums, i)
end
end
local hasChild = false
for i, num in ipairs(rowNums) do
local heading = args['heading' .. num]
if heading then
root
:tag('tr')
:tag('th')
:addClass(cfg.i18n.class.heading)
:addClass(args.headingclass)
:addClass(args['heading' .. num .. 'class'])
:cssText(args.basestyle)
:cssText(args.headingstyle)
:cssText(args['heading' .. num .. 'style'])
:newline()
:wikitext(heading)
end
local content = args['content' .. num]
if content then
local baseContentClass = cfg.i18n.class.content
if detectChild(content) then
baseContentClass = cfg.i18n.class.content_with_subgroup
hasChild = true
end
root
:tag('tr')
:tag('td')
:addClass(baseContentClass)
:addClass(args.contentclass)
:addClass(args['content' .. num .. 'class'])
:cssText(args.contentstyle)
:cssText(args['content' .. num .. 'style'])
:newline()
:wikitext(content)
:done()
-- Without a linebreak after the </td>, a nested list like
-- "* {{hlist| ...}}" doesn't parse correctly.
:newline()
end
end
if args.below then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.below)
:addClass(args.belowclass)
:cssText(args.belowstyle)
:newline()
:wikitext(args.below)
end
if not child and has_navbar(args.navbar, args.name) then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.navbar)
:cssText(args.navbarstyle)
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
fontstyle = args.navbarfontstyle
})
end
local base_templatestyles = ''
if not child then
base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = cfg.i18n.templatestyles.sidebar }
}
end
local templatestyles = ''
if args['templatestyles'] and args['templatestyles'] ~= '' then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] and args['child templatestyles'] ~= '' then
child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] and args['grandchild templatestyles'] ~= '' then
grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
add_list_styles(args), -- see [hlist_note] above about ordering
base_templatestyles,
templatestyles,
child_templatestyles,
grandchild_templatestyles,
hiding_templatestyles,
tostring(root),
(hasChild and cfg.i18n.category.child or ''),
categorizeTemplatesWithInlineStyles(args)
})
end
local function list_title(args, is_centered_list_titles, num)
local title_text = trimAndAddAutomaticNewline(args['list' .. num .. 'title']
or cfg.i18n.default_list_title)
local title
if is_centered_list_titles then
-- collapsible can be finicky, so provide some CSS/HTML to support
title = mw.html.create('div')
:addClass(cfg.i18n.class.list_title_centered)
:wikitext(title_text)
else
title = mw.html.create()
:wikitext(title_text)
end
local title_container = mw.html.create('div')
:addClass(cfg.i18n.class.list_title)
-- don't /need/ a listnumtitleclass because you can do
-- .templateclass .listnumclass .sidebar-list-title
:addClass(args.listtitleclass)
:cssText(args.basestyle)
:cssText(args.listtitlestyle)
:cssText('color: var(--color-base)')
:cssText(args['list' .. num .. 'titlestyle'])
:node(title)
:done()
return title_container
end
--[[
Main entry point for sidebar with collapsible lists.
Does the work of creating the collapsible lists themselves and including them
into the args.
]]
function p.collapsible(frame)
local args = getArgs(frame)
if not args.name and
frame:getParent():getTitle():gsub(cfg.i18n.pattern.collapse_sandbox, '') ==
cfg.i18n.collapse_title_not_to_add_navbar then
args.navbar = cfg.i18n.navbar_none
end
local contentArgs = {}
local is_centered_list_titles = false
if args['centered list titles'] and args['centered list titles'] ~= '' then
is_centered_list_titles = true
end
for k, v in pairs(args) do
local num = string.match(k, '^list(%d+)$')
if num then
local expand = args.expanded and
(args.expanded == 'all' or args.expanded == args['list' .. num .. 'name'])
local row = mw.html.create('div')
row
:addClass(cfg.i18n.class.list)
:addClass('mw-collapsible')
:addClass((not expand) and 'mw-collapsed' or nil)
:addClass(args['list' .. num .. 'class'])
:cssText(args.listframestyle)
:cssText(args['list' .. num .. 'framestyle'])
:node(list_title(args, is_centered_list_titles, num))
:tag('div')
:addClass(cfg.i18n.class.list_content)
:addClass('mw-collapsible-content')
-- don't /need/ a listnumstyleclass because you can do
-- .templatename .listnumclass .sidebar-list
:addClass(args.listclass)
:cssText(args.liststyle)
:cssText(args['list' .. num .. 'style'])
:wikitext(trimAndAddAutomaticNewline(args['list' .. num]))
contentArgs['content' .. num] = tostring(row)
end
end
for k, v in pairs(contentArgs) do
args[k] = v
end
return p.sidebar(frame, args, cfg.i18n.class.collapse)
end
return p
4esitsmrbrm92s3g3av1dblfso2ifay
Module:Sidebar/configuration
828
11337694
37019552
34859332
2026-05-01T14:40:56Z
Exec8
10305
37019552
Scribunto
text/plain
return {
i18n = {
child_yes = 'yes',
float_none = 'none',
float_left = 'left',
wrap_true = 'true',
navbar_none = 'none',
navbar_off = 'off',
default_list_title = 'List',
title_not_to_add_navbar = 'Template:Sidebar',
collapse_title_not_to_add_navbar = 'Template:Sidebar with collapsible lists',
templatestyles = {
sidebar = 'Module:Sidebar/styles.css',
hlist = 'Hlist/styles.css',
plainlist = 'Plainlist/styles.css',
subinfobox = 'Subinfobox bodystyle/styles.css',
},
category = {
child = '[[Category:Pages using sidebar with the child parameter]]',
conversion = '[[Category:Sidebars with styles needing conversion]]'
},
pattern = {
collapse_sandbox = '/sandbox$',
sandbox = '/sandbox$',
subgroup = 'sidebar%-subgroup',
style_conversion = 'style$',
uncategorized_conversion_titles = {
'/[Ss]andbox',
'/[Tt]estcases',
'/[Dd]oc$'
}
},
class = {
sidebar = 'sidebar',
subgroup = 'sidebar-subgroup',
subinfobox = 'subinfobox',
collapse = 'sidebar-collapse',
float_none = 'sidebar-none',
float_left = 'sidebar-left',
wraplinks = 'nowraplinks',
outer_title = 'sidebar-outer-title',
top_image = 'sidebar-top-image',
top_caption = 'sidebar-top-caption',
pretitle = 'sidebar-pretitle',
pretitle_with_top_image = 'sidebar-pretitle-with-top-image',
title = 'sidebar-title',
title_with_pretitle = 'sidebar-title-with-pretitle',
image = 'sidebar-image',
caption = 'sidebar-caption',
above = 'sidebar-above',
heading = 'sidebar-heading',
content = 'sidebar-content',
content_with_subgroup = 'sidebar-content-with-subgroup',
below = 'sidebar-below',
navbar = 'sidebar-navbar',
list = 'sidebar-list',
list_title = 'sidebar-list-title',
list_title_centered = 'sidebar-list-title-c',
list_content = 'sidebar-list-content'
}
}
}
de8ylruatuwrc8ixb9ircgcsi86ff1y
Plantilya:Infobox settlement/styles.css
10
11338949
37019570
34905208
2026-05-01T14:57:43Z
Exec8
10305
.
37019570
sanitized-css
text/css
/* {{pp|small=y}} */
.ib-settlement {
border-collapse: collapse;
line-height: 1.2em;
}
@media (min-width: 640px) {
.ib-settlement {
width: 23em;
}
}
/* TODO split definitions to appropriate class names when live from HTML element */
.ib-settlement td,
.ib-settlement th {
border-top: 1px solid #a2a9b1;
padding: 0.4em 0.6em 0.4em 0.6em;
}
.ib-settlement .mergedtoprow .infobox-full-data,
.ib-settlement .mergedtoprow .infobox-header,
.ib-settlement .mergedtoprow .infobox-data,
.ib-settlement .mergedtoprow .infobox-label,
.ib-settlement .mergedtoprow .infobox-below {
border-top: 1px solid #a2a9b1;
padding: 0.4em 0.6em 0.2em 0.6em;
}
.ib-settlement .mergedrow .infobox-full-data,
.ib-settlement .mergedrow .infobox-data,
.ib-settlement .mergedrow .infobox-label {
border: 0;
padding: 0 0.6em 0.2em 0.6em;
}
.ib-settlement .mergedbottomrow .infobox-full-data,
.ib-settlement .mergedbottomrow .infobox-data,
.ib-settlement .mergedbottomrow .infobox-label {
border-top: 0;
border-bottom: 1px solid #a2a9b1;
padding: 0 0.6em 0.4em 0.6em;
}
.ib-settlement .maptable {
border: 0;
padding: 0;
}
.ib-settlement .infobox-header,
.ib-settlement .infobox-below {
text-align: left;
}
.ib-settlement .infobox-above {
font-size: 125%;
line-height: 1.3em;
}
.ib-settlement .infobox-subheader {
background-color: #cddeff;color:inherit;
font-weight: bold;
}
.ib-settlement-native {
font-weight: normal;
padding-top: 0.2em;
}
.ib-settlement-other-name {
font-size: 78%;
}
.ib-settlement-official {
font-weight: bold;
}
.ib-settlement-caption {
padding: 0.3em 0 0 0;
}
.ib-settlement-caption-link {
padding: 0.2em 0;
}
.ib-settlement-nickname {
display: inline;
}
.ib-settlement-fn {
font-weight: normal;
display: inline;
}
r64slwko84pew5lxs3tepin9znpz4pc
Clube Atlético Mineiro
0
11344631
37019684
35061997
2026-05-02T01:02:27Z
~2026-26584-18
142650
Mga update
37019684
wikitext
text/x-wiki
Ang '''Clube Atlético Mineiro''' (Portuges nga paglitok: [ˈklubi ɐˈtlɛtʃiku miˈne(j)ɾu]), sagad gitawag nga '''Atlético''', '''Atlético Mineiro''', '''Mineiro''' ug colloquially nga '''Galo''' (gilitok [ˈgalu], "Rooster"), mao ang pinakadako ug labing karaan nga propesyonal nga football club sa [[Belo Horizonte (kapital sa estado)|Belo Horizonte]], ang kapital nga dakbayan sa estado sa Minas Gerais sa Brazil. Ang koponan nakigkompetensya sa Campeonato Brasileiro Série A, ang una nga lebel sa football sa Brazil, ingon man sa Campeonato Mineiro, ang labing taas nga lebel sa liga sa estado sa Minas Gerais.
Ang Clube Atlético Mineiro, gitukod kaniadtong 25 Marso 1908 sa kawhaan ug duha ka mga estudyante gikan sa Belo Horizonte. Bisan pa nga adunay taas nga klase nga mga magtutukod, ang club nagbukas dayon sa mga pultahan niini sa mga magdudula sa matag sosyal nga klase, nga nagtukod sa kaugalingon ingon usa ka "klub sa mga tawo" ug nahimo nga usa sa labing gisuportahan nga mga club sa Brazil. Ang maskot sa club, ang manok, kusganong nakig-uban sa Atlético sukad sa pagpaila niini sa 1930s. Sulod sa mga katuigan, ang pulong Gaylo (Portuges para sa "manog") nahimong komon nga angga sa club mismo. Ang regular nga home kit sa team naglangkob sa black-and-white striped shirts, black shorts ug white socks.
Ang Atlético nakadaog sa Campeonato Mineiro usa ka rekord sa 48 ka beses. Sa nasyonal nga lebel, ang club nakadaog sa Campeonato Brasileiro tulo ka beses, kaniadtong 1971 ug 2021 ug natapos ang ikaduha sa lima ka higayon. Kini usab nakadaog sa Copa do Brasil kaduha ug ang Supercopa do Brasil ug ang Copa dos Campeões Brasileiros kausa matag usa. Sa internasyonal nga club football, ang Atlético nakadaog sa Copa Libertadores ug sa Recopa Sudamericana kausa matag usa, ug usa ka record nga duha ka Copa CONMEBOL; ang team nakaabot na sab og tulo ka laing continental finals. Ang club nakigkompetensya usab sa ubang mga dula sa tibuuk nga kasaysayan niini, diin ang departamento sa futsal nahimong labi ka bantog.
Ang club nagdula sa ilang mga dula sa balay sa Arena MRV, nga adunay kapasidad sa operasyon nga kapin sa 46,000 nga mga tumatan-aw. Ang konstruksyon sa Arena MRV nagsugod niadtong Abril 20, 2020, ang inagurasyon niini niadtong Abril 15, 2023, ug ang unang opisyal nga duwa niini nahitabo niadtong Agosto 27, 2023. Usahay, ang Atlético magdula usab sa ilang mga home games sa Mineirão stadium, nga gipanag-iya sa lokal nga estado. gobyerno.
Ang Atlético adunay lokal nga kaatbang sa Cruzëiro, nga ginganlag Clássico Mineiro. Ang club usab adunay usa ka lokal nga karibal sa América Mineiro ug usa ka interstate sa Flamengo. Ang Atlético adunay ika-unom nga labing bililhon nga brand sa Brazil, nagkantidad og R$515.5 milyon (€143 milyon) sa 2016, ang ika-8 nga pinakadako nga panon sa football sa Brazil ug ikapito sa nasud sa mga termino sa turnover, nga nakamugna og R$244.6 milyon (€62.2 milyon) sa 2015.
Niadtong Nobyembre 1, 2023, gipahibalo nga nahuman ni Galo Holding ang pagpalit sa nagkontrol nga interes (75%) sa SAF sa club. Sa kinatibuk-an nga 913 ka milyon nga reais nga gibayad sa mga bag-ong tigpamuhunan, ang ikatulo nga bahin sa kantidad gigamit sa pagbayad sa mga utang.
https://atletico.com.br/
[[Kategoriya:Football]]
f028kyh0dl4suo4n1h9znh0vrwrcico
37019685
37019684
2026-05-02T01:09:37Z
~2026-26584-18
142650
37019685
wikitext
text/x-wiki
Ang '''Clube Atlético Mineiro''' (Portuges nga paglitok: [ˈklubi ɐˈtlɛtʃiku miˈne(j)ɾu]), sagad gitawag nga '''Atlético''', '''Atlético Mineiro''', '''Mineiro''' ug colloquially nga '''Galo''' (gilitok [ˈgalu], "Rooster"), kini usa ka propesyonal nga club sa football gikan sa Belo Horizonte, ang kaulohan sa estado sa Brazil sa Minas Gerais. Ang koponan nakigkompetensya sa Campeonato Brasileiro Série A, ang una nga lebel sa football sa Brazil, ingon man sa Campeonato Mineiro, ang labing taas nga lebel sa liga sa estado sa Minas Gerais.
Ang Clube Atlético Mineiro, gitukod kaniadtong 25 Marso 1908 sa kawhaan ug duha ka mga estudyante gikan sa Belo Horizonte. Bisan pa nga adunay taas nga klase nga mga magtutukod, ang club nagbukas dayon sa mga pultahan niini sa mga magdudula sa matag sosyal nga klase, nga nagtukod sa kaugalingon ingon usa ka "klub sa mga tawo" ug nahimo nga usa sa labing gisuportahan nga mga club sa Brazil. Ang maskot sa club, ang manok, kusganong nakig-uban sa Atlético sukad sa pagpaila niini sa 1930s. Sulod sa mga katuigan, ang pulong Gaylo (Portuges para sa "manog") nahimong komon nga angga sa club mismo. Ang regular nga home kit sa team naglangkob sa black-and-white striped shirts, black shorts ug white socks.
Ang Atlético nakadaog sa Campeonato Mineiro usa ka rekord sa 48 ka beses. Sa nasyonal, ang club nakadaog sa Brazilian Championship kaduha , kaniadtong 1971 ug 2021 ug natapos ang ikaduha sa lima ka higayon. Kini usab nakadaog sa Copa do Brasil kaduha ug ang Supercopa do Brasil ug ang Copa dos Campeões Brasileiros kausa matag usa. Sa internasyonal nga club football, ang Atlético nakadaog sa Copa Libertadores ug sa Recopa Sudamericana kausa matag usa, ug usa ka record nga duha ka Copa CONMEBOL; ang team nakaabot na sab og tulo ka laing continental finals. Ang club nakigkompetensya usab sa ubang mga dula sa tibuuk nga kasaysayan niini, diin ang departamento sa futsal nahimong labi ka bantog.
Ang club nagdula sa ilang mga dula sa balay sa Arena MRV, nga adunay kapasidad sa operasyon nga kapin sa 46,000 nga mga tumatan-aw. Ang konstruksyon sa Arena MRV nagsugod niadtong Abril 20, 2020, ang inagurasyon niini niadtong Abril 15, 2023, ug ang unang opisyal nga duwa niini nahitabo niadtong Agosto 27, 2023. Usahay, ang Atlético magdula usab sa ilang mga home games sa Mineirão stadium, nga gipanag-iya sa lokal nga estado. gobyerno.
Ang Atlético adunay lokal nga kaatbang sa Cruzëiro, nga ginganlag Clássico Mineiro. Ang club usab adunay usa ka lokal nga karibal sa América Mineiro ug usa ka interstate sa Flamengo. Ang Atlético adunay ika-unom nga labing bililhon nga brand sa Brazil, nagkantidad og R$515.5 milyon (€143 milyon) sa 2016, ang ika-8 nga pinakadako nga panon sa football sa Brazil ug ikapito sa nasud sa mga termino sa turnover, nga nakamugna og R$244.6 milyon (€62.2 milyon) sa 2015.
Niadtong Nobyembre 1, 2023, gipahibalo nga nahuman ni Galo Holding ang pagpalit sa nagkontrol nga interes (75%) sa SAF sa club. Sa kinatibuk-an nga 913 ka milyon nga reais nga gibayad sa mga bag-ong tigpamuhunan, ang ikatulo nga bahin sa kantidad gigamit sa pagbayad sa mga utang.
https://atletico.com.br/
[[Kategoriya:Football]]
sqg85pkvti10rdflxhsry8qxsvxkpjf
Lai Ching-te
0
11349101
37019512
37019511
2026-05-01T12:18:56Z
Ikar.us
3482
Giway-bili ang rebisyon [[Special:Diff/37019511|37019511]] ni [[Special:Contributions/IMRH2004|IMRH2004]] ([[User talk:IMRH2004|Hisgot]])
37019512
wikitext
text/x-wiki
[[Payl:William_Lai_Ching-te_20230814.jpg|thumb|Lai Ching-te (2023)]]
'''Lai Ching-te''' (sa [[Intsik]] 賴清德, Pinyin Lài Qīngdé, W.-G. Lai Chʻing-tê; natawo niadtong Oktubre 6, 1959 sa Wanli), nga mas nailhan usab isip '''William Lai''', usa ka pulitiko nga taga-Taiwan gikan sa Democratic Progressive Party (DPP). Sukad Mayo 20, 2024, siya mao ang kasamtangang presidente sa [[Republika sa Tsina]] (Taiwan).
Sa tibuok nasod, nakapahimulos si Lai og dako nga pagtagad niadtong 2014, sa dihang siya mibisita sa Shanghai ug sa usa ka panulti sa Fudan University misulti alang sa katungod sa katawhan sa Taiwan sa kaugalingong pagpili ug sa ingon, indirektang para sa kagawasan sa Taiwan gikan sa People's Republic of China (tan-awa ang Taiwan Conflict). Tungod niini, siya usa sa pipila ka mga politik'''o''' nga nagpahayag sa kini nga kasabutan nga laganap sa katilingban sa Taiwan bisan pa sa ilang pagbisita sa China.
Niadtong Setyembre 8, 2017, gitudlo si Lai ni Presidenta Tsai Ing-wen ingon nga sunod ni Lin Chuan sa pagka Chairman sa Executive Yuan, o Punong Ministro sa Taiwan. Tungod sa grabeng kapildihan sa DPP sa lokal nga eleksyon niadtong Nobyembre 2018, mipahibalo si Lai sa iyang pag-resign ug gihatag ang katungdanan niadtong Enero 11, 2019 kang Su Tseng-chan'''g'''.
Niadtong Marso 18, 2019, gipahibalo ni Lai ang iyang pagkandidato alang sa posisyon nga punong kandidato sa DPPsa umaabot nga eleksyon sa presidente sa sunod tuig. Apan sa botohan nga gihimo gikan Hunyo 10 hangtod 12, 2019, napildi siya sa iyang kontra-kandidato, ang kasamtangang presidente Tsai Ing-wen. Niadtong Nobyembre sa maong tuig, nagkasabot ang duha ka politiko nga mukuyog si Lai kang Tsai isip kandidato alang sa posisyon nga Bise Presidente. Human sa kadaogan sa eleksyon niadtong Enero 11, 2020, gisumpaan si Lai isip Bise Presidente niadtong Mayo 20, 2020.
Sa 2024 nga eleksyon sa pagkapresidente, si Lai midaog nga adunay hapit 40 porsyento nga boto. Nanumpa siya sa katungdanan niadtong Mayo 20, 2024. Niadtong Hunyo 4, 2024, gisaulog ni Lai ang 1989 nga pagsumpo sa kalihukang demokrasya sa Tian'anmen Square sa [[Pekin|Beijing]] . Naghisgot sa People's Republic of China, iyang gipahayag nga ang usa ka tinuud nga respetado nga nasud nagtugot sa mga lungsuranon sa pagpahayag sa ilang mga opinyon.
[[Kategoriya:Mga natawo sa 1959]]
668yk6orffgm2quihu4v3yjjvla7gxk
Lightyear
0
11352298
37019513
37010273
2026-05-01T12:25:59Z
~2026-26306-73
142576
/* Cast */ +[[Kategoriya:Mga pelikula sa Pixar]]
37019513
wikitext
text/x-wiki
Ang '''''Lightyear''''' (2022) maoy [[Amerikano]]ng karton nga pelikula.
==Cast==
* [[Chris Evans]]
* [[Keke Palmer]]
* [[Peter Sohn]]
* [[Taika Waititi]]
* [[Dale Soules]]
* [[James Brolin]]
* [[Uzo Aduba]]
[[Kategoriya:2022 nga mga pelikula]]
[[Kategoriya:Amerikanong karton nga pelikula]]
[[Kategoriya:Mga pelikula sa Pixar]]
[[Kategoriya:Toy Story]]
rjymz08t2g535lmwdc5k13cs352pysh
Toy Story 5
0
11352299
37019514
37010274
2026-05-01T12:26:25Z
~2026-26306-73
142576
/* Cast */ +[[Kategoriya:Mga pelikula sa Pixar]]
37019514
wikitext
text/x-wiki
Ang '''''Toy Story 5''''' (2026) maoy [[Amerikano]]ng karton nga pelikula.
==Cast==
* [[Tom Hanks]]
* [[Tim Allen]]
* [[Joan Cusack]]
* [[Greta Lee]]
* [[Conan O'Brien]]
* [[Tony Hale]]
* [[Craig Robinson]]
* [[Shelby Rabara]]
* [[Scarlett Spears]]
* [[Mykal-Michelle Harris]]
* [[Matty Matheson]]
* [[John Ratzenberger]]
* [[Wallace Shawn]]
* [[Blake Clark]]
* [[Jeff Bergman]]
* [[Anna Vocino]]
* [[Annie Potts]]
* [[Bonnie Hunt]]
* [[Melissa Villaseñor]]
* [[John Hopkins]]
* [[Kristen Schaal]]
* [[Ernie Hudson]]
* [[Keanu Reeves]]
[[Kategoriya:2026 nga mga pelikula]]
[[Kategoriya:Amerikanong karton nga pelikula]]
[[Kategoriya:Mga pelikula sa Pixar]]
[[Kategoriya:Toy Story]]
7xdjxpjjs1qzjaa1gvnxxm6olhilubf
Xenogale
0
11353897
37019516
2026-05-01T13:57:11Z
~2026-26632-15
142617
Redirected page to [[Xenogale naso]]
37019516
wikitext
text/x-wiki
#REDIRECT [[Xenogale naso]]
chg1yn7tbx6jm4bydbaqhilokp9aeme
Xenogale naso
0
11353898
37019517
2026-05-01T13:58:31Z
~2026-26632-15
142617
Created page with "{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}} {{Taxobox | name = ''Herpestes naso'' | status = LC | image = | image_caption = | domain = | regnum = [[Animalia]] | phylum = [[Maybukobuko (mananap)|Chordata]] | classis = [[Mammalia]] | ordo = [[Carnivora]] | familia = [[Herpestidae]] | genus = [[Xenogale]] | species = '''Xenogale naso''' | binomial = Herpestes naso | binomial_authority = de Winton, 1901 | range_map = Long-nosed Mongoose area.png | range_map_caption =..."
37019517
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Herpestes naso''
| status = LC
| image =
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = [[Xenogale]]
| species = '''Xenogale naso'''
| binomial = Herpestes naso
| binomial_authority = de Winton, 1901
| range_map = Long-nosed Mongoose area.png
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms =
| status_ref = <ref name = "iucn"/>
| status_system = iucn3.1 }}
Kaliwatan sa [[mamipero]] ang '''''Xenogale naso'''''<ref name = "COL"/>. Una ning gihulagway ni De Winton ni adtong 1901.<ref name = "col35491763"/> Ang ''Herpestes naso'' sakop sa [[kahenera]] nga ''[[Xenogale]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/><ref name = "source"/> Giklaseklase sa [[IUCN]] ang kaliwatan sa [[kinaminosang kalabotan]].<ref name = "iucn"/>
Kini nga matang hayop na sabwag sa:
* [[Aprika]]
Walay nalista nga matang nga sama niini.<ref name = "COL"/>
<!-- katapusan sa gisulat -->
lvzfg0cti7mnwvf62k09ewkgodhdp19
37019518
37019517
2026-05-01T13:59:39Z
~2026-26632-15
142617
/* */
37019518
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Xenogale naso''
| status = LC
| image =
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = [[Xenogale]]
| species = '''Xenogale naso'''
| binomial = Herpestes naso
| binomial_authority = de Winton, 1901
| range_map = Long-nosed Mongoose area.png
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms =
| status_ref = <ref name = "iucn"/>
| status_system = iucn3.1 }}
Kaliwatan sa [[mamipero]] ang '''''Xenogale naso'''''<ref name = "COL"/>. Una ning gihulagway ni De Winton ni adtong 1901.<ref name = "col35491763"/> Ang ''Herpestes naso'' sakop sa [[kahenera]] nga ''[[Xenogale]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/><ref name = "source"/> Giklaseklase sa [[IUCN]] ang kaliwatan sa [[kinaminosang kalabotan]].<ref name = "iucn"/>
Kini nga matang hayop na sabwag sa:
* [[Aprika]]
Walay nalista nga matang nga sama niini.<ref name = "COL"/>
<!-- katapusan sa gisulat -->
fu6tfoj1c7tgb43koa6t0qp13wyyqva
37019519
37019518
2026-05-01T14:00:29Z
~2026-26632-15
142617
/* */
37019519
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Xenogale naso''
| status = LC
| image =
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = [[Xenogale]]
| species = '''Xenogale naso'''
| binomial = Xenogale naso
| binomial_authority = de Winton, 1901
| range_map = Long-nosed Mongoose area.png
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms =
| status_ref = <ref name = "iucn"/>
| status_system = iucn3.1 }}
Kaliwatan sa [[mamipero]] ang '''''Xenogale naso'''''<ref name = "COL"/>. Una ning gihulagway ni De Winton ni adtong 1901.<ref name = "col35491763"/> Ang ''Herpestes naso'' sakop sa [[kahenera]] nga ''[[Xenogale]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/><ref name = "source"/> Giklaseklase sa [[IUCN]] ang kaliwatan sa [[kinaminosang kalabotan]].<ref name = "iucn"/>
Kini nga matang hayop na sabwag sa:
* [[Aprika]]
Walay nalista nga matang nga sama niini.<ref name = "COL"/>
<!-- katapusan sa gisulat -->
1ltxugrrfd9cm5hnyermloq03g5k0ec
37019521
37019519
2026-05-01T14:13:31Z
~2026-26632-15
142617
37019521
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Xenogale naso''
| status = LC
| image =Long-nosed mongoose (without bg).png
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = [[Xenogale]]
| species = '''Xenogale naso'''
| binomial = Xenogale naso
| binomial_authority = de Winton, 1901
| range_map = Long-nosed Mongoose area.png
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms =
| status_ref = <ref name = "iucn"/>
| status_system = iucn3.1 }}
Kaliwatan sa [[mamipero]] ang '''''Xenogale naso'''''<ref name = "COL"/>. Una ning gihulagway ni De Winton ni adtong 1901.<ref name = "col35491763"/> Ang ''Herpestes naso'' sakop sa [[kahenera]] nga ''[[Xenogale]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/><ref name = "source"/> Giklaseklase sa [[IUCN]] ang kaliwatan sa [[kinaminosang kalabotan]].<ref name = "iucn"/>
Kini nga matang hayop na sabwag sa:
* [[Aprika]]
Walay nalista nga matang nga sama niini.<ref name = "COL"/>
<!-- katapusan sa gisulat -->
ksie6adn1io3mqs9e0vfrtemscaxt35
37019522
37019521
2026-05-01T14:17:53Z
~2026-26632-15
142617
/* */
37019522
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Xenogale naso''
| status = LC
| image =Long-nosed mongoose (without bg).png
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = [[Xenogale]]
| species = '''Xenogale naso'''
| binomial = Xenogale naso
| binomial_authority = de Winton, 1901
| range_map = Long-nosed Mongoose area.png
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms =
| status_ref = <ref name = "iucn"/>
| status_system = iucn3.1 }}
Kaliwatan sa [[mamipero]] ang '''''Xenogale naso'''''<ref name = "COL"/>. Una ning gihulagway ni De Winton ni adtong 1901.<ref name = "col35491763"/> Ang ''Herpestes naso'' sakop sa [[kahenera]] nga ''[[Xenogale]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/><ref name = "source"/> Giklaseklase sa [[IUCN]] ang kaliwatan sa [[kinaminosang kalabotan]].<ref name = "iucn"/>
Kini nga matang hayop na sabwag sa:
* [[Aprika]]
Walay nalista nga matang nga sama niini.<ref name = "COL"/>
<!-- katapusan sa gisulat -->
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 35491763|accessdate= 2019-11-11}}</ref>
<ref name = "col35491763">Wilson, Don E., and DeeAnn M. Reeder, eds. (2005) , Mammal Species of the World: A Taxonomic and Geographic Reference, 3rd ed., vols. 1 & 2</ref>
<ref name = "source">Tom Orrell (custodian), Dave Nicolson (ed). (2019). ITIS Global: The Integrated Taxonomic Information System (version Jun 2017). In: Species 2000 & ITIS Catalogue of Life, 2019 Annual Checklist (Roskov Y., Ower G., Orrell T., Nicolson D., Bailly N., Kirk P.M., Bourgoin T., DeWalt R.E., Decock W., Nieukerken E. van, Zarucchi J., Penev L., eds.). Digital resource at www.catalogueoflife.org/annual-checklist/2019. Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X.</ref>
<ref name = "iucn">{{IUCN2012.2|assessors= |year= 2008|id= 41615|title= Xenogale naso|downloaded= 24/10/2012}}</ref>
</references>
<gallery>
Long-nosed Mongoose area.png
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Mamipero sa Aprika]]
[[Kategoriya:Xenogale]]
evngzxra8vrbv05w2e9gtxfwhs7f7lk
37019588
37019522
2026-05-01T15:08:16Z
~2026-26632-15
142617
/* */
37019588
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Xenogale naso''
| status = LC
| image =Long-nosed mongoose (without bg).png
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = [[Xenogale]]
| species = '''Xenogale naso'''
| binomial = Xenogale naso
| binomial_authority = de Winton, 1901
| range_map = Long-nosed Mongoose area.png
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms =
| status_ref = <ref name = "iucn"/>
| status_system = iucn3.1 }}
Kaliwatan sa [[mamipero]] ang '''''Xenogale naso'''''<ref name = "COL"/>. Una ning gihulagway ni De Winton ni adtong 1901.<ref name = "col35491763"/> Ang ''Xenogale naso'' sakop sa [[kahenera]] nga ''[[Xenogale]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/><ref name = "source"/> Giklaseklase sa [[IUCN]] ang kaliwatan sa [[kinaminosang kalabotan]].<ref name = "iucn"/>
Kini nga matang hayop na sabwag sa:
* [[Aprika]]
Walay nalista nga matang nga sama niini.<ref name = "COL"/>
<!-- katapusan sa gisulat -->
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 35491763|accessdate= 2019-11-11}}</ref>
<ref name = "col35491763">Wilson, Don E., and DeeAnn M. Reeder, eds. (2005) , Mammal Species of the World: A Taxonomic and Geographic Reference, 3rd ed., vols. 1 & 2</ref>
<ref name = "source">Tom Orrell (custodian), Dave Nicolson (ed). (2019). ITIS Global: The Integrated Taxonomic Information System (version Jun 2017). In: Species 2000 & ITIS Catalogue of Life, 2019 Annual Checklist (Roskov Y., Ower G., Orrell T., Nicolson D., Bailly N., Kirk P.M., Bourgoin T., DeWalt R.E., Decock W., Nieukerken E. van, Zarucchi J., Penev L., eds.). Digital resource at www.catalogueoflife.org/annual-checklist/2019. Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X.</ref>
<ref name = "iucn">{{IUCN2012.2|assessors= |year= 2008|id= 41615|title= Xenogale naso|downloaded= 24/10/2012}}</ref>
</references>
<gallery>
Long-nosed Mongoose area.png
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Mamipero sa Aprika]]
[[Kategoriya:Xenogale]]
3xb9gdnn8p5caxewab7ynmagsxi5udf
Plantilya:Collapse top/styles.css
10
11353899
37019548
2026-05-01T14:36:56Z
Exec8
10305
.
37019548
sanitized-css
text/css
/* {{pp-template}} */
.cot-header-mainspace {
background:#F0F2F5;
color:inherit;
}
.cot-header-other {
background:#CCFFCC;
color:inherit;
}
@media screen {
html.skin-theme-clientpref-night .cot-header-mainspace {
background:#14181F;
color:inherit;
}
html.skin-theme-clientpref-night .cot-header-other {
background:#003500;
color:inherit;
}
}
@media screen and (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os .cot-header-mainspace {
background:#14181F;
color:inherit;
}
html.skin-theme-clientpref-os .cot-header-other {
background:#003500;
color:inherit;
}
}
3dmy4gvp7pqjgd52ssrwtrpf96lg1jj
Plantilya:Collapse top/TemplateData
10
11353900
37019549
2026-05-01T14:38:33Z
Exec8
10305
.
37019549
wikitext
text/x-wiki
==TemplateData==
{{TemplateData header}}
<templatedata>
{
"params": {
"1": {
"aliases": [
"title",
"heading",
"header",
"reason",
"result"
],
"label": "Title",
"description": "Main title of collapsed box",
"example": "This is the title text",
"required": true
},
"2": {
"label": "Custom warning line",
"description": "Will override the standard warning line, and make the 'warning' parameter unnecessary",
"example": "This is a custom warning line",
"type": "string"
},
"indent": {
"description": "Indents the box from the left of the page",
"type": "unknown",
"autovalue": "0px"
},
"expand": {
"aliases": [
"collapse"
], "description": "Using expand=yes or collapse=no will leave the material uncollapsed with the border and coloring",
"example": "true",
"type": "string",
"autovalue": ""
},
"border": {
"label": "Border width (px)",
"description": "Sets the width of the border line on the collapsed material",
"example": "2px",
"default": "1px",
"autovalue": ""
},
"b-color": {
"label": "Border color",
"description": "Sets the border color",
"example": "#F0F2F5",
"default": "Silver"
},
"width": {
"label": "Template width (px or %)",
"description": "Sets the width of the overall template",
"example": "50%"
},
"bg": {
"label": "Collapsed material background color",
"description": "Sets the background color of the collapsed material",
"example": "#F0F2F5",
"default": "#CFC"
},
"left": {
"label": "Alight along the left margin (true or blank)",
"description": "Will align the 'parameter 1 title' along the left margin",
"example": "true",
"type": "string"
},
"fc": {
"label": "Title font color",
"description": "Sets the font color of the title of the collapsible bar",
"example": "#F0F2F5",
"default": "Black"
},
"warning": {
"label": "Warning (true or blank)",
"description": "Will display a default warning line under the main title which reads \"The following is a closed debate. Please do not modify it.\"",
"example": "true"
},
"border2": {
"label": "Expanded box border size & color",
"description": "Sets the border of the box that appears when template is expanded",
"example": "2px",
"default": "1px silver"
},
"padding": {
"label": "Padding (px)",
"description": "Sets the padding on the collapsed material in the colored area",
"example": "16px",
"default": "8px"
},
"bg2": {
"label": "Expanded box color",
"description": "Sets background of the box that appears when template is expanded",
"example": "#F0F2F5",
"default": "white"
}
},
"description": "Use in conjunction with {{Collapse bottom}}. Will collapse text in between the two templates."
}
</templatedata>
4j8i4nfojmsk8wp59bzenrbqtyi5sdr
Plantilya:Navbox with collapsible groups
10
11353901
37019550
2026-05-01T14:39:29Z
Exec8
10305
.
37019550
wikitext
text/x-wiki
{{#invoke:Navbox|with collapsible groups}}<noinclude>
{{documentation}}
</noinclude>
0et0dat8y10f19rcple250dan4w781r
Coendou mexicanus
0
11353902
37019560
2026-05-01T14:44:58Z
~2026-26632-15
142617
Created page with "{{paghimo ni bot|Lsjbot|mangungutkut|date=2020-10}} {{Taxobox | name = ''Coendou mexicanus'' | status = LC | image = mexican-hairy-porcupine-1.jpg | image_caption = | domain = | regnum = [[Animalia]] | phylum = [[Maybukobuko (mananap)|Chordata]] | classis = [[Mammalia]] | ordo = [[Mangungutkut|Rodentia]] | familia = [[Erethizontidae]] | genus = [[Coendou]] | species = '''Coendou mexicanus''' | binomial = Coendou mexicanus | binomial_authority = ([[Kerr (awtor)|Kerr]],..."
37019560
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mangungutkut|date=2020-10}}
{{Taxobox
| name = ''Coendou mexicanus''
| status = LC
| image = mexican-hairy-porcupine-1.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Mangungutkut|Rodentia]]
| familia = [[Erethizontidae]]
| genus = [[Coendou]]
| species = '''Coendou mexicanus'''
| binomial = Coendou mexicanus
| binomial_authority = ([[Kerr (awtor)|Kerr]], 1792)
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms =
| status_ref = <ref name = "iucn"/>
| status_system = iucn3.1 }}
Kaliwatan sa [[mangungutkut]] ang '''''Coendou mexicanus'''''<ref name = "COL"/>. Una ning gihulagway ni [[Kerr (awtor)|Kerr]] ni adtong 1792.<ref name = "col35490790"/> Ang ''Coendou mexicanus'' sakop sa [[kahenera]] nga ''[[Coendou]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Erethizontidae]].<ref name = "COL"/><ref name = "source"/> Giklaseklase sa [[IUCN]] ang kaliwatan sa [[kinaminosang kalabotan]].<ref name = "iucn"/>
Kini nga matang hayop na sabwag sa:
* [[Amerika Sentral]]
csa2mc3zptwknu6maljit52iihmhl37
Plantilya:Protection pollock
10
11353903
37019561
2026-05-01T14:45:09Z
Exec8
10305
.
37019561
wikitext
text/x-wiki
{{#invoke:Protection banner|main}}<noinclude>
{{documentation}}
</noinclude>
8rt1snyv5yit3jnuzrbl00negaj27e5
Plantilya:Tfm/dated
10
11353904
37019566
2026-05-01T14:53:36Z
Exec8
10305
.
37019566
wikitext
text/x-wiki
{{ {{{|safesubst:}}}#invoke:Unsubst||type= |page= |link= |help= |$B={{#ifeq:{{{bigbox|<noinclude>yes</noinclude>}}}|yes|{{#invoke:Message box|ombox
|type = move
|image = none
|class = nomobile mbox-tfd
|small = {{{small|no}}}
|text = This {{#ifeq:{{lc:{{{type}}}}}|module|[[Help:Module|module]]|[[Help:Template|template]]}} is '''being considered for merging with [[{{#ifeq:{{lc:{{{type}}}}}|module|Module|Template}}:{{{otherpage}}}]].''' Please discuss this matter at [[{{{link}}}|'''this {{#ifeq:{{lc:{{{type}}}}}|module|module|template}}'s entry''']] at templates for discussion to help reach a consensus.
{{#ifeq:{{{help}}}|off||----
''<small class="plainlinks" style="line-height:1.3em;">[[Wikipedia:Maintenance|Maintenance]] use only:<br />1. [{{fullurl:{{{link}}}|action=edit&editintro=Wikipedia:Templates_for_discussion/editnotice§ion=1}} Edit the TfD log] to create the discussion entry.<br />2. Please consider notifying the [{{fullurl:{{FULLPAGENAME}}|action=history}} author(s)] by placing <span class="nowrap">{{#Invoke:Template link general|main|code=on|Tfmnotice|{{{page}}}|{{{otherpage}}}|subst=yes}} <nowiki>~~~~</nowiki></span> on their talk page(s).</small>''
}}}}{{#invoke:Category handler|main
| all = [[Category:Templates for merging]]
| nocat = {{{nocat|{{#ifeq:{{Template:FULLBASEPAGENAME|{{FULLBASEPAGENAME}}}}|Template:Tfm|true}}}}}
| category2 = {{{category|¬}}}
}}|{{#switch:{{lc:{{{type}}}}}
|tiny = <templatestyles src="Template:Template for discussion/styles.css" /><span class="noprint tfd tfd-dated tfd-tiny {{#ifeq:{{{dedup|}}}|no||tfd-dedup}}">[[{{{link}}}|‹See TfM›]]</span>
|inline = <templatestyles src="Template:Template for discussion/styles.css" /><span class="noprint tfd tfd-dated tfd-inline {{#ifeq:{{{dedup|}}}|no||tfd-dedup}}">‹The [[Help:Template|template]] <i>[[Template:{{{page}}}|{{{page}}}]]</i> is being [[{{{link}}}|considered for merging]].›</span>
|infobox|box|sidebar = <templatestyles src="Template:Template for discussion/styles.css" /><div class="boilerplate metadata plainlinks tfd tfd-dated tfd-sidebar {{#ifeq:{{{dedup|}}}|no||tfd-dedup}}">‹ The [[Help:Template|template]] ''[[Template:{{{page}}}|{{{page}}}]]'' is being [[{{{link}}}|considered for merging]]. ›</div>
|disabled = <noinclude><!-- No output --></noinclude>
|#default = <templatestyles src="Template:Template for discussion/styles.css" /><div class="boilerplate metadata plainlinks tfd tfd-dated tfd-default {{#ifeq:{{{dedup|}}}|no||tfd-dedup}}">‹ The [[Help:Template|template]] below (''[[Template:{{{page}}}|{{{page}}}]]'') is being considered for merging{{#if:{{{otherpage|}}}| with {{{otherpage|}}}}}. See [[{{{link}}}|templates for discussion]] to help reach a consensus. ›</div>
}}}}}}<noinclude>
{{Documentation}}
</noinclude>
k6fcrasuvahj76euwu5z8ehpniak3rg
Module:InfoboxImage/data
828
11353905
37019569
2026-05-01T14:57:11Z
Exec8
10305
.
37019569
Scribunto
text/plain
local placeholderList = {
"Blue - Replace this image female.svg",
"Blue - Replace this image male.svg",
"Flag of None (square).svg",
"Flag of None.svg",
"Flag of.svg",
"Green - Replace this image female.svg",
"Green - Replace this image male.svg",
"Image is needed female.svg",
"Image is needed male.svg",
"Location map of None.svg",
"Male no free image yet.png",
"Missing flag.png",
"No flag.svg",
"No free portrait.svg",
"No portrait (female).svg",
"No portrait (male).svg",
"Red - Replace this image female.svg",
"Red - Replace this image male.svg",
"Replace this image female.svg",
"Replace this image male (blue).svg",
"Replace this image male.svg",
"Silver - Replace this image female.svg",
"Silver - Replace this image male.svg",
"Replace this image.svg",
"Cricket no pic.png",
"CarersLogo.gif",
"Diagram Needed.svg",
"Example.jpg",
"Image placeholder.png",
"No male portrait.svg",
"Nocover-upload.png",
"NoDVDcover copy.png",
"Noribbon.svg",
"No portrait-BFD-test.svg",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Sin bandera.svg",
"Sin escudo.svg",
"Replace this image - temple.png",
"Replace this image butterfly.png",
"Replace this image.svg",
"Replace this image1.svg",
"Resolution angle.png",
"Image-No portrait-text-BFD-test.svg",
"Insert image here.svg",
"No image available.png",
"NO IMAGE YET square.png",
"NO IMAGE YET.png",
"No Photo Available.svg",
"No Screenshot.svg",
"No-image-available.jpg",
"Null.png",
"PictureNeeded.gif",
"Place holder.jpg",
"Unbenannt.JPG",
"UploadACopyrightFreeImage.svg",
"UploadAnImage.gif",
"UploadAnImage.svg",
"UploadAnImageShort.svg",
"CarersLogo.gif",
"Diagram Needed.svg",
"No male portrait.svg",
"NoDVDcover copy.png",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Noimage.gif",
}
local placeholder_image = {}
for _, val in ipairs(placeholderList) do
placeholder_image[val] = true
end
local categories = {
url_image_links = "[[Category:Pages using infoboxes with URL in image parameter]]",
thumbnail_images = "[[Category:Pages using infoboxes with thumbnail images]]",
}
return { placeholder_image = placeholder_image, categories = categories }
4h39dpz9m6jxmu0vznaup0kyz6rbh4y
Module:Entrypoint
828
11353906
37019593
2026-05-01T15:11:42Z
Exec8
10305
.
37019593
Scribunto
text/plain
--- Entrypoint templating wrapper for Scribunto packages.
-- The module generates an entrypoint function that can execute Scribunto
-- package calls in the template context. This allows a package to support
-- both direct and template invocations.
--
-- @script entrypoint
-- @release beta
-- @author [[wikia:dev:User:8nml|8nml]] (Fandom Dev Wiki)
-- @param {table} package Scribunto package.
-- @error[85] {string} 'you must specify a function to call'
-- @error[91] {string} 'the function you specified did not exist'
-- @error[opt,95] {string} '$2 is not a function'
-- @return {function} Template entrypoint - @{main}.
-- @note Parent frames are not available in Entrypoint's
-- `frame`. This is because recursive (grandparent)
-- frame access is impossible in legacy Scribunto
-- due to [[mw:Manual:Parser#Empty-argument expansion
-- cache|empty-argument expansion cache]] limitations.
-- @note As Entrypoint enables template access rather than
-- a new extension hook, it does not work with named
-- numeric parameters such as `1=` or `2=`. This may
-- result in unexpected behaviour such as Entrypoint
-- and module errors.
--- Stateless, sequential Lua iterator.
-- @function inext
-- @param {table} t Invariant state to loop over.
-- @param {number} i Control variable (current index).
-- @return[opt] {number} Next index.
-- @return[opt] {number|string|table|boolean} Next value.
-- @see https://github.com/lua/lua/blob/v5.1.1/lbaselib.c#L247
local inext = select(1, ipairs{})
--- Check for MediaWiki version 1.25.
-- The concurrent Scribunto release adds a type check for package functions.
-- @variable {boolean} func_check
-- @see [[mw:MediaWiki 1.24/wmf7#Scribunto]]
local func_check = tonumber(mw.site.currentVersion:match('^%d+.%d+')) >= 1.25
--- MediaWiki error message getter.
-- Mimics Scribunto error formatting for script errors.
-- @function msg
-- @param {string} key MediaWiki i18n message key.
-- @param[opt] {string} fn_name Name of package function.
-- @return {string} Formatted lowercase message.
-- @local
local function msg(key, fn_name)
return select(1, mw.message.new(key)
:plain()
:match(':%s*(.-)[.۔。෴։።]?$')
:gsub('^.', mw.ustring.lower)
:gsub('$2', fn_name or '$2')
)
end
--- Template entrypoint function generated by this module.
-- @function main
-- @param {Frame} frame Scribunto frame in module context.
-- @return {string} Module output in template context.
return function(package) return function(f)
local frame = f:getParent()
local args_mt = {}
local arg_cache = {}
args_mt.__pairs = function()
return next, arg_cache, nil
end
args_mt.__ipairs = function()
return inext, arg_cache, 0
end
args_mt.__index = function(t, k)
return arg_cache[k]
end
for key, val in pairs(frame.args) do
arg_cache[key] = val
end
local fn_name = table.remove(arg_cache, 1)
f.args = setmetatable({}, args_mt)
frame.args = setmetatable({}, args_mt)
if not fn_name then
error(msg('scribunto-common-nofunction'))
end
fn_name = mw.text.trim(fn_name)
if not package[fn_name] then
error(msg('scribunto-common-nosuchfunction', fn_name))
end
if func_check and type(package[fn_name]) ~= 'function' then
error(msg('scribunto-common-notafunction', fn_name))
end
return package[fn_name](frame)
end end
l7xohd37g14pkh4rq39hdb3rm65nejf
Module:Fallbacklist
828
11353907
37019594
2026-05-01T15:12:03Z
Exec8
10305
.
37019594
Scribunto
text/plain
--- Language fallback rules for other Lua modules.
-- @see [[c:Module:Fallbacklist]]
-- @release stable
-- @submodule
return {
-- crh (Crimean Tatar) cluster: crh-cyrl , crh-latn -> crh (Crimean Tatar)
['crh'] = {'crh-latn'},
['crh-cyrl'] = {'crh', 'ru'},
['crh-latn'] = {'crh'},
-- de (German) cluster:
['als'] = {'gsw', 'de'}, -- Alemannisch
['bar'] = {'de'}, -- Bavarian
['de-at'] = {'de'}, -- Austrian German
['de-ch'] = {'de'}, -- Swiss High German
['de-formal'] = {'de'}, -- German (formal address)
['dsb'] = {'de'}, -- Lower Sorbian
['frr'] = {'de'}, -- Northern Frisian
['hsb'] = {'de'}, -- Upper Sorbian
['ksh'] = {'de'}, -- Colognian
['lb'] = {'de'}, -- Luxembourgish
['nds'] = {'nds-nl', 'de'}, -- Low German
['nds-nl'] = {'nds', 'nl'}, -- Low Saxon (Netherlands)
['pdc'] = {'de'}, -- Deitsch
['pdt'] = {'nds', 'de'}, -- Plautdietsch
['pfl'] = {'de'}, -- Pälzisch
['sli'] = {'de'}, -- Lower Silesian
['stq'] = {'de'}, -- Seeltersk
['vmf'] = {'de'}, -- Upper Franconian
-- es (Spanish) cluster
['an'] = {'es'}, -- Aragonese
['arn'] = {'es'}, -- Mapuche
['ay'] = {'es'}, -- Aymara
['cbk-zam'] = {'es'}, -- Chavacano de Zamboanga
['gn'] = {'es'}, -- Guarani
['lad'] = {'es'}, -- Ladino
['nah'] = {'es'}, -- Nahuatl
['qu'] = {'es'}, -- Quechua
['qug'] = {'qu', 'es'}, -- Runa shimi
-- et (Estonian) cluster
['liv'] = {'et'}, -- Līvõ kēļ
['vep'] = {'et'}, -- Veps
['vro'] = {'et'}, -- Võro
['fiu-vro'] = {'vro', 'et'}, -- Võro
-- fa (Persian) cluster
['bcc'] = {'fa'}, -- Southern Balochi
['bqi'] = {'fa'}, -- Bakhtiari
['glk'] = {'fa'}, -- Gilaki
['mzn'] = {'fa'}, -- Mazandarani
-- fi (Finnish) cluster:
['fit'] = {'fi'}, -- meänkieli
['vot'] = {'fi'}, -- Votic
-- fr (French) cluster:
['bm'] = {'fr'}, -- Bambara
['br'] = {'fr'}, -- Breton
['co'] = {'fr'}, -- Corsican
['ff'] = {'fr'}, -- Fulah
['frc'] = {'fr'}, -- Cajun French
['frp'] = {'fr'}, -- Franco-Provençal
['ht'] = {'fr'}, -- Haitian
['ln'] = {'fr'}, -- Lingala
['mg'] = {'fr'}, -- Malagasy
['pcd'] = {'fr'}, -- Picard
['sg'] = {'fr'}, -- Sango
['ty'] = {'fr'}, -- Tahitian
['wa'] = {'fr'}, -- Walloon
['wo'] = {'fr'}, -- Wolof
-- hi (Hindi) cluster
['anp'] = {'hi'}, -- Angika
['mai'] = {'hi'}, -- Maithili
['sa'] = {'hi'}, -- Sanskrit
-- hif (Fiji Hindi) cluster: hif-deva , hif-latn -> hif (Fiji Hindi)
['hif'] = {'hif-latn'},
['hif-deva'] = {'hif'},
['hif-latn'] = {'hif'},
-- id (Indonesian) cluster
['min'] = {'id'}, -- Minangkabau
['ace'] = {'id'}, -- Achinese
['bug'] = {'id'}, -- Buginese
['bjn'] = {'id'}, -- Banjar
['jv'] = {'id'}, -- Javanese
['su'] = {'id'}, -- Sundanese
['map-bms'] = {'jv', 'id'}, -- Basa Banyumasan
-- ike (Eastern Canadian Inuktitut) cluster: ike-cans , ike-latn -> ike (Eastern Canadian Inuktitut)
['ike-cans'] = {'ik'},
['ike-latn'] = {'ik'},
-- it (Italian) cluster
['egl'] = {'it'}, -- Emiliàn
['eml'] = {'it'}, -- Emiliano-Romagnolo
['fur'] = {'it'}, -- Friulian
['lij'] = {'it'}, -- Ligure
['lmo'] = {'it'}, -- lumbaart
['nap'] = {'it'}, -- Neapolitan
['pms'] = {'it'}, -- Piedmontese
['rgn'] = {'it'}, -- Romagnol
['scn'] = {'it'}, -- Sicilian
['vec'] = {'it'}, -- vèneto
-- kk (Kazakh) cluster:
-- kk-arab , kk-cyrl , kk-latn , kk-cn , kk-kz , kk-tr -> kk (Kazakh)
['kk'] = {'kk-cyrl'}, -- Kazakh
['kk-arab'] = {'kk-cyrl', 'kk'}, -- Kazakh (Arabic script)
['kk-cn'] = {'kk-arab', 'kk-cyrl', 'kk'}, -- Kazakh (China)
['kk-cyrl'] = {'kk'}, -- Kazakh (Cyrillic script)
['kk-kz'] = {'kk', 'kk-cyrl'}, -- Kazakh (Kazakhstan)
['kk-latn'] = {'kk-cyrl', 'kk'}, -- Kazakh (Latin script)
['kk-tr'] = {'kk-latn', 'kk-cyrl', 'kk'}, -- Kazakh (Turkey)
['kaa'] = {'kk-latn', 'kk-cyrl'}, -- Kara-Kalpak
-- ku (Kurdish) cluster: ku-latn , ku-arab -> ku (Kurdish)
['ku'] = {'ku-latn'},
['ku-arab'] = {'ckb', 'ckb-arab', 'ku'}, -- كوردي (عەرەبی)
['ku-latn'] = {'ku'},
['ckb'] = {'ckb-arab', 'ku'},
-- nl (Dutch) cluster
['af'] = {'nl'}, -- Afrikaans
['fy'] = {'nl'}, -- Western Frisian
['li'] = {'nl'}, -- Liechtenstein
['nl-informal'] = {'nl'}, -- Nederlands (informeel)
['vls'] = {'nl'}, -- Vlaams
['zea'] = {'nl'}, -- Zeeuws
--pl (Polish) cluster
['csb'] = {'pl'}, -- Kashubian
['szl'] = {'pl'}, -- Silesian
-- pt (Portuguese) cluster
['gl'] = {'pt'}, -- Galician
['mwl'] = {'pt'}, -- Mirandese
['pt-br'] = {'pt'}, -- Brazilian Portuguese
-- ro (Romanian) cluster
['mo'] = {'ro'}, -- Moldavian
['rmy'] = {'ro'}, -- Romani
-- ru (Russian) cluster
['ab'] = {'ru'}, -- Abkhazian
['av'] = {'ru'}, -- Avaric
['ba'] = {'ru'}, -- Bashkir
['be-tarask'] = {'ru'}, -- Belorussian
['ce'] = {'ru'}, -- Chechen
['crh-cyrl'] = {'ru'}, -- Crimean Tatar (Cyrillic script)
['cv'] = {'ru'}, -- Chuvash
['inh'] = {'ru'}, -- Ingush
['koi'] = {'ru'}, -- Komi-Permyak
['krc'] = {'ru'}, -- Karachay-Balkar
['kv'] = {'ru'}, -- Komi
['lbe'] = {'ru'}, -- лакку
['lez'] = {'ru'}, -- Lezghian
['mhr'] = {'ru'}, -- Eastern Mari
['mrj'] = {'ru'}, -- Hill Mari
['myv'] = {'ru'}, -- Erzya
['os'] = {'ru'}, -- Ossetic
['rue'] = {'uk', 'ru'}, -- Rusyn
['sah'] = {'ru'}, -- Sakha
['tt'] = {'tt-cyrl', 'ru'}, -- Tatar
['tt-cyrl'] = {'ru'}, -- Tatar (Cyrillic script)
['udm'] = {'ru'}, -- Udmurt
['uk'] = {'ru'}, -- Ukranian
['xal'] = {'ru'}, -- Kalmyk
['tt'] = {'tt-cyrl', 'ru'}, -- Tatar
-- ruq (Megleno Romanian) cluster: ruq-cyrl , ruq-grek , ruq-latn -> ruq (Megleno Romanian)
['ruq'] = {'ruq-latn', 'ro'}, -- Megleno-Romanian
['ruq-cyrl'] = {'ruq', 'mk'}, -- Megleno-Romanian (Cyrillic script)
['ruq-grek'] = {'ruq'}, -- Megleno-Romanian (Greek script)
['ruq-latn'] = {'ro', 'ruq'}, -- Megleno-Romanian (Latin script)
-- sr (Serbian) cluster: sr-ec , sr-el -> sr (Serbian)
['sr'] = {'sr-ec'},
['sr-ec'] = {'sr'},
['sr-el'] = {'sr'},
-- tg (Tajik) cluster: tg-cyrl , tg-latn -> tg (Tajik)
['tg'] = {'tg-cyrl'},
['tg-cyrl'] = {'tg'},
['tg-latn'] = {'tg'},
-- tr (Turkish) cluster
['gag'] = {'tr'}, -- Gagauz
['kiu'] = {'tr'}, -- Kirmanjki
['lzz'] = {'tr'}, -- Lazuri
-- tt (Tatar) cluster: tt-cyrl , tt-latn -> tt (Tatar)
['tt-cyrl'] = {'tt'},
['tt-latn'] = {'tt'},
-- zh (Chinese) cluster
-- /includes/language/converters/ZhConverter.php
-- https://gerrit.wikimedia.org/r/703560
['cdo'] = {'nan', 'zh-hant', 'zh', 'zh-hans'}, -- Min Dong Chinese
['gan'] = {'gan-hant', 'gan-hans', 'zh-hant', 'zh-hans', 'zh'}, -- Gan
['gan-hans'] = {'gan', 'gan-hant', 'zh-hans', 'zh', 'zh-hant'}, -- Simplified Gan script
['gan-hant'] = {'gan', 'gan-hans', 'zh-hant', 'zh', 'zh-hans'}, -- Traditional Gan script
['hak'] = {'zh-hant', 'zh', 'zh-hans'}, -- Hakka
['ii'] = {'zh-cn', 'zh-hans', 'zh', 'zh-hant'}, -- Sichuan Yi
['lzh'] = {'zh-hant', 'zh', 'zh-hans'}, -- Literary Chinese
['nan'] = {'cdo', 'zh-hant', 'zh', 'zh-hans'}, -- Min Nan Chinese
['szy'] = {'zh-tw', 'zh-hant', 'zh', 'zh-hans'}, -- Sakizaya
['tay'] = {'zh-tw', 'zh-hant', 'zh', 'zh-hans'}, -- Atayal
['trv'] = {'zh-tw', 'zh-hant', 'zh', 'zh-hans'}, -- Seediq
['wuu'] = {'zh-hans', 'zh-hant', 'zh'}, -- Wu
-- https://phabricator.wikimedia.org/T59138
-- ['wuu'] = {'wuu-hans, 'wuu-hant', 'zh-hans', 'zh-hant', 'zh'}, -- Wu
-- ['wuu-hans'] = {'wuu', 'wuu-hant', 'zh-hans', 'zh', 'zh-hant'}, -- Simplified Wu
-- ['wuu-hant'] = {'wuu', 'wuu-hans', 'zh-hant', 'zh', 'zh-hans'}, -- Traditional Wu
['yue'] = {'zh-hk', 'zh-hant', 'zh-hans', 'zh'}, -- Cantonese
-- https://phabricator.wikimedia.org/T59106
-- ['yue'] = {'yue-hant', 'yue-hans, 'zh-hk', 'zh-hant', 'zh-hans', 'zh'}, -- Cantonese
-- ['yue-hans'] = {'yue', 'yue-hant', 'zh-hans', 'zh', 'zh-hk', 'zh-hant'}, -- Simplified Cantonese
-- ['yue-hant'] = {'yue', 'yue-hans', 'zh-hk', 'zh-hant', 'zh', 'zh-hans'}, -- Traditional Cantonese
['za'] = {'zh-hans', 'zh-hant', 'zh'}, -- Zhuang
-- The time allocated for running scripts has expired.
-- ['zh'] = {'zh-hans', 'zh-hant', 'zh-cn', 'zh-tw', 'zh-hk'}, -- Chinese
-- ['zh-hans'] = {'zh-cn', 'zh', 'zh-hant'}, -- Simplified Chinese
-- ['zh-hant'] = {'zh-tw', 'zh-hk', 'zh', 'zh-hans'}, -- Traditional Chinese
-- ['zh-tw'] = {'zh-hant', 'zh-hk', 'zh', 'zh-hans'}, -- Chinese (Taiwan)
-- ['zh-hk'] = {'zh-hant', 'zh-tw', 'zh', 'zh-hans'}, -- Chinese (Hong Kong)
['zh'] = {'zh-hans', 'zh-hant', 'zh-hk'}, -- Chinese
['zh-hans'] = {'zh-hant', 'zh-hk'}, -- Simplified Chinese
['zh-hant'] = {'zh-hk', 'zh-hans'}, -- Traditional Chinese
['zh-cn'] = {'zh-hans', 'zh', 'zh-hant'}, -- Chinese (Mainland China)
['zh-sg'] = {'zh-hans', 'zh-cn', 'zh', 'zh-hant'}, -- Chinese (Singapore)
['zh-my'] = {'zh-hans', 'zh-sg', 'zh-cn', 'zh', 'zh-hant'}, -- Chinese (Malaysia)
['zh-tw'] = {'zh-hant', 'zh-hk', 'zh-hans'}, -- Chinese (Taiwan)
['zh-hk'] = {'zh-hant', 'zh-hans'}, -- Chinese (Hong Kong)
['zh-mo'] = {'zh-hant', 'zh-hk', 'zh-tw', 'zh', 'zh-hans'}, -- Chinese (Macau)
['zh-classical'] = {'lzh', 'zh-hant', 'zh', 'zh-hans'}, -- Classical Chinese -> Literary Chinese
['zh-min-nan'] = {'nan', 'cdo', 'zh-hant', 'zh', 'zh-hans'}, -- Chinese (Min Nan) -> Min Nan Chinese
['zh-yue'] = {'yue', 'zh-hk', 'zh-hant', 'zh-hans', 'zh'}, -- Yue Chinese -> Cantonese
------------------------
--------- misc ---------
------------------------
['arz'] = {'ar'}, -- Egyptian Arabic -> Arabic
['azb'] = {'az'}, -- Southern Azerbaijani -> Azerbaijani
['be-x-old'] = {'be-tarask'}, -- be-x-old -> be-tarask (wrong to correct Taraškievica form of Belarusian orthography)
['bh'] = {'bho'}, -- Bihari -> Bhojpuri
['bpy'] = {'bn'}, -- Bishnupria Manipuri -> Bengali
-- da
['jut'] = {'da'}, -- Jutish -> Danish
['kl'] = {'da'}, -- Kalaallisut -> Danish
['en-gb'] = {'en'}, -- Brexit -> English
['yi'] = {'he'}, -- Yiddish -> Hebrew
['iu'] = {'ike-cans'}, -- Inuktitut -> Eastern Canadian (Aboriginal syllabics)
['xmf'] = {'ka'}, -- Mingrelian -> Georgian
['kbd'] = {'kbd-cyrl', 'ru'}, -- Kabardian -> Адыгэбзэ
['tcy'] = {'kn'}, -- Tulu -> Kannada
['ko-kp'] = {'ko'}, -- 한국어 (조선) -> Korean
['ks'] = {'ks-arab'}, -- Kashmiri -> Kashmiri (Arabic script)
-- lt
['bat-smg'] = {'sgs', 'lt'}, -- Samogitian -> Lithuanian
['sgs'] = {'lt'}, -- Samogitian -> Lithuanian
['ltg'] = {'lv'}, -- Latvian -> Latgalian
['dtp'] = {'ms'}, -- Central Dusun -> Malay
['no'] = {'nb'}, -- Norwegian (bokmål) -> Norwegian Bokmål
['roa-rup'] = {'rup'}, -- Aromanian (other Romance) -> Aromanian
['aln'] = {'sq'}, -- Gheg Albanian -> Albanian
['ug'] = {'ug-arab'}, -- Uyghur -> Uyghur (Arabic script)
['khw'] = {'ur'}, -- Khowar -> Urdu
}
puottz3ra6u2ba8av2uuzkxjgvm5n0q
Module:Deprecated
828
11353908
37019597
2026-05-01T15:15:23Z
Exec8
10305
.
37019597
Scribunto
text/plain
--- Marks items as deprecated, and provides a warning when they are called.
--
-- ## Limitations ##
-- This module will not provide a warning if a deprecated item is called from
-- within the same module that this module is used.
--
-- @release alpha
-- @author [[User:Awesome_Aasim|Awesome Aasim]]
-- @function deprecated
-- @param {table} p package frame
-- @param deprecatedTable
-- @return package
return function(p, deprecatedTable, replacement)
local pckg = {}
--- Warn
-- @param {string} text warning text
function warn(text)
local tb = debug.traceback()
mw.log(text .. '\n' .. tb)
mw.addWarning(text .. tb:gsub("\n", "<br/>"):gsub("\t", " "))
end
if deprecatedTable == nil or deprecatedTable == true then
deprecatedTable = {}
for k,_ in pairs(p) do
deprecatedTable[k] = {
deprecated = true,
replacement = replacement or ""
}
end
end
setmetatable(pckg, {
__index = function(t, index)
if deprecatedTable[index] and deprecatedTable[index]["deprecated"] then
warn(
mw.ustring.format(
"Deprecated member <code>%s</code> called. ", index
) .. (
deprecatedTable[index]["replacement"]
and mw.ustring.format("Please %s instead.", deprecatedTable[index]["replacement"])
or ''
)
)
end
return p[index]
end
})
return pckg
end
my1p1xp76qgfnvctx8pevv0cvz0hjyb
Plantilya:PH wikidata/deprecated parameter
10
11353909
37019598
2026-05-01T15:16:02Z
Exec8
10305
.
37019598
wikitext
text/x-wiki
<noinclude>
{{documentation|content=
Articles which transcluded this subtemplate are using [[template:PH wikidata]] using any parameters which are not supported by the template.
}}</noinclude>
glicap6l3bw2xg8ipyitgrxbxm8etbl
Plantilya:Wikidata
10
11353910
37019604
2026-05-01T15:29:02Z
Exec8
10305
.
37019604
wikitext
text/x-wiki
<includeonly>{{safesubst:#invoke:Wd|main}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
aqnmh4azo4jle51xny4knl3b1hl9873
Module:Check for conflicting parameters
828
11353911
37019626
2026-05-01T15:53:34Z
Exec8
10305
.
37019626
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
Plantilya:Template for discussion/styles.css
10
11353912
37019627
2026-05-01T15:54:02Z
Exec8
10305
.
37019627
sanitized-css
text/css
/* {{pp-template|small=yes}} */
/* See [[Template:Tfd/dated]] and [[Template:Tfm/dated]] */
.tfd-dated {
font-size: 85%;
}
.tfd-default {
border-bottom: 1px solid var(--border-color-base, #a2a9b1);
clear: both;
text-align: center;
}
.tfd-tiny {
font-weight: bold;
}
.tfd-inline {
border: 1px solid var(--border-color-base, #a2a9b1);
}
.tfd-sidebar {
border-bottom: 1px solid var(--border-color-base, #a2a9b1);
text-align: center;
position: relative;
}
@media (min-width: 640px) {
.tfd-sidebar {
clear: right;
float: right;
width: 22em;
}
}
/* Hide all but the first TFD notice in each paragraph */
:not(.mw-parser-output):not(.documentation) > .tfd-dedup ~ .tfd-dedup, :not(.mw-parser-output):not(.documentation) > .tfd-dedup ~ * .tfd-dedup {
display: none;
}
87sijgb207pm0scajvk9vr4wpqetsg7
Module:Noinclude
828
11353913
37019628
2026-05-01T15:54:19Z
Exec8
10305
.
37019628
Scribunto
text/plain
local p = {}
function p.noinclude(frame)
return frame:getParent():preprocess("<noinclude>" .. frame.args.text .. "</noinclude>");
end
return p
46540us5h0lf6rm25j7fyb26bxvq4q9
Module:Settlement short description
828
11353914
37019629
2026-05-01T15:54:36Z
Exec8
10305
.
37019629
Scribunto
text/plain
--generates auto short description for use in infobox settlement
local p = {}
p.categories = ""
local plain = require('Module:Plain text')._main
local getArgs = require('Module:Arguments').getArgs
local tableTools = require ('Module:TableTools')
function p.reverseTable (init)
init[1], init[3] = init[3], init[1]
return init
end
function p.assign (args, argname, num)
local val
local var = {}
for i = 0,num do
--handle initial "subdivision_foo" without number
if i == 0 then
val = ""
else
val = tostring(i)
end
var[i+1] = p.validate(plain(args[argname..val]))
end
return var
end
--Display short description using {{short description}}
function p.shortdesc(text, frame)
return frame:expandTemplate{title = 'Short description', args = {text, 'noreplace'}}
end
function p.category (cattype)
local category = string.format('[[Category:Pages using infobox settlement with bad %s]]', cattype)
if category then p.categories = p.categories..category end --categorize
end
--sanity and other checks
function p.validate (parameter, cat)
if not parameter then return nil end
parameter = parameter:gsub('%b()', '') --remove things in brackets as extraneous information
:gsub('%s+', ' ') --fix possible extra spaces from previous cleanup
:gsub('^%s+', '') --trim spaces from beginning
:gsub('%s+$', '') --trim spaces from end
if parameter:match("[,;]") or not parameter:match("%a") then --must have some letters, ignore if multiple types/subdivisions
if cat then p.category (cat) end
return nil
end
if (parameter == "") then return nil end
return parameter
end
--removes redundancy like "England, United Kingdom" and fixes issues like "Foo in United States" (to "Foo in the United States")
--also used in Module:Type in location
function p.cleanupLoc (location)
if location == "" then return nil end
local replacements = {
["England, United Kingdom"] = "England",
["Scotland, United Kingdom"] = "Scotland",
["Wales, United Kingdom"] = "Wales",
["New York City, New York, United States"] = "New York City",
["^United States$"] = "the United States",
["London, United Kingdom"] = "London, England"
}
for i, v in pairs(replacements) do
location = location:gsub(i, v) --series of replacements
end
return location
end
function p.main(frame)
local categories = ""
local subdivision_types = {}
local subdivision_names = {}
local args = getArgs (frame, {parentOnly = true})
local settlement_type = p.validate(plain(args.settlement_type or args.type), "settlement type") or "Place"
local short_description = plain(args.short_description)
subdivision_types = p.assign(args, "subdivision_type", 2)
subdivision_names = p.assign(args, "subdivision_name", 2)
if short_description then
if (short_description == 'no') then
return
else
local language = mw.language.getContentLanguage()
return p.shortdesc(language:ucfirst(short_description), frame)
end
end
if not(subdivision_names[3] and
(string.find(settlement_type, '[nN]eighbo[u]?rhood') or string.find(settlement_type, '[sS]uburb'))) then
subdivision_names[3] = nil --display the third subdivision_type only if suburb or neighborhood
end
--if say "Voivodeship" is found within the subdivision_type, then specially handle
--by adding Voivodeship to the end if not already present
for x, y in ipairs (subdivision_types) do
local special_types = {
"Voivodeship"
}
for i, j in ipairs(special_types) do
if subdivision_names[x] and string.find(y, j, 1, true)
and not string.find(subdivision_names[x], j, 1, true) then
subdivision_names[x] = subdivision_names[x].." "..j
end
end
end
for x, y in ipairs (subdivision_names) do
if y then
if string.find(settlement_type, y, 1, true) then --if the subdivision is found within the settlement type
subdivision_names[x] = nil --don't display redundancy
p.category ("settlement type")
end
if y == mw.title.getCurrentTitle().text then --if the title is the same as one of the subdivision_names
subdivision_names[x] = nil --don't display redundancy
end
end
end
local location = table.concat(tableTools.compressSparseArray(p.reverseTable(subdivision_names)), ', ')
location = p.cleanupLoc (location)
if location then location = " in " .. location else location = "" end
local language = mw.language.getContentLanguage()
return p.shortdesc(language:ucfirst(settlement_type..location), frame)..p.categories
end
return p
sdmmtzi7bcwz6i491hq96btdkaj2hrz
Plantilya:Fix comma category
10
11353915
37019630
2026-05-01T15:54:54Z
Exec8
10305
Created page with "{{#invoke:String|replace|{{{1}}}|%[%[Category:(.-)from (.-) 2,(.-)%]%]|[[Category:%1 from %2 2%3]]|plain=false}}<noinclude>{{documentation}}</noinclude>"
37019630
wikitext
text/x-wiki
{{#invoke:String|replace|{{{1}}}|%[%[Category:(.-)from (.-) 2,(.-)%]%]|[[Category:%1 from %2 2%3]]|plain=false}}<noinclude>{{documentation}}</noinclude>
m9tezz247zwbvel8aa1xrexdvqx5g08
Plantilya:Infobox location
10
11353916
37019631
2026-05-01T16:01:13Z
Exec8
10305
.
37019631
wikitext
text/x-wiki
<includeonly>{{Infobox settlement
|name = {{{name|{{#invoke:wd|label|{{{qid|}}}}}}}}
|native_name = {{{native_name|}}}
|official_name = {{{official_name|}}}
|settlement_type = {{{settlement_type|{{#invoke:String2|label|{{#invoke:wd|property|linked|{{{qid|}}}|P31}}}}}}}
|image_skyline = {{{image_skyline|{{#invoke:wd|property|raw|best|{{{qid|}}}|P18}}}}}
|image_alt = {{{image_alt|}}}
|image_caption = {{{image_caption|<!--{{#if:{{{image_skyline|}}}|{{{image_caption|}}}|{{#if:{{#invoke:Wikidata|getImageLegend|FETCH_WIKIDATA|id={{{qid|}}}}}|{{#invoke:Wikidata|getImageLegend|FETCH_WIKIDATA|id={{{qid|}}}}}|Image of {{#if:{{{name|}}}|{{{name}}}|{{#invoke:wd|label|{{{qid|}}}}}}}}}}}--> }}}
|image_size = {{{image_size|280px}}}
|image_flag = {{{image_flag|{{#invoke:wd|property|raw|best|{{{qid|}}}|P41}}}}}
|flag_alt = {{{flag_alt|}}}
|flag_size = {{{flag_size|110x80px}}}
|image_seal = {{{image_seal|{{#invoke:wd|property|raw|best|{{{qid|}}}|P158}}}}}
|seal_alt = {{{seal_alt|}}}
|seal_size = {{{seal_size|100x80px}}}
|image_shield = {{{image_shield|{{#if:{{main other|{{#property:P158}}|{{#property:P158|from={{{qid|}}}}}}}||{{#invoke:wd|property|raw|best|{{{qid|}}}|P94}}}}}}}
|shield_alt = {{{shield_alt|}}}
|shield_size = {{{shield_size|100x80px}}}
|nickname = {{{nickname|}}}
|motto = {{{motto|}}}
|image_map = {{{image_map|{{#invoke:wd|property|raw|best|{{{qid|}}}|P242}} }}}
|mapsize = {{{mapsize|280px}}}
|map_alt = {{{map_alt|Lokasyon na {{#invoke:wd|label|{{{qid|}}}}}}}}
|map_caption = {{{map_caption|Lokasyon sa {{#invoke:wd|label|{{{qid|}}}}}}}}
|pushpin_map = {{{pushpin_map|}}}
|pushpin_label_position = {{{pushpin_label_position|}}}
|pushpin_label = {{{pushpin_label|}}}
|pushpin_map_alt = {{{pushpin_map_alt|}}}
|pushpin_mapsize = {{{pushpin_mapsize|280px}}}
|pushpin_relief = {{{pushpin_relief|}}}
|pushpin_map_caption = {{{pushpin_map_caption|}}}
|pushpin_map2 = {{#if:{{{pushpin_map|}}}||{{#if:{{#invoke:Wikidata|pageId}}{{{qid|}}}|{{#tag:mapframe|
[
{
"type": "ExternalData",
"properties": { "fill": "#FF0000", "fill-opacity": 0.1, "stroke": "#FF9999" },
"service": "geoshape",
"ids": "{{{qid|{{#invoke:Wikidata|pageId}}}}}"
},
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [{{#invoke:WikidataIB |getValue |maxvals =1 |P625 |fwd=ALL |osd=no |qid={{{qid|}}} |noicon=true |show=longlat}}] },
"properties": {
"title": "Lokasyon na {{#invoke:wd|label|{{{qid|}}}}}",
"marker-color": "0050d0",
"marker-symbol": "circle-stroked"
}
}
]
|longitude = {{#invoke:WikidataIB |getValue |maxvals =1|P625 |fwd=ALL |osd=no |qid={{{qid|}}}|noicon=true |show=long}}
|latitude = {{#invoke:WikidataIB |getValue |maxvals =1|P625 |fwd=ALL |osd=no |qid={{{qid|}}} |noicon=true |show=lat}}
|zoom = {{{zoom|10}}}
|width = 280
|height = 280
|align = center
|frameless = yes
|lang = {{{lang|}}}
}}|}} }}
|pushpin_map2_coord = {{#if:{{{pushpin_map|}}}|{{coord|{{#invoke:WikidataIB |getValue |maxvals =1|P625 |fwd=ALL |osd=no |qid={{{qid|}}} |noicon=true |show=lat}}|{{#invoke:WikidataIB |getValue |maxvals =1|P625 |fwd=ALL |osd=no |qid={{{qid|}}}|noicon=true |show=long}}}}}}
|coordinates = {{{coordinates|{{#if:{{#invoke:Wikidata|pageId}}{{{qid|}}}|{{coord/display/{{main other|inline,title|inline}}|{{#tag:maplink|
[
{
"type": "ExternalData",
"properties": { "fill": "#FF0000", "fill-opacity": 0.1, "stroke": "#FF9999" },
"service": "geoshape",
"ids": "{{{qid|{{#invoke:Wikidata|pageId}}}}}"
},
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [{{#invoke:WikidataIB |getValue |maxvals =1 |P625 |fwd=ALL |osd=no |qid={{{qid|}}} |noicon=true |show=longlat}}] },
"properties": {
"title": "Lokasyon na {{#invoke:wd|label|{{{qid|}}}}}",
"marker-color": "0050d0",
"marker-symbol": "circle-stroked"
}
}
]
|longitude = {{#invoke:WikidataIB |getValue |maxvals =1|P625 |fwd=ALL |osd=no |qid={{{qid|}}}|noicon=true |show=long}}
|latitude = {{#invoke:WikidataIB |getValue |maxvals =1|P625 |fwd=ALL |osd=no |qid={{{qid|}}} |noicon=true |show=lat}}
|zoom = {{{zoom|10}}}
|lang = {{{lang|}}}
}} }} |}} }}}
|coordinates_footnotes = {{{coordinates_footnotes|{{#ifeq:{{{dateformat}}}|dmy|{{#invoke:wd|references|current|{{{qid|}}}|P625}}|{{#invoke:wd|references|mdy|current|{{{qid|}}}|P625}} }} }}}
|subdivision_type = {{{subdivision_type|Dalin}}}
|subdivision_name = {{{subdivision_name|{{#invoke:wd|property|linked|{{{qid|}}}|P17}}}}}
| parts_type = [[Barangay]]
| parts_style = para
| p1 = {{PH Barangay count | {{wikidata|label|raw}} }}
|established_title = {{{established_title|{{#if:{{main other|{{#property:P571}}|{{#property:P571|from={{{qid|}}}}}}}|Angipaletnegan|}}}}}
|established_date = {{{established_date|{{#ifeq:{{{dateformat}}}|dmy|{{PAGENAMEBASE|{{#invoke:wd|property|{{{qid|}}}|P571}}}}|{{PAGENAMEBASE|{{#invoke:wd|property|mdy|{{{qid|}}}|P571}}}} }} }}}
|seat_type = {{{seat_type|{{#if:{{main other|{{#property:P36}}|{{#property:P36|from={{{qid|}}}}}}}|Kabesera|}}}}}
|seat = {{{seat|{{#if:{{#invoke:wd|property|linked|{{{qid|}}}|P36}}|{{#invoke:wd|property|linked|{{{qid|}}}|P36}}|{{main other|{{#property:P36}}|{{#property:P36|from={{{qid|}}}}}}}}}}}}
|leader_title = {{{leader_title|{{#if:{{main other|{{#property:P6}}|{{#property:P6|from={{{qid|}}}}}}}|{{#if:{{#invoke:String2|label|{{#invoke:wd|property|linked|{{{qid|}}}|P1313}}}}|{{#invoke:String2|label|{{#invoke:wd|property|linked|{{{qid|}}}|P1313}}}}|Pangulo}}}}}}}
|leader_name = {{#property:P6}}
|area_footnotes = {{{area_footnotes|{{#ifeq:{{{dateformat}}}|dmy|{{#invoke:wd|references|current|{{{qid|}}}|P2046}}|{{#invoke:wd|references|mdy|current|{{{qid|}}}|P2046}} }} }}}
|area_total_km2 = {{{area_total_km2|{{#if:{{main other|{{#property:P2046}}|{{#property:P2046|from={{{qid|}}}}}}}|{{#ifeq:{{#invoke:Wikidata|getUnits|qid={{{qid|}}}|P2046|FETCH_WIKIDATA}}|square meter|{{rnd|{{convert|input={{#invoke:String|replace|{{#invoke:String|replace|{{#invoke:wd|property|{{{qid|}}}|P2046}}| %D+||plain=false}}|±[%d%.][%d%.]*||plain=false}} m2|km2|disp=output number only|comma=off}}|2}}|{{#ifeq:{{#invoke:Wikidata|getUnits|qid={{{qid|}}}|P2046|FETCH_WIKIDATA}}|square kilometer|{{rnd|{{convert|input={{#invoke:String|replace|{{#invoke:String|replace|{{#invoke:wd|property|{{{qid|}}}|P2046}}| %D+||plain=false}}|±[%d%.][%d%.]*||plain=false}} km2|km2|disp=output number only|comma=off}}|2}}|{{#invoke:String|replace|{{#invoke:String|replace|{{#invoke:wd|property|{{{qid|}}}|P2046}}| %D+||plain=false}}|±[%d%.][%d%.]*||plain=false}} }} }} }} }}}
|elevation_m = {{{elevation_m|{{#ifexpr:{{#invoke:String|find|{{#invoke:wd|property|raw|best|{{{qid|}}}|P2044}}|foot}}||{{#invoke:String|replace|{{#invoke:string|replace|{{#invoke:wd|property|raw|best|{{{qid|}}}|P2044}}|±[%d%.][%d%.]*||plain=false}}|meter}}}}}}}
|population_footnotes = {{{population_footnotes|{{#ifeq:{{{dateformat}}}|dmy|{{#invoke:wd|references|{{{qid|}}}|P1082|{{formatnum:{{#invoke:wd|property|{{{qid|}}}|P1082}}|R}}}}|{{#invoke:wd|references|mdy|{{{qid|}}}|P1082|{{formatnum:{{#invoke:wd|property|{{{qid|}}}|P1082}}|R}}}} }} }}}
|population_as_of = {{{population_as_of|{{#ifeq:{{{dateformat}}}|dmy|{{#invoke:wd|qualifier|normal+|single|{{{qid|}}}|P1082|P585}}|{{#invoke:wd|qualifier|mdy|normal+|single|{{{qid|}}}|P1082|P585}} }} }}}
|population_total = {{{population_total|{{#invoke:wd|property|current|{{{qid|}}}|P1082}} }}}
|population_density_km2 = {{{population_density_km2|auto}}}
|timezone = {{{timezone|{{#invoke:wd|properties|linked|{{{qid|}}}|P421}}}}}
|postal_code_type = {{{postal_code_type|Kodigo na postal}}}
|postal_code = {{{postal_code|{{#invoke:wd|properties|raw|{{{qid|}}}|P281}}}}}
|area_code = {{{area_code|{{#invoke:wd|properties|raw|{{{qid|}}}|P473}}}}}
|website = {{{website|{{#if:{{main other|{{#property:P856}}|{{#property:P856|from={{{qid|}}}}}}}|{{URL|{{#invoke:wd|property|raw|best|{{{qid|}}}|P856}}}}|}}}}}
| demographics_type1 = {{#if:{{#property:P3087}}| Economia}}
| demographics1_title1 = Klase
| demographics1_info1 = {{#ifeq:{{#property:P1879}}|no value|{{void}}|{{PH wikidata|income_class}}}}
| demographics1_title2 =
| demographics1_info2 =
| demographics1_title3 = Kita
| demographics1_info3 = {{#if:{{#property:P3087}}| {{PH wikidata|revenue}} ({{wikidata|qualifier|single|P3087|P585}})}}
| demographics1_title4 =
| demographics1_info4 =
| demographics1_title5 = Kabtangan
| demographics1_info5 = {{#if:{{#property:P2403}}| {{PH wikidata|assets}} ({{wikidata|qualifier|single|P2403|P585}})}}
| demographics1_title6 =
| demographics1_info6 =
| demographics1_title7 = Utang
| demographics1_info7 = {{#if:{{#property:P2138}}| {{PH wikidata|liabilities}} ({{wikidata|qualifier|single|P2138|P585}})}}
| demographics1_title8 =
| demographics1_info8 =
| demographics1_title9 = Gasto
| demographics1_info9 = {{#if:{{#property:P2402}}| {{PH wikidata|expenditure}} ({{wikidata|qualifier|single|P2402|P585}})}}
| demographics1_title10 =
| demographics1_info10 =
|footnotes = {{{footnotes|{{#if:{{#invoke:Wikidata|pageId}}||{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{error|Pasakbay!}} Data will appear when article is linked to Wikidata.[[Category:Articles using Template:Infobox location not linked to Wikidata]]}}}} }}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
r263sk233ngn7x0a0g62h01y7m32sqg
37019645
37019631
2026-05-01T16:13:06Z
Exec8
10305
.
37019645
wikitext
text/x-wiki
<includeonly>{{Infobox settlement
|name = {{{name|{{#invoke:wd|label|{{{qid|}}}}}}}}
|native_name = {{{native_name|}}}
|official_name = {{{official_name|}}}
|settlement_type = {{{settlement_type|{{#invoke:String2|label|{{#invoke:wd|property|linked|{{{qid|}}}|P31}}}}}}}
|image_skyline = {{{image_skyline|{{#invoke:wd|property|raw|best|{{{qid|}}}|P18}}}}}
|image_alt = {{{image_alt|}}}
|image_caption = {{{image_caption|<!--{{#if:{{{image_skyline|}}}|{{{image_caption|}}}|{{#if:{{#invoke:Wikidata|getImageLegend|FETCH_WIKIDATA|id={{{qid|}}}}}|{{#invoke:Wikidata|getImageLegend|FETCH_WIKIDATA|id={{{qid|}}}}}|Image of {{#if:{{{name|}}}|{{{name}}}|{{#invoke:wd|label|{{{qid|}}}}}}}}}}}--> }}}
|image_size = {{{image_size|280px}}}
|image_flag = {{{image_flag|{{#invoke:wd|property|raw|best|{{{qid|}}}|P41}}}}}
|flag_alt = {{{flag_alt|}}}
|flag_size = {{{flag_size|110x80px}}}
|image_seal = {{{image_seal|{{#invoke:wd|property|raw|best|{{{qid|}}}|P158}}}}}
|seal_alt = {{{seal_alt|}}}
|seal_size = {{{seal_size|100x80px}}}
|image_shield = {{{image_shield|{{#if:{{main other|{{#property:P158}}|{{#property:P158|from={{{qid|}}}}}}}||{{#invoke:wd|property|raw|best|{{{qid|}}}|P94}}}}}}}
|shield_alt = {{{shield_alt|}}}
|shield_size = {{{shield_size|100x80px}}}
|nickname = {{{nickname|}}}
|motto = {{{motto|}}}
|image_map = {{{image_map|{{#invoke:wd|property|raw|best|{{{qid|}}}|P242}} }}}
|mapsize = {{{mapsize|280px}}}
|map_alt = {{{map_alt|Lokasyon na {{#invoke:wd|label|{{{qid|}}}}}}}}
|map_caption = {{{map_caption|Lokasyon sa {{#invoke:wd|label|{{{qid|}}}}}}}}
|pushpin_map = {{{pushpin_map|}}}
|pushpin_label_position = {{{pushpin_label_position|}}}
|pushpin_label = {{{pushpin_label|}}}
|pushpin_map_alt = {{{pushpin_map_alt|}}}
|pushpin_mapsize = {{{pushpin_mapsize|280px}}}
|pushpin_relief = {{{pushpin_relief|}}}
|pushpin_map_caption = {{{pushpin_map_caption|}}}
|coordinates_footnotes = {{{coordinates_footnotes|{{#ifeq:{{{dateformat}}}|dmy|{{#invoke:wd|references|current|{{{qid|}}}|P625}}|{{#invoke:wd|references|mdy|current|{{{qid|}}}|P625}} }} }}}
|subdivision_type = {{{subdivision_type|Dalin}}}
|subdivision_name = {{{subdivision_name|{{#invoke:wd|property|linked|{{{qid|}}}|P17}}}}}
| parts_type = [[Barangay]]
| parts_style = para
| p1 = {{PH Barangay count | {{wikidata|label|raw}} }}
|established_title = {{{established_title|{{#if:{{main other|{{#property:P571}}|{{#property:P571|from={{{qid|}}}}}}}|Angipaletnegan|}}}}}
|established_date = {{{established_date|{{#ifeq:{{{dateformat}}}|dmy|{{PAGENAMEBASE|{{#invoke:wd|property|{{{qid|}}}|P571}}}}|{{PAGENAMEBASE|{{#invoke:wd|property|mdy|{{{qid|}}}|P571}}}} }} }}}
|seat_type = {{{seat_type|{{#if:{{main other|{{#property:P36}}|{{#property:P36|from={{{qid|}}}}}}}|Kabesera|}}}}}
|seat = {{{seat|{{#if:{{#invoke:wd|property|linked|{{{qid|}}}|P36}}|{{#invoke:wd|property|linked|{{{qid|}}}|P36}}|{{main other|{{#property:P36}}|{{#property:P36|from={{{qid|}}}}}}}}}}}}
|leader_title = {{{leader_title|{{#if:{{main other|{{#property:P6}}|{{#property:P6|from={{{qid|}}}}}}}|{{#if:{{#invoke:String2|label|{{#invoke:wd|property|linked|{{{qid|}}}|P1313}}}}|{{#invoke:String2|label|{{#invoke:wd|property|linked|{{{qid|}}}|P1313}}}}|Pangulo}}}}}}}
|leader_name = {{#property:P6}}
|area_footnotes = {{{area_footnotes|{{#ifeq:{{{dateformat}}}|dmy|{{#invoke:wd|references|current|{{{qid|}}}|P2046}}|{{#invoke:wd|references|mdy|current|{{{qid|}}}|P2046}} }} }}}
|area_total_km2 = {{{area_total_km2|{{#if:{{main other|{{#property:P2046}}|{{#property:P2046|from={{{qid|}}}}}}}|{{#ifeq:{{#invoke:Wikidata|getUnits|qid={{{qid|}}}|P2046|FETCH_WIKIDATA}}|square meter|{{rnd|{{convert|input={{#invoke:String|replace|{{#invoke:String|replace|{{#invoke:wd|property|{{{qid|}}}|P2046}}| %D+||plain=false}}|±[%d%.][%d%.]*||plain=false}} m2|km2|disp=output number only|comma=off}}|2}}|{{#ifeq:{{#invoke:Wikidata|getUnits|qid={{{qid|}}}|P2046|FETCH_WIKIDATA}}|square kilometer|{{rnd|{{convert|input={{#invoke:String|replace|{{#invoke:String|replace|{{#invoke:wd|property|{{{qid|}}}|P2046}}| %D+||plain=false}}|±[%d%.][%d%.]*||plain=false}} km2|km2|disp=output number only|comma=off}}|2}}|{{#invoke:String|replace|{{#invoke:String|replace|{{#invoke:wd|property|{{{qid|}}}|P2046}}| %D+||plain=false}}|±[%d%.][%d%.]*||plain=false}} }} }} }} }}}
|elevation_m = {{{elevation_m|{{#ifexpr:{{#invoke:String|find|{{#invoke:wd|property|raw|best|{{{qid|}}}|P2044}}|foot}}||{{#invoke:String|replace|{{#invoke:string|replace|{{#invoke:wd|property|raw|best|{{{qid|}}}|P2044}}|±[%d%.][%d%.]*||plain=false}}|meter}}}}}}}
|population_footnotes = {{{population_footnotes|{{#ifeq:{{{dateformat}}}|dmy|{{#invoke:wd|references|{{{qid|}}}|P1082|{{formatnum:{{#invoke:wd|property|{{{qid|}}}|P1082}}|R}}}}|{{#invoke:wd|references|mdy|{{{qid|}}}|P1082|{{formatnum:{{#invoke:wd|property|{{{qid|}}}|P1082}}|R}}}} }} }}}
|population_as_of = {{{population_as_of|{{#ifeq:{{{dateformat}}}|dmy|{{#invoke:wd|qualifier|normal+|single|{{{qid|}}}|P1082|P585}}|{{#invoke:wd|qualifier|mdy|normal+|single|{{{qid|}}}|P1082|P585}} }} }}}
|population_total = {{{population_total|{{#invoke:wd|property|current|{{{qid|}}}|P1082}} }}}
|population_density_km2 = {{{population_density_km2|auto}}}
|timezone = {{{timezone|{{#invoke:wd|properties|linked|{{{qid|}}}|P421}}}}}
|postal_code_type = {{{postal_code_type|Kodigo na postal}}}
|postal_code = {{{postal_code|{{#invoke:wd|properties|raw|{{{qid|}}}|P281}}}}}
|area_code = {{{area_code|{{#invoke:wd|properties|raw|{{{qid|}}}|P473}}}}}
|website = {{{website|{{#if:{{main other|{{#property:P856}}|{{#property:P856|from={{{qid|}}}}}}}|{{URL|{{#invoke:wd|property|raw|best|{{{qid|}}}|P856}}}}|}}}}}
| demographics_type1 = {{#if:{{#property:P3087}}| Economia}}
| demographics1_title1 = Klase
| demographics1_info1 = {{#ifeq:{{#property:P1879}}|no value|{{void}}|{{PH wikidata|income_class}}}}
| demographics1_title2 =
| demographics1_info2 =
| demographics1_title3 = Kita
| demographics1_info3 = {{#if:{{#property:P3087}}| {{PH wikidata|revenue}} ({{wikidata|qualifier|single|P3087|P585}})}}
| demographics1_title4 =
| demographics1_info4 =
| demographics1_title5 = Kabtangan
| demographics1_info5 = {{#if:{{#property:P2403}}| {{PH wikidata|assets}} ({{wikidata|qualifier|single|P2403|P585}})}}
| demographics1_title6 =
| demographics1_info6 =
| demographics1_title7 = Utang
| demographics1_info7 = {{#if:{{#property:P2138}}| {{PH wikidata|liabilities}} ({{wikidata|qualifier|single|P2138|P585}})}}
| demographics1_title8 =
| demographics1_info8 =
| demographics1_title9 = Gasto
| demographics1_info9 = {{#if:{{#property:P2402}}| {{PH wikidata|expenditure}} ({{wikidata|qualifier|single|P2402|P585}})}}
| demographics1_title10 =
| demographics1_info10 =
|footnotes = {{{footnotes|{{#if:{{#invoke:Wikidata|pageId}}||{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{error|Pasakbay!}} Data will appear when article is linked to Wikidata.[[Category:Articles using Template:Infobox location not linked to Wikidata]]}}}} }}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
5mu0ev112fi61h2u0p51rljddh3daa4
Plantilya:PH wikidata/balance sheet item
10
11353917
37019632
2026-05-01T16:02:19Z
Exec8
10305
.
37019632
wikitext
text/x-wiki
<includeonly>{{safesubst:#switch:{{{1|}}}
| #default = <span class{{=}}"error">[[Template:PH wikidata]] called with unsupported balance sheet item "{{{1}}}"</span>
| revenue | assets | liabilities | expenditure =
₱{{hsp}}{{safesubst:#invoke:WikidataIB |getValue |{{safesubst:#switch:{{{1|}}}|revenue=P3087 |assets=P2403 |liabilities=P2138 |expenditure=P2402 }} ||fwd=ALL |rank=b |osd=no |noicon=true |scale=6 |su=false |qual=P585 |qdf=y }}
| revenue_point_in_time | assets_point_in_time | liabilities_point_in_time | expenditure_point_in_time =
}}</includeonly><noinclude>
{{documentation}}</noinclude>
3mrc2i8azd5q26ajsfu4nl5pgyd676z
Plantilya:PH Barangay count
10
11353918
37019633
2026-05-01T16:02:56Z
Exec8
10305
.
37019633
wikitext
text/x-wiki
<!-- This template is used as a switch to display count of barangays in a local administrative unit in the Philippines -->{{#switch: {{{1|}}}
| Q928 <!-- Philippines --> = 42020 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc -->
| Q2673519 <!-- Luzon, Philippines --> = 20492 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/luzon -->
| Q211436 <!-- Visayas, Philippines --> = 11444 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/visayas -->
| Q37274898 <!-- Mindanao, Philippines --> = 10084 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/mindanao -->
| Q13580 <!-- Metro Manila, National Capital Region --> = 1710 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/130000000 -->
| Q12933 <!-- Ilocos Region, Luzon --> = 3267 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/010000000 -->
| Q13615 <!-- Cagayan Valley, Luzon --> = 2311 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/020000000 -->
| Q13606 <!-- Cordillera Administrative Region, Luzon --> = 1178 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/140000000 -->
| Q13617 <!-- Central Luzon, Luzon --> = 3102 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/030000000 -->
| Q13650 <!-- Calabarzon, Luzon --> = 3993 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/040000000 -->
| Q13662 <!-- Bicol Region, Luzon --> = 3471 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/050000000 -->
| Q13658 <!-- Mimaropa, Luzon --> = 1460 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/170000000 -->
| Q13665 <!-- Western Visayas, Visayas --> = 4051 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/060000000 -->
| Q13669 <!-- Central Visayas, Visayas --> = 3003 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/070000000 -->
| Q13675 <!-- Eastern Visayas, Visayas --> = 4390 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/080000000 -->
| Q13682 <!-- Zamboanga Peninsula, Mindanao --> = 1904 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/090000000 -->
| Q13690 <!-- Northern Mindanao, Mindanao --> = 2022 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/100000000 -->
| Q13704 <!-- Caraga, Mindanao --> = 1311 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/160000000 -->
| Q13694 <!-- Davao Region, Mindanao --> = 1162 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/110000000 -->
| Q13701 <!-- Soccsksargen, Mindanao --> = 1195 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/120000000 -->
| Q24869612 <!-- Bangasmoro, Mindanao --> = 2490 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/150000000 -->
| Q13813 <!-- Ilocos Norte, Ilocos Region --> = 559 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/012800000 -->
| Q12741 <!-- Ilocos Sur, Ilocos Region --> = 768 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/012900000 -->
| Q13829 <!-- La Union, Ilocos Region --> = 576 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/013300000 -->
| Q13871 <!-- Pangasinan, Ilocos Region --> = 1364 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/015500000 -->
| Q13740 <!-- Batanes, Cagayan Valley --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/020900000 -->
| Q13759 <!-- Cagayan, Cagayan Valley --> = 820 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/021500000 -->
| Q13826 <!-- Isabela, Cagayan Valley --> = 1055 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/023100000 -->
| Q13866 <!-- Nueva Vizcaya, Cagayan Valley --> = 275 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/025000000 -->
| Q13873 <!-- Quirino, Cagayan Valley --> = 132 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/025700000 -->
| Q13711 <!-- Abra, Cordillera Administrative Region --> = 303 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/140100000 -->
| Q13728 <!-- Apayao, Cordillera Administrative Region --> = 133 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/148100000 -->
| Q13750 <!-- Benguet, Cordillera Administrative Region --> = 269 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/141100000 -->
| Q13812 <!-- Ifugao, Cordillera Administrative Region --> = 176 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/142700000 -->
| Q13827 <!-- Kalinga, Cordillera Administrative Region --> = 153 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/143200000 -->
| Q13861 <!-- Mountain Province, Cordillera Administrative Region --> = 133 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/144400000 -->
| Q13730 <!-- Aurora, Central Luzon --> = 151 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/037700000 -->
| Q13739 <!-- Bataan, Central Luzon --> = 237 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/030800000 -->
| Q13755 <!-- Bulacan, Central Luzon --> = 569 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/031400000 -->
| Q13865 <!-- Nueva Ecija, Central Luzon --> = 849 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/034900000 -->
| Q13870 <!-- Pampanga, Central Luzon --> = 538 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/035400000 -->
| Q13892 <!-- Tarlac, Central Luzon --> = 511 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/036900000 -->
| Q13895 <!-- Zambales, Central Luzon --> = 247 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/037100000 -->
| Q13744 <!-- Batangas, Calabarzon --> = 1078 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/041000000 -->
| Q13785 <!-- Cavite, Calabarzon --> = 803 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/042100000 -->
| Q13840 <!-- Laguna, Calabarzon --> = 681 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/043400000 -->
| Q13872 <!-- Quezon, Calabarzon --> = 1242 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/045600000 -->
| Q13874 <!-- Rizal, Calabarzon --> = 189 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/045800000 -->
| Q13726 <!-- Albay, Bicol Region --> = 720 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/050500000 -->
| Q13763 <!-- Camarines Norte, Bicol Region --> = 282 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/051600000 -->
| Q13767 <!-- Camarines Sur, Bicol Region --> = 1063 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/051700000 -->
| Q13778 <!-- Catanduanes, Bicol Region --> = 315 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/052000000 -->
| Q13847 <!-- Masbate, Bicol Region --> = 550 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/054100000 -->
| Q13881 <!-- Sorsogon, Bicol Region --> = 541 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/056200000 -->
| Q13846 <!-- Marinduque, Mimaropa --> = 218 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/174000000 -->
| Q13867 <!-- Occidental Mindoro, Mimaropa --> = 164 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/175100000 -->
| Q13868 <!-- Oriental Mindoro, Mimaropa --> = 426 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/175200000 -->
| Q13869 <!-- Palawan, Mimaropa --> = 433 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/175300000 -->
| Q13875 <!-- Romblon, Mimaropa --> = 219 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/060400000 -->
| Q13723 <!-- Aklan, Western Visayas --> = 327 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/060400000 -->
| Q13727 <!-- Antique, Western Visayas --> = 590 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/060600000 -->
| Q13772 <!-- Capiz, Western Visayas --> = 473 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/061900000 -->
| Q13810 <!-- Guimaras, Western Visayas --> = 98 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/067900000 -->
| Q13825 <!-- Iloilo, Western Visayas --> = 1901 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/063000000 -->
| Q13862 <!-- Negros Occidental, Western Visayas --> = 662 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/064500000 -->
| Q13752 <!-- Bohol, Central Visayas --> = 1109 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/071200000 -->
| Q13786 <!-- Cebu, Central Visayas --> = 1203 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/072200000 -->
| Q13863 <!-- Negros Oriental, Central Visayas --> = 557 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/074600000 -->
| Q13879 <!-- Siquijor, Central Visayas --> = 134 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/076100000 -->
| Q13751 <!-- Biliran, Eastern Visayas --> = 132 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/087800000 -->
| Q13809 <!-- Eastern Samar, Eastern Visayas --> = 597 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/082600000 -->
| Q13844 <!-- Leyte, Eastern Visayas --> = 1641 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/083700000 -->
| Q13864 <!-- Northern Samar, Eastern Visayas --> = 569 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/084800000 -->
| Q13876 <!-- Samar, Eastern Visayas --> = 951 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/086000000 -->
| Q13884 <!-- Southern Leyte, Eastern Visayas --> = 500 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/086400000 -->
| Q13899 <!-- Zamboanga del Norte, Zamboanga Peninsula --> = 691 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/097200000 -->
| Q13900 <!-- Zamboanga del Sur, Zamboanga Peninsula --> = 779 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/097300000 -->
| Q13902 <!-- Zamboanga Sibugay, Zamboanga Peninsula --> = 389 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/098300000 -->
| Q13753 <!-- Bukidnon, Northern Mindanao --> = 464 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/101300000 -->
| Q13769 <!-- Camiguin, Northern Mindanao --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/101800000 -->
| Q13841 <!-- Lanao del Norte, Northern Mindanao --> = 506 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/103500000 -->
| Q13857 <!-- Misamis Occidental, Northern Mindanao --> = 490 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/104200000 -->
| Q13860 <!-- Misamis Oriental, Northern Mindanao --> = 504 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/104300000 -->
| Q13714 <!-- Agusan del Norte, Caraga --> = 253 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/160200000 -->
| Q13721 <!-- Agusan del Sur, Caraga --> = 314 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/160300000 -->
| Q13807 <!-- Dinagat Islands, Caraga --> = 100 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/168500000 -->
| Q13889 <!-- Surigao del Norte, Caraga --> = 335 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/166700000 -->
| Q13891 <!-- Surigao del Sur, Caraga --> = 309 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/166800000 -->
| Q13789 <!-- Davao de Oro, Davao Region --> = 237 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/118200000 -->
| Q13792 <!-- Davao del Norte, Davao Region --> = 223 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/112300000 -->
| Q13794 <!-- Davao del Sur, Davao Region --> = 414 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/112400000 -->
| Q3656379 <!-- Davao Occidental, Davao Region --> = 105 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/118600000 -->
| Q13806 <!-- Davao Oriental, Davao Region --> = 183 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/112500000 -->
| Q13791 <!-- Cotabato, Soccsksargen --> = 543 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/124700000 -->
| Q13877 <!-- Sarangani, Soccsksargen --> = 141 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/128000000 -->
| Q13882 <!-- South Cotabato, Soccsksargen --> = 225 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/126300000 -->
| Q13885 <!-- Sultan Kudarat, Soccsksargen --> = 249 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/126500000 -->
| Q13737 <!-- Basilan, Bangasmoro --> = 210 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/150700000 -->
| Q13843 <!-- Lanao del Sur, Bangasmoro --> = 1159 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/153600000 -->
| Q13845 <!-- Maguindanao, Bangasmoro --> = 508 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/153800000 -->
| Q13887 <!-- Sulu, Bangasmoro --> = 410 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/156600000 -->
| Q13893 <!-- Tawi-Tawi, Bangasmoro --> = 203 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/157000000 -->
| Q1478 <!-- Caloocan --> = 188 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137501000 -->
| Q8854 <!-- Las Piñas --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137601000 -->
| Q1508 <!-- Makati --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137602000 -->
| Q8861 <!-- Malabon --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137502000 -->
| Q9085 <!-- Mandaluyong --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137401000 -->
| Q1461 <!-- Manila --> = 897 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/submuni/133900000 -->
| Q17175 <!-- Marikina --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137402000 -->
| Q17176 <!-- Muntinlupa --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137603000 -->
| Q17179 <!-- Navotas --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137503000 -->
| Q17182 <!-- Parañaque --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137604000 -->
| Q17189 <!-- Pasay --> = 201 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137605000 -->
| Q1624 <!-- Pasig --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137403000 -->
| Q1017325 <!-- Pateros, Metro Manila --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137606000 -->
| Q1475 <!-- Quezon City --> = 142 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137404000 -->
| Q749283 <!-- San Juan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137405000 -->
| Q1643 <!-- Taguig --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137607000 -->
| Q1623 <!-- Valenzuela --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137504000 -->
| Q39241 <!-- Adams, Ilocos Norte --> = 1 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012801000 -->
| Q39271 <!-- Bacarra, Ilocos Norte --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012802000 -->
| Q39303 <!-- Badoc, Ilocos Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012803000 -->
| Q39326 <!-- Bangui, Ilocos Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012804000 -->
| Q39346 <!-- Banna, Ilocos Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012811000 -->
| Q39711 <!-- Batac, Ilocos Norte --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012805000 -->
| Q39368 <!-- Burgos, Ilocos Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012806000 -->
| Q39393 <!-- Carasi, Ilocos Norte --> = 3 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012807000 -->
| Q39416 <!-- Currimao, Ilocos Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012808000 -->
| Q39429 <!-- Dingras, Ilocos Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012809000 -->
| Q39511 <!-- Dumalneg, Ilocos Norte --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012810000 -->
| Q39738 <!-- Laoag, Ilocos Norte --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012812000 -->
| Q39523 <!-- Marcos, Ilocos Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012813000 -->
| Q39540 <!-- Nueva Era, Ilocos Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012814000 -->
| Q39559 <!-- Pagudpud, Ilocos Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012815000 -->
| Q39573 <!-- Paoay, Ilocos Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012816000 -->
| Q39591 <!-- Pasuquin, Ilocos Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012817000 -->
| Q39616 <!-- Piddig, Ilocos Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012818000 -->
| Q39629 <!-- Pinili, Ilocos Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012819000 -->
| Q39653 <!-- San Nicolas, Ilocos Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012820000 -->
| Q39673 <!-- Sarrat, Ilocos Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012821000 -->
| Q39677 <!-- Solsona, Ilocos Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012822000 -->
| Q39694 <!-- Vintar, Ilocos Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012823000 -->
| Q12813 <!-- Alilem, Ilocos Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012901000 -->
| Q12818 <!-- Banayoyo, Ilocos Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012902000 -->
| Q12825 <!-- Bantay, Ilocos Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012903000 -->
| Q12828 <!-- Burgos, Ilocos Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012904000 -->
| Q12832 <!-- Cabugao, Ilocos Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012905000 -->
| Q205956 <!-- Candon, Ilocos Sur --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012906000 -->
| Q12834 <!-- Caoayan, Ilocos Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012907000 -->
| Q12835 <!-- Cervantes, Ilocos Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012908000 -->
| Q12838 <!-- Galimuyod, Ilocos Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012909000 -->
| Q12840 <!-- Gregorio del Pilar, Ilocos Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012910000 -->
| Q12843 <!-- Lidlidda, Ilocos Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012911000 -->
| Q12845 <!-- Magsingal, Ilocos Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012912000 -->
| Q12848 <!-- Nagbukel, Ilocos Sur --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012913000 -->
| Q12850 <!-- Narvacan, Ilocos Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012914000 -->
| Q12853 <!-- Quirino, Ilocos Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012915000 -->
| Q12856 <!-- Salcedo, Ilocos Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012916000 -->
| Q12859 <!-- San Emilio, Ilocos Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012917000 -->
| Q12863 <!-- San Esteban, Ilocos Sur --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012918000 -->
| Q12864 <!-- San Ildefonso, Ilocos Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012919000 -->
| Q12867 <!-- San Juan, Ilocos Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012920000 -->
| Q12868 <!-- San Vicente, Ilocos Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012921000 -->
| Q12873 <!-- Santa, Ilocos Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012922000 -->
| Q12875 <!-- Santa Catalina, Ilocos Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012923000 -->
| Q12880 <!-- Santa Cruz, Ilocos Sur --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012924000 -->
| Q12882 <!-- Santa Lucia, Ilocos Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012925000 -->
| Q12692 <!-- Santa Maria, Ilocos Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012926000 -->
| Q12884 <!-- Santiago, Ilocos Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012927000 -->
| Q12885 <!-- Santo Domingo, Ilocos Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012928000 -->
| Q12888 <!-- Sigay, Ilocos Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012929000 -->
| Q12891 <!-- Sinait, Ilocos Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012930000 -->
| Q12893 <!-- Sugpon, Ilocos Sur --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012931000 -->
| Q12894 <!-- Suyo, Ilocos Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012932000 -->
| Q12895 <!-- Tagudin, Ilocos Sur --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012933000 -->
| Q235004 <!-- Vigan, Ilocos Sur --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012934000 -->
| Q40168 <!-- Agoo, La Union --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013301000 -->
| Q40239 <!-- Aringay, La Union --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013302000 -->
| Q40259 <!-- Bacnotan, La Union --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013303000 -->
| Q40275 <!-- Bagulin, La Union --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013304000 -->
| Q40282 <!-- Balaoan, La Union --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013305000 -->
| Q40298 <!-- Bangar, La Union --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013306000 -->
| Q40313 <!-- Bauang, La Union --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013307000 -->
| Q40372 <!-- Burgos, La Union --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013308000 -->
| Q40393 <!-- Caba, La Union --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013309000 -->
| Q40419 <!-- Luna, La Union --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013310000 -->
| Q40450 <!-- Naguilian, La Union --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013311000 -->
| Q40466 <!-- Pugo, La Union --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013312000 -->
| Q40486 <!-- Rosario, La Union --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013313000 -->
| Q40584 <!-- San Fernando, La Union --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013314000 -->
| Q40500 <!-- San Gabriel, La Union --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013315000 -->
| Q40517 <!-- San Juan, La Union --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013316000 -->
| Q40521 <!-- Santo Tomas, La Union --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013317000 -->
| Q40536 <!-- Santol, La Union --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013318000 -->
| Q40557 <!-- Sudipen, La Union --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013319000 -->
| Q40562 <!-- Tubao, La Union --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013320000 -->
| Q41668 <!-- Agno, Pangasinan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015501000 -->
| Q41686 <!-- Aguilar, Pangasinan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015502000 -->
| Q43162 <!-- Alaminos, Pangasinan --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015503000 -->
| Q41704 <!-- Alcala, Pangasinan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015502000 -->
| Q41713 <!-- Anda, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015504000 -->
| Q41721 <!-- Asingan, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015505000 -->
| Q41725 <!-- Balungao, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015506000 -->
| Q41732 <!-- Bani, Pangasinan --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015508000 -->
| Q41737 <!-- Basista, Pangasinan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015509000 -->
| Q41757 <!-- Bautista, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015510000 -->
| Q41762 <!-- Bayambang, Pangasinan --> = 77 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015511000 -->
| Q41771 <!-- Binalonan, Pangasinan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015512000 -->
| Q41779 <!-- Binmaley, Pangasinan --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015513000 -->
| Q41807 <!-- Bolinao, Pangasinan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015514000 -->
| Q41826 <!-- Bugallon, Pangasinan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015515000 -->
| Q41850 <!-- Burgos, Pangasinan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015516000 -->
| Q41855 <!-- Calasiao, Pangasinan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015517000 -->
| Q875070 <!-- Dagupan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015518000 -->
| Q41917 <!-- Dasol, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015519000 -->
| Q41922 <!-- Infanta, Pangasinan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015520000 -->
| Q41942 <!-- Labrador, Pangasinan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015521000 -->
| Q41965 <!-- Laoac, Pangasinan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015548000 -->
| Q41978 <!-- Lingayen, Pangasinan --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015522000 -->
| Q41982 <!-- Mabini, Pangasinan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015523000 -->
| Q41985 <!-- Malasiqui, Pangasinan --> = 73 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015524000 -->
| Q1020685 <!-- Manaoag, Pangasinan --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015525000 -->
| Q41996 <!-- Mangaldan, Pangasinan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015526000 -->
| Q42001 <!-- Mangatarem, Pangasinan --> = 82 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015527000 -->
| Q42006 <!-- Mapandan, Pangasinan --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015528000 -->
| Q42011 <!-- Natividad, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015529000 -->
| Q42017 <!-- Pozorrubio, Pangasinan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015530000 -->
| Q42024 <!-- Rosales, Pangasinan --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015531000 -->
| Q43165 <!-- San Carlos, Pangasinan --> = 86 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015532000 -->
| Q42031 <!-- San Fabian, Pangasinan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015533000 -->
| Q42036 <!-- San Jacinto, Pangasinan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015534000 -->
| Q42039 <!-- San Manuel, Pangasinan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015535000 -->
| Q42043 <!-- San Nicolas, Pangasinan --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015536000 -->
| Q42044 <!-- San Quintin, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015537000 -->
| Q122401 <!-- Santa Barbara, Pangasinan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015538000 -->
| Q42055 <!-- Santa Maria, Pangasinan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015539000 -->
| Q43140 <!-- Santo Tomas, Pangasinan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015540000 -->
| Q43143 <!-- Sison, Pangasinan --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015541000 -->
| Q43145 <!-- Sual, Pangasinan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015542000 -->
| Q43148 <!-- Tayug, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015543000 -->
| Q43152 <!-- Umingan, Pangasinan --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015544000 -->
| Q43154 <!-- Urbiztondo, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015545000 -->
| Q43168 <!-- Urdaneta, Pangasinan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015546000 -->
| Q43157 <!-- Villasis, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015547000 -->
| Q43180 <!-- Basco, Batanes --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020901000 -->
| Q43451 <!-- Itbayat, Batanes --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020902000 -->
| Q43454 <!-- Ivana, Batanes --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020903000 -->
| Q43458 <!-- Mahatao, Batanes --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020904000 -->
| Q43460 <!-- Sabtang, Batanes --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020905000 -->
| Q43469 <!-- Uyugan, Batanes --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020906000 -->
| Q43500 <!-- Abulug, Cagayan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021501000 -->
| Q43503 <!-- Alcala, Cagayan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021502000 -->
| Q43508 <!-- Allacapan, Cagayan --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021503000 -->
| Q43515 <!-- Amulung, Cagayan --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021504000 -->
| Q43517 <!-- Aparri, Cagayan --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021505000 -->
| Q43520 <!-- Baggao, Cagayan --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021506000 -->
| Q49058 <!-- Ballesteros, Cagayan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021507000 -->
| Q49059 <!-- Buguey, Cagayan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021508000 -->
| Q49062 <!-- Calayan, Cagayan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021509000 -->
| Q49313 <!-- Camalaniugan, Cagayan --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021510000 -->
| Q49314 <!-- Claveria, Cagayan --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021511000 -->
| Q49315 <!-- Enrile, Cagayan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021512000 -->
| Q49316 <!-- Gattaran, Cagayan --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021513000 -->
| Q49317 <!-- Gonzaga, Cagayan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021514000 -->
| Q49318 <!-- Iguig, Cagayan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021515000 -->
| Q49320 <!-- Lal-lo, Cagayan --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021516000 -->
| Q49321 <!-- Lasam, Cagayan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021517000 -->
| Q49324 <!-- Pamplona, Cagayan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021518000 -->
| Q49327 <!-- Peñablanca, Cagayan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021519000 -->
| Q49331 <!-- Piat, Cagayan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021520000 -->
| Q49333 <!-- Rizal, Cagayan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021521000 -->
| Q49336 <!-- Sanchez-Mira, Cagayan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021522000 -->
| Q49337 <!-- Santa Ana, Cagayan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021523000 -->
| Q49339 <!-- Santa Praxedes, Cagayan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021524000 -->
| Q49342 <!-- Santa Teresita, Cagayan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021525000 -->
| Q49346 <!-- Santo Niño, Cagayan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021526000 -->
| Q49348 <!-- Solana, Cagayan --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021527000 -->
| Q49350 <!-- Tuao, Cagayan --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021528000 -->
| Q2200 <!-- Tuguegarao, Cagayan --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021529000 -->
| Q49354 <!-- Alicia, Isabela --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023101000 -->
| Q49357 <!-- Angadanan, Isabela --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023102000 -->
| Q49358 <!-- Aurora, Isabela --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023103000 -->
| Q49359 <!-- Benito Soliven, Isabela --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023104000 -->
| Q49360 <!-- Burgos, Isabela --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023105000 -->
| Q49361 <!-- Cabagan, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023106000 -->
| Q49362 <!-- Cabatuan, Isabela --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023107000 -->
| Q50178 <!-- Cauayan, Isabela --> = 65 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023108000 -->
| Q49363 <!-- Cordon, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023109000 -->
| Q49365 <!-- Delfin Albano, Isabela --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023118000 -->
| Q49366 <!-- Dinapigue, Isabela --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023110000 -->
| Q49368 <!-- Divilacan, Isabela --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023111000 -->
| Q49369 <!-- Echague, Isabela --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023112000 -->
| Q49370 <!-- Gamu, Isabela --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023113000 -->
| Q50179 <!-- Ilagan, Isabela --> = 91 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023114000 -->
| Q49372 <!-- Jones, Isabela --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023115000 -->
| Q49375 <!-- Luna, Isabela --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023116000 -->
| Q49434 <!-- Maconacon, Isabela --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023117000 -->
| Q49435 <!-- Mallig, Isabela --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023119000 -->
| Q50066 <!-- Naguilian, Isabela --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023120000 -->
| Q50102 <!-- Palanan, Isabela --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023121000 -->
| Q50145 <!-- Quezon, Isabela --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023122000 -->
| Q50149 <!-- Quirino, Isabela --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023123000 -->
| Q50152 <!-- Ramon, Isabela --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023124000 -->
| Q50153 <!-- Reina Mercedes, Isabela --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023125000 -->
| Q50154 <!-- Roxas, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023126000 -->
| Q50158 <!-- San Agustin, Isabela --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023127000 -->
| Q50160 <!-- San Guillermo, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023128000 -->
| Q50163 <!-- San Isidro, Isabela --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023129000 -->
| Q50164 <!-- San Manuel, Isabela --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023130000 -->
| Q50167 <!-- San Mariano, Isabela --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023131000 -->
| Q50171 <!-- San Mateo, Isabela --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023132000 -->
| Q50174 <!-- San Pablo, Isabela --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023133000 -->
| Q50175 <!-- Santa Maria, Isabela --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023134000 -->
| Q50180 <!-- Santiago --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023135000 -->
| Q50176 <!-- Santo Tomas, Isabela --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023136000 -->
| Q50177 <!-- Tumauini, Isabela --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023137000 -->
| Q51474 <!-- Alfonso Castaneda, Nueva Vizcaya --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025015000 -->
| Q51475 <!-- Ambaguio, Nueva Vizcaya --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025001000 -->
| Q51477 <!-- Aritao, Nueva Vizcaya --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025002000 -->
| Q51478 <!-- Bagabag, Nueva Vizcaya --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025003000 -->
| Q51479 <!-- Bambang, Nueva Vizcaya --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025004000 -->
| Q51480 <!-- Bayombong , Nueva Vizcaya --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025005000 -->
| Q51481 <!-- Diadi, Nueva Vizcaya --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025006000 -->
| Q51483 <!-- Dupax del Norte, Nueva Vizcaya --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025007000 -->
| Q51484 <!-- Dupax del Sur, Nueva Vizcaya --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025008000 -->
| Q51485 <!-- Kasibu, Nueva Vizcaya --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025009000 -->
| Q51486 <!-- Kayapa, Nueva Vizcaya --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025010000 -->
| Q51487 <!-- Quezon, Nueva Vizcaya --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025011000 -->
| Q51493 <!-- Santa Fe, Nueva Vizcaya --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025012000 -->
| Q51494 <!-- Solano, Nueva Vizcaya --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025013000 -->
| Q51496 <!-- Villaverde, Nueva Vizcaya --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025014000 -->
| Q53069 <!-- Aglipay, Quirino --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025701000 -->
| Q53070 <!-- Cabarroguis, Quirino --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025702000 -->
| Q53071 <!-- Diffun, Quirino --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025703000 -->
| Q53072 <!-- Maddela, Quirino --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025704000 -->
| Q53073 <!-- Nagtipunan, Quirino --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025706000 -->
| Q53074 <!-- Saguday, Quirino --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025705000 -->
| Q27995 <!-- Bangued , Abra --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140101000 -->
| Q28002 <!-- Boliney, Abra --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140102000 -->
| Q28014 <!-- Bucay, Abra --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140103000 -->
| Q28030 <!-- Bucloc, Abra --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140104000 -->
| Q28044 <!-- Daguioman, Abra --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140105000 -->
| Q28068 <!-- Danglas, Abra --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140106000 -->
| Q28096 <!-- Dolores, Abra --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140107000 -->
| Q28124 <!-- La Paz, Abra --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140108000 -->
| Q29007 <!-- Lacub, Abra --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140109000 -->
| Q29020 <!-- Lagangilang, Abra --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140110000 -->
| Q29029 <!-- Lagayan, Abra --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140111000 -->
| Q29038 <!-- Langiden, Abra --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140112000 -->
| Q29045 <!-- Licuan-Baay, Abra --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140113000 -->
| Q29048 <!-- Luba, Abra --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140114000 -->
| Q29069 <!-- Malibcong, Abra --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140115000 -->
| Q29082 <!-- Manabo, Abra --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140116000 -->
| Q29094 <!-- Peñarrubia, Abra --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140117000 -->
| Q29102 <!-- Pidigan, Abra --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140118000 -->
| Q29109 <!-- Pilar, Abra --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140119000 -->
| Q29116 <!-- Sallapadan, Abra --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140120000 -->
| Q801530 <!-- San Isidro, Abra --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140121000 -->
| Q29123 <!-- San Juan, Abra --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140122000 -->
| Q29133 <!-- San Quintin, Abra --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140123000 -->
| Q29139 <!-- Tayum, Abra --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140124000 -->
| Q29146 <!-- Tineg, Abra --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140125000 -->
| Q29153 <!-- Tubo, Abra --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140126000 -->
| Q29191 <!-- Villaviciosa, Abra --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140127000 -->
| Q29018 <!-- Calanasan, Apayao --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148101000 -->
| Q30033 <!-- Conner, Apayao --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148102000 -->
| Q30042 <!-- Flora, Apayao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148103000 -->
| Q30053 <!-- Kabugao, Apayao --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148104000 -->
| Q801777 <!-- Luna, Apayao --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148105000 -->
| Q30062 <!-- Pudtol, Apayao --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148106000 -->
| Q30073 <!-- Santa Marcela, Apayao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148107000 -->
| Q30104 <!-- Atok, Benguet --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141101000 -->
| Q1822 <!-- Baguio --> = 129 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141102000 -->
| Q30325 <!-- Bakun, Benguet --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141103000 -->
| Q30328 <!-- Bokod, Benguet --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141104000 -->
| Q30332 <!-- Buguias, Benguet --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141105000 -->
| Q30335 <!-- Itogon, Benguet --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141106000 -->
| Q30338 <!-- Kabayan, Benguet --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141107000 -->
| Q30345 <!-- Kapangan, Benguet --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141108000 -->
| Q30349 <!-- Kibungan, Benguet --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141109000 -->
| Q30351 <!-- La Trinidad , Benguet --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141110000 -->
| Q30356 <!-- Mankayan, Benguet --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141111000 -->
| Q30358 <!-- Sablan, Benguet --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141112000 -->
| Q30361 <!-- Tuba, Benguet --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141113000 -->
| Q30363 <!-- Tublay, Benguet --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141114000 -->
| Q30365 <!-- Aguinaldo, Ifugao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142708000 -->
| Q30391 <!-- Alfonso Lista, Ifugao --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142707000 -->
| Q30394 <!-- Asipulo, Ifugao --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142711000 -->
| Q806138 <!-- Banaue, Ifugao --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142701000 -->
| Q30410 <!-- Hingyon, Ifugao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142709000 -->
| Q30413 <!-- Hungduan, Ifugao --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142702000 -->
| Q30416 <!-- Kiangan, Ifugao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142703000 -->
| Q30419 <!-- Lagawe, Ifugao --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142704000 -->
| Q30421 <!-- Lamut, Ifugao --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142705000 -->
| Q30425 <!-- Mayoyao, Ifugao --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142706000 -->
| Q30428 <!-- Tinoc, Ifugao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142710000 -->
| Q35848 <!-- Balbalan, Kalinga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143201000 -->
| Q35858 <!-- Lubuagan, Kalinga --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143206000 -->
| Q35866 <!-- Pasil, Kalinga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143208000 -->
| Q35873 <!-- Pinukpuk, Kalinga --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143209000 -->
| Q35884 <!-- Rizal, Kalinga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143211000 -->
| Q35925 <!-- Tabuk, Kalinga --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143213000 -->
| Q35897 <!-- Tanudan, Kalinga --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143214000 -->
| Q35909 <!-- Tinglayan, Kalinga --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143215000 -->
| Q35975 <!-- Barlig, Mountain Province --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144401000 -->
| Q35994 <!-- Bauko, Mountain Province --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144402000 -->
| Q36012 <!-- Besao, Mountain Province --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144403000 -->
| Q36025 <!-- Bontoc, Mountain Province --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144404000 -->
| Q36040 <!-- Natonin, Mountain Province --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144405000 -->
| Q36049 <!-- Paracelis, Mountain Province --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144406000 -->
| Q36061 <!-- Sabangan, Mountain Province --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144407000 -->
| Q36076 <!-- Sadanga, Mountain Province --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144408000 -->
| Q36090 <!-- Sagada, Mountain Province --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144409000 -->
| Q36099 <!-- Tadian, Mountain Province --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144410000 -->
| Q53081 <!-- Baler, Aurora --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037701000 -->
| Q53083 <!-- Casiguran, Aurora --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037702000 -->
| Q53084 <!-- Dilasag, Aurora --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037703000 -->
| Q53086 <!-- Dinalungan, Aurora --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037704000 -->
| Q53087 <!-- Dingalan, Aurora --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037705000 -->
| Q53089 <!-- Dipaculao, Aurora --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037706000 -->
| Q53090 <!-- Maria Aurora, Aurora --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037707000 -->
| Q53092 <!-- San Luis, Aurora --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037708000 -->
| Q54455 <!-- Abucay, Bataan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030801000 -->
| Q54456 <!-- Bagac, Bataan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030802000 -->
| Q1719 <!-- Balanga, Bataan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030803000 -->
| Q54457 <!-- Dinalupihan, Bataan --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030804000 -->
| Q54458 <!-- Hermosa, Bataan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030805000 -->
| Q54459 <!-- Limay, Bataan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030806000 -->
| Q54460 <!-- Mariveles, Bataan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030807000 -->
| Q54461 <!-- Morong, Bataan --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030808000 -->
| Q54462 <!-- Orani, Bataan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030809000 -->
| Q54463 <!-- Orion, Bataan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030810000 -->
| Q54464 <!-- Pilar, Bataan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030811000 -->
| Q54465 <!-- Samal, Bataan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030812000 -->
| Q54551 <!-- Angat, Bulacan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031401000 -->
| Q54553 <!-- Balagtas, Bulacan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031402000 -->
| Q54554 <!-- Baliuag, Bulacan --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031403000 -->
| Q54555 <!-- Bocaue, Bulacan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031404000 -->
| Q54558 <!-- Bulakan, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031405000 -->
| Q54560 <!-- Bustos, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031406000 -->
| Q54564 <!-- Calumpit, Bulacan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031407000 -->
| Q54566 <!-- Doña Remedios Trinidad, Bulacan --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031424000 -->
| Q54589 <!-- Guiguinto, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031408000 -->
| Q54592 <!-- Hagonoy, Bulacan --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031409000 -->
| Q2180 <!-- Malolos, Bulacan --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031410000 -->
| Q54595 <!-- Marilao, Bulacan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031411000 -->
| Q2187 <!-- Meycauayan, Bulacan --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031412000 -->
| Q54598 <!-- Norzagaray, Bulacan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031413000 -->
| Q54599 <!-- Obando, Bulacan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031414000 -->
| Q54600 <!-- Pandi, Bulacan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031415000 -->
| Q54605 <!-- Paombong, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031416000 -->
| Q54760 <!-- Plaridel, Bulacan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031417000 -->
| Q54761 <!-- Pulilan, Bulacan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031418000 -->
| Q54762 <!-- San Ildefonso, Bulacan --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031419000 -->
| Q2193 <!-- San Jose del Monte, Bulacan --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031420000 -->
| Q54763 <!-- San Miguel, Bulacan --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031421000 -->
| Q54765 <!-- San Rafael, Bulacan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031422000 -->
| Q54768 <!-- Santa Maria, Bulacan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031423000 -->
| Q55543 <!-- Aliaga, Nueva Ecija --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034901000 -->
| Q55544 <!-- Bongabon, Nueva Ecija --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034902000 -->
| Q55595 <!-- Cabanatuan, Nueva Ecija --> = 89 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034903000 -->
| Q55545 <!-- Cabiao, Nueva Ecija --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034904000 -->
| Q55546 <!-- Carranglan, Nueva Ecija --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034905000 -->
| Q55547 <!-- Cuyapo, Nueva Ecija --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034906000 -->
| Q55548 <!-- Gabaldon, Nueva Ecija --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034907000 -->
| Q55596 <!-- Gapan, Nueva Ecija --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034908000 -->
| Q55549 <!-- General Mamerto Natividad, Nueva Ecija --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034909000 -->
| Q55551 <!-- General Tinio, Nueva Ecija --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034910000 -->
| Q55552 <!-- Guimba, Nueva Ecija --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034911000 -->
| Q30871 <!-- Jaen, Nueva Ecija --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034912000 -->
| Q55556 <!-- Laur, Nueva Ecija --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034913000 -->
| Q55557 <!-- Licab, Nueva Ecija --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034914000 -->
| Q55558 <!-- Llanera, Nueva Ecija --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034915000 -->
| Q55559 <!-- Lupao, Nueva Ecija --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034916000 -->
| Q55597 <!-- Muñoz, Nueva Ecija --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034917000 -->
| Q55560 <!-- Nampicuan, Nueva Ecija --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034918000 -->
| Q55598 <!-- Palayan, Nueva Ecija --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034919000 -->
| Q55567 <!-- Pantabangan, Nueva Ecija --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034920000 -->
| Q55568 <!-- Peñaranda, Nueva Ecija --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034921000 -->
| Q55569 <!-- Quezon, Nueva Ecija --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034922000 -->
| Q55570 <!-- Rizal, Nueva Ecija --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034923000 -->
| Q30923 <!-- San Antonio, Nueva Ecija --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034924000 -->
| Q55572 <!-- San Isidro, Nueva Ecija --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034925000 -->
| Q55599 <!-- San Jose, Nueva Ecija --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034926000 -->
| Q55573 <!-- San Leonardo, Nueva Ecija --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034927000 -->
| Q55590 <!-- Santa Rosa, Nueva Ecija --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034928000 -->
| Q55591 <!-- Santo Domingo, Nueva Ecija --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034929000 -->
| Q55592 <!-- Talavera, Nueva Ecija --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034930000 -->
| Q55593 <!-- Talugtug, Nueva Ecija --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034931000 -->
| Q28731 <!-- Zaragoza, Nueva Ecija --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034932000 -->
| Q55741 <!-- Angeles --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035401000 -->
| Q55693 <!-- Apalit, Pampanga --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035402000 -->
| Q55694 <!-- Arayat, Pampanga --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035403000 -->
| Q55696 <!-- Bacolor, Pampanga --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035404000 -->
| Q55699 <!-- Candaba, Pampanga --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035405000 -->
| Q55700 <!-- Floridablanca, Pampanga --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035406000 -->
| Q55702 <!-- Guagua, Pampanga --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035407000 -->
| Q55705 <!-- Lubao, Pampanga --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035408000 -->
| Q55737 <!-- Mabalacat, Pampanga --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035409000 -->
| Q55707 <!-- Macabebe, Pampanga --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035410000 -->
| Q55709 <!-- Magalang, Pampanga --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035411000 -->
| Q55710 <!-- Masantol, Pampanga --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035412000 -->
| Q55712 <!-- Mexico, Pampanga --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035413000 -->
| Q55717 <!-- Minalin, Pampanga --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035414000 -->
| Q55721 <!-- Porac, Pampanga --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035415000 -->
| Q55740 <!-- San Fernando, Pampanga --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035416000 -->
| Q55724 <!-- San Luis, Pampanga --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035417000 -->
| Q55725 <!-- San Simon, Pampanga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035418000 -->
| Q55727 <!-- Santa Ana, Pampanga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035419000 -->
| Q55730 <!-- Santa Rita, Pampanga --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035420000 -->
| Q55731 <!-- Santo Tomas, Pampanga --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035421000 -->
| Q55734 <!-- Sasmuan, Pampanga --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035422000 -->
| Q56414 <!-- Anao, Tarlac --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036901000 -->
| Q56420 <!-- Bamban, Tarlac --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036902000 -->
| Q56424 <!-- Camiling, Tarlac --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036903000 -->
| Q56427 <!-- Capas, Tarlac --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036904000 -->
| Q30934 <!-- Concepcion, Tarlac --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036905000 -->
| Q56439 <!-- Gerona, Tarlac --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036906000 -->
| Q28733 <!-- La Paz, Tarlac --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036907000 -->
| Q56444 <!-- Mayantoc, Tarlac --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036908000 -->
| Q56453 <!-- Moncada, Tarlac --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036909000 -->
| Q56457 <!-- Paniqui, Tarlac --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036910000 -->
| Q56461 <!-- Pura, Tarlac --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036911000 -->
| Q56465 <!-- Ramos, Tarlac --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036912000 -->
| Q56471 <!-- San Clemente, Tarlac --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036913000 -->
| Q56476 <!-- San Jose, Tarlac --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036918000 -->
| Q56481 <!-- San Manuel, Tarlac --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036914000 -->
| Q56486 <!-- Santa Ignacia, Tarlac --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036915000 -->
| Q5285 <!-- Tarlac, Tarlac --> = 76 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036916000 -->
| Q56493 <!-- Victoria, Tarlac --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036917000 -->
| Q56529 <!-- Botolan, Zambales --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037101000 -->
| Q56533 <!-- Cabangan, Zambales --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037102000 -->
| Q56538 <!-- Candelaria, Zambales --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037103000 -->
| Q56561 <!-- Castillejos, Zambales --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037104000 -->
| Q56566 <!-- Iba, Zambales --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037105000 -->
| Q56572 <!-- Masinloc, Zambales --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037106000 -->
| Q56759 <!-- Olongapo --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037107000 -->
| Q56575 <!-- Palauig, Zambales --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037108000 -->
| Q56581 <!-- San Antonio, Zambales --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037109000 -->
| Q56584 <!-- San Felipe, Zambales --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037110000 -->
| Q56623 <!-- San Marcelino, Zambales --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037111000 -->
| Q56647 <!-- San Narciso, Zambales --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037112000 -->
| Q56656 <!-- Santa Cruz, Zambales --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037113000 -->
| Q56663 <!-- Subic, Zambales --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037114000 -->
| Q59250 <!-- Agoncillo, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041001000 -->
| Q59251 <!-- Alitagtag, Batangas --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041002000 -->
| Q59252 <!-- Balayan, Batangas --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041003000 -->
| Q59253 <!-- Balete, Batangas --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041004000 -->
| Q1723 <!-- Batangas, Batangas --> = 105 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041005000 -->
| Q59272 <!-- Bauan, Batangas --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041006000 -->
| Q59276 <!-- Calaca, Batangas --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041007000 -->
| Q59279 <!-- Calatagan, Batangas --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041008000 -->
| Q59287 <!-- Cuenca, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041009000 -->
| Q59304 <!-- Ibaan, Batangas --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041010000 -->
| Q59308 <!-- Laurel, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041011000 -->
| Q59311 <!-- Lemery, Batangas --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041012000 -->
| Q59312 <!-- Lian, Batangas --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041013000 -->
| Q1725 <!-- Lipa, Batangas --> = 72 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041014000 -->
| Q803199 <!-- Lobo, Batangas --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041015000 -->
| Q59313 <!-- Mabini, Batangas --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041016000 -->
| Q59731 <!-- Malvar, Batangas --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041017000 -->
| Q59740 <!-- Mataasnakahoy, Batangas --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041018000 -->
| Q59745 <!-- Nasugbu, Batangas --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041019000 -->
| Q59749 <!-- Padre Garcia, Batangas --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041020000 -->
| Q59758 <!-- Rosario, Batangas --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041021000 -->
| Q59764 <!-- San Jose, Batangas --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041022000 -->
| Q59770 <!-- San Juan, Batangas --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041023000 -->
| Q59773 <!-- San Luis, Batangas --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041024000 -->
| Q59777 <!-- San Nicolas, Batangas --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041025000 -->
| Q59784 <!-- San Pascual, Batangas --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041026000 -->
| Q59788 <!-- Santa Teresita, Batangas --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041027000 -->
| Q59799 <!-- Santo Tomas, Batangas --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041028000 -->
| Q59814 <!-- Taal, Batangas --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041029000 -->
| Q59825 <!-- Talisay, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041030000 -->
| Q1730 <!-- Tanauan, Batangas --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041031000 -->
| Q59830 <!-- Taysan, Batangas --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041032000 -->
| Q59835 <!-- Tingloy, Batangas --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041033000 -->
| Q59844 <!-- Tuy, Batangas --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041034000 -->
| Q62600 <!-- Alfonso, Cavite --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042101000 -->
| Q62606 <!-- Amadeo, Cavite --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042102000 -->
| Q63129 <!-- Bacoor, Cavite --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042103000 -->
| Q62611 <!-- Carmona, Cavite --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042104000 -->
| Q1482 <!-- Cavite, Cavite --> = 84 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042105000 -->
| Q63139 <!-- Dasmariñas, Cavite --> = 75 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042106000 -->
| Q62719 <!-- General Emilio Aguinaldo, Cavite --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042107000 -->
| Q62638 <!-- General Mariano Alvarez, Cavite --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042123000 -->
| Q62723 <!-- General Trias, Cavite --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042108000 -->
| Q63145 <!-- Imus, Cavite --> = 97 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042109000 -->
| Q62729 <!-- Indang, Cavite --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042110000 -->
| Q62755 <!-- Kawit, Cavite --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042111000 -->
| Q62771 <!-- Magallanes, Cavite --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042112000 -->
| Q62776 <!-- Maragondon, Cavite --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042113000 -->
| Q62784 <!-- Mendez, Cavite --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042114000 -->
| Q62799 <!-- Naic, Cavite --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042115000 -->
| Q63096 <!-- Noveleta, Cavite --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042116000 -->
| Q63102 <!-- Rosario, Cavite --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042117000 -->
| Q63110 <!-- Silang, Cavite --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042118000 -->
| Q63154 <!-- Tagaytay, Cavite --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042119000 -->
| Q63115 <!-- Tanza, Cavite --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042120000 -->
| Q63124 <!-- Ternate, Cavite --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042121000 -->
| Q63160 <!-- Trece Martires, Cavite --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042122000 -->
| Q63750 <!-- Alaminos, Laguna --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043401000 -->
| Q63763 <!-- Bay, Laguna --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043402000 -->
| Q75961 <!-- Biñan, Laguna --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043403000 -->
| Q25096 <!-- Cabuyao, Laguna --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043404000 -->
| Q75978 <!-- Calamba, Laguna --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043405000 -->
| Q69739 <!-- Calauan, Laguna --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043406000 -->
| Q69749 <!-- Cavinti, Laguna --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043407000 -->
| Q69759 <!-- Famy, Laguna --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043408000 -->
| Q69771 <!-- Kalayaan, Laguna --> = 3 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043409000 -->
| Q69781 <!-- Liliw, Laguna --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043410000 -->
| Q69793 <!-- Los Baños, Laguna --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043411000 -->
| Q69812 <!-- Luisiana, Laguna --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043412000 -->
| Q69824 <!-- Lumban, Laguna --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043413000 -->
| Q75875 <!-- Mabitac, Laguna --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043414000 -->
| Q75881 <!-- Magdalena, Laguna --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043415000 -->
| Q75888 <!-- Majayjay, Laguna --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043416000 -->
| Q75895 <!-- Nagcarlan, Laguna --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043417000 -->
| Q75899 <!-- Paete, Laguna --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043418000 -->
| Q75905 <!-- Pagsanjan, Laguna --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043419000 -->
| Q75910 <!-- Pakil, Laguna --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043420000 -->
| Q75918 <!-- Pangil, Laguna --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043421000 -->
| Q75923 <!-- Pila, Laguna --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043422000 -->
| Q75928 <!-- Rizal, Laguna --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043423000 -->
| Q76001 <!-- San Pablo, Laguna --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043424000 -->
| Q75933 <!-- San Pedro, Laguna --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043425000 -->
| Q75938 <!-- Santa Cruz, Laguna --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043426000 -->
| Q75943 <!-- Santa Maria, Laguna --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043427000 -->
| Q76010 <!-- Santa Rosa, Laguna --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043428000 -->
| Q75948 <!-- Siniloan, Laguna --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043429000 -->
| Q75953 <!-- Victoria, Laguna --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043430000 -->
| Q103777 <!-- Agdangan, Quezon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045601000 -->
| Q103786 <!-- Alabat, Quezon --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045602000 -->
| Q103807 <!-- Atimonan, Quezon --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045603000 -->
| Q103815 <!-- Buenavista, Quezon --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045605000 -->
| Q103825 <!-- Burdeos, Quezon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045606000 -->
| Q103833 <!-- Calauag, Quezon --> = 81 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045607000 -->
| Q103841 <!-- Candelaria, Quezon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045608000 -->
| Q103872 <!-- Catanauan, Quezon --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045610000 -->
| Q103879 <!-- Dolores, Quezon --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045615000 -->
| Q103889 <!-- General Luna, Quezon --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045616000 -->
| Q103899 <!-- General Nakar, Quezon --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045617000 -->
| Q103905 <!-- Guinayangan, Quezon --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045618000 -->
| Q103914 <!-- Gumaca, Quezon --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045619000 -->
| Q103921 <!-- Infanta, Quezon --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045620000 -->
| Q103928 <!-- Jomalig, Quezon --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045621000 -->
| Q103935 <!-- Lopez, Quezon --> = 95 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045622000 -->
| Q103941 <!-- Lucban, Quezon --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045623000 -->
| Q104125 <!-- Lucena --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045624000 -->
| Q103947 <!-- Macalelon, Quezon --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045625000 -->
| Q103952 <!-- Mauban, Quezon --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045627000 -->
| Q103958 <!-- Mulanay, Quezon --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045628000 -->
| Q103965 <!-- Padre Burgos, Quezon --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045629000 -->
| Q103971 <!-- Pagbilao, Quezon --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045630000 -->
| Q103976 <!-- Panukulan, Quezon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045631000 -->
| Q103981 <!-- Patnanungan, Quezon --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045632000 -->
| Q103987 <!-- Perez, Quezon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045633000 -->
| Q103996 <!-- Pitogo, Quezon --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045634000 -->
| Q104005 <!-- Plaridel, Quezon --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045635000 -->
| Q104011 <!-- Polillo, Quezon --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045636000 -->
| Q104020 <!-- Quezon, Quezon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045637000 -->
| Q104026 <!-- Real, Quezon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045638000 -->
| Q104037 <!-- Sampaloc, Quezon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045639000 -->
| Q104044 <!-- San Andres, Quezon --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045640000 -->
| Q104052 <!-- San Antonio, Quezon --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045641000 -->
| Q104063 <!-- San Francisco, Quezon --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045642000 -->
| Q104071 <!-- San Narciso, Quezon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045644000 -->
| Q104078 <!-- Sariaya, Quezon --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045645000 -->
| Q104087 <!-- Tagkawayan, Quezon --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045646000 -->
| Q104113 <!-- Tayabas, Quezon --> = 66 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045647000 -->
| Q104092 <!-- Tiaong, Quezon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045648000 -->
| Q104099 <!-- Unisan, Quezon --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045649000 -->
| Q106758 <!-- Angono, Rizal --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045801000 -->
| Q1636 <!-- Antipolo, Rizal --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045802000 -->
| Q106766 <!-- Baras, Rizal --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045803000 -->
| Q106783 <!-- Binangonan, Rizal --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045804000 -->
| Q106790 <!-- Cainta, Rizal --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045805000 -->
| Q106796 <!-- Cardona, Rizal --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045806000 -->
| Q106804 <!-- Jalajala, Rizal --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045807000 -->
| Q106810 <!-- Morong, Rizal --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045809000 -->
| Q106817 <!-- Pililla, Rizal --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045810000 -->
| Q106825 <!-- Rodriguez, Rizal --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045808000 -->
| Q106832 <!-- San Mateo, Rizal --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045811000 -->
| Q106839 <!-- Tanay, Rizal --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045812000 -->
| Q373204 <!-- Taytay, Rizal --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045813000 -->
| Q106848 <!-- Teresa, Rizal --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045814000 -->
| Q492912 <!-- Bacacay, Albay --> = 56 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050501000 -->
| Q492976 <!-- Camalig, Albay --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050502000 -->
| Q493008 <!-- Daraga, Albay --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050503000 -->
| Q493032 <!-- Guinobatan, Albay --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050504000 -->
| Q493065 <!-- Jovellar, Albay --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050505000 -->
| Q1696 <!-- Legazpi, Albay --> = 70 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050506000 -->
| Q493095 <!-- Libon, Albay --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050507000 -->
| Q1701 <!-- Ligao, Albay --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050508000 -->
| Q493132 <!-- Malilipot, Albay --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050509000 -->
| Q493178 <!-- Malinao, Albay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050510000 -->
| Q493204 <!-- Manito, Albay --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050511000 -->
| Q493246 <!-- Oas, Albay --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050512000 -->
| Q256045 <!-- Pio Duran, Albay --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050513000 -->
| Q493326 <!-- Polangui, Albay --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050514000 -->
| Q493362 <!-- Rapu-Rapu, Albay --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050515000 -->
| Q493409 <!-- Santo Domingo, Albay --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050516000 -->
| Q1706 <!-- Tabaco, Albay --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050517000 -->
| Q493444 <!-- Tiwi, Albay --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050518000 -->
| Q356607 <!-- Basud, Camarines Norte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051601000 -->
| Q119624 <!-- Capalonga, Camarines Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051602000 -->
| Q356655 <!-- Daet, Camarines Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051603000 -->
| Q356681 <!-- Jose Panganiban, Camarines Norte --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051605000 -->
| Q356708 <!-- Labo, Camarines Norte --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051606000 -->
| Q356734 <!-- Mercedes, Camarines Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051607000 -->
| Q356759 <!-- Paracale, Camarines Norte --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051608000 -->
| Q356803 <!-- San Lorenzo Ruiz, Camarines Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051604000 -->
| Q302791 <!-- San Vicente, Camarines Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051609000 -->
| Q356853 <!-- Santa Elena, Camarines Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051610000 -->
| Q356878 <!-- Talisay, Camarines Norte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051611000 -->
| Q356898 <!-- Vinzons, Camarines Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051612000 -->
| Q208672 <!-- Baao, Camarines Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051701000 -->
| Q208678 <!-- Balatan, Camarines Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051702000 -->
| Q208683 <!-- Bato, Camarines Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051703000 -->
| Q208690 <!-- Bombon, Camarines Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051704000 -->
| Q208699 <!-- Buhi, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051705000 -->
| Q208712 <!-- Bula, Camarines Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051706000 -->
| Q208717 <!-- Cabusao, Camarines Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051707000 -->
| Q208727 <!-- Calabanga, Camarines Sur --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051708000 -->
| Q208738 <!-- Camaligan, Camarines Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051709000 -->
| Q208749 <!-- Canaman, Camarines Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051710000 -->
| Q208757 <!-- Caramoan, Camarines Sur --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051711000 -->
| Q208765 <!-- Del Gallego, Camarines Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051712000 -->
| Q208769 <!-- Gainza, Camarines Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051713000 -->
| Q208775 <!-- Garchitorena, Camarines Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051714000 -->
| Q208782 <!-- Goa, Camarines Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051715000 -->
| Q2205 <!-- Iriga, Camarines Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051716000 -->
| Q208792 <!-- Lagonoy, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051717000 -->
| Q208814 <!-- Libmanan, Camarines Sur --> = 75 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051718000 -->
| Q208835 <!-- Lupi, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051719000 -->
| Q208845 <!-- Magarao, Camarines Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051720000 -->
| Q208852 <!-- Milaor, Camarines Sur --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051721000 -->
| Q208864 <!-- Minalabac, Camarines Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051722000 -->
| Q208872 <!-- Nabua, Camarines Sur --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051723000 -->
| Q2207 <!-- Naga --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051724000 -->
| Q208878 <!-- Ocampo, Camarines Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051725000 -->
| Q208886 <!-- Pamplona, Camarines Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051726000 -->
| Q208892 <!-- Pasacao, Camarines Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051727000 -->
| Q208899 <!-- Pili, Camarines Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051728000 -->
| Q208919 <!-- Presentacion, Camarines Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051729000 -->
| Q208924 <!-- Ragay, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051730000 -->
| Q208937 <!-- Sagñay, Camarines Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051731000 -->
| Q208950 <!-- San Fernando, Camarines Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051732000 -->
| Q208966 <!-- San Jose, Camarines Sur --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051733000 -->
| Q208985 <!-- Sipocot, Camarines Sur --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051734000 -->
| Q208995 <!-- Siruma, Camarines Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051735000 -->
| Q209011 <!-- Tigaon, Camarines Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051736000 -->
| Q209024 <!-- Tinambac, Camarines Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051737000 -->
| Q192067 <!-- Bagamanoc, Catanduanes --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052001000 -->
| Q192072 <!-- Baras, Catanduanes --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052002000 -->
| Q192085 <!-- Bato, Catanduanes --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052003000 -->
| Q192091 <!-- Caramoran, Catanduanes --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052004000 -->
| Q192629 <!-- Gigmoto, Catanduanes --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052005000 -->
| Q123163 <!-- Pandan, Catanduanes --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052006000 -->
| Q192646 <!-- Panganiban, Catanduanes --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052007000 -->
| Q840162 <!-- San Andres, Catanduanes --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052008000 -->
| Q192665 <!-- San Miguel, Catanduanes --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052009000 -->
| Q192670 <!-- Viga, Catanduanes --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052010000 -->
| Q192681 <!-- Virac, Catanduanes --> = 63 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052011000 -->
| Q107011 <!-- Boac, Marinduque --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174001000 -->
| Q107034 <!-- Mogpog, Marinduque --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174004000 -->
| Q107042 <!-- Santa Cruz, Marinduque --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174005000 -->
| Q107048 <!-- Torrijos, Marinduque --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174006000 -->
| Q191416 <!-- Aroroy, Masbate --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054101000 -->
| Q191438 <!-- Baleno, Masbate --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054102000 -->
| Q191453 <!-- Balud, Masbate --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054103000 -->
| Q191463 <!-- Batuan, Masbate --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054104000 -->
| Q191478 <!-- Cataingan, Masbate --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054105000 -->
| Q191482 <!-- Cawayan, Masbate --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054106000 -->
| Q191490 <!-- Claveria, Masbate --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054107000 -->
| Q191496 <!-- Dimasalang, Masbate --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054108000 -->
| Q191501 <!-- Esperanza, Masbate --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054109000 -->
| Q191512 <!-- Mandaon, Masbate --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054110000 -->
| Q191651 <!-- Masbate, Masbate --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054111000 -->
| Q191522 <!-- Milagros, Masbate --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054112000 -->
| Q191533 <!-- Mobo, Masbate --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054113000 -->
| Q191544 <!-- Monreal, Masbate --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054114000 -->
| Q191558 <!-- Palanas, Masbate --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054115000 -->
| Q191581 <!-- Pio V. Corpuz, Masbate --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054116000 -->
| Q191590 <!-- Placer, Masbate --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054117000 -->
| Q191606 <!-- San Fernando, Masbate --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054118000 -->
| Q191621 <!-- San Jacinto, Masbate --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054119000 -->
| Q191630 <!-- San Pascual, Masbate --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054120000 -->
| Q191636 <!-- Uson, Masbate --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054121000 -->
| Q174114 <!-- Barcelona, Sorsogon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056202000 -->
| Q174132 <!-- Bulan, Sorsogon --> = 63 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056203000 -->
| Q174162 <!-- Casiguran, Sorsogon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056205000 -->
| Q174177 <!-- Castilla, Sorsogon --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056206000 -->
| Q174192 <!-- Donsol, Sorsogon --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056207000 -->
| Q174201 <!-- Gubat, Sorsogon --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056208000 -->
| Q174215 <!-- Irosin, Sorsogon --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056209000 -->
| Q174236 <!-- Magallanes, Sorsogon --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056211000 -->
| Q174246 <!-- Matnog, Sorsogon --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056212000 -->
| Q174269 <!-- Prieto Diaz, Sorsogon --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056214000 -->
| Q174281 <!-- Santa Magdalena, Sorsogon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056215000 -->
| Q107023 <!-- Buenavista, Marinduque --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174002000 -->
| Q107029 <!-- Gasan, Marinduque --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174003000 -->
| Q107454 <!-- Abra de Ilog, Occidental Mindoro --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175101000 -->
| Q107460 <!-- Calintaan, Occidental Mindoro --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175102000 -->
| Q107465 <!-- Looc, Occidental Mindoro --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175103000 -->
| Q107476 <!-- Lubang, Occidental Mindoro --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175104000 -->
| Q107482 <!-- Magsaysay, Occidental Mindoro --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175105000 -->
| Q107488 <!-- Mamburao , Occidental Mindoro --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175106000 -->
| Q107493 <!-- Paluan, Occidental Mindoro --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175107000 -->
| Q107499 <!-- Rizal, Occidental Mindoro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175108000 -->
| Q107505 <!-- Sablayan, Occidental Mindoro --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175109000 -->
| Q107511 <!-- San Jose, Occidental Mindoro --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175110000 -->
| Q107519 <!-- Santa Cruz, Occidental Mindoro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175111000 -->
| Q107538 <!-- Baco, Oriental Mindoro --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175201000 -->
| Q107543 <!-- Bansud, Oriental Mindoro --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175202000 -->
| Q107550 <!-- Bongabong, Oriental Mindoro --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175203000 -->
| Q107554 <!-- Bulalacao, Oriental Mindoro --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175204000 -->
| Q107624 <!-- Calapan, Oriental Mindoro --> = 62 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175205000 -->
| Q107559 <!-- Gloria, Oriental Mindoro --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175206000 -->
| Q107567 <!-- Mansalay, Oriental Mindoro --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175207000 -->
| Q107573 <!-- Naujan, Oriental Mindoro --> = 70 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175208000 -->
| Q107578 <!-- Pinamalayan, Oriental Mindoro --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175209000 -->
| Q107585 <!-- Pola, Oriental Mindoro --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175210000 -->
| Q107593 <!-- Puerto Galera, Oriental Mindoro --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175211000 -->
| Q107598 <!-- Roxas, Oriental Mindoro --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175212000 -->
| Q107606 <!-- San Teodoro, Oriental Mindoro --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175213000 -->
| Q107612 <!-- Socorro, Oriental Mindoro --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175214000 -->
| Q107618 <!-- Victoria, Oriental Mindoro --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175215000 -->
| Q111338 <!-- Aborlan, Palawan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175301000 -->
| Q111351 <!-- Agutaya, Palawan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175302000 -->
| Q111360 <!-- Araceli, Palawan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175303000 -->
| Q111372 <!-- Balabac, Palawan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175304000 -->
| Q111378 <!-- Bataraza, Palawan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175305000 -->
| Q111386 <!-- Brooke's Point, Palawan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175306000 -->
| Q111393 <!-- Busuanga, Palawan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175307000 -->
| Q111402 <!-- Cagayancillo, Palawan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175308000 -->
| Q111414 <!-- Coron, Palawan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175309000 -->
| Q111427 <!-- Culion, Palawan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175322000 -->
| Q111438 <!-- Cuyo, Palawan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175310000 -->
| Q111468 <!-- Dumaran, Palawan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175311000 -->
| Q111483 <!-- El Nido, Palawan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175312000 -->
| Q111495 <!-- Kalayaan, Palawan --> = 1 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175321000 -->
| Q111506 <!-- Linapacan, Palawan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175313000 -->
| Q111521 <!-- Magsaysay, Palawan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175314000 -->
| Q111535 <!-- Narra, Palawan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175315000 -->
| Q111739 <!-- Puerto Princesa --> = 66 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175316000 -->
| Q111662 <!-- Quezon, Palawan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175317000 -->
| Q111677 <!-- Rizal, Palawan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175323000 -->
| Q111689 <!-- Roxas, Palawan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175318000 -->
| Q111707 <!-- San Vicente, Palawan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175319000 -->
| Q111719 <!-- Sofronio Española, Palawan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175324000 -->
| Q111730 <!-- Taytay, Palawan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175320000 -->
| Q174497 <!-- Alcantara, Romblon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175901000 -->
| Q174511 <!-- Banton, Romblon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175902000 -->
| Q174525 <!-- Cajidiocan, Romblon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175903000 -->
| Q174544 <!-- Calatrava, Romblon --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175904000 -->
| Q174562 <!-- Concepcion, Romblon --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175905000 -->
| Q174575 <!-- Corcuera, Romblon --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175906000 -->
| Q174591 <!-- Ferrol, Romblon --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175916000 -->
| Q174607 <!-- Looc, Romblon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175907000 -->
| Q174620 <!-- Magdiwang, Romblon --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175908000 -->
| Q174632 <!-- Odiongan, Romblon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175909000 -->
| Q174649 <!-- Romblon , Romblon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175910000 -->
| Q174659 <!-- San Agustin, Romblon --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175911000 -->
| Q174667 <!-- San Andres, Romblon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175912000 -->
| Q174676 <!-- San Fernando, Romblon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175913000 -->
| Q174689 <!-- San Jose, Romblon --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175914000 -->
| Q174702 <!-- Santa Fe, Romblon --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175915000 -->
| Q174717 <!-- Santa Maria, Romblon --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175917000 -->
| Q174149 <!-- Bulusan, Sorsogon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056204000 -->
| Q174226 <!-- Juban, Sorsogon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056210000 -->
| Q174255 <!-- Pilar, Sorsogon --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056213000 -->
| Q174096 <!-- Sorsogon, Sorsogon --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056216000 -->
| Q434743 <!-- Altavas, Aklan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060401000 -->
| Q626586 <!-- Balete, Aklan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060402000 -->
| Q569215 <!-- Banga, Aklan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060403000 -->
| Q626645 <!-- Batan, Aklan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060404000 -->
| Q576805 <!-- Buruanga, Aklan --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060405000 -->
| Q626695 <!-- Ibajay, Aklan --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060406000 -->
| Q626721 <!-- Kalibo , Aklan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060407000 -->
| Q626746 <!-- Lezo, Aklan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060408000 -->
| Q626786 <!-- Libacao, Aklan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060409000 -->
| Q626820 <!-- Madalag, Aklan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060410000 -->
| Q626873 <!-- Makato, Aklan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060411000 -->
| Q626905 <!-- Malay, Aklan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060412000 -->
| Q626935 <!-- Malinao, Aklan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060413000 -->
| Q626959 <!-- Nabas, Aklan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060414000 -->
| Q626992 <!-- New Washington, Aklan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060415000 -->
| Q627008 <!-- Numancia, Aklan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060416000 -->
| Q627028 <!-- Tangalan, Aklan --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060417000 -->
| Q492119 <!-- Anini-y, Antique --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060601000 -->
| Q492155 <!-- Barbaza, Antique --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060602000 -->
| Q492263 <!-- Belison, Antique --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060603000 -->
| Q492325 <!-- Bugasong, Antique --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060604000 -->
| Q492363 <!-- Caluya, Antique --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060605000 -->
| Q492406 <!-- Culasi, Antique --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060606000 -->
| Q144779 <!-- Hamtic, Antique --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060608000 -->
| Q492479 <!-- Laua-an, Antique --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060609000 -->
| Q492516 <!-- Libertad, Antique --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060610000 -->
| Q492545 <!-- Pandan, Antique --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060611000 -->
| Q492577 <!-- Patnongon, Antique --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060612000 -->
| Q492619 <!-- San Jose, Antique --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060613000 -->
| Q492673 <!-- San Remigio, Antique --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060614000 -->
| Q492707 <!-- Sebaste, Antique --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060615000 -->
| Q492742 <!-- Sibalom, Antique --> = 76 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060616000 -->
| Q492780 <!-- Tibiao, Antique --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060617000 -->
| Q492817 <!-- Tobias Fornier, Antique --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060607000 -->
| Q492862 <!-- Valderrama, Antique --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060618000 -->
| Q355953 <!-- Cuartero, Capiz --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061901000 -->
| Q355986 <!-- Dao, Capiz --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061902000 -->
| Q356019 <!-- Dumalag, Capiz --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061903000 -->
| Q356053 <!-- Dumarao, Capiz --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061904000 -->
| Q356081 <!-- Ivisan, Capiz --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061905000 -->
| Q356106 <!-- Jamindan, Capiz --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061906000 -->
| Q356153 <!-- Ma-ayon, Capiz --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061907000 -->
| Q356174 <!-- Mambusao, Capiz --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061908000 -->
| Q356204 <!-- Panay, Capiz --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061909000 -->
| Q356231 <!-- Panitan, Capiz --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061910000 -->
| Q356266 <!-- Pilar, Capiz --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061911000 -->
| Q356292 <!-- Pontevedra, Capiz --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061912000 -->
| Q356313 <!-- President Roxas, Capiz --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061913000 -->
| Q2209 <!-- Roxas, Capiz --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061914000 -->
| Q356338 <!-- Sapi-an, Capiz --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061915000 -->
| Q356368 <!-- Sigma, Capiz --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061916000 -->
| Q356398 <!-- Tapaz, Capiz --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061917000 -->
| Q313781 <!-- Buenavista, Guimaras --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067901000 -->
| Q313802 <!-- Jordan, Guimaras --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067902000 -->
| Q313810 <!-- Nueva Valencia, Guimaras --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067903000 -->
| Q313825 <!-- San Lorenzo, Guimaras --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067904000 -->
| Q313844 <!-- Sibunag, Guimaras --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067905000 -->
| Q274491 <!-- Ajuy, Iloilo --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063001000 -->
| Q274508 <!-- Alimodian, Iloilo --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063002000 -->
| Q274543 <!-- Anilao, Iloilo --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063003000 -->
| Q274557 <!-- Badiangan, Iloilo --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063004000 -->
| Q274578 <!-- Balasan, Iloilo --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063005000 -->
| Q274595 <!-- Banate, Iloilo --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063006000 -->
| Q82502 <!-- Barotac Nuevo, Iloilo --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063007000 -->
| Q82493 <!-- Barotac Viejo, Iloilo --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063008000 -->
| Q274654 <!-- Batad, Iloilo --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063009000 -->
| Q274671 <!-- Bingawan, Iloilo --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063010000 -->
| Q274693 <!-- Cabatuan, Iloilo --> = 68 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063012000 -->
| Q274713 <!-- Calinog, Iloilo --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063013000 -->
| Q274731 <!-- Carles, Iloilo --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063014000 -->
| Q274749 <!-- Concepcion, Iloilo --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063015000 -->
| Q274780 <!-- Dingle, Iloilo --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063016000 -->
| Q274795 <!-- Dueñas, Iloilo --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063017000 -->
| Q74758 <!-- Dumangas, Iloilo --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063018000 -->
| Q82506 <!-- Estancia, Iloilo --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063019000 -->
| Q274847 <!-- Guimbal, Iloilo --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063020000 -->
| Q74755 <!-- Igbaras, Iloilo --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063021000 -->
| Q459787 <!-- Iloilo --> = 180 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063022000 -->
| Q82570 <!-- Janiuay, Iloilo --> = 60 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063023000 -->
| Q274907 <!-- Lambunao, Iloilo --> = 73 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063025000 -->
| Q274937 <!-- Leganes, Iloilo --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063026000 -->
| Q274961 <!-- Lemery, Iloilo --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063027000 -->
| Q274987 <!-- Leon, Iloilo --> = 85 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063028000 -->
| Q275015 <!-- Maasin, Iloilo --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063029000 -->
| Q74753 <!-- Miagao, Iloilo --> = 119 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063030000 -->
| Q275071 <!-- Mina, Iloilo --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063031000 -->
| Q275184 <!-- New Lucena, Iloilo --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063032000 -->
| Q275199 <!-- Oton, Iloilo --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063034000 -->
| Q1855693 <!-- Passi, Iloilo --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063035000 -->
| Q275221 <!-- Pavia, Iloilo --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063036000 -->
| Q275243 <!-- Pototan, Iloilo --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063037000 -->
| Q275264 <!-- San Dionisio, Iloilo --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063038000 -->
| Q275280 <!-- San Enrique, Iloilo --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063039000 -->
| Q275295 <!-- San Joaquin, Iloilo --> = 85 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063040000 -->
| Q275312 <!-- San Miguel, Iloilo --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063041000 -->
| Q275329 <!-- San Rafael, Iloilo --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063042000 -->
| Q275347 <!-- Santa Barbara, Iloilo --> = 60 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063043000 -->
| Q275368 <!-- Sara, Iloilo --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063044000 -->
| Q82497 <!-- Tigbauan, Iloilo --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063045000 -->
| Q275417 <!-- Tubungan, Iloilo --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063046000 -->
| Q148064 <!-- Zarraga, Iloilo --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063047000 -->
| Q5217 <!-- Bacolod --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/060000000 -->
| Q628297 <!-- Bago, Negros Occidental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064502000 -->
| Q195243 <!-- Binalbagan, Negros Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064503000 -->
| Q1020688 <!-- Cadiz, Negros Occidental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064504000 -->
| Q195258 <!-- Calatrava, Negros Occidental --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064505000 -->
| Q195272 <!-- Candoni, Negros Occidental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064506000 -->
| Q195287 <!-- Cauayan, Negros Occidental --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064507000 -->
| Q195304 <!-- Enrique B. Magalona, Negros Occidental --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064508000 -->
| Q1027743 <!-- Escalante, Negros Occidental --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064509000 -->
| Q1423846 <!-- Himamaylan, Negros Occidental --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064510000 -->
| Q195322 <!-- Hinigaran, Negros Occidental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064511000 -->
| Q195336 <!-- Hinoba-an, Negros Occidental --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064512000 -->
| Q195352 <!-- Ilog, Negros Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064513000 -->
| Q195373 <!-- Isabela, Negros Occidental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064514000 -->
| Q1026445 <!-- Kabankalan, Negros Occidental --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064515000 -->
| Q1789908 <!-- La Carlota, Negros Occidental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064516000 -->
| Q195397 <!-- La Castellana, Negros Occidental --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064517000 -->
| Q195418 <!-- Manapla, Negros Occidental --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064518000 -->
| Q195438 <!-- Moises Padilla, Negros Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064519000 -->
| Q195459 <!-- Murcia, Negros Occidental --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064520000 -->
| Q195477 <!-- Pontevedra, Negros Occidental --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064521000 -->
| Q195489 <!-- Pulupandan, Negros Occidental --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064522000 -->
| Q1787527 <!-- Sagay, Negros Occidental --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064523000 -->
| Q195503 <!-- Salvador Benedicto, Negros Occidental --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064532000 -->
| Q1025390 <!-- San Carlos, Negros Occidental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064524000 -->
| Q195523 <!-- San Enrique, Negros Occidental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064525000 -->
| Q1020696 <!-- Silay, Negros Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064526000 -->
| Q1027115 <!-- Sipalay, Negros Occidental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064527000 -->
| Q1027120 <!-- Talisay, Negros Occidental --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064528000 -->
| Q195549 <!-- Toboso, Negros Occidental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064529000 -->
| Q195569 <!-- Valladolid, Negros Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064530000 -->
| Q1026021 <!-- Victorias, Negros Occidental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064531000 -->
| Q194822 <!-- Amlan, Negros Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074601000 -->
| Q194854 <!-- Ayungon, Negros Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074602000 -->
| Q194874 <!-- Bacong, Negros Oriental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074603000 -->
| Q628590 <!-- Bais, Negros Oriental --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074604000 -->
| Q194900 <!-- Basay, Negros Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074605000 -->
| Q812113 <!-- Bayawan, Negros Oriental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074606000 -->
| Q194916 <!-- Bindoy, Negros Oriental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074607000 -->
| Q991602 <!-- Canlaon, Negros Oriental --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074608000 -->
| Q194940 <!-- Dauin, Negros Oriental --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074609000 -->
| Q873377 <!-- Dumaguete, Negros Oriental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074610000 -->
| Q195197 <!-- Guihulngan, Negros Oriental --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074611000 -->
| Q194967 <!-- Jimalalud, Negros Oriental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074612000 -->
| Q194983 <!-- La Libertad, Negros Oriental --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074613000 -->
| Q195004 <!-- Mabinay, Negros Oriental --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074614000 -->
| Q195018 <!-- Manjuyod, Negros Oriental --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074615000 -->
| Q195040 <!-- Pamplona, Negros Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074616000 -->
| Q195056 <!-- San Jose, Negros Oriental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074617000 -->
| Q195074 <!-- Santa Catalina, Negros Oriental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074618000 -->
| Q195090 <!-- Siaton, Negros Oriental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074619000 -->
| Q195106 <!-- Sibulan, Negros Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074620000 -->
| Q1020705 <!-- Tanjay, Negros Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074621000 -->
| Q195121 <!-- Tayasan, Negros Oriental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074622000 -->
| Q195140 <!-- Valencia, Negros Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074623000 -->
| Q195164 <!-- Vallehermoso, Negros Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074624000 -->
| Q145673 <!-- Zamboanguita, Negros Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074625000 -->
| Q404369 <!-- Alburquerque, Bohol --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071201000 -->
| Q404403 <!-- Alicia, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071202000 -->
| Q404434 <!-- Anda, Bohol --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071203000 -->
| Q404459 <!-- Antequera, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071204000 -->
| Q404489 <!-- Baclayon, Bohol --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071205000 -->
| Q404519 <!-- Balilihan, Bohol --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071206000 -->
| Q404549 <!-- Batuan, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071207000 -->
| Q404581 <!-- Bien Unido, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071248000 -->
| Q404604 <!-- Bilar, Bohol --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071208000 -->
| Q404623 <!-- Buenavista, Bohol --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071209000 -->
| Q404652 <!-- Calape, Bohol --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071210000 -->
| Q404680 <!-- Candijay, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071211000 -->
| Q241239 <!-- Carmen, Bohol --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071212000 -->
| Q404750 <!-- Catigbian, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071213000 -->
| Q404775 <!-- Clarin, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071214000 -->
| Q404799 <!-- Corella, Bohol --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071215000 -->
| Q404825 <!-- Cortes, Bohol --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071216000 -->
| Q404854 <!-- Dagohoy, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071217000 -->
| Q404882 <!-- Danao, Bohol --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071218000 -->
| Q404908 <!-- Dauis, Bohol --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071219000 -->
| Q404930 <!-- Dimiao, Bohol --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071220000 -->
| Q404951 <!-- Duero, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071221000 -->
| Q404976 <!-- Garcia Hernandez, Bohol --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071222000 -->
| Q405005 <!-- Getafe, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071226000 -->
| Q405058 <!-- Guindulman, Bohol --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071223000 -->
| Q405088 <!-- Inabanga, Bohol --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071224000 -->
| Q405110 <!-- Jagna, Bohol --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071225000 -->
| Q405141 <!-- Lila, Bohol --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071227000 -->
| Q405171 <!-- Loay, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071228000 -->
| Q405197 <!-- Loboc, Bohol --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071229000 -->
| Q405224 <!-- Loon, Bohol --> = 67 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071230000 -->
| Q405268 <!-- Mabini, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071231000 -->
| Q405303 <!-- Maribojoc, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071232000 -->
| Q178330 <!-- Panglao, Bohol --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071233000 -->
| Q405384 <!-- Pilar, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071234000 -->
| Q405427 <!-- President Carlos P. Garcia, Bohol --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071235000 -->
| Q405472 <!-- Sagbayan, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071236000 -->
| Q259298 <!-- San Isidro, Bohol --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071237000 -->
| Q405544 <!-- San Miguel, Bohol --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071238000 -->
| Q386388 <!-- Sevilla, Bohol --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071239000 -->
| Q405628 <!-- Sierra Bullones, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071240000 -->
| Q405674 <!-- Sikatuna, Bohol --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071241000 -->
| Q1826 <!-- Tagbilaran, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071242000 -->
| Q405714 <!-- Talibon, Bohol --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071243000 -->
| Q405749 <!-- Trinidad, Bohol --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071244000 -->
| Q405980 <!-- Tubigon, Bohol --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071245000 -->
| Q406015 <!-- Ubay, Bohol --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071246000 -->
| Q406046 <!-- Valencia, Bohol --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071247000 -->
| Q315636 <!-- Alcantara, Cebu --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072201000 -->
| Q315655 <!-- Alcoy, Cebu --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072202000 -->
| Q315669 <!-- Alegria, Cebu --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072203000 -->
| Q315687 <!-- Aloguinsan, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072204000 -->
| Q315703 <!-- Argao, Cebu --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072205000 -->
| Q315719 <!-- Asturias, Cebu --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072206000 -->
| Q315733 <!-- Badian, Cebu --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072207000 -->
| Q315754 <!-- Balamban, Cebu --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072208000 -->
| Q315771 <!-- Bantayan, Cebu --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072209000 -->
| Q315790 <!-- Barili, Cebu --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072210000 -->
| Q890623 <!-- Bogo, Cebu --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072211000 -->
| Q315809 <!-- Boljoon, Cebu --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072212000 -->
| Q315827 <!-- Borbon, Cebu --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072213000 -->
| Q315851 <!-- Carcar, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072214000 -->
| Q315882 <!-- Carmen, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072215000 -->
| Q315900 <!-- Catmon, Cebu --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072216000 -->
| Q1467 <!-- Cebu --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072217000 -->
| Q315923 <!-- Compostela, Cebu --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072218000 -->
| Q315945 <!-- Consolacion, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072219000 -->
| Q315965 <!-- Cordova, Cebu --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072220000 -->
| Q315981 <!-- Daanbantayan, Cebu --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072221000 -->
| Q316001 <!-- Dalaguete, Cebu --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072222000 -->
| Q1159273 <!-- Danao, Cebu --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072223000 -->
| Q316019 <!-- Dumanjug, Cebu --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072224000 -->
| Q316037 <!-- Ginatilan, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072225000 -->
| Q574903 <!-- Lapu-Lapu --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072226000 -->
| Q316056 <!-- Liloan, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072227000 -->
| Q316080 <!-- Madridejos, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072228000 -->
| Q316101 <!-- Malabuyoc, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072229000 -->
| Q1889017 <!-- Mandaue --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072230000 -->
| Q316125 <!-- Medellin, Cebu --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072231000 -->
| Q316146 <!-- Minglanilla, Cebu --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072232000 -->
| Q316171 <!-- Moalboal, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072233000 -->
| Q316197 <!-- Naga, Cebu --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072234000 -->
| Q316230 <!-- Oslob, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072235000 -->
| Q316245 <!-- Pilar, Cebu --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072236000 -->
| Q316259 <!-- Pinamungahan, Cebu --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072237000 -->
| Q316275 <!-- Poro, Cebu --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072238000 -->
| Q316289 <!-- Ronda, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072239000 -->
| Q316303 <!-- Samboan, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072240000 -->
| Q316318 <!-- San Fernando, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072241000 -->
| Q316332 <!-- San Francisco, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072242000 -->
| Q316350 <!-- San Remigio, Cebu --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072243000 -->
| Q316370 <!-- Santa Fe, Cebu --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072244000 -->
| Q316386 <!-- Santander, Cebu --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072245000 -->
| Q316404 <!-- Sibonga, Cebu --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072246000 -->
| Q316432 <!-- Sogod, Cebu --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072247000 -->
| Q316453 <!-- Tabogon, Cebu --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072248000 -->
| Q316474 <!-- Tabuelan, Cebu --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072249000 -->
| Q316500 <!-- Talisay, Cebu --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072250000 -->
| Q316527 <!-- Toledo, Cebu --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072251000 -->
| Q316547 <!-- Tuburan, Cebu --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072252000 -->
| Q316564 <!-- Tudela, Cebu --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072253000 -->
| Q174305 <!-- Enrique Villanueva, Siquijor --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076101000 -->
| Q174317 <!-- Larena, Siquijor --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076102000 -->
| Q174332 <!-- Lazi, Siquijor --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076103000 -->
| Q174343 <!-- Maria, Siquijor --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076104000 -->
| Q174354 <!-- San Juan, Siquijor --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076105000 -->
| Q174373 <!-- Siquijor, Siquijor --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076106000 -->
| Q406163 <!-- Almeria, Biliran --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087801000 -->
| Q406186 <!-- Biliran, Biliran --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087802000 -->
| Q406226 <!-- Cabucgayan, Biliran --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087803000 -->
| Q406267 <!-- Caibiran, Biliran --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087804000 -->
| Q406317 <!-- Culaba, Biliran --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087805000 -->
| Q406353 <!-- Kawayan, Biliran --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087806000 -->
| Q406393 <!-- Maripipi, Biliran --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087807000 -->
| Q277211 <!-- Naval, Biliran --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087808000 -->
| Q313880 <!-- Arteche, Eastern Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082601000 -->
| Q313904 <!-- Balangiga, Eastern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082602000 -->
| Q313914 <!-- Balangkayan, Eastern Samar --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082603000 -->
| Q894059 <!-- Borongan, Eastern Samar --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082604000 -->
| Q313926 <!-- Can-avid, Eastern Samar --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082605000 -->
| Q313939 <!-- Dolores, Eastern Samar --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082606000 -->
| Q313951 <!-- General MacArthur, Eastern Samar --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082607000 -->
| Q313967 <!-- Giporlos, Eastern Samar --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082608000 -->
| Q313984 <!-- Guiuan, Eastern Samar --> = 60 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082609000 -->
| Q314002 <!-- Hernani, Eastern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082610000 -->
| Q314021 <!-- Jipapad, Eastern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082611000 -->
| Q314046 <!-- Lawaan, Eastern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082612000 -->
| Q314070 <!-- Llorente, Eastern Samar --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082613000 -->
| Q314096 <!-- Maslog, Eastern Samar --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082614000 -->
| Q314117 <!-- Maydolong, Eastern Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082615000 -->
| Q314129 <!-- Mercedes, Eastern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082616000 -->
| Q314154 <!-- Oras, Eastern Samar --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082617000 -->
| Q314175 <!-- Quinapondan, Eastern Samar --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082618000 -->
| Q314197 <!-- Salcedo, Eastern Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082619000 -->
| Q314220 <!-- San Julian, Eastern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082620000 -->
| Q314239 <!-- San Policarpo, Eastern Samar --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082621000 -->
| Q314257 <!-- Sulat, Eastern Samar --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082622000 -->
| Q205677 <!-- Taft, Eastern Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082623000 -->
| Q212877 <!-- Abuyog, Leyte --> = 63 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083701000 -->
| Q212888 <!-- Alangalang, Leyte --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083702000 -->
| Q212896 <!-- Albuera, Leyte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083703000 -->
| Q212907 <!-- Babatngon, Leyte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083705000 -->
| Q212924 <!-- Barugo, Leyte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083706000 -->
| Q212935 <!-- Bato, Leyte --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083707000 -->
| Q812117 <!-- Baybay, Leyte --> = 92 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083708000 -->
| Q212945 <!-- Burauen, Leyte --> = 77 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083710000 -->
| Q212951 <!-- Calubian, Leyte --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083713000 -->
| Q212958 <!-- Capoocan, Leyte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083714000 -->
| Q212969 <!-- Carigara, Leyte --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083715000 -->
| Q212981 <!-- Dagami, Leyte --> = 65 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083717000 -->
| Q212988 <!-- Dulag, Leyte --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083718000 -->
| Q213006 <!-- Hilongos, Leyte --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083719000 -->
| Q213024 <!-- Hindang, Leyte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083720000 -->
| Q213042 <!-- Inopacan, Leyte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083721000 -->
| Q213060 <!-- Isabel, Leyte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083722000 -->
| Q213086 <!-- Jaro, Leyte --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083723000 -->
| Q213101 <!-- Javier, Leyte --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083724000 -->
| Q213113 <!-- Julita, Leyte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083725000 -->
| Q213130 <!-- Kananga, Leyte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083726000 -->
| Q213144 <!-- La Paz, Leyte --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083728000 -->
| Q213160 <!-- Leyte, Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083729000 -->
| Q213174 <!-- MacArthur, Leyte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083730000 -->
| Q213190 <!-- Mahaplag, Leyte --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083731000 -->
| Q213209 <!-- Matag-ob, Leyte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083733000 -->
| Q213227 <!-- Matalom, Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083734000 -->
| Q213245 <!-- Mayorga, Leyte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083735000 -->
| Q213261 <!-- Merida, Leyte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083736000 -->
| Q1014782 <!-- Ormoc --> = 85 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083738000 -->
| Q213281 <!-- Palo, Leyte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083739000 -->
| Q213303 <!-- Palompon, Leyte --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083740000 -->
| Q213323 <!-- Pastrana, Leyte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083741000 -->
| Q213341 <!-- San Isidro, Leyte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083742000 -->
| Q213357 <!-- San Miguel, Leyte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083743000 -->
| Q213378 <!-- Santa Fe, Leyte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083744000 -->
| Q213400 <!-- Tabango, Leyte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083745000 -->
| Q213420 <!-- Tabontabon, Leyte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083746000 -->
| Q40626 <!-- Tacloban --> = 138 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083747000 -->
| Q213431 <!-- Tanauan, Leyte --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083748000 -->
| Q213442 <!-- Tolosa, Leyte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083749000 -->
| Q213455 <!-- Tunga, Leyte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083750000 -->
| Q213463 <!-- Villaba, Leyte --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083751000 -->
| Q174784 <!-- Allen, Northern Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084801000 -->
| Q174801 <!-- Biri, Northern Samar --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084802000 -->
| Q174822 <!-- Bobon, Northern Samar --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084803000 -->
| Q174871 <!-- Capul, Northern Samar --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084804000 -->
| Q174886 <!-- Catarman , Northern Samar --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084805000 -->
| Q174906 <!-- Catubig, Northern Samar --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084806000 -->
| Q174919 <!-- Gamay, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084807000 -->
| Q174940 <!-- Laoang, Northern Samar --> = 56 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084808000 -->
| Q174962 <!-- Lapinig, Northern Samar --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084809000 -->
| Q174987 <!-- Las Navas, Northern Samar --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084810000 -->
| Q175008 <!-- Lavezares, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084811000 -->
| Q175031 <!-- Lope de Vega, Northern Samar --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084824000 -->
| Q175054 <!-- Mapanas, Northern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084812000 -->
| Q175082 <!-- Mondragon, Northern Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084813000 -->
| Q175100 <!-- Palapag, Northern Samar --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084814000 -->
| Q175115 <!-- Pambujan, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084815000 -->
| Q175136 <!-- Rosario, Northern Samar --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084816000 -->
| Q175163 <!-- San Antonio, Northern Samar --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084817000 -->
| Q175183 <!-- San Isidro, Northern Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084818000 -->
| Q175203 <!-- San Jose, Northern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084819000 -->
| Q175230 <!-- San Roque, Northern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084820000 -->
| Q175247 <!-- San Vicente, Northern Samar --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084821000 -->
| Q175267 <!-- Silvino Lobos, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084822000 -->
| Q175283 <!-- Victoria, Northern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084823000 -->
| Q816088 <!-- Almagro, Samar --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086001000 -->
| Q809957 <!-- Basey, Samar --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086002000 -->
| Q577336 <!-- Calbayog, Samar --> = 157 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086003000 -->
| Q816128 <!-- Calbiga, Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086004000 -->
| Q1020709 <!-- Catbalogan, Samar --> = 57 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086005000 -->
| Q816142 <!-- Daram, Samar --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086006000 -->
| Q816160 <!-- Gandara, Samar --> = 69 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086007000 -->
| Q816184 <!-- Hinabangan, Samar --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086008000 -->
| Q816207 <!-- Jiabong, Samar --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086009000 -->
| Q816240 <!-- Marabut, Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086010000 -->
| Q816267 <!-- Matuguinao, Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086011000 -->
| Q816296 <!-- Motiong, Samar --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086012000 -->
| Q816320 <!-- Pagsanghan, Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086026000 -->
| Q816342 <!-- Paranas, Samar --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086022000 -->
| Q252184 <!-- Pinabacdao, Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086013000 -->
| Q816396 <!-- San Jorge, Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086025000 -->
| Q816413 <!-- San Jose de Buan, Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086014000 -->
| Q816435 <!-- San Sebastian, Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086015000 -->
| Q816454 <!-- Santa Margarita, Samar --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086016000 -->
| Q816471 <!-- Santa Rita, Samar --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086017000 -->
| Q608320 <!-- Santo Niño, Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086018000 -->
| Q126346 <!-- Tagapul-an, Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086024000 -->
| Q816519 <!-- Talalora, Samar --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086019000 -->
| Q816542 <!-- Tarangnan, Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086020000 -->
| Q816564 <!-- Villareal, Samar --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086021000 -->
| Q229664 <!-- Zumarraga, Samar --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086023000 -->
| Q173608 <!-- Anahawan, Southern Leyte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086401000 -->
| Q173622 <!-- Bontoc, Southern Leyte --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086402000 -->
| Q173632 <!-- Hinunangan, Southern Leyte --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086403000 -->
| Q173641 <!-- Hinundayan, Southern Leyte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086404000 -->
| Q173655 <!-- Libagon, Southern Leyte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086405000 -->
| Q173665 <!-- Liloan, Southern Leyte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086406000 -->
| Q173678 <!-- Limasawa, Southern Leyte --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086419000 -->
| Q1025387 <!-- Maasin, Southern Leyte --> = 70 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086407000 -->
| Q173688 <!-- Macrohon, Southern Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086408000 -->
| Q173701 <!-- Malitbog, Southern Leyte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086409000 -->
| Q173713 <!-- Padre Burgos, Southern Leyte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086410000 -->
| Q173723 <!-- Pintuyan, Southern Leyte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086411000 -->
| Q173735 <!-- Saint Bernard, Southern Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086412000 -->
| Q173745 <!-- San Francisco, Southern Leyte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086413000 -->
| Q173754 <!-- San Juan, Southern Leyte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086414000 -->
| Q173763 <!-- San Ricardo, Southern Leyte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086415000 -->
| Q173774 <!-- Silago, Southern Leyte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086416000 -->
| Q173792 <!-- Sogod, Southern Leyte --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086417000 -->
| Q173811 <!-- Tomas Oppus, Southern Leyte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086418000 -->
| Q132482 <!-- Baliguian, Zamboanga del Norte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097224000 -->
| Q1014775 <!-- Dapitan, Zamboanga del Norte --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097201000 -->
| Q432169 <!-- Dipolog, Zamboanga del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097202000 -->
| Q132496 <!-- Godod, Zamboanga del Norte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097225000 -->
| Q132507 <!-- Gutalac, Zamboanga del Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097223000 -->
| Q132520 <!-- Jose Dalman, Zamboanga del Norte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097222000 -->
| Q132523 <!-- Kalawit, Zamboanga del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097227000 -->
| Q132527 <!-- Katipunan, Zamboanga del Norte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097203000 -->
| Q132532 <!-- La Libertad, Zamboanga del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097204000 -->
| Q132535 <!-- Labason, Zamboanga del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097205000 -->
| Q132540 <!-- Leon B. Postigo, Zamboanga del Norte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097226000 -->
| Q132553 <!-- Liloy, Zamboanga del Norte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097206000 -->
| Q132561 <!-- Manukan, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097207000 -->
| Q132566 <!-- Mutia, Zamboanga del Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097208000 -->
| Q132570 <!-- Piñan, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097209000 -->
| Q132574 <!-- Polanco, Zamboanga del Norte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097210000 -->
| Q132578 <!-- President Manuel A. Roxas, Zamboanga del Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097211000 -->
| Q132583 <!-- Rizal, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097212000 -->
| Q132586 <!-- Salug, Zamboanga del Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097213000 -->
| Q132591 <!-- Sergio Osmeña Sr., Zamboanga del Norte --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097214000 -->
| Q132594 <!-- Siayan, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097215000 -->
| Q132599 <!-- Sibuco, Zamboanga del Norte --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097216000 -->
| Q132601 <!-- Sibutad, Zamboanga del Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097217000 -->
| Q132605 <!-- Sindangan, Zamboanga del Norte --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097218000 -->
| Q132610 <!-- Siocon, Zamboanga del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097219000 -->
| Q132613 <!-- Sirawai, Zamboanga del Norte --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097220000 -->
| Q132617 <!-- Tampilisan, Zamboanga del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097221000 -->
| Q132015 <!-- Aurora, Zamboanga del Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097302000 -->
| Q132032 <!-- Bayog, Zamboanga del Sur --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097303000 -->
| Q132057 <!-- Dimataling, Zamboanga del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097305000 -->
| Q132077 <!-- Dinas, Zamboanga del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097306000 -->
| Q132104 <!-- Dumalinao, Zamboanga del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097307000 -->
| Q132126 <!-- Dumingag, Zamboanga del Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097308000 -->
| Q132141 <!-- Guipos, Zamboanga del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097343000 -->
| Q132155 <!-- Josefina, Zamboanga del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097337000 -->
| Q132161 <!-- Kumalarang, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097311000 -->
| Q132184 <!-- Labangan, Zamboanga del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097312000 -->
| Q132200 <!-- Lakewood, Zamboanga del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097333000 -->
| Q132215 <!-- Lapuyan, Zamboanga del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097313000 -->
| Q132230 <!-- Mahayag, Zamboanga del Sur --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097315000 -->
| Q132244 <!-- Margosatubig, Zamboanga del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097317000 -->
| Q132262 <!-- Midsalip, Zamboanga del Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097318000 -->
| Q132271 <!-- Molave, Zamboanga del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097319000 -->
| Q874270 <!-- Pagadian, Zamboanga del Sur --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097322000 -->
| Q132284 <!-- Pitogo, Zamboanga del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097338000 -->
| Q132301 <!-- Ramon Magsaysay, Zamboanga del Sur --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097323000 -->
| Q132317 <!-- San Miguel, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097324000 -->
| Q132337 <!-- San Pablo, Zamboanga del Sur --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097325000 -->
| Q132353 <!-- Sominot, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097340000 -->
| Q132371 <!-- Tabina, Zamboanga del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097327000 -->
| Q132391 <!-- Tambulig, Zamboanga del Sur --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097328000 -->
| Q132403 <!-- Tigbao, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097344000 -->
| Q132417 <!-- Tukuran, Zamboanga del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097330000 -->
| Q132432 <!-- Vincenzo A. Sagun, Zamboanga del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097341000 -->
| Q1629 <!-- Zamboanga --> = 98 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097332000 -->
| Q131797 <!-- Alicia, Zamboanga Sibugay --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098301000 -->
| Q131811 <!-- Buug, Zamboanga Sibugay --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098302000 -->
| Q131816 <!-- Diplahan, Zamboanga Sibugay --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098303000 -->
| Q131838 <!-- Imelda, Zamboanga Sibugay --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098304000 -->
| Q131850 <!-- Ipil, Zamboanga Sibugay --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098305000 -->
| Q131870 <!-- Kabasalan, Zamboanga Sibugay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098306000 -->
| Q131892 <!-- Mabuhay, Zamboanga Sibugay --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098307000 -->
| Q131906 <!-- Malangas, Zamboanga Sibugay --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098308000 -->
| Q131917 <!-- Naga, Zamboanga Sibugay --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098309000 -->
| Q131926 <!-- Olutanga, Zamboanga Sibugay --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098310000 -->
| Q131941 <!-- Payao, Zamboanga Sibugay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098311000 -->
| Q131954 <!-- Roseller Lim, Zamboanga Sibugay --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098312000 -->
| Q124780 <!-- Siay, Zamboanga Sibugay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098313000 -->
| Q131968 <!-- Talusan, Zamboanga Sibugay --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098314000 -->
| Q131975 <!-- Titay, Zamboanga Sibugay --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098315000 -->
| Q131984 <!-- Tungawan, Zamboanga Sibugay --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098316000 -->
| Q356943 <!-- Baungon, Bukidnon --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101301000 -->
| Q356971 <!-- Cabanglasan, Bukidnon --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101322000 -->
| Q356997 <!-- Damulog, Bukidnon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101302000 -->
| Q357021 <!-- Dangcagan, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101303000 -->
| Q357053 <!-- Don Carlos, Bukidnon --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101304000 -->
| Q357075 <!-- Impasug-ong, Bukidnon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101305000 -->
| Q357100 <!-- Kadingilan, Bukidnon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101306000 -->
| Q357124 <!-- Kalilangan, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101307000 -->
| Q357152 <!-- Kibawe, Bukidnon --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101308000 -->
| Q357175 <!-- Kitaotao, Bukidnon --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101309000 -->
| Q357198 <!-- Lantapan, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101310000 -->
| Q357226 <!-- Libona, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101311000 -->
| Q1856 <!-- Malaybalay, Bukidnon --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101312000 -->
| Q357252 <!-- Malitbog, Bukidnon --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101313000 -->
| Q357272 <!-- Manolo Fortich, Bukidnon --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101314000 -->
| Q357299 <!-- Maramag, Bukidnon --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101315000 -->
| Q357311 <!-- Pangantucan, Bukidnon --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101316000 -->
| Q357342 <!-- Quezon, Bukidnon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101317000 -->
| Q357371 <!-- San Fernando, Bukidnon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101318000 -->
| Q357396 <!-- Sumilao, Bukidnon --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101319000 -->
| Q357420 <!-- Talakag, Bukidnon --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101320000 -->
| Q2158 <!-- Valencia, Bukidnon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101321000 -->
| Q356442 <!-- Catarman, Camiguin --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101801000 -->
| Q356472 <!-- Guinsiliban, Camiguin --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101802000 -->
| Q176033 <!-- Mahinog, Camiguin --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101803000 -->
| Q356518 <!-- Mambajao, Camiguin --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101804000 -->
| Q356549 <!-- Sagay, Camiguin --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101805000 -->
| Q274150 <!-- Bacolod, Lanao del Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103501000 -->
| Q274164 <!-- Baloi, Lanao del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103502000 -->
| Q274173 <!-- Baroy, Lanao del Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103503000 -->
| Q285488 <!-- Iligan --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103504000 -->
| Q274186 <!-- Kapatagan, Lanao del Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103505000 -->
| Q274197 <!-- Kauswagan, Lanao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103507000 -->
| Q274205 <!-- Kolambugan, Lanao del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103508000 -->
| Q274215 <!-- Lala, Lanao del Norte --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103509000 -->
| Q274230 <!-- Linamon, Lanao del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103510000 -->
| Q274243 <!-- Magsaysay, Lanao del Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103511000 -->
| Q274260 <!-- Maigo, Lanao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103512000 -->
| Q274272 <!-- Matungao, Lanao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103513000 -->
| Q274287 <!-- Munai, Lanao del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103514000 -->
| Q274299 <!-- Nunungan, Lanao del Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103515000 -->
| Q274313 <!-- Pantao Ragat, Lanao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103516000 -->
| Q274329 <!-- Pantar, Lanao del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103523000 -->
| Q274343 <!-- Poona Piagapo, Lanao del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103517000 -->
| Q274357 <!-- Salvador, Lanao del Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103518000 -->
| Q274369 <!-- Sapad, Lanao del Norte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103519000 -->
| Q274387 <!-- Sultan Naga Dimaporo, Lanao del Norte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103506000 -->
| Q274406 <!-- Tagoloan, Lanao del Norte --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103520000 -->
| Q274427 <!-- Tangcal, Lanao del Norte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103521000 -->
| Q274439 <!-- Tubod, Lanao del Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103522000 -->
| Q155502 <!-- Aloran, Misamis Occidental --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104201000 -->
| Q196056 <!-- Baliangao, Misamis Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104202000 -->
| Q196076 <!-- Bonifacio, Misamis Occidental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104203000 -->
| Q196097 <!-- Calamba, Misamis Occidental --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104204000 -->
| Q196114 <!-- Clarin, Misamis Occidental --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104205000 -->
| Q196129 <!-- Concepcion, Misamis Occidental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104206000 -->
| Q196145 <!-- Don Victoriano Chiongbian, Misamis Occidental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104217000 -->
| Q196158 <!-- Jimenez, Misamis Occidental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104207000 -->
| Q196173 <!-- Lopez Jaena, Misamis Occidental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104208000 -->
| Q1067897 <!-- Oroquieta, Misamis Occidental --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104209000 -->
| Q263837 <!-- Ozamiz, Misamis Occidental --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104210000 -->
| Q196191 <!-- Panaon, Misamis Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104211000 -->
| Q196207 <!-- Plaridel, Misamis Occidental --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104212000 -->
| Q196222 <!-- Sapang Dalaga, Misamis Occidental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104213000 -->
| Q196233 <!-- Sinacaban, Misamis Occidental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104214000 -->
| Q1026277 <!-- Tangub, Misamis Occidental --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104215000 -->
| Q196248 <!-- Tudela, Misamis Occidental --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104216000 -->
| Q195623 <!-- Alubijid, Misamis Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/104300000 -->
| Q195637 <!-- Balingasag, Misamis Oriental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104302000 -->
| Q195650 <!-- Balingoan, Misamis Oriental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104303000 -->
| Q195663 <!-- Binuangan, Misamis Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104304000 -->
| Q1645 <!-- Cagayan de Oro --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104305000 -->
| Q195676 <!-- Claveria, Misamis Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104306000 -->
| Q195686 <!-- El Salvador, Misamis Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104307000 -->
| Q1525029 <!-- Gingoog, Misamis Oriental --> = 79 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104308000 -->
| Q195696 <!-- Gitagum, Misamis Oriental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104309000 -->
| Q195709 <!-- Initao, Misamis Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104310000 -->
| Q195717 <!-- Jasaan, Misamis Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104311000 -->
| Q195726 <!-- Kinoguitan, Misamis Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104312000 -->
| Q195740 <!-- Lagonglong, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104313000 -->
| Q195755 <!-- Laguindingan, Misamis Oriental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104314000 -->
| Q195767 <!-- Libertad, Misamis Oriental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104315000 -->
| Q195780 <!-- Lugait, Misamis Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104316000 -->
| Q195799 <!-- Magsaysay, Misamis Oriental --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104318000 -->
| Q195815 <!-- Manticao, Misamis Oriental --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104317000 -->
| Q195834 <!-- Medina, Misamis Oriental --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104319000 -->
| Q195855 <!-- Naawan, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104320000 -->
| Q195870 <!-- Opol, Misamis Oriental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104321000 -->
| Q195883 <!-- Salay, Misamis Oriental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104322000 -->
| Q195899 <!-- Sugbongcogon, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104323000 -->
| Q1026274 <!-- Tagoloan, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104324000 -->
| Q195917 <!-- Talisayan, Misamis Oriental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104325000 -->
| Q195937 <!-- Villanueva, Misamis Oriental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104326000 -->
| Q627390 <!-- Buenavista, Agusan del Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160201000 -->
| Q1686 <!-- Butuan --> = 86 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160202000 -->
| Q1692 <!-- Cabadbaran, Agusan del Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160203000 -->
| Q627434 <!-- Carmen, Agusan del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160204000 -->
| Q627461 <!-- Jabonga, Agusan del Norte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160205000 -->
| Q627495 <!-- Kitcharao, Agusan del Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160206000 -->
| Q627529 <!-- Las Nieves, Agusan del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160207000 -->
| Q627572 <!-- Magallanes, Agusan del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160208000 -->
| Q627604 <!-- Nasipit, Agusan del Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160209000 -->
| Q627638 <!-- Remedios T. Romualdez, Agusan del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160212000 -->
| Q588955 <!-- Santiago, Agusan del Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160210000 -->
| Q176975 <!-- Tubay, Agusan del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160211000 -->
| Q1694 <!-- Bayugan, Agusan del Sur --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160301000 -->
| Q627049 <!-- Bunawan, Agusan del Sur --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160302000 -->
| Q627077 <!-- Esperanza, Agusan del Sur --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160303000 -->
| Q627107 <!-- La Paz, Agusan del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160304000 -->
| Q627120 <!-- Loreto, Agusan del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160305000 -->
| Q627144 <!-- Prosperidad, Agusan del Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160306000 -->
| Q627167 <!-- Rosario, Agusan del Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160307000 -->
| Q627190 <!-- San Francisco, Agusan del Sur --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160308000 -->
| Q627210 <!-- San Luis, Agusan del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160309000 -->
| Q627231 <!-- Santa Josefa, Agusan del Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160310000 -->
| Q627260 <!-- Sibagat, Agusan del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160314000 -->
| Q627286 <!-- Talacogon, Agusan del Sur --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160311000 -->
| Q627320 <!-- Trento, Agusan del Sur --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160312000 -->
| Q627349 <!-- Veruela, Agusan del Sur --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160313000 -->
| Q314298 <!-- Basilisa, Dinagat Islands --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168501000 -->
| Q314318 <!-- Cagdianao, Dinagat Islands --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168502000 -->
| Q314336 <!-- Dinagat, Dinagat Islands --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168503000 -->
| Q314345 <!-- Libjo, Dinagat Islands --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168504000 -->
| Q314356 <!-- Loreto, Dinagat Islands --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168505000 -->
| Q251691 <!-- San Jose, Dinagat Islands --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168506000 -->
| Q314374 <!-- Tubajon, Dinagat Islands --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168507000 -->
| Q155706 <!-- Alegria, Surigao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166701000 -->
| Q155720 <!-- Bacuag, Surigao del Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166702000 -->
| Q155735 <!-- Burgos, Surigao del Norte --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166704000 -->
| Q155748 <!-- Claver, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166706000 -->
| Q155763 <!-- Dapa, Surigao del Norte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166707000 -->
| Q28735 <!-- Del Carmen, Surigao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166708000 -->
| Q155784 <!-- General Luna, Surigao del Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166710000 -->
| Q155795 <!-- Gigaquit, Surigao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166711000 -->
| Q155808 <!-- Mainit, Surigao del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166714000 -->
| Q155819 <!-- Malimono, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166715000 -->
| Q155830 <!-- Pilar, Surigao del Norte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166716000 -->
| Q155839 <!-- Placer, Surigao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166717000 -->
| Q155849 <!-- San Benito, Surigao del Norte --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166718000 -->
| Q155864 <!-- San Francisco , Surigao del Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166719000 -->
| Q155876 <!-- San Isidro, Surigao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166720000 -->
| Q28958 <!-- Santa Monica , Surigao del Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166721000 -->
| Q155905 <!-- Sison, Surigao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166722000 -->
| Q155917 <!-- Socorro, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166723000 -->
| Q1019949 <!-- Surigao, Surigao del Norte --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166724000 -->
| Q155934 <!-- Tagana-an, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166725000 -->
| Q155946 <!-- Tubod, Surigao del Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166727000 -->
| Q155471 <!-- Barobo, Surigao del Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166801000 -->
| Q155499 <!-- Bayabas, Surigao del Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166802000 -->
| Q866414 <!-- Bislig, Surigao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166803000 -->
| Q155524 <!-- Cagwait, Surigao del Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166804000 -->
| Q155536 <!-- Cantilan, Surigao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166805000 -->
| Q155548 <!-- Carmen, Surigao del Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166806000 -->
| Q155558 <!-- Carrascal, Surigao del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166807000 -->
| Q155568 <!-- Cortes, Surigao del Sur --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166808000 -->
| Q155576 <!-- Hinatuan, Surigao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166809000 -->
| Q155582 <!-- Lanuza, Surigao del Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166810000 -->
| Q155590 <!-- Lianga, Surigao del Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166811000 -->
| Q155598 <!-- Lingig, Surigao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166812000 -->
| Q155605 <!-- Madrid, Surigao del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166813000 -->
| Q155611 <!-- Marihatag, Surigao del Sur --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166814000 -->
| Q155618 <!-- San Agustin, Surigao del Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166815000 -->
| Q155625 <!-- San Miguel, Surigao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166816000 -->
| Q155633 <!-- Tagbina, Surigao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166817000 -->
| Q155648 <!-- Tago, Surigao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166818000 -->
| Q155674 <!-- Tandag, Surigao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166819000 -->
| Q315450 <!-- Compostela, Davao de Oro --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118201000 -->
| Q315468 <!-- Laak, Davao de Oro --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118202000 -->
| Q187225 <!-- Mabini, Davao de Oro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118203000 -->
| Q315497 <!-- Maco, Davao de Oro --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118204000 -->
| Q315512 <!-- Maragusan, Davao de Oro --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118205000 -->
| Q315524 <!-- Mawab, Davao de Oro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118206000 -->
| Q315543 <!-- Monkayo, Davao de Oro --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118207000 -->
| Q315557 <!-- Montevista, Davao de Oro --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118208000 -->
| Q315570 <!-- Nabunturan, Davao de Oro --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118209000 -->
| Q315582 <!-- New Bataan, Davao de Oro --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118210000 -->
| Q315598 <!-- Pantukan, Davao de Oro --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118211000 -->
| Q314393 <!-- Asuncion, Davao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112301000 -->
| Q314410 <!-- Braulio E. Dujali, Davao del Norte --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112323000 -->
| Q314422 <!-- Carmen, Davao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112303000 -->
| Q314438 <!-- Kapalong, Davao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112305000 -->
| Q314452 <!-- New Corella, Davao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112314000 -->
| Q967367 <!-- Panabo, Davao del Norte --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112315000 -->
| Q1020674 <!-- Samal, Davao del Norte --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112317000 -->
| Q314468 <!-- San Isidro, Davao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112324000 -->
| Q314486 <!-- Santo Tomas, Davao del Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112318000 -->
| Q725168 <!-- Tagum, Davao del Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112319000 -->
| Q314501 <!-- Talaingod, Davao del Norte --> = 3 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112322000 -->
| Q314778 <!-- Bansalan, Davao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112401000 -->
| Q1473 <!-- Davao --> = 182 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112402000 -->
| Q1020939 <!-- Digos, Davao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112403000 -->
| Q314808 <!-- Hagonoy, Davao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112404000 -->
| Q314844 <!-- Kiblawan, Davao del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112406000 -->
| Q314864 <!-- Magsaysay, Davao del Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112407000 -->
| Q314885 <!-- Malalag, Davao del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112408000 -->
| Q314923 <!-- Matanao, Davao del Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112410000 -->
| Q314944 <!-- Padada, Davao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112411000 -->
| Q314965 <!-- Santa Cruz, Davao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112412000 -->
| Q315014 <!-- Sulop, Davao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112414000 -->
| Q314796 <!-- Don Marcelino, Davao Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118601000 -->
| Q314824 <!-- Jose Abad Santos, Davao Occidental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118602000 -->
| Q314907 <!-- Malita, Davao Occidental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118603000 -->
| Q314980 <!-- Santa Maria, Davao Occidental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118604000 -->
| Q314999 <!-- Sarangani, Davao Occidental --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118605000 -->
| Q314522 <!-- Baganga, Davao Oriental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112501000 -->
| Q314542 <!-- Banaybanay, Davao Oriental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112502000 -->
| Q314574 <!-- Boston, Davao Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112503000 -->
| Q314593 <!-- Caraga, Davao Oriental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112504000 -->
| Q314619 <!-- Cateel, Davao Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112505000 -->
| Q314632 <!-- Governor Generoso, Davao Oriental --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112506000 -->
| Q314653 <!-- Lupon, Davao Oriental --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112507000 -->
| Q314671 <!-- Manay, Davao Oriental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112508000 -->
| Q314686 <!-- Mati, Davao Oriental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112505000 -->
| Q314721 <!-- San Isidro, Davao Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112510000 -->
| Q314745 <!-- Tarragona, Davao Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112511000 -->
| Q315042 <!-- Alamada, Cotabato --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124701000 -->
| Q315061 <!-- Aleosan, Cotabato --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124717000 -->
| Q315081 <!-- Antipas, Cotabato --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124715000 -->
| Q315098 <!-- Arakan, Cotabato --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124718000 -->
| Q315121 <!-- Banisilan, Cotabato --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124716000 -->
| Q315144 <!-- Carmen, Cotabato --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124702000 -->
| Q315164 <!-- Kabacan, Cotabato --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124703000 -->
| Q583137 <!-- Kidapawan, Cotabato --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124704000 -->
| Q315190 <!-- Libungan, Cotabato --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124705000 -->
| Q267975 <!-- Magpet, Cotabato --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124706000 -->
| Q315244 <!-- Makilala, Cotabato --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124707000 -->
| Q315267 <!-- Matalam, Cotabato --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124708000 -->
| Q315283 <!-- Midsayap, Cotabato --> = 57 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124709000 -->
| Q315213 <!-- M'lang, Cotabato --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124710000 -->
| Q304654 <!-- Pigkawayan, Cotabato --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124711000 -->
| Q315314 <!-- Pikit, Cotabato --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124712000 -->
| Q315334 <!-- President Roxas, Cotabato --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124713000 -->
| Q315345 <!-- Tulunan, Cotabato --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124714000 -->
| Q174393 <!-- Alabel, Sarangani --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128001000 -->
| Q174403 <!-- Glan, Sarangani --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128002000 -->
| Q174417 <!-- Kiamba, Sarangani --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128003000 -->
| Q174429 <!-- Maasim, Sarangani --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128004000 -->
| Q174442 <!-- Maitum, Sarangani --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128005000 -->
| Q174457 <!-- Malapatan, Sarangani --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128006000 -->
| Q174468 <!-- Malungon, Sarangani --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128007000 -->
| Q173870 <!-- Banga, South Cotabato --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126302000 -->
| Q594275 <!-- General Santos --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126303000 -->
| Q542154 <!-- Koronadal, South Cotabato --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126306000 -->
| Q173898 <!-- Lake Sebu, South Cotabato --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126319000 -->
| Q173922 <!-- Norala, South Cotabato --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126311000 -->
| Q173944 <!-- Polomolok, South Cotabato --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126312000 -->
| Q173965 <!-- Santo Niño, South Cotabato --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126318000 -->
| Q173986 <!-- Surallah, South Cotabato --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126313000 -->
| Q174018 <!-- Tampakan, South Cotabato --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126314000 -->
| Q174039 <!-- Tantangan, South Cotabato --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126315000 -->
| Q174003 <!-- T'boli, South Cotabato --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126316000 -->
| Q174055 <!-- Tupi, South Cotabato --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126317000 -->
| Q173393 <!-- Bagumbayan, Sultan Kudarat --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126501000 -->
| Q173404 <!-- Columbio, Sultan Kudarat --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126502000 -->
| Q173414 <!-- Esperanza, Sultan Kudarat --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126503000 -->
| Q173428 <!-- Isulan, Sultan Kudarat --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126504000 -->
| Q173438 <!-- Kalamansig, Sultan Kudarat --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126505000 -->
| Q173449 <!-- Lambayong, Sultan Kudarat --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126508000 -->
| Q173460 <!-- Lebak, Sultan Kudarat --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126506000 -->
| Q173468 <!-- Lutayan, Sultan Kudarat --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126507000 -->
| Q173479 <!-- Palimbang, Sultan Kudarat --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126509000 -->
| Q137813 <!-- President Quirino, Sultan Kudarat --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126510000 -->
| Q173556 <!-- Senator Ninoy Aquino, Sultan Kudarat --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126512000 -->
| Q173575 <!-- Tacurong, Sultan Kudarat --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126511000 -->
| Q42589 <!-- Akbar, Basilan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150708000 -->
| Q41999 <!-- Al-Barka, Basilan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150709000 -->
| Q41998 <!-- Hadji Mohammad Ajul, Basilan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150710000 -->
| Q802075 <!-- Hadji Muhtamad, Basilan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150712000 -->
| Q1710 <!-- Isabela --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/099701000 -->
| Q1714 <!-- Lamitan, Basilan --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150702000 -->
| Q802107 <!-- Lantawan, Basilan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150703000 -->
| Q802142 <!-- Maluso, Basilan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150704000 -->
| Q802171 <!-- Sumisip, Basilan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150705000 -->
| Q802202 <!-- Tabuan-Lasa, Basilan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150713000 -->
| Q667595 <!-- Tipo-Tipo, Basilan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150706000 -->
| Q630096 <!-- Tuburan, Basilan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150707000 -->
| Q204771 <!-- Ungkaya Pukan, Basilan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150711000 -->
| Q273775 <!-- Amai Manabilang, Lanao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153637000 -->
| Q273657 <!-- Bacolod-Kalawi, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153601000 -->
| Q273680 <!-- Balabagan, Lanao del Sur --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153602000 -->
| Q273700 <!-- Balindong, Lanao del Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153603000 -->
| Q273718 <!-- Bayang, Lanao del Sur --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153604000 -->
| Q273728 <!-- Binidayan, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153605000 -->
| Q273744 <!-- Buadiposo-Buntong, Lanao del Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153633000 -->
| Q273757 <!-- Bubong, Lanao del Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153606000 -->
| Q273796 <!-- Butig, Lanao del Sur --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153607000 -->
| Q273813 <!-- Calanogas, Lanao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153632000 -->
| Q273828 <!-- Ditsaan-Ramain, Lanao del Sur --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153624000 -->
| Q273851 <!-- Ganassi, Lanao del Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153609000 -->
| Q273864 <!-- Kapai, Lanao del Sur --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153610000 -->
| Q273882 <!-- Kapatagan, Lanao del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153639000 -->
| Q273895 <!-- Lumba-Bayabao, Lanao del Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153611000 -->
| Q273906 <!-- Lumbaca-Unayan, Lanao del Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153641000 -->
| Q273915 <!-- Lumbatan, Lanao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153612000 -->
| Q273928 <!-- Lumbayanague, Lanao del Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153636000 -->
| Q273939 <!-- Madalum, Lanao del Sur --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153613000 -->
| Q273948 <!-- Madamba, Lanao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153614000 -->
| Q273960 <!-- Maguing, Lanao del Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153634000 -->
| Q273970 <!-- Malabang, Lanao del Sur --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153615000 -->
| Q273982 <!-- Marantao, Lanao del Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153616000 -->
| Q592338 <!-- Marawi, Lanao del Sur --> = 96 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153617000 -->
| Q273988 <!-- Marogong, Lanao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153631000 -->
| Q273998 <!-- Masiu, Lanao del Sur --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153618000 -->
| Q177004 <!-- Mulondo, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153619000 -->
| Q274015 <!-- Pagayawan, Lanao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153620000 -->
| Q274022 <!-- Piagapo, Lanao del Sur --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153621000 -->
| Q274031 <!-- Picong, Lanao del Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153635000 -->
| Q274037 <!-- Poona Bayabao, Lanao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153622000 -->
| Q274047 <!-- Pualas, Lanao del Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153623000 -->
| Q274057 <!-- Saguiaran, Lanao del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153625000 -->
| Q126297 <!-- Sultan Dumalondong, Lanao del Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153640000 -->
| Q274077 <!-- Tagoloan II, Lanao del Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153638000 -->
| Q274087 <!-- Tamparan, Lanao del Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153626000 -->
| Q274097 <!-- Taraka, Lanao del Sur --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153627000 -->
| Q274114 <!-- Tubaran, Lanao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153628000 -->
| Q274124 <!-- Tugaya, Lanao del Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153629000 -->
| Q274134 <!-- Wao, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153630000 -->
| Q212222 <!-- Ampatuan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153801000 -->
| Q212240 <!-- Barira, Maguindanao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153818000 -->
| Q212255 <!-- Buldon, Maguindanao --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153802000 -->
| Q212280 <!-- Buluan, Maguindanao --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153803000 -->
| Q726993 <!-- Cotabato --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/129804000 -->
| Q212310 <!-- Datu Abdullah Sangki, Maguindanao --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153828000 -->
| Q212336 <!-- Datu Anggal Midtimbang, Maguindanao --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153831000 -->
| Q212366 <!-- Datu Blah T. Sinsuat, Maguindanao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153830000 -->
| Q212389 <!-- Datu Hoffer Ampatuan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153835000 -->
| Q212411 <!-- Datu Montawal, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153822000 -->
| Q212432 <!-- Datu Odin Sinsuat, Maguindanao --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153807000 -->
| Q212463 <!-- Datu Paglas, Maguindanao --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153805000 -->
| Q212488 <!-- Datu Piang, Maguindanao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153806000 -->
| Q212503 <!-- Datu Salibo, Maguindanao --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153836000 -->
| Q212519 <!-- Datu Saudi-Ampatuan, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153826000 -->
| Q212537 <!-- Datu Unsay, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153827000 -->
| Q212557 <!-- General Salipada K. Pendatun, Maguindanao --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153819000 -->
| Q212581 <!-- Guindulungan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153825000 -->
| Q212603 <!-- Kabuntalan, Maguindanao --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153814000 -->
| Q212623 <!-- Mamasapano, Maguindanao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153820000 -->
| Q212644 <!-- Mangudadatu, Maguindanao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153820000 -->
| Q212662 <!-- Matanog, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153809000 -->
| Q212684 <!-- Northern Kabuntalan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153834000 -->
| Q212707 <!-- Pagalungan, Maguindanao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153810000 -->
| Q122827 <!-- Paglat, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153823000 -->
| Q212735 <!-- Pandag, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153833000 -->
| Q212748 <!-- Parang, Maguindanao --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153811000 -->
| Q212759 <!-- Rajah Buayan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153829000 -->
| Q212766 <!-- Shariff Aguak, Maguindanao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153808000 -->
| Q212778 <!-- Shariff Saydona Mustapha, Maguindanao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153837000 -->
| Q212784 <!-- South Upi, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153817000 -->
| Q212791 <!-- Sultan Kudarat, Maguindanao --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153812000 -->
| Q212802 <!-- Sultan Mastura, Maguindanao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153824000 -->
| Q212808 <!-- Sultan sa Barongis, Maguindanao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153813000 -->
| Q212830 <!-- Sultan Sumagka, Maguindanao --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153821000 -->
| Q212823 <!-- Talayan, Maguindanao --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153816000 -->
| Q212843 <!-- Upi, Maguindanao --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153815000 -->
| Q155970 <!-- Banguingui, Sulu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156615000 -->
| Q155983 <!-- Hadji Panglima Tahil, Sulu --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156606000 -->
| Q156008 <!-- Indanan, Sulu --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156601000 -->
| Q156024 <!-- Jolo, Sulu --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156602000 -->
| Q156042 <!-- Kalingalan Caluang, Sulu --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156603000 -->
| Q156055 <!-- Lugus, Sulu --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156617000 -->
| Q156071 <!-- Luuk, Sulu --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156604000 -->
| Q156090 <!-- Maimbung, Sulu --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156605000 -->
| Q156107 <!-- Old Panamao, Sulu --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156607000 -->
| Q156126 <!-- Omar, Sulu --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156619000 -->
| Q156159 <!-- Pandami, Sulu --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156618000 -->
| Q156180 <!-- Panglima Estino, Sulu --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156616000 -->
| Q156195 <!-- Pangutaran, Sulu --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156608000 -->
| Q156208 <!-- Parang, Sulu --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156609000 -->
| Q156225 <!-- Pata, Sulu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156610000 -->
| Q156244 <!-- Patikul, Sulu --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156611000 -->
| Q156263 <!-- Siasi, Sulu --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156612000 -->
| Q156285 <!-- Talipao, Sulu --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156613000 -->
| Q156302 <!-- Tapul, Sulu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156614000 -->
| Q155195 <!-- Bongao, Tawi-Tawi --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157002000 -->
| Q155221 <!-- Languyan, Tawi-Tawi --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157009000 -->
| Q155241 <!-- Mapun, Tawi-Tawi --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157003000 -->
| Q155259 <!-- Panglima Sugala, Tawi-Tawi --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157001000 -->
| Q155274 <!-- Sapa-Sapa, Tawi-Tawi --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157010000 -->
| Q155288 <!-- Sibutu, Tawi-Tawi --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157011000 -->
| Q155318 <!-- Simunul, Tawi-Tawi --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157004000 -->
| Q155334 <!-- Sitangkai, Tawi-Tawi --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157005000 -->
| Q155355 <!-- South Ubian, Tawi-Tawi --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157006000 -->
| Q155377 <!-- Tandubas, Tawi-Tawi --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157007000 -->
| Q155396 <!-- Turtle Islands, Tawi-Tawi --> = 2 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157008000 -->
{{{1|}}} {{main other|[[Category:Philippine articles requiring maintenance]]}}
}}
<noinclude>{{pp-template}}[[Category:Philippines templates]]</noinclude>
91fxqqqv0l4j1elxgylhb0v0khpyl93
37019634
37019633
2026-05-01T16:03:23Z
Exec8
10305
37019634
wikitext
text/x-wiki
<!-- This template is used as a switch to display count of barangays in a local administrative unit in the Philippines -->{{#switch: {{{1|}}}
| Q928 <!-- Philippines --> = 42020 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc -->
| Q2673519 <!-- Luzon, Philippines --> = 20492 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/luzon -->
| Q211436 <!-- Visayas, Philippines --> = 11444 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/visayas -->
| Q37274898 <!-- Mindanao, Philippines --> = 10084 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/mindanao -->
| Q13580 <!-- Metro Manila, National Capital Region --> = 1710 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/130000000 -->
| Q12933 <!-- Ilocos Region, Luzon --> = 3267 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/010000000 -->
| Q13615 <!-- Cagayan Valley, Luzon --> = 2311 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/020000000 -->
| Q13606 <!-- Cordillera Administrative Region, Luzon --> = 1178 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/140000000 -->
| Q13617 <!-- Central Luzon, Luzon --> = 3102 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/030000000 -->
| Q13650 <!-- Calabarzon, Luzon --> = 3993 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/040000000 -->
| Q13662 <!-- Bicol Region, Luzon --> = 3471 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/050000000 -->
| Q13658 <!-- Mimaropa, Luzon --> = 1460 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/170000000 -->
| Q13665 <!-- Western Visayas, Visayas --> = 4051 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/060000000 -->
| Q13669 <!-- Central Visayas, Visayas --> = 3003 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/070000000 -->
| Q13675 <!-- Eastern Visayas, Visayas --> = 4390 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/080000000 -->
| Q13682 <!-- Zamboanga Peninsula, Mindanao --> = 1904 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/090000000 -->
| Q13690 <!-- Northern Mindanao, Mindanao --> = 2022 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/100000000 -->
| Q13704 <!-- Caraga, Mindanao --> = 1311 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/160000000 -->
| Q13694 <!-- Davao Region, Mindanao --> = 1162 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/110000000 -->
| Q13701 <!-- Soccsksargen, Mindanao --> = 1195 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/120000000 -->
| Q24869612 <!-- Bangasmoro, Mindanao --> = 2490 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/150000000 -->
| Q13813 <!-- Ilocos Norte, Ilocos Region --> = 559 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/012800000 -->
| Q12741 <!-- Ilocos Sur, Ilocos Region --> = 768 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/012900000 -->
| Q13829 <!-- La Union, Ilocos Region --> = 576 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/013300000 -->
| Q13871 <!-- Pangasinan, Ilocos Region --> = 1364 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/015500000 -->
| Q13740 <!-- Batanes, Cagayan Valley --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/020900000 -->
| Q13759 <!-- Cagayan, Cagayan Valley --> = 820 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/021500000 -->
| Q13826 <!-- Isabela, Cagayan Valley --> = 1055 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/023100000 -->
| Q13866 <!-- Nueva Vizcaya, Cagayan Valley --> = 275 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/025000000 -->
| Q13873 <!-- Quirino, Cagayan Valley --> = 132 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/025700000 -->
| Q13711 <!-- Abra, Cordillera Administrative Region --> = 303 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/140100000 -->
| Q13728 <!-- Apayao, Cordillera Administrative Region --> = 133 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/148100000 -->
| Q13750 <!-- Benguet, Cordillera Administrative Region --> = 269 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/141100000 -->
| Q13812 <!-- Ifugao, Cordillera Administrative Region --> = 176 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/142700000 -->
| Q13827 <!-- Kalinga, Cordillera Administrative Region --> = 153 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/143200000 -->
| Q13861 <!-- Mountain Province, Cordillera Administrative Region --> = 133 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/144400000 -->
| Q13730 <!-- Aurora, Central Luzon --> = 151 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/037700000 -->
| Q13739 <!-- Bataan, Central Luzon --> = 237 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/030800000 -->
| Q13755 <!-- Bulacan, Central Luzon --> = 569 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/031400000 -->
| Q13865 <!-- Nueva Ecija, Central Luzon --> = 849 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/034900000 -->
| Q13870 <!-- Pampanga, Central Luzon --> = 538 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/035400000 -->
| Q13892 <!-- Tarlac, Central Luzon --> = 511 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/036900000 -->
| Q13895 <!-- Zambales, Central Luzon --> = 247 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/037100000 -->
| Q13744 <!-- Batangas, Calabarzon --> = 1078 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/041000000 -->
| Q13785 <!-- Cavite, Calabarzon --> = 803 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/042100000 -->
| Q13840 <!-- Laguna, Calabarzon --> = 681 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/043400000 -->
| Q13872 <!-- Quezon, Calabarzon --> = 1242 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/045600000 -->
| Q13874 <!-- Rizal, Calabarzon --> = 189 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/045800000 -->
| Q13726 <!-- Albay, Bicol Region --> = 720 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/050500000 -->
| Q13763 <!-- Camarines Norte, Bicol Region --> = 282 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/051600000 -->
| Q13767 <!-- Camarines Sur, Bicol Region --> = 1063 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/051700000 -->
| Q13778 <!-- Catanduanes, Bicol Region --> = 315 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/052000000 -->
| Q13847 <!-- Masbate, Bicol Region --> = 550 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/054100000 -->
| Q13881 <!-- Sorsogon, Bicol Region --> = 541 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/056200000 -->
| Q13846 <!-- Marinduque, Mimaropa --> = 218 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/174000000 -->
| Q13867 <!-- Occidental Mindoro, Mimaropa --> = 164 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/175100000 -->
| Q13868 <!-- Oriental Mindoro, Mimaropa --> = 426 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/175200000 -->
| Q13869 <!-- Palawan, Mimaropa --> = 433 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/175300000 -->
| Q13875 <!-- Romblon, Mimaropa --> = 219 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/060400000 -->
| Q13723 <!-- Aklan, Western Visayas --> = 327 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/060400000 -->
| Q13727 <!-- Antique, Western Visayas --> = 590 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/060600000 -->
| Q13772 <!-- Capiz, Western Visayas --> = 473 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/061900000 -->
| Q13810 <!-- Guimaras, Western Visayas --> = 98 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/067900000 -->
| Q13825 <!-- Iloilo, Western Visayas --> = 1901 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/063000000 -->
| Q13862 <!-- Negros Occidental, Western Visayas --> = 662 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/064500000 -->
| Q13752 <!-- Bohol, Central Visayas --> = 1109 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/071200000 -->
| Q13786 <!-- Cebu, Central Visayas --> = 1203 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/072200000 -->
| Q13863 <!-- Negros Oriental, Central Visayas --> = 557 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/074600000 -->
| Q13879 <!-- Siquijor, Central Visayas --> = 134 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/076100000 -->
| Q13751 <!-- Biliran, Eastern Visayas --> = 132 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/087800000 -->
| Q13809 <!-- Eastern Samar, Eastern Visayas --> = 597 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/082600000 -->
| Q13844 <!-- Leyte, Eastern Visayas --> = 1641 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/083700000 -->
| Q13864 <!-- Northern Samar, Eastern Visayas --> = 569 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/084800000 -->
| Q13876 <!-- Samar, Eastern Visayas --> = 951 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/086000000 -->
| Q13884 <!-- Southern Leyte, Eastern Visayas --> = 500 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/086400000 -->
| Q13899 <!-- Zamboanga del Norte, Zamboanga Peninsula --> = 691 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/097200000 -->
| Q13900 <!-- Zamboanga del Sur, Zamboanga Peninsula --> = 779 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/097300000 -->
| Q13902 <!-- Zamboanga Sibugay, Zamboanga Peninsula --> = 389 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/098300000 -->
| Q13753 <!-- Bukidnon, Northern Mindanao --> = 464 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/101300000 -->
| Q13769 <!-- Camiguin, Northern Mindanao --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/101800000 -->
| Q13841 <!-- Lanao del Norte, Northern Mindanao --> = 506 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/103500000 -->
| Q13857 <!-- Misamis Occidental, Northern Mindanao --> = 490 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/104200000 -->
| Q13860 <!-- Misamis Oriental, Northern Mindanao --> = 504 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/104300000 -->
| Q13714 <!-- Agusan del Norte, Caraga --> = 253 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/160200000 -->
| Q13721 <!-- Agusan del Sur, Caraga --> = 314 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/160300000 -->
| Q13807 <!-- Dinagat Islands, Caraga --> = 100 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/168500000 -->
| Q13889 <!-- Surigao del Norte, Caraga --> = 335 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/166700000 -->
| Q13891 <!-- Surigao del Sur, Caraga --> = 309 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/166800000 -->
| Q13789 <!-- Davao de Oro, Davao Region --> = 237 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/118200000 -->
| Q13792 <!-- Davao del Norte, Davao Region --> = 223 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/112300000 -->
| Q13794 <!-- Davao del Sur, Davao Region --> = 414 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/112400000 -->
| Q3656379 <!-- Davao Occidental, Davao Region --> = 105 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/118600000 -->
| Q13806 <!-- Davao Oriental, Davao Region --> = 183 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/112500000 -->
| Q13791 <!-- Cotabato, Soccsksargen --> = 543 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/124700000 -->
| Q13877 <!-- Sarangani, Soccsksargen --> = 141 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/128000000 -->
| Q13882 <!-- South Cotabato, Soccsksargen --> = 225 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/126300000 -->
| Q13885 <!-- Sultan Kudarat, Soccsksargen --> = 249 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/126500000 -->
| Q13737 <!-- Basilan, Bangasmoro --> = 210 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/150700000 -->
| Q13843 <!-- Lanao del Sur, Bangasmoro --> = 1159 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/153600000 -->
| Q13845 <!-- Maguindanao, Bangasmoro --> = 508 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/153800000 -->
| Q13887 <!-- Sulu, Bangasmoro --> = 410 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/156600000 -->
| Q13893 <!-- Tawi-Tawi, Bangasmoro --> = 203 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/157000000 -->
| Q1478 <!-- Caloocan --> = 188 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137501000 -->
| Q8854 <!-- Las Piñas --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137601000 -->
| Q1508 <!-- Makati --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137602000 -->
| Q8861 <!-- Malabon --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137502000 -->
| Q9085 <!-- Mandaluyong --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137401000 -->
| Q1461 <!-- Manila --> = 897 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/submuni/133900000 -->
| Q17175 <!-- Marikina --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137402000 -->
| Q17176 <!-- Muntinlupa --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137603000 -->
| Q17179 <!-- Navotas --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137503000 -->
| Q17182 <!-- Parañaque --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137604000 -->
| Q17189 <!-- Pasay --> = 201 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137605000 -->
| Q1624 <!-- Pasig --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137403000 -->
| Q1017325 <!-- Pateros, Metro Manila --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137606000 -->
| Q1475 <!-- Quezon City --> = 142 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137404000 -->
| Q749283 <!-- San Juan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137405000 -->
| Q1643 <!-- Taguig --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137607000 -->
| Q1623 <!-- Valenzuela --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137504000 -->
| Q39241 <!-- Adams, Ilocos Norte --> = 1 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012801000 -->
| Q39271 <!-- Bacarra, Ilocos Norte --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012802000 -->
| Q39303 <!-- Badoc, Ilocos Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012803000 -->
| Q39326 <!-- Bangui, Ilocos Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012804000 -->
| Q39346 <!-- Banna, Ilocos Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012811000 -->
| Q39711 <!-- Batac, Ilocos Norte --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012805000 -->
| Q39368 <!-- Burgos, Ilocos Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012806000 -->
| Q39393 <!-- Carasi, Ilocos Norte --> = 3 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012807000 -->
| Q39416 <!-- Currimao, Ilocos Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012808000 -->
| Q39429 <!-- Dingras, Ilocos Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012809000 -->
| Q39511 <!-- Dumalneg, Ilocos Norte --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012810000 -->
| Q39738 <!-- Laoag, Ilocos Norte --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012812000 -->
| Q39523 <!-- Marcos, Ilocos Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012813000 -->
| Q39540 <!-- Nueva Era, Ilocos Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012814000 -->
| Q39559 <!-- Pagudpud, Ilocos Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012815000 -->
| Q39573 <!-- Paoay, Ilocos Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012816000 -->
| Q39591 <!-- Pasuquin, Ilocos Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012817000 -->
| Q39616 <!-- Piddig, Ilocos Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012818000 -->
| Q39629 <!-- Pinili, Ilocos Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012819000 -->
| Q39653 <!-- San Nicolas, Ilocos Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012820000 -->
| Q39673 <!-- Sarrat, Ilocos Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012821000 -->
| Q39677 <!-- Solsona, Ilocos Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012822000 -->
| Q39694 <!-- Vintar, Ilocos Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012823000 -->
| Q12813 <!-- Alilem, Ilocos Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012901000 -->
| Q12818 <!-- Banayoyo, Ilocos Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012902000 -->
| Q12825 <!-- Bantay, Ilocos Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012903000 -->
| Q12828 <!-- Burgos, Ilocos Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012904000 -->
| Q12832 <!-- Cabugao, Ilocos Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012905000 -->
| Q205956 <!-- Candon, Ilocos Sur --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012906000 -->
| Q12834 <!-- Caoayan, Ilocos Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012907000 -->
| Q12835 <!-- Cervantes, Ilocos Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012908000 -->
| Q12838 <!-- Galimuyod, Ilocos Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012909000 -->
| Q12840 <!-- Gregorio del Pilar, Ilocos Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012910000 -->
| Q12843 <!-- Lidlidda, Ilocos Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012911000 -->
| Q12845 <!-- Magsingal, Ilocos Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012912000 -->
| Q12848 <!-- Nagbukel, Ilocos Sur --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012913000 -->
| Q12850 <!-- Narvacan, Ilocos Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012914000 -->
| Q12853 <!-- Quirino, Ilocos Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012915000 -->
| Q12856 <!-- Salcedo, Ilocos Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012916000 -->
| Q12859 <!-- San Emilio, Ilocos Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012917000 -->
| Q12863 <!-- San Esteban, Ilocos Sur --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012918000 -->
| Q12864 <!-- San Ildefonso, Ilocos Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012919000 -->
| Q12867 <!-- San Juan, Ilocos Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012920000 -->
| Q12868 <!-- San Vicente, Ilocos Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012921000 -->
| Q12873 <!-- Santa, Ilocos Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012922000 -->
| Q12875 <!-- Santa Catalina, Ilocos Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012923000 -->
| Q12880 <!-- Santa Cruz, Ilocos Sur --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012924000 -->
| Q12882 <!-- Santa Lucia, Ilocos Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012925000 -->
| Q12692 <!-- Santa Maria, Ilocos Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012926000 -->
| Q12884 <!-- Santiago, Ilocos Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012927000 -->
| Q12885 <!-- Santo Domingo, Ilocos Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012928000 -->
| Q12888 <!-- Sigay, Ilocos Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012929000 -->
| Q12891 <!-- Sinait, Ilocos Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012930000 -->
| Q12893 <!-- Sugpon, Ilocos Sur --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012931000 -->
| Q12894 <!-- Suyo, Ilocos Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012932000 -->
| Q12895 <!-- Tagudin, Ilocos Sur --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012933000 -->
| Q235004 <!-- Vigan, Ilocos Sur --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012934000 -->
| Q40168 <!-- Agoo, La Union --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013301000 -->
| Q40239 <!-- Aringay, La Union --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013302000 -->
| Q40259 <!-- Bacnotan, La Union --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013303000 -->
| Q40275 <!-- Bagulin, La Union --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013304000 -->
| Q40282 <!-- Balaoan, La Union --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013305000 -->
| Q40298 <!-- Bangar, La Union --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013306000 -->
| Q40313 <!-- Bauang, La Union --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013307000 -->
| Q40372 <!-- Burgos, La Union --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013308000 -->
| Q40393 <!-- Caba, La Union --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013309000 -->
| Q40419 <!-- Luna, La Union --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013310000 -->
| Q40450 <!-- Naguilian, La Union --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013311000 -->
| Q40466 <!-- Pugo, La Union --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013312000 -->
| Q40486 <!-- Rosario, La Union --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013313000 -->
| Q40584 <!-- San Fernando, La Union --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013314000 -->
| Q40500 <!-- San Gabriel, La Union --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013315000 -->
| Q40517 <!-- San Juan, La Union --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013316000 -->
| Q40521 <!-- Santo Tomas, La Union --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013317000 -->
| Q40536 <!-- Santol, La Union --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013318000 -->
| Q40557 <!-- Sudipen, La Union --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013319000 -->
| Q40562 <!-- Tubao, La Union --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013320000 -->
| Q41668 <!-- Agno, Pangasinan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015501000 -->
| Q41686 <!-- Aguilar, Pangasinan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015502000 -->
| Q43162 <!-- Alaminos, Pangasinan --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015503000 -->
| Q41704 <!-- Alcala, Pangasinan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015502000 -->
| Q41713 <!-- Anda, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015504000 -->
| Q41721 <!-- Asingan, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015505000 -->
| Q41725 <!-- Balungao, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015506000 -->
| Q41732 <!-- Bani, Pangasinan --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015508000 -->
| Q41737 <!-- Basista, Pangasinan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015509000 -->
| Q41757 <!-- Bautista, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015510000 -->
| Q41762 <!-- Bayambang, Pangasinan --> = 77 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015511000 -->
| Q41771 <!-- Binalonan, Pangasinan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015512000 -->
| Q41779 <!-- Binmaley, Pangasinan --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015513000 -->
| Q41807 <!-- Bolinao, Pangasinan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015514000 -->
| Q41826 <!-- Bugallon, Pangasinan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015515000 -->
| Q41850 <!-- Burgos, Pangasinan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015516000 -->
| Q41855 <!-- Calasiao, Pangasinan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015517000 -->
| Q875070 <!-- Dagupan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015518000 -->
| Q41917 <!-- Dasol, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015519000 -->
| Q41922 <!-- Infanta, Pangasinan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015520000 -->
| Q41942 <!-- Labrador, Pangasinan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015521000 -->
| Q41965 <!-- Laoac, Pangasinan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015548000 -->
| Q41978 <!-- Lingayen, Pangasinan --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015522000 -->
| Q41982 <!-- Mabini, Pangasinan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015523000 -->
| Q41985 <!-- Malasiqui, Pangasinan --> = 73 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015524000 -->
| Q1020685 <!-- Manaoag, Pangasinan --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015525000 -->
| Q41996 <!-- Mangaldan, Pangasinan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015526000 -->
| Q42001 <!-- Mangatarem, Pangasinan --> = 82 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015527000 -->
| Q42006 <!-- Mapandan, Pangasinan --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015528000 -->
| Q42011 <!-- Natividad, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015529000 -->
| Q42017 <!-- Pozorrubio, Pangasinan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015530000 -->
| Q42024 <!-- Rosales, Pangasinan --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015531000 -->
| Q43165 <!-- San Carlos, Pangasinan --> = 86 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015532000 -->
| Q42031 <!-- San Fabian, Pangasinan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015533000 -->
| Q42036 <!-- San Jacinto, Pangasinan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015534000 -->
| Q42039 <!-- San Manuel, Pangasinan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015535000 -->
| Q42043 <!-- San Nicolas, Pangasinan --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015536000 -->
| Q42044 <!-- San Quintin, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015537000 -->
| Q122401 <!-- Santa Barbara, Pangasinan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015538000 -->
| Q42055 <!-- Santa Maria, Pangasinan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015539000 -->
| Q43140 <!-- Santo Tomas, Pangasinan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015540000 -->
| Q43143 <!-- Sison, Pangasinan --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015541000 -->
| Q43145 <!-- Sual, Pangasinan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015542000 -->
| Q43148 <!-- Tayug, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015543000 -->
| Q43152 <!-- Umingan, Pangasinan --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015544000 -->
| Q43154 <!-- Urbiztondo, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015545000 -->
| Q43168 <!-- Urdaneta, Pangasinan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015546000 -->
| Q43157 <!-- Villasis, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015547000 -->
| Q43180 <!-- Basco, Batanes --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020901000 -->
| Q43451 <!-- Itbayat, Batanes --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020902000 -->
| Q43454 <!-- Ivana, Batanes --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020903000 -->
| Q43458 <!-- Mahatao, Batanes --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020904000 -->
| Q43460 <!-- Sabtang, Batanes --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020905000 -->
| Q43469 <!-- Uyugan, Batanes --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020906000 -->
| Q43500 <!-- Abulug, Cagayan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021501000 -->
| Q43503 <!-- Alcala, Cagayan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021502000 -->
| Q43508 <!-- Allacapan, Cagayan --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021503000 -->
| Q43515 <!-- Amulung, Cagayan --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021504000 -->
| Q43517 <!-- Aparri, Cagayan --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021505000 -->
| Q43520 <!-- Baggao, Cagayan --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021506000 -->
| Q49058 <!-- Ballesteros, Cagayan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021507000 -->
| Q49059 <!-- Buguey, Cagayan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021508000 -->
| Q49062 <!-- Calayan, Cagayan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021509000 -->
| Q49313 <!-- Camalaniugan, Cagayan --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021510000 -->
| Q49314 <!-- Claveria, Cagayan --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021511000 -->
| Q49315 <!-- Enrile, Cagayan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021512000 -->
| Q49316 <!-- Gattaran, Cagayan --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021513000 -->
| Q49317 <!-- Gonzaga, Cagayan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021514000 -->
| Q49318 <!-- Iguig, Cagayan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021515000 -->
| Q49320 <!-- Lal-lo, Cagayan --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021516000 -->
| Q49321 <!-- Lasam, Cagayan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021517000 -->
| Q49324 <!-- Pamplona, Cagayan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021518000 -->
| Q49327 <!-- Peñablanca, Cagayan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021519000 -->
| Q49331 <!-- Piat, Cagayan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021520000 -->
| Q49333 <!-- Rizal, Cagayan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021521000 -->
| Q49336 <!-- Sanchez-Mira, Cagayan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021522000 -->
| Q49337 <!-- Santa Ana, Cagayan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021523000 -->
| Q49339 <!-- Santa Praxedes, Cagayan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021524000 -->
| Q49342 <!-- Santa Teresita, Cagayan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021525000 -->
| Q49346 <!-- Santo Niño, Cagayan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021526000 -->
| Q49348 <!-- Solana, Cagayan --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021527000 -->
| Q49350 <!-- Tuao, Cagayan --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021528000 -->
| Q2200 <!-- Tuguegarao, Cagayan --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021529000 -->
| Q49354 <!-- Alicia, Isabela --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023101000 -->
| Q49357 <!-- Angadanan, Isabela --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023102000 -->
| Q49358 <!-- Aurora, Isabela --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023103000 -->
| Q49359 <!-- Benito Soliven, Isabela --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023104000 -->
| Q49360 <!-- Burgos, Isabela --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023105000 -->
| Q49361 <!-- Cabagan, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023106000 -->
| Q49362 <!-- Cabatuan, Isabela --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023107000 -->
| Q50178 <!-- Cauayan, Isabela --> = 65 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023108000 -->
| Q49363 <!-- Cordon, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023109000 -->
| Q49365 <!-- Delfin Albano, Isabela --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023118000 -->
| Q49366 <!-- Dinapigue, Isabela --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023110000 -->
| Q49368 <!-- Divilacan, Isabela --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023111000 -->
| Q49369 <!-- Echague, Isabela --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023112000 -->
| Q49370 <!-- Gamu, Isabela --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023113000 -->
| Q50179 <!-- Ilagan, Isabela --> = 91 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023114000 -->
| Q49372 <!-- Jones, Isabela --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023115000 -->
| Q49375 <!-- Luna, Isabela --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023116000 -->
| Q49434 <!-- Maconacon, Isabela --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023117000 -->
| Q49435 <!-- Mallig, Isabela --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023119000 -->
| Q50066 <!-- Naguilian, Isabela --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023120000 -->
| Q50102 <!-- Palanan, Isabela --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023121000 -->
| Q50145 <!-- Quezon, Isabela --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023122000 -->
| Q50149 <!-- Quirino, Isabela --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023123000 -->
| Q50152 <!-- Ramon, Isabela --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023124000 -->
| Q50153 <!-- Reina Mercedes, Isabela --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023125000 -->
| Q50154 <!-- Roxas, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023126000 -->
| Q50158 <!-- San Agustin, Isabela --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023127000 -->
| Q50160 <!-- San Guillermo, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023128000 -->
| Q50163 <!-- San Isidro, Isabela --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023129000 -->
| Q50164 <!-- San Manuel, Isabela --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023130000 -->
| Q50167 <!-- San Mariano, Isabela --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023131000 -->
| Q50171 <!-- San Mateo, Isabela --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023132000 -->
| Q50174 <!-- San Pablo, Isabela --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023133000 -->
| Q50175 <!-- Santa Maria, Isabela --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023134000 -->
| Q50180 <!-- Santiago --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023135000 -->
| Q50176 <!-- Santo Tomas, Isabela --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023136000 -->
| Q50177 <!-- Tumauini, Isabela --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023137000 -->
| Q51474 <!-- Alfonso Castaneda, Nueva Vizcaya --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025015000 -->
| Q51475 <!-- Ambaguio, Nueva Vizcaya --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025001000 -->
| Q51477 <!-- Aritao, Nueva Vizcaya --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025002000 -->
| Q51478 <!-- Bagabag, Nueva Vizcaya --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025003000 -->
| Q51479 <!-- Bambang, Nueva Vizcaya --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025004000 -->
| Q51480 <!-- Bayombong , Nueva Vizcaya --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025005000 -->
| Q51481 <!-- Diadi, Nueva Vizcaya --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025006000 -->
| Q51483 <!-- Dupax del Norte, Nueva Vizcaya --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025007000 -->
| Q51484 <!-- Dupax del Sur, Nueva Vizcaya --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025008000 -->
| Q51485 <!-- Kasibu, Nueva Vizcaya --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025009000 -->
| Q51486 <!-- Kayapa, Nueva Vizcaya --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025010000 -->
| Q51487 <!-- Quezon, Nueva Vizcaya --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025011000 -->
| Q51493 <!-- Santa Fe, Nueva Vizcaya --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025012000 -->
| Q51494 <!-- Solano, Nueva Vizcaya --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025013000 -->
| Q51496 <!-- Villaverde, Nueva Vizcaya --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025014000 -->
| Q53069 <!-- Aglipay, Quirino --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025701000 -->
| Q53070 <!-- Cabarroguis, Quirino --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025702000 -->
| Q53071 <!-- Diffun, Quirino --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025703000 -->
| Q53072 <!-- Maddela, Quirino --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025704000 -->
| Q53073 <!-- Nagtipunan, Quirino --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025706000 -->
| Q53074 <!-- Saguday, Quirino --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025705000 -->
| Q27995 <!-- Bangued , Abra --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140101000 -->
| Q28002 <!-- Boliney, Abra --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140102000 -->
| Q28014 <!-- Bucay, Abra --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140103000 -->
| Q28030 <!-- Bucloc, Abra --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140104000 -->
| Q28044 <!-- Daguioman, Abra --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140105000 -->
| Q28068 <!-- Danglas, Abra --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140106000 -->
| Q28096 <!-- Dolores, Abra --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140107000 -->
| Q28124 <!-- La Paz, Abra --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140108000 -->
| Q29007 <!-- Lacub, Abra --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140109000 -->
| Q29020 <!-- Lagangilang, Abra --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140110000 -->
| Q29029 <!-- Lagayan, Abra --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140111000 -->
| Q29038 <!-- Langiden, Abra --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140112000 -->
| Q29045 <!-- Licuan-Baay, Abra --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140113000 -->
| Q29048 <!-- Luba, Abra --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140114000 -->
| Q29069 <!-- Malibcong, Abra --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140115000 -->
| Q29082 <!-- Manabo, Abra --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140116000 -->
| Q29094 <!-- Peñarrubia, Abra --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140117000 -->
| Q29102 <!-- Pidigan, Abra --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140118000 -->
| Q29109 <!-- Pilar, Abra --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140119000 -->
| Q29116 <!-- Sallapadan, Abra --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140120000 -->
| Q801530 <!-- San Isidro, Abra --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140121000 -->
| Q29123 <!-- San Juan, Abra --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140122000 -->
| Q29133 <!-- San Quintin, Abra --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140123000 -->
| Q29139 <!-- Tayum, Abra --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140124000 -->
| Q29146 <!-- Tineg, Abra --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140125000 -->
| Q29153 <!-- Tubo, Abra --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140126000 -->
| Q29191 <!-- Villaviciosa, Abra --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140127000 -->
| Q29018 <!-- Calanasan, Apayao --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148101000 -->
| Q30033 <!-- Conner, Apayao --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148102000 -->
| Q30042 <!-- Flora, Apayao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148103000 -->
| Q30053 <!-- Kabugao, Apayao --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148104000 -->
| Q801777 <!-- Luna, Apayao --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148105000 -->
| Q30062 <!-- Pudtol, Apayao --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148106000 -->
| Q30073 <!-- Santa Marcela, Apayao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148107000 -->
| Q30104 <!-- Atok, Benguet --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141101000 -->
| Q1822 <!-- Baguio --> = 129 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141102000 -->
| Q30325 <!-- Bakun, Benguet --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141103000 -->
| Q30328 <!-- Bokod, Benguet --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141104000 -->
| Q30332 <!-- Buguias, Benguet --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141105000 -->
| Q30335 <!-- Itogon, Benguet --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141106000 -->
| Q30338 <!-- Kabayan, Benguet --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141107000 -->
| Q30345 <!-- Kapangan, Benguet --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141108000 -->
| Q30349 <!-- Kibungan, Benguet --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141109000 -->
| Q30351 <!-- La Trinidad , Benguet --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141110000 -->
| Q30356 <!-- Mankayan, Benguet --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141111000 -->
| Q30358 <!-- Sablan, Benguet --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141112000 -->
| Q30361 <!-- Tuba, Benguet --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141113000 -->
| Q30363 <!-- Tublay, Benguet --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141114000 -->
| Q30365 <!-- Aguinaldo, Ifugao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142708000 -->
| Q30391 <!-- Alfonso Lista, Ifugao --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142707000 -->
| Q30394 <!-- Asipulo, Ifugao --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142711000 -->
| Q806138 <!-- Banaue, Ifugao --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142701000 -->
| Q30410 <!-- Hingyon, Ifugao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142709000 -->
| Q30413 <!-- Hungduan, Ifugao --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142702000 -->
| Q30416 <!-- Kiangan, Ifugao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142703000 -->
| Q30419 <!-- Lagawe, Ifugao --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142704000 -->
| Q30421 <!-- Lamut, Ifugao --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142705000 -->
| Q30425 <!-- Mayoyao, Ifugao --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142706000 -->
| Q30428 <!-- Tinoc, Ifugao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142710000 -->
| Q35848 <!-- Balbalan, Kalinga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143201000 -->
| Q35858 <!-- Lubuagan, Kalinga --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143206000 -->
| Q35866 <!-- Pasil, Kalinga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143208000 -->
| Q35873 <!-- Pinukpuk, Kalinga --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143209000 -->
| Q35884 <!-- Rizal, Kalinga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143211000 -->
| Q35925 <!-- Tabuk, Kalinga --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143213000 -->
| Q35897 <!-- Tanudan, Kalinga --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143214000 -->
| Q35909 <!-- Tinglayan, Kalinga --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143215000 -->
| Q35975 <!-- Barlig, Mountain Province --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144401000 -->
| Q35994 <!-- Bauko, Mountain Province --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144402000 -->
| Q36012 <!-- Besao, Mountain Province --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144403000 -->
| Q36025 <!-- Bontoc, Mountain Province --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144404000 -->
| Q36040 <!-- Natonin, Mountain Province --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144405000 -->
| Q36049 <!-- Paracelis, Mountain Province --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144406000 -->
| Q36061 <!-- Sabangan, Mountain Province --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144407000 -->
| Q36076 <!-- Sadanga, Mountain Province --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144408000 -->
| Q36090 <!-- Sagada, Mountain Province --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144409000 -->
| Q36099 <!-- Tadian, Mountain Province --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144410000 -->
| Q53081 <!-- Baler, Aurora --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037701000 -->
| Q53083 <!-- Casiguran, Aurora --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037702000 -->
| Q53084 <!-- Dilasag, Aurora --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037703000 -->
| Q53086 <!-- Dinalungan, Aurora --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037704000 -->
| Q53087 <!-- Dingalan, Aurora --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037705000 -->
| Q53089 <!-- Dipaculao, Aurora --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037706000 -->
| Q53090 <!-- Maria Aurora, Aurora --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037707000 -->
| Q53092 <!-- San Luis, Aurora --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037708000 -->
| Q54455 <!-- Abucay, Bataan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030801000 -->
| Q54456 <!-- Bagac, Bataan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030802000 -->
| Q1719 <!-- Balanga, Bataan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030803000 -->
| Q54457 <!-- Dinalupihan, Bataan --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030804000 -->
| Q54458 <!-- Hermosa, Bataan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030805000 -->
| Q54459 <!-- Limay, Bataan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030806000 -->
| Q54460 <!-- Mariveles, Bataan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030807000 -->
| Q54461 <!-- Morong, Bataan --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030808000 -->
| Q54462 <!-- Orani, Bataan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030809000 -->
| Q54463 <!-- Orion, Bataan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030810000 -->
| Q54464 <!-- Pilar, Bataan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030811000 -->
| Q54465 <!-- Samal, Bataan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030812000 -->
| Q54551 <!-- Angat, Bulacan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031401000 -->
| Q54553 <!-- Balagtas, Bulacan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031402000 -->
| Q54554 <!-- Baliuag, Bulacan --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031403000 -->
| Q54555 <!-- Bocaue, Bulacan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031404000 -->
| Q54558 <!-- Bulakan, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031405000 -->
| Q54560 <!-- Bustos, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031406000 -->
| Q54564 <!-- Calumpit, Bulacan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031407000 -->
| Q54566 <!-- Doña Remedios Trinidad, Bulacan --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031424000 -->
| Q54589 <!-- Guiguinto, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031408000 -->
| Q54592 <!-- Hagonoy, Bulacan --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031409000 -->
| Q2180 <!-- Malolos, Bulacan --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031410000 -->
| Q54595 <!-- Marilao, Bulacan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031411000 -->
| Q2187 <!-- Meycauayan, Bulacan --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031412000 -->
| Q54598 <!-- Norzagaray, Bulacan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031413000 -->
| Q54599 <!-- Obando, Bulacan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031414000 -->
| Q54600 <!-- Pandi, Bulacan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031415000 -->
| Q54605 <!-- Paombong, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031416000 -->
| Q54760 <!-- Plaridel, Bulacan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031417000 -->
| Q54761 <!-- Pulilan, Bulacan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031418000 -->
| Q54762 <!-- San Ildefonso, Bulacan --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031419000 -->
| Q2193 <!-- San Jose del Monte, Bulacan --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031420000 -->
| Q54763 <!-- San Miguel, Bulacan --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031421000 -->
| Q54765 <!-- San Rafael, Bulacan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031422000 -->
| Q54768 <!-- Santa Maria, Bulacan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031423000 -->
| Q55543 <!-- Aliaga, Nueva Ecija --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034901000 -->
| Q55544 <!-- Bongabon, Nueva Ecija --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034902000 -->
| Q55595 <!-- Cabanatuan, Nueva Ecija --> = 89 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034903000 -->
| Q55545 <!-- Cabiao, Nueva Ecija --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034904000 -->
| Q55546 <!-- Carranglan, Nueva Ecija --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034905000 -->
| Q55547 <!-- Cuyapo, Nueva Ecija --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034906000 -->
| Q55548 <!-- Gabaldon, Nueva Ecija --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034907000 -->
| Q55596 <!-- Gapan, Nueva Ecija --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034908000 -->
| Q55549 <!-- General Mamerto Natividad, Nueva Ecija --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034909000 -->
| Q55551 <!-- General Tinio, Nueva Ecija --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034910000 -->
| Q55552 <!-- Guimba, Nueva Ecija --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034911000 -->
| Q30871 <!-- Jaen, Nueva Ecija --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034912000 -->
| Q55556 <!-- Laur, Nueva Ecija --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034913000 -->
| Q55557 <!-- Licab, Nueva Ecija --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034914000 -->
| Q55558 <!-- Llanera, Nueva Ecija --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034915000 -->
| Q55559 <!-- Lupao, Nueva Ecija --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034916000 -->
| Q55597 <!-- Muñoz, Nueva Ecija --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034917000 -->
| Q55560 <!-- Nampicuan, Nueva Ecija --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034918000 -->
| Q55598 <!-- Palayan, Nueva Ecija --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034919000 -->
| Q55567 <!-- Pantabangan, Nueva Ecija --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034920000 -->
| Q55568 <!-- Peñaranda, Nueva Ecija --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034921000 -->
| Q55569 <!-- Quezon, Nueva Ecija --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034922000 -->
| Q55570 <!-- Rizal, Nueva Ecija --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034923000 -->
| Q30923 <!-- San Antonio, Nueva Ecija --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034924000 -->
| Q55572 <!-- San Isidro, Nueva Ecija --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034925000 -->
| Q55599 <!-- San Jose, Nueva Ecija --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034926000 -->
| Q55573 <!-- San Leonardo, Nueva Ecija --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034927000 -->
| Q55590 <!-- Santa Rosa, Nueva Ecija --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034928000 -->
| Q55591 <!-- Santo Domingo, Nueva Ecija --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034929000 -->
| Q55592 <!-- Talavera, Nueva Ecija --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034930000 -->
| Q55593 <!-- Talugtug, Nueva Ecija --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034931000 -->
| Q28731 <!-- Zaragoza, Nueva Ecija --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034932000 -->
| Q55741 <!-- Angeles --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035401000 -->
| Q55693 <!-- Apalit, Pampanga --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035402000 -->
| Q55694 <!-- Arayat, Pampanga --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035403000 -->
| Q55696 <!-- Bacolor, Pampanga --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035404000 -->
| Q55699 <!-- Candaba, Pampanga --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035405000 -->
| Q55700 <!-- Floridablanca, Pampanga --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035406000 -->
| Q55702 <!-- Guagua, Pampanga --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035407000 -->
| Q55705 <!-- Lubao, Pampanga --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035408000 -->
| Q55737 <!-- Mabalacat, Pampanga --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035409000 -->
| Q55707 <!-- Macabebe, Pampanga --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035410000 -->
| Q55709 <!-- Magalang, Pampanga --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035411000 -->
| Q55710 <!-- Masantol, Pampanga --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035412000 -->
| Q55712 <!-- Mexico, Pampanga --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035413000 -->
| Q55717 <!-- Minalin, Pampanga --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035414000 -->
| Q55721 <!-- Porac, Pampanga --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035415000 -->
| Q55740 <!-- San Fernando, Pampanga --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035416000 -->
| Q55724 <!-- San Luis, Pampanga --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035417000 -->
| Q55725 <!-- San Simon, Pampanga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035418000 -->
| Q55727 <!-- Santa Ana, Pampanga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035419000 -->
| Q55730 <!-- Santa Rita, Pampanga --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035420000 -->
| Q55731 <!-- Santo Tomas, Pampanga --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035421000 -->
| Q55734 <!-- Sasmuan, Pampanga --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035422000 -->
| Q56414 <!-- Anao, Tarlac --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036901000 -->
| Q56420 <!-- Bamban, Tarlac --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036902000 -->
| Q56424 <!-- Camiling, Tarlac --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036903000 -->
| Q56427 <!-- Capas, Tarlac --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036904000 -->
| Q30934 <!-- Concepcion, Tarlac --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036905000 -->
| Q56439 <!-- Gerona, Tarlac --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036906000 -->
| Q28733 <!-- La Paz, Tarlac --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036907000 -->
| Q56444 <!-- Mayantoc, Tarlac --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036908000 -->
| Q56453 <!-- Moncada, Tarlac --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036909000 -->
| Q56457 <!-- Paniqui, Tarlac --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036910000 -->
| Q56461 <!-- Pura, Tarlac --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036911000 -->
| Q56465 <!-- Ramos, Tarlac --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036912000 -->
| Q56471 <!-- San Clemente, Tarlac --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036913000 -->
| Q56476 <!-- San Jose, Tarlac --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036918000 -->
| Q56481 <!-- San Manuel, Tarlac --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036914000 -->
| Q56486 <!-- Santa Ignacia, Tarlac --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036915000 -->
| Q5285 <!-- Tarlac, Tarlac --> = 76 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036916000 -->
| Q56493 <!-- Victoria, Tarlac --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036917000 -->
| Q56529 <!-- Botolan, Zambales --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037101000 -->
| Q56533 <!-- Cabangan, Zambales --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037102000 -->
| Q56538 <!-- Candelaria, Zambales --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037103000 -->
| Q56561 <!-- Castillejos, Zambales --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037104000 -->
| Q56566 <!-- Iba, Zambales --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037105000 -->
| Q56572 <!-- Masinloc, Zambales --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037106000 -->
| Q56759 <!-- Olongapo --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037107000 -->
| Q56575 <!-- Palauig, Zambales --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037108000 -->
| Q56581 <!-- San Antonio, Zambales --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037109000 -->
| Q56584 <!-- San Felipe, Zambales --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037110000 -->
| Q56623 <!-- San Marcelino, Zambales --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037111000 -->
| Q56647 <!-- San Narciso, Zambales --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037112000 -->
| Q56656 <!-- Santa Cruz, Zambales --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037113000 -->
| Q56663 <!-- Subic, Zambales --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037114000 -->
| Q59250 <!-- Agoncillo, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041001000 -->
| Q59251 <!-- Alitagtag, Batangas --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041002000 -->
| Q59252 <!-- Balayan, Batangas --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041003000 -->
| Q59253 <!-- Balete, Batangas --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041004000 -->
| Q1723 <!-- Batangas, Batangas --> = 105 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041005000 -->
| Q59272 <!-- Bauan, Batangas --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041006000 -->
| Q59276 <!-- Calaca, Batangas --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041007000 -->
| Q59279 <!-- Calatagan, Batangas --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041008000 -->
| Q59287 <!-- Cuenca, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041009000 -->
| Q59304 <!-- Ibaan, Batangas --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041010000 -->
| Q59308 <!-- Laurel, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041011000 -->
| Q59311 <!-- Lemery, Batangas --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041012000 -->
| Q59312 <!-- Lian, Batangas --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041013000 -->
| Q1725 <!-- Lipa, Batangas --> = 72 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041014000 -->
| Q803199 <!-- Lobo, Batangas --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041015000 -->
| Q59313 <!-- Mabini, Batangas --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041016000 -->
| Q59731 <!-- Malvar, Batangas --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041017000 -->
| Q59740 <!-- Mataasnakahoy, Batangas --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041018000 -->
| Q59745 <!-- Nasugbu, Batangas --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041019000 -->
| Q59749 <!-- Padre Garcia, Batangas --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041020000 -->
| Q59758 <!-- Rosario, Batangas --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041021000 -->
| Q59764 <!-- San Jose, Batangas --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041022000 -->
| Q59770 <!-- San Juan, Batangas --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041023000 -->
| Q59773 <!-- San Luis, Batangas --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041024000 -->
| Q59777 <!-- San Nicolas, Batangas --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041025000 -->
| Q59784 <!-- San Pascual, Batangas --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041026000 -->
| Q59788 <!-- Santa Teresita, Batangas --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041027000 -->
| Q59799 <!-- Santo Tomas, Batangas --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041028000 -->
| Q59814 <!-- Taal, Batangas --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041029000 -->
| Q59825 <!-- Talisay, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041030000 -->
| Q1730 <!-- Tanauan, Batangas --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041031000 -->
| Q59830 <!-- Taysan, Batangas --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041032000 -->
| Q59835 <!-- Tingloy, Batangas --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041033000 -->
| Q59844 <!-- Tuy, Batangas --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041034000 -->
| Q62600 <!-- Alfonso, Cavite --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042101000 -->
| Q62606 <!-- Amadeo, Cavite --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042102000 -->
| Q63129 <!-- Bacoor, Cavite --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042103000 -->
| Q62611 <!-- Carmona, Cavite --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042104000 -->
| Q1482 <!-- Cavite, Cavite --> = 84 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042105000 -->
| Q63139 <!-- Dasmariñas, Cavite --> = 75 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042106000 -->
| Q62719 <!-- General Emilio Aguinaldo, Cavite --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042107000 -->
| Q62638 <!-- General Mariano Alvarez, Cavite --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042123000 -->
| Q62723 <!-- General Trias, Cavite --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042108000 -->
| Q63145 <!-- Imus, Cavite --> = 97 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042109000 -->
| Q62729 <!-- Indang, Cavite --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042110000 -->
| Q62755 <!-- Kawit, Cavite --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042111000 -->
| Q62771 <!-- Magallanes, Cavite --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042112000 -->
| Q62776 <!-- Maragondon, Cavite --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042113000 -->
| Q62784 <!-- Mendez, Cavite --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042114000 -->
| Q62799 <!-- Naic, Cavite --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042115000 -->
| Q63096 <!-- Noveleta, Cavite --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042116000 -->
| Q63102 <!-- Rosario, Cavite --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042117000 -->
| Q63110 <!-- Silang, Cavite --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042118000 -->
| Q63154 <!-- Tagaytay, Cavite --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042119000 -->
| Q63115 <!-- Tanza, Cavite --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042120000 -->
| Q63124 <!-- Ternate, Cavite --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042121000 -->
| Q63160 <!-- Trece Martires, Cavite --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042122000 -->
| Q63750 <!-- Alaminos, Laguna --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043401000 -->
| Q63763 <!-- Bay, Laguna --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043402000 -->
| Q75961 <!-- Biñan, Laguna --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043403000 -->
| Q25096 <!-- Cabuyao, Laguna --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043404000 -->
| Q75978 <!-- Calamba, Laguna --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043405000 -->
| Q69739 <!-- Calauan, Laguna --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043406000 -->
| Q69749 <!-- Cavinti, Laguna --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043407000 -->
| Q69759 <!-- Famy, Laguna --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043408000 -->
| Q69771 <!-- Kalayaan, Laguna --> = 3 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043409000 -->
| Q69781 <!-- Liliw, Laguna --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043410000 -->
| Q69793 <!-- Los Baños, Laguna --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043411000 -->
| Q69812 <!-- Luisiana, Laguna --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043412000 -->
| Q69824 <!-- Lumban, Laguna --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043413000 -->
| Q75875 <!-- Mabitac, Laguna --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043414000 -->
| Q75881 <!-- Magdalena, Laguna --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043415000 -->
| Q75888 <!-- Majayjay, Laguna --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043416000 -->
| Q75895 <!-- Nagcarlan, Laguna --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043417000 -->
| Q75899 <!-- Paete, Laguna --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043418000 -->
| Q75905 <!-- Pagsanjan, Laguna --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043419000 -->
| Q75910 <!-- Pakil, Laguna --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043420000 -->
| Q75918 <!-- Pangil, Laguna --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043421000 -->
| Q75923 <!-- Pila, Laguna --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043422000 -->
| Q75928 <!-- Rizal, Laguna --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043423000 -->
| Q76001 <!-- San Pablo, Laguna --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043424000 -->
| Q75933 <!-- San Pedro, Laguna --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043425000 -->
| Q75938 <!-- Santa Cruz, Laguna --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043426000 -->
| Q75943 <!-- Santa Maria, Laguna --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043427000 -->
| Q76010 <!-- Santa Rosa, Laguna --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043428000 -->
| Q75948 <!-- Siniloan, Laguna --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043429000 -->
| Q75953 <!-- Victoria, Laguna --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043430000 -->
| Q103777 <!-- Agdangan, Quezon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045601000 -->
| Q103786 <!-- Alabat, Quezon --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045602000 -->
| Q103807 <!-- Atimonan, Quezon --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045603000 -->
| Q103815 <!-- Buenavista, Quezon --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045605000 -->
| Q103825 <!-- Burdeos, Quezon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045606000 -->
| Q103833 <!-- Calauag, Quezon --> = 81 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045607000 -->
| Q103841 <!-- Candelaria, Quezon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045608000 -->
| Q103872 <!-- Catanauan, Quezon --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045610000 -->
| Q103879 <!-- Dolores, Quezon --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045615000 -->
| Q103889 <!-- General Luna, Quezon --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045616000 -->
| Q103899 <!-- General Nakar, Quezon --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045617000 -->
| Q103905 <!-- Guinayangan, Quezon --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045618000 -->
| Q103914 <!-- Gumaca, Quezon --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045619000 -->
| Q103921 <!-- Infanta, Quezon --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045620000 -->
| Q103928 <!-- Jomalig, Quezon --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045621000 -->
| Q103935 <!-- Lopez, Quezon --> = 95 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045622000 -->
| Q103941 <!-- Lucban, Quezon --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045623000 -->
| Q104125 <!-- Lucena --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045624000 -->
| Q103947 <!-- Macalelon, Quezon --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045625000 -->
| Q103952 <!-- Mauban, Quezon --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045627000 -->
| Q103958 <!-- Mulanay, Quezon --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045628000 -->
| Q103965 <!-- Padre Burgos, Quezon --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045629000 -->
| Q103971 <!-- Pagbilao, Quezon --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045630000 -->
| Q103976 <!-- Panukulan, Quezon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045631000 -->
| Q103981 <!-- Patnanungan, Quezon --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045632000 -->
| Q103987 <!-- Perez, Quezon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045633000 -->
| Q103996 <!-- Pitogo, Quezon --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045634000 -->
| Q104005 <!-- Plaridel, Quezon --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045635000 -->
| Q104011 <!-- Polillo, Quezon --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045636000 -->
| Q104020 <!-- Quezon, Quezon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045637000 -->
| Q104026 <!-- Real, Quezon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045638000 -->
| Q104037 <!-- Sampaloc, Quezon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045639000 -->
| Q104044 <!-- San Andres, Quezon --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045640000 -->
| Q104052 <!-- San Antonio, Quezon --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045641000 -->
| Q104063 <!-- San Francisco, Quezon --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045642000 -->
| Q104071 <!-- San Narciso, Quezon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045644000 -->
| Q104078 <!-- Sariaya, Quezon --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045645000 -->
| Q104087 <!-- Tagkawayan, Quezon --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045646000 -->
| Q104113 <!-- Tayabas, Quezon --> = 66 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045647000 -->
| Q104092 <!-- Tiaong, Quezon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045648000 -->
| Q104099 <!-- Unisan, Quezon --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045649000 -->
| Q106758 <!-- Angono, Rizal --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045801000 -->
| Q1636 <!-- Antipolo, Rizal --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045802000 -->
| Q106766 <!-- Baras, Rizal --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045803000 -->
| Q106783 <!-- Binangonan, Rizal --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045804000 -->
| Q106790 <!-- Cainta, Rizal --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045805000 -->
| Q106796 <!-- Cardona, Rizal --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045806000 -->
| Q106804 <!-- Jalajala, Rizal --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045807000 -->
| Q106810 <!-- Morong, Rizal --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045809000 -->
| Q106817 <!-- Pililla, Rizal --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045810000 -->
| Q106825 <!-- Rodriguez, Rizal --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045808000 -->
| Q106832 <!-- San Mateo, Rizal --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045811000 -->
| Q106839 <!-- Tanay, Rizal --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045812000 -->
| Q373204 <!-- Taytay, Rizal --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045813000 -->
| Q106848 <!-- Teresa, Rizal --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045814000 -->
| Q492912 <!-- Bacacay, Albay --> = 56 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050501000 -->
| Q492976 <!-- Camalig, Albay --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050502000 -->
| Q493008 <!-- Daraga, Albay --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050503000 -->
| Q493032 <!-- Guinobatan, Albay --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050504000 -->
| Q493065 <!-- Jovellar, Albay --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050505000 -->
| Q1696 <!-- Legazpi, Albay --> = 70 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050506000 -->
| Q493095 <!-- Libon, Albay --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050507000 -->
| Q1701 <!-- Ligao, Albay --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050508000 -->
| Q493132 <!-- Malilipot, Albay --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050509000 -->
| Q493178 <!-- Malinao, Albay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050510000 -->
| Q493204 <!-- Manito, Albay --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050511000 -->
| Q493246 <!-- Oas, Albay --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050512000 -->
| Q256045 <!-- Pio Duran, Albay --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050513000 -->
| Q493326 <!-- Polangui, Albay --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050514000 -->
| Q493362 <!-- Rapu-Rapu, Albay --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050515000 -->
| Q493409 <!-- Santo Domingo, Albay --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050516000 -->
| Q1706 <!-- Tabaco, Albay --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050517000 -->
| Q493444 <!-- Tiwi, Albay --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050518000 -->
| Q356607 <!-- Basud, Camarines Norte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051601000 -->
| Q119624 <!-- Capalonga, Camarines Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051602000 -->
| Q356655 <!-- Daet, Camarines Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051603000 -->
| Q356681 <!-- Jose Panganiban, Camarines Norte --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051605000 -->
| Q356708 <!-- Labo, Camarines Norte --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051606000 -->
| Q356734 <!-- Mercedes, Camarines Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051607000 -->
| Q356759 <!-- Paracale, Camarines Norte --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051608000 -->
| Q356803 <!-- San Lorenzo Ruiz, Camarines Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051604000 -->
| Q302791 <!-- San Vicente, Camarines Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051609000 -->
| Q356853 <!-- Santa Elena, Camarines Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051610000 -->
| Q356878 <!-- Talisay, Camarines Norte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051611000 -->
| Q356898 <!-- Vinzons, Camarines Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051612000 -->
| Q208672 <!-- Baao, Camarines Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051701000 -->
| Q208678 <!-- Balatan, Camarines Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051702000 -->
| Q208683 <!-- Bato, Camarines Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051703000 -->
| Q208690 <!-- Bombon, Camarines Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051704000 -->
| Q208699 <!-- Buhi, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051705000 -->
| Q208712 <!-- Bula, Camarines Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051706000 -->
| Q208717 <!-- Cabusao, Camarines Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051707000 -->
| Q208727 <!-- Calabanga, Camarines Sur --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051708000 -->
| Q208738 <!-- Camaligan, Camarines Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051709000 -->
| Q208749 <!-- Canaman, Camarines Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051710000 -->
| Q208757 <!-- Caramoan, Camarines Sur --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051711000 -->
| Q208765 <!-- Del Gallego, Camarines Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051712000 -->
| Q208769 <!-- Gainza, Camarines Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051713000 -->
| Q208775 <!-- Garchitorena, Camarines Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051714000 -->
| Q208782 <!-- Goa, Camarines Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051715000 -->
| Q2205 <!-- Iriga, Camarines Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051716000 -->
| Q208792 <!-- Lagonoy, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051717000 -->
| Q208814 <!-- Libmanan, Camarines Sur --> = 75 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051718000 -->
| Q208835 <!-- Lupi, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051719000 -->
| Q208845 <!-- Magarao, Camarines Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051720000 -->
| Q208852 <!-- Milaor, Camarines Sur --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051721000 -->
| Q208864 <!-- Minalabac, Camarines Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051722000 -->
| Q208872 <!-- Nabua, Camarines Sur --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051723000 -->
| Q2207 <!-- Naga --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051724000 -->
| Q208878 <!-- Ocampo, Camarines Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051725000 -->
| Q208886 <!-- Pamplona, Camarines Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051726000 -->
| Q208892 <!-- Pasacao, Camarines Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051727000 -->
| Q208899 <!-- Pili, Camarines Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051728000 -->
| Q208919 <!-- Presentacion, Camarines Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051729000 -->
| Q208924 <!-- Ragay, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051730000 -->
| Q208937 <!-- Sagñay, Camarines Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051731000 -->
| Q208950 <!-- San Fernando, Camarines Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051732000 -->
| Q208966 <!-- San Jose, Camarines Sur --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051733000 -->
| Q208985 <!-- Sipocot, Camarines Sur --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051734000 -->
| Q208995 <!-- Siruma, Camarines Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051735000 -->
| Q209011 <!-- Tigaon, Camarines Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051736000 -->
| Q209024 <!-- Tinambac, Camarines Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051737000 -->
| Q192067 <!-- Bagamanoc, Catanduanes --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052001000 -->
| Q192072 <!-- Baras, Catanduanes --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052002000 -->
| Q192085 <!-- Bato, Catanduanes --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052003000 -->
| Q192091 <!-- Caramoran, Catanduanes --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052004000 -->
| Q192629 <!-- Gigmoto, Catanduanes --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052005000 -->
| Q123163 <!-- Pandan, Catanduanes --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052006000 -->
| Q192646 <!-- Panganiban, Catanduanes --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052007000 -->
| Q840162 <!-- San Andres, Catanduanes --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052008000 -->
| Q192665 <!-- San Miguel, Catanduanes --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052009000 -->
| Q192670 <!-- Viga, Catanduanes --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052010000 -->
| Q192681 <!-- Virac, Catanduanes --> = 63 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052011000 -->
| Q107011 <!-- Boac, Marinduque --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174001000 -->
| Q107034 <!-- Mogpog, Marinduque --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174004000 -->
| Q107042 <!-- Santa Cruz, Marinduque --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174005000 -->
| Q107048 <!-- Torrijos, Marinduque --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174006000 -->
| Q191416 <!-- Aroroy, Masbate --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054101000 -->
| Q191438 <!-- Baleno, Masbate --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054102000 -->
| Q191453 <!-- Balud, Masbate --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054103000 -->
| Q191463 <!-- Batuan, Masbate --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054104000 -->
| Q191478 <!-- Cataingan, Masbate --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054105000 -->
| Q191482 <!-- Cawayan, Masbate --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054106000 -->
| Q191490 <!-- Claveria, Masbate --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054107000 -->
| Q191496 <!-- Dimasalang, Masbate --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054108000 -->
| Q191501 <!-- Esperanza, Masbate --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054109000 -->
| Q191512 <!-- Mandaon, Masbate --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054110000 -->
| Q191651 <!-- Masbate, Masbate --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054111000 -->
| Q191522 <!-- Milagros, Masbate --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054112000 -->
| Q191533 <!-- Mobo, Masbate --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054113000 -->
| Q191544 <!-- Monreal, Masbate --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054114000 -->
| Q191558 <!-- Palanas, Masbate --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054115000 -->
| Q191581 <!-- Pio V. Corpuz, Masbate --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054116000 -->
| Q191590 <!-- Placer, Masbate --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054117000 -->
| Q191606 <!-- San Fernando, Masbate --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054118000 -->
| Q191621 <!-- San Jacinto, Masbate --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054119000 -->
| Q191630 <!-- San Pascual, Masbate --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054120000 -->
| Q191636 <!-- Uson, Masbate --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054121000 -->
| Q174114 <!-- Barcelona, Sorsogon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056202000 -->
| Q174132 <!-- Bulan, Sorsogon --> = 63 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056203000 -->
| Q174162 <!-- Casiguran, Sorsogon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056205000 -->
| Q174177 <!-- Castilla, Sorsogon --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056206000 -->
| Q174192 <!-- Donsol, Sorsogon --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056207000 -->
| Q174201 <!-- Gubat, Sorsogon --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056208000 -->
| Q174215 <!-- Irosin, Sorsogon --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056209000 -->
| Q174236 <!-- Magallanes, Sorsogon --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056211000 -->
| Q174246 <!-- Matnog, Sorsogon --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056212000 -->
| Q174269 <!-- Prieto Diaz, Sorsogon --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056214000 -->
| Q174281 <!-- Santa Magdalena, Sorsogon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056215000 -->
| Q107023 <!-- Buenavista, Marinduque --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174002000 -->
| Q107029 <!-- Gasan, Marinduque --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174003000 -->
| Q107454 <!-- Abra de Ilog, Occidental Mindoro --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175101000 -->
| Q107460 <!-- Calintaan, Occidental Mindoro --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175102000 -->
| Q107465 <!-- Looc, Occidental Mindoro --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175103000 -->
| Q107476 <!-- Lubang, Occidental Mindoro --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175104000 -->
| Q107482 <!-- Magsaysay, Occidental Mindoro --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175105000 -->
| Q107488 <!-- Mamburao , Occidental Mindoro --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175106000 -->
| Q107493 <!-- Paluan, Occidental Mindoro --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175107000 -->
| Q107499 <!-- Rizal, Occidental Mindoro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175108000 -->
| Q107505 <!-- Sablayan, Occidental Mindoro --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175109000 -->
| Q107511 <!-- San Jose, Occidental Mindoro --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175110000 -->
| Q107519 <!-- Santa Cruz, Occidental Mindoro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175111000 -->
| Q107538 <!-- Baco, Oriental Mindoro --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175201000 -->
| Q107543 <!-- Bansud, Oriental Mindoro --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175202000 -->
| Q107550 <!-- Bongabong, Oriental Mindoro --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175203000 -->
| Q107554 <!-- Bulalacao, Oriental Mindoro --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175204000 -->
| Q107624 <!-- Calapan, Oriental Mindoro --> = 62 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175205000 -->
| Q107559 <!-- Gloria, Oriental Mindoro --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175206000 -->
| Q107567 <!-- Mansalay, Oriental Mindoro --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175207000 -->
| Q107573 <!-- Naujan, Oriental Mindoro --> = 70 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175208000 -->
| Q107578 <!-- Pinamalayan, Oriental Mindoro --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175209000 -->
| Q107585 <!-- Pola, Oriental Mindoro --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175210000 -->
| Q107593 <!-- Puerto Galera, Oriental Mindoro --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175211000 -->
| Q107598 <!-- Roxas, Oriental Mindoro --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175212000 -->
| Q107606 <!-- San Teodoro, Oriental Mindoro --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175213000 -->
| Q107612 <!-- Socorro, Oriental Mindoro --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175214000 -->
| Q107618 <!-- Victoria, Oriental Mindoro --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175215000 -->
| Q111338 <!-- Aborlan, Palawan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175301000 -->
| Q111351 <!-- Agutaya, Palawan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175302000 -->
| Q111360 <!-- Araceli, Palawan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175303000 -->
| Q111372 <!-- Balabac, Palawan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175304000 -->
| Q111378 <!-- Bataraza, Palawan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175305000 -->
| Q111386 <!-- Brooke's Point, Palawan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175306000 -->
| Q111393 <!-- Busuanga, Palawan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175307000 -->
| Q111402 <!-- Cagayancillo, Palawan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175308000 -->
| Q111414 <!-- Coron, Palawan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175309000 -->
| Q111427 <!-- Culion, Palawan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175322000 -->
| Q111438 <!-- Cuyo, Palawan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175310000 -->
| Q111468 <!-- Dumaran, Palawan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175311000 -->
| Q111483 <!-- El Nido, Palawan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175312000 -->
| Q111495 <!-- Kalayaan, Palawan --> = 1 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175321000 -->
| Q111506 <!-- Linapacan, Palawan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175313000 -->
| Q111521 <!-- Magsaysay, Palawan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175314000 -->
| Q111535 <!-- Narra, Palawan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175315000 -->
| Q111739 <!-- Puerto Princesa --> = 66 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175316000 -->
| Q111662 <!-- Quezon, Palawan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175317000 -->
| Q111677 <!-- Rizal, Palawan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175323000 -->
| Q111689 <!-- Roxas, Palawan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175318000 -->
| Q111707 <!-- San Vicente, Palawan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175319000 -->
| Q111719 <!-- Sofronio Española, Palawan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175324000 -->
| Q111730 <!-- Taytay, Palawan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175320000 -->
| Q174497 <!-- Alcantara, Romblon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175901000 -->
| Q174511 <!-- Banton, Romblon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175902000 -->
| Q174525 <!-- Cajidiocan, Romblon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175903000 -->
| Q174544 <!-- Calatrava, Romblon --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175904000 -->
| Q174562 <!-- Concepcion, Romblon --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175905000 -->
| Q174575 <!-- Corcuera, Romblon --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175906000 -->
| Q174591 <!-- Ferrol, Romblon --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175916000 -->
| Q174607 <!-- Looc, Romblon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175907000 -->
| Q174620 <!-- Magdiwang, Romblon --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175908000 -->
| Q174632 <!-- Odiongan, Romblon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175909000 -->
| Q174649 <!-- Romblon , Romblon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175910000 -->
| Q174659 <!-- San Agustin, Romblon --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175911000 -->
| Q174667 <!-- San Andres, Romblon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175912000 -->
| Q174676 <!-- San Fernando, Romblon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175913000 -->
| Q174689 <!-- San Jose, Romblon --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175914000 -->
| Q174702 <!-- Santa Fe, Romblon --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175915000 -->
| Q174717 <!-- Santa Maria, Romblon --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175917000 -->
| Q174149 <!-- Bulusan, Sorsogon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056204000 -->
| Q174226 <!-- Juban, Sorsogon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056210000 -->
| Q174255 <!-- Pilar, Sorsogon --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056213000 -->
| Q174096 <!-- Sorsogon, Sorsogon --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056216000 -->
| Q434743 <!-- Altavas, Aklan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060401000 -->
| Q626586 <!-- Balete, Aklan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060402000 -->
| Q569215 <!-- Banga, Aklan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060403000 -->
| Q626645 <!-- Batan, Aklan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060404000 -->
| Q576805 <!-- Buruanga, Aklan --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060405000 -->
| Q626695 <!-- Ibajay, Aklan --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060406000 -->
| Q626721 <!-- Kalibo , Aklan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060407000 -->
| Q626746 <!-- Lezo, Aklan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060408000 -->
| Q626786 <!-- Libacao, Aklan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060409000 -->
| Q626820 <!-- Madalag, Aklan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060410000 -->
| Q626873 <!-- Makato, Aklan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060411000 -->
| Q626905 <!-- Malay, Aklan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060412000 -->
| Q626935 <!-- Malinao, Aklan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060413000 -->
| Q626959 <!-- Nabas, Aklan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060414000 -->
| Q626992 <!-- New Washington, Aklan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060415000 -->
| Q627008 <!-- Numancia, Aklan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060416000 -->
| Q627028 <!-- Tangalan, Aklan --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060417000 -->
| Q492119 <!-- Anini-y, Antique --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060601000 -->
| Q492155 <!-- Barbaza, Antique --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060602000 -->
| Q492263 <!-- Belison, Antique --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060603000 -->
| Q492325 <!-- Bugasong, Antique --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060604000 -->
| Q492363 <!-- Caluya, Antique --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060605000 -->
| Q492406 <!-- Culasi, Antique --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060606000 -->
| Q144779 <!-- Hamtic, Antique --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060608000 -->
| Q492479 <!-- Laua-an, Antique --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060609000 -->
| Q492516 <!-- Libertad, Antique --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060610000 -->
| Q492545 <!-- Pandan, Antique --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060611000 -->
| Q492577 <!-- Patnongon, Antique --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060612000 -->
| Q492619 <!-- San Jose, Antique --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060613000 -->
| Q492673 <!-- San Remigio, Antique --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060614000 -->
| Q492707 <!-- Sebaste, Antique --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060615000 -->
| Q492742 <!-- Sibalom, Antique --> = 76 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060616000 -->
| Q492780 <!-- Tibiao, Antique --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060617000 -->
| Q492817 <!-- Tobias Fornier, Antique --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060607000 -->
| Q492862 <!-- Valderrama, Antique --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060618000 -->
| Q355953 <!-- Cuartero, Capiz --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061901000 -->
| Q355986 <!-- Dao, Capiz --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061902000 -->
| Q356019 <!-- Dumalag, Capiz --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061903000 -->
| Q356053 <!-- Dumarao, Capiz --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061904000 -->
| Q356081 <!-- Ivisan, Capiz --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061905000 -->
| Q356106 <!-- Jamindan, Capiz --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061906000 -->
| Q356153 <!-- Ma-ayon, Capiz --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061907000 -->
| Q356174 <!-- Mambusao, Capiz --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061908000 -->
| Q356204 <!-- Panay, Capiz --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061909000 -->
| Q356231 <!-- Panitan, Capiz --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061910000 -->
| Q356266 <!-- Pilar, Capiz --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061911000 -->
| Q356292 <!-- Pontevedra, Capiz --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061912000 -->
| Q356313 <!-- President Roxas, Capiz --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061913000 -->
| Q2209 <!-- Roxas, Capiz --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061914000 -->
| Q356338 <!-- Sapi-an, Capiz --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061915000 -->
| Q356368 <!-- Sigma, Capiz --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061916000 -->
| Q356398 <!-- Tapaz, Capiz --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061917000 -->
| Q313781 <!-- Buenavista, Guimaras --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067901000 -->
| Q313802 <!-- Jordan, Guimaras --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067902000 -->
| Q313810 <!-- Nueva Valencia, Guimaras --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067903000 -->
| Q313825 <!-- San Lorenzo, Guimaras --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067904000 -->
| Q313844 <!-- Sibunag, Guimaras --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067905000 -->
| Q274491 <!-- Ajuy, Iloilo --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063001000 -->
| Q274508 <!-- Alimodian, Iloilo --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063002000 -->
| Q274543 <!-- Anilao, Iloilo --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063003000 -->
| Q274557 <!-- Badiangan, Iloilo --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063004000 -->
| Q274578 <!-- Balasan, Iloilo --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063005000 -->
| Q274595 <!-- Banate, Iloilo --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063006000 -->
| Q82502 <!-- Barotac Nuevo, Iloilo --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063007000 -->
| Q82493 <!-- Barotac Viejo, Iloilo --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063008000 -->
| Q274654 <!-- Batad, Iloilo --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063009000 -->
| Q274671 <!-- Bingawan, Iloilo --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063010000 -->
| Q274693 <!-- Cabatuan, Iloilo --> = 68 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063012000 -->
| Q274713 <!-- Calinog, Iloilo --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063013000 -->
| Q274731 <!-- Carles, Iloilo --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063014000 -->
| Q274749 <!-- Concepcion, Iloilo --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063015000 -->
| Q274780 <!-- Dingle, Iloilo --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063016000 -->
| Q274795 <!-- Dueñas, Iloilo --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063017000 -->
| Q74758 <!-- Dumangas, Iloilo --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063018000 -->
| Q82506 <!-- Estancia, Iloilo --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063019000 -->
| Q274847 <!-- Guimbal, Iloilo --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063020000 -->
| Q74755 <!-- Igbaras, Iloilo --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063021000 -->
| Q459787 <!-- Iloilo --> = 180 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063022000 -->
| Q82570 <!-- Janiuay, Iloilo --> = 60 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063023000 -->
| Q274907 <!-- Lambunao, Iloilo --> = 73 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063025000 -->
| Q274937 <!-- Leganes, Iloilo --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063026000 -->
| Q274961 <!-- Lemery, Iloilo --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063027000 -->
| Q274987 <!-- Leon, Iloilo --> = 85 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063028000 -->
| Q275015 <!-- Maasin, Iloilo --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063029000 -->
| Q74753 <!-- Miagao, Iloilo --> = 119 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063030000 -->
| Q275071 <!-- Mina, Iloilo --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063031000 -->
| Q275184 <!-- New Lucena, Iloilo --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063032000 -->
| Q275199 <!-- Oton, Iloilo --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063034000 -->
| Q1855693 <!-- Passi, Iloilo --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063035000 -->
| Q275221 <!-- Pavia, Iloilo --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063036000 -->
| Q275243 <!-- Pototan, Iloilo --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063037000 -->
| Q275264 <!-- San Dionisio, Iloilo --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063038000 -->
| Q275280 <!-- San Enrique, Iloilo --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063039000 -->
| Q275295 <!-- San Joaquin, Iloilo --> = 85 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063040000 -->
| Q275312 <!-- San Miguel, Iloilo --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063041000 -->
| Q275329 <!-- San Rafael, Iloilo --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063042000 -->
| Q275347 <!-- Santa Barbara, Iloilo --> = 60 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063043000 -->
| Q275368 <!-- Sara, Iloilo --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063044000 -->
| Q82497 <!-- Tigbauan, Iloilo --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063045000 -->
| Q275417 <!-- Tubungan, Iloilo --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063046000 -->
| Q148064 <!-- Zarraga, Iloilo --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063047000 -->
| Q5217 <!-- Bacolod --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/060000000 -->
| Q628297 <!-- Bago, Negros Occidental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064502000 -->
| Q195243 <!-- Binalbagan, Negros Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064503000 -->
| Q1020688 <!-- Cadiz, Negros Occidental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064504000 -->
| Q195258 <!-- Calatrava, Negros Occidental --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064505000 -->
| Q195272 <!-- Candoni, Negros Occidental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064506000 -->
| Q195287 <!-- Cauayan, Negros Occidental --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064507000 -->
| Q195304 <!-- Enrique B. Magalona, Negros Occidental --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064508000 -->
| Q1027743 <!-- Escalante, Negros Occidental --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064509000 -->
| Q1423846 <!-- Himamaylan, Negros Occidental --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064510000 -->
| Q195322 <!-- Hinigaran, Negros Occidental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064511000 -->
| Q195336 <!-- Hinoba-an, Negros Occidental --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064512000 -->
| Q195352 <!-- Ilog, Negros Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064513000 -->
| Q195373 <!-- Isabela, Negros Occidental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064514000 -->
| Q1026445 <!-- Kabankalan, Negros Occidental --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064515000 -->
| Q1789908 <!-- La Carlota, Negros Occidental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064516000 -->
| Q195397 <!-- La Castellana, Negros Occidental --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064517000 -->
| Q195418 <!-- Manapla, Negros Occidental --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064518000 -->
| Q195438 <!-- Moises Padilla, Negros Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064519000 -->
| Q195459 <!-- Murcia, Negros Occidental --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064520000 -->
| Q195477 <!-- Pontevedra, Negros Occidental --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064521000 -->
| Q195489 <!-- Pulupandan, Negros Occidental --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064522000 -->
| Q1787527 <!-- Sagay, Negros Occidental --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064523000 -->
| Q195503 <!-- Salvador Benedicto, Negros Occidental --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064532000 -->
| Q1025390 <!-- San Carlos, Negros Occidental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064524000 -->
| Q195523 <!-- San Enrique, Negros Occidental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064525000 -->
| Q1020696 <!-- Silay, Negros Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064526000 -->
| Q1027115 <!-- Sipalay, Negros Occidental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064527000 -->
| Q1027120 <!-- Talisay, Negros Occidental --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064528000 -->
| Q195549 <!-- Toboso, Negros Occidental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064529000 -->
| Q195569 <!-- Valladolid, Negros Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064530000 -->
| Q1026021 <!-- Victorias, Negros Occidental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064531000 -->
| Q194822 <!-- Amlan, Negros Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074601000 -->
| Q194854 <!-- Ayungon, Negros Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074602000 -->
| Q194874 <!-- Bacong, Negros Oriental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074603000 -->
| Q628590 <!-- Bais, Negros Oriental --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074604000 -->
| Q194900 <!-- Basay, Negros Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074605000 -->
| Q812113 <!-- Bayawan, Negros Oriental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074606000 -->
| Q194916 <!-- Bindoy, Negros Oriental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074607000 -->
| Q991602 <!-- Canlaon, Negros Oriental --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074608000 -->
| Q194940 <!-- Dauin, Negros Oriental --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074609000 -->
| Q873377 <!-- Dumaguete, Negros Oriental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074610000 -->
| Q195197 <!-- Guihulngan, Negros Oriental --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074611000 -->
| Q194967 <!-- Jimalalud, Negros Oriental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074612000 -->
| Q194983 <!-- La Libertad, Negros Oriental --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074613000 -->
| Q195004 <!-- Mabinay, Negros Oriental --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074614000 -->
| Q195018 <!-- Manjuyod, Negros Oriental --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074615000 -->
| Q195040 <!-- Pamplona, Negros Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074616000 -->
| Q195056 <!-- San Jose, Negros Oriental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074617000 -->
| Q195074 <!-- Santa Catalina, Negros Oriental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074618000 -->
| Q195090 <!-- Siaton, Negros Oriental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074619000 -->
| Q195106 <!-- Sibulan, Negros Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074620000 -->
| Q1020705 <!-- Tanjay, Negros Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074621000 -->
| Q195121 <!-- Tayasan, Negros Oriental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074622000 -->
| Q195140 <!-- Valencia, Negros Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074623000 -->
| Q195164 <!-- Vallehermoso, Negros Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074624000 -->
| Q145673 <!-- Zamboanguita, Negros Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074625000 -->
| Q404369 <!-- Alburquerque, Bohol --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071201000 -->
| Q404403 <!-- Alicia, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071202000 -->
| Q404434 <!-- Anda, Bohol --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071203000 -->
| Q404459 <!-- Antequera, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071204000 -->
| Q404489 <!-- Baclayon, Bohol --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071205000 -->
| Q404519 <!-- Balilihan, Bohol --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071206000 -->
| Q404549 <!-- Batuan, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071207000 -->
| Q404581 <!-- Bien Unido, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071248000 -->
| Q404604 <!-- Bilar, Bohol --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071208000 -->
| Q404623 <!-- Buenavista, Bohol --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071209000 -->
| Q404652 <!-- Calape, Bohol --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071210000 -->
| Q404680 <!-- Candijay, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071211000 -->
| Q241239 <!-- Carmen, Bohol --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071212000 -->
| Q404750 <!-- Catigbian, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071213000 -->
| Q404775 <!-- Clarin, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071214000 -->
| Q404799 <!-- Corella, Bohol --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071215000 -->
| Q404825 <!-- Cortes, Bohol --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071216000 -->
| Q404854 <!-- Dagohoy, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071217000 -->
| Q404882 <!-- Danao, Bohol --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071218000 -->
| Q404908 <!-- Dauis, Bohol --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071219000 -->
| Q404930 <!-- Dimiao, Bohol --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071220000 -->
| Q404951 <!-- Duero, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071221000 -->
| Q404976 <!-- Garcia Hernandez, Bohol --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071222000 -->
| Q405005 <!-- Getafe, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071226000 -->
| Q405058 <!-- Guindulman, Bohol --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071223000 -->
| Q405088 <!-- Inabanga, Bohol --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071224000 -->
| Q405110 <!-- Jagna, Bohol --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071225000 -->
| Q405141 <!-- Lila, Bohol --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071227000 -->
| Q405171 <!-- Loay, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071228000 -->
| Q405197 <!-- Loboc, Bohol --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071229000 -->
| Q405224 <!-- Loon, Bohol --> = 67 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071230000 -->
| Q405268 <!-- Mabini, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071231000 -->
| Q405303 <!-- Maribojoc, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071232000 -->
| Q178330 <!-- Panglao, Bohol --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071233000 -->
| Q405384 <!-- Pilar, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071234000 -->
| Q405427 <!-- President Carlos P. Garcia, Bohol --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071235000 -->
| Q405472 <!-- Sagbayan, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071236000 -->
| Q259298 <!-- San Isidro, Bohol --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071237000 -->
| Q405544 <!-- San Miguel, Bohol --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071238000 -->
| Q386388 <!-- Sevilla, Bohol --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071239000 -->
| Q405628 <!-- Sierra Bullones, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071240000 -->
| Q405674 <!-- Sikatuna, Bohol --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071241000 -->
| Q1826 <!-- Tagbilaran, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071242000 -->
| Q405714 <!-- Talibon, Bohol --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071243000 -->
| Q405749 <!-- Trinidad, Bohol --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071244000 -->
| Q405980 <!-- Tubigon, Bohol --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071245000 -->
| Q406015 <!-- Ubay, Bohol --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071246000 -->
| Q406046 <!-- Valencia, Bohol --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071247000 -->
| Q315636 <!-- Alcantara, Cebu --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072201000 -->
| Q315655 <!-- Alcoy, Cebu --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072202000 -->
| Q315669 <!-- Alegria, Cebu --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072203000 -->
| Q315687 <!-- Aloguinsan, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072204000 -->
| Q315703 <!-- Argao, Cebu --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072205000 -->
| Q315719 <!-- Asturias, Cebu --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072206000 -->
| Q315733 <!-- Badian, Cebu --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072207000 -->
| Q315754 <!-- Balamban, Cebu --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072208000 -->
| Q315771 <!-- Bantayan, Cebu --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072209000 -->
| Q315790 <!-- Barili, Cebu --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072210000 -->
| Q890623 <!-- Bogo, Cebu --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072211000 -->
| Q315809 <!-- Boljoon, Cebu --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072212000 -->
| Q315827 <!-- Borbon, Cebu --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072213000 -->
| Q315851 <!-- Carcar, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072214000 -->
| Q315882 <!-- Carmen, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072215000 -->
| Q315900 <!-- Catmon, Cebu --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072216000 -->
| Q1467 <!-- Cebu --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072217000 -->
| Q315923 <!-- Compostela, Cebu --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072218000 -->
| Q315945 <!-- Consolacion, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072219000 -->
| Q315965 <!-- Cordova, Cebu --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072220000 -->
| Q315981 <!-- Daanbantayan, Cebu --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072221000 -->
| Q316001 <!-- Dalaguete, Cebu --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072222000 -->
| Q1159273 <!-- Danao, Cebu --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072223000 -->
| Q316019 <!-- Dumanjug, Cebu --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072224000 -->
| Q316037 <!-- Ginatilan, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072225000 -->
| Q574903 <!-- Lapu-Lapu --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072226000 -->
| Q316056 <!-- Liloan, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072227000 -->
| Q316080 <!-- Madridejos, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072228000 -->
| Q316101 <!-- Malabuyoc, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072229000 -->
| Q1889017 <!-- Mandaue --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072230000 -->
| Q316125 <!-- Medellin, Cebu --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072231000 -->
| Q316146 <!-- Minglanilla, Cebu --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072232000 -->
| Q316171 <!-- Moalboal, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072233000 -->
| Q316197 <!-- Naga, Cebu --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072234000 -->
| Q316230 <!-- Oslob, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072235000 -->
| Q316245 <!-- Pilar, Cebu --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072236000 -->
| Q316259 <!-- Pinamungahan, Cebu --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072237000 -->
| Q316275 <!-- Poro, Cebu --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072238000 -->
| Q316289 <!-- Ronda, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072239000 -->
| Q316303 <!-- Samboan, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072240000 -->
| Q316318 <!-- San Fernando, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072241000 -->
| Q316332 <!-- San Francisco, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072242000 -->
| Q316350 <!-- San Remigio, Cebu --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072243000 -->
| Q316370 <!-- Santa Fe, Cebu --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072244000 -->
| Q316386 <!-- Santander, Cebu --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072245000 -->
| Q316404 <!-- Sibonga, Cebu --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072246000 -->
| Q316432 <!-- Sogod, Cebu --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072247000 -->
| Q316453 <!-- Tabogon, Cebu --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072248000 -->
| Q316474 <!-- Tabuelan, Cebu --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072249000 -->
| Q316500 <!-- Talisay, Cebu --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072250000 -->
| Q316527 <!-- Toledo, Cebu --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072251000 -->
| Q316547 <!-- Tuburan, Cebu --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072252000 -->
| Q316564 <!-- Tudela, Cebu --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072253000 -->
| Q174305 <!-- Enrique Villanueva, Siquijor --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076101000 -->
| Q174317 <!-- Larena, Siquijor --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076102000 -->
| Q174332 <!-- Lazi, Siquijor --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076103000 -->
| Q174343 <!-- Maria, Siquijor --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076104000 -->
| Q174354 <!-- San Juan, Siquijor --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076105000 -->
| Q174373 <!-- Siquijor, Siquijor --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076106000 -->
| Q406163 <!-- Almeria, Biliran --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087801000 -->
| Q406186 <!-- Biliran, Biliran --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087802000 -->
| Q406226 <!-- Cabucgayan, Biliran --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087803000 -->
| Q406267 <!-- Caibiran, Biliran --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087804000 -->
| Q406317 <!-- Culaba, Biliran --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087805000 -->
| Q406353 <!-- Kawayan, Biliran --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087806000 -->
| Q406393 <!-- Maripipi, Biliran --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087807000 -->
| Q277211 <!-- Naval, Biliran --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087808000 -->
| Q313880 <!-- Arteche, Eastern Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082601000 -->
| Q313904 <!-- Balangiga, Eastern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082602000 -->
| Q313914 <!-- Balangkayan, Eastern Samar --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082603000 -->
| Q894059 <!-- Borongan, Eastern Samar --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082604000 -->
| Q313926 <!-- Can-avid, Eastern Samar --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082605000 -->
| Q313939 <!-- Dolores, Eastern Samar --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082606000 -->
| Q313951 <!-- General MacArthur, Eastern Samar --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082607000 -->
| Q313967 <!-- Giporlos, Eastern Samar --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082608000 -->
| Q313984 <!-- Guiuan, Eastern Samar --> = 60 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082609000 -->
| Q314002 <!-- Hernani, Eastern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082610000 -->
| Q314021 <!-- Jipapad, Eastern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082611000 -->
| Q314046 <!-- Lawaan, Eastern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082612000 -->
| Q314070 <!-- Llorente, Eastern Samar --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082613000 -->
| Q314096 <!-- Maslog, Eastern Samar --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082614000 -->
| Q314117 <!-- Maydolong, Eastern Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082615000 -->
| Q314129 <!-- Mercedes, Eastern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082616000 -->
| Q314154 <!-- Oras, Eastern Samar --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082617000 -->
| Q314175 <!-- Quinapondan, Eastern Samar --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082618000 -->
| Q314197 <!-- Salcedo, Eastern Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082619000 -->
| Q314220 <!-- San Julian, Eastern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082620000 -->
| Q314239 <!-- San Policarpo, Eastern Samar --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082621000 -->
| Q314257 <!-- Sulat, Eastern Samar --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082622000 -->
| Q205677 <!-- Taft, Eastern Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082623000 -->
| Q212877 <!-- Abuyog, Leyte --> = 63 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083701000 -->
| Q212888 <!-- Alangalang, Leyte --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083702000 -->
| Q212896 <!-- Albuera, Leyte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083703000 -->
| Q212907 <!-- Babatngon, Leyte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083705000 -->
| Q212924 <!-- Barugo, Leyte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083706000 -->
| Q212935 <!-- Bato, Leyte --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083707000 -->
| Q812117 <!-- Baybay, Leyte --> = 92 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083708000 -->
| Q212945 <!-- Burauen, Leyte --> = 77 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083710000 -->
| Q212951 <!-- Calubian, Leyte --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083713000 -->
| Q212958 <!-- Capoocan, Leyte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083714000 -->
| Q212969 <!-- Carigara, Leyte --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083715000 -->
| Q212981 <!-- Dagami, Leyte --> = 65 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083717000 -->
| Q212988 <!-- Dulag, Leyte --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083718000 -->
| Q213006 <!-- Hilongos, Leyte --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083719000 -->
| Q213024 <!-- Hindang, Leyte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083720000 -->
| Q213042 <!-- Inopacan, Leyte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083721000 -->
| Q213060 <!-- Isabel, Leyte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083722000 -->
| Q213086 <!-- Jaro, Leyte --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083723000 -->
| Q213101 <!-- Javier, Leyte --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083724000 -->
| Q213113 <!-- Julita, Leyte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083725000 -->
| Q213130 <!-- Kananga, Leyte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083726000 -->
| Q213144 <!-- La Paz, Leyte --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083728000 -->
| Q213160 <!-- Leyte, Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083729000 -->
| Q213174 <!-- MacArthur, Leyte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083730000 -->
| Q213190 <!-- Mahaplag, Leyte --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083731000 -->
| Q213209 <!-- Matag-ob, Leyte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083733000 -->
| Q213227 <!-- Matalom, Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083734000 -->
| Q213245 <!-- Mayorga, Leyte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083735000 -->
| Q213261 <!-- Merida, Leyte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083736000 -->
| Q1014782 <!-- Ormoc --> = 85 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083738000 -->
| Q213281 <!-- Palo, Leyte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083739000 -->
| Q213303 <!-- Palompon, Leyte --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083740000 -->
| Q213323 <!-- Pastrana, Leyte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083741000 -->
| Q213341 <!-- San Isidro, Leyte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083742000 -->
| Q213357 <!-- San Miguel, Leyte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083743000 -->
| Q213378 <!-- Santa Fe, Leyte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083744000 -->
| Q213400 <!-- Tabango, Leyte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083745000 -->
| Q213420 <!-- Tabontabon, Leyte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083746000 -->
| Q40626 <!-- Tacloban --> = 138 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083747000 -->
| Q213431 <!-- Tanauan, Leyte --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083748000 -->
| Q213442 <!-- Tolosa, Leyte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083749000 -->
| Q213455 <!-- Tunga, Leyte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083750000 -->
| Q213463 <!-- Villaba, Leyte --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083751000 -->
| Q174784 <!-- Allen, Northern Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084801000 -->
| Q174801 <!-- Biri, Northern Samar --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084802000 -->
| Q174822 <!-- Bobon, Northern Samar --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084803000 -->
| Q174871 <!-- Capul, Northern Samar --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084804000 -->
| Q174886 <!-- Catarman , Northern Samar --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084805000 -->
| Q174906 <!-- Catubig, Northern Samar --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084806000 -->
| Q174919 <!-- Gamay, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084807000 -->
| Q174940 <!-- Laoang, Northern Samar --> = 56 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084808000 -->
| Q174962 <!-- Lapinig, Northern Samar --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084809000 -->
| Q174987 <!-- Las Navas, Northern Samar --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084810000 -->
| Q175008 <!-- Lavezares, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084811000 -->
| Q175031 <!-- Lope de Vega, Northern Samar --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084824000 -->
| Q175054 <!-- Mapanas, Northern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084812000 -->
| Q175082 <!-- Mondragon, Northern Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084813000 -->
| Q175100 <!-- Palapag, Northern Samar --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084814000 -->
| Q175115 <!-- Pambujan, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084815000 -->
| Q175136 <!-- Rosario, Northern Samar --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084816000 -->
| Q175163 <!-- San Antonio, Northern Samar --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084817000 -->
| Q175183 <!-- San Isidro, Northern Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084818000 -->
| Q175203 <!-- San Jose, Northern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084819000 -->
| Q175230 <!-- San Roque, Northern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084820000 -->
| Q175247 <!-- San Vicente, Northern Samar --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084821000 -->
| Q175267 <!-- Silvino Lobos, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084822000 -->
| Q175283 <!-- Victoria, Northern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084823000 -->
| Q816088 <!-- Almagro, Samar --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086001000 -->
| Q809957 <!-- Basey, Samar --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086002000 -->
| Q577336 <!-- Calbayog, Samar --> = 157 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086003000 -->
| Q816128 <!-- Calbiga, Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086004000 -->
| Q1020709 <!-- Catbalogan, Samar --> = 57 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086005000 -->
| Q816142 <!-- Daram, Samar --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086006000 -->
| Q816160 <!-- Gandara, Samar --> = 69 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086007000 -->
| Q816184 <!-- Hinabangan, Samar --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086008000 -->
| Q816207 <!-- Jiabong, Samar --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086009000 -->
| Q816240 <!-- Marabut, Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086010000 -->
| Q816267 <!-- Matuguinao, Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086011000 -->
| Q816296 <!-- Motiong, Samar --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086012000 -->
| Q816320 <!-- Pagsanghan, Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086026000 -->
| Q816342 <!-- Paranas, Samar --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086022000 -->
| Q252184 <!-- Pinabacdao, Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086013000 -->
| Q816396 <!-- San Jorge, Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086025000 -->
| Q816413 <!-- San Jose de Buan, Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086014000 -->
| Q816435 <!-- San Sebastian, Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086015000 -->
| Q816454 <!-- Santa Margarita, Samar --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086016000 -->
| Q816471 <!-- Santa Rita, Samar --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086017000 -->
| Q608320 <!-- Santo Niño, Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086018000 -->
| Q126346 <!-- Tagapul-an, Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086024000 -->
| Q816519 <!-- Talalora, Samar --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086019000 -->
| Q816542 <!-- Tarangnan, Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086020000 -->
| Q816564 <!-- Villareal, Samar --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086021000 -->
| Q229664 <!-- Zumarraga, Samar --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086023000 -->
| Q173608 <!-- Anahawan, Southern Leyte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086401000 -->
| Q173622 <!-- Bontoc, Southern Leyte --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086402000 -->
| Q173632 <!-- Hinunangan, Southern Leyte --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086403000 -->
| Q173641 <!-- Hinundayan, Southern Leyte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086404000 -->
| Q173655 <!-- Libagon, Southern Leyte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086405000 -->
| Q173665 <!-- Liloan, Southern Leyte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086406000 -->
| Q173678 <!-- Limasawa, Southern Leyte --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086419000 -->
| Q1025387 <!-- Maasin, Southern Leyte --> = 70 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086407000 -->
| Q173688 <!-- Macrohon, Southern Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086408000 -->
| Q173701 <!-- Malitbog, Southern Leyte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086409000 -->
| Q173713 <!-- Padre Burgos, Southern Leyte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086410000 -->
| Q173723 <!-- Pintuyan, Southern Leyte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086411000 -->
| Q173735 <!-- Saint Bernard, Southern Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086412000 -->
| Q173745 <!-- San Francisco, Southern Leyte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086413000 -->
| Q173754 <!-- San Juan, Southern Leyte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086414000 -->
| Q173763 <!-- San Ricardo, Southern Leyte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086415000 -->
| Q173774 <!-- Silago, Southern Leyte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086416000 -->
| Q173792 <!-- Sogod, Southern Leyte --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086417000 -->
| Q173811 <!-- Tomas Oppus, Southern Leyte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086418000 -->
| Q132482 <!-- Baliguian, Zamboanga del Norte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097224000 -->
| Q1014775 <!-- Dapitan, Zamboanga del Norte --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097201000 -->
| Q432169 <!-- Dipolog, Zamboanga del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097202000 -->
| Q132496 <!-- Godod, Zamboanga del Norte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097225000 -->
| Q132507 <!-- Gutalac, Zamboanga del Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097223000 -->
| Q132520 <!-- Jose Dalman, Zamboanga del Norte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097222000 -->
| Q132523 <!-- Kalawit, Zamboanga del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097227000 -->
| Q132527 <!-- Katipunan, Zamboanga del Norte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097203000 -->
| Q132532 <!-- La Libertad, Zamboanga del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097204000 -->
| Q132535 <!-- Labason, Zamboanga del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097205000 -->
| Q132540 <!-- Leon B. Postigo, Zamboanga del Norte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097226000 -->
| Q132553 <!-- Liloy, Zamboanga del Norte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097206000 -->
| Q132561 <!-- Manukan, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097207000 -->
| Q132566 <!-- Mutia, Zamboanga del Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097208000 -->
| Q132570 <!-- Piñan, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097209000 -->
| Q132574 <!-- Polanco, Zamboanga del Norte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097210000 -->
| Q132578 <!-- President Manuel A. Roxas, Zamboanga del Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097211000 -->
| Q132583 <!-- Rizal, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097212000 -->
| Q132586 <!-- Salug, Zamboanga del Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097213000 -->
| Q132591 <!-- Sergio Osmeña Sr., Zamboanga del Norte --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097214000 -->
| Q132594 <!-- Siayan, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097215000 -->
| Q132599 <!-- Sibuco, Zamboanga del Norte --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097216000 -->
| Q132601 <!-- Sibutad, Zamboanga del Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097217000 -->
| Q132605 <!-- Sindangan, Zamboanga del Norte --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097218000 -->
| Q132610 <!-- Siocon, Zamboanga del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097219000 -->
| Q132613 <!-- Sirawai, Zamboanga del Norte --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097220000 -->
| Q132617 <!-- Tampilisan, Zamboanga del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097221000 -->
| Q132015 <!-- Aurora, Zamboanga del Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097302000 -->
| Q132032 <!-- Bayog, Zamboanga del Sur --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097303000 -->
| Q132057 <!-- Dimataling, Zamboanga del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097305000 -->
| Q132077 <!-- Dinas, Zamboanga del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097306000 -->
| Q132104 <!-- Dumalinao, Zamboanga del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097307000 -->
| Q132126 <!-- Dumingag, Zamboanga del Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097308000 -->
| Q132141 <!-- Guipos, Zamboanga del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097343000 -->
| Q132155 <!-- Josefina, Zamboanga del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097337000 -->
| Q132161 <!-- Kumalarang, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097311000 -->
| Q132184 <!-- Labangan, Zamboanga del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097312000 -->
| Q132200 <!-- Lakewood, Zamboanga del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097333000 -->
| Q132215 <!-- Lapuyan, Zamboanga del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097313000 -->
| Q132230 <!-- Mahayag, Zamboanga del Sur --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097315000 -->
| Q132244 <!-- Margosatubig, Zamboanga del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097317000 -->
| Q132262 <!-- Midsalip, Zamboanga del Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097318000 -->
| Q132271 <!-- Molave, Zamboanga del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097319000 -->
| Q874270 <!-- Pagadian, Zamboanga del Sur --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097322000 -->
| Q132284 <!-- Pitogo, Zamboanga del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097338000 -->
| Q132301 <!-- Ramon Magsaysay, Zamboanga del Sur --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097323000 -->
| Q132317 <!-- San Miguel, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097324000 -->
| Q132337 <!-- San Pablo, Zamboanga del Sur --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097325000 -->
| Q132353 <!-- Sominot, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097340000 -->
| Q132371 <!-- Tabina, Zamboanga del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097327000 -->
| Q132391 <!-- Tambulig, Zamboanga del Sur --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097328000 -->
| Q132403 <!-- Tigbao, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097344000 -->
| Q132417 <!-- Tukuran, Zamboanga del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097330000 -->
| Q132432 <!-- Vincenzo A. Sagun, Zamboanga del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097341000 -->
| Q1629 <!-- Zamboanga --> = 98 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097332000 -->
| Q131797 <!-- Alicia, Zamboanga Sibugay --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098301000 -->
| Q131811 <!-- Buug, Zamboanga Sibugay --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098302000 -->
| Q131816 <!-- Diplahan, Zamboanga Sibugay --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098303000 -->
| Q131838 <!-- Imelda, Zamboanga Sibugay --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098304000 -->
| Q131850 <!-- Ipil, Zamboanga Sibugay --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098305000 -->
| Q131870 <!-- Kabasalan, Zamboanga Sibugay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098306000 -->
| Q131892 <!-- Mabuhay, Zamboanga Sibugay --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098307000 -->
| Q131906 <!-- Malangas, Zamboanga Sibugay --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098308000 -->
| Q131917 <!-- Naga, Zamboanga Sibugay --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098309000 -->
| Q131926 <!-- Olutanga, Zamboanga Sibugay --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098310000 -->
| Q131941 <!-- Payao, Zamboanga Sibugay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098311000 -->
| Q131954 <!-- Roseller Lim, Zamboanga Sibugay --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098312000 -->
| Q124780 <!-- Siay, Zamboanga Sibugay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098313000 -->
| Q131968 <!-- Talusan, Zamboanga Sibugay --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098314000 -->
| Q131975 <!-- Titay, Zamboanga Sibugay --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098315000 -->
| Q131984 <!-- Tungawan, Zamboanga Sibugay --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098316000 -->
| Q356943 <!-- Baungon, Bukidnon --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101301000 -->
| Q356971 <!-- Cabanglasan, Bukidnon --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101322000 -->
| Q356997 <!-- Damulog, Bukidnon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101302000 -->
| Q357021 <!-- Dangcagan, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101303000 -->
| Q357053 <!-- Don Carlos, Bukidnon --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101304000 -->
| Q357075 <!-- Impasug-ong, Bukidnon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101305000 -->
| Q357100 <!-- Kadingilan, Bukidnon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101306000 -->
| Q357124 <!-- Kalilangan, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101307000 -->
| Q357152 <!-- Kibawe, Bukidnon --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101308000 -->
| Q357175 <!-- Kitaotao, Bukidnon --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101309000 -->
| Q357198 <!-- Lantapan, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101310000 -->
| Q357226 <!-- Libona, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101311000 -->
| Q1856 <!-- Malaybalay, Bukidnon --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101312000 -->
| Q357252 <!-- Malitbog, Bukidnon --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101313000 -->
| Q357272 <!-- Manolo Fortich, Bukidnon --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101314000 -->
| Q357299 <!-- Maramag, Bukidnon --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101315000 -->
| Q357311 <!-- Pangantucan, Bukidnon --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101316000 -->
| Q357342 <!-- Quezon, Bukidnon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101317000 -->
| Q357371 <!-- San Fernando, Bukidnon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101318000 -->
| Q357396 <!-- Sumilao, Bukidnon --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101319000 -->
| Q357420 <!-- Talakag, Bukidnon --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101320000 -->
| Q2158 <!-- Valencia, Bukidnon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101321000 -->
| Q356442 <!-- Catarman, Camiguin --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101801000 -->
| Q356472 <!-- Guinsiliban, Camiguin --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101802000 -->
| Q176033 <!-- Mahinog, Camiguin --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101803000 -->
| Q356518 <!-- Mambajao, Camiguin --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101804000 -->
| Q356549 <!-- Sagay, Camiguin --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101805000 -->
| Q274150 <!-- Bacolod, Lanao del Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103501000 -->
| Q274164 <!-- Baloi, Lanao del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103502000 -->
| Q274173 <!-- Baroy, Lanao del Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103503000 -->
| Q285488 <!-- Iligan --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103504000 -->
| Q274186 <!-- Kapatagan, Lanao del Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103505000 -->
| Q274197 <!-- Kauswagan, Lanao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103507000 -->
| Q274205 <!-- Kolambugan, Lanao del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103508000 -->
| Q274215 <!-- Lala, Lanao del Norte --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103509000 -->
| Q274230 <!-- Linamon, Lanao del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103510000 -->
| Q274243 <!-- Magsaysay, Lanao del Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103511000 -->
| Q274260 <!-- Maigo, Lanao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103512000 -->
| Q274272 <!-- Matungao, Lanao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103513000 -->
| Q274287 <!-- Munai, Lanao del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103514000 -->
| Q274299 <!-- Nunungan, Lanao del Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103515000 -->
| Q274313 <!-- Pantao Ragat, Lanao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103516000 -->
| Q274329 <!-- Pantar, Lanao del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103523000 -->
| Q274343 <!-- Poona Piagapo, Lanao del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103517000 -->
| Q274357 <!-- Salvador, Lanao del Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103518000 -->
| Q274369 <!-- Sapad, Lanao del Norte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103519000 -->
| Q274387 <!-- Sultan Naga Dimaporo, Lanao del Norte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103506000 -->
| Q274406 <!-- Tagoloan, Lanao del Norte --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103520000 -->
| Q274427 <!-- Tangcal, Lanao del Norte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103521000 -->
| Q274439 <!-- Tubod, Lanao del Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103522000 -->
| Q155502 <!-- Aloran, Misamis Occidental --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104201000 -->
| Q196056 <!-- Baliangao, Misamis Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104202000 -->
| Q196076 <!-- Bonifacio, Misamis Occidental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104203000 -->
| Q196097 <!-- Calamba, Misamis Occidental --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104204000 -->
| Q196114 <!-- Clarin, Misamis Occidental --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104205000 -->
| Q196129 <!-- Concepcion, Misamis Occidental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104206000 -->
| Q196145 <!-- Don Victoriano Chiongbian, Misamis Occidental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104217000 -->
| Q196158 <!-- Jimenez, Misamis Occidental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104207000 -->
| Q196173 <!-- Lopez Jaena, Misamis Occidental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104208000 -->
| Q1067897 <!-- Oroquieta, Misamis Occidental --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104209000 -->
| Q263837 <!-- Ozamiz, Misamis Occidental --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104210000 -->
| Q196191 <!-- Panaon, Misamis Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104211000 -->
| Q196207 <!-- Plaridel, Misamis Occidental --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104212000 -->
| Q196222 <!-- Sapang Dalaga, Misamis Occidental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104213000 -->
| Q196233 <!-- Sinacaban, Misamis Occidental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104214000 -->
| Q1026277 <!-- Tangub, Misamis Occidental --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104215000 -->
| Q196248 <!-- Tudela, Misamis Occidental --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104216000 -->
| Q195623 <!-- Alubijid, Misamis Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/104300000 -->
| Q195637 <!-- Balingasag, Misamis Oriental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104302000 -->
| Q195650 <!-- Balingoan, Misamis Oriental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104303000 -->
| Q195663 <!-- Binuangan, Misamis Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104304000 -->
| Q1645 <!-- Cagayan de Oro --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104305000 -->
| Q195676 <!-- Claveria, Misamis Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104306000 -->
| Q195686 <!-- El Salvador, Misamis Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104307000 -->
| Q1525029 <!-- Gingoog, Misamis Oriental --> = 79 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104308000 -->
| Q195696 <!-- Gitagum, Misamis Oriental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104309000 -->
| Q195709 <!-- Initao, Misamis Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104310000 -->
| Q195717 <!-- Jasaan, Misamis Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104311000 -->
| Q195726 <!-- Kinoguitan, Misamis Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104312000 -->
| Q195740 <!-- Lagonglong, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104313000 -->
| Q195755 <!-- Laguindingan, Misamis Oriental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104314000 -->
| Q195767 <!-- Libertad, Misamis Oriental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104315000 -->
| Q195780 <!-- Lugait, Misamis Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104316000 -->
| Q195799 <!-- Magsaysay, Misamis Oriental --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104318000 -->
| Q195815 <!-- Manticao, Misamis Oriental --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104317000 -->
| Q195834 <!-- Medina, Misamis Oriental --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104319000 -->
| Q195855 <!-- Naawan, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104320000 -->
| Q195870 <!-- Opol, Misamis Oriental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104321000 -->
| Q195883 <!-- Salay, Misamis Oriental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104322000 -->
| Q195899 <!-- Sugbongcogon, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104323000 -->
| Q1026274 <!-- Tagoloan, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104324000 -->
| Q195917 <!-- Talisayan, Misamis Oriental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104325000 -->
| Q195937 <!-- Villanueva, Misamis Oriental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104326000 -->
| Q627390 <!-- Buenavista, Agusan del Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160201000 -->
| Q1686 <!-- Butuan --> = 86 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160202000 -->
| Q1692 <!-- Cabadbaran, Agusan del Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160203000 -->
| Q627434 <!-- Carmen, Agusan del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160204000 -->
| Q627461 <!-- Jabonga, Agusan del Norte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160205000 -->
| Q627495 <!-- Kitcharao, Agusan del Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160206000 -->
| Q627529 <!-- Las Nieves, Agusan del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160207000 -->
| Q627572 <!-- Magallanes, Agusan del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160208000 -->
| Q627604 <!-- Nasipit, Agusan del Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160209000 -->
| Q627638 <!-- Remedios T. Romualdez, Agusan del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160212000 -->
| Q588955 <!-- Santiago, Agusan del Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160210000 -->
| Q176975 <!-- Tubay, Agusan del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160211000 -->
| Q1694 <!-- Bayugan, Agusan del Sur --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160301000 -->
| Q627049 <!-- Bunawan, Agusan del Sur --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160302000 -->
| Q627077 <!-- Esperanza, Agusan del Sur --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160303000 -->
| Q627107 <!-- La Paz, Agusan del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160304000 -->
| Q627120 <!-- Loreto, Agusan del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160305000 -->
| Q627144 <!-- Prosperidad, Agusan del Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160306000 -->
| Q627167 <!-- Rosario, Agusan del Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160307000 -->
| Q627190 <!-- San Francisco, Agusan del Sur --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160308000 -->
| Q627210 <!-- San Luis, Agusan del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160309000 -->
| Q627231 <!-- Santa Josefa, Agusan del Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160310000 -->
| Q627260 <!-- Sibagat, Agusan del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160314000 -->
| Q627286 <!-- Talacogon, Agusan del Sur --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160311000 -->
| Q627320 <!-- Trento, Agusan del Sur --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160312000 -->
| Q627349 <!-- Veruela, Agusan del Sur --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160313000 -->
| Q314298 <!-- Basilisa, Dinagat Islands --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168501000 -->
| Q314318 <!-- Cagdianao, Dinagat Islands --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168502000 -->
| Q314336 <!-- Dinagat, Dinagat Islands --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168503000 -->
| Q314345 <!-- Libjo, Dinagat Islands --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168504000 -->
| Q314356 <!-- Loreto, Dinagat Islands --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168505000 -->
| Q251691 <!-- San Jose, Dinagat Islands --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168506000 -->
| Q314374 <!-- Tubajon, Dinagat Islands --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168507000 -->
| Q155706 <!-- Alegria, Surigao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166701000 -->
| Q155720 <!-- Bacuag, Surigao del Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166702000 -->
| Q155735 <!-- Burgos, Surigao del Norte --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166704000 -->
| Q155748 <!-- Claver, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166706000 -->
| Q155763 <!-- Dapa, Surigao del Norte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166707000 -->
| Q28735 <!-- Del Carmen, Surigao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166708000 -->
| Q155784 <!-- General Luna, Surigao del Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166710000 -->
| Q155795 <!-- Gigaquit, Surigao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166711000 -->
| Q155808 <!-- Mainit, Surigao del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166714000 -->
| Q155819 <!-- Malimono, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166715000 -->
| Q155830 <!-- Pilar, Surigao del Norte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166716000 -->
| Q155839 <!-- Placer, Surigao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166717000 -->
| Q155849 <!-- San Benito, Surigao del Norte --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166718000 -->
| Q155864 <!-- San Francisco , Surigao del Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166719000 -->
| Q155876 <!-- San Isidro, Surigao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166720000 -->
| Q28958 <!-- Santa Monica , Surigao del Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166721000 -->
| Q155905 <!-- Sison, Surigao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166722000 -->
| Q155917 <!-- Socorro, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166723000 -->
| Q1019949 <!-- Surigao, Surigao del Norte --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166724000 -->
| Q155934 <!-- Tagana-an, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166725000 -->
| Q155946 <!-- Tubod, Surigao del Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166727000 -->
| Q155471 <!-- Barobo, Surigao del Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166801000 -->
| Q155499 <!-- Bayabas, Surigao del Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166802000 -->
| Q866414 <!-- Bislig, Surigao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166803000 -->
| Q155524 <!-- Cagwait, Surigao del Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166804000 -->
| Q155536 <!-- Cantilan, Surigao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166805000 -->
| Q155548 <!-- Carmen, Surigao del Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166806000 -->
| Q155558 <!-- Carrascal, Surigao del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166807000 -->
| Q155568 <!-- Cortes, Surigao del Sur --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166808000 -->
| Q155576 <!-- Hinatuan, Surigao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166809000 -->
| Q155582 <!-- Lanuza, Surigao del Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166810000 -->
| Q155590 <!-- Lianga, Surigao del Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166811000 -->
| Q155598 <!-- Lingig, Surigao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166812000 -->
| Q155605 <!-- Madrid, Surigao del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166813000 -->
| Q155611 <!-- Marihatag, Surigao del Sur --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166814000 -->
| Q155618 <!-- San Agustin, Surigao del Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166815000 -->
| Q155625 <!-- San Miguel, Surigao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166816000 -->
| Q155633 <!-- Tagbina, Surigao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166817000 -->
| Q155648 <!-- Tago, Surigao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166818000 -->
| Q155674 <!-- Tandag, Surigao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166819000 -->
| Q315450 <!-- Compostela, Davao de Oro --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118201000 -->
| Q315468 <!-- Laak, Davao de Oro --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118202000 -->
| Q187225 <!-- Mabini, Davao de Oro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118203000 -->
| Q315497 <!-- Maco, Davao de Oro --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118204000 -->
| Q315512 <!-- Maragusan, Davao de Oro --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118205000 -->
| Q315524 <!-- Mawab, Davao de Oro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118206000 -->
| Q315543 <!-- Monkayo, Davao de Oro --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118207000 -->
| Q315557 <!-- Montevista, Davao de Oro --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118208000 -->
| Q315570 <!-- Nabunturan, Davao de Oro --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118209000 -->
| Q315582 <!-- New Bataan, Davao de Oro --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118210000 -->
| Q315598 <!-- Pantukan, Davao de Oro --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118211000 -->
| Q314393 <!-- Asuncion, Davao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112301000 -->
| Q314410 <!-- Braulio E. Dujali, Davao del Norte --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112323000 -->
| Q314422 <!-- Carmen, Davao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112303000 -->
| Q314438 <!-- Kapalong, Davao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112305000 -->
| Q314452 <!-- New Corella, Davao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112314000 -->
| Q967367 <!-- Panabo, Davao del Norte --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112315000 -->
| Q1020674 <!-- Samal, Davao del Norte --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112317000 -->
| Q314468 <!-- San Isidro, Davao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112324000 -->
| Q314486 <!-- Santo Tomas, Davao del Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112318000 -->
| Q725168 <!-- Tagum, Davao del Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112319000 -->
| Q314501 <!-- Talaingod, Davao del Norte --> = 3 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112322000 -->
| Q314778 <!-- Bansalan, Davao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112401000 -->
| Q1473 <!-- Davao --> = 182 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112402000 -->
| Q1020939 <!-- Digos, Davao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112403000 -->
| Q314808 <!-- Hagonoy, Davao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112404000 -->
| Q314844 <!-- Kiblawan, Davao del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112406000 -->
| Q314864 <!-- Magsaysay, Davao del Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112407000 -->
| Q314885 <!-- Malalag, Davao del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112408000 -->
| Q314923 <!-- Matanao, Davao del Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112410000 -->
| Q314944 <!-- Padada, Davao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112411000 -->
| Q314965 <!-- Santa Cruz, Davao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112412000 -->
| Q315014 <!-- Sulop, Davao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112414000 -->
| Q314796 <!-- Don Marcelino, Davao Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118601000 -->
| Q314824 <!-- Jose Abad Santos, Davao Occidental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118602000 -->
| Q314907 <!-- Malita, Davao Occidental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118603000 -->
| Q314980 <!-- Santa Maria, Davao Occidental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118604000 -->
| Q314999 <!-- Sarangani, Davao Occidental --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118605000 -->
| Q314522 <!-- Baganga, Davao Oriental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112501000 -->
| Q314542 <!-- Banaybanay, Davao Oriental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112502000 -->
| Q314574 <!-- Boston, Davao Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112503000 -->
| Q314593 <!-- Caraga, Davao Oriental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112504000 -->
| Q314619 <!-- Cateel, Davao Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112505000 -->
| Q314632 <!-- Governor Generoso, Davao Oriental --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112506000 -->
| Q314653 <!-- Lupon, Davao Oriental --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112507000 -->
| Q314671 <!-- Manay, Davao Oriental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112508000 -->
| Q314686 <!-- Mati, Davao Oriental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112505000 -->
| Q314721 <!-- San Isidro, Davao Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112510000 -->
| Q314745 <!-- Tarragona, Davao Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112511000 -->
| Q315042 <!-- Alamada, Cotabato --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124701000 -->
| Q315061 <!-- Aleosan, Cotabato --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124717000 -->
| Q315081 <!-- Antipas, Cotabato --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124715000 -->
| Q315098 <!-- Arakan, Cotabato --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124718000 -->
| Q315121 <!-- Banisilan, Cotabato --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124716000 -->
| Q315144 <!-- Carmen, Cotabato --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124702000 -->
| Q315164 <!-- Kabacan, Cotabato --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124703000 -->
| Q583137 <!-- Kidapawan, Cotabato --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124704000 -->
| Q315190 <!-- Libungan, Cotabato --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124705000 -->
| Q267975 <!-- Magpet, Cotabato --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124706000 -->
| Q315244 <!-- Makilala, Cotabato --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124707000 -->
| Q315267 <!-- Matalam, Cotabato --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124708000 -->
| Q315283 <!-- Midsayap, Cotabato --> = 57 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124709000 -->
| Q315213 <!-- M'lang, Cotabato --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124710000 -->
| Q304654 <!-- Pigkawayan, Cotabato --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124711000 -->
| Q315314 <!-- Pikit, Cotabato --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124712000 -->
| Q315334 <!-- President Roxas, Cotabato --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124713000 -->
| Q315345 <!-- Tulunan, Cotabato --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124714000 -->
| Q174393 <!-- Alabel, Sarangani --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128001000 -->
| Q174403 <!-- Glan, Sarangani --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128002000 -->
| Q174417 <!-- Kiamba, Sarangani --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128003000 -->
| Q174429 <!-- Maasim, Sarangani --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128004000 -->
| Q174442 <!-- Maitum, Sarangani --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128005000 -->
| Q174457 <!-- Malapatan, Sarangani --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128006000 -->
| Q174468 <!-- Malungon, Sarangani --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128007000 -->
| Q173870 <!-- Banga, South Cotabato --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126302000 -->
| Q594275 <!-- General Santos --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126303000 -->
| Q542154 <!-- Koronadal, South Cotabato --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126306000 -->
| Q173898 <!-- Lake Sebu, South Cotabato --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126319000 -->
| Q173922 <!-- Norala, South Cotabato --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126311000 -->
| Q173944 <!-- Polomolok, South Cotabato --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126312000 -->
| Q173965 <!-- Santo Niño, South Cotabato --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126318000 -->
| Q173986 <!-- Surallah, South Cotabato --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126313000 -->
| Q174018 <!-- Tampakan, South Cotabato --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126314000 -->
| Q174039 <!-- Tantangan, South Cotabato --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126315000 -->
| Q174003 <!-- T'boli, South Cotabato --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126316000 -->
| Q174055 <!-- Tupi, South Cotabato --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126317000 -->
| Q173393 <!-- Bagumbayan, Sultan Kudarat --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126501000 -->
| Q173404 <!-- Columbio, Sultan Kudarat --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126502000 -->
| Q173414 <!-- Esperanza, Sultan Kudarat --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126503000 -->
| Q173428 <!-- Isulan, Sultan Kudarat --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126504000 -->
| Q173438 <!-- Kalamansig, Sultan Kudarat --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126505000 -->
| Q173449 <!-- Lambayong, Sultan Kudarat --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126508000 -->
| Q173460 <!-- Lebak, Sultan Kudarat --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126506000 -->
| Q173468 <!-- Lutayan, Sultan Kudarat --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126507000 -->
| Q173479 <!-- Palimbang, Sultan Kudarat --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126509000 -->
| Q137813 <!-- President Quirino, Sultan Kudarat --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126510000 -->
| Q173556 <!-- Senator Ninoy Aquino, Sultan Kudarat --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126512000 -->
| Q173575 <!-- Tacurong, Sultan Kudarat --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126511000 -->
| Q42589 <!-- Akbar, Basilan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150708000 -->
| Q41999 <!-- Al-Barka, Basilan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150709000 -->
| Q41998 <!-- Hadji Mohammad Ajul, Basilan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150710000 -->
| Q802075 <!-- Hadji Muhtamad, Basilan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150712000 -->
| Q1710 <!-- Isabela --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/099701000 -->
| Q1714 <!-- Lamitan, Basilan --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150702000 -->
| Q802107 <!-- Lantawan, Basilan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150703000 -->
| Q802142 <!-- Maluso, Basilan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150704000 -->
| Q802171 <!-- Sumisip, Basilan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150705000 -->
| Q802202 <!-- Tabuan-Lasa, Basilan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150713000 -->
| Q667595 <!-- Tipo-Tipo, Basilan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150706000 -->
| Q630096 <!-- Tuburan, Basilan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150707000 -->
| Q204771 <!-- Ungkaya Pukan, Basilan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150711000 -->
| Q273775 <!-- Amai Manabilang, Lanao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153637000 -->
| Q273657 <!-- Bacolod-Kalawi, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153601000 -->
| Q273680 <!-- Balabagan, Lanao del Sur --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153602000 -->
| Q273700 <!-- Balindong, Lanao del Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153603000 -->
| Q273718 <!-- Bayang, Lanao del Sur --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153604000 -->
| Q273728 <!-- Binidayan, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153605000 -->
| Q273744 <!-- Buadiposo-Buntong, Lanao del Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153633000 -->
| Q273757 <!-- Bubong, Lanao del Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153606000 -->
| Q273796 <!-- Butig, Lanao del Sur --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153607000 -->
| Q273813 <!-- Calanogas, Lanao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153632000 -->
| Q273828 <!-- Ditsaan-Ramain, Lanao del Sur --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153624000 -->
| Q273851 <!-- Ganassi, Lanao del Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153609000 -->
| Q273864 <!-- Kapai, Lanao del Sur --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153610000 -->
| Q273882 <!-- Kapatagan, Lanao del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153639000 -->
| Q273895 <!-- Lumba-Bayabao, Lanao del Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153611000 -->
| Q273906 <!-- Lumbaca-Unayan, Lanao del Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153641000 -->
| Q273915 <!-- Lumbatan, Lanao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153612000 -->
| Q273928 <!-- Lumbayanague, Lanao del Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153636000 -->
| Q273939 <!-- Madalum, Lanao del Sur --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153613000 -->
| Q273948 <!-- Madamba, Lanao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153614000 -->
| Q273960 <!-- Maguing, Lanao del Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153634000 -->
| Q273970 <!-- Malabang, Lanao del Sur --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153615000 -->
| Q273982 <!-- Marantao, Lanao del Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153616000 -->
| Q592338 <!-- Marawi, Lanao del Sur --> = 96 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153617000 -->
| Q273988 <!-- Marogong, Lanao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153631000 -->
| Q273998 <!-- Masiu, Lanao del Sur --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153618000 -->
| Q177004 <!-- Mulondo, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153619000 -->
| Q274015 <!-- Pagayawan, Lanao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153620000 -->
| Q274022 <!-- Piagapo, Lanao del Sur --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153621000 -->
| Q274031 <!-- Picong, Lanao del Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153635000 -->
| Q274037 <!-- Poona Bayabao, Lanao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153622000 -->
| Q274047 <!-- Pualas, Lanao del Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153623000 -->
| Q274057 <!-- Saguiaran, Lanao del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153625000 -->
| Q126297 <!-- Sultan Dumalondong, Lanao del Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153640000 -->
| Q274077 <!-- Tagoloan II, Lanao del Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153638000 -->
| Q274087 <!-- Tamparan, Lanao del Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153626000 -->
| Q274097 <!-- Taraka, Lanao del Sur --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153627000 -->
| Q274114 <!-- Tubaran, Lanao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153628000 -->
| Q274124 <!-- Tugaya, Lanao del Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153629000 -->
| Q274134 <!-- Wao, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153630000 -->
| Q212222 <!-- Ampatuan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153801000 -->
| Q212240 <!-- Barira, Maguindanao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153818000 -->
| Q212255 <!-- Buldon, Maguindanao --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153802000 -->
| Q212280 <!-- Buluan, Maguindanao --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153803000 -->
| Q726993 <!-- Cotabato --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/129804000 -->
| Q212310 <!-- Datu Abdullah Sangki, Maguindanao --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153828000 -->
| Q212336 <!-- Datu Anggal Midtimbang, Maguindanao --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153831000 -->
| Q212366 <!-- Datu Blah T. Sinsuat, Maguindanao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153830000 -->
| Q212389 <!-- Datu Hoffer Ampatuan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153835000 -->
| Q212411 <!-- Datu Montawal, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153822000 -->
| Q212432 <!-- Datu Odin Sinsuat, Maguindanao --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153807000 -->
| Q212463 <!-- Datu Paglas, Maguindanao --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153805000 -->
| Q212488 <!-- Datu Piang, Maguindanao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153806000 -->
| Q212503 <!-- Datu Salibo, Maguindanao --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153836000 -->
| Q212519 <!-- Datu Saudi-Ampatuan, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153826000 -->
| Q212537 <!-- Datu Unsay, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153827000 -->
| Q212557 <!-- General Salipada K. Pendatun, Maguindanao --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153819000 -->
| Q212581 <!-- Guindulungan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153825000 -->
| Q212603 <!-- Kabuntalan, Maguindanao --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153814000 -->
| Q212623 <!-- Mamasapano, Maguindanao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153820000 -->
| Q212644 <!-- Mangudadatu, Maguindanao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153820000 -->
| Q212662 <!-- Matanog, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153809000 -->
| Q212684 <!-- Northern Kabuntalan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153834000 -->
| Q212707 <!-- Pagalungan, Maguindanao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153810000 -->
| Q122827 <!-- Paglat, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153823000 -->
| Q212735 <!-- Pandag, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153833000 -->
| Q212748 <!-- Parang, Maguindanao --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153811000 -->
| Q212759 <!-- Rajah Buayan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153829000 -->
| Q212766 <!-- Shariff Aguak, Maguindanao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153808000 -->
| Q212778 <!-- Shariff Saydona Mustapha, Maguindanao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153837000 -->
| Q212784 <!-- South Upi, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153817000 -->
| Q212791 <!-- Sultan Kudarat, Maguindanao --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153812000 -->
| Q212802 <!-- Sultan Mastura, Maguindanao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153824000 -->
| Q212808 <!-- Sultan sa Barongis, Maguindanao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153813000 -->
| Q212830 <!-- Sultan Sumagka, Maguindanao --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153821000 -->
| Q212823 <!-- Talayan, Maguindanao --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153816000 -->
| Q212843 <!-- Upi, Maguindanao --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153815000 -->
| Q155970 <!-- Banguingui, Sulu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156615000 -->
| Q155983 <!-- Hadji Panglima Tahil, Sulu --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156606000 -->
| Q156008 <!-- Indanan, Sulu --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156601000 -->
| Q156024 <!-- Jolo, Sulu --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156602000 -->
| Q156042 <!-- Kalingalan Caluang, Sulu --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156603000 -->
| Q156055 <!-- Lugus, Sulu --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156617000 -->
| Q156071 <!-- Luuk, Sulu --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156604000 -->
| Q156090 <!-- Maimbung, Sulu --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156605000 -->
| Q156107 <!-- Old Panamao, Sulu --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156607000 -->
| Q156126 <!-- Omar, Sulu --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156619000 -->
| Q156159 <!-- Pandami, Sulu --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156618000 -->
| Q156180 <!-- Panglima Estino, Sulu --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156616000 -->
| Q156195 <!-- Pangutaran, Sulu --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156608000 -->
| Q156208 <!-- Parang, Sulu --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156609000 -->
| Q156225 <!-- Pata, Sulu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156610000 -->
| Q156244 <!-- Patikul, Sulu --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156611000 -->
| Q156263 <!-- Siasi, Sulu --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156612000 -->
| Q156285 <!-- Talipao, Sulu --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156613000 -->
| Q156302 <!-- Tapul, Sulu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156614000 -->
| Q155195 <!-- Bongao, Tawi-Tawi --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157002000 -->
| Q155221 <!-- Languyan, Tawi-Tawi --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157009000 -->
| Q155241 <!-- Mapun, Tawi-Tawi --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157003000 -->
| Q155259 <!-- Panglima Sugala, Tawi-Tawi --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157001000 -->
| Q155274 <!-- Sapa-Sapa, Tawi-Tawi --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157010000 -->
| Q155288 <!-- Sibutu, Tawi-Tawi --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157011000 -->
| Q155318 <!-- Simunul, Tawi-Tawi --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157004000 -->
| Q155334 <!-- Sitangkai, Tawi-Tawi --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157005000 -->
| Q155355 <!-- South Ubian, Tawi-Tawi --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157006000 -->
| Q155377 <!-- Tandubas, Tawi-Tawi --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157007000 -->
| Q155396 <!-- Turtle Islands, Tawi-Tawi --> = 2 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157008000 -->
{{{1|}}} {{main other|[[Category:Philippine articles requiring maintenance]]}}
}}
<noinclude>{{pp-template}}[[Category:Filipinas]]</noinclude>
a1gx6e0vq4rl31gqrw3ckgahtalgt5b
37019635
37019634
2026-05-01T16:03:39Z
Exec8
10305
37019635
wikitext
text/x-wiki
<!-- This template is used as a switch to display count of barangays in a local administrative unit in the Philippines -->{{#switch: {{{1|}}}
| Q928 <!-- Philippines --> = 42020 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc -->
| Q2673519 <!-- Luzon, Philippines --> = 20492 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/luzon -->
| Q211436 <!-- Visayas, Philippines --> = 11444 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/visayas -->
| Q37274898 <!-- Mindanao, Philippines --> = 10084 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/mindanao -->
| Q13580 <!-- Metro Manila, National Capital Region --> = 1710 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/130000000 -->
| Q12933 <!-- Ilocos Region, Luzon --> = 3267 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/010000000 -->
| Q13615 <!-- Cagayan Valley, Luzon --> = 2311 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/020000000 -->
| Q13606 <!-- Cordillera Administrative Region, Luzon --> = 1178 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/140000000 -->
| Q13617 <!-- Central Luzon, Luzon --> = 3102 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/030000000 -->
| Q13650 <!-- Calabarzon, Luzon --> = 3993 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/040000000 -->
| Q13662 <!-- Bicol Region, Luzon --> = 3471 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/050000000 -->
| Q13658 <!-- Mimaropa, Luzon --> = 1460 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/170000000 -->
| Q13665 <!-- Western Visayas, Visayas --> = 4051 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/060000000 -->
| Q13669 <!-- Central Visayas, Visayas --> = 3003 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/070000000 -->
| Q13675 <!-- Eastern Visayas, Visayas --> = 4390 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/080000000 -->
| Q13682 <!-- Zamboanga Peninsula, Mindanao --> = 1904 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/090000000 -->
| Q13690 <!-- Northern Mindanao, Mindanao --> = 2022 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/100000000 -->
| Q13704 <!-- Caraga, Mindanao --> = 1311 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/160000000 -->
| Q13694 <!-- Davao Region, Mindanao --> = 1162 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/110000000 -->
| Q13701 <!-- Soccsksargen, Mindanao --> = 1195 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/120000000 -->
| Q24869612 <!-- Bangasmoro, Mindanao --> = 2490 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/150000000 -->
| Q13813 <!-- Ilocos Norte, Ilocos Region --> = 559 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/012800000 -->
| Q12741 <!-- Ilocos Sur, Ilocos Region --> = 768 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/012900000 -->
| Q13829 <!-- La Union, Ilocos Region --> = 576 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/013300000 -->
| Q13871 <!-- Pangasinan, Ilocos Region --> = 1364 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/015500000 -->
| Q13740 <!-- Batanes, Cagayan Valley --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/020900000 -->
| Q13759 <!-- Cagayan, Cagayan Valley --> = 820 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/021500000 -->
| Q13826 <!-- Isabela, Cagayan Valley --> = 1055 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/023100000 -->
| Q13866 <!-- Nueva Vizcaya, Cagayan Valley --> = 275 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/025000000 -->
| Q13873 <!-- Quirino, Cagayan Valley --> = 132 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/025700000 -->
| Q13711 <!-- Abra, Cordillera Administrative Region --> = 303 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/140100000 -->
| Q13728 <!-- Apayao, Cordillera Administrative Region --> = 133 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/148100000 -->
| Q13750 <!-- Benguet, Cordillera Administrative Region --> = 269 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/141100000 -->
| Q13812 <!-- Ifugao, Cordillera Administrative Region --> = 176 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/142700000 -->
| Q13827 <!-- Kalinga, Cordillera Administrative Region --> = 153 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/143200000 -->
| Q13861 <!-- Mountain Province, Cordillera Administrative Region --> = 133 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/144400000 -->
| Q13730 <!-- Aurora, Central Luzon --> = 151 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/037700000 -->
| Q13739 <!-- Bataan, Central Luzon --> = 237 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/030800000 -->
| Q13755 <!-- Bulacan, Central Luzon --> = 569 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/031400000 -->
| Q13865 <!-- Nueva Ecija, Central Luzon --> = 849 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/034900000 -->
| Q13870 <!-- Pampanga, Central Luzon --> = 538 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/035400000 -->
| Q13892 <!-- Tarlac, Central Luzon --> = 511 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/036900000 -->
| Q13895 <!-- Zambales, Central Luzon --> = 247 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/037100000 -->
| Q13744 <!-- Batangas, Calabarzon --> = 1078 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/041000000 -->
| Q13785 <!-- Cavite, Calabarzon --> = 803 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/042100000 -->
| Q13840 <!-- Laguna, Calabarzon --> = 681 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/043400000 -->
| Q13872 <!-- Quezon, Calabarzon --> = 1242 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/045600000 -->
| Q13874 <!-- Rizal, Calabarzon --> = 189 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/045800000 -->
| Q13726 <!-- Albay, Bicol Region --> = 720 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/050500000 -->
| Q13763 <!-- Camarines Norte, Bicol Region --> = 282 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/051600000 -->
| Q13767 <!-- Camarines Sur, Bicol Region --> = 1063 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/051700000 -->
| Q13778 <!-- Catanduanes, Bicol Region --> = 315 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/052000000 -->
| Q13847 <!-- Masbate, Bicol Region --> = 550 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/054100000 -->
| Q13881 <!-- Sorsogon, Bicol Region --> = 541 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/056200000 -->
| Q13846 <!-- Marinduque, Mimaropa --> = 218 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/174000000 -->
| Q13867 <!-- Occidental Mindoro, Mimaropa --> = 164 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/175100000 -->
| Q13868 <!-- Oriental Mindoro, Mimaropa --> = 426 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/175200000 -->
| Q13869 <!-- Palawan, Mimaropa --> = 433 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/175300000 -->
| Q13875 <!-- Romblon, Mimaropa --> = 219 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/060400000 -->
| Q13723 <!-- Aklan, Western Visayas --> = 327 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/060400000 -->
| Q13727 <!-- Antique, Western Visayas --> = 590 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/060600000 -->
| Q13772 <!-- Capiz, Western Visayas --> = 473 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/061900000 -->
| Q13810 <!-- Guimaras, Western Visayas --> = 98 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/067900000 -->
| Q13825 <!-- Iloilo, Western Visayas --> = 1901 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/063000000 -->
| Q13862 <!-- Negros Occidental, Western Visayas --> = 662 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/064500000 -->
| Q13752 <!-- Bohol, Central Visayas --> = 1109 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/071200000 -->
| Q13786 <!-- Cebu, Central Visayas --> = 1203 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/072200000 -->
| Q13863 <!-- Negros Oriental, Central Visayas --> = 557 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/074600000 -->
| Q13879 <!-- Siquijor, Central Visayas --> = 134 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/076100000 -->
| Q13751 <!-- Biliran, Eastern Visayas --> = 132 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/087800000 -->
| Q13809 <!-- Eastern Samar, Eastern Visayas --> = 597 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/082600000 -->
| Q13844 <!-- Leyte, Eastern Visayas --> = 1641 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/083700000 -->
| Q13864 <!-- Northern Samar, Eastern Visayas --> = 569 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/084800000 -->
| Q13876 <!-- Samar, Eastern Visayas --> = 951 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/086000000 -->
| Q13884 <!-- Southern Leyte, Eastern Visayas --> = 500 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/086400000 -->
| Q13899 <!-- Zamboanga del Norte, Zamboanga Peninsula --> = 691 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/097200000 -->
| Q13900 <!-- Zamboanga del Sur, Zamboanga Peninsula --> = 779 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/097300000 -->
| Q13902 <!-- Zamboanga Sibugay, Zamboanga Peninsula --> = 389 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/098300000 -->
| Q13753 <!-- Bukidnon, Northern Mindanao --> = 464 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/101300000 -->
| Q13769 <!-- Camiguin, Northern Mindanao --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/101800000 -->
| Q13841 <!-- Lanao del Norte, Northern Mindanao --> = 506 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/103500000 -->
| Q13857 <!-- Misamis Occidental, Northern Mindanao --> = 490 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/104200000 -->
| Q13860 <!-- Misamis Oriental, Northern Mindanao --> = 504 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/104300000 -->
| Q13714 <!-- Agusan del Norte, Caraga --> = 253 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/160200000 -->
| Q13721 <!-- Agusan del Sur, Caraga --> = 314 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/160300000 -->
| Q13807 <!-- Dinagat Islands, Caraga --> = 100 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/168500000 -->
| Q13889 <!-- Surigao del Norte, Caraga --> = 335 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/166700000 -->
| Q13891 <!-- Surigao del Sur, Caraga --> = 309 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/166800000 -->
| Q13789 <!-- Davao de Oro, Davao Region --> = 237 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/118200000 -->
| Q13792 <!-- Davao del Norte, Davao Region --> = 223 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/112300000 -->
| Q13794 <!-- Davao del Sur, Davao Region --> = 414 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/112400000 -->
| Q3656379 <!-- Davao Occidental, Davao Region --> = 105 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/118600000 -->
| Q13806 <!-- Davao Oriental, Davao Region --> = 183 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/112500000 -->
| Q13791 <!-- Cotabato, Soccsksargen --> = 543 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/124700000 -->
| Q13877 <!-- Sarangani, Soccsksargen --> = 141 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/128000000 -->
| Q13882 <!-- South Cotabato, Soccsksargen --> = 225 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/126300000 -->
| Q13885 <!-- Sultan Kudarat, Soccsksargen --> = 249 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/126500000 -->
| Q13737 <!-- Basilan, Bangasmoro --> = 210 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/150700000 -->
| Q13843 <!-- Lanao del Sur, Bangasmoro --> = 1159 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/153600000 -->
| Q13845 <!-- Maguindanao, Bangasmoro --> = 508 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/153800000 -->
| Q13887 <!-- Sulu, Bangasmoro --> = 410 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/156600000 -->
| Q13893 <!-- Tawi-Tawi, Bangasmoro --> = 203 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/157000000 -->
| Q1478 <!-- Caloocan --> = 188 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137501000 -->
| Q8854 <!-- Las Piñas --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137601000 -->
| Q1508 <!-- Makati --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137602000 -->
| Q8861 <!-- Malabon --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137502000 -->
| Q9085 <!-- Mandaluyong --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137401000 -->
| Q1461 <!-- Manila --> = 897 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/submuni/133900000 -->
| Q17175 <!-- Marikina --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137402000 -->
| Q17176 <!-- Muntinlupa --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137603000 -->
| Q17179 <!-- Navotas --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137503000 -->
| Q17182 <!-- Parañaque --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137604000 -->
| Q17189 <!-- Pasay --> = 201 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137605000 -->
| Q1624 <!-- Pasig --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137403000 -->
| Q1017325 <!-- Pateros, Metro Manila --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137606000 -->
| Q1475 <!-- Quezon City --> = 142 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137404000 -->
| Q749283 <!-- San Juan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137405000 -->
| Q1643 <!-- Taguig --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137607000 -->
| Q1623 <!-- Valenzuela --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137504000 -->
| Q39241 <!-- Adams, Ilocos Norte --> = 1 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012801000 -->
| Q39271 <!-- Bacarra, Ilocos Norte --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012802000 -->
| Q39303 <!-- Badoc, Ilocos Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012803000 -->
| Q39326 <!-- Bangui, Ilocos Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012804000 -->
| Q39346 <!-- Banna, Ilocos Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012811000 -->
| Q39711 <!-- Batac, Ilocos Norte --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012805000 -->
| Q39368 <!-- Burgos, Ilocos Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012806000 -->
| Q39393 <!-- Carasi, Ilocos Norte --> = 3 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012807000 -->
| Q39416 <!-- Currimao, Ilocos Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012808000 -->
| Q39429 <!-- Dingras, Ilocos Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012809000 -->
| Q39511 <!-- Dumalneg, Ilocos Norte --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012810000 -->
| Q39738 <!-- Laoag, Ilocos Norte --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012812000 -->
| Q39523 <!-- Marcos, Ilocos Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012813000 -->
| Q39540 <!-- Nueva Era, Ilocos Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012814000 -->
| Q39559 <!-- Pagudpud, Ilocos Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012815000 -->
| Q39573 <!-- Paoay, Ilocos Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012816000 -->
| Q39591 <!-- Pasuquin, Ilocos Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012817000 -->
| Q39616 <!-- Piddig, Ilocos Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012818000 -->
| Q39629 <!-- Pinili, Ilocos Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012819000 -->
| Q39653 <!-- San Nicolas, Ilocos Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012820000 -->
| Q39673 <!-- Sarrat, Ilocos Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012821000 -->
| Q39677 <!-- Solsona, Ilocos Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012822000 -->
| Q39694 <!-- Vintar, Ilocos Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012823000 -->
| Q12813 <!-- Alilem, Ilocos Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012901000 -->
| Q12818 <!-- Banayoyo, Ilocos Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012902000 -->
| Q12825 <!-- Bantay, Ilocos Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012903000 -->
| Q12828 <!-- Burgos, Ilocos Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012904000 -->
| Q12832 <!-- Cabugao, Ilocos Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012905000 -->
| Q205956 <!-- Candon, Ilocos Sur --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012906000 -->
| Q12834 <!-- Caoayan, Ilocos Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012907000 -->
| Q12835 <!-- Cervantes, Ilocos Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012908000 -->
| Q12838 <!-- Galimuyod, Ilocos Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012909000 -->
| Q12840 <!-- Gregorio del Pilar, Ilocos Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012910000 -->
| Q12843 <!-- Lidlidda, Ilocos Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012911000 -->
| Q12845 <!-- Magsingal, Ilocos Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012912000 -->
| Q12848 <!-- Nagbukel, Ilocos Sur --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012913000 -->
| Q12850 <!-- Narvacan, Ilocos Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012914000 -->
| Q12853 <!-- Quirino, Ilocos Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012915000 -->
| Q12856 <!-- Salcedo, Ilocos Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012916000 -->
| Q12859 <!-- San Emilio, Ilocos Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012917000 -->
| Q12863 <!-- San Esteban, Ilocos Sur --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012918000 -->
| Q12864 <!-- San Ildefonso, Ilocos Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012919000 -->
| Q12867 <!-- San Juan, Ilocos Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012920000 -->
| Q12868 <!-- San Vicente, Ilocos Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012921000 -->
| Q12873 <!-- Santa, Ilocos Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012922000 -->
| Q12875 <!-- Santa Catalina, Ilocos Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012923000 -->
| Q12880 <!-- Santa Cruz, Ilocos Sur --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012924000 -->
| Q12882 <!-- Santa Lucia, Ilocos Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012925000 -->
| Q12692 <!-- Santa Maria, Ilocos Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012926000 -->
| Q12884 <!-- Santiago, Ilocos Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012927000 -->
| Q12885 <!-- Santo Domingo, Ilocos Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012928000 -->
| Q12888 <!-- Sigay, Ilocos Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012929000 -->
| Q12891 <!-- Sinait, Ilocos Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012930000 -->
| Q12893 <!-- Sugpon, Ilocos Sur --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012931000 -->
| Q12894 <!-- Suyo, Ilocos Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012932000 -->
| Q12895 <!-- Tagudin, Ilocos Sur --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012933000 -->
| Q235004 <!-- Vigan, Ilocos Sur --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012934000 -->
| Q40168 <!-- Agoo, La Union --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013301000 -->
| Q40239 <!-- Aringay, La Union --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013302000 -->
| Q40259 <!-- Bacnotan, La Union --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013303000 -->
| Q40275 <!-- Bagulin, La Union --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013304000 -->
| Q40282 <!-- Balaoan, La Union --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013305000 -->
| Q40298 <!-- Bangar, La Union --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013306000 -->
| Q40313 <!-- Bauang, La Union --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013307000 -->
| Q40372 <!-- Burgos, La Union --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013308000 -->
| Q40393 <!-- Caba, La Union --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013309000 -->
| Q40419 <!-- Luna, La Union --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013310000 -->
| Q40450 <!-- Naguilian, La Union --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013311000 -->
| Q40466 <!-- Pugo, La Union --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013312000 -->
| Q40486 <!-- Rosario, La Union --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013313000 -->
| Q40584 <!-- San Fernando, La Union --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013314000 -->
| Q40500 <!-- San Gabriel, La Union --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013315000 -->
| Q40517 <!-- San Juan, La Union --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013316000 -->
| Q40521 <!-- Santo Tomas, La Union --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013317000 -->
| Q40536 <!-- Santol, La Union --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013318000 -->
| Q40557 <!-- Sudipen, La Union --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013319000 -->
| Q40562 <!-- Tubao, La Union --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013320000 -->
| Q41668 <!-- Agno, Pangasinan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015501000 -->
| Q41686 <!-- Aguilar, Pangasinan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015502000 -->
| Q43162 <!-- Alaminos, Pangasinan --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015503000 -->
| Q41704 <!-- Alcala, Pangasinan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015502000 -->
| Q41713 <!-- Anda, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015504000 -->
| Q41721 <!-- Asingan, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015505000 -->
| Q41725 <!-- Balungao, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015506000 -->
| Q41732 <!-- Bani, Pangasinan --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015508000 -->
| Q41737 <!-- Basista, Pangasinan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015509000 -->
| Q41757 <!-- Bautista, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015510000 -->
| Q41762 <!-- Bayambang, Pangasinan --> = 77 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015511000 -->
| Q41771 <!-- Binalonan, Pangasinan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015512000 -->
| Q41779 <!-- Binmaley, Pangasinan --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015513000 -->
| Q41807 <!-- Bolinao, Pangasinan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015514000 -->
| Q41826 <!-- Bugallon, Pangasinan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015515000 -->
| Q41850 <!-- Burgos, Pangasinan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015516000 -->
| Q41855 <!-- Calasiao, Pangasinan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015517000 -->
| Q875070 <!-- Dagupan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015518000 -->
| Q41917 <!-- Dasol, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015519000 -->
| Q41922 <!-- Infanta, Pangasinan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015520000 -->
| Q41942 <!-- Labrador, Pangasinan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015521000 -->
| Q41965 <!-- Laoac, Pangasinan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015548000 -->
| Q41978 <!-- Lingayen, Pangasinan --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015522000 -->
| Q41982 <!-- Mabini, Pangasinan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015523000 -->
| Q41985 <!-- Malasiqui, Pangasinan --> = 73 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015524000 -->
| Q1020685 <!-- Manaoag, Pangasinan --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015525000 -->
| Q41996 <!-- Mangaldan, Pangasinan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015526000 -->
| Q42001 <!-- Mangatarem, Pangasinan --> = 82 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015527000 -->
| Q42006 <!-- Mapandan, Pangasinan --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015528000 -->
| Q42011 <!-- Natividad, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015529000 -->
| Q42017 <!-- Pozorrubio, Pangasinan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015530000 -->
| Q42024 <!-- Rosales, Pangasinan --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015531000 -->
| Q43165 <!-- San Carlos, Pangasinan --> = 86 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015532000 -->
| Q42031 <!-- San Fabian, Pangasinan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015533000 -->
| Q42036 <!-- San Jacinto, Pangasinan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015534000 -->
| Q42039 <!-- San Manuel, Pangasinan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015535000 -->
| Q42043 <!-- San Nicolas, Pangasinan --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015536000 -->
| Q42044 <!-- San Quintin, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015537000 -->
| Q122401 <!-- Santa Barbara, Pangasinan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015538000 -->
| Q42055 <!-- Santa Maria, Pangasinan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015539000 -->
| Q43140 <!-- Santo Tomas, Pangasinan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015540000 -->
| Q43143 <!-- Sison, Pangasinan --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015541000 -->
| Q43145 <!-- Sual, Pangasinan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015542000 -->
| Q43148 <!-- Tayug, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015543000 -->
| Q43152 <!-- Umingan, Pangasinan --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015544000 -->
| Q43154 <!-- Urbiztondo, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015545000 -->
| Q43168 <!-- Urdaneta, Pangasinan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015546000 -->
| Q43157 <!-- Villasis, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015547000 -->
| Q43180 <!-- Basco, Batanes --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020901000 -->
| Q43451 <!-- Itbayat, Batanes --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020902000 -->
| Q43454 <!-- Ivana, Batanes --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020903000 -->
| Q43458 <!-- Mahatao, Batanes --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020904000 -->
| Q43460 <!-- Sabtang, Batanes --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020905000 -->
| Q43469 <!-- Uyugan, Batanes --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020906000 -->
| Q43500 <!-- Abulug, Cagayan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021501000 -->
| Q43503 <!-- Alcala, Cagayan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021502000 -->
| Q43508 <!-- Allacapan, Cagayan --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021503000 -->
| Q43515 <!-- Amulung, Cagayan --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021504000 -->
| Q43517 <!-- Aparri, Cagayan --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021505000 -->
| Q43520 <!-- Baggao, Cagayan --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021506000 -->
| Q49058 <!-- Ballesteros, Cagayan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021507000 -->
| Q49059 <!-- Buguey, Cagayan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021508000 -->
| Q49062 <!-- Calayan, Cagayan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021509000 -->
| Q49313 <!-- Camalaniugan, Cagayan --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021510000 -->
| Q49314 <!-- Claveria, Cagayan --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021511000 -->
| Q49315 <!-- Enrile, Cagayan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021512000 -->
| Q49316 <!-- Gattaran, Cagayan --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021513000 -->
| Q49317 <!-- Gonzaga, Cagayan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021514000 -->
| Q49318 <!-- Iguig, Cagayan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021515000 -->
| Q49320 <!-- Lal-lo, Cagayan --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021516000 -->
| Q49321 <!-- Lasam, Cagayan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021517000 -->
| Q49324 <!-- Pamplona, Cagayan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021518000 -->
| Q49327 <!-- Peñablanca, Cagayan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021519000 -->
| Q49331 <!-- Piat, Cagayan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021520000 -->
| Q49333 <!-- Rizal, Cagayan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021521000 -->
| Q49336 <!-- Sanchez-Mira, Cagayan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021522000 -->
| Q49337 <!-- Santa Ana, Cagayan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021523000 -->
| Q49339 <!-- Santa Praxedes, Cagayan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021524000 -->
| Q49342 <!-- Santa Teresita, Cagayan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021525000 -->
| Q49346 <!-- Santo Niño, Cagayan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021526000 -->
| Q49348 <!-- Solana, Cagayan --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021527000 -->
| Q49350 <!-- Tuao, Cagayan --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021528000 -->
| Q2200 <!-- Tuguegarao, Cagayan --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021529000 -->
| Q49354 <!-- Alicia, Isabela --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023101000 -->
| Q49357 <!-- Angadanan, Isabela --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023102000 -->
| Q49358 <!-- Aurora, Isabela --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023103000 -->
| Q49359 <!-- Benito Soliven, Isabela --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023104000 -->
| Q49360 <!-- Burgos, Isabela --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023105000 -->
| Q49361 <!-- Cabagan, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023106000 -->
| Q49362 <!-- Cabatuan, Isabela --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023107000 -->
| Q50178 <!-- Cauayan, Isabela --> = 65 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023108000 -->
| Q49363 <!-- Cordon, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023109000 -->
| Q49365 <!-- Delfin Albano, Isabela --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023118000 -->
| Q49366 <!-- Dinapigue, Isabela --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023110000 -->
| Q49368 <!-- Divilacan, Isabela --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023111000 -->
| Q49369 <!-- Echague, Isabela --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023112000 -->
| Q49370 <!-- Gamu, Isabela --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023113000 -->
| Q50179 <!-- Ilagan, Isabela --> = 91 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023114000 -->
| Q49372 <!-- Jones, Isabela --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023115000 -->
| Q49375 <!-- Luna, Isabela --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023116000 -->
| Q49434 <!-- Maconacon, Isabela --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023117000 -->
| Q49435 <!-- Mallig, Isabela --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023119000 -->
| Q50066 <!-- Naguilian, Isabela --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023120000 -->
| Q50102 <!-- Palanan, Isabela --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023121000 -->
| Q50145 <!-- Quezon, Isabela --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023122000 -->
| Q50149 <!-- Quirino, Isabela --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023123000 -->
| Q50152 <!-- Ramon, Isabela --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023124000 -->
| Q50153 <!-- Reina Mercedes, Isabela --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023125000 -->
| Q50154 <!-- Roxas, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023126000 -->
| Q50158 <!-- San Agustin, Isabela --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023127000 -->
| Q50160 <!-- San Guillermo, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023128000 -->
| Q50163 <!-- San Isidro, Isabela --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023129000 -->
| Q50164 <!-- San Manuel, Isabela --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023130000 -->
| Q50167 <!-- San Mariano, Isabela --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023131000 -->
| Q50171 <!-- San Mateo, Isabela --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023132000 -->
| Q50174 <!-- San Pablo, Isabela --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023133000 -->
| Q50175 <!-- Santa Maria, Isabela --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023134000 -->
| Q50180 <!-- Santiago --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023135000 -->
| Q50176 <!-- Santo Tomas, Isabela --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023136000 -->
| Q50177 <!-- Tumauini, Isabela --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023137000 -->
| Q51474 <!-- Alfonso Castaneda, Nueva Vizcaya --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025015000 -->
| Q51475 <!-- Ambaguio, Nueva Vizcaya --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025001000 -->
| Q51477 <!-- Aritao, Nueva Vizcaya --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025002000 -->
| Q51478 <!-- Bagabag, Nueva Vizcaya --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025003000 -->
| Q51479 <!-- Bambang, Nueva Vizcaya --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025004000 -->
| Q51480 <!-- Bayombong , Nueva Vizcaya --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025005000 -->
| Q51481 <!-- Diadi, Nueva Vizcaya --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025006000 -->
| Q51483 <!-- Dupax del Norte, Nueva Vizcaya --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025007000 -->
| Q51484 <!-- Dupax del Sur, Nueva Vizcaya --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025008000 -->
| Q51485 <!-- Kasibu, Nueva Vizcaya --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025009000 -->
| Q51486 <!-- Kayapa, Nueva Vizcaya --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025010000 -->
| Q51487 <!-- Quezon, Nueva Vizcaya --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025011000 -->
| Q51493 <!-- Santa Fe, Nueva Vizcaya --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025012000 -->
| Q51494 <!-- Solano, Nueva Vizcaya --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025013000 -->
| Q51496 <!-- Villaverde, Nueva Vizcaya --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025014000 -->
| Q53069 <!-- Aglipay, Quirino --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025701000 -->
| Q53070 <!-- Cabarroguis, Quirino --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025702000 -->
| Q53071 <!-- Diffun, Quirino --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025703000 -->
| Q53072 <!-- Maddela, Quirino --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025704000 -->
| Q53073 <!-- Nagtipunan, Quirino --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025706000 -->
| Q53074 <!-- Saguday, Quirino --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025705000 -->
| Q27995 <!-- Bangued , Abra --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140101000 -->
| Q28002 <!-- Boliney, Abra --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140102000 -->
| Q28014 <!-- Bucay, Abra --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140103000 -->
| Q28030 <!-- Bucloc, Abra --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140104000 -->
| Q28044 <!-- Daguioman, Abra --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140105000 -->
| Q28068 <!-- Danglas, Abra --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140106000 -->
| Q28096 <!-- Dolores, Abra --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140107000 -->
| Q28124 <!-- La Paz, Abra --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140108000 -->
| Q29007 <!-- Lacub, Abra --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140109000 -->
| Q29020 <!-- Lagangilang, Abra --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140110000 -->
| Q29029 <!-- Lagayan, Abra --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140111000 -->
| Q29038 <!-- Langiden, Abra --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140112000 -->
| Q29045 <!-- Licuan-Baay, Abra --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140113000 -->
| Q29048 <!-- Luba, Abra --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140114000 -->
| Q29069 <!-- Malibcong, Abra --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140115000 -->
| Q29082 <!-- Manabo, Abra --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140116000 -->
| Q29094 <!-- Peñarrubia, Abra --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140117000 -->
| Q29102 <!-- Pidigan, Abra --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140118000 -->
| Q29109 <!-- Pilar, Abra --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140119000 -->
| Q29116 <!-- Sallapadan, Abra --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140120000 -->
| Q801530 <!-- San Isidro, Abra --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140121000 -->
| Q29123 <!-- San Juan, Abra --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140122000 -->
| Q29133 <!-- San Quintin, Abra --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140123000 -->
| Q29139 <!-- Tayum, Abra --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140124000 -->
| Q29146 <!-- Tineg, Abra --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140125000 -->
| Q29153 <!-- Tubo, Abra --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140126000 -->
| Q29191 <!-- Villaviciosa, Abra --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140127000 -->
| Q29018 <!-- Calanasan, Apayao --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148101000 -->
| Q30033 <!-- Conner, Apayao --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148102000 -->
| Q30042 <!-- Flora, Apayao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148103000 -->
| Q30053 <!-- Kabugao, Apayao --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148104000 -->
| Q801777 <!-- Luna, Apayao --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148105000 -->
| Q30062 <!-- Pudtol, Apayao --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148106000 -->
| Q30073 <!-- Santa Marcela, Apayao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148107000 -->
| Q30104 <!-- Atok, Benguet --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141101000 -->
| Q1822 <!-- Baguio --> = 129 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141102000 -->
| Q30325 <!-- Bakun, Benguet --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141103000 -->
| Q30328 <!-- Bokod, Benguet --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141104000 -->
| Q30332 <!-- Buguias, Benguet --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141105000 -->
| Q30335 <!-- Itogon, Benguet --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141106000 -->
| Q30338 <!-- Kabayan, Benguet --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141107000 -->
| Q30345 <!-- Kapangan, Benguet --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141108000 -->
| Q30349 <!-- Kibungan, Benguet --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141109000 -->
| Q30351 <!-- La Trinidad , Benguet --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141110000 -->
| Q30356 <!-- Mankayan, Benguet --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141111000 -->
| Q30358 <!-- Sablan, Benguet --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141112000 -->
| Q30361 <!-- Tuba, Benguet --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141113000 -->
| Q30363 <!-- Tublay, Benguet --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141114000 -->
| Q30365 <!-- Aguinaldo, Ifugao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142708000 -->
| Q30391 <!-- Alfonso Lista, Ifugao --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142707000 -->
| Q30394 <!-- Asipulo, Ifugao --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142711000 -->
| Q806138 <!-- Banaue, Ifugao --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142701000 -->
| Q30410 <!-- Hingyon, Ifugao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142709000 -->
| Q30413 <!-- Hungduan, Ifugao --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142702000 -->
| Q30416 <!-- Kiangan, Ifugao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142703000 -->
| Q30419 <!-- Lagawe, Ifugao --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142704000 -->
| Q30421 <!-- Lamut, Ifugao --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142705000 -->
| Q30425 <!-- Mayoyao, Ifugao --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142706000 -->
| Q30428 <!-- Tinoc, Ifugao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142710000 -->
| Q35848 <!-- Balbalan, Kalinga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143201000 -->
| Q35858 <!-- Lubuagan, Kalinga --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143206000 -->
| Q35866 <!-- Pasil, Kalinga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143208000 -->
| Q35873 <!-- Pinukpuk, Kalinga --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143209000 -->
| Q35884 <!-- Rizal, Kalinga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143211000 -->
| Q35925 <!-- Tabuk, Kalinga --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143213000 -->
| Q35897 <!-- Tanudan, Kalinga --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143214000 -->
| Q35909 <!-- Tinglayan, Kalinga --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143215000 -->
| Q35975 <!-- Barlig, Mountain Province --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144401000 -->
| Q35994 <!-- Bauko, Mountain Province --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144402000 -->
| Q36012 <!-- Besao, Mountain Province --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144403000 -->
| Q36025 <!-- Bontoc, Mountain Province --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144404000 -->
| Q36040 <!-- Natonin, Mountain Province --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144405000 -->
| Q36049 <!-- Paracelis, Mountain Province --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144406000 -->
| Q36061 <!-- Sabangan, Mountain Province --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144407000 -->
| Q36076 <!-- Sadanga, Mountain Province --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144408000 -->
| Q36090 <!-- Sagada, Mountain Province --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144409000 -->
| Q36099 <!-- Tadian, Mountain Province --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144410000 -->
| Q53081 <!-- Baler, Aurora --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037701000 -->
| Q53083 <!-- Casiguran, Aurora --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037702000 -->
| Q53084 <!-- Dilasag, Aurora --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037703000 -->
| Q53086 <!-- Dinalungan, Aurora --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037704000 -->
| Q53087 <!-- Dingalan, Aurora --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037705000 -->
| Q53089 <!-- Dipaculao, Aurora --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037706000 -->
| Q53090 <!-- Maria Aurora, Aurora --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037707000 -->
| Q53092 <!-- San Luis, Aurora --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037708000 -->
| Q54455 <!-- Abucay, Bataan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030801000 -->
| Q54456 <!-- Bagac, Bataan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030802000 -->
| Q1719 <!-- Balanga, Bataan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030803000 -->
| Q54457 <!-- Dinalupihan, Bataan --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030804000 -->
| Q54458 <!-- Hermosa, Bataan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030805000 -->
| Q54459 <!-- Limay, Bataan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030806000 -->
| Q54460 <!-- Mariveles, Bataan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030807000 -->
| Q54461 <!-- Morong, Bataan --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030808000 -->
| Q54462 <!-- Orani, Bataan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030809000 -->
| Q54463 <!-- Orion, Bataan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030810000 -->
| Q54464 <!-- Pilar, Bataan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030811000 -->
| Q54465 <!-- Samal, Bataan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030812000 -->
| Q54551 <!-- Angat, Bulacan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031401000 -->
| Q54553 <!-- Balagtas, Bulacan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031402000 -->
| Q54554 <!-- Baliuag, Bulacan --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031403000 -->
| Q54555 <!-- Bocaue, Bulacan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031404000 -->
| Q54558 <!-- Bulakan, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031405000 -->
| Q54560 <!-- Bustos, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031406000 -->
| Q54564 <!-- Calumpit, Bulacan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031407000 -->
| Q54566 <!-- Doña Remedios Trinidad, Bulacan --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031424000 -->
| Q54589 <!-- Guiguinto, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031408000 -->
| Q54592 <!-- Hagonoy, Bulacan --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031409000 -->
| Q2180 <!-- Malolos, Bulacan --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031410000 -->
| Q54595 <!-- Marilao, Bulacan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031411000 -->
| Q2187 <!-- Meycauayan, Bulacan --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031412000 -->
| Q54598 <!-- Norzagaray, Bulacan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031413000 -->
| Q54599 <!-- Obando, Bulacan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031414000 -->
| Q54600 <!-- Pandi, Bulacan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031415000 -->
| Q54605 <!-- Paombong, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031416000 -->
| Q54760 <!-- Plaridel, Bulacan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031417000 -->
| Q54761 <!-- Pulilan, Bulacan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031418000 -->
| Q54762 <!-- San Ildefonso, Bulacan --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031419000 -->
| Q2193 <!-- San Jose del Monte, Bulacan --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031420000 -->
| Q54763 <!-- San Miguel, Bulacan --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031421000 -->
| Q54765 <!-- San Rafael, Bulacan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031422000 -->
| Q54768 <!-- Santa Maria, Bulacan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031423000 -->
| Q55543 <!-- Aliaga, Nueva Ecija --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034901000 -->
| Q55544 <!-- Bongabon, Nueva Ecija --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034902000 -->
| Q55595 <!-- Cabanatuan, Nueva Ecija --> = 89 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034903000 -->
| Q55545 <!-- Cabiao, Nueva Ecija --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034904000 -->
| Q55546 <!-- Carranglan, Nueva Ecija --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034905000 -->
| Q55547 <!-- Cuyapo, Nueva Ecija --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034906000 -->
| Q55548 <!-- Gabaldon, Nueva Ecija --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034907000 -->
| Q55596 <!-- Gapan, Nueva Ecija --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034908000 -->
| Q55549 <!-- General Mamerto Natividad, Nueva Ecija --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034909000 -->
| Q55551 <!-- General Tinio, Nueva Ecija --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034910000 -->
| Q55552 <!-- Guimba, Nueva Ecija --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034911000 -->
| Q30871 <!-- Jaen, Nueva Ecija --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034912000 -->
| Q55556 <!-- Laur, Nueva Ecija --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034913000 -->
| Q55557 <!-- Licab, Nueva Ecija --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034914000 -->
| Q55558 <!-- Llanera, Nueva Ecija --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034915000 -->
| Q55559 <!-- Lupao, Nueva Ecija --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034916000 -->
| Q55597 <!-- Muñoz, Nueva Ecija --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034917000 -->
| Q55560 <!-- Nampicuan, Nueva Ecija --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034918000 -->
| Q55598 <!-- Palayan, Nueva Ecija --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034919000 -->
| Q55567 <!-- Pantabangan, Nueva Ecija --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034920000 -->
| Q55568 <!-- Peñaranda, Nueva Ecija --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034921000 -->
| Q55569 <!-- Quezon, Nueva Ecija --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034922000 -->
| Q55570 <!-- Rizal, Nueva Ecija --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034923000 -->
| Q30923 <!-- San Antonio, Nueva Ecija --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034924000 -->
| Q55572 <!-- San Isidro, Nueva Ecija --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034925000 -->
| Q55599 <!-- San Jose, Nueva Ecija --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034926000 -->
| Q55573 <!-- San Leonardo, Nueva Ecija --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034927000 -->
| Q55590 <!-- Santa Rosa, Nueva Ecija --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034928000 -->
| Q55591 <!-- Santo Domingo, Nueva Ecija --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034929000 -->
| Q55592 <!-- Talavera, Nueva Ecija --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034930000 -->
| Q55593 <!-- Talugtug, Nueva Ecija --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034931000 -->
| Q28731 <!-- Zaragoza, Nueva Ecija --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034932000 -->
| Q55741 <!-- Angeles --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035401000 -->
| Q55693 <!-- Apalit, Pampanga --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035402000 -->
| Q55694 <!-- Arayat, Pampanga --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035403000 -->
| Q55696 <!-- Bacolor, Pampanga --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035404000 -->
| Q55699 <!-- Candaba, Pampanga --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035405000 -->
| Q55700 <!-- Floridablanca, Pampanga --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035406000 -->
| Q55702 <!-- Guagua, Pampanga --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035407000 -->
| Q55705 <!-- Lubao, Pampanga --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035408000 -->
| Q55737 <!-- Mabalacat, Pampanga --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035409000 -->
| Q55707 <!-- Macabebe, Pampanga --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035410000 -->
| Q55709 <!-- Magalang, Pampanga --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035411000 -->
| Q55710 <!-- Masantol, Pampanga --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035412000 -->
| Q55712 <!-- Mexico, Pampanga --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035413000 -->
| Q55717 <!-- Minalin, Pampanga --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035414000 -->
| Q55721 <!-- Porac, Pampanga --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035415000 -->
| Q55740 <!-- San Fernando, Pampanga --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035416000 -->
| Q55724 <!-- San Luis, Pampanga --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035417000 -->
| Q55725 <!-- San Simon, Pampanga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035418000 -->
| Q55727 <!-- Santa Ana, Pampanga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035419000 -->
| Q55730 <!-- Santa Rita, Pampanga --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035420000 -->
| Q55731 <!-- Santo Tomas, Pampanga --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035421000 -->
| Q55734 <!-- Sasmuan, Pampanga --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035422000 -->
| Q56414 <!-- Anao, Tarlac --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036901000 -->
| Q56420 <!-- Bamban, Tarlac --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036902000 -->
| Q56424 <!-- Camiling, Tarlac --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036903000 -->
| Q56427 <!-- Capas, Tarlac --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036904000 -->
| Q30934 <!-- Concepcion, Tarlac --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036905000 -->
| Q56439 <!-- Gerona, Tarlac --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036906000 -->
| Q28733 <!-- La Paz, Tarlac --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036907000 -->
| Q56444 <!-- Mayantoc, Tarlac --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036908000 -->
| Q56453 <!-- Moncada, Tarlac --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036909000 -->
| Q56457 <!-- Paniqui, Tarlac --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036910000 -->
| Q56461 <!-- Pura, Tarlac --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036911000 -->
| Q56465 <!-- Ramos, Tarlac --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036912000 -->
| Q56471 <!-- San Clemente, Tarlac --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036913000 -->
| Q56476 <!-- San Jose, Tarlac --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036918000 -->
| Q56481 <!-- San Manuel, Tarlac --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036914000 -->
| Q56486 <!-- Santa Ignacia, Tarlac --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036915000 -->
| Q5285 <!-- Tarlac, Tarlac --> = 76 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036916000 -->
| Q56493 <!-- Victoria, Tarlac --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036917000 -->
| Q56529 <!-- Botolan, Zambales --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037101000 -->
| Q56533 <!-- Cabangan, Zambales --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037102000 -->
| Q56538 <!-- Candelaria, Zambales --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037103000 -->
| Q56561 <!-- Castillejos, Zambales --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037104000 -->
| Q56566 <!-- Iba, Zambales --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037105000 -->
| Q56572 <!-- Masinloc, Zambales --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037106000 -->
| Q56759 <!-- Olongapo --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037107000 -->
| Q56575 <!-- Palauig, Zambales --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037108000 -->
| Q56581 <!-- San Antonio, Zambales --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037109000 -->
| Q56584 <!-- San Felipe, Zambales --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037110000 -->
| Q56623 <!-- San Marcelino, Zambales --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037111000 -->
| Q56647 <!-- San Narciso, Zambales --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037112000 -->
| Q56656 <!-- Santa Cruz, Zambales --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037113000 -->
| Q56663 <!-- Subic, Zambales --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037114000 -->
| Q59250 <!-- Agoncillo, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041001000 -->
| Q59251 <!-- Alitagtag, Batangas --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041002000 -->
| Q59252 <!-- Balayan, Batangas --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041003000 -->
| Q59253 <!-- Balete, Batangas --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041004000 -->
| Q1723 <!-- Batangas, Batangas --> = 105 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041005000 -->
| Q59272 <!-- Bauan, Batangas --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041006000 -->
| Q59276 <!-- Calaca, Batangas --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041007000 -->
| Q59279 <!-- Calatagan, Batangas --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041008000 -->
| Q59287 <!-- Cuenca, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041009000 -->
| Q59304 <!-- Ibaan, Batangas --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041010000 -->
| Q59308 <!-- Laurel, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041011000 -->
| Q59311 <!-- Lemery, Batangas --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041012000 -->
| Q59312 <!-- Lian, Batangas --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041013000 -->
| Q1725 <!-- Lipa, Batangas --> = 72 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041014000 -->
| Q803199 <!-- Lobo, Batangas --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041015000 -->
| Q59313 <!-- Mabini, Batangas --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041016000 -->
| Q59731 <!-- Malvar, Batangas --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041017000 -->
| Q59740 <!-- Mataasnakahoy, Batangas --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041018000 -->
| Q59745 <!-- Nasugbu, Batangas --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041019000 -->
| Q59749 <!-- Padre Garcia, Batangas --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041020000 -->
| Q59758 <!-- Rosario, Batangas --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041021000 -->
| Q59764 <!-- San Jose, Batangas --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041022000 -->
| Q59770 <!-- San Juan, Batangas --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041023000 -->
| Q59773 <!-- San Luis, Batangas --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041024000 -->
| Q59777 <!-- San Nicolas, Batangas --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041025000 -->
| Q59784 <!-- San Pascual, Batangas --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041026000 -->
| Q59788 <!-- Santa Teresita, Batangas --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041027000 -->
| Q59799 <!-- Santo Tomas, Batangas --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041028000 -->
| Q59814 <!-- Taal, Batangas --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041029000 -->
| Q59825 <!-- Talisay, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041030000 -->
| Q1730 <!-- Tanauan, Batangas --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041031000 -->
| Q59830 <!-- Taysan, Batangas --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041032000 -->
| Q59835 <!-- Tingloy, Batangas --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041033000 -->
| Q59844 <!-- Tuy, Batangas --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041034000 -->
| Q62600 <!-- Alfonso, Cavite --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042101000 -->
| Q62606 <!-- Amadeo, Cavite --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042102000 -->
| Q63129 <!-- Bacoor, Cavite --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042103000 -->
| Q62611 <!-- Carmona, Cavite --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042104000 -->
| Q1482 <!-- Cavite, Cavite --> = 84 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042105000 -->
| Q63139 <!-- Dasmariñas, Cavite --> = 75 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042106000 -->
| Q62719 <!-- General Emilio Aguinaldo, Cavite --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042107000 -->
| Q62638 <!-- General Mariano Alvarez, Cavite --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042123000 -->
| Q62723 <!-- General Trias, Cavite --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042108000 -->
| Q63145 <!-- Imus, Cavite --> = 97 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042109000 -->
| Q62729 <!-- Indang, Cavite --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042110000 -->
| Q62755 <!-- Kawit, Cavite --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042111000 -->
| Q62771 <!-- Magallanes, Cavite --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042112000 -->
| Q62776 <!-- Maragondon, Cavite --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042113000 -->
| Q62784 <!-- Mendez, Cavite --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042114000 -->
| Q62799 <!-- Naic, Cavite --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042115000 -->
| Q63096 <!-- Noveleta, Cavite --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042116000 -->
| Q63102 <!-- Rosario, Cavite --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042117000 -->
| Q63110 <!-- Silang, Cavite --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042118000 -->
| Q63154 <!-- Tagaytay, Cavite --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042119000 -->
| Q63115 <!-- Tanza, Cavite --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042120000 -->
| Q63124 <!-- Ternate, Cavite --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042121000 -->
| Q63160 <!-- Trece Martires, Cavite --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042122000 -->
| Q63750 <!-- Alaminos, Laguna --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043401000 -->
| Q63763 <!-- Bay, Laguna --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043402000 -->
| Q75961 <!-- Biñan, Laguna --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043403000 -->
| Q25096 <!-- Cabuyao, Laguna --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043404000 -->
| Q75978 <!-- Calamba, Laguna --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043405000 -->
| Q69739 <!-- Calauan, Laguna --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043406000 -->
| Q69749 <!-- Cavinti, Laguna --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043407000 -->
| Q69759 <!-- Famy, Laguna --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043408000 -->
| Q69771 <!-- Kalayaan, Laguna --> = 3 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043409000 -->
| Q69781 <!-- Liliw, Laguna --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043410000 -->
| Q69793 <!-- Los Baños, Laguna --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043411000 -->
| Q69812 <!-- Luisiana, Laguna --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043412000 -->
| Q69824 <!-- Lumban, Laguna --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043413000 -->
| Q75875 <!-- Mabitac, Laguna --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043414000 -->
| Q75881 <!-- Magdalena, Laguna --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043415000 -->
| Q75888 <!-- Majayjay, Laguna --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043416000 -->
| Q75895 <!-- Nagcarlan, Laguna --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043417000 -->
| Q75899 <!-- Paete, Laguna --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043418000 -->
| Q75905 <!-- Pagsanjan, Laguna --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043419000 -->
| Q75910 <!-- Pakil, Laguna --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043420000 -->
| Q75918 <!-- Pangil, Laguna --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043421000 -->
| Q75923 <!-- Pila, Laguna --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043422000 -->
| Q75928 <!-- Rizal, Laguna --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043423000 -->
| Q76001 <!-- San Pablo, Laguna --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043424000 -->
| Q75933 <!-- San Pedro, Laguna --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043425000 -->
| Q75938 <!-- Santa Cruz, Laguna --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043426000 -->
| Q75943 <!-- Santa Maria, Laguna --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043427000 -->
| Q76010 <!-- Santa Rosa, Laguna --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043428000 -->
| Q75948 <!-- Siniloan, Laguna --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043429000 -->
| Q75953 <!-- Victoria, Laguna --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043430000 -->
| Q103777 <!-- Agdangan, Quezon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045601000 -->
| Q103786 <!-- Alabat, Quezon --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045602000 -->
| Q103807 <!-- Atimonan, Quezon --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045603000 -->
| Q103815 <!-- Buenavista, Quezon --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045605000 -->
| Q103825 <!-- Burdeos, Quezon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045606000 -->
| Q103833 <!-- Calauag, Quezon --> = 81 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045607000 -->
| Q103841 <!-- Candelaria, Quezon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045608000 -->
| Q103872 <!-- Catanauan, Quezon --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045610000 -->
| Q103879 <!-- Dolores, Quezon --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045615000 -->
| Q103889 <!-- General Luna, Quezon --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045616000 -->
| Q103899 <!-- General Nakar, Quezon --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045617000 -->
| Q103905 <!-- Guinayangan, Quezon --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045618000 -->
| Q103914 <!-- Gumaca, Quezon --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045619000 -->
| Q103921 <!-- Infanta, Quezon --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045620000 -->
| Q103928 <!-- Jomalig, Quezon --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045621000 -->
| Q103935 <!-- Lopez, Quezon --> = 95 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045622000 -->
| Q103941 <!-- Lucban, Quezon --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045623000 -->
| Q104125 <!-- Lucena --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045624000 -->
| Q103947 <!-- Macalelon, Quezon --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045625000 -->
| Q103952 <!-- Mauban, Quezon --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045627000 -->
| Q103958 <!-- Mulanay, Quezon --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045628000 -->
| Q103965 <!-- Padre Burgos, Quezon --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045629000 -->
| Q103971 <!-- Pagbilao, Quezon --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045630000 -->
| Q103976 <!-- Panukulan, Quezon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045631000 -->
| Q103981 <!-- Patnanungan, Quezon --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045632000 -->
| Q103987 <!-- Perez, Quezon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045633000 -->
| Q103996 <!-- Pitogo, Quezon --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045634000 -->
| Q104005 <!-- Plaridel, Quezon --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045635000 -->
| Q104011 <!-- Polillo, Quezon --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045636000 -->
| Q104020 <!-- Quezon, Quezon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045637000 -->
| Q104026 <!-- Real, Quezon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045638000 -->
| Q104037 <!-- Sampaloc, Quezon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045639000 -->
| Q104044 <!-- San Andres, Quezon --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045640000 -->
| Q104052 <!-- San Antonio, Quezon --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045641000 -->
| Q104063 <!-- San Francisco, Quezon --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045642000 -->
| Q104071 <!-- San Narciso, Quezon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045644000 -->
| Q104078 <!-- Sariaya, Quezon --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045645000 -->
| Q104087 <!-- Tagkawayan, Quezon --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045646000 -->
| Q104113 <!-- Tayabas, Quezon --> = 66 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045647000 -->
| Q104092 <!-- Tiaong, Quezon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045648000 -->
| Q104099 <!-- Unisan, Quezon --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045649000 -->
| Q106758 <!-- Angono, Rizal --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045801000 -->
| Q1636 <!-- Antipolo, Rizal --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045802000 -->
| Q106766 <!-- Baras, Rizal --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045803000 -->
| Q106783 <!-- Binangonan, Rizal --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045804000 -->
| Q106790 <!-- Cainta, Rizal --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045805000 -->
| Q106796 <!-- Cardona, Rizal --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045806000 -->
| Q106804 <!-- Jalajala, Rizal --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045807000 -->
| Q106810 <!-- Morong, Rizal --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045809000 -->
| Q106817 <!-- Pililla, Rizal --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045810000 -->
| Q106825 <!-- Rodriguez, Rizal --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045808000 -->
| Q106832 <!-- San Mateo, Rizal --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045811000 -->
| Q106839 <!-- Tanay, Rizal --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045812000 -->
| Q373204 <!-- Taytay, Rizal --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045813000 -->
| Q106848 <!-- Teresa, Rizal --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045814000 -->
| Q492912 <!-- Bacacay, Albay --> = 56 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050501000 -->
| Q492976 <!-- Camalig, Albay --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050502000 -->
| Q493008 <!-- Daraga, Albay --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050503000 -->
| Q493032 <!-- Guinobatan, Albay --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050504000 -->
| Q493065 <!-- Jovellar, Albay --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050505000 -->
| Q1696 <!-- Legazpi, Albay --> = 70 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050506000 -->
| Q493095 <!-- Libon, Albay --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050507000 -->
| Q1701 <!-- Ligao, Albay --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050508000 -->
| Q493132 <!-- Malilipot, Albay --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050509000 -->
| Q493178 <!-- Malinao, Albay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050510000 -->
| Q493204 <!-- Manito, Albay --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050511000 -->
| Q493246 <!-- Oas, Albay --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050512000 -->
| Q256045 <!-- Pio Duran, Albay --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050513000 -->
| Q493326 <!-- Polangui, Albay --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050514000 -->
| Q493362 <!-- Rapu-Rapu, Albay --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050515000 -->
| Q493409 <!-- Santo Domingo, Albay --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050516000 -->
| Q1706 <!-- Tabaco, Albay --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050517000 -->
| Q493444 <!-- Tiwi, Albay --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050518000 -->
| Q356607 <!-- Basud, Camarines Norte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051601000 -->
| Q119624 <!-- Capalonga, Camarines Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051602000 -->
| Q356655 <!-- Daet, Camarines Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051603000 -->
| Q356681 <!-- Jose Panganiban, Camarines Norte --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051605000 -->
| Q356708 <!-- Labo, Camarines Norte --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051606000 -->
| Q356734 <!-- Mercedes, Camarines Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051607000 -->
| Q356759 <!-- Paracale, Camarines Norte --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051608000 -->
| Q356803 <!-- San Lorenzo Ruiz, Camarines Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051604000 -->
| Q302791 <!-- San Vicente, Camarines Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051609000 -->
| Q356853 <!-- Santa Elena, Camarines Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051610000 -->
| Q356878 <!-- Talisay, Camarines Norte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051611000 -->
| Q356898 <!-- Vinzons, Camarines Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051612000 -->
| Q208672 <!-- Baao, Camarines Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051701000 -->
| Q208678 <!-- Balatan, Camarines Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051702000 -->
| Q208683 <!-- Bato, Camarines Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051703000 -->
| Q208690 <!-- Bombon, Camarines Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051704000 -->
| Q208699 <!-- Buhi, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051705000 -->
| Q208712 <!-- Bula, Camarines Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051706000 -->
| Q208717 <!-- Cabusao, Camarines Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051707000 -->
| Q208727 <!-- Calabanga, Camarines Sur --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051708000 -->
| Q208738 <!-- Camaligan, Camarines Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051709000 -->
| Q208749 <!-- Canaman, Camarines Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051710000 -->
| Q208757 <!-- Caramoan, Camarines Sur --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051711000 -->
| Q208765 <!-- Del Gallego, Camarines Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051712000 -->
| Q208769 <!-- Gainza, Camarines Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051713000 -->
| Q208775 <!-- Garchitorena, Camarines Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051714000 -->
| Q208782 <!-- Goa, Camarines Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051715000 -->
| Q2205 <!-- Iriga, Camarines Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051716000 -->
| Q208792 <!-- Lagonoy, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051717000 -->
| Q208814 <!-- Libmanan, Camarines Sur --> = 75 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051718000 -->
| Q208835 <!-- Lupi, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051719000 -->
| Q208845 <!-- Magarao, Camarines Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051720000 -->
| Q208852 <!-- Milaor, Camarines Sur --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051721000 -->
| Q208864 <!-- Minalabac, Camarines Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051722000 -->
| Q208872 <!-- Nabua, Camarines Sur --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051723000 -->
| Q2207 <!-- Naga --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051724000 -->
| Q208878 <!-- Ocampo, Camarines Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051725000 -->
| Q208886 <!-- Pamplona, Camarines Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051726000 -->
| Q208892 <!-- Pasacao, Camarines Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051727000 -->
| Q208899 <!-- Pili, Camarines Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051728000 -->
| Q208919 <!-- Presentacion, Camarines Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051729000 -->
| Q208924 <!-- Ragay, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051730000 -->
| Q208937 <!-- Sagñay, Camarines Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051731000 -->
| Q208950 <!-- San Fernando, Camarines Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051732000 -->
| Q208966 <!-- San Jose, Camarines Sur --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051733000 -->
| Q208985 <!-- Sipocot, Camarines Sur --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051734000 -->
| Q208995 <!-- Siruma, Camarines Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051735000 -->
| Q209011 <!-- Tigaon, Camarines Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051736000 -->
| Q209024 <!-- Tinambac, Camarines Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051737000 -->
| Q192067 <!-- Bagamanoc, Catanduanes --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052001000 -->
| Q192072 <!-- Baras, Catanduanes --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052002000 -->
| Q192085 <!-- Bato, Catanduanes --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052003000 -->
| Q192091 <!-- Caramoran, Catanduanes --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052004000 -->
| Q192629 <!-- Gigmoto, Catanduanes --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052005000 -->
| Q123163 <!-- Pandan, Catanduanes --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052006000 -->
| Q192646 <!-- Panganiban, Catanduanes --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052007000 -->
| Q840162 <!-- San Andres, Catanduanes --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052008000 -->
| Q192665 <!-- San Miguel, Catanduanes --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052009000 -->
| Q192670 <!-- Viga, Catanduanes --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052010000 -->
| Q192681 <!-- Virac, Catanduanes --> = 63 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052011000 -->
| Q107011 <!-- Boac, Marinduque --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174001000 -->
| Q107034 <!-- Mogpog, Marinduque --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174004000 -->
| Q107042 <!-- Santa Cruz, Marinduque --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174005000 -->
| Q107048 <!-- Torrijos, Marinduque --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174006000 -->
| Q191416 <!-- Aroroy, Masbate --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054101000 -->
| Q191438 <!-- Baleno, Masbate --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054102000 -->
| Q191453 <!-- Balud, Masbate --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054103000 -->
| Q191463 <!-- Batuan, Masbate --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054104000 -->
| Q191478 <!-- Cataingan, Masbate --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054105000 -->
| Q191482 <!-- Cawayan, Masbate --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054106000 -->
| Q191490 <!-- Claveria, Masbate --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054107000 -->
| Q191496 <!-- Dimasalang, Masbate --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054108000 -->
| Q191501 <!-- Esperanza, Masbate --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054109000 -->
| Q191512 <!-- Mandaon, Masbate --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054110000 -->
| Q191651 <!-- Masbate, Masbate --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054111000 -->
| Q191522 <!-- Milagros, Masbate --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054112000 -->
| Q191533 <!-- Mobo, Masbate --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054113000 -->
| Q191544 <!-- Monreal, Masbate --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054114000 -->
| Q191558 <!-- Palanas, Masbate --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054115000 -->
| Q191581 <!-- Pio V. Corpuz, Masbate --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054116000 -->
| Q191590 <!-- Placer, Masbate --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054117000 -->
| Q191606 <!-- San Fernando, Masbate --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054118000 -->
| Q191621 <!-- San Jacinto, Masbate --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054119000 -->
| Q191630 <!-- San Pascual, Masbate --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054120000 -->
| Q191636 <!-- Uson, Masbate --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054121000 -->
| Q174114 <!-- Barcelona, Sorsogon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056202000 -->
| Q174132 <!-- Bulan, Sorsogon --> = 63 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056203000 -->
| Q174162 <!-- Casiguran, Sorsogon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056205000 -->
| Q174177 <!-- Castilla, Sorsogon --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056206000 -->
| Q174192 <!-- Donsol, Sorsogon --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056207000 -->
| Q174201 <!-- Gubat, Sorsogon --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056208000 -->
| Q174215 <!-- Irosin, Sorsogon --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056209000 -->
| Q174236 <!-- Magallanes, Sorsogon --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056211000 -->
| Q174246 <!-- Matnog, Sorsogon --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056212000 -->
| Q174269 <!-- Prieto Diaz, Sorsogon --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056214000 -->
| Q174281 <!-- Santa Magdalena, Sorsogon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056215000 -->
| Q107023 <!-- Buenavista, Marinduque --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174002000 -->
| Q107029 <!-- Gasan, Marinduque --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174003000 -->
| Q107454 <!-- Abra de Ilog, Occidental Mindoro --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175101000 -->
| Q107460 <!-- Calintaan, Occidental Mindoro --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175102000 -->
| Q107465 <!-- Looc, Occidental Mindoro --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175103000 -->
| Q107476 <!-- Lubang, Occidental Mindoro --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175104000 -->
| Q107482 <!-- Magsaysay, Occidental Mindoro --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175105000 -->
| Q107488 <!-- Mamburao , Occidental Mindoro --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175106000 -->
| Q107493 <!-- Paluan, Occidental Mindoro --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175107000 -->
| Q107499 <!-- Rizal, Occidental Mindoro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175108000 -->
| Q107505 <!-- Sablayan, Occidental Mindoro --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175109000 -->
| Q107511 <!-- San Jose, Occidental Mindoro --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175110000 -->
| Q107519 <!-- Santa Cruz, Occidental Mindoro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175111000 -->
| Q107538 <!-- Baco, Oriental Mindoro --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175201000 -->
| Q107543 <!-- Bansud, Oriental Mindoro --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175202000 -->
| Q107550 <!-- Bongabong, Oriental Mindoro --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175203000 -->
| Q107554 <!-- Bulalacao, Oriental Mindoro --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175204000 -->
| Q107624 <!-- Calapan, Oriental Mindoro --> = 62 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175205000 -->
| Q107559 <!-- Gloria, Oriental Mindoro --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175206000 -->
| Q107567 <!-- Mansalay, Oriental Mindoro --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175207000 -->
| Q107573 <!-- Naujan, Oriental Mindoro --> = 70 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175208000 -->
| Q107578 <!-- Pinamalayan, Oriental Mindoro --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175209000 -->
| Q107585 <!-- Pola, Oriental Mindoro --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175210000 -->
| Q107593 <!-- Puerto Galera, Oriental Mindoro --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175211000 -->
| Q107598 <!-- Roxas, Oriental Mindoro --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175212000 -->
| Q107606 <!-- San Teodoro, Oriental Mindoro --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175213000 -->
| Q107612 <!-- Socorro, Oriental Mindoro --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175214000 -->
| Q107618 <!-- Victoria, Oriental Mindoro --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175215000 -->
| Q111338 <!-- Aborlan, Palawan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175301000 -->
| Q111351 <!-- Agutaya, Palawan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175302000 -->
| Q111360 <!-- Araceli, Palawan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175303000 -->
| Q111372 <!-- Balabac, Palawan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175304000 -->
| Q111378 <!-- Bataraza, Palawan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175305000 -->
| Q111386 <!-- Brooke's Point, Palawan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175306000 -->
| Q111393 <!-- Busuanga, Palawan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175307000 -->
| Q111402 <!-- Cagayancillo, Palawan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175308000 -->
| Q111414 <!-- Coron, Palawan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175309000 -->
| Q111427 <!-- Culion, Palawan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175322000 -->
| Q111438 <!-- Cuyo, Palawan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175310000 -->
| Q111468 <!-- Dumaran, Palawan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175311000 -->
| Q111483 <!-- El Nido, Palawan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175312000 -->
| Q111495 <!-- Kalayaan, Palawan --> = 1 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175321000 -->
| Q111506 <!-- Linapacan, Palawan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175313000 -->
| Q111521 <!-- Magsaysay, Palawan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175314000 -->
| Q111535 <!-- Narra, Palawan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175315000 -->
| Q111739 <!-- Puerto Princesa --> = 66 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175316000 -->
| Q111662 <!-- Quezon, Palawan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175317000 -->
| Q111677 <!-- Rizal, Palawan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175323000 -->
| Q111689 <!-- Roxas, Palawan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175318000 -->
| Q111707 <!-- San Vicente, Palawan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175319000 -->
| Q111719 <!-- Sofronio Española, Palawan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175324000 -->
| Q111730 <!-- Taytay, Palawan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175320000 -->
| Q174497 <!-- Alcantara, Romblon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175901000 -->
| Q174511 <!-- Banton, Romblon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175902000 -->
| Q174525 <!-- Cajidiocan, Romblon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175903000 -->
| Q174544 <!-- Calatrava, Romblon --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175904000 -->
| Q174562 <!-- Concepcion, Romblon --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175905000 -->
| Q174575 <!-- Corcuera, Romblon --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175906000 -->
| Q174591 <!-- Ferrol, Romblon --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175916000 -->
| Q174607 <!-- Looc, Romblon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175907000 -->
| Q174620 <!-- Magdiwang, Romblon --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175908000 -->
| Q174632 <!-- Odiongan, Romblon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175909000 -->
| Q174649 <!-- Romblon , Romblon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175910000 -->
| Q174659 <!-- San Agustin, Romblon --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175911000 -->
| Q174667 <!-- San Andres, Romblon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175912000 -->
| Q174676 <!-- San Fernando, Romblon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175913000 -->
| Q174689 <!-- San Jose, Romblon --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175914000 -->
| Q174702 <!-- Santa Fe, Romblon --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175915000 -->
| Q174717 <!-- Santa Maria, Romblon --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175917000 -->
| Q174149 <!-- Bulusan, Sorsogon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056204000 -->
| Q174226 <!-- Juban, Sorsogon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056210000 -->
| Q174255 <!-- Pilar, Sorsogon --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056213000 -->
| Q174096 <!-- Sorsogon, Sorsogon --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056216000 -->
| Q434743 <!-- Altavas, Aklan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060401000 -->
| Q626586 <!-- Balete, Aklan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060402000 -->
| Q569215 <!-- Banga, Aklan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060403000 -->
| Q626645 <!-- Batan, Aklan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060404000 -->
| Q576805 <!-- Buruanga, Aklan --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060405000 -->
| Q626695 <!-- Ibajay, Aklan --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060406000 -->
| Q626721 <!-- Kalibo , Aklan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060407000 -->
| Q626746 <!-- Lezo, Aklan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060408000 -->
| Q626786 <!-- Libacao, Aklan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060409000 -->
| Q626820 <!-- Madalag, Aklan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060410000 -->
| Q626873 <!-- Makato, Aklan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060411000 -->
| Q626905 <!-- Malay, Aklan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060412000 -->
| Q626935 <!-- Malinao, Aklan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060413000 -->
| Q626959 <!-- Nabas, Aklan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060414000 -->
| Q626992 <!-- New Washington, Aklan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060415000 -->
| Q627008 <!-- Numancia, Aklan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060416000 -->
| Q627028 <!-- Tangalan, Aklan --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060417000 -->
| Q492119 <!-- Anini-y, Antique --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060601000 -->
| Q492155 <!-- Barbaza, Antique --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060602000 -->
| Q492263 <!-- Belison, Antique --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060603000 -->
| Q492325 <!-- Bugasong, Antique --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060604000 -->
| Q492363 <!-- Caluya, Antique --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060605000 -->
| Q492406 <!-- Culasi, Antique --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060606000 -->
| Q144779 <!-- Hamtic, Antique --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060608000 -->
| Q492479 <!-- Laua-an, Antique --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060609000 -->
| Q492516 <!-- Libertad, Antique --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060610000 -->
| Q492545 <!-- Pandan, Antique --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060611000 -->
| Q492577 <!-- Patnongon, Antique --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060612000 -->
| Q492619 <!-- San Jose, Antique --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060613000 -->
| Q492673 <!-- San Remigio, Antique --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060614000 -->
| Q492707 <!-- Sebaste, Antique --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060615000 -->
| Q492742 <!-- Sibalom, Antique --> = 76 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060616000 -->
| Q492780 <!-- Tibiao, Antique --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060617000 -->
| Q492817 <!-- Tobias Fornier, Antique --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060607000 -->
| Q492862 <!-- Valderrama, Antique --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060618000 -->
| Q355953 <!-- Cuartero, Capiz --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061901000 -->
| Q355986 <!-- Dao, Capiz --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061902000 -->
| Q356019 <!-- Dumalag, Capiz --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061903000 -->
| Q356053 <!-- Dumarao, Capiz --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061904000 -->
| Q356081 <!-- Ivisan, Capiz --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061905000 -->
| Q356106 <!-- Jamindan, Capiz --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061906000 -->
| Q356153 <!-- Ma-ayon, Capiz --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061907000 -->
| Q356174 <!-- Mambusao, Capiz --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061908000 -->
| Q356204 <!-- Panay, Capiz --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061909000 -->
| Q356231 <!-- Panitan, Capiz --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061910000 -->
| Q356266 <!-- Pilar, Capiz --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061911000 -->
| Q356292 <!-- Pontevedra, Capiz --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061912000 -->
| Q356313 <!-- President Roxas, Capiz --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061913000 -->
| Q2209 <!-- Roxas, Capiz --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061914000 -->
| Q356338 <!-- Sapi-an, Capiz --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061915000 -->
| Q356368 <!-- Sigma, Capiz --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061916000 -->
| Q356398 <!-- Tapaz, Capiz --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061917000 -->
| Q313781 <!-- Buenavista, Guimaras --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067901000 -->
| Q313802 <!-- Jordan, Guimaras --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067902000 -->
| Q313810 <!-- Nueva Valencia, Guimaras --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067903000 -->
| Q313825 <!-- San Lorenzo, Guimaras --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067904000 -->
| Q313844 <!-- Sibunag, Guimaras --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067905000 -->
| Q274491 <!-- Ajuy, Iloilo --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063001000 -->
| Q274508 <!-- Alimodian, Iloilo --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063002000 -->
| Q274543 <!-- Anilao, Iloilo --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063003000 -->
| Q274557 <!-- Badiangan, Iloilo --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063004000 -->
| Q274578 <!-- Balasan, Iloilo --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063005000 -->
| Q274595 <!-- Banate, Iloilo --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063006000 -->
| Q82502 <!-- Barotac Nuevo, Iloilo --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063007000 -->
| Q82493 <!-- Barotac Viejo, Iloilo --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063008000 -->
| Q274654 <!-- Batad, Iloilo --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063009000 -->
| Q274671 <!-- Bingawan, Iloilo --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063010000 -->
| Q274693 <!-- Cabatuan, Iloilo --> = 68 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063012000 -->
| Q274713 <!-- Calinog, Iloilo --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063013000 -->
| Q274731 <!-- Carles, Iloilo --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063014000 -->
| Q274749 <!-- Concepcion, Iloilo --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063015000 -->
| Q274780 <!-- Dingle, Iloilo --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063016000 -->
| Q274795 <!-- Dueñas, Iloilo --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063017000 -->
| Q74758 <!-- Dumangas, Iloilo --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063018000 -->
| Q82506 <!-- Estancia, Iloilo --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063019000 -->
| Q274847 <!-- Guimbal, Iloilo --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063020000 -->
| Q74755 <!-- Igbaras, Iloilo --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063021000 -->
| Q459787 <!-- Iloilo --> = 180 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063022000 -->
| Q82570 <!-- Janiuay, Iloilo --> = 60 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063023000 -->
| Q274907 <!-- Lambunao, Iloilo --> = 73 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063025000 -->
| Q274937 <!-- Leganes, Iloilo --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063026000 -->
| Q274961 <!-- Lemery, Iloilo --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063027000 -->
| Q274987 <!-- Leon, Iloilo --> = 85 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063028000 -->
| Q275015 <!-- Maasin, Iloilo --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063029000 -->
| Q74753 <!-- Miagao, Iloilo --> = 119 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063030000 -->
| Q275071 <!-- Mina, Iloilo --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063031000 -->
| Q275184 <!-- New Lucena, Iloilo --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063032000 -->
| Q275199 <!-- Oton, Iloilo --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063034000 -->
| Q1855693 <!-- Passi, Iloilo --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063035000 -->
| Q275221 <!-- Pavia, Iloilo --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063036000 -->
| Q275243 <!-- Pototan, Iloilo --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063037000 -->
| Q275264 <!-- San Dionisio, Iloilo --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063038000 -->
| Q275280 <!-- San Enrique, Iloilo --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063039000 -->
| Q275295 <!-- San Joaquin, Iloilo --> = 85 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063040000 -->
| Q275312 <!-- San Miguel, Iloilo --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063041000 -->
| Q275329 <!-- San Rafael, Iloilo --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063042000 -->
| Q275347 <!-- Santa Barbara, Iloilo --> = 60 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063043000 -->
| Q275368 <!-- Sara, Iloilo --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063044000 -->
| Q82497 <!-- Tigbauan, Iloilo --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063045000 -->
| Q275417 <!-- Tubungan, Iloilo --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063046000 -->
| Q148064 <!-- Zarraga, Iloilo --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063047000 -->
| Q5217 <!-- Bacolod --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/060000000 -->
| Q628297 <!-- Bago, Negros Occidental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064502000 -->
| Q195243 <!-- Binalbagan, Negros Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064503000 -->
| Q1020688 <!-- Cadiz, Negros Occidental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064504000 -->
| Q195258 <!-- Calatrava, Negros Occidental --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064505000 -->
| Q195272 <!-- Candoni, Negros Occidental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064506000 -->
| Q195287 <!-- Cauayan, Negros Occidental --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064507000 -->
| Q195304 <!-- Enrique B. Magalona, Negros Occidental --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064508000 -->
| Q1027743 <!-- Escalante, Negros Occidental --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064509000 -->
| Q1423846 <!-- Himamaylan, Negros Occidental --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064510000 -->
| Q195322 <!-- Hinigaran, Negros Occidental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064511000 -->
| Q195336 <!-- Hinoba-an, Negros Occidental --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064512000 -->
| Q195352 <!-- Ilog, Negros Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064513000 -->
| Q195373 <!-- Isabela, Negros Occidental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064514000 -->
| Q1026445 <!-- Kabankalan, Negros Occidental --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064515000 -->
| Q1789908 <!-- La Carlota, Negros Occidental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064516000 -->
| Q195397 <!-- La Castellana, Negros Occidental --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064517000 -->
| Q195418 <!-- Manapla, Negros Occidental --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064518000 -->
| Q195438 <!-- Moises Padilla, Negros Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064519000 -->
| Q195459 <!-- Murcia, Negros Occidental --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064520000 -->
| Q195477 <!-- Pontevedra, Negros Occidental --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064521000 -->
| Q195489 <!-- Pulupandan, Negros Occidental --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064522000 -->
| Q1787527 <!-- Sagay, Negros Occidental --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064523000 -->
| Q195503 <!-- Salvador Benedicto, Negros Occidental --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064532000 -->
| Q1025390 <!-- San Carlos, Negros Occidental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064524000 -->
| Q195523 <!-- San Enrique, Negros Occidental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064525000 -->
| Q1020696 <!-- Silay, Negros Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064526000 -->
| Q1027115 <!-- Sipalay, Negros Occidental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064527000 -->
| Q1027120 <!-- Talisay, Negros Occidental --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064528000 -->
| Q195549 <!-- Toboso, Negros Occidental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064529000 -->
| Q195569 <!-- Valladolid, Negros Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064530000 -->
| Q1026021 <!-- Victorias, Negros Occidental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064531000 -->
| Q194822 <!-- Amlan, Negros Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074601000 -->
| Q194854 <!-- Ayungon, Negros Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074602000 -->
| Q194874 <!-- Bacong, Negros Oriental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074603000 -->
| Q628590 <!-- Bais, Negros Oriental --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074604000 -->
| Q194900 <!-- Basay, Negros Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074605000 -->
| Q812113 <!-- Bayawan, Negros Oriental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074606000 -->
| Q194916 <!-- Bindoy, Negros Oriental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074607000 -->
| Q991602 <!-- Canlaon, Negros Oriental --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074608000 -->
| Q194940 <!-- Dauin, Negros Oriental --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074609000 -->
| Q873377 <!-- Dumaguete, Negros Oriental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074610000 -->
| Q195197 <!-- Guihulngan, Negros Oriental --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074611000 -->
| Q194967 <!-- Jimalalud, Negros Oriental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074612000 -->
| Q194983 <!-- La Libertad, Negros Oriental --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074613000 -->
| Q195004 <!-- Mabinay, Negros Oriental --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074614000 -->
| Q195018 <!-- Manjuyod, Negros Oriental --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074615000 -->
| Q195040 <!-- Pamplona, Negros Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074616000 -->
| Q195056 <!-- San Jose, Negros Oriental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074617000 -->
| Q195074 <!-- Santa Catalina, Negros Oriental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074618000 -->
| Q195090 <!-- Siaton, Negros Oriental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074619000 -->
| Q195106 <!-- Sibulan, Negros Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074620000 -->
| Q1020705 <!-- Tanjay, Negros Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074621000 -->
| Q195121 <!-- Tayasan, Negros Oriental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074622000 -->
| Q195140 <!-- Valencia, Negros Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074623000 -->
| Q195164 <!-- Vallehermoso, Negros Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074624000 -->
| Q145673 <!-- Zamboanguita, Negros Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074625000 -->
| Q404369 <!-- Alburquerque, Bohol --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071201000 -->
| Q404403 <!-- Alicia, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071202000 -->
| Q404434 <!-- Anda, Bohol --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071203000 -->
| Q404459 <!-- Antequera, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071204000 -->
| Q404489 <!-- Baclayon, Bohol --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071205000 -->
| Q404519 <!-- Balilihan, Bohol --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071206000 -->
| Q404549 <!-- Batuan, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071207000 -->
| Q404581 <!-- Bien Unido, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071248000 -->
| Q404604 <!-- Bilar, Bohol --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071208000 -->
| Q404623 <!-- Buenavista, Bohol --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071209000 -->
| Q404652 <!-- Calape, Bohol --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071210000 -->
| Q404680 <!-- Candijay, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071211000 -->
| Q241239 <!-- Carmen, Bohol --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071212000 -->
| Q404750 <!-- Catigbian, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071213000 -->
| Q404775 <!-- Clarin, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071214000 -->
| Q404799 <!-- Corella, Bohol --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071215000 -->
| Q404825 <!-- Cortes, Bohol --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071216000 -->
| Q404854 <!-- Dagohoy, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071217000 -->
| Q404882 <!-- Danao, Bohol --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071218000 -->
| Q404908 <!-- Dauis, Bohol --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071219000 -->
| Q404930 <!-- Dimiao, Bohol --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071220000 -->
| Q404951 <!-- Duero, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071221000 -->
| Q404976 <!-- Garcia Hernandez, Bohol --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071222000 -->
| Q405005 <!-- Getafe, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071226000 -->
| Q405058 <!-- Guindulman, Bohol --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071223000 -->
| Q405088 <!-- Inabanga, Bohol --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071224000 -->
| Q405110 <!-- Jagna, Bohol --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071225000 -->
| Q405141 <!-- Lila, Bohol --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071227000 -->
| Q405171 <!-- Loay, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071228000 -->
| Q405197 <!-- Loboc, Bohol --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071229000 -->
| Q405224 <!-- Loon, Bohol --> = 67 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071230000 -->
| Q405268 <!-- Mabini, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071231000 -->
| Q405303 <!-- Maribojoc, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071232000 -->
| Q178330 <!-- Panglao, Bohol --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071233000 -->
| Q405384 <!-- Pilar, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071234000 -->
| Q405427 <!-- President Carlos P. Garcia, Bohol --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071235000 -->
| Q405472 <!-- Sagbayan, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071236000 -->
| Q259298 <!-- San Isidro, Bohol --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071237000 -->
| Q405544 <!-- San Miguel, Bohol --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071238000 -->
| Q386388 <!-- Sevilla, Bohol --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071239000 -->
| Q405628 <!-- Sierra Bullones, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071240000 -->
| Q405674 <!-- Sikatuna, Bohol --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071241000 -->
| Q1826 <!-- Tagbilaran, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071242000 -->
| Q405714 <!-- Talibon, Bohol --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071243000 -->
| Q405749 <!-- Trinidad, Bohol --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071244000 -->
| Q405980 <!-- Tubigon, Bohol --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071245000 -->
| Q406015 <!-- Ubay, Bohol --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071246000 -->
| Q406046 <!-- Valencia, Bohol --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071247000 -->
| Q315636 <!-- Alcantara, Cebu --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072201000 -->
| Q315655 <!-- Alcoy, Cebu --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072202000 -->
| Q315669 <!-- Alegria, Cebu --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072203000 -->
| Q315687 <!-- Aloguinsan, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072204000 -->
| Q315703 <!-- Argao, Cebu --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072205000 -->
| Q315719 <!-- Asturias, Cebu --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072206000 -->
| Q315733 <!-- Badian, Cebu --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072207000 -->
| Q315754 <!-- Balamban, Cebu --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072208000 -->
| Q315771 <!-- Bantayan, Cebu --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072209000 -->
| Q315790 <!-- Barili, Cebu --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072210000 -->
| Q890623 <!-- Bogo, Cebu --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072211000 -->
| Q315809 <!-- Boljoon, Cebu --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072212000 -->
| Q315827 <!-- Borbon, Cebu --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072213000 -->
| Q315851 <!-- Carcar, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072214000 -->
| Q315882 <!-- Carmen, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072215000 -->
| Q315900 <!-- Catmon, Cebu --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072216000 -->
| Q1467 <!-- Cebu --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072217000 -->
| Q315923 <!-- Compostela, Cebu --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072218000 -->
| Q315945 <!-- Consolacion, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072219000 -->
| Q315965 <!-- Cordova, Cebu --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072220000 -->
| Q315981 <!-- Daanbantayan, Cebu --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072221000 -->
| Q316001 <!-- Dalaguete, Cebu --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072222000 -->
| Q1159273 <!-- Danao, Cebu --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072223000 -->
| Q316019 <!-- Dumanjug, Cebu --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072224000 -->
| Q316037 <!-- Ginatilan, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072225000 -->
| Q574903 <!-- Lapu-Lapu --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072226000 -->
| Q316056 <!-- Liloan, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072227000 -->
| Q316080 <!-- Madridejos, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072228000 -->
| Q316101 <!-- Malabuyoc, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072229000 -->
| Q1889017 <!-- Mandaue --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072230000 -->
| Q316125 <!-- Medellin, Cebu --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072231000 -->
| Q316146 <!-- Minglanilla, Cebu --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072232000 -->
| Q316171 <!-- Moalboal, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072233000 -->
| Q316197 <!-- Naga, Cebu --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072234000 -->
| Q316230 <!-- Oslob, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072235000 -->
| Q316245 <!-- Pilar, Cebu --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072236000 -->
| Q316259 <!-- Pinamungahan, Cebu --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072237000 -->
| Q316275 <!-- Poro, Cebu --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072238000 -->
| Q316289 <!-- Ronda, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072239000 -->
| Q316303 <!-- Samboan, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072240000 -->
| Q316318 <!-- San Fernando, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072241000 -->
| Q316332 <!-- San Francisco, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072242000 -->
| Q316350 <!-- San Remigio, Cebu --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072243000 -->
| Q316370 <!-- Santa Fe, Cebu --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072244000 -->
| Q316386 <!-- Santander, Cebu --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072245000 -->
| Q316404 <!-- Sibonga, Cebu --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072246000 -->
| Q316432 <!-- Sogod, Cebu --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072247000 -->
| Q316453 <!-- Tabogon, Cebu --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072248000 -->
| Q316474 <!-- Tabuelan, Cebu --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072249000 -->
| Q316500 <!-- Talisay, Cebu --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072250000 -->
| Q316527 <!-- Toledo, Cebu --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072251000 -->
| Q316547 <!-- Tuburan, Cebu --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072252000 -->
| Q316564 <!-- Tudela, Cebu --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072253000 -->
| Q174305 <!-- Enrique Villanueva, Siquijor --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076101000 -->
| Q174317 <!-- Larena, Siquijor --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076102000 -->
| Q174332 <!-- Lazi, Siquijor --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076103000 -->
| Q174343 <!-- Maria, Siquijor --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076104000 -->
| Q174354 <!-- San Juan, Siquijor --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076105000 -->
| Q174373 <!-- Siquijor, Siquijor --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076106000 -->
| Q406163 <!-- Almeria, Biliran --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087801000 -->
| Q406186 <!-- Biliran, Biliran --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087802000 -->
| Q406226 <!-- Cabucgayan, Biliran --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087803000 -->
| Q406267 <!-- Caibiran, Biliran --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087804000 -->
| Q406317 <!-- Culaba, Biliran --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087805000 -->
| Q406353 <!-- Kawayan, Biliran --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087806000 -->
| Q406393 <!-- Maripipi, Biliran --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087807000 -->
| Q277211 <!-- Naval, Biliran --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087808000 -->
| Q313880 <!-- Arteche, Eastern Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082601000 -->
| Q313904 <!-- Balangiga, Eastern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082602000 -->
| Q313914 <!-- Balangkayan, Eastern Samar --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082603000 -->
| Q894059 <!-- Borongan, Eastern Samar --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082604000 -->
| Q313926 <!-- Can-avid, Eastern Samar --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082605000 -->
| Q313939 <!-- Dolores, Eastern Samar --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082606000 -->
| Q313951 <!-- General MacArthur, Eastern Samar --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082607000 -->
| Q313967 <!-- Giporlos, Eastern Samar --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082608000 -->
| Q313984 <!-- Guiuan, Eastern Samar --> = 60 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082609000 -->
| Q314002 <!-- Hernani, Eastern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082610000 -->
| Q314021 <!-- Jipapad, Eastern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082611000 -->
| Q314046 <!-- Lawaan, Eastern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082612000 -->
| Q314070 <!-- Llorente, Eastern Samar --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082613000 -->
| Q314096 <!-- Maslog, Eastern Samar --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082614000 -->
| Q314117 <!-- Maydolong, Eastern Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082615000 -->
| Q314129 <!-- Mercedes, Eastern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082616000 -->
| Q314154 <!-- Oras, Eastern Samar --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082617000 -->
| Q314175 <!-- Quinapondan, Eastern Samar --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082618000 -->
| Q314197 <!-- Salcedo, Eastern Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082619000 -->
| Q314220 <!-- San Julian, Eastern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082620000 -->
| Q314239 <!-- San Policarpo, Eastern Samar --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082621000 -->
| Q314257 <!-- Sulat, Eastern Samar --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082622000 -->
| Q205677 <!-- Taft, Eastern Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082623000 -->
| Q212877 <!-- Abuyog, Leyte --> = 63 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083701000 -->
| Q212888 <!-- Alangalang, Leyte --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083702000 -->
| Q212896 <!-- Albuera, Leyte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083703000 -->
| Q212907 <!-- Babatngon, Leyte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083705000 -->
| Q212924 <!-- Barugo, Leyte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083706000 -->
| Q212935 <!-- Bato, Leyte --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083707000 -->
| Q812117 <!-- Baybay, Leyte --> = 92 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083708000 -->
| Q212945 <!-- Burauen, Leyte --> = 77 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083710000 -->
| Q212951 <!-- Calubian, Leyte --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083713000 -->
| Q212958 <!-- Capoocan, Leyte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083714000 -->
| Q212969 <!-- Carigara, Leyte --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083715000 -->
| Q212981 <!-- Dagami, Leyte --> = 65 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083717000 -->
| Q212988 <!-- Dulag, Leyte --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083718000 -->
| Q213006 <!-- Hilongos, Leyte --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083719000 -->
| Q213024 <!-- Hindang, Leyte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083720000 -->
| Q213042 <!-- Inopacan, Leyte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083721000 -->
| Q213060 <!-- Isabel, Leyte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083722000 -->
| Q213086 <!-- Jaro, Leyte --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083723000 -->
| Q213101 <!-- Javier, Leyte --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083724000 -->
| Q213113 <!-- Julita, Leyte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083725000 -->
| Q213130 <!-- Kananga, Leyte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083726000 -->
| Q213144 <!-- La Paz, Leyte --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083728000 -->
| Q213160 <!-- Leyte, Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083729000 -->
| Q213174 <!-- MacArthur, Leyte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083730000 -->
| Q213190 <!-- Mahaplag, Leyte --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083731000 -->
| Q213209 <!-- Matag-ob, Leyte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083733000 -->
| Q213227 <!-- Matalom, Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083734000 -->
| Q213245 <!-- Mayorga, Leyte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083735000 -->
| Q213261 <!-- Merida, Leyte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083736000 -->
| Q1014782 <!-- Ormoc --> = 85 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083738000 -->
| Q213281 <!-- Palo, Leyte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083739000 -->
| Q213303 <!-- Palompon, Leyte --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083740000 -->
| Q213323 <!-- Pastrana, Leyte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083741000 -->
| Q213341 <!-- San Isidro, Leyte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083742000 -->
| Q213357 <!-- San Miguel, Leyte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083743000 -->
| Q213378 <!-- Santa Fe, Leyte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083744000 -->
| Q213400 <!-- Tabango, Leyte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083745000 -->
| Q213420 <!-- Tabontabon, Leyte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083746000 -->
| Q40626 <!-- Tacloban --> = 138 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083747000 -->
| Q213431 <!-- Tanauan, Leyte --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083748000 -->
| Q213442 <!-- Tolosa, Leyte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083749000 -->
| Q213455 <!-- Tunga, Leyte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083750000 -->
| Q213463 <!-- Villaba, Leyte --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083751000 -->
| Q174784 <!-- Allen, Northern Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084801000 -->
| Q174801 <!-- Biri, Northern Samar --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084802000 -->
| Q174822 <!-- Bobon, Northern Samar --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084803000 -->
| Q174871 <!-- Capul, Northern Samar --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084804000 -->
| Q174886 <!-- Catarman , Northern Samar --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084805000 -->
| Q174906 <!-- Catubig, Northern Samar --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084806000 -->
| Q174919 <!-- Gamay, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084807000 -->
| Q174940 <!-- Laoang, Northern Samar --> = 56 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084808000 -->
| Q174962 <!-- Lapinig, Northern Samar --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084809000 -->
| Q174987 <!-- Las Navas, Northern Samar --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084810000 -->
| Q175008 <!-- Lavezares, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084811000 -->
| Q175031 <!-- Lope de Vega, Northern Samar --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084824000 -->
| Q175054 <!-- Mapanas, Northern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084812000 -->
| Q175082 <!-- Mondragon, Northern Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084813000 -->
| Q175100 <!-- Palapag, Northern Samar --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084814000 -->
| Q175115 <!-- Pambujan, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084815000 -->
| Q175136 <!-- Rosario, Northern Samar --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084816000 -->
| Q175163 <!-- San Antonio, Northern Samar --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084817000 -->
| Q175183 <!-- San Isidro, Northern Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084818000 -->
| Q175203 <!-- San Jose, Northern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084819000 -->
| Q175230 <!-- San Roque, Northern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084820000 -->
| Q175247 <!-- San Vicente, Northern Samar --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084821000 -->
| Q175267 <!-- Silvino Lobos, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084822000 -->
| Q175283 <!-- Victoria, Northern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084823000 -->
| Q816088 <!-- Almagro, Samar --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086001000 -->
| Q809957 <!-- Basey, Samar --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086002000 -->
| Q577336 <!-- Calbayog, Samar --> = 157 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086003000 -->
| Q816128 <!-- Calbiga, Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086004000 -->
| Q1020709 <!-- Catbalogan, Samar --> = 57 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086005000 -->
| Q816142 <!-- Daram, Samar --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086006000 -->
| Q816160 <!-- Gandara, Samar --> = 69 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086007000 -->
| Q816184 <!-- Hinabangan, Samar --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086008000 -->
| Q816207 <!-- Jiabong, Samar --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086009000 -->
| Q816240 <!-- Marabut, Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086010000 -->
| Q816267 <!-- Matuguinao, Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086011000 -->
| Q816296 <!-- Motiong, Samar --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086012000 -->
| Q816320 <!-- Pagsanghan, Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086026000 -->
| Q816342 <!-- Paranas, Samar --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086022000 -->
| Q252184 <!-- Pinabacdao, Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086013000 -->
| Q816396 <!-- San Jorge, Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086025000 -->
| Q816413 <!-- San Jose de Buan, Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086014000 -->
| Q816435 <!-- San Sebastian, Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086015000 -->
| Q816454 <!-- Santa Margarita, Samar --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086016000 -->
| Q816471 <!-- Santa Rita, Samar --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086017000 -->
| Q608320 <!-- Santo Niño, Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086018000 -->
| Q126346 <!-- Tagapul-an, Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086024000 -->
| Q816519 <!-- Talalora, Samar --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086019000 -->
| Q816542 <!-- Tarangnan, Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086020000 -->
| Q816564 <!-- Villareal, Samar --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086021000 -->
| Q229664 <!-- Zumarraga, Samar --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086023000 -->
| Q173608 <!-- Anahawan, Southern Leyte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086401000 -->
| Q173622 <!-- Bontoc, Southern Leyte --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086402000 -->
| Q173632 <!-- Hinunangan, Southern Leyte --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086403000 -->
| Q173641 <!-- Hinundayan, Southern Leyte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086404000 -->
| Q173655 <!-- Libagon, Southern Leyte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086405000 -->
| Q173665 <!-- Liloan, Southern Leyte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086406000 -->
| Q173678 <!-- Limasawa, Southern Leyte --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086419000 -->
| Q1025387 <!-- Maasin, Southern Leyte --> = 70 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086407000 -->
| Q173688 <!-- Macrohon, Southern Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086408000 -->
| Q173701 <!-- Malitbog, Southern Leyte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086409000 -->
| Q173713 <!-- Padre Burgos, Southern Leyte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086410000 -->
| Q173723 <!-- Pintuyan, Southern Leyte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086411000 -->
| Q173735 <!-- Saint Bernard, Southern Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086412000 -->
| Q173745 <!-- San Francisco, Southern Leyte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086413000 -->
| Q173754 <!-- San Juan, Southern Leyte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086414000 -->
| Q173763 <!-- San Ricardo, Southern Leyte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086415000 -->
| Q173774 <!-- Silago, Southern Leyte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086416000 -->
| Q173792 <!-- Sogod, Southern Leyte --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086417000 -->
| Q173811 <!-- Tomas Oppus, Southern Leyte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086418000 -->
| Q132482 <!-- Baliguian, Zamboanga del Norte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097224000 -->
| Q1014775 <!-- Dapitan, Zamboanga del Norte --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097201000 -->
| Q432169 <!-- Dipolog, Zamboanga del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097202000 -->
| Q132496 <!-- Godod, Zamboanga del Norte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097225000 -->
| Q132507 <!-- Gutalac, Zamboanga del Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097223000 -->
| Q132520 <!-- Jose Dalman, Zamboanga del Norte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097222000 -->
| Q132523 <!-- Kalawit, Zamboanga del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097227000 -->
| Q132527 <!-- Katipunan, Zamboanga del Norte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097203000 -->
| Q132532 <!-- La Libertad, Zamboanga del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097204000 -->
| Q132535 <!-- Labason, Zamboanga del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097205000 -->
| Q132540 <!-- Leon B. Postigo, Zamboanga del Norte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097226000 -->
| Q132553 <!-- Liloy, Zamboanga del Norte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097206000 -->
| Q132561 <!-- Manukan, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097207000 -->
| Q132566 <!-- Mutia, Zamboanga del Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097208000 -->
| Q132570 <!-- Piñan, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097209000 -->
| Q132574 <!-- Polanco, Zamboanga del Norte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097210000 -->
| Q132578 <!-- President Manuel A. Roxas, Zamboanga del Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097211000 -->
| Q132583 <!-- Rizal, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097212000 -->
| Q132586 <!-- Salug, Zamboanga del Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097213000 -->
| Q132591 <!-- Sergio Osmeña Sr., Zamboanga del Norte --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097214000 -->
| Q132594 <!-- Siayan, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097215000 -->
| Q132599 <!-- Sibuco, Zamboanga del Norte --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097216000 -->
| Q132601 <!-- Sibutad, Zamboanga del Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097217000 -->
| Q132605 <!-- Sindangan, Zamboanga del Norte --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097218000 -->
| Q132610 <!-- Siocon, Zamboanga del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097219000 -->
| Q132613 <!-- Sirawai, Zamboanga del Norte --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097220000 -->
| Q132617 <!-- Tampilisan, Zamboanga del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097221000 -->
| Q132015 <!-- Aurora, Zamboanga del Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097302000 -->
| Q132032 <!-- Bayog, Zamboanga del Sur --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097303000 -->
| Q132057 <!-- Dimataling, Zamboanga del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097305000 -->
| Q132077 <!-- Dinas, Zamboanga del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097306000 -->
| Q132104 <!-- Dumalinao, Zamboanga del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097307000 -->
| Q132126 <!-- Dumingag, Zamboanga del Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097308000 -->
| Q132141 <!-- Guipos, Zamboanga del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097343000 -->
| Q132155 <!-- Josefina, Zamboanga del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097337000 -->
| Q132161 <!-- Kumalarang, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097311000 -->
| Q132184 <!-- Labangan, Zamboanga del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097312000 -->
| Q132200 <!-- Lakewood, Zamboanga del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097333000 -->
| Q132215 <!-- Lapuyan, Zamboanga del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097313000 -->
| Q132230 <!-- Mahayag, Zamboanga del Sur --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097315000 -->
| Q132244 <!-- Margosatubig, Zamboanga del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097317000 -->
| Q132262 <!-- Midsalip, Zamboanga del Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097318000 -->
| Q132271 <!-- Molave, Zamboanga del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097319000 -->
| Q874270 <!-- Pagadian, Zamboanga del Sur --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097322000 -->
| Q132284 <!-- Pitogo, Zamboanga del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097338000 -->
| Q132301 <!-- Ramon Magsaysay, Zamboanga del Sur --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097323000 -->
| Q132317 <!-- San Miguel, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097324000 -->
| Q132337 <!-- San Pablo, Zamboanga del Sur --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097325000 -->
| Q132353 <!-- Sominot, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097340000 -->
| Q132371 <!-- Tabina, Zamboanga del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097327000 -->
| Q132391 <!-- Tambulig, Zamboanga del Sur --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097328000 -->
| Q132403 <!-- Tigbao, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097344000 -->
| Q132417 <!-- Tukuran, Zamboanga del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097330000 -->
| Q132432 <!-- Vincenzo A. Sagun, Zamboanga del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097341000 -->
| Q1629 <!-- Zamboanga --> = 98 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097332000 -->
| Q131797 <!-- Alicia, Zamboanga Sibugay --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098301000 -->
| Q131811 <!-- Buug, Zamboanga Sibugay --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098302000 -->
| Q131816 <!-- Diplahan, Zamboanga Sibugay --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098303000 -->
| Q131838 <!-- Imelda, Zamboanga Sibugay --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098304000 -->
| Q131850 <!-- Ipil, Zamboanga Sibugay --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098305000 -->
| Q131870 <!-- Kabasalan, Zamboanga Sibugay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098306000 -->
| Q131892 <!-- Mabuhay, Zamboanga Sibugay --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098307000 -->
| Q131906 <!-- Malangas, Zamboanga Sibugay --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098308000 -->
| Q131917 <!-- Naga, Zamboanga Sibugay --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098309000 -->
| Q131926 <!-- Olutanga, Zamboanga Sibugay --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098310000 -->
| Q131941 <!-- Payao, Zamboanga Sibugay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098311000 -->
| Q131954 <!-- Roseller Lim, Zamboanga Sibugay --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098312000 -->
| Q124780 <!-- Siay, Zamboanga Sibugay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098313000 -->
| Q131968 <!-- Talusan, Zamboanga Sibugay --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098314000 -->
| Q131975 <!-- Titay, Zamboanga Sibugay --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098315000 -->
| Q131984 <!-- Tungawan, Zamboanga Sibugay --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098316000 -->
| Q356943 <!-- Baungon, Bukidnon --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101301000 -->
| Q356971 <!-- Cabanglasan, Bukidnon --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101322000 -->
| Q356997 <!-- Damulog, Bukidnon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101302000 -->
| Q357021 <!-- Dangcagan, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101303000 -->
| Q357053 <!-- Don Carlos, Bukidnon --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101304000 -->
| Q357075 <!-- Impasug-ong, Bukidnon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101305000 -->
| Q357100 <!-- Kadingilan, Bukidnon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101306000 -->
| Q357124 <!-- Kalilangan, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101307000 -->
| Q357152 <!-- Kibawe, Bukidnon --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101308000 -->
| Q357175 <!-- Kitaotao, Bukidnon --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101309000 -->
| Q357198 <!-- Lantapan, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101310000 -->
| Q357226 <!-- Libona, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101311000 -->
| Q1856 <!-- Malaybalay, Bukidnon --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101312000 -->
| Q357252 <!-- Malitbog, Bukidnon --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101313000 -->
| Q357272 <!-- Manolo Fortich, Bukidnon --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101314000 -->
| Q357299 <!-- Maramag, Bukidnon --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101315000 -->
| Q357311 <!-- Pangantucan, Bukidnon --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101316000 -->
| Q357342 <!-- Quezon, Bukidnon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101317000 -->
| Q357371 <!-- San Fernando, Bukidnon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101318000 -->
| Q357396 <!-- Sumilao, Bukidnon --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101319000 -->
| Q357420 <!-- Talakag, Bukidnon --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101320000 -->
| Q2158 <!-- Valencia, Bukidnon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101321000 -->
| Q356442 <!-- Catarman, Camiguin --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101801000 -->
| Q356472 <!-- Guinsiliban, Camiguin --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101802000 -->
| Q176033 <!-- Mahinog, Camiguin --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101803000 -->
| Q356518 <!-- Mambajao, Camiguin --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101804000 -->
| Q356549 <!-- Sagay, Camiguin --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101805000 -->
| Q274150 <!-- Bacolod, Lanao del Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103501000 -->
| Q274164 <!-- Baloi, Lanao del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103502000 -->
| Q274173 <!-- Baroy, Lanao del Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103503000 -->
| Q285488 <!-- Iligan --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103504000 -->
| Q274186 <!-- Kapatagan, Lanao del Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103505000 -->
| Q274197 <!-- Kauswagan, Lanao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103507000 -->
| Q274205 <!-- Kolambugan, Lanao del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103508000 -->
| Q274215 <!-- Lala, Lanao del Norte --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103509000 -->
| Q274230 <!-- Linamon, Lanao del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103510000 -->
| Q274243 <!-- Magsaysay, Lanao del Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103511000 -->
| Q274260 <!-- Maigo, Lanao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103512000 -->
| Q274272 <!-- Matungao, Lanao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103513000 -->
| Q274287 <!-- Munai, Lanao del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103514000 -->
| Q274299 <!-- Nunungan, Lanao del Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103515000 -->
| Q274313 <!-- Pantao Ragat, Lanao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103516000 -->
| Q274329 <!-- Pantar, Lanao del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103523000 -->
| Q274343 <!-- Poona Piagapo, Lanao del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103517000 -->
| Q274357 <!-- Salvador, Lanao del Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103518000 -->
| Q274369 <!-- Sapad, Lanao del Norte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103519000 -->
| Q274387 <!-- Sultan Naga Dimaporo, Lanao del Norte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103506000 -->
| Q274406 <!-- Tagoloan, Lanao del Norte --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103520000 -->
| Q274427 <!-- Tangcal, Lanao del Norte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103521000 -->
| Q274439 <!-- Tubod, Lanao del Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103522000 -->
| Q155502 <!-- Aloran, Misamis Occidental --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104201000 -->
| Q196056 <!-- Baliangao, Misamis Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104202000 -->
| Q196076 <!-- Bonifacio, Misamis Occidental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104203000 -->
| Q196097 <!-- Calamba, Misamis Occidental --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104204000 -->
| Q196114 <!-- Clarin, Misamis Occidental --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104205000 -->
| Q196129 <!-- Concepcion, Misamis Occidental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104206000 -->
| Q196145 <!-- Don Victoriano Chiongbian, Misamis Occidental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104217000 -->
| Q196158 <!-- Jimenez, Misamis Occidental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104207000 -->
| Q196173 <!-- Lopez Jaena, Misamis Occidental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104208000 -->
| Q1067897 <!-- Oroquieta, Misamis Occidental --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104209000 -->
| Q263837 <!-- Ozamiz, Misamis Occidental --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104210000 -->
| Q196191 <!-- Panaon, Misamis Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104211000 -->
| Q196207 <!-- Plaridel, Misamis Occidental --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104212000 -->
| Q196222 <!-- Sapang Dalaga, Misamis Occidental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104213000 -->
| Q196233 <!-- Sinacaban, Misamis Occidental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104214000 -->
| Q1026277 <!-- Tangub, Misamis Occidental --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104215000 -->
| Q196248 <!-- Tudela, Misamis Occidental --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104216000 -->
| Q195623 <!-- Alubijid, Misamis Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/104300000 -->
| Q195637 <!-- Balingasag, Misamis Oriental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104302000 -->
| Q195650 <!-- Balingoan, Misamis Oriental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104303000 -->
| Q195663 <!-- Binuangan, Misamis Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104304000 -->
| Q1645 <!-- Cagayan de Oro --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104305000 -->
| Q195676 <!-- Claveria, Misamis Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104306000 -->
| Q195686 <!-- El Salvador, Misamis Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104307000 -->
| Q1525029 <!-- Gingoog, Misamis Oriental --> = 79 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104308000 -->
| Q195696 <!-- Gitagum, Misamis Oriental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104309000 -->
| Q195709 <!-- Initao, Misamis Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104310000 -->
| Q195717 <!-- Jasaan, Misamis Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104311000 -->
| Q195726 <!-- Kinoguitan, Misamis Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104312000 -->
| Q195740 <!-- Lagonglong, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104313000 -->
| Q195755 <!-- Laguindingan, Misamis Oriental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104314000 -->
| Q195767 <!-- Libertad, Misamis Oriental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104315000 -->
| Q195780 <!-- Lugait, Misamis Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104316000 -->
| Q195799 <!-- Magsaysay, Misamis Oriental --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104318000 -->
| Q195815 <!-- Manticao, Misamis Oriental --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104317000 -->
| Q195834 <!-- Medina, Misamis Oriental --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104319000 -->
| Q195855 <!-- Naawan, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104320000 -->
| Q195870 <!-- Opol, Misamis Oriental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104321000 -->
| Q195883 <!-- Salay, Misamis Oriental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104322000 -->
| Q195899 <!-- Sugbongcogon, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104323000 -->
| Q1026274 <!-- Tagoloan, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104324000 -->
| Q195917 <!-- Talisayan, Misamis Oriental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104325000 -->
| Q195937 <!-- Villanueva, Misamis Oriental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104326000 -->
| Q627390 <!-- Buenavista, Agusan del Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160201000 -->
| Q1686 <!-- Butuan --> = 86 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160202000 -->
| Q1692 <!-- Cabadbaran, Agusan del Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160203000 -->
| Q627434 <!-- Carmen, Agusan del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160204000 -->
| Q627461 <!-- Jabonga, Agusan del Norte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160205000 -->
| Q627495 <!-- Kitcharao, Agusan del Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160206000 -->
| Q627529 <!-- Las Nieves, Agusan del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160207000 -->
| Q627572 <!-- Magallanes, Agusan del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160208000 -->
| Q627604 <!-- Nasipit, Agusan del Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160209000 -->
| Q627638 <!-- Remedios T. Romualdez, Agusan del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160212000 -->
| Q588955 <!-- Santiago, Agusan del Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160210000 -->
| Q176975 <!-- Tubay, Agusan del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160211000 -->
| Q1694 <!-- Bayugan, Agusan del Sur --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160301000 -->
| Q627049 <!-- Bunawan, Agusan del Sur --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160302000 -->
| Q627077 <!-- Esperanza, Agusan del Sur --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160303000 -->
| Q627107 <!-- La Paz, Agusan del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160304000 -->
| Q627120 <!-- Loreto, Agusan del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160305000 -->
| Q627144 <!-- Prosperidad, Agusan del Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160306000 -->
| Q627167 <!-- Rosario, Agusan del Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160307000 -->
| Q627190 <!-- San Francisco, Agusan del Sur --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160308000 -->
| Q627210 <!-- San Luis, Agusan del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160309000 -->
| Q627231 <!-- Santa Josefa, Agusan del Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160310000 -->
| Q627260 <!-- Sibagat, Agusan del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160314000 -->
| Q627286 <!-- Talacogon, Agusan del Sur --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160311000 -->
| Q627320 <!-- Trento, Agusan del Sur --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160312000 -->
| Q627349 <!-- Veruela, Agusan del Sur --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160313000 -->
| Q314298 <!-- Basilisa, Dinagat Islands --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168501000 -->
| Q314318 <!-- Cagdianao, Dinagat Islands --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168502000 -->
| Q314336 <!-- Dinagat, Dinagat Islands --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168503000 -->
| Q314345 <!-- Libjo, Dinagat Islands --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168504000 -->
| Q314356 <!-- Loreto, Dinagat Islands --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168505000 -->
| Q251691 <!-- San Jose, Dinagat Islands --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168506000 -->
| Q314374 <!-- Tubajon, Dinagat Islands --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168507000 -->
| Q155706 <!-- Alegria, Surigao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166701000 -->
| Q155720 <!-- Bacuag, Surigao del Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166702000 -->
| Q155735 <!-- Burgos, Surigao del Norte --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166704000 -->
| Q155748 <!-- Claver, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166706000 -->
| Q155763 <!-- Dapa, Surigao del Norte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166707000 -->
| Q28735 <!-- Del Carmen, Surigao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166708000 -->
| Q155784 <!-- General Luna, Surigao del Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166710000 -->
| Q155795 <!-- Gigaquit, Surigao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166711000 -->
| Q155808 <!-- Mainit, Surigao del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166714000 -->
| Q155819 <!-- Malimono, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166715000 -->
| Q155830 <!-- Pilar, Surigao del Norte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166716000 -->
| Q155839 <!-- Placer, Surigao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166717000 -->
| Q155849 <!-- San Benito, Surigao del Norte --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166718000 -->
| Q155864 <!-- San Francisco , Surigao del Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166719000 -->
| Q155876 <!-- San Isidro, Surigao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166720000 -->
| Q28958 <!-- Santa Monica , Surigao del Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166721000 -->
| Q155905 <!-- Sison, Surigao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166722000 -->
| Q155917 <!-- Socorro, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166723000 -->
| Q1019949 <!-- Surigao, Surigao del Norte --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166724000 -->
| Q155934 <!-- Tagana-an, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166725000 -->
| Q155946 <!-- Tubod, Surigao del Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166727000 -->
| Q155471 <!-- Barobo, Surigao del Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166801000 -->
| Q155499 <!-- Bayabas, Surigao del Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166802000 -->
| Q866414 <!-- Bislig, Surigao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166803000 -->
| Q155524 <!-- Cagwait, Surigao del Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166804000 -->
| Q155536 <!-- Cantilan, Surigao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166805000 -->
| Q155548 <!-- Carmen, Surigao del Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166806000 -->
| Q155558 <!-- Carrascal, Surigao del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166807000 -->
| Q155568 <!-- Cortes, Surigao del Sur --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166808000 -->
| Q155576 <!-- Hinatuan, Surigao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166809000 -->
| Q155582 <!-- Lanuza, Surigao del Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166810000 -->
| Q155590 <!-- Lianga, Surigao del Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166811000 -->
| Q155598 <!-- Lingig, Surigao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166812000 -->
| Q155605 <!-- Madrid, Surigao del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166813000 -->
| Q155611 <!-- Marihatag, Surigao del Sur --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166814000 -->
| Q155618 <!-- San Agustin, Surigao del Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166815000 -->
| Q155625 <!-- San Miguel, Surigao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166816000 -->
| Q155633 <!-- Tagbina, Surigao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166817000 -->
| Q155648 <!-- Tago, Surigao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166818000 -->
| Q155674 <!-- Tandag, Surigao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166819000 -->
| Q315450 <!-- Compostela, Davao de Oro --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118201000 -->
| Q315468 <!-- Laak, Davao de Oro --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118202000 -->
| Q187225 <!-- Mabini, Davao de Oro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118203000 -->
| Q315497 <!-- Maco, Davao de Oro --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118204000 -->
| Q315512 <!-- Maragusan, Davao de Oro --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118205000 -->
| Q315524 <!-- Mawab, Davao de Oro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118206000 -->
| Q315543 <!-- Monkayo, Davao de Oro --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118207000 -->
| Q315557 <!-- Montevista, Davao de Oro --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118208000 -->
| Q315570 <!-- Nabunturan, Davao de Oro --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118209000 -->
| Q315582 <!-- New Bataan, Davao de Oro --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118210000 -->
| Q315598 <!-- Pantukan, Davao de Oro --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118211000 -->
| Q314393 <!-- Asuncion, Davao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112301000 -->
| Q314410 <!-- Braulio E. Dujali, Davao del Norte --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112323000 -->
| Q314422 <!-- Carmen, Davao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112303000 -->
| Q314438 <!-- Kapalong, Davao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112305000 -->
| Q314452 <!-- New Corella, Davao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112314000 -->
| Q967367 <!-- Panabo, Davao del Norte --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112315000 -->
| Q1020674 <!-- Samal, Davao del Norte --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112317000 -->
| Q314468 <!-- San Isidro, Davao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112324000 -->
| Q314486 <!-- Santo Tomas, Davao del Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112318000 -->
| Q725168 <!-- Tagum, Davao del Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112319000 -->
| Q314501 <!-- Talaingod, Davao del Norte --> = 3 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112322000 -->
| Q314778 <!-- Bansalan, Davao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112401000 -->
| Q1473 <!-- Davao --> = 182 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112402000 -->
| Q1020939 <!-- Digos, Davao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112403000 -->
| Q314808 <!-- Hagonoy, Davao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112404000 -->
| Q314844 <!-- Kiblawan, Davao del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112406000 -->
| Q314864 <!-- Magsaysay, Davao del Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112407000 -->
| Q314885 <!-- Malalag, Davao del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112408000 -->
| Q314923 <!-- Matanao, Davao del Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112410000 -->
| Q314944 <!-- Padada, Davao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112411000 -->
| Q314965 <!-- Santa Cruz, Davao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112412000 -->
| Q315014 <!-- Sulop, Davao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112414000 -->
| Q314796 <!-- Don Marcelino, Davao Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118601000 -->
| Q314824 <!-- Jose Abad Santos, Davao Occidental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118602000 -->
| Q314907 <!-- Malita, Davao Occidental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118603000 -->
| Q314980 <!-- Santa Maria, Davao Occidental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118604000 -->
| Q314999 <!-- Sarangani, Davao Occidental --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118605000 -->
| Q314522 <!-- Baganga, Davao Oriental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112501000 -->
| Q314542 <!-- Banaybanay, Davao Oriental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112502000 -->
| Q314574 <!-- Boston, Davao Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112503000 -->
| Q314593 <!-- Caraga, Davao Oriental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112504000 -->
| Q314619 <!-- Cateel, Davao Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112505000 -->
| Q314632 <!-- Governor Generoso, Davao Oriental --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112506000 -->
| Q314653 <!-- Lupon, Davao Oriental --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112507000 -->
| Q314671 <!-- Manay, Davao Oriental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112508000 -->
| Q314686 <!-- Mati, Davao Oriental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112505000 -->
| Q314721 <!-- San Isidro, Davao Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112510000 -->
| Q314745 <!-- Tarragona, Davao Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112511000 -->
| Q315042 <!-- Alamada, Cotabato --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124701000 -->
| Q315061 <!-- Aleosan, Cotabato --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124717000 -->
| Q315081 <!-- Antipas, Cotabato --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124715000 -->
| Q315098 <!-- Arakan, Cotabato --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124718000 -->
| Q315121 <!-- Banisilan, Cotabato --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124716000 -->
| Q315144 <!-- Carmen, Cotabato --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124702000 -->
| Q315164 <!-- Kabacan, Cotabato --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124703000 -->
| Q583137 <!-- Kidapawan, Cotabato --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124704000 -->
| Q315190 <!-- Libungan, Cotabato --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124705000 -->
| Q267975 <!-- Magpet, Cotabato --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124706000 -->
| Q315244 <!-- Makilala, Cotabato --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124707000 -->
| Q315267 <!-- Matalam, Cotabato --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124708000 -->
| Q315283 <!-- Midsayap, Cotabato --> = 57 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124709000 -->
| Q315213 <!-- M'lang, Cotabato --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124710000 -->
| Q304654 <!-- Pigkawayan, Cotabato --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124711000 -->
| Q315314 <!-- Pikit, Cotabato --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124712000 -->
| Q315334 <!-- President Roxas, Cotabato --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124713000 -->
| Q315345 <!-- Tulunan, Cotabato --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124714000 -->
| Q174393 <!-- Alabel, Sarangani --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128001000 -->
| Q174403 <!-- Glan, Sarangani --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128002000 -->
| Q174417 <!-- Kiamba, Sarangani --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128003000 -->
| Q174429 <!-- Maasim, Sarangani --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128004000 -->
| Q174442 <!-- Maitum, Sarangani --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128005000 -->
| Q174457 <!-- Malapatan, Sarangani --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128006000 -->
| Q174468 <!-- Malungon, Sarangani --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128007000 -->
| Q173870 <!-- Banga, South Cotabato --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126302000 -->
| Q594275 <!-- General Santos --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126303000 -->
| Q542154 <!-- Koronadal, South Cotabato --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126306000 -->
| Q173898 <!-- Lake Sebu, South Cotabato --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126319000 -->
| Q173922 <!-- Norala, South Cotabato --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126311000 -->
| Q173944 <!-- Polomolok, South Cotabato --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126312000 -->
| Q173965 <!-- Santo Niño, South Cotabato --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126318000 -->
| Q173986 <!-- Surallah, South Cotabato --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126313000 -->
| Q174018 <!-- Tampakan, South Cotabato --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126314000 -->
| Q174039 <!-- Tantangan, South Cotabato --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126315000 -->
| Q174003 <!-- T'boli, South Cotabato --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126316000 -->
| Q174055 <!-- Tupi, South Cotabato --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126317000 -->
| Q173393 <!-- Bagumbayan, Sultan Kudarat --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126501000 -->
| Q173404 <!-- Columbio, Sultan Kudarat --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126502000 -->
| Q173414 <!-- Esperanza, Sultan Kudarat --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126503000 -->
| Q173428 <!-- Isulan, Sultan Kudarat --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126504000 -->
| Q173438 <!-- Kalamansig, Sultan Kudarat --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126505000 -->
| Q173449 <!-- Lambayong, Sultan Kudarat --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126508000 -->
| Q173460 <!-- Lebak, Sultan Kudarat --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126506000 -->
| Q173468 <!-- Lutayan, Sultan Kudarat --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126507000 -->
| Q173479 <!-- Palimbang, Sultan Kudarat --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126509000 -->
| Q137813 <!-- President Quirino, Sultan Kudarat --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126510000 -->
| Q173556 <!-- Senator Ninoy Aquino, Sultan Kudarat --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126512000 -->
| Q173575 <!-- Tacurong, Sultan Kudarat --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126511000 -->
| Q42589 <!-- Akbar, Basilan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150708000 -->
| Q41999 <!-- Al-Barka, Basilan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150709000 -->
| Q41998 <!-- Hadji Mohammad Ajul, Basilan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150710000 -->
| Q802075 <!-- Hadji Muhtamad, Basilan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150712000 -->
| Q1710 <!-- Isabela --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/099701000 -->
| Q1714 <!-- Lamitan, Basilan --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150702000 -->
| Q802107 <!-- Lantawan, Basilan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150703000 -->
| Q802142 <!-- Maluso, Basilan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150704000 -->
| Q802171 <!-- Sumisip, Basilan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150705000 -->
| Q802202 <!-- Tabuan-Lasa, Basilan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150713000 -->
| Q667595 <!-- Tipo-Tipo, Basilan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150706000 -->
| Q630096 <!-- Tuburan, Basilan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150707000 -->
| Q204771 <!-- Ungkaya Pukan, Basilan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150711000 -->
| Q273775 <!-- Amai Manabilang, Lanao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153637000 -->
| Q273657 <!-- Bacolod-Kalawi, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153601000 -->
| Q273680 <!-- Balabagan, Lanao del Sur --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153602000 -->
| Q273700 <!-- Balindong, Lanao del Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153603000 -->
| Q273718 <!-- Bayang, Lanao del Sur --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153604000 -->
| Q273728 <!-- Binidayan, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153605000 -->
| Q273744 <!-- Buadiposo-Buntong, Lanao del Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153633000 -->
| Q273757 <!-- Bubong, Lanao del Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153606000 -->
| Q273796 <!-- Butig, Lanao del Sur --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153607000 -->
| Q273813 <!-- Calanogas, Lanao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153632000 -->
| Q273828 <!-- Ditsaan-Ramain, Lanao del Sur --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153624000 -->
| Q273851 <!-- Ganassi, Lanao del Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153609000 -->
| Q273864 <!-- Kapai, Lanao del Sur --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153610000 -->
| Q273882 <!-- Kapatagan, Lanao del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153639000 -->
| Q273895 <!-- Lumba-Bayabao, Lanao del Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153611000 -->
| Q273906 <!-- Lumbaca-Unayan, Lanao del Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153641000 -->
| Q273915 <!-- Lumbatan, Lanao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153612000 -->
| Q273928 <!-- Lumbayanague, Lanao del Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153636000 -->
| Q273939 <!-- Madalum, Lanao del Sur --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153613000 -->
| Q273948 <!-- Madamba, Lanao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153614000 -->
| Q273960 <!-- Maguing, Lanao del Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153634000 -->
| Q273970 <!-- Malabang, Lanao del Sur --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153615000 -->
| Q273982 <!-- Marantao, Lanao del Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153616000 -->
| Q592338 <!-- Marawi, Lanao del Sur --> = 96 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153617000 -->
| Q273988 <!-- Marogong, Lanao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153631000 -->
| Q273998 <!-- Masiu, Lanao del Sur --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153618000 -->
| Q177004 <!-- Mulondo, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153619000 -->
| Q274015 <!-- Pagayawan, Lanao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153620000 -->
| Q274022 <!-- Piagapo, Lanao del Sur --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153621000 -->
| Q274031 <!-- Picong, Lanao del Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153635000 -->
| Q274037 <!-- Poona Bayabao, Lanao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153622000 -->
| Q274047 <!-- Pualas, Lanao del Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153623000 -->
| Q274057 <!-- Saguiaran, Lanao del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153625000 -->
| Q126297 <!-- Sultan Dumalondong, Lanao del Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153640000 -->
| Q274077 <!-- Tagoloan II, Lanao del Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153638000 -->
| Q274087 <!-- Tamparan, Lanao del Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153626000 -->
| Q274097 <!-- Taraka, Lanao del Sur --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153627000 -->
| Q274114 <!-- Tubaran, Lanao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153628000 -->
| Q274124 <!-- Tugaya, Lanao del Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153629000 -->
| Q274134 <!-- Wao, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153630000 -->
| Q212222 <!-- Ampatuan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153801000 -->
| Q212240 <!-- Barira, Maguindanao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153818000 -->
| Q212255 <!-- Buldon, Maguindanao --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153802000 -->
| Q212280 <!-- Buluan, Maguindanao --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153803000 -->
| Q726993 <!-- Cotabato --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/129804000 -->
| Q212310 <!-- Datu Abdullah Sangki, Maguindanao --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153828000 -->
| Q212336 <!-- Datu Anggal Midtimbang, Maguindanao --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153831000 -->
| Q212366 <!-- Datu Blah T. Sinsuat, Maguindanao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153830000 -->
| Q212389 <!-- Datu Hoffer Ampatuan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153835000 -->
| Q212411 <!-- Datu Montawal, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153822000 -->
| Q212432 <!-- Datu Odin Sinsuat, Maguindanao --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153807000 -->
| Q212463 <!-- Datu Paglas, Maguindanao --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153805000 -->
| Q212488 <!-- Datu Piang, Maguindanao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153806000 -->
| Q212503 <!-- Datu Salibo, Maguindanao --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153836000 -->
| Q212519 <!-- Datu Saudi-Ampatuan, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153826000 -->
| Q212537 <!-- Datu Unsay, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153827000 -->
| Q212557 <!-- General Salipada K. Pendatun, Maguindanao --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153819000 -->
| Q212581 <!-- Guindulungan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153825000 -->
| Q212603 <!-- Kabuntalan, Maguindanao --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153814000 -->
| Q212623 <!-- Mamasapano, Maguindanao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153820000 -->
| Q212644 <!-- Mangudadatu, Maguindanao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153820000 -->
| Q212662 <!-- Matanog, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153809000 -->
| Q212684 <!-- Northern Kabuntalan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153834000 -->
| Q212707 <!-- Pagalungan, Maguindanao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153810000 -->
| Q122827 <!-- Paglat, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153823000 -->
| Q212735 <!-- Pandag, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153833000 -->
| Q212748 <!-- Parang, Maguindanao --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153811000 -->
| Q212759 <!-- Rajah Buayan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153829000 -->
| Q212766 <!-- Shariff Aguak, Maguindanao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153808000 -->
| Q212778 <!-- Shariff Saydona Mustapha, Maguindanao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153837000 -->
| Q212784 <!-- South Upi, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153817000 -->
| Q212791 <!-- Sultan Kudarat, Maguindanao --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153812000 -->
| Q212802 <!-- Sultan Mastura, Maguindanao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153824000 -->
| Q212808 <!-- Sultan sa Barongis, Maguindanao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153813000 -->
| Q212830 <!-- Sultan Sumagka, Maguindanao --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153821000 -->
| Q212823 <!-- Talayan, Maguindanao --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153816000 -->
| Q212843 <!-- Upi, Maguindanao --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153815000 -->
| Q155970 <!-- Banguingui, Sulu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156615000 -->
| Q155983 <!-- Hadji Panglima Tahil, Sulu --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156606000 -->
| Q156008 <!-- Indanan, Sulu --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156601000 -->
| Q156024 <!-- Jolo, Sulu --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156602000 -->
| Q156042 <!-- Kalingalan Caluang, Sulu --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156603000 -->
| Q156055 <!-- Lugus, Sulu --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156617000 -->
| Q156071 <!-- Luuk, Sulu --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156604000 -->
| Q156090 <!-- Maimbung, Sulu --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156605000 -->
| Q156107 <!-- Old Panamao, Sulu --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156607000 -->
| Q156126 <!-- Omar, Sulu --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156619000 -->
| Q156159 <!-- Pandami, Sulu --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156618000 -->
| Q156180 <!-- Panglima Estino, Sulu --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156616000 -->
| Q156195 <!-- Pangutaran, Sulu --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156608000 -->
| Q156208 <!-- Parang, Sulu --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156609000 -->
| Q156225 <!-- Pata, Sulu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156610000 -->
| Q156244 <!-- Patikul, Sulu --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156611000 -->
| Q156263 <!-- Siasi, Sulu --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156612000 -->
| Q156285 <!-- Talipao, Sulu --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156613000 -->
| Q156302 <!-- Tapul, Sulu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156614000 -->
| Q155195 <!-- Bongao, Tawi-Tawi --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157002000 -->
| Q155221 <!-- Languyan, Tawi-Tawi --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157009000 -->
| Q155241 <!-- Mapun, Tawi-Tawi --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157003000 -->
| Q155259 <!-- Panglima Sugala, Tawi-Tawi --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157001000 -->
| Q155274 <!-- Sapa-Sapa, Tawi-Tawi --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157010000 -->
| Q155288 <!-- Sibutu, Tawi-Tawi --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157011000 -->
| Q155318 <!-- Simunul, Tawi-Tawi --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157004000 -->
| Q155334 <!-- Sitangkai, Tawi-Tawi --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157005000 -->
| Q155355 <!-- South Ubian, Tawi-Tawi --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157006000 -->
| Q155377 <!-- Tandubas, Tawi-Tawi --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157007000 -->
| Q155396 <!-- Turtle Islands, Tawi-Tawi --> = 2 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157008000 -->
{{{1|}}} {{main other|[[Category:Philippine articles requiring maintenance]]}}
}}
<noinclude>{{pp-template}}[[Category:Pilipinas]]</noinclude>
2cdtxl78mcnx996u9v1ekvrcvac2ro5
37019636
37019635
2026-05-01T16:04:08Z
Exec8
10305
Protected "[[Plantilya:PH Barangay count]]" ([Edit=I-block ang bag-o ug wala marehistrong gumagamit] (indefinite) [Move=Mga tagdumala lamang] (indefinite))
37019635
wikitext
text/x-wiki
<!-- This template is used as a switch to display count of barangays in a local administrative unit in the Philippines -->{{#switch: {{{1|}}}
| Q928 <!-- Philippines --> = 42020 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc -->
| Q2673519 <!-- Luzon, Philippines --> = 20492 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/luzon -->
| Q211436 <!-- Visayas, Philippines --> = 11444 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/visayas -->
| Q37274898 <!-- Mindanao, Philippines --> = 10084 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/mindanao -->
| Q13580 <!-- Metro Manila, National Capital Region --> = 1710 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/130000000 -->
| Q12933 <!-- Ilocos Region, Luzon --> = 3267 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/010000000 -->
| Q13615 <!-- Cagayan Valley, Luzon --> = 2311 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/020000000 -->
| Q13606 <!-- Cordillera Administrative Region, Luzon --> = 1178 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/140000000 -->
| Q13617 <!-- Central Luzon, Luzon --> = 3102 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/030000000 -->
| Q13650 <!-- Calabarzon, Luzon --> = 3993 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/040000000 -->
| Q13662 <!-- Bicol Region, Luzon --> = 3471 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/050000000 -->
| Q13658 <!-- Mimaropa, Luzon --> = 1460 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/170000000 -->
| Q13665 <!-- Western Visayas, Visayas --> = 4051 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/060000000 -->
| Q13669 <!-- Central Visayas, Visayas --> = 3003 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/070000000 -->
| Q13675 <!-- Eastern Visayas, Visayas --> = 4390 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/080000000 -->
| Q13682 <!-- Zamboanga Peninsula, Mindanao --> = 1904 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/090000000 -->
| Q13690 <!-- Northern Mindanao, Mindanao --> = 2022 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/100000000 -->
| Q13704 <!-- Caraga, Mindanao --> = 1311 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/160000000 -->
| Q13694 <!-- Davao Region, Mindanao --> = 1162 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/110000000 -->
| Q13701 <!-- Soccsksargen, Mindanao --> = 1195 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/120000000 -->
| Q24869612 <!-- Bangasmoro, Mindanao --> = 2490 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/150000000 -->
| Q13813 <!-- Ilocos Norte, Ilocos Region --> = 559 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/012800000 -->
| Q12741 <!-- Ilocos Sur, Ilocos Region --> = 768 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/012900000 -->
| Q13829 <!-- La Union, Ilocos Region --> = 576 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/013300000 -->
| Q13871 <!-- Pangasinan, Ilocos Region --> = 1364 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/015500000 -->
| Q13740 <!-- Batanes, Cagayan Valley --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/020900000 -->
| Q13759 <!-- Cagayan, Cagayan Valley --> = 820 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/021500000 -->
| Q13826 <!-- Isabela, Cagayan Valley --> = 1055 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/023100000 -->
| Q13866 <!-- Nueva Vizcaya, Cagayan Valley --> = 275 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/025000000 -->
| Q13873 <!-- Quirino, Cagayan Valley --> = 132 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/025700000 -->
| Q13711 <!-- Abra, Cordillera Administrative Region --> = 303 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/140100000 -->
| Q13728 <!-- Apayao, Cordillera Administrative Region --> = 133 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/148100000 -->
| Q13750 <!-- Benguet, Cordillera Administrative Region --> = 269 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/141100000 -->
| Q13812 <!-- Ifugao, Cordillera Administrative Region --> = 176 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/142700000 -->
| Q13827 <!-- Kalinga, Cordillera Administrative Region --> = 153 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/143200000 -->
| Q13861 <!-- Mountain Province, Cordillera Administrative Region --> = 133 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/144400000 -->
| Q13730 <!-- Aurora, Central Luzon --> = 151 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/037700000 -->
| Q13739 <!-- Bataan, Central Luzon --> = 237 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/030800000 -->
| Q13755 <!-- Bulacan, Central Luzon --> = 569 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/031400000 -->
| Q13865 <!-- Nueva Ecija, Central Luzon --> = 849 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/034900000 -->
| Q13870 <!-- Pampanga, Central Luzon --> = 538 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/035400000 -->
| Q13892 <!-- Tarlac, Central Luzon --> = 511 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/036900000 -->
| Q13895 <!-- Zambales, Central Luzon --> = 247 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/037100000 -->
| Q13744 <!-- Batangas, Calabarzon --> = 1078 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/041000000 -->
| Q13785 <!-- Cavite, Calabarzon --> = 803 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/042100000 -->
| Q13840 <!-- Laguna, Calabarzon --> = 681 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/043400000 -->
| Q13872 <!-- Quezon, Calabarzon --> = 1242 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/045600000 -->
| Q13874 <!-- Rizal, Calabarzon --> = 189 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/045800000 -->
| Q13726 <!-- Albay, Bicol Region --> = 720 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/050500000 -->
| Q13763 <!-- Camarines Norte, Bicol Region --> = 282 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/051600000 -->
| Q13767 <!-- Camarines Sur, Bicol Region --> = 1063 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/051700000 -->
| Q13778 <!-- Catanduanes, Bicol Region --> = 315 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/052000000 -->
| Q13847 <!-- Masbate, Bicol Region --> = 550 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/054100000 -->
| Q13881 <!-- Sorsogon, Bicol Region --> = 541 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/056200000 -->
| Q13846 <!-- Marinduque, Mimaropa --> = 218 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/174000000 -->
| Q13867 <!-- Occidental Mindoro, Mimaropa --> = 164 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/175100000 -->
| Q13868 <!-- Oriental Mindoro, Mimaropa --> = 426 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/175200000 -->
| Q13869 <!-- Palawan, Mimaropa --> = 433 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/175300000 -->
| Q13875 <!-- Romblon, Mimaropa --> = 219 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/060400000 -->
| Q13723 <!-- Aklan, Western Visayas --> = 327 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/060400000 -->
| Q13727 <!-- Antique, Western Visayas --> = 590 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/060600000 -->
| Q13772 <!-- Capiz, Western Visayas --> = 473 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/061900000 -->
| Q13810 <!-- Guimaras, Western Visayas --> = 98 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/067900000 -->
| Q13825 <!-- Iloilo, Western Visayas --> = 1901 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/063000000 -->
| Q13862 <!-- Negros Occidental, Western Visayas --> = 662 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/064500000 -->
| Q13752 <!-- Bohol, Central Visayas --> = 1109 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/071200000 -->
| Q13786 <!-- Cebu, Central Visayas --> = 1203 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/072200000 -->
| Q13863 <!-- Negros Oriental, Central Visayas --> = 557 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/074600000 -->
| Q13879 <!-- Siquijor, Central Visayas --> = 134 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/076100000 -->
| Q13751 <!-- Biliran, Eastern Visayas --> = 132 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/087800000 -->
| Q13809 <!-- Eastern Samar, Eastern Visayas --> = 597 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/082600000 -->
| Q13844 <!-- Leyte, Eastern Visayas --> = 1641 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/083700000 -->
| Q13864 <!-- Northern Samar, Eastern Visayas --> = 569 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/084800000 -->
| Q13876 <!-- Samar, Eastern Visayas --> = 951 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/086000000 -->
| Q13884 <!-- Southern Leyte, Eastern Visayas --> = 500 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/086400000 -->
| Q13899 <!-- Zamboanga del Norte, Zamboanga Peninsula --> = 691 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/097200000 -->
| Q13900 <!-- Zamboanga del Sur, Zamboanga Peninsula --> = 779 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/097300000 -->
| Q13902 <!-- Zamboanga Sibugay, Zamboanga Peninsula --> = 389 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/098300000 -->
| Q13753 <!-- Bukidnon, Northern Mindanao --> = 464 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/101300000 -->
| Q13769 <!-- Camiguin, Northern Mindanao --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/101800000 -->
| Q13841 <!-- Lanao del Norte, Northern Mindanao --> = 506 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/103500000 -->
| Q13857 <!-- Misamis Occidental, Northern Mindanao --> = 490 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/104200000 -->
| Q13860 <!-- Misamis Oriental, Northern Mindanao --> = 504 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/104300000 -->
| Q13714 <!-- Agusan del Norte, Caraga --> = 253 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/160200000 -->
| Q13721 <!-- Agusan del Sur, Caraga --> = 314 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/160300000 -->
| Q13807 <!-- Dinagat Islands, Caraga --> = 100 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/168500000 -->
| Q13889 <!-- Surigao del Norte, Caraga --> = 335 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/166700000 -->
| Q13891 <!-- Surigao del Sur, Caraga --> = 309 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/166800000 -->
| Q13789 <!-- Davao de Oro, Davao Region --> = 237 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/118200000 -->
| Q13792 <!-- Davao del Norte, Davao Region --> = 223 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/112300000 -->
| Q13794 <!-- Davao del Sur, Davao Region --> = 414 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/112400000 -->
| Q3656379 <!-- Davao Occidental, Davao Region --> = 105 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/118600000 -->
| Q13806 <!-- Davao Oriental, Davao Region --> = 183 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/112500000 -->
| Q13791 <!-- Cotabato, Soccsksargen --> = 543 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/124700000 -->
| Q13877 <!-- Sarangani, Soccsksargen --> = 141 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/128000000 -->
| Q13882 <!-- South Cotabato, Soccsksargen --> = 225 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/126300000 -->
| Q13885 <!-- Sultan Kudarat, Soccsksargen --> = 249 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/126500000 -->
| Q13737 <!-- Basilan, Bangasmoro --> = 210 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/150700000 -->
| Q13843 <!-- Lanao del Sur, Bangasmoro --> = 1159 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/153600000 -->
| Q13845 <!-- Maguindanao, Bangasmoro --> = 508 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/153800000 -->
| Q13887 <!-- Sulu, Bangasmoro --> = 410 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/156600000 -->
| Q13893 <!-- Tawi-Tawi, Bangasmoro --> = 203 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/157000000 -->
| Q1478 <!-- Caloocan --> = 188 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137501000 -->
| Q8854 <!-- Las Piñas --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137601000 -->
| Q1508 <!-- Makati --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137602000 -->
| Q8861 <!-- Malabon --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137502000 -->
| Q9085 <!-- Mandaluyong --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137401000 -->
| Q1461 <!-- Manila --> = 897 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/submuni/133900000 -->
| Q17175 <!-- Marikina --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137402000 -->
| Q17176 <!-- Muntinlupa --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137603000 -->
| Q17179 <!-- Navotas --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137503000 -->
| Q17182 <!-- Parañaque --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137604000 -->
| Q17189 <!-- Pasay --> = 201 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137605000 -->
| Q1624 <!-- Pasig --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137403000 -->
| Q1017325 <!-- Pateros, Metro Manila --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137606000 -->
| Q1475 <!-- Quezon City --> = 142 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137404000 -->
| Q749283 <!-- San Juan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137405000 -->
| Q1643 <!-- Taguig --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137607000 -->
| Q1623 <!-- Valenzuela --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/137504000 -->
| Q39241 <!-- Adams, Ilocos Norte --> = 1 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012801000 -->
| Q39271 <!-- Bacarra, Ilocos Norte --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012802000 -->
| Q39303 <!-- Badoc, Ilocos Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012803000 -->
| Q39326 <!-- Bangui, Ilocos Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012804000 -->
| Q39346 <!-- Banna, Ilocos Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012811000 -->
| Q39711 <!-- Batac, Ilocos Norte --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012805000 -->
| Q39368 <!-- Burgos, Ilocos Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012806000 -->
| Q39393 <!-- Carasi, Ilocos Norte --> = 3 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012807000 -->
| Q39416 <!-- Currimao, Ilocos Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012808000 -->
| Q39429 <!-- Dingras, Ilocos Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012809000 -->
| Q39511 <!-- Dumalneg, Ilocos Norte --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012810000 -->
| Q39738 <!-- Laoag, Ilocos Norte --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012812000 -->
| Q39523 <!-- Marcos, Ilocos Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012813000 -->
| Q39540 <!-- Nueva Era, Ilocos Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012814000 -->
| Q39559 <!-- Pagudpud, Ilocos Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012815000 -->
| Q39573 <!-- Paoay, Ilocos Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012816000 -->
| Q39591 <!-- Pasuquin, Ilocos Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012817000 -->
| Q39616 <!-- Piddig, Ilocos Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012818000 -->
| Q39629 <!-- Pinili, Ilocos Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012819000 -->
| Q39653 <!-- San Nicolas, Ilocos Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012820000 -->
| Q39673 <!-- Sarrat, Ilocos Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012821000 -->
| Q39677 <!-- Solsona, Ilocos Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012822000 -->
| Q39694 <!-- Vintar, Ilocos Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012823000 -->
| Q12813 <!-- Alilem, Ilocos Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012901000 -->
| Q12818 <!-- Banayoyo, Ilocos Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012902000 -->
| Q12825 <!-- Bantay, Ilocos Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012903000 -->
| Q12828 <!-- Burgos, Ilocos Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012904000 -->
| Q12832 <!-- Cabugao, Ilocos Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012905000 -->
| Q205956 <!-- Candon, Ilocos Sur --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012906000 -->
| Q12834 <!-- Caoayan, Ilocos Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012907000 -->
| Q12835 <!-- Cervantes, Ilocos Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012908000 -->
| Q12838 <!-- Galimuyod, Ilocos Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012909000 -->
| Q12840 <!-- Gregorio del Pilar, Ilocos Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012910000 -->
| Q12843 <!-- Lidlidda, Ilocos Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012911000 -->
| Q12845 <!-- Magsingal, Ilocos Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012912000 -->
| Q12848 <!-- Nagbukel, Ilocos Sur --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012913000 -->
| Q12850 <!-- Narvacan, Ilocos Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012914000 -->
| Q12853 <!-- Quirino, Ilocos Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012915000 -->
| Q12856 <!-- Salcedo, Ilocos Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012916000 -->
| Q12859 <!-- San Emilio, Ilocos Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012917000 -->
| Q12863 <!-- San Esteban, Ilocos Sur --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012918000 -->
| Q12864 <!-- San Ildefonso, Ilocos Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012919000 -->
| Q12867 <!-- San Juan, Ilocos Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012920000 -->
| Q12868 <!-- San Vicente, Ilocos Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012921000 -->
| Q12873 <!-- Santa, Ilocos Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012922000 -->
| Q12875 <!-- Santa Catalina, Ilocos Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012923000 -->
| Q12880 <!-- Santa Cruz, Ilocos Sur --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012924000 -->
| Q12882 <!-- Santa Lucia, Ilocos Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012925000 -->
| Q12692 <!-- Santa Maria, Ilocos Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012926000 -->
| Q12884 <!-- Santiago, Ilocos Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012927000 -->
| Q12885 <!-- Santo Domingo, Ilocos Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012928000 -->
| Q12888 <!-- Sigay, Ilocos Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012929000 -->
| Q12891 <!-- Sinait, Ilocos Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012930000 -->
| Q12893 <!-- Sugpon, Ilocos Sur --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012931000 -->
| Q12894 <!-- Suyo, Ilocos Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012932000 -->
| Q12895 <!-- Tagudin, Ilocos Sur --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012933000 -->
| Q235004 <!-- Vigan, Ilocos Sur --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/012934000 -->
| Q40168 <!-- Agoo, La Union --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013301000 -->
| Q40239 <!-- Aringay, La Union --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013302000 -->
| Q40259 <!-- Bacnotan, La Union --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013303000 -->
| Q40275 <!-- Bagulin, La Union --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013304000 -->
| Q40282 <!-- Balaoan, La Union --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013305000 -->
| Q40298 <!-- Bangar, La Union --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013306000 -->
| Q40313 <!-- Bauang, La Union --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013307000 -->
| Q40372 <!-- Burgos, La Union --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013308000 -->
| Q40393 <!-- Caba, La Union --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013309000 -->
| Q40419 <!-- Luna, La Union --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013310000 -->
| Q40450 <!-- Naguilian, La Union --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013311000 -->
| Q40466 <!-- Pugo, La Union --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013312000 -->
| Q40486 <!-- Rosario, La Union --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013313000 -->
| Q40584 <!-- San Fernando, La Union --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013314000 -->
| Q40500 <!-- San Gabriel, La Union --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013315000 -->
| Q40517 <!-- San Juan, La Union --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013316000 -->
| Q40521 <!-- Santo Tomas, La Union --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013317000 -->
| Q40536 <!-- Santol, La Union --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013318000 -->
| Q40557 <!-- Sudipen, La Union --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013319000 -->
| Q40562 <!-- Tubao, La Union --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/013320000 -->
| Q41668 <!-- Agno, Pangasinan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015501000 -->
| Q41686 <!-- Aguilar, Pangasinan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015502000 -->
| Q43162 <!-- Alaminos, Pangasinan --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015503000 -->
| Q41704 <!-- Alcala, Pangasinan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015502000 -->
| Q41713 <!-- Anda, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015504000 -->
| Q41721 <!-- Asingan, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015505000 -->
| Q41725 <!-- Balungao, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015506000 -->
| Q41732 <!-- Bani, Pangasinan --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015508000 -->
| Q41737 <!-- Basista, Pangasinan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015509000 -->
| Q41757 <!-- Bautista, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015510000 -->
| Q41762 <!-- Bayambang, Pangasinan --> = 77 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015511000 -->
| Q41771 <!-- Binalonan, Pangasinan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015512000 -->
| Q41779 <!-- Binmaley, Pangasinan --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015513000 -->
| Q41807 <!-- Bolinao, Pangasinan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015514000 -->
| Q41826 <!-- Bugallon, Pangasinan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015515000 -->
| Q41850 <!-- Burgos, Pangasinan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015516000 -->
| Q41855 <!-- Calasiao, Pangasinan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015517000 -->
| Q875070 <!-- Dagupan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015518000 -->
| Q41917 <!-- Dasol, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015519000 -->
| Q41922 <!-- Infanta, Pangasinan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015520000 -->
| Q41942 <!-- Labrador, Pangasinan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015521000 -->
| Q41965 <!-- Laoac, Pangasinan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015548000 -->
| Q41978 <!-- Lingayen, Pangasinan --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015522000 -->
| Q41982 <!-- Mabini, Pangasinan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015523000 -->
| Q41985 <!-- Malasiqui, Pangasinan --> = 73 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015524000 -->
| Q1020685 <!-- Manaoag, Pangasinan --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015525000 -->
| Q41996 <!-- Mangaldan, Pangasinan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015526000 -->
| Q42001 <!-- Mangatarem, Pangasinan --> = 82 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015527000 -->
| Q42006 <!-- Mapandan, Pangasinan --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015528000 -->
| Q42011 <!-- Natividad, Pangasinan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015529000 -->
| Q42017 <!-- Pozorrubio, Pangasinan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015530000 -->
| Q42024 <!-- Rosales, Pangasinan --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015531000 -->
| Q43165 <!-- San Carlos, Pangasinan --> = 86 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015532000 -->
| Q42031 <!-- San Fabian, Pangasinan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015533000 -->
| Q42036 <!-- San Jacinto, Pangasinan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015534000 -->
| Q42039 <!-- San Manuel, Pangasinan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015535000 -->
| Q42043 <!-- San Nicolas, Pangasinan --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015536000 -->
| Q42044 <!-- San Quintin, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015537000 -->
| Q122401 <!-- Santa Barbara, Pangasinan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015538000 -->
| Q42055 <!-- Santa Maria, Pangasinan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015539000 -->
| Q43140 <!-- Santo Tomas, Pangasinan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015540000 -->
| Q43143 <!-- Sison, Pangasinan --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015541000 -->
| Q43145 <!-- Sual, Pangasinan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015542000 -->
| Q43148 <!-- Tayug, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015543000 -->
| Q43152 <!-- Umingan, Pangasinan --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015544000 -->
| Q43154 <!-- Urbiztondo, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015545000 -->
| Q43168 <!-- Urdaneta, Pangasinan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015546000 -->
| Q43157 <!-- Villasis, Pangasinan --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/015547000 -->
| Q43180 <!-- Basco, Batanes --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020901000 -->
| Q43451 <!-- Itbayat, Batanes --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020902000 -->
| Q43454 <!-- Ivana, Batanes --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020903000 -->
| Q43458 <!-- Mahatao, Batanes --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020904000 -->
| Q43460 <!-- Sabtang, Batanes --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020905000 -->
| Q43469 <!-- Uyugan, Batanes --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/020906000 -->
| Q43500 <!-- Abulug, Cagayan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021501000 -->
| Q43503 <!-- Alcala, Cagayan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021502000 -->
| Q43508 <!-- Allacapan, Cagayan --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021503000 -->
| Q43515 <!-- Amulung, Cagayan --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021504000 -->
| Q43517 <!-- Aparri, Cagayan --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021505000 -->
| Q43520 <!-- Baggao, Cagayan --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021506000 -->
| Q49058 <!-- Ballesteros, Cagayan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021507000 -->
| Q49059 <!-- Buguey, Cagayan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021508000 -->
| Q49062 <!-- Calayan, Cagayan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021509000 -->
| Q49313 <!-- Camalaniugan, Cagayan --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021510000 -->
| Q49314 <!-- Claveria, Cagayan --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021511000 -->
| Q49315 <!-- Enrile, Cagayan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021512000 -->
| Q49316 <!-- Gattaran, Cagayan --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021513000 -->
| Q49317 <!-- Gonzaga, Cagayan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021514000 -->
| Q49318 <!-- Iguig, Cagayan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021515000 -->
| Q49320 <!-- Lal-lo, Cagayan --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021516000 -->
| Q49321 <!-- Lasam, Cagayan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021517000 -->
| Q49324 <!-- Pamplona, Cagayan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021518000 -->
| Q49327 <!-- Peñablanca, Cagayan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021519000 -->
| Q49331 <!-- Piat, Cagayan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021520000 -->
| Q49333 <!-- Rizal, Cagayan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021521000 -->
| Q49336 <!-- Sanchez-Mira, Cagayan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021522000 -->
| Q49337 <!-- Santa Ana, Cagayan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021523000 -->
| Q49339 <!-- Santa Praxedes, Cagayan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021524000 -->
| Q49342 <!-- Santa Teresita, Cagayan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021525000 -->
| Q49346 <!-- Santo Niño, Cagayan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021526000 -->
| Q49348 <!-- Solana, Cagayan --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021527000 -->
| Q49350 <!-- Tuao, Cagayan --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021528000 -->
| Q2200 <!-- Tuguegarao, Cagayan --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/021529000 -->
| Q49354 <!-- Alicia, Isabela --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023101000 -->
| Q49357 <!-- Angadanan, Isabela --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023102000 -->
| Q49358 <!-- Aurora, Isabela --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023103000 -->
| Q49359 <!-- Benito Soliven, Isabela --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023104000 -->
| Q49360 <!-- Burgos, Isabela --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023105000 -->
| Q49361 <!-- Cabagan, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023106000 -->
| Q49362 <!-- Cabatuan, Isabela --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023107000 -->
| Q50178 <!-- Cauayan, Isabela --> = 65 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023108000 -->
| Q49363 <!-- Cordon, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023109000 -->
| Q49365 <!-- Delfin Albano, Isabela --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023118000 -->
| Q49366 <!-- Dinapigue, Isabela --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023110000 -->
| Q49368 <!-- Divilacan, Isabela --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023111000 -->
| Q49369 <!-- Echague, Isabela --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023112000 -->
| Q49370 <!-- Gamu, Isabela --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023113000 -->
| Q50179 <!-- Ilagan, Isabela --> = 91 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023114000 -->
| Q49372 <!-- Jones, Isabela --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023115000 -->
| Q49375 <!-- Luna, Isabela --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023116000 -->
| Q49434 <!-- Maconacon, Isabela --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023117000 -->
| Q49435 <!-- Mallig, Isabela --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023119000 -->
| Q50066 <!-- Naguilian, Isabela --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023120000 -->
| Q50102 <!-- Palanan, Isabela --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023121000 -->
| Q50145 <!-- Quezon, Isabela --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023122000 -->
| Q50149 <!-- Quirino, Isabela --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023123000 -->
| Q50152 <!-- Ramon, Isabela --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023124000 -->
| Q50153 <!-- Reina Mercedes, Isabela --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023125000 -->
| Q50154 <!-- Roxas, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023126000 -->
| Q50158 <!-- San Agustin, Isabela --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023127000 -->
| Q50160 <!-- San Guillermo, Isabela --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023128000 -->
| Q50163 <!-- San Isidro, Isabela --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023129000 -->
| Q50164 <!-- San Manuel, Isabela --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023130000 -->
| Q50167 <!-- San Mariano, Isabela --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023131000 -->
| Q50171 <!-- San Mateo, Isabela --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023132000 -->
| Q50174 <!-- San Pablo, Isabela --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023133000 -->
| Q50175 <!-- Santa Maria, Isabela --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023134000 -->
| Q50180 <!-- Santiago --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023135000 -->
| Q50176 <!-- Santo Tomas, Isabela --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023136000 -->
| Q50177 <!-- Tumauini, Isabela --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/023137000 -->
| Q51474 <!-- Alfonso Castaneda, Nueva Vizcaya --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025015000 -->
| Q51475 <!-- Ambaguio, Nueva Vizcaya --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025001000 -->
| Q51477 <!-- Aritao, Nueva Vizcaya --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025002000 -->
| Q51478 <!-- Bagabag, Nueva Vizcaya --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025003000 -->
| Q51479 <!-- Bambang, Nueva Vizcaya --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025004000 -->
| Q51480 <!-- Bayombong , Nueva Vizcaya --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025005000 -->
| Q51481 <!-- Diadi, Nueva Vizcaya --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025006000 -->
| Q51483 <!-- Dupax del Norte, Nueva Vizcaya --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025007000 -->
| Q51484 <!-- Dupax del Sur, Nueva Vizcaya --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025008000 -->
| Q51485 <!-- Kasibu, Nueva Vizcaya --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025009000 -->
| Q51486 <!-- Kayapa, Nueva Vizcaya --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025010000 -->
| Q51487 <!-- Quezon, Nueva Vizcaya --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025011000 -->
| Q51493 <!-- Santa Fe, Nueva Vizcaya --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025012000 -->
| Q51494 <!-- Solano, Nueva Vizcaya --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025013000 -->
| Q51496 <!-- Villaverde, Nueva Vizcaya --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025014000 -->
| Q53069 <!-- Aglipay, Quirino --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025701000 -->
| Q53070 <!-- Cabarroguis, Quirino --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025702000 -->
| Q53071 <!-- Diffun, Quirino --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025703000 -->
| Q53072 <!-- Maddela, Quirino --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025704000 -->
| Q53073 <!-- Nagtipunan, Quirino --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025706000 -->
| Q53074 <!-- Saguday, Quirino --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/025705000 -->
| Q27995 <!-- Bangued , Abra --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140101000 -->
| Q28002 <!-- Boliney, Abra --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140102000 -->
| Q28014 <!-- Bucay, Abra --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140103000 -->
| Q28030 <!-- Bucloc, Abra --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140104000 -->
| Q28044 <!-- Daguioman, Abra --> = 4 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140105000 -->
| Q28068 <!-- Danglas, Abra --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140106000 -->
| Q28096 <!-- Dolores, Abra --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140107000 -->
| Q28124 <!-- La Paz, Abra --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140108000 -->
| Q29007 <!-- Lacub, Abra --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140109000 -->
| Q29020 <!-- Lagangilang, Abra --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140110000 -->
| Q29029 <!-- Lagayan, Abra --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140111000 -->
| Q29038 <!-- Langiden, Abra --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140112000 -->
| Q29045 <!-- Licuan-Baay, Abra --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140113000 -->
| Q29048 <!-- Luba, Abra --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140114000 -->
| Q29069 <!-- Malibcong, Abra --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140115000 -->
| Q29082 <!-- Manabo, Abra --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140116000 -->
| Q29094 <!-- Peñarrubia, Abra --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140117000 -->
| Q29102 <!-- Pidigan, Abra --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140118000 -->
| Q29109 <!-- Pilar, Abra --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140119000 -->
| Q29116 <!-- Sallapadan, Abra --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140120000 -->
| Q801530 <!-- San Isidro, Abra --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140121000 -->
| Q29123 <!-- San Juan, Abra --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140122000 -->
| Q29133 <!-- San Quintin, Abra --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140123000 -->
| Q29139 <!-- Tayum, Abra --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140124000 -->
| Q29146 <!-- Tineg, Abra --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140125000 -->
| Q29153 <!-- Tubo, Abra --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140126000 -->
| Q29191 <!-- Villaviciosa, Abra --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/140127000 -->
| Q29018 <!-- Calanasan, Apayao --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148101000 -->
| Q30033 <!-- Conner, Apayao --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148102000 -->
| Q30042 <!-- Flora, Apayao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148103000 -->
| Q30053 <!-- Kabugao, Apayao --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148104000 -->
| Q801777 <!-- Luna, Apayao --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148105000 -->
| Q30062 <!-- Pudtol, Apayao --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148106000 -->
| Q30073 <!-- Santa Marcela, Apayao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/148107000 -->
| Q30104 <!-- Atok, Benguet --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141101000 -->
| Q1822 <!-- Baguio --> = 129 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141102000 -->
| Q30325 <!-- Bakun, Benguet --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141103000 -->
| Q30328 <!-- Bokod, Benguet --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141104000 -->
| Q30332 <!-- Buguias, Benguet --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141105000 -->
| Q30335 <!-- Itogon, Benguet --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141106000 -->
| Q30338 <!-- Kabayan, Benguet --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141107000 -->
| Q30345 <!-- Kapangan, Benguet --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141108000 -->
| Q30349 <!-- Kibungan, Benguet --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141109000 -->
| Q30351 <!-- La Trinidad , Benguet --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141110000 -->
| Q30356 <!-- Mankayan, Benguet --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141111000 -->
| Q30358 <!-- Sablan, Benguet --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141112000 -->
| Q30361 <!-- Tuba, Benguet --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141113000 -->
| Q30363 <!-- Tublay, Benguet --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/141114000 -->
| Q30365 <!-- Aguinaldo, Ifugao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142708000 -->
| Q30391 <!-- Alfonso Lista, Ifugao --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142707000 -->
| Q30394 <!-- Asipulo, Ifugao --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142711000 -->
| Q806138 <!-- Banaue, Ifugao --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142701000 -->
| Q30410 <!-- Hingyon, Ifugao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142709000 -->
| Q30413 <!-- Hungduan, Ifugao --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142702000 -->
| Q30416 <!-- Kiangan, Ifugao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142703000 -->
| Q30419 <!-- Lagawe, Ifugao --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142704000 -->
| Q30421 <!-- Lamut, Ifugao --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142705000 -->
| Q30425 <!-- Mayoyao, Ifugao --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142706000 -->
| Q30428 <!-- Tinoc, Ifugao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/142710000 -->
| Q35848 <!-- Balbalan, Kalinga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143201000 -->
| Q35858 <!-- Lubuagan, Kalinga --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143206000 -->
| Q35866 <!-- Pasil, Kalinga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143208000 -->
| Q35873 <!-- Pinukpuk, Kalinga --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143209000 -->
| Q35884 <!-- Rizal, Kalinga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143211000 -->
| Q35925 <!-- Tabuk, Kalinga --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143213000 -->
| Q35897 <!-- Tanudan, Kalinga --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143214000 -->
| Q35909 <!-- Tinglayan, Kalinga --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/143215000 -->
| Q35975 <!-- Barlig, Mountain Province --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144401000 -->
| Q35994 <!-- Bauko, Mountain Province --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144402000 -->
| Q36012 <!-- Besao, Mountain Province --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144403000 -->
| Q36025 <!-- Bontoc, Mountain Province --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144404000 -->
| Q36040 <!-- Natonin, Mountain Province --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144405000 -->
| Q36049 <!-- Paracelis, Mountain Province --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144406000 -->
| Q36061 <!-- Sabangan, Mountain Province --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144407000 -->
| Q36076 <!-- Sadanga, Mountain Province --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144408000 -->
| Q36090 <!-- Sagada, Mountain Province --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144409000 -->
| Q36099 <!-- Tadian, Mountain Province --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/144410000 -->
| Q53081 <!-- Baler, Aurora --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037701000 -->
| Q53083 <!-- Casiguran, Aurora --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037702000 -->
| Q53084 <!-- Dilasag, Aurora --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037703000 -->
| Q53086 <!-- Dinalungan, Aurora --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037704000 -->
| Q53087 <!-- Dingalan, Aurora --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037705000 -->
| Q53089 <!-- Dipaculao, Aurora --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037706000 -->
| Q53090 <!-- Maria Aurora, Aurora --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037707000 -->
| Q53092 <!-- San Luis, Aurora --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037708000 -->
| Q54455 <!-- Abucay, Bataan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030801000 -->
| Q54456 <!-- Bagac, Bataan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030802000 -->
| Q1719 <!-- Balanga, Bataan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030803000 -->
| Q54457 <!-- Dinalupihan, Bataan --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030804000 -->
| Q54458 <!-- Hermosa, Bataan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030805000 -->
| Q54459 <!-- Limay, Bataan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030806000 -->
| Q54460 <!-- Mariveles, Bataan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030807000 -->
| Q54461 <!-- Morong, Bataan --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030808000 -->
| Q54462 <!-- Orani, Bataan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030809000 -->
| Q54463 <!-- Orion, Bataan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030810000 -->
| Q54464 <!-- Pilar, Bataan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030811000 -->
| Q54465 <!-- Samal, Bataan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/030812000 -->
| Q54551 <!-- Angat, Bulacan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031401000 -->
| Q54553 <!-- Balagtas, Bulacan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031402000 -->
| Q54554 <!-- Baliuag, Bulacan --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031403000 -->
| Q54555 <!-- Bocaue, Bulacan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031404000 -->
| Q54558 <!-- Bulakan, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031405000 -->
| Q54560 <!-- Bustos, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031406000 -->
| Q54564 <!-- Calumpit, Bulacan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031407000 -->
| Q54566 <!-- Doña Remedios Trinidad, Bulacan --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031424000 -->
| Q54589 <!-- Guiguinto, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031408000 -->
| Q54592 <!-- Hagonoy, Bulacan --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031409000 -->
| Q2180 <!-- Malolos, Bulacan --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031410000 -->
| Q54595 <!-- Marilao, Bulacan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031411000 -->
| Q2187 <!-- Meycauayan, Bulacan --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031412000 -->
| Q54598 <!-- Norzagaray, Bulacan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031413000 -->
| Q54599 <!-- Obando, Bulacan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031414000 -->
| Q54600 <!-- Pandi, Bulacan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031415000 -->
| Q54605 <!-- Paombong, Bulacan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031416000 -->
| Q54760 <!-- Plaridel, Bulacan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031417000 -->
| Q54761 <!-- Pulilan, Bulacan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031418000 -->
| Q54762 <!-- San Ildefonso, Bulacan --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031419000 -->
| Q2193 <!-- San Jose del Monte, Bulacan --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031420000 -->
| Q54763 <!-- San Miguel, Bulacan --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031421000 -->
| Q54765 <!-- San Rafael, Bulacan --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031422000 -->
| Q54768 <!-- Santa Maria, Bulacan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/031423000 -->
| Q55543 <!-- Aliaga, Nueva Ecija --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034901000 -->
| Q55544 <!-- Bongabon, Nueva Ecija --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034902000 -->
| Q55595 <!-- Cabanatuan, Nueva Ecija --> = 89 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034903000 -->
| Q55545 <!-- Cabiao, Nueva Ecija --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034904000 -->
| Q55546 <!-- Carranglan, Nueva Ecija --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034905000 -->
| Q55547 <!-- Cuyapo, Nueva Ecija --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034906000 -->
| Q55548 <!-- Gabaldon, Nueva Ecija --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034907000 -->
| Q55596 <!-- Gapan, Nueva Ecija --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034908000 -->
| Q55549 <!-- General Mamerto Natividad, Nueva Ecija --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034909000 -->
| Q55551 <!-- General Tinio, Nueva Ecija --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034910000 -->
| Q55552 <!-- Guimba, Nueva Ecija --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034911000 -->
| Q30871 <!-- Jaen, Nueva Ecija --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034912000 -->
| Q55556 <!-- Laur, Nueva Ecija --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034913000 -->
| Q55557 <!-- Licab, Nueva Ecija --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034914000 -->
| Q55558 <!-- Llanera, Nueva Ecija --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034915000 -->
| Q55559 <!-- Lupao, Nueva Ecija --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034916000 -->
| Q55597 <!-- Muñoz, Nueva Ecija --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034917000 -->
| Q55560 <!-- Nampicuan, Nueva Ecija --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034918000 -->
| Q55598 <!-- Palayan, Nueva Ecija --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034919000 -->
| Q55567 <!-- Pantabangan, Nueva Ecija --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034920000 -->
| Q55568 <!-- Peñaranda, Nueva Ecija --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034921000 -->
| Q55569 <!-- Quezon, Nueva Ecija --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034922000 -->
| Q55570 <!-- Rizal, Nueva Ecija --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034923000 -->
| Q30923 <!-- San Antonio, Nueva Ecija --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034924000 -->
| Q55572 <!-- San Isidro, Nueva Ecija --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034925000 -->
| Q55599 <!-- San Jose, Nueva Ecija --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034926000 -->
| Q55573 <!-- San Leonardo, Nueva Ecija --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034927000 -->
| Q55590 <!-- Santa Rosa, Nueva Ecija --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034928000 -->
| Q55591 <!-- Santo Domingo, Nueva Ecija --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034929000 -->
| Q55592 <!-- Talavera, Nueva Ecija --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034930000 -->
| Q55593 <!-- Talugtug, Nueva Ecija --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034931000 -->
| Q28731 <!-- Zaragoza, Nueva Ecija --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/034932000 -->
| Q55741 <!-- Angeles --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035401000 -->
| Q55693 <!-- Apalit, Pampanga --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035402000 -->
| Q55694 <!-- Arayat, Pampanga --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035403000 -->
| Q55696 <!-- Bacolor, Pampanga --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035404000 -->
| Q55699 <!-- Candaba, Pampanga --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035405000 -->
| Q55700 <!-- Floridablanca, Pampanga --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035406000 -->
| Q55702 <!-- Guagua, Pampanga --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035407000 -->
| Q55705 <!-- Lubao, Pampanga --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035408000 -->
| Q55737 <!-- Mabalacat, Pampanga --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035409000 -->
| Q55707 <!-- Macabebe, Pampanga --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035410000 -->
| Q55709 <!-- Magalang, Pampanga --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035411000 -->
| Q55710 <!-- Masantol, Pampanga --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035412000 -->
| Q55712 <!-- Mexico, Pampanga --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035413000 -->
| Q55717 <!-- Minalin, Pampanga --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035414000 -->
| Q55721 <!-- Porac, Pampanga --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035415000 -->
| Q55740 <!-- San Fernando, Pampanga --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035416000 -->
| Q55724 <!-- San Luis, Pampanga --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035417000 -->
| Q55725 <!-- San Simon, Pampanga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035418000 -->
| Q55727 <!-- Santa Ana, Pampanga --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035419000 -->
| Q55730 <!-- Santa Rita, Pampanga --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035420000 -->
| Q55731 <!-- Santo Tomas, Pampanga --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035421000 -->
| Q55734 <!-- Sasmuan, Pampanga --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/035422000 -->
| Q56414 <!-- Anao, Tarlac --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036901000 -->
| Q56420 <!-- Bamban, Tarlac --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036902000 -->
| Q56424 <!-- Camiling, Tarlac --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036903000 -->
| Q56427 <!-- Capas, Tarlac --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036904000 -->
| Q30934 <!-- Concepcion, Tarlac --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036905000 -->
| Q56439 <!-- Gerona, Tarlac --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036906000 -->
| Q28733 <!-- La Paz, Tarlac --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036907000 -->
| Q56444 <!-- Mayantoc, Tarlac --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036908000 -->
| Q56453 <!-- Moncada, Tarlac --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036909000 -->
| Q56457 <!-- Paniqui, Tarlac --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036910000 -->
| Q56461 <!-- Pura, Tarlac --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036911000 -->
| Q56465 <!-- Ramos, Tarlac --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036912000 -->
| Q56471 <!-- San Clemente, Tarlac --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036913000 -->
| Q56476 <!-- San Jose, Tarlac --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036918000 -->
| Q56481 <!-- San Manuel, Tarlac --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036914000 -->
| Q56486 <!-- Santa Ignacia, Tarlac --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036915000 -->
| Q5285 <!-- Tarlac, Tarlac --> = 76 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036916000 -->
| Q56493 <!-- Victoria, Tarlac --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/036917000 -->
| Q56529 <!-- Botolan, Zambales --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037101000 -->
| Q56533 <!-- Cabangan, Zambales --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037102000 -->
| Q56538 <!-- Candelaria, Zambales --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037103000 -->
| Q56561 <!-- Castillejos, Zambales --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037104000 -->
| Q56566 <!-- Iba, Zambales --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037105000 -->
| Q56572 <!-- Masinloc, Zambales --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037106000 -->
| Q56759 <!-- Olongapo --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037107000 -->
| Q56575 <!-- Palauig, Zambales --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037108000 -->
| Q56581 <!-- San Antonio, Zambales --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037109000 -->
| Q56584 <!-- San Felipe, Zambales --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037110000 -->
| Q56623 <!-- San Marcelino, Zambales --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037111000 -->
| Q56647 <!-- San Narciso, Zambales --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037112000 -->
| Q56656 <!-- Santa Cruz, Zambales --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037113000 -->
| Q56663 <!-- Subic, Zambales --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/037114000 -->
| Q59250 <!-- Agoncillo, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041001000 -->
| Q59251 <!-- Alitagtag, Batangas --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041002000 -->
| Q59252 <!-- Balayan, Batangas --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041003000 -->
| Q59253 <!-- Balete, Batangas --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041004000 -->
| Q1723 <!-- Batangas, Batangas --> = 105 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041005000 -->
| Q59272 <!-- Bauan, Batangas --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041006000 -->
| Q59276 <!-- Calaca, Batangas --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041007000 -->
| Q59279 <!-- Calatagan, Batangas --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041008000 -->
| Q59287 <!-- Cuenca, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041009000 -->
| Q59304 <!-- Ibaan, Batangas --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041010000 -->
| Q59308 <!-- Laurel, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041011000 -->
| Q59311 <!-- Lemery, Batangas --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041012000 -->
| Q59312 <!-- Lian, Batangas --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041013000 -->
| Q1725 <!-- Lipa, Batangas --> = 72 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041014000 -->
| Q803199 <!-- Lobo, Batangas --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041015000 -->
| Q59313 <!-- Mabini, Batangas --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041016000 -->
| Q59731 <!-- Malvar, Batangas --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041017000 -->
| Q59740 <!-- Mataasnakahoy, Batangas --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041018000 -->
| Q59745 <!-- Nasugbu, Batangas --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041019000 -->
| Q59749 <!-- Padre Garcia, Batangas --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041020000 -->
| Q59758 <!-- Rosario, Batangas --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041021000 -->
| Q59764 <!-- San Jose, Batangas --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041022000 -->
| Q59770 <!-- San Juan, Batangas --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041023000 -->
| Q59773 <!-- San Luis, Batangas --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041024000 -->
| Q59777 <!-- San Nicolas, Batangas --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041025000 -->
| Q59784 <!-- San Pascual, Batangas --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041026000 -->
| Q59788 <!-- Santa Teresita, Batangas --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041027000 -->
| Q59799 <!-- Santo Tomas, Batangas --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041028000 -->
| Q59814 <!-- Taal, Batangas --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041029000 -->
| Q59825 <!-- Talisay, Batangas --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041030000 -->
| Q1730 <!-- Tanauan, Batangas --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041031000 -->
| Q59830 <!-- Taysan, Batangas --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041032000 -->
| Q59835 <!-- Tingloy, Batangas --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041033000 -->
| Q59844 <!-- Tuy, Batangas --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/041034000 -->
| Q62600 <!-- Alfonso, Cavite --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042101000 -->
| Q62606 <!-- Amadeo, Cavite --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042102000 -->
| Q63129 <!-- Bacoor, Cavite --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042103000 -->
| Q62611 <!-- Carmona, Cavite --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042104000 -->
| Q1482 <!-- Cavite, Cavite --> = 84 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042105000 -->
| Q63139 <!-- Dasmariñas, Cavite --> = 75 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042106000 -->
| Q62719 <!-- General Emilio Aguinaldo, Cavite --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042107000 -->
| Q62638 <!-- General Mariano Alvarez, Cavite --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042123000 -->
| Q62723 <!-- General Trias, Cavite --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042108000 -->
| Q63145 <!-- Imus, Cavite --> = 97 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042109000 -->
| Q62729 <!-- Indang, Cavite --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042110000 -->
| Q62755 <!-- Kawit, Cavite --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042111000 -->
| Q62771 <!-- Magallanes, Cavite --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042112000 -->
| Q62776 <!-- Maragondon, Cavite --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042113000 -->
| Q62784 <!-- Mendez, Cavite --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042114000 -->
| Q62799 <!-- Naic, Cavite --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042115000 -->
| Q63096 <!-- Noveleta, Cavite --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042116000 -->
| Q63102 <!-- Rosario, Cavite --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042117000 -->
| Q63110 <!-- Silang, Cavite --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042118000 -->
| Q63154 <!-- Tagaytay, Cavite --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042119000 -->
| Q63115 <!-- Tanza, Cavite --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042120000 -->
| Q63124 <!-- Ternate, Cavite --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042121000 -->
| Q63160 <!-- Trece Martires, Cavite --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/042122000 -->
| Q63750 <!-- Alaminos, Laguna --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043401000 -->
| Q63763 <!-- Bay, Laguna --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043402000 -->
| Q75961 <!-- Biñan, Laguna --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043403000 -->
| Q25096 <!-- Cabuyao, Laguna --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043404000 -->
| Q75978 <!-- Calamba, Laguna --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043405000 -->
| Q69739 <!-- Calauan, Laguna --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043406000 -->
| Q69749 <!-- Cavinti, Laguna --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043407000 -->
| Q69759 <!-- Famy, Laguna --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043408000 -->
| Q69771 <!-- Kalayaan, Laguna --> = 3 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043409000 -->
| Q69781 <!-- Liliw, Laguna --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043410000 -->
| Q69793 <!-- Los Baños, Laguna --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043411000 -->
| Q69812 <!-- Luisiana, Laguna --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043412000 -->
| Q69824 <!-- Lumban, Laguna --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043413000 -->
| Q75875 <!-- Mabitac, Laguna --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043414000 -->
| Q75881 <!-- Magdalena, Laguna --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043415000 -->
| Q75888 <!-- Majayjay, Laguna --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043416000 -->
| Q75895 <!-- Nagcarlan, Laguna --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043417000 -->
| Q75899 <!-- Paete, Laguna --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043418000 -->
| Q75905 <!-- Pagsanjan, Laguna --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043419000 -->
| Q75910 <!-- Pakil, Laguna --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043420000 -->
| Q75918 <!-- Pangil, Laguna --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043421000 -->
| Q75923 <!-- Pila, Laguna --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043422000 -->
| Q75928 <!-- Rizal, Laguna --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043423000 -->
| Q76001 <!-- San Pablo, Laguna --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043424000 -->
| Q75933 <!-- San Pedro, Laguna --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043425000 -->
| Q75938 <!-- Santa Cruz, Laguna --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043426000 -->
| Q75943 <!-- Santa Maria, Laguna --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043427000 -->
| Q76010 <!-- Santa Rosa, Laguna --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043428000 -->
| Q75948 <!-- Siniloan, Laguna --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043429000 -->
| Q75953 <!-- Victoria, Laguna --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/043430000 -->
| Q103777 <!-- Agdangan, Quezon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045601000 -->
| Q103786 <!-- Alabat, Quezon --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045602000 -->
| Q103807 <!-- Atimonan, Quezon --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045603000 -->
| Q103815 <!-- Buenavista, Quezon --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045605000 -->
| Q103825 <!-- Burdeos, Quezon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045606000 -->
| Q103833 <!-- Calauag, Quezon --> = 81 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045607000 -->
| Q103841 <!-- Candelaria, Quezon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045608000 -->
| Q103872 <!-- Catanauan, Quezon --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045610000 -->
| Q103879 <!-- Dolores, Quezon --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045615000 -->
| Q103889 <!-- General Luna, Quezon --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045616000 -->
| Q103899 <!-- General Nakar, Quezon --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045617000 -->
| Q103905 <!-- Guinayangan, Quezon --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045618000 -->
| Q103914 <!-- Gumaca, Quezon --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045619000 -->
| Q103921 <!-- Infanta, Quezon --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045620000 -->
| Q103928 <!-- Jomalig, Quezon --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045621000 -->
| Q103935 <!-- Lopez, Quezon --> = 95 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045622000 -->
| Q103941 <!-- Lucban, Quezon --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045623000 -->
| Q104125 <!-- Lucena --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045624000 -->
| Q103947 <!-- Macalelon, Quezon --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045625000 -->
| Q103952 <!-- Mauban, Quezon --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045627000 -->
| Q103958 <!-- Mulanay, Quezon --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045628000 -->
| Q103965 <!-- Padre Burgos, Quezon --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045629000 -->
| Q103971 <!-- Pagbilao, Quezon --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045630000 -->
| Q103976 <!-- Panukulan, Quezon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045631000 -->
| Q103981 <!-- Patnanungan, Quezon --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045632000 -->
| Q103987 <!-- Perez, Quezon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045633000 -->
| Q103996 <!-- Pitogo, Quezon --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045634000 -->
| Q104005 <!-- Plaridel, Quezon --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045635000 -->
| Q104011 <!-- Polillo, Quezon --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045636000 -->
| Q104020 <!-- Quezon, Quezon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045637000 -->
| Q104026 <!-- Real, Quezon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045638000 -->
| Q104037 <!-- Sampaloc, Quezon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045639000 -->
| Q104044 <!-- San Andres, Quezon --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045640000 -->
| Q104052 <!-- San Antonio, Quezon --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045641000 -->
| Q104063 <!-- San Francisco, Quezon --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045642000 -->
| Q104071 <!-- San Narciso, Quezon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045644000 -->
| Q104078 <!-- Sariaya, Quezon --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045645000 -->
| Q104087 <!-- Tagkawayan, Quezon --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045646000 -->
| Q104113 <!-- Tayabas, Quezon --> = 66 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045647000 -->
| Q104092 <!-- Tiaong, Quezon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045648000 -->
| Q104099 <!-- Unisan, Quezon --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045649000 -->
| Q106758 <!-- Angono, Rizal --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045801000 -->
| Q1636 <!-- Antipolo, Rizal --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045802000 -->
| Q106766 <!-- Baras, Rizal --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045803000 -->
| Q106783 <!-- Binangonan, Rizal --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045804000 -->
| Q106790 <!-- Cainta, Rizal --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045805000 -->
| Q106796 <!-- Cardona, Rizal --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045806000 -->
| Q106804 <!-- Jalajala, Rizal --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045807000 -->
| Q106810 <!-- Morong, Rizal --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045809000 -->
| Q106817 <!-- Pililla, Rizal --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045810000 -->
| Q106825 <!-- Rodriguez, Rizal --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045808000 -->
| Q106832 <!-- San Mateo, Rizal --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045811000 -->
| Q106839 <!-- Tanay, Rizal --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045812000 -->
| Q373204 <!-- Taytay, Rizal --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045813000 -->
| Q106848 <!-- Teresa, Rizal --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/045814000 -->
| Q492912 <!-- Bacacay, Albay --> = 56 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050501000 -->
| Q492976 <!-- Camalig, Albay --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050502000 -->
| Q493008 <!-- Daraga, Albay --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050503000 -->
| Q493032 <!-- Guinobatan, Albay --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050504000 -->
| Q493065 <!-- Jovellar, Albay --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050505000 -->
| Q1696 <!-- Legazpi, Albay --> = 70 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050506000 -->
| Q493095 <!-- Libon, Albay --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050507000 -->
| Q1701 <!-- Ligao, Albay --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050508000 -->
| Q493132 <!-- Malilipot, Albay --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050509000 -->
| Q493178 <!-- Malinao, Albay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050510000 -->
| Q493204 <!-- Manito, Albay --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050511000 -->
| Q493246 <!-- Oas, Albay --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050512000 -->
| Q256045 <!-- Pio Duran, Albay --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050513000 -->
| Q493326 <!-- Polangui, Albay --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050514000 -->
| Q493362 <!-- Rapu-Rapu, Albay --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050515000 -->
| Q493409 <!-- Santo Domingo, Albay --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050516000 -->
| Q1706 <!-- Tabaco, Albay --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050517000 -->
| Q493444 <!-- Tiwi, Albay --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/050518000 -->
| Q356607 <!-- Basud, Camarines Norte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051601000 -->
| Q119624 <!-- Capalonga, Camarines Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051602000 -->
| Q356655 <!-- Daet, Camarines Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051603000 -->
| Q356681 <!-- Jose Panganiban, Camarines Norte --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051605000 -->
| Q356708 <!-- Labo, Camarines Norte --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051606000 -->
| Q356734 <!-- Mercedes, Camarines Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051607000 -->
| Q356759 <!-- Paracale, Camarines Norte --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051608000 -->
| Q356803 <!-- San Lorenzo Ruiz, Camarines Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051604000 -->
| Q302791 <!-- San Vicente, Camarines Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051609000 -->
| Q356853 <!-- Santa Elena, Camarines Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051610000 -->
| Q356878 <!-- Talisay, Camarines Norte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051611000 -->
| Q356898 <!-- Vinzons, Camarines Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051612000 -->
| Q208672 <!-- Baao, Camarines Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051701000 -->
| Q208678 <!-- Balatan, Camarines Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051702000 -->
| Q208683 <!-- Bato, Camarines Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051703000 -->
| Q208690 <!-- Bombon, Camarines Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051704000 -->
| Q208699 <!-- Buhi, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051705000 -->
| Q208712 <!-- Bula, Camarines Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051706000 -->
| Q208717 <!-- Cabusao, Camarines Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051707000 -->
| Q208727 <!-- Calabanga, Camarines Sur --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051708000 -->
| Q208738 <!-- Camaligan, Camarines Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051709000 -->
| Q208749 <!-- Canaman, Camarines Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051710000 -->
| Q208757 <!-- Caramoan, Camarines Sur --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051711000 -->
| Q208765 <!-- Del Gallego, Camarines Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051712000 -->
| Q208769 <!-- Gainza, Camarines Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051713000 -->
| Q208775 <!-- Garchitorena, Camarines Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051714000 -->
| Q208782 <!-- Goa, Camarines Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051715000 -->
| Q2205 <!-- Iriga, Camarines Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051716000 -->
| Q208792 <!-- Lagonoy, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051717000 -->
| Q208814 <!-- Libmanan, Camarines Sur --> = 75 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051718000 -->
| Q208835 <!-- Lupi, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051719000 -->
| Q208845 <!-- Magarao, Camarines Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051720000 -->
| Q208852 <!-- Milaor, Camarines Sur --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051721000 -->
| Q208864 <!-- Minalabac, Camarines Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051722000 -->
| Q208872 <!-- Nabua, Camarines Sur --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051723000 -->
| Q2207 <!-- Naga --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051724000 -->
| Q208878 <!-- Ocampo, Camarines Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051725000 -->
| Q208886 <!-- Pamplona, Camarines Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051726000 -->
| Q208892 <!-- Pasacao, Camarines Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051727000 -->
| Q208899 <!-- Pili, Camarines Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051728000 -->
| Q208919 <!-- Presentacion, Camarines Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051729000 -->
| Q208924 <!-- Ragay, Camarines Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051730000 -->
| Q208937 <!-- Sagñay, Camarines Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051731000 -->
| Q208950 <!-- San Fernando, Camarines Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051732000 -->
| Q208966 <!-- San Jose, Camarines Sur --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051733000 -->
| Q208985 <!-- Sipocot, Camarines Sur --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051734000 -->
| Q208995 <!-- Siruma, Camarines Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051735000 -->
| Q209011 <!-- Tigaon, Camarines Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051736000 -->
| Q209024 <!-- Tinambac, Camarines Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/051737000 -->
| Q192067 <!-- Bagamanoc, Catanduanes --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052001000 -->
| Q192072 <!-- Baras, Catanduanes --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052002000 -->
| Q192085 <!-- Bato, Catanduanes --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052003000 -->
| Q192091 <!-- Caramoran, Catanduanes --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052004000 -->
| Q192629 <!-- Gigmoto, Catanduanes --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052005000 -->
| Q123163 <!-- Pandan, Catanduanes --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052006000 -->
| Q192646 <!-- Panganiban, Catanduanes --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052007000 -->
| Q840162 <!-- San Andres, Catanduanes --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052008000 -->
| Q192665 <!-- San Miguel, Catanduanes --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052009000 -->
| Q192670 <!-- Viga, Catanduanes --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052010000 -->
| Q192681 <!-- Virac, Catanduanes --> = 63 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/052011000 -->
| Q107011 <!-- Boac, Marinduque --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174001000 -->
| Q107034 <!-- Mogpog, Marinduque --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174004000 -->
| Q107042 <!-- Santa Cruz, Marinduque --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174005000 -->
| Q107048 <!-- Torrijos, Marinduque --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174006000 -->
| Q191416 <!-- Aroroy, Masbate --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054101000 -->
| Q191438 <!-- Baleno, Masbate --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054102000 -->
| Q191453 <!-- Balud, Masbate --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054103000 -->
| Q191463 <!-- Batuan, Masbate --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054104000 -->
| Q191478 <!-- Cataingan, Masbate --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054105000 -->
| Q191482 <!-- Cawayan, Masbate --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054106000 -->
| Q191490 <!-- Claveria, Masbate --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054107000 -->
| Q191496 <!-- Dimasalang, Masbate --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054108000 -->
| Q191501 <!-- Esperanza, Masbate --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054109000 -->
| Q191512 <!-- Mandaon, Masbate --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054110000 -->
| Q191651 <!-- Masbate, Masbate --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054111000 -->
| Q191522 <!-- Milagros, Masbate --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054112000 -->
| Q191533 <!-- Mobo, Masbate --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054113000 -->
| Q191544 <!-- Monreal, Masbate --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054114000 -->
| Q191558 <!-- Palanas, Masbate --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054115000 -->
| Q191581 <!-- Pio V. Corpuz, Masbate --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054116000 -->
| Q191590 <!-- Placer, Masbate --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054117000 -->
| Q191606 <!-- San Fernando, Masbate --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054118000 -->
| Q191621 <!-- San Jacinto, Masbate --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054119000 -->
| Q191630 <!-- San Pascual, Masbate --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054120000 -->
| Q191636 <!-- Uson, Masbate --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/054121000 -->
| Q174114 <!-- Barcelona, Sorsogon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056202000 -->
| Q174132 <!-- Bulan, Sorsogon --> = 63 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056203000 -->
| Q174162 <!-- Casiguran, Sorsogon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056205000 -->
| Q174177 <!-- Castilla, Sorsogon --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056206000 -->
| Q174192 <!-- Donsol, Sorsogon --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056207000 -->
| Q174201 <!-- Gubat, Sorsogon --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056208000 -->
| Q174215 <!-- Irosin, Sorsogon --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056209000 -->
| Q174236 <!-- Magallanes, Sorsogon --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056211000 -->
| Q174246 <!-- Matnog, Sorsogon --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056212000 -->
| Q174269 <!-- Prieto Diaz, Sorsogon --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056214000 -->
| Q174281 <!-- Santa Magdalena, Sorsogon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056215000 -->
| Q107023 <!-- Buenavista, Marinduque --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174002000 -->
| Q107029 <!-- Gasan, Marinduque --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/174003000 -->
| Q107454 <!-- Abra de Ilog, Occidental Mindoro --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175101000 -->
| Q107460 <!-- Calintaan, Occidental Mindoro --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175102000 -->
| Q107465 <!-- Looc, Occidental Mindoro --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175103000 -->
| Q107476 <!-- Lubang, Occidental Mindoro --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175104000 -->
| Q107482 <!-- Magsaysay, Occidental Mindoro --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175105000 -->
| Q107488 <!-- Mamburao , Occidental Mindoro --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175106000 -->
| Q107493 <!-- Paluan, Occidental Mindoro --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175107000 -->
| Q107499 <!-- Rizal, Occidental Mindoro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175108000 -->
| Q107505 <!-- Sablayan, Occidental Mindoro --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175109000 -->
| Q107511 <!-- San Jose, Occidental Mindoro --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175110000 -->
| Q107519 <!-- Santa Cruz, Occidental Mindoro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175111000 -->
| Q107538 <!-- Baco, Oriental Mindoro --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175201000 -->
| Q107543 <!-- Bansud, Oriental Mindoro --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175202000 -->
| Q107550 <!-- Bongabong, Oriental Mindoro --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175203000 -->
| Q107554 <!-- Bulalacao, Oriental Mindoro --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175204000 -->
| Q107624 <!-- Calapan, Oriental Mindoro --> = 62 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175205000 -->
| Q107559 <!-- Gloria, Oriental Mindoro --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175206000 -->
| Q107567 <!-- Mansalay, Oriental Mindoro --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175207000 -->
| Q107573 <!-- Naujan, Oriental Mindoro --> = 70 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175208000 -->
| Q107578 <!-- Pinamalayan, Oriental Mindoro --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175209000 -->
| Q107585 <!-- Pola, Oriental Mindoro --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175210000 -->
| Q107593 <!-- Puerto Galera, Oriental Mindoro --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175211000 -->
| Q107598 <!-- Roxas, Oriental Mindoro --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175212000 -->
| Q107606 <!-- San Teodoro, Oriental Mindoro --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175213000 -->
| Q107612 <!-- Socorro, Oriental Mindoro --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175214000 -->
| Q107618 <!-- Victoria, Oriental Mindoro --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175215000 -->
| Q111338 <!-- Aborlan, Palawan --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175301000 -->
| Q111351 <!-- Agutaya, Palawan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175302000 -->
| Q111360 <!-- Araceli, Palawan --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175303000 -->
| Q111372 <!-- Balabac, Palawan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175304000 -->
| Q111378 <!-- Bataraza, Palawan --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175305000 -->
| Q111386 <!-- Brooke's Point, Palawan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175306000 -->
| Q111393 <!-- Busuanga, Palawan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175307000 -->
| Q111402 <!-- Cagayancillo, Palawan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175308000 -->
| Q111414 <!-- Coron, Palawan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175309000 -->
| Q111427 <!-- Culion, Palawan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175322000 -->
| Q111438 <!-- Cuyo, Palawan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175310000 -->
| Q111468 <!-- Dumaran, Palawan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175311000 -->
| Q111483 <!-- El Nido, Palawan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175312000 -->
| Q111495 <!-- Kalayaan, Palawan --> = 1 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175321000 -->
| Q111506 <!-- Linapacan, Palawan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175313000 -->
| Q111521 <!-- Magsaysay, Palawan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175314000 -->
| Q111535 <!-- Narra, Palawan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175315000 -->
| Q111739 <!-- Puerto Princesa --> = 66 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175316000 -->
| Q111662 <!-- Quezon, Palawan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175317000 -->
| Q111677 <!-- Rizal, Palawan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175323000 -->
| Q111689 <!-- Roxas, Palawan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175318000 -->
| Q111707 <!-- San Vicente, Palawan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175319000 -->
| Q111719 <!-- Sofronio Española, Palawan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175324000 -->
| Q111730 <!-- Taytay, Palawan --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175320000 -->
| Q174497 <!-- Alcantara, Romblon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175901000 -->
| Q174511 <!-- Banton, Romblon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175902000 -->
| Q174525 <!-- Cajidiocan, Romblon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175903000 -->
| Q174544 <!-- Calatrava, Romblon --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175904000 -->
| Q174562 <!-- Concepcion, Romblon --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175905000 -->
| Q174575 <!-- Corcuera, Romblon --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175906000 -->
| Q174591 <!-- Ferrol, Romblon --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175916000 -->
| Q174607 <!-- Looc, Romblon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175907000 -->
| Q174620 <!-- Magdiwang, Romblon --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175908000 -->
| Q174632 <!-- Odiongan, Romblon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175909000 -->
| Q174649 <!-- Romblon , Romblon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175910000 -->
| Q174659 <!-- San Agustin, Romblon --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175911000 -->
| Q174667 <!-- San Andres, Romblon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175912000 -->
| Q174676 <!-- San Fernando, Romblon --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175913000 -->
| Q174689 <!-- San Jose, Romblon --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175914000 -->
| Q174702 <!-- Santa Fe, Romblon --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175915000 -->
| Q174717 <!-- Santa Maria, Romblon --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/175917000 -->
| Q174149 <!-- Bulusan, Sorsogon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056204000 -->
| Q174226 <!-- Juban, Sorsogon --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056210000 -->
| Q174255 <!-- Pilar, Sorsogon --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056213000 -->
| Q174096 <!-- Sorsogon, Sorsogon --> = 64 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/056216000 -->
| Q434743 <!-- Altavas, Aklan --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060401000 -->
| Q626586 <!-- Balete, Aklan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060402000 -->
| Q569215 <!-- Banga, Aklan --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060403000 -->
| Q626645 <!-- Batan, Aklan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060404000 -->
| Q576805 <!-- Buruanga, Aklan --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060405000 -->
| Q626695 <!-- Ibajay, Aklan --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060406000 -->
| Q626721 <!-- Kalibo , Aklan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060407000 -->
| Q626746 <!-- Lezo, Aklan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060408000 -->
| Q626786 <!-- Libacao, Aklan --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060409000 -->
| Q626820 <!-- Madalag, Aklan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060410000 -->
| Q626873 <!-- Makato, Aklan --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060411000 -->
| Q626905 <!-- Malay, Aklan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060412000 -->
| Q626935 <!-- Malinao, Aklan --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060413000 -->
| Q626959 <!-- Nabas, Aklan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060414000 -->
| Q626992 <!-- New Washington, Aklan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060415000 -->
| Q627008 <!-- Numancia, Aklan --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060416000 -->
| Q627028 <!-- Tangalan, Aklan --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060417000 -->
| Q492119 <!-- Anini-y, Antique --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060601000 -->
| Q492155 <!-- Barbaza, Antique --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060602000 -->
| Q492263 <!-- Belison, Antique --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060603000 -->
| Q492325 <!-- Bugasong, Antique --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060604000 -->
| Q492363 <!-- Caluya, Antique --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060605000 -->
| Q492406 <!-- Culasi, Antique --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060606000 -->
| Q144779 <!-- Hamtic, Antique --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060608000 -->
| Q492479 <!-- Laua-an, Antique --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060609000 -->
| Q492516 <!-- Libertad, Antique --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060610000 -->
| Q492545 <!-- Pandan, Antique --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060611000 -->
| Q492577 <!-- Patnongon, Antique --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060612000 -->
| Q492619 <!-- San Jose, Antique --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060613000 -->
| Q492673 <!-- San Remigio, Antique --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060614000 -->
| Q492707 <!-- Sebaste, Antique --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060615000 -->
| Q492742 <!-- Sibalom, Antique --> = 76 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060616000 -->
| Q492780 <!-- Tibiao, Antique --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060617000 -->
| Q492817 <!-- Tobias Fornier, Antique --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060607000 -->
| Q492862 <!-- Valderrama, Antique --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/060618000 -->
| Q355953 <!-- Cuartero, Capiz --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061901000 -->
| Q355986 <!-- Dao, Capiz --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061902000 -->
| Q356019 <!-- Dumalag, Capiz --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061903000 -->
| Q356053 <!-- Dumarao, Capiz --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061904000 -->
| Q356081 <!-- Ivisan, Capiz --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061905000 -->
| Q356106 <!-- Jamindan, Capiz --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061906000 -->
| Q356153 <!-- Ma-ayon, Capiz --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061907000 -->
| Q356174 <!-- Mambusao, Capiz --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061908000 -->
| Q356204 <!-- Panay, Capiz --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061909000 -->
| Q356231 <!-- Panitan, Capiz --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061910000 -->
| Q356266 <!-- Pilar, Capiz --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061911000 -->
| Q356292 <!-- Pontevedra, Capiz --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061912000 -->
| Q356313 <!-- President Roxas, Capiz --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061913000 -->
| Q2209 <!-- Roxas, Capiz --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061914000 -->
| Q356338 <!-- Sapi-an, Capiz --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061915000 -->
| Q356368 <!-- Sigma, Capiz --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061916000 -->
| Q356398 <!-- Tapaz, Capiz --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/061917000 -->
| Q313781 <!-- Buenavista, Guimaras --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067901000 -->
| Q313802 <!-- Jordan, Guimaras --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067902000 -->
| Q313810 <!-- Nueva Valencia, Guimaras --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067903000 -->
| Q313825 <!-- San Lorenzo, Guimaras --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067904000 -->
| Q313844 <!-- Sibunag, Guimaras --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/067905000 -->
| Q274491 <!-- Ajuy, Iloilo --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063001000 -->
| Q274508 <!-- Alimodian, Iloilo --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063002000 -->
| Q274543 <!-- Anilao, Iloilo --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063003000 -->
| Q274557 <!-- Badiangan, Iloilo --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063004000 -->
| Q274578 <!-- Balasan, Iloilo --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063005000 -->
| Q274595 <!-- Banate, Iloilo --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063006000 -->
| Q82502 <!-- Barotac Nuevo, Iloilo --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063007000 -->
| Q82493 <!-- Barotac Viejo, Iloilo --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063008000 -->
| Q274654 <!-- Batad, Iloilo --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063009000 -->
| Q274671 <!-- Bingawan, Iloilo --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063010000 -->
| Q274693 <!-- Cabatuan, Iloilo --> = 68 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063012000 -->
| Q274713 <!-- Calinog, Iloilo --> = 59 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063013000 -->
| Q274731 <!-- Carles, Iloilo --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063014000 -->
| Q274749 <!-- Concepcion, Iloilo --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063015000 -->
| Q274780 <!-- Dingle, Iloilo --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063016000 -->
| Q274795 <!-- Dueñas, Iloilo --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063017000 -->
| Q74758 <!-- Dumangas, Iloilo --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063018000 -->
| Q82506 <!-- Estancia, Iloilo --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063019000 -->
| Q274847 <!-- Guimbal, Iloilo --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063020000 -->
| Q74755 <!-- Igbaras, Iloilo --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063021000 -->
| Q459787 <!-- Iloilo --> = 180 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063022000 -->
| Q82570 <!-- Janiuay, Iloilo --> = 60 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063023000 -->
| Q274907 <!-- Lambunao, Iloilo --> = 73 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063025000 -->
| Q274937 <!-- Leganes, Iloilo --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063026000 -->
| Q274961 <!-- Lemery, Iloilo --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063027000 -->
| Q274987 <!-- Leon, Iloilo --> = 85 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063028000 -->
| Q275015 <!-- Maasin, Iloilo --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063029000 -->
| Q74753 <!-- Miagao, Iloilo --> = 119 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063030000 -->
| Q275071 <!-- Mina, Iloilo --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063031000 -->
| Q275184 <!-- New Lucena, Iloilo --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063032000 -->
| Q275199 <!-- Oton, Iloilo --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063034000 -->
| Q1855693 <!-- Passi, Iloilo --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063035000 -->
| Q275221 <!-- Pavia, Iloilo --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063036000 -->
| Q275243 <!-- Pototan, Iloilo --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063037000 -->
| Q275264 <!-- San Dionisio, Iloilo --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063038000 -->
| Q275280 <!-- San Enrique, Iloilo --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063039000 -->
| Q275295 <!-- San Joaquin, Iloilo --> = 85 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063040000 -->
| Q275312 <!-- San Miguel, Iloilo --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063041000 -->
| Q275329 <!-- San Rafael, Iloilo --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063042000 -->
| Q275347 <!-- Santa Barbara, Iloilo --> = 60 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063043000 -->
| Q275368 <!-- Sara, Iloilo --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063044000 -->
| Q82497 <!-- Tigbauan, Iloilo --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063045000 -->
| Q275417 <!-- Tubungan, Iloilo --> = 48 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063046000 -->
| Q148064 <!-- Zarraga, Iloilo --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/063047000 -->
| Q5217 <!-- Bacolod --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/provinces/060000000 -->
| Q628297 <!-- Bago, Negros Occidental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064502000 -->
| Q195243 <!-- Binalbagan, Negros Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064503000 -->
| Q1020688 <!-- Cadiz, Negros Occidental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064504000 -->
| Q195258 <!-- Calatrava, Negros Occidental --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064505000 -->
| Q195272 <!-- Candoni, Negros Occidental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064506000 -->
| Q195287 <!-- Cauayan, Negros Occidental --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064507000 -->
| Q195304 <!-- Enrique B. Magalona, Negros Occidental --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064508000 -->
| Q1027743 <!-- Escalante, Negros Occidental --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064509000 -->
| Q1423846 <!-- Himamaylan, Negros Occidental --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064510000 -->
| Q195322 <!-- Hinigaran, Negros Occidental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064511000 -->
| Q195336 <!-- Hinoba-an, Negros Occidental --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064512000 -->
| Q195352 <!-- Ilog, Negros Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064513000 -->
| Q195373 <!-- Isabela, Negros Occidental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064514000 -->
| Q1026445 <!-- Kabankalan, Negros Occidental --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064515000 -->
| Q1789908 <!-- La Carlota, Negros Occidental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064516000 -->
| Q195397 <!-- La Castellana, Negros Occidental --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064517000 -->
| Q195418 <!-- Manapla, Negros Occidental --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064518000 -->
| Q195438 <!-- Moises Padilla, Negros Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064519000 -->
| Q195459 <!-- Murcia, Negros Occidental --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064520000 -->
| Q195477 <!-- Pontevedra, Negros Occidental --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064521000 -->
| Q195489 <!-- Pulupandan, Negros Occidental --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064522000 -->
| Q1787527 <!-- Sagay, Negros Occidental --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064523000 -->
| Q195503 <!-- Salvador Benedicto, Negros Occidental --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064532000 -->
| Q1025390 <!-- San Carlos, Negros Occidental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064524000 -->
| Q195523 <!-- San Enrique, Negros Occidental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064525000 -->
| Q1020696 <!-- Silay, Negros Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064526000 -->
| Q1027115 <!-- Sipalay, Negros Occidental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064527000 -->
| Q1027120 <!-- Talisay, Negros Occidental --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064528000 -->
| Q195549 <!-- Toboso, Negros Occidental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064529000 -->
| Q195569 <!-- Valladolid, Negros Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064530000 -->
| Q1026021 <!-- Victorias, Negros Occidental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/064531000 -->
| Q194822 <!-- Amlan, Negros Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074601000 -->
| Q194854 <!-- Ayungon, Negros Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074602000 -->
| Q194874 <!-- Bacong, Negros Oriental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074603000 -->
| Q628590 <!-- Bais, Negros Oriental --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074604000 -->
| Q194900 <!-- Basay, Negros Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074605000 -->
| Q812113 <!-- Bayawan, Negros Oriental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074606000 -->
| Q194916 <!-- Bindoy, Negros Oriental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074607000 -->
| Q991602 <!-- Canlaon, Negros Oriental --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074608000 -->
| Q194940 <!-- Dauin, Negros Oriental --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074609000 -->
| Q873377 <!-- Dumaguete, Negros Oriental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074610000 -->
| Q195197 <!-- Guihulngan, Negros Oriental --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074611000 -->
| Q194967 <!-- Jimalalud, Negros Oriental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074612000 -->
| Q194983 <!-- La Libertad, Negros Oriental --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074613000 -->
| Q195004 <!-- Mabinay, Negros Oriental --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074614000 -->
| Q195018 <!-- Manjuyod, Negros Oriental --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074615000 -->
| Q195040 <!-- Pamplona, Negros Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074616000 -->
| Q195056 <!-- San Jose, Negros Oriental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074617000 -->
| Q195074 <!-- Santa Catalina, Negros Oriental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074618000 -->
| Q195090 <!-- Siaton, Negros Oriental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074619000 -->
| Q195106 <!-- Sibulan, Negros Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074620000 -->
| Q1020705 <!-- Tanjay, Negros Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074621000 -->
| Q195121 <!-- Tayasan, Negros Oriental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074622000 -->
| Q195140 <!-- Valencia, Negros Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074623000 -->
| Q195164 <!-- Vallehermoso, Negros Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074624000 -->
| Q145673 <!-- Zamboanguita, Negros Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/074625000 -->
| Q404369 <!-- Alburquerque, Bohol --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071201000 -->
| Q404403 <!-- Alicia, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071202000 -->
| Q404434 <!-- Anda, Bohol --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071203000 -->
| Q404459 <!-- Antequera, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071204000 -->
| Q404489 <!-- Baclayon, Bohol --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071205000 -->
| Q404519 <!-- Balilihan, Bohol --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071206000 -->
| Q404549 <!-- Batuan, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071207000 -->
| Q404581 <!-- Bien Unido, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071248000 -->
| Q404604 <!-- Bilar, Bohol --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071208000 -->
| Q404623 <!-- Buenavista, Bohol --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071209000 -->
| Q404652 <!-- Calape, Bohol --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071210000 -->
| Q404680 <!-- Candijay, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071211000 -->
| Q241239 <!-- Carmen, Bohol --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071212000 -->
| Q404750 <!-- Catigbian, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071213000 -->
| Q404775 <!-- Clarin, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071214000 -->
| Q404799 <!-- Corella, Bohol --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071215000 -->
| Q404825 <!-- Cortes, Bohol --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071216000 -->
| Q404854 <!-- Dagohoy, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071217000 -->
| Q404882 <!-- Danao, Bohol --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071218000 -->
| Q404908 <!-- Dauis, Bohol --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071219000 -->
| Q404930 <!-- Dimiao, Bohol --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071220000 -->
| Q404951 <!-- Duero, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071221000 -->
| Q404976 <!-- Garcia Hernandez, Bohol --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071222000 -->
| Q405005 <!-- Getafe, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071226000 -->
| Q405058 <!-- Guindulman, Bohol --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071223000 -->
| Q405088 <!-- Inabanga, Bohol --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071224000 -->
| Q405110 <!-- Jagna, Bohol --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071225000 -->
| Q405141 <!-- Lila, Bohol --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071227000 -->
| Q405171 <!-- Loay, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071228000 -->
| Q405197 <!-- Loboc, Bohol --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071229000 -->
| Q405224 <!-- Loon, Bohol --> = 67 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071230000 -->
| Q405268 <!-- Mabini, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071231000 -->
| Q405303 <!-- Maribojoc, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071232000 -->
| Q178330 <!-- Panglao, Bohol --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071233000 -->
| Q405384 <!-- Pilar, Bohol --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071234000 -->
| Q405427 <!-- President Carlos P. Garcia, Bohol --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071235000 -->
| Q405472 <!-- Sagbayan, Bohol --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071236000 -->
| Q259298 <!-- San Isidro, Bohol --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071237000 -->
| Q405544 <!-- San Miguel, Bohol --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071238000 -->
| Q386388 <!-- Sevilla, Bohol --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071239000 -->
| Q405628 <!-- Sierra Bullones, Bohol --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071240000 -->
| Q405674 <!-- Sikatuna, Bohol --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071241000 -->
| Q1826 <!-- Tagbilaran, Bohol --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071242000 -->
| Q405714 <!-- Talibon, Bohol --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071243000 -->
| Q405749 <!-- Trinidad, Bohol --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071244000 -->
| Q405980 <!-- Tubigon, Bohol --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071245000 -->
| Q406015 <!-- Ubay, Bohol --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071246000 -->
| Q406046 <!-- Valencia, Bohol --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/071247000 -->
| Q315636 <!-- Alcantara, Cebu --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072201000 -->
| Q315655 <!-- Alcoy, Cebu --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072202000 -->
| Q315669 <!-- Alegria, Cebu --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072203000 -->
| Q315687 <!-- Aloguinsan, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072204000 -->
| Q315703 <!-- Argao, Cebu --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072205000 -->
| Q315719 <!-- Asturias, Cebu --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072206000 -->
| Q315733 <!-- Badian, Cebu --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072207000 -->
| Q315754 <!-- Balamban, Cebu --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072208000 -->
| Q315771 <!-- Bantayan, Cebu --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072209000 -->
| Q315790 <!-- Barili, Cebu --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072210000 -->
| Q890623 <!-- Bogo, Cebu --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072211000 -->
| Q315809 <!-- Boljoon, Cebu --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072212000 -->
| Q315827 <!-- Borbon, Cebu --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072213000 -->
| Q315851 <!-- Carcar, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072214000 -->
| Q315882 <!-- Carmen, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072215000 -->
| Q315900 <!-- Catmon, Cebu --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072216000 -->
| Q1467 <!-- Cebu --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072217000 -->
| Q315923 <!-- Compostela, Cebu --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072218000 -->
| Q315945 <!-- Consolacion, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072219000 -->
| Q315965 <!-- Cordova, Cebu --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072220000 -->
| Q315981 <!-- Daanbantayan, Cebu --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072221000 -->
| Q316001 <!-- Dalaguete, Cebu --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072222000 -->
| Q1159273 <!-- Danao, Cebu --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072223000 -->
| Q316019 <!-- Dumanjug, Cebu --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072224000 -->
| Q316037 <!-- Ginatilan, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072225000 -->
| Q574903 <!-- Lapu-Lapu --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072226000 -->
| Q316056 <!-- Liloan, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072227000 -->
| Q316080 <!-- Madridejos, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072228000 -->
| Q316101 <!-- Malabuyoc, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072229000 -->
| Q1889017 <!-- Mandaue --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072230000 -->
| Q316125 <!-- Medellin, Cebu --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072231000 -->
| Q316146 <!-- Minglanilla, Cebu --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072232000 -->
| Q316171 <!-- Moalboal, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072233000 -->
| Q316197 <!-- Naga, Cebu --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072234000 -->
| Q316230 <!-- Oslob, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072235000 -->
| Q316245 <!-- Pilar, Cebu --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072236000 -->
| Q316259 <!-- Pinamungahan, Cebu --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072237000 -->
| Q316275 <!-- Poro, Cebu --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072238000 -->
| Q316289 <!-- Ronda, Cebu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072239000 -->
| Q316303 <!-- Samboan, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072240000 -->
| Q316318 <!-- San Fernando, Cebu --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072241000 -->
| Q316332 <!-- San Francisco, Cebu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072242000 -->
| Q316350 <!-- San Remigio, Cebu --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072243000 -->
| Q316370 <!-- Santa Fe, Cebu --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072244000 -->
| Q316386 <!-- Santander, Cebu --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072245000 -->
| Q316404 <!-- Sibonga, Cebu --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072246000 -->
| Q316432 <!-- Sogod, Cebu --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072247000 -->
| Q316453 <!-- Tabogon, Cebu --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072248000 -->
| Q316474 <!-- Tabuelan, Cebu --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072249000 -->
| Q316500 <!-- Talisay, Cebu --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072250000 -->
| Q316527 <!-- Toledo, Cebu --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072251000 -->
| Q316547 <!-- Tuburan, Cebu --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072252000 -->
| Q316564 <!-- Tudela, Cebu --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/072253000 -->
| Q174305 <!-- Enrique Villanueva, Siquijor --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076101000 -->
| Q174317 <!-- Larena, Siquijor --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076102000 -->
| Q174332 <!-- Lazi, Siquijor --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076103000 -->
| Q174343 <!-- Maria, Siquijor --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076104000 -->
| Q174354 <!-- San Juan, Siquijor --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076105000 -->
| Q174373 <!-- Siquijor, Siquijor --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/076106000 -->
| Q406163 <!-- Almeria, Biliran --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087801000 -->
| Q406186 <!-- Biliran, Biliran --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087802000 -->
| Q406226 <!-- Cabucgayan, Biliran --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087803000 -->
| Q406267 <!-- Caibiran, Biliran --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087804000 -->
| Q406317 <!-- Culaba, Biliran --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087805000 -->
| Q406353 <!-- Kawayan, Biliran --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087806000 -->
| Q406393 <!-- Maripipi, Biliran --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087807000 -->
| Q277211 <!-- Naval, Biliran --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/087808000 -->
| Q313880 <!-- Arteche, Eastern Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082601000 -->
| Q313904 <!-- Balangiga, Eastern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082602000 -->
| Q313914 <!-- Balangkayan, Eastern Samar --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082603000 -->
| Q894059 <!-- Borongan, Eastern Samar --> = 61 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082604000 -->
| Q313926 <!-- Can-avid, Eastern Samar --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082605000 -->
| Q313939 <!-- Dolores, Eastern Samar --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082606000 -->
| Q313951 <!-- General MacArthur, Eastern Samar --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082607000 -->
| Q313967 <!-- Giporlos, Eastern Samar --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082608000 -->
| Q313984 <!-- Guiuan, Eastern Samar --> = 60 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082609000 -->
| Q314002 <!-- Hernani, Eastern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082610000 -->
| Q314021 <!-- Jipapad, Eastern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082611000 -->
| Q314046 <!-- Lawaan, Eastern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082612000 -->
| Q314070 <!-- Llorente, Eastern Samar --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082613000 -->
| Q314096 <!-- Maslog, Eastern Samar --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082614000 -->
| Q314117 <!-- Maydolong, Eastern Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082615000 -->
| Q314129 <!-- Mercedes, Eastern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082616000 -->
| Q314154 <!-- Oras, Eastern Samar --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082617000 -->
| Q314175 <!-- Quinapondan, Eastern Samar --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082618000 -->
| Q314197 <!-- Salcedo, Eastern Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082619000 -->
| Q314220 <!-- San Julian, Eastern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082620000 -->
| Q314239 <!-- San Policarpo, Eastern Samar --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082621000 -->
| Q314257 <!-- Sulat, Eastern Samar --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082622000 -->
| Q205677 <!-- Taft, Eastern Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/082623000 -->
| Q212877 <!-- Abuyog, Leyte --> = 63 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083701000 -->
| Q212888 <!-- Alangalang, Leyte --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083702000 -->
| Q212896 <!-- Albuera, Leyte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083703000 -->
| Q212907 <!-- Babatngon, Leyte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083705000 -->
| Q212924 <!-- Barugo, Leyte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083706000 -->
| Q212935 <!-- Bato, Leyte --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083707000 -->
| Q812117 <!-- Baybay, Leyte --> = 92 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083708000 -->
| Q212945 <!-- Burauen, Leyte --> = 77 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083710000 -->
| Q212951 <!-- Calubian, Leyte --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083713000 -->
| Q212958 <!-- Capoocan, Leyte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083714000 -->
| Q212969 <!-- Carigara, Leyte --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083715000 -->
| Q212981 <!-- Dagami, Leyte --> = 65 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083717000 -->
| Q212988 <!-- Dulag, Leyte --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083718000 -->
| Q213006 <!-- Hilongos, Leyte --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083719000 -->
| Q213024 <!-- Hindang, Leyte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083720000 -->
| Q213042 <!-- Inopacan, Leyte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083721000 -->
| Q213060 <!-- Isabel, Leyte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083722000 -->
| Q213086 <!-- Jaro, Leyte --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083723000 -->
| Q213101 <!-- Javier, Leyte --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083724000 -->
| Q213113 <!-- Julita, Leyte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083725000 -->
| Q213130 <!-- Kananga, Leyte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083726000 -->
| Q213144 <!-- La Paz, Leyte --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083728000 -->
| Q213160 <!-- Leyte, Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083729000 -->
| Q213174 <!-- MacArthur, Leyte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083730000 -->
| Q213190 <!-- Mahaplag, Leyte --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083731000 -->
| Q213209 <!-- Matag-ob, Leyte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083733000 -->
| Q213227 <!-- Matalom, Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083734000 -->
| Q213245 <!-- Mayorga, Leyte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083735000 -->
| Q213261 <!-- Merida, Leyte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083736000 -->
| Q1014782 <!-- Ormoc --> = 85 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083738000 -->
| Q213281 <!-- Palo, Leyte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083739000 -->
| Q213303 <!-- Palompon, Leyte --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083740000 -->
| Q213323 <!-- Pastrana, Leyte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083741000 -->
| Q213341 <!-- San Isidro, Leyte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083742000 -->
| Q213357 <!-- San Miguel, Leyte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083743000 -->
| Q213378 <!-- Santa Fe, Leyte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083744000 -->
| Q213400 <!-- Tabango, Leyte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083745000 -->
| Q213420 <!-- Tabontabon, Leyte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083746000 -->
| Q40626 <!-- Tacloban --> = 138 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083747000 -->
| Q213431 <!-- Tanauan, Leyte --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083748000 -->
| Q213442 <!-- Tolosa, Leyte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083749000 -->
| Q213455 <!-- Tunga, Leyte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083750000 -->
| Q213463 <!-- Villaba, Leyte --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/083751000 -->
| Q174784 <!-- Allen, Northern Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084801000 -->
| Q174801 <!-- Biri, Northern Samar --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084802000 -->
| Q174822 <!-- Bobon, Northern Samar --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084803000 -->
| Q174871 <!-- Capul, Northern Samar --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084804000 -->
| Q174886 <!-- Catarman , Northern Samar --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084805000 -->
| Q174906 <!-- Catubig, Northern Samar --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084806000 -->
| Q174919 <!-- Gamay, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084807000 -->
| Q174940 <!-- Laoang, Northern Samar --> = 56 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084808000 -->
| Q174962 <!-- Lapinig, Northern Samar --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084809000 -->
| Q174987 <!-- Las Navas, Northern Samar --> = 53 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084810000 -->
| Q175008 <!-- Lavezares, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084811000 -->
| Q175031 <!-- Lope de Vega, Northern Samar --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084824000 -->
| Q175054 <!-- Mapanas, Northern Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084812000 -->
| Q175082 <!-- Mondragon, Northern Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084813000 -->
| Q175100 <!-- Palapag, Northern Samar --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084814000 -->
| Q175115 <!-- Pambujan, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084815000 -->
| Q175136 <!-- Rosario, Northern Samar --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084816000 -->
| Q175163 <!-- San Antonio, Northern Samar --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084817000 -->
| Q175183 <!-- San Isidro, Northern Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084818000 -->
| Q175203 <!-- San Jose, Northern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084819000 -->
| Q175230 <!-- San Roque, Northern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084820000 -->
| Q175247 <!-- San Vicente, Northern Samar --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084821000 -->
| Q175267 <!-- Silvino Lobos, Northern Samar --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084822000 -->
| Q175283 <!-- Victoria, Northern Samar --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/084823000 -->
| Q816088 <!-- Almagro, Samar --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086001000 -->
| Q809957 <!-- Basey, Samar --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086002000 -->
| Q577336 <!-- Calbayog, Samar --> = 157 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086003000 -->
| Q816128 <!-- Calbiga, Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086004000 -->
| Q1020709 <!-- Catbalogan, Samar --> = 57 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086005000 -->
| Q816142 <!-- Daram, Samar --> = 58 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086006000 -->
| Q816160 <!-- Gandara, Samar --> = 69 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086007000 -->
| Q816184 <!-- Hinabangan, Samar --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086008000 -->
| Q816207 <!-- Jiabong, Samar --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086009000 -->
| Q816240 <!-- Marabut, Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086010000 -->
| Q816267 <!-- Matuguinao, Samar --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086011000 -->
| Q816296 <!-- Motiong, Samar --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086012000 -->
| Q816320 <!-- Pagsanghan, Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086026000 -->
| Q816342 <!-- Paranas, Samar --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086022000 -->
| Q252184 <!-- Pinabacdao, Samar --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086013000 -->
| Q816396 <!-- San Jorge, Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086025000 -->
| Q816413 <!-- San Jose de Buan, Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086014000 -->
| Q816435 <!-- San Sebastian, Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086015000 -->
| Q816454 <!-- Santa Margarita, Samar --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086016000 -->
| Q816471 <!-- Santa Rita, Samar --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086017000 -->
| Q608320 <!-- Santo Niño, Samar --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086018000 -->
| Q126346 <!-- Tagapul-an, Samar --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086024000 -->
| Q816519 <!-- Talalora, Samar --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086019000 -->
| Q816542 <!-- Tarangnan, Samar --> = 41 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086020000 -->
| Q816564 <!-- Villareal, Samar --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086021000 -->
| Q229664 <!-- Zumarraga, Samar --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086023000 -->
| Q173608 <!-- Anahawan, Southern Leyte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086401000 -->
| Q173622 <!-- Bontoc, Southern Leyte --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086402000 -->
| Q173632 <!-- Hinunangan, Southern Leyte --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086403000 -->
| Q173641 <!-- Hinundayan, Southern Leyte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086404000 -->
| Q173655 <!-- Libagon, Southern Leyte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086405000 -->
| Q173665 <!-- Liloan, Southern Leyte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086406000 -->
| Q173678 <!-- Limasawa, Southern Leyte --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086419000 -->
| Q1025387 <!-- Maasin, Southern Leyte --> = 70 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086407000 -->
| Q173688 <!-- Macrohon, Southern Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086408000 -->
| Q173701 <!-- Malitbog, Southern Leyte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086409000 -->
| Q173713 <!-- Padre Burgos, Southern Leyte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086410000 -->
| Q173723 <!-- Pintuyan, Southern Leyte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086411000 -->
| Q173735 <!-- Saint Bernard, Southern Leyte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086412000 -->
| Q173745 <!-- San Francisco, Southern Leyte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086413000 -->
| Q173754 <!-- San Juan, Southern Leyte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086414000 -->
| Q173763 <!-- San Ricardo, Southern Leyte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086415000 -->
| Q173774 <!-- Silago, Southern Leyte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086416000 -->
| Q173792 <!-- Sogod, Southern Leyte --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086417000 -->
| Q173811 <!-- Tomas Oppus, Southern Leyte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/086418000 -->
| Q132482 <!-- Baliguian, Zamboanga del Norte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097224000 -->
| Q1014775 <!-- Dapitan, Zamboanga del Norte --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097201000 -->
| Q432169 <!-- Dipolog, Zamboanga del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097202000 -->
| Q132496 <!-- Godod, Zamboanga del Norte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097225000 -->
| Q132507 <!-- Gutalac, Zamboanga del Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097223000 -->
| Q132520 <!-- Jose Dalman, Zamboanga del Norte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097222000 -->
| Q132523 <!-- Kalawit, Zamboanga del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097227000 -->
| Q132527 <!-- Katipunan, Zamboanga del Norte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097203000 -->
| Q132532 <!-- La Libertad, Zamboanga del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097204000 -->
| Q132535 <!-- Labason, Zamboanga del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097205000 -->
| Q132540 <!-- Leon B. Postigo, Zamboanga del Norte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097226000 -->
| Q132553 <!-- Liloy, Zamboanga del Norte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097206000 -->
| Q132561 <!-- Manukan, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097207000 -->
| Q132566 <!-- Mutia, Zamboanga del Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097208000 -->
| Q132570 <!-- Piñan, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097209000 -->
| Q132574 <!-- Polanco, Zamboanga del Norte --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097210000 -->
| Q132578 <!-- President Manuel A. Roxas, Zamboanga del Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097211000 -->
| Q132583 <!-- Rizal, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097212000 -->
| Q132586 <!-- Salug, Zamboanga del Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097213000 -->
| Q132591 <!-- Sergio Osmeña Sr., Zamboanga del Norte --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097214000 -->
| Q132594 <!-- Siayan, Zamboanga del Norte --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097215000 -->
| Q132599 <!-- Sibuco, Zamboanga del Norte --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097216000 -->
| Q132601 <!-- Sibutad, Zamboanga del Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097217000 -->
| Q132605 <!-- Sindangan, Zamboanga del Norte --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097218000 -->
| Q132610 <!-- Siocon, Zamboanga del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097219000 -->
| Q132613 <!-- Sirawai, Zamboanga del Norte --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097220000 -->
| Q132617 <!-- Tampilisan, Zamboanga del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097221000 -->
| Q132015 <!-- Aurora, Zamboanga del Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097302000 -->
| Q132032 <!-- Bayog, Zamboanga del Sur --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097303000 -->
| Q132057 <!-- Dimataling, Zamboanga del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097305000 -->
| Q132077 <!-- Dinas, Zamboanga del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097306000 -->
| Q132104 <!-- Dumalinao, Zamboanga del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097307000 -->
| Q132126 <!-- Dumingag, Zamboanga del Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097308000 -->
| Q132141 <!-- Guipos, Zamboanga del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097343000 -->
| Q132155 <!-- Josefina, Zamboanga del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097337000 -->
| Q132161 <!-- Kumalarang, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097311000 -->
| Q132184 <!-- Labangan, Zamboanga del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097312000 -->
| Q132200 <!-- Lakewood, Zamboanga del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097333000 -->
| Q132215 <!-- Lapuyan, Zamboanga del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097313000 -->
| Q132230 <!-- Mahayag, Zamboanga del Sur --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097315000 -->
| Q132244 <!-- Margosatubig, Zamboanga del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097317000 -->
| Q132262 <!-- Midsalip, Zamboanga del Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097318000 -->
| Q132271 <!-- Molave, Zamboanga del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097319000 -->
| Q874270 <!-- Pagadian, Zamboanga del Sur --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097322000 -->
| Q132284 <!-- Pitogo, Zamboanga del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097338000 -->
| Q132301 <!-- Ramon Magsaysay, Zamboanga del Sur --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097323000 -->
| Q132317 <!-- San Miguel, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097324000 -->
| Q132337 <!-- San Pablo, Zamboanga del Sur --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097325000 -->
| Q132353 <!-- Sominot, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097340000 -->
| Q132371 <!-- Tabina, Zamboanga del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097327000 -->
| Q132391 <!-- Tambulig, Zamboanga del Sur --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097328000 -->
| Q132403 <!-- Tigbao, Zamboanga del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097344000 -->
| Q132417 <!-- Tukuran, Zamboanga del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097330000 -->
| Q132432 <!-- Vincenzo A. Sagun, Zamboanga del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097341000 -->
| Q1629 <!-- Zamboanga --> = 98 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/097332000 -->
| Q131797 <!-- Alicia, Zamboanga Sibugay --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098301000 -->
| Q131811 <!-- Buug, Zamboanga Sibugay --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098302000 -->
| Q131816 <!-- Diplahan, Zamboanga Sibugay --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098303000 -->
| Q131838 <!-- Imelda, Zamboanga Sibugay --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098304000 -->
| Q131850 <!-- Ipil, Zamboanga Sibugay --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098305000 -->
| Q131870 <!-- Kabasalan, Zamboanga Sibugay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098306000 -->
| Q131892 <!-- Mabuhay, Zamboanga Sibugay --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098307000 -->
| Q131906 <!-- Malangas, Zamboanga Sibugay --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098308000 -->
| Q131917 <!-- Naga, Zamboanga Sibugay --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098309000 -->
| Q131926 <!-- Olutanga, Zamboanga Sibugay --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098310000 -->
| Q131941 <!-- Payao, Zamboanga Sibugay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098311000 -->
| Q131954 <!-- Roseller Lim, Zamboanga Sibugay --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098312000 -->
| Q124780 <!-- Siay, Zamboanga Sibugay --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098313000 -->
| Q131968 <!-- Talusan, Zamboanga Sibugay --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098314000 -->
| Q131975 <!-- Titay, Zamboanga Sibugay --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098315000 -->
| Q131984 <!-- Tungawan, Zamboanga Sibugay --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/098316000 -->
| Q356943 <!-- Baungon, Bukidnon --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101301000 -->
| Q356971 <!-- Cabanglasan, Bukidnon --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101322000 -->
| Q356997 <!-- Damulog, Bukidnon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101302000 -->
| Q357021 <!-- Dangcagan, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101303000 -->
| Q357053 <!-- Don Carlos, Bukidnon --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101304000 -->
| Q357075 <!-- Impasug-ong, Bukidnon --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101305000 -->
| Q357100 <!-- Kadingilan, Bukidnon --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101306000 -->
| Q357124 <!-- Kalilangan, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101307000 -->
| Q357152 <!-- Kibawe, Bukidnon --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101308000 -->
| Q357175 <!-- Kitaotao, Bukidnon --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101309000 -->
| Q357198 <!-- Lantapan, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101310000 -->
| Q357226 <!-- Libona, Bukidnon --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101311000 -->
| Q1856 <!-- Malaybalay, Bukidnon --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101312000 -->
| Q357252 <!-- Malitbog, Bukidnon --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101313000 -->
| Q357272 <!-- Manolo Fortich, Bukidnon --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101314000 -->
| Q357299 <!-- Maramag, Bukidnon --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101315000 -->
| Q357311 <!-- Pangantucan, Bukidnon --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101316000 -->
| Q357342 <!-- Quezon, Bukidnon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101317000 -->
| Q357371 <!-- San Fernando, Bukidnon --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101318000 -->
| Q357396 <!-- Sumilao, Bukidnon --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101319000 -->
| Q357420 <!-- Talakag, Bukidnon --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101320000 -->
| Q2158 <!-- Valencia, Bukidnon --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101321000 -->
| Q356442 <!-- Catarman, Camiguin --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101801000 -->
| Q356472 <!-- Guinsiliban, Camiguin --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101802000 -->
| Q176033 <!-- Mahinog, Camiguin --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101803000 -->
| Q356518 <!-- Mambajao, Camiguin --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101804000 -->
| Q356549 <!-- Sagay, Camiguin --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/101805000 -->
| Q274150 <!-- Bacolod, Lanao del Norte --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103501000 -->
| Q274164 <!-- Baloi, Lanao del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103502000 -->
| Q274173 <!-- Baroy, Lanao del Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103503000 -->
| Q285488 <!-- Iligan --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103504000 -->
| Q274186 <!-- Kapatagan, Lanao del Norte --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103505000 -->
| Q274197 <!-- Kauswagan, Lanao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103507000 -->
| Q274205 <!-- Kolambugan, Lanao del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103508000 -->
| Q274215 <!-- Lala, Lanao del Norte --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103509000 -->
| Q274230 <!-- Linamon, Lanao del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103510000 -->
| Q274243 <!-- Magsaysay, Lanao del Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103511000 -->
| Q274260 <!-- Maigo, Lanao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103512000 -->
| Q274272 <!-- Matungao, Lanao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103513000 -->
| Q274287 <!-- Munai, Lanao del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103514000 -->
| Q274299 <!-- Nunungan, Lanao del Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103515000 -->
| Q274313 <!-- Pantao Ragat, Lanao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103516000 -->
| Q274329 <!-- Pantar, Lanao del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103523000 -->
| Q274343 <!-- Poona Piagapo, Lanao del Norte --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103517000 -->
| Q274357 <!-- Salvador, Lanao del Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103518000 -->
| Q274369 <!-- Sapad, Lanao del Norte --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103519000 -->
| Q274387 <!-- Sultan Naga Dimaporo, Lanao del Norte --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103506000 -->
| Q274406 <!-- Tagoloan, Lanao del Norte --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103520000 -->
| Q274427 <!-- Tangcal, Lanao del Norte --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103521000 -->
| Q274439 <!-- Tubod, Lanao del Norte --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/103522000 -->
| Q155502 <!-- Aloran, Misamis Occidental --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104201000 -->
| Q196056 <!-- Baliangao, Misamis Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104202000 -->
| Q196076 <!-- Bonifacio, Misamis Occidental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104203000 -->
| Q196097 <!-- Calamba, Misamis Occidental --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104204000 -->
| Q196114 <!-- Clarin, Misamis Occidental --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104205000 -->
| Q196129 <!-- Concepcion, Misamis Occidental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104206000 -->
| Q196145 <!-- Don Victoriano Chiongbian, Misamis Occidental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104217000 -->
| Q196158 <!-- Jimenez, Misamis Occidental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104207000 -->
| Q196173 <!-- Lopez Jaena, Misamis Occidental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104208000 -->
| Q1067897 <!-- Oroquieta, Misamis Occidental --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104209000 -->
| Q263837 <!-- Ozamiz, Misamis Occidental --> = 51 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104210000 -->
| Q196191 <!-- Panaon, Misamis Occidental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104211000 -->
| Q196207 <!-- Plaridel, Misamis Occidental --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104212000 -->
| Q196222 <!-- Sapang Dalaga, Misamis Occidental --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104213000 -->
| Q196233 <!-- Sinacaban, Misamis Occidental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104214000 -->
| Q1026277 <!-- Tangub, Misamis Occidental --> = 55 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104215000 -->
| Q196248 <!-- Tudela, Misamis Occidental --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104216000 -->
| Q195623 <!-- Alubijid, Misamis Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/citimuni/104300000 -->
| Q195637 <!-- Balingasag, Misamis Oriental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104302000 -->
| Q195650 <!-- Balingoan, Misamis Oriental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104303000 -->
| Q195663 <!-- Binuangan, Misamis Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104304000 -->
| Q1645 <!-- Cagayan de Oro --> = 80 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104305000 -->
| Q195676 <!-- Claveria, Misamis Oriental --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104306000 -->
| Q195686 <!-- El Salvador, Misamis Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104307000 -->
| Q1525029 <!-- Gingoog, Misamis Oriental --> = 79 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104308000 -->
| Q195696 <!-- Gitagum, Misamis Oriental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104309000 -->
| Q195709 <!-- Initao, Misamis Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104310000 -->
| Q195717 <!-- Jasaan, Misamis Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104311000 -->
| Q195726 <!-- Kinoguitan, Misamis Oriental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104312000 -->
| Q195740 <!-- Lagonglong, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104313000 -->
| Q195755 <!-- Laguindingan, Misamis Oriental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104314000 -->
| Q195767 <!-- Libertad, Misamis Oriental --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104315000 -->
| Q195780 <!-- Lugait, Misamis Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104316000 -->
| Q195799 <!-- Magsaysay, Misamis Oriental --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104318000 -->
| Q195815 <!-- Manticao, Misamis Oriental --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104317000 -->
| Q195834 <!-- Medina, Misamis Oriental --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104319000 -->
| Q195855 <!-- Naawan, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104320000 -->
| Q195870 <!-- Opol, Misamis Oriental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104321000 -->
| Q195883 <!-- Salay, Misamis Oriental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104322000 -->
| Q195899 <!-- Sugbongcogon, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104323000 -->
| Q1026274 <!-- Tagoloan, Misamis Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104324000 -->
| Q195917 <!-- Talisayan, Misamis Oriental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104325000 -->
| Q195937 <!-- Villanueva, Misamis Oriental --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/104326000 -->
| Q627390 <!-- Buenavista, Agusan del Norte --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160201000 -->
| Q1686 <!-- Butuan --> = 86 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160202000 -->
| Q1692 <!-- Cabadbaran, Agusan del Norte --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160203000 -->
| Q627434 <!-- Carmen, Agusan del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160204000 -->
| Q627461 <!-- Jabonga, Agusan del Norte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160205000 -->
| Q627495 <!-- Kitcharao, Agusan del Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160206000 -->
| Q627529 <!-- Las Nieves, Agusan del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160207000 -->
| Q627572 <!-- Magallanes, Agusan del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160208000 -->
| Q627604 <!-- Nasipit, Agusan del Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160209000 -->
| Q627638 <!-- Remedios T. Romualdez, Agusan del Norte --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160212000 -->
| Q588955 <!-- Santiago, Agusan del Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160210000 -->
| Q176975 <!-- Tubay, Agusan del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160211000 -->
| Q1694 <!-- Bayugan, Agusan del Sur --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160301000 -->
| Q627049 <!-- Bunawan, Agusan del Sur --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160302000 -->
| Q627077 <!-- Esperanza, Agusan del Sur --> = 47 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160303000 -->
| Q627107 <!-- La Paz, Agusan del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160304000 -->
| Q627120 <!-- Loreto, Agusan del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160305000 -->
| Q627144 <!-- Prosperidad, Agusan del Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160306000 -->
| Q627167 <!-- Rosario, Agusan del Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160307000 -->
| Q627190 <!-- San Francisco, Agusan del Sur --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160308000 -->
| Q627210 <!-- San Luis, Agusan del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160309000 -->
| Q627231 <!-- Santa Josefa, Agusan del Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160310000 -->
| Q627260 <!-- Sibagat, Agusan del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160314000 -->
| Q627286 <!-- Talacogon, Agusan del Sur --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160311000 -->
| Q627320 <!-- Trento, Agusan del Sur --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160312000 -->
| Q627349 <!-- Veruela, Agusan del Sur --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/160313000 -->
| Q314298 <!-- Basilisa, Dinagat Islands --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168501000 -->
| Q314318 <!-- Cagdianao, Dinagat Islands --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168502000 -->
| Q314336 <!-- Dinagat, Dinagat Islands --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168503000 -->
| Q314345 <!-- Libjo, Dinagat Islands --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168504000 -->
| Q314356 <!-- Loreto, Dinagat Islands --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168505000 -->
| Q251691 <!-- San Jose, Dinagat Islands --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168506000 -->
| Q314374 <!-- Tubajon, Dinagat Islands --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/168507000 -->
| Q155706 <!-- Alegria, Surigao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166701000 -->
| Q155720 <!-- Bacuag, Surigao del Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166702000 -->
| Q155735 <!-- Burgos, Surigao del Norte --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166704000 -->
| Q155748 <!-- Claver, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166706000 -->
| Q155763 <!-- Dapa, Surigao del Norte --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166707000 -->
| Q28735 <!-- Del Carmen, Surigao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166708000 -->
| Q155784 <!-- General Luna, Surigao del Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166710000 -->
| Q155795 <!-- Gigaquit, Surigao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166711000 -->
| Q155808 <!-- Mainit, Surigao del Norte --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166714000 -->
| Q155819 <!-- Malimono, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166715000 -->
| Q155830 <!-- Pilar, Surigao del Norte --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166716000 -->
| Q155839 <!-- Placer, Surigao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166717000 -->
| Q155849 <!-- San Benito, Surigao del Norte --> = 6 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166718000 -->
| Q155864 <!-- San Francisco , Surigao del Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166719000 -->
| Q155876 <!-- San Isidro, Surigao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166720000 -->
| Q28958 <!-- Santa Monica , Surigao del Norte --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166721000 -->
| Q155905 <!-- Sison, Surigao del Norte --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166722000 -->
| Q155917 <!-- Socorro, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166723000 -->
| Q1019949 <!-- Surigao, Surigao del Norte --> = 54 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166724000 -->
| Q155934 <!-- Tagana-an, Surigao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166725000 -->
| Q155946 <!-- Tubod, Surigao del Norte --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166727000 -->
| Q155471 <!-- Barobo, Surigao del Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166801000 -->
| Q155499 <!-- Bayabas, Surigao del Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166802000 -->
| Q866414 <!-- Bislig, Surigao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166803000 -->
| Q155524 <!-- Cagwait, Surigao del Sur --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166804000 -->
| Q155536 <!-- Cantilan, Surigao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166805000 -->
| Q155548 <!-- Carmen, Surigao del Sur --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166806000 -->
| Q155558 <!-- Carrascal, Surigao del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166807000 -->
| Q155568 <!-- Cortes, Surigao del Sur --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166808000 -->
| Q155576 <!-- Hinatuan, Surigao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166809000 -->
| Q155582 <!-- Lanuza, Surigao del Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166810000 -->
| Q155590 <!-- Lianga, Surigao del Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166811000 -->
| Q155598 <!-- Lingig, Surigao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166812000 -->
| Q155605 <!-- Madrid, Surigao del Sur --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166813000 -->
| Q155611 <!-- Marihatag, Surigao del Sur --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166814000 -->
| Q155618 <!-- San Agustin, Surigao del Sur --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166815000 -->
| Q155625 <!-- San Miguel, Surigao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166816000 -->
| Q155633 <!-- Tagbina, Surigao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166817000 -->
| Q155648 <!-- Tago, Surigao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166818000 -->
| Q155674 <!-- Tandag, Surigao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/166819000 -->
| Q315450 <!-- Compostela, Davao de Oro --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118201000 -->
| Q315468 <!-- Laak, Davao de Oro --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118202000 -->
| Q187225 <!-- Mabini, Davao de Oro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118203000 -->
| Q315497 <!-- Maco, Davao de Oro --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118204000 -->
| Q315512 <!-- Maragusan, Davao de Oro --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118205000 -->
| Q315524 <!-- Mawab, Davao de Oro --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118206000 -->
| Q315543 <!-- Monkayo, Davao de Oro --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118207000 -->
| Q315557 <!-- Montevista, Davao de Oro --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118208000 -->
| Q315570 <!-- Nabunturan, Davao de Oro --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118209000 -->
| Q315582 <!-- New Bataan, Davao de Oro --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118210000 -->
| Q315598 <!-- Pantukan, Davao de Oro --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118211000 -->
| Q314393 <!-- Asuncion, Davao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112301000 -->
| Q314410 <!-- Braulio E. Dujali, Davao del Norte --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112323000 -->
| Q314422 <!-- Carmen, Davao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112303000 -->
| Q314438 <!-- Kapalong, Davao del Norte --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112305000 -->
| Q314452 <!-- New Corella, Davao del Norte --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112314000 -->
| Q967367 <!-- Panabo, Davao del Norte --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112315000 -->
| Q1020674 <!-- Samal, Davao del Norte --> = 46 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112317000 -->
| Q314468 <!-- San Isidro, Davao del Norte --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112324000 -->
| Q314486 <!-- Santo Tomas, Davao del Norte --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112318000 -->
| Q725168 <!-- Tagum, Davao del Norte --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112319000 -->
| Q314501 <!-- Talaingod, Davao del Norte --> = 3 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112322000 -->
| Q314778 <!-- Bansalan, Davao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112401000 -->
| Q1473 <!-- Davao --> = 182 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112402000 -->
| Q1020939 <!-- Digos, Davao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112403000 -->
| Q314808 <!-- Hagonoy, Davao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112404000 -->
| Q314844 <!-- Kiblawan, Davao del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112406000 -->
| Q314864 <!-- Magsaysay, Davao del Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112407000 -->
| Q314885 <!-- Malalag, Davao del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112408000 -->
| Q314923 <!-- Matanao, Davao del Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112410000 -->
| Q314944 <!-- Padada, Davao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112411000 -->
| Q314965 <!-- Santa Cruz, Davao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112412000 -->
| Q315014 <!-- Sulop, Davao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112414000 -->
| Q314796 <!-- Don Marcelino, Davao Occidental --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118601000 -->
| Q314824 <!-- Jose Abad Santos, Davao Occidental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118602000 -->
| Q314907 <!-- Malita, Davao Occidental --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118603000 -->
| Q314980 <!-- Santa Maria, Davao Occidental --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118604000 -->
| Q314999 <!-- Sarangani, Davao Occidental --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/118605000 -->
| Q314522 <!-- Baganga, Davao Oriental --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112501000 -->
| Q314542 <!-- Banaybanay, Davao Oriental --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112502000 -->
| Q314574 <!-- Boston, Davao Oriental --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112503000 -->
| Q314593 <!-- Caraga, Davao Oriental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112504000 -->
| Q314619 <!-- Cateel, Davao Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112505000 -->
| Q314632 <!-- Governor Generoso, Davao Oriental --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112506000 -->
| Q314653 <!-- Lupon, Davao Oriental --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112507000 -->
| Q314671 <!-- Manay, Davao Oriental --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112508000 -->
| Q314686 <!-- Mati, Davao Oriental --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112505000 -->
| Q314721 <!-- San Isidro, Davao Oriental --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112510000 -->
| Q314745 <!-- Tarragona, Davao Oriental --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/112511000 -->
| Q315042 <!-- Alamada, Cotabato --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124701000 -->
| Q315061 <!-- Aleosan, Cotabato --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124717000 -->
| Q315081 <!-- Antipas, Cotabato --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124715000 -->
| Q315098 <!-- Arakan, Cotabato --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124718000 -->
| Q315121 <!-- Banisilan, Cotabato --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124716000 -->
| Q315144 <!-- Carmen, Cotabato --> = 28 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124702000 -->
| Q315164 <!-- Kabacan, Cotabato --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124703000 -->
| Q583137 <!-- Kidapawan, Cotabato --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124704000 -->
| Q315190 <!-- Libungan, Cotabato --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124705000 -->
| Q267975 <!-- Magpet, Cotabato --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124706000 -->
| Q315244 <!-- Makilala, Cotabato --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124707000 -->
| Q315267 <!-- Matalam, Cotabato --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124708000 -->
| Q315283 <!-- Midsayap, Cotabato --> = 57 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124709000 -->
| Q315213 <!-- M'lang, Cotabato --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124710000 -->
| Q304654 <!-- Pigkawayan, Cotabato --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124711000 -->
| Q315314 <!-- Pikit, Cotabato --> = 42 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124712000 -->
| Q315334 <!-- President Roxas, Cotabato --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124713000 -->
| Q315345 <!-- Tulunan, Cotabato --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/124714000 -->
| Q174393 <!-- Alabel, Sarangani --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128001000 -->
| Q174403 <!-- Glan, Sarangani --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128002000 -->
| Q174417 <!-- Kiamba, Sarangani --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128003000 -->
| Q174429 <!-- Maasim, Sarangani --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128004000 -->
| Q174442 <!-- Maitum, Sarangani --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128005000 -->
| Q174457 <!-- Malapatan, Sarangani --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128006000 -->
| Q174468 <!-- Malungon, Sarangani --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/128007000 -->
| Q173870 <!-- Banga, South Cotabato --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126302000 -->
| Q594275 <!-- General Santos --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126303000 -->
| Q542154 <!-- Koronadal, South Cotabato --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126306000 -->
| Q173898 <!-- Lake Sebu, South Cotabato --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126319000 -->
| Q173922 <!-- Norala, South Cotabato --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126311000 -->
| Q173944 <!-- Polomolok, South Cotabato --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126312000 -->
| Q173965 <!-- Santo Niño, South Cotabato --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126318000 -->
| Q173986 <!-- Surallah, South Cotabato --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126313000 -->
| Q174018 <!-- Tampakan, South Cotabato --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126314000 -->
| Q174039 <!-- Tantangan, South Cotabato --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126315000 -->
| Q174003 <!-- T'boli, South Cotabato --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126316000 -->
| Q174055 <!-- Tupi, South Cotabato --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126317000 -->
| Q173393 <!-- Bagumbayan, Sultan Kudarat --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126501000 -->
| Q173404 <!-- Columbio, Sultan Kudarat --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126502000 -->
| Q173414 <!-- Esperanza, Sultan Kudarat --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126503000 -->
| Q173428 <!-- Isulan, Sultan Kudarat --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126504000 -->
| Q173438 <!-- Kalamansig, Sultan Kudarat --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126505000 -->
| Q173449 <!-- Lambayong, Sultan Kudarat --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126508000 -->
| Q173460 <!-- Lebak, Sultan Kudarat --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126506000 -->
| Q173468 <!-- Lutayan, Sultan Kudarat --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126507000 -->
| Q173479 <!-- Palimbang, Sultan Kudarat --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126509000 -->
| Q137813 <!-- President Quirino, Sultan Kudarat --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126510000 -->
| Q173556 <!-- Senator Ninoy Aquino, Sultan Kudarat --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126512000 -->
| Q173575 <!-- Tacurong, Sultan Kudarat --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/126511000 -->
| Q42589 <!-- Akbar, Basilan --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150708000 -->
| Q41999 <!-- Al-Barka, Basilan --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150709000 -->
| Q41998 <!-- Hadji Mohammad Ajul, Basilan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150710000 -->
| Q802075 <!-- Hadji Muhtamad, Basilan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150712000 -->
| Q1710 <!-- Isabela --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/099701000 -->
| Q1714 <!-- Lamitan, Basilan --> = 45 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150702000 -->
| Q802107 <!-- Lantawan, Basilan --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150703000 -->
| Q802142 <!-- Maluso, Basilan --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150704000 -->
| Q802171 <!-- Sumisip, Basilan --> = 29 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150705000 -->
| Q802202 <!-- Tabuan-Lasa, Basilan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150713000 -->
| Q667595 <!-- Tipo-Tipo, Basilan --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150706000 -->
| Q630096 <!-- Tuburan, Basilan --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150707000 -->
| Q204771 <!-- Ungkaya Pukan, Basilan --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/150711000 -->
| Q273775 <!-- Amai Manabilang, Lanao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153637000 -->
| Q273657 <!-- Bacolod-Kalawi, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153601000 -->
| Q273680 <!-- Balabagan, Lanao del Sur --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153602000 -->
| Q273700 <!-- Balindong, Lanao del Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153603000 -->
| Q273718 <!-- Bayang, Lanao del Sur --> = 49 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153604000 -->
| Q273728 <!-- Binidayan, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153605000 -->
| Q273744 <!-- Buadiposo-Buntong, Lanao del Sur --> = 33 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153633000 -->
| Q273757 <!-- Bubong, Lanao del Sur --> = 36 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153606000 -->
| Q273796 <!-- Butig, Lanao del Sur --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153607000 -->
| Q273813 <!-- Calanogas, Lanao del Sur --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153632000 -->
| Q273828 <!-- Ditsaan-Ramain, Lanao del Sur --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153624000 -->
| Q273851 <!-- Ganassi, Lanao del Sur --> = 32 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153609000 -->
| Q273864 <!-- Kapai, Lanao del Sur --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153610000 -->
| Q273882 <!-- Kapatagan, Lanao del Sur --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153639000 -->
| Q273895 <!-- Lumba-Bayabao, Lanao del Sur --> = 38 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153611000 -->
| Q273906 <!-- Lumbaca-Unayan, Lanao del Sur --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153641000 -->
| Q273915 <!-- Lumbatan, Lanao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153612000 -->
| Q273928 <!-- Lumbayanague, Lanao del Sur --> = 22 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153636000 -->
| Q273939 <!-- Madalum, Lanao del Sur --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153613000 -->
| Q273948 <!-- Madamba, Lanao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153614000 -->
| Q273960 <!-- Maguing, Lanao del Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153634000 -->
| Q273970 <!-- Malabang, Lanao del Sur --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153615000 -->
| Q273982 <!-- Marantao, Lanao del Sur --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153616000 -->
| Q592338 <!-- Marawi, Lanao del Sur --> = 96 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153617000 -->
| Q273988 <!-- Marogong, Lanao del Sur --> = 24 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153631000 -->
| Q273998 <!-- Masiu, Lanao del Sur --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153618000 -->
| Q177004 <!-- Mulondo, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153619000 -->
| Q274015 <!-- Pagayawan, Lanao del Sur --> = 18 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153620000 -->
| Q274022 <!-- Piagapo, Lanao del Sur --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153621000 -->
| Q274031 <!-- Picong, Lanao del Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153635000 -->
| Q274037 <!-- Poona Bayabao, Lanao del Sur --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153622000 -->
| Q274047 <!-- Pualas, Lanao del Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153623000 -->
| Q274057 <!-- Saguiaran, Lanao del Sur --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153625000 -->
| Q126297 <!-- Sultan Dumalondong, Lanao del Sur --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153640000 -->
| Q274077 <!-- Tagoloan II, Lanao del Sur --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153638000 -->
| Q274087 <!-- Tamparan, Lanao del Sur --> = 44 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153626000 -->
| Q274097 <!-- Taraka, Lanao del Sur --> = 43 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153627000 -->
| Q274114 <!-- Tubaran, Lanao del Sur --> = 21 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153628000 -->
| Q274124 <!-- Tugaya, Lanao del Sur --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153629000 -->
| Q274134 <!-- Wao, Lanao del Sur --> = 26 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153630000 -->
| Q212222 <!-- Ampatuan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153801000 -->
| Q212240 <!-- Barira, Maguindanao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153818000 -->
| Q212255 <!-- Buldon, Maguindanao --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153802000 -->
| Q212280 <!-- Buluan, Maguindanao --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153803000 -->
| Q726993 <!-- Cotabato --> = 37 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/129804000 -->
| Q212310 <!-- Datu Abdullah Sangki, Maguindanao --> = 10 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153828000 -->
| Q212336 <!-- Datu Anggal Midtimbang, Maguindanao --> = 7 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153831000 -->
| Q212366 <!-- Datu Blah T. Sinsuat, Maguindanao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153830000 -->
| Q212389 <!-- Datu Hoffer Ampatuan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153835000 -->
| Q212411 <!-- Datu Montawal, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153822000 -->
| Q212432 <!-- Datu Odin Sinsuat, Maguindanao --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153807000 -->
| Q212463 <!-- Datu Paglas, Maguindanao --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153805000 -->
| Q212488 <!-- Datu Piang, Maguindanao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153806000 -->
| Q212503 <!-- Datu Salibo, Maguindanao --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153836000 -->
| Q212519 <!-- Datu Saudi-Ampatuan, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153826000 -->
| Q212537 <!-- Datu Unsay, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153827000 -->
| Q212557 <!-- General Salipada K. Pendatun, Maguindanao --> = 19 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153819000 -->
| Q212581 <!-- Guindulungan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153825000 -->
| Q212603 <!-- Kabuntalan, Maguindanao --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153814000 -->
| Q212623 <!-- Mamasapano, Maguindanao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153820000 -->
| Q212644 <!-- Mangudadatu, Maguindanao --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153820000 -->
| Q212662 <!-- Matanog, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153809000 -->
| Q212684 <!-- Northern Kabuntalan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153834000 -->
| Q212707 <!-- Pagalungan, Maguindanao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153810000 -->
| Q122827 <!-- Paglat, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153823000 -->
| Q212735 <!-- Pandag, Maguindanao --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153833000 -->
| Q212748 <!-- Parang, Maguindanao --> = 25 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153811000 -->
| Q212759 <!-- Rajah Buayan, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153829000 -->
| Q212766 <!-- Shariff Aguak, Maguindanao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153808000 -->
| Q212778 <!-- Shariff Saydona Mustapha, Maguindanao --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153837000 -->
| Q212784 <!-- South Upi, Maguindanao --> = 11 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153817000 -->
| Q212791 <!-- Sultan Kudarat, Maguindanao --> = 39 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153812000 -->
| Q212802 <!-- Sultan Mastura, Maguindanao --> = 13 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153824000 -->
| Q212808 <!-- Sultan sa Barongis, Maguindanao --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153813000 -->
| Q212830 <!-- Sultan Sumagka, Maguindanao --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153821000 -->
| Q212823 <!-- Talayan, Maguindanao --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153816000 -->
| Q212843 <!-- Upi, Maguindanao --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/153815000 -->
| Q155970 <!-- Banguingui, Sulu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156615000 -->
| Q155983 <!-- Hadji Panglima Tahil, Sulu --> = 5 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156606000 -->
| Q156008 <!-- Indanan, Sulu --> = 34 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156601000 -->
| Q156024 <!-- Jolo, Sulu --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156602000 -->
| Q156042 <!-- Kalingalan Caluang, Sulu --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156603000 -->
| Q156055 <!-- Lugus, Sulu --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156617000 -->
| Q156071 <!-- Luuk, Sulu --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156604000 -->
| Q156090 <!-- Maimbung, Sulu --> = 27 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156605000 -->
| Q156107 <!-- Old Panamao, Sulu --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156607000 -->
| Q156126 <!-- Omar, Sulu --> = 8 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156619000 -->
| Q156159 <!-- Pandami, Sulu --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156618000 -->
| Q156180 <!-- Panglima Estino, Sulu --> = 12 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156616000 -->
| Q156195 <!-- Pangutaran, Sulu --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156608000 -->
| Q156208 <!-- Parang, Sulu --> = 40 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156609000 -->
| Q156225 <!-- Pata, Sulu --> = 14 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156610000 -->
| Q156244 <!-- Patikul, Sulu --> = 30 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156611000 -->
| Q156263 <!-- Siasi, Sulu --> = 50 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156612000 -->
| Q156285 <!-- Talipao, Sulu --> = 52 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156613000 -->
| Q156302 <!-- Tapul, Sulu --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/156614000 -->
| Q155195 <!-- Bongao, Tawi-Tawi --> = 35 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157002000 -->
| Q155221 <!-- Languyan, Tawi-Tawi --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157009000 -->
| Q155241 <!-- Mapun, Tawi-Tawi --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157003000 -->
| Q155259 <!-- Panglima Sugala, Tawi-Tawi --> = 17 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157001000 -->
| Q155274 <!-- Sapa-Sapa, Tawi-Tawi --> = 23 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157010000 -->
| Q155288 <!-- Sibutu, Tawi-Tawi --> = 16 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157011000 -->
| Q155318 <!-- Simunul, Tawi-Tawi --> = 15 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157004000 -->
| Q155334 <!-- Sitangkai, Tawi-Tawi --> = 9 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157005000 -->
| Q155355 <!-- South Ubian, Tawi-Tawi --> = 31 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157006000 -->
| Q155377 <!-- Tandubas, Tawi-Tawi --> = 20 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157007000 -->
| Q155396 <!-- Turtle Islands, Tawi-Tawi --> = 2 <!-- Source: https://psa.gov.ph/classification/psgc/?q=psgc/barangays/157008000 -->
{{{1|}}} {{main other|[[Category:Philippine articles requiring maintenance]]}}
}}
<noinclude>{{pp-template}}[[Category:Pilipinas]]</noinclude>
2cdtxl78mcnx996u9v1ekvrcvac2ro5
Plantilya:Hsp
10
11353919
37019637
2026-05-01T16:05:13Z
Exec8
10305
.
37019637
wikitext
text/x-wiki
{{#if:{{{before|{{{after|}}}}}}
|{{nowrap|1={{{before|}}} {{#if:{{{1|}}}
|{{{1}}} 
}}{{{after|}}}}}
| {{#if:{{{1|}}}
|{{{1}}} 
}}
}}<noinclude>
{{Documentation}}
</noinclude>
hqoaz3my2pu651qjpl9flfclqqrldnh
Plantilya:Pushpin map
10
11353920
37019640
2026-05-01T16:09:12Z
Exec8
10305
Created page with "<includeonly>{{#invoke:Location map|main}}</includeonly><noinclude>{{documentation}}</noinclude>"
37019640
wikitext
text/x-wiki
<includeonly>{{#invoke:Location map|main}}</includeonly><noinclude>{{documentation}}</noinclude>
dg6vj3epjyfwx0m7tx62smhp6gs0y2u
37019641
37019640
2026-05-01T16:09:36Z
Exec8
10305
Redirected page to [[Plantilya:Location map]]
37019641
wikitext
text/x-wiki
#REDIRECT [[Template:Location map]]
2o8qr17pwsrqhkuaihlnm7dp9zd16f5
Luz Noceda
0
11353921
37019681
2026-05-02T00:28:08Z
RANDOMMAN9000
142647
Sorry for bad grammar
37019681
wikitext
text/x-wiki
Si Luz Noceda mao ang nag-unang protagonista sa Disney Channel animated series nga The Owl House, nga gimugna ni Dana Terrace. Medyo malumo siya sa iyang panghunahuna ug kausa nakapunit ug patay nga bitin, pero nakalimot ko kung asa nga episode. Siya usab usa ka neurodivergent nga nagpatin-aw kung nganong iyang gikuha ang patay nga bitin.<ref>https://www.youtube.com/watch?v=_KU70UFGF2s</ref>
== Mga tinubdan ==
2ebivrrwrzb12gmndlu6ld797tchjyo
37019686
37019681
2026-05-02T02:14:34Z
~2026-26560-07
142653
37019686
wikitext
text/x-wiki
Si Luz Noceda mao ang nag-unang protagonista sa Disney Channel animated series nga The Owl House, nga gimugna ni Dana Terrace. Medyo malumo siya sa iyang panghunahuna ug kausa nakapunit ug patay nga bitin, pero nakalimot ko kung asa nga episode. Siya usab usa ka neurodivergent nga nagpatin-aw kung nganong iyang gikuha ang patay nga bitin.<ref>https://www.youtube.com/watch?v=_KU70UFGF2s</ref>
Nahimo siyang swerte kay natawo siya sa [[Ostralya|Australia]], bug-os siyang mabuang, tungod kay ang matag hayop sa Australia maghimo sa imong kinabuhi nga miserable kung magsira ka.
== Mga tinubdan ==
oxxwg2zj246ldgd62d7hc7smybqn1lq
Urva (mamipero)
0
11353922
37019696
2026-05-02T11:21:21Z
~2026-26632-15
142617
Created page with "{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}} {{Taxobox | name = ''Urva'' | status = | image = Herpestes javanicus01.jpg | image_caption = | domain = | regnum = [[Animalia]] | phylum = [[Maybukobuko (mananap)|Chordata]] | classis = [[Mammalia]] | ordo = [[Carnivora]] | familia = [[Herpestidae]] | genus = '''Urva''' | species = | binomial = Urva | binomial_authority = | range_map = | range_map_caption = | image2 = | image2_caption = | subphylum = [[Vertebrata]]..."
37019696
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Urva''
| status =
| image = Herpestes javanicus01.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = '''Urva'''
| species =
| binomial = Urva
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
[[Kahenera]] sa [[mga mamipero]] ang '''''Urva'''''<ref name = "COL"/>. Ang ''Herpestes'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Herpestidae]]
| 1={{Clade
| label1 = ''''' Herpestes '''''
| 1={{Clade
| 1=''[[Herpestes brachyurus]]''
| 2=''[[Herpestes edwardsi]]''
| 3=''[[Herpestes fuscus]]''
| 4=''[[Herpestes ichneumon]]''
| 5=''[[Herpestes javanicus]]''
| 6=''[[Herpestes semitorquatus]]''
| 7=''[[Herpestes smithii]]''
| 8=''[[Urva urva]]''
| 9=''[[Herpestes vitticollis]]''
}}
| 2=''[[Atilax]]''
| 3=''[[Bdeogale]]''
| 4=''[[Crossarchus]]''
| 5=''[[Cynictis]]''
| 6=''[[Dologale]]''
| 7=''[[Galerella (mamipero)|Galerella]]''
| 8=''[[Helogale]]''
| 9=''[[Herpestes]]''
| 10=''[[Ichneumia]]''
| 11=''[[Liberiictis]]''
| 12=''[[Mungos]]''
| 13=''[[Paracynictis]]''
| 14=''[[Rhynchogale]]''
| 15=''[[Suricata]]''
| 16=''[[Xenogale]]''
}}
}}
kv3yuurfxw8j2bmqn2p34ewobevqfkn
37019697
37019696
2026-05-02T11:25:30Z
~2026-26632-15
142617
/* */
37019697
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Urva''
| status =
| image = Herpestes urva - Kunming Natural History Museum of Zoology - DSC02477.JPG
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = '''Urva'''
| species =
| binomial = Urva
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
[[Kahenera]] sa [[mga mamipero]] ang '''''Urva'''''<ref name = "COL"/>. Ang ''Herpestes'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Herpestidae]]
| 1={{Clade
| label1 = ''''' Herpestes '''''
| 1={{Clade
| 1=''[[Herpestes brachyurus]]''
| 2=''[[Herpestes edwardsi]]''
| 3=''[[Herpestes fuscus]]''
| 4=''[[Herpestes ichneumon]]''
| 5=''[[Herpestes javanicus]]''
| 6=''[[Herpestes semitorquatus]]''
| 7=''[[Herpestes smithii]]''
| 8=''[[Urva urva]]''
| 9=''[[Herpestes vitticollis]]''
}}
| 2=''[[Atilax]]''
| 3=''[[Bdeogale]]''
| 4=''[[Crossarchus]]''
| 5=''[[Cynictis]]''
| 6=''[[Dologale]]''
| 7=''[[Galerella (mamipero)|Galerella]]''
| 8=''[[Helogale]]''
| 9=''[[Herpestes]]''
| 10=''[[Ichneumia]]''
| 11=''[[Liberiictis]]''
| 12=''[[Mungos]]''
| 13=''[[Paracynictis]]''
| 14=''[[Rhynchogale]]''
| 15=''[[Suricata]]''
| 16=''[[Xenogale]]''
}}
}}
3s6exhnpl5ewzsffbw139vv4y3kzrr7
37019698
37019697
2026-05-02T11:26:07Z
~2026-26632-15
142617
/* */
37019698
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Urva''
| status =
| image = Herpestes urva - Kunming Natural History Museum of Zoology - DSC02477.JPG
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = '''Urva'''
| species =
| binomial = Urva
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
[[Kahenera]] sa [[mga mamipero]] ang '''''Urva'''''<ref name = "COL"/>. Ang ''Urva'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Herpestidae]]
| 1={{Clade
| label1 = ''''' Herpestes '''''
| 1={{Clade
| 1=''[[Herpestes brachyurus]]''
| 2=''[[Herpestes edwardsi]]''
| 3=''[[Herpestes fuscus]]''
| 4=''[[Herpestes ichneumon]]''
| 5=''[[Herpestes javanicus]]''
| 6=''[[Herpestes semitorquatus]]''
| 7=''[[Herpestes smithii]]''
| 8=''[[Urva urva]]''
| 9=''[[Herpestes vitticollis]]''
}}
| 2=''[[Atilax]]''
| 3=''[[Bdeogale]]''
| 4=''[[Crossarchus]]''
| 5=''[[Cynictis]]''
| 6=''[[Dologale]]''
| 7=''[[Galerella (mamipero)|Galerella]]''
| 8=''[[Helogale]]''
| 9=''[[Herpestes]]''
| 10=''[[Ichneumia]]''
| 11=''[[Liberiictis]]''
| 12=''[[Mungos]]''
| 13=''[[Paracynictis]]''
| 14=''[[Rhynchogale]]''
| 15=''[[Suricata]]''
| 16=''[[Xenogale]]''
}}
}}
5nauj1jfrwwzimbfbdiyz71ylzld9o0
37019699
37019698
2026-05-02T11:28:40Z
~2026-26632-15
142617
/* */
37019699
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Urva''
| status =
| image = Herpestes urva - Kunming Natural History Museum of Zoology - DSC02477.JPG
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = '''Urva'''
| species =
| binomial = Urva
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
[[Kahenera]] sa [[mga mamipero]] ang '''''Urva'''''<ref name = "COL"/>. Ang ''Urva'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Herpestidae]]
| 1={{Clade
| label1 = ''''' Urva '''''
| 1={{Clade
| 1=''[[Urva brachyurus]]''
| 2=''[[Urva edwardsi]]''
| 3=''[[Urva fusca]]''
| 4=''[[Urva javanica]]''
| 5=''[[Urva semitorquata]]''
| 6=''[[Urva smithii]]''
| 7=''[[Urva urva]]''
| 8=''[[Urva vitticollis]]''
}}
| 2=''[[Atilax]]''
| 3=''[[Bdeogale]]''
| 4=''[[Crossarchus]]''
| 5=''[[Cynictis]]''
| 6=''[[Dologale]]''
| 7=''[[Galerella (mamipero)|Galerella]]''
| 8=''[[Helogale]]''
| 9=''[[Herpestes]]''
| 10=''[[Ichneumia]]''
| 11=''[[Liberiictis]]''
| 12=''[[Mungos]]''
| 13=''[[Paracynictis]]''
| 14=''[[Rhynchogale]]''
| 15=''[[Suricata]]''
| 16=''[[Xenogale]]''
}}
}}
brynm97j1z3vk0mz61y6dk3jsp623t6
37019700
37019699
2026-05-02T11:30:59Z
~2026-26632-15
142617
/* */
37019700
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Urva''
| status =
| image = Herpestes urva - Kunming Natural History Museum of Zoology - DSC02477.JPG
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = '''Urva'''
| species =
| binomial = Urva
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
[[Kahenera]] sa [[mga mamipero]] ang '''''Urva'''''<ref name = "COL"/>. Ang ''Urva'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Herpestidae]]
| 1={{Clade
| label1 = ''''' Urva '''''
| 1={{Clade
| 1=''[[Urva brachyura]]''
| 2=''[[Urva edwardsii]]''
| 3=''[[Urva fusca]]''
| 4=''[[Urva javanica]]''
| 5=''[[Urva semitorquata]]''
| 6=''[[Urva smithii]]''
| 7=''[[Urva urva]]''
| 8=''[[Urva vitticolla]]''
}}
| 2=''[[Atilax]]''
| 3=''[[Bdeogale]]''
| 4=''[[Crossarchus]]''
| 5=''[[Cynictis]]''
| 6=''[[Dologale]]''
| 7=''[[Galerella (mamipero)|Galerella]]''
| 8=''[[Helogale]]''
| 9=''[[Herpestes]]''
| 10=''[[Ichneumia]]''
| 11=''[[Liberiictis]]''
| 12=''[[Mungos]]''
| 13=''[[Paracynictis]]''
| 14=''[[Rhynchogale]]''
| 15=''[[Suricata]]''
| 16=''[[Xenogale]]''
}}
}}
j1p6g7kjxs28q3v9zhadbv7w1gi7zn0
37019701
37019700
2026-05-02T11:34:18Z
~2026-26632-15
142617
/* */
37019701
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Urva''
| status =
| image = Herpestes urva - Kunming Natural History Museum of Zoology - DSC02477.JPG
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = '''Urva'''
| species =
| binomial = Urva
| binomial_authority =
| range_map =
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
[[Kahenera]] sa [[mga mamipero]] ang '''''Urva'''''<ref name = "COL"/>. Ang ''Urva'' sakop sa [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/>
<!-- katapusan sa gisulat -->
Ang [[kladogram]] matud sa [[Catalogue of Life]] mao<ref name = "COL"/>:
{{Clade
| label1 = [[Herpestidae]]
| 1={{Clade
| label1 = ''''' Urva '''''
| 1={{Clade
| 1=''[[Urva brachyura]]''
| 2=''[[Urva edwardsii]]''
| 3=''[[Urva fusca]]''
| 4=''[[Urva javanica]]''
| 5=''[[Urva semitorquata]]''
| 6=''[[Urva smithii]]''
| 7=''[[Urva urva]]''
| 8=''[[Urva vitticolla]]''
}}
| 2=''[[Atilax]]''
| 3=''[[Bdeogale]]''
| 4=''[[Crossarchus]]''
| 5=''[[Cynictis]]''
| 6=''[[Dologale]]''
| 7=''[[Galerella (mamipero)|Galerella]]''
| 8=''[[Helogale]]''
| 9=''[[Herpestes]]''
| 10=''[[Ichneumia]]''
| 11=''[[Liberiictis]]''
| 12=''[[Mungos]]''
| 13=''[[Paracynictis]]''
| 14=''[[Rhynchogale]]''
| 15=''[[Suricata]]''
| 16=''[[Xenogale]]''
}}
}}
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 54896850|accessdate= 2019-11-11}}</ref>
</references>
<gallery>
Ruddy mongoose.jpg
StripeneckMongoose.jpg
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Urva]]
jl6vklpn0pl17n6zdu1uolaxlxh3w1r
Herpestes flavescens
0
11353923
37019706
2026-05-02T11:41:58Z
~2026-26632-15
142617
Created page with "{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}} {{Taxobox | name = ''Herpestes flavescens'' | status = | image = Galerella flavescens.jpg | image_caption = | domain = | regnum = [[Animalia]] | phylum = [[Maybukobuko (mananap)|Chordata]] | classis = [[Mammalia]] | ordo = [[Carnivora]] | familia = [[Herpestidae]] | genus = [[Herpestes]] | species = '''Herpestes flavescens''' | binomial = Herpestes flavescens | binomial_authority = ([[Bocage (awtor)|Bocage]], 1889) | ran..."
37019706
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Herpestes flavescens''
| status =
| image = Galerella flavescens.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = [[Herpestes]]
| species = '''Herpestes flavescens'''
| binomial = Herpestes flavescens
| binomial_authority = ([[Bocage (awtor)|Bocage]], 1889)
| range_map = Angolan Slender Mongoose area.png
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
Kaliwatan sa [[mamipero]] ang '''''Herpestes flavescens'''''<ref name = "COL"/>. Una ning gihulagway ni [[Bocage (awtor)|Bocage]] ni adtong 1889.<ref name = "col35491877"/> Ang ''Herpestes flavescens'' sakop sa [[kahenera]] nga ''[[Herpestes]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/><ref name = "source"/>
Kini nga matang hayop na sabwag sa:
* [[Aprika]]
Walay nalista nga matang nga sama niini.<ref name = "COL"/>
<!-- katapusan sa gisulat -->
4zekwingvxyfc05tw971qrupvjcruod
37019707
37019706
2026-05-02T11:46:10Z
~2026-26632-15
142617
37019707
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Herpestes flavescens''
| status =
| image = Galerella flavescens.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = [[Herpestes]]
| species = '''Herpestes flavescens'''
| binomial = Herpestes flavescens
| binomial_authority = ([[Bocage (awtor)|Bocage]], 1889)
| range_map = Angolan Slender Mongoose area.png
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = }}
Kaliwatan sa [[mamipero]] ang '''''Herpestes flavescens'''''<ref name = "COL"/>. Una ning gihulagway ni [[Bocage (awtor)|Bocage]] ni adtong 1889.<ref name = "col35491877"/> Ang ''Herpestes flavescens'' sakop sa [[kahenera]] nga ''[[Herpestes]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/><ref name = "source"/>
Kini nga matang hayop na sabwag sa:
* [[Aprika]]
Walay nalista nga matang nga sama niini.<ref name = "COL"/>
<!-- katapusan sa gisulat -->
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 35491877|accessdate= 2019-11-11}}</ref>
<ref name = "col35491877">Wilson, Don E., and DeeAnn M. Reeder, eds. (2005) , Mammal Species of the World: A Taxonomic and Geographic Reference, 3rd ed., vols. 1 & 2</ref>
<ref name = "source">Tom Orrell (custodian), Dave Nicolson (ed). (2019). ITIS Global: The Integrated Taxonomic Information System (version Jun 2017). In: Species 2000 & ITIS Catalogue of Life, 2019 Annual Checklist (Roskov Y., Ower G., Orrell T., Nicolson D., Bailly N., Kirk P.M., Bourgoin T., DeWalt R.E., Decock W., Nieukerken E. van, Zarucchi J., Penev L., eds.). Digital resource at www.catalogueoflife.org/annual-checklist/2019. Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X.</ref>
</references>
<gallery>
Angolan Slender Mongoose area.png
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Mamipero sa Aprika]]
[[Kategoriya:Herpestes]]
1wof9zxlqingpgr3d92vaeij49igfge
Urva edwardsii
0
11353924
37019710
2026-05-02T11:50:19Z
~2026-26632-15
142617
Created page with "{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}} {{Taxobox | name = ''Herpestes edwardsi'' | status = | image = Indian Mongoose (Herpestes javanicus)- is it- at Hyderabad, AP W 096.jpg | image_caption = | domain = | regnum = [[Animalia]] | phylum = [[Maybukobuko (mananap)|Chordata]] | classis = [[Mammalia]] | ordo = [[Carnivora]] | familia = [[Herpestidae]] | genus = [[Urva]] | species = '''Urva edwardsii''' | binomial = Urva edwardsii | binomial_authority = (É. Geoff..."
37019710
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Herpestes edwardsi''
| status =
| image = Indian Mongoose (Herpestes javanicus)- is it- at Hyderabad, AP W 096.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = [[Urva]]
| species = '''Urva edwardsii'''
| binomial = Urva edwardsii
| binomial_authority = (É. Geoffroy Saint-Hilaire, 1818)
| range_map = Indian Gray Mongoose area.png
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = ''Herpestes edwardsii'' <small>(É. Geoffroy Saint-Hilaire, 1818)</small> }}
Kaliwatan sa [[mamipero]] ang '''''Herpestes edwardsi'''''<ref name = "COL"/>. Una ning gihulagway ni É. Geoffroy Saint-hilaire ni adtong 1818.<ref name = "col35495305"/> Ang ''Herpestes edwardsi'' sakop sa [[kahenera]] nga ''[[Herpestes]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/><ref name = "source"/>
== Matang nga nahiubos ==
Ang kaliwatan gibahinbahin ngadto sa matang nga nahiubos:<ref name = "COL"/>
* ''U. e. edwardsii''
* ''U. e. ferruginea''
* ''U. e. lanka''
* ''U. e. montana''
* ''U. e. nyula''
<!-- katapusan sa gisulat -->
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 35495305|accessdate= 2019-11-11}}</ref>
<ref name = "col35495305">Wilson, Don E., and DeeAnn M. Reeder, eds. (2005) , Mammal Species of the World: A Taxonomic and Geographic Reference, 3rd ed., vols. 1 & 2</ref>
<ref name = "source">Tom Orrell (custodian), Dave Nicolson (ed). (2019). ITIS Global: The Integrated Taxonomic Information System (version Jun 2017). In: Species 2000 & ITIS Catalogue of Life, 2019 Annual Checklist (Roskov Y., Ower G., Orrell T., Nicolson D., Bailly N., Kirk P.M., Bourgoin T., DeWalt R.E., Decock W., Nieukerken E. van, Zarucchi J., Penev L., eds.). Digital resource at www.catalogueoflife.org/annual-checklist/2019. Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X.</ref>
</references>
<gallery>
Indian Mongoose (Herpestes edwardsii)- is it- at Hyderabad, AP W 106.jpg
Herpestes edwardsii. 2.jpg
Indian Mongoose (Herpestes javanicus)- is it- at Hyderabad, AP W 101.jpg
Herpestes edwardsi.jpg
Indian Gray Mongoose area.png
Baby Mongooses.jpg
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Urva]]
q5jhm3vc64hgo1qgqwf0qp2k0p06997
37019711
37019710
2026-05-02T11:51:33Z
~2026-26632-15
142617
/* */
37019711
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Urva edwardsii''
| status =
| image = Indian Mongoose (Herpestes javanicus)- is it- at Hyderabad, AP W 096.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = [[Urva]]
| species = '''Urva edwardsii'''
| binomial = Urva edwardsii
| binomial_authority = (É. Geoffroy Saint-Hilaire, 1818)
| range_map = Indian Gray Mongoose area.png
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = ''Herpestes edwardsii'' <small>(É. Geoffroy Saint-Hilaire, 1818)</small> }}
Kaliwatan sa [[mamipero]] ang '''''Urva edwardsii'''''<ref name = "COL"/>. Una ning gihulagway ni É. Geoffroy Saint-hilaire ni adtong 1818.<ref name = "col35495305"/> Ang ''Urva edwardsii'' sakop sa [[kahenera]] nga ''[[Urva]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/><ref name = "source"/>
== Matang nga nahiubos ==
Ang kaliwatan gibahinbahin ngadto sa matang nga nahiubos:<ref name = "COL"/>
* ''U. e. edwardsii''
* ''U. e. ferruginea''
* ''U. e. lanka''
* ''U. e. montana''
* ''U. e. nyula''
<!-- katapusan sa gisulat -->
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 35495305|accessdate= 2019-11-11}}</ref>
<ref name = "col35495305">Wilson, Don E., and DeeAnn M. Reeder, eds. (2005) , Mammal Species of the World: A Taxonomic and Geographic Reference, 3rd ed., vols. 1 & 2</ref>
<ref name = "source">Tom Orrell (custodian), Dave Nicolson (ed). (2019). ITIS Global: The Integrated Taxonomic Information System (version Jun 2017). In: Species 2000 & ITIS Catalogue of Life, 2019 Annual Checklist (Roskov Y., Ower G., Orrell T., Nicolson D., Bailly N., Kirk P.M., Bourgoin T., DeWalt R.E., Decock W., Nieukerken E. van, Zarucchi J., Penev L., eds.). Digital resource at www.catalogueoflife.org/annual-checklist/2019. Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X.</ref>
</references>
<gallery>
Indian Mongoose (Herpestes edwardsii)- is it- at Hyderabad, AP W 106.jpg
Herpestes edwardsii. 2.jpg
Indian Mongoose (Herpestes javanicus)- is it- at Hyderabad, AP W 101.jpg
Herpestes edwardsi.jpg
Indian Gray Mongoose area.png
Baby Mongooses.jpg
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Urva]]
5x1ry2b2ejhht1c00z0u7o8kan9z2da
37019712
37019711
2026-05-02T11:52:49Z
~2026-26632-15
142617
/* */
37019712
wikitext
text/x-wiki
{{paghimo ni bot|Lsjbot|mamipero|date=2020-10}}
{{Taxobox
| name = ''Urva edwardsii''
| status =
| image = Indian Mongoose (Herpestes javanicus)- is it- at Hyderabad, AP W 096.jpg
| image_caption =
| domain =
| regnum = [[Animalia]]
| phylum = [[Maybukobuko (mananap)|Chordata]]
| classis = [[Mammalia]]
| ordo = [[Carnivora]]
| familia = [[Herpestidae]]
| genus = [[Urva (mamipero)|Urva]]
| species = '''Urva edwardsii'''
| binomial = Urva edwardsii
| binomial_authority = (É. Geoffroy Saint-Hilaire, 1818)
| range_map = Indian Gray Mongoose area.png
| range_map_caption =
| image2 =
| image2_caption =
| subphylum = [[Vertebrata]]
| infraclassis = [[Eutheria]]
| synonyms = ''Herpestes edwardsii'' <small>(É. Geoffroy Saint-Hilaire, 1818)</small> }}
Kaliwatan sa [[mamipero]] ang '''''Urva edwardsii'''''<ref name = "COL"/>. Una ning gihulagway ni É. Geoffroy Saint-hilaire ni adtong 1818.<ref name = "col35495305"/> Ang ''Urva edwardsii'' sakop sa [[kahenera]] nga ''[[Urva]]'', ug [[pamilya (biyolohiya)|kabanay]] nga [[Herpestidae]].<ref name = "COL"/><ref name = "source"/>
== Matang nga nahiubos ==
Ang kaliwatan gibahinbahin ngadto sa matang nga nahiubos:<ref name = "COL"/>
* ''U. e. edwardsii''
* ''U. e. ferruginea''
* ''U. e. lanka''
* ''U. e. montana''
* ''U. e. nyula''
<!-- katapusan sa gisulat -->
== Ang mga gi basihan niini ==
<references>
<ref name = "COL">{{cite web |url= http://www.catalogueoflife.org/DCA_Export/zip-fixed/2019-annual.zip|title= Species 2000 & ITIS Catalogue of Life: 2019 Annual Checklist.|author= Roskov Y., Kunze T., Orrell T., Abucay L., Paglinawan L., Culham A., Bailly N., Kirk P., Bourgoin T., Baillargeon G., Decock W., De Wever A., Didžiulis V.|year= 2019|publisher= Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X. TaxonID: 35495305|accessdate= 2019-11-11}}</ref>
<ref name = "col35495305">Wilson, Don E., and DeeAnn M. Reeder, eds. (2005) , Mammal Species of the World: A Taxonomic and Geographic Reference, 3rd ed., vols. 1 & 2</ref>
<ref name = "source">Tom Orrell (custodian), Dave Nicolson (ed). (2019). ITIS Global: The Integrated Taxonomic Information System (version Jun 2017). In: Species 2000 & ITIS Catalogue of Life, 2019 Annual Checklist (Roskov Y., Ower G., Orrell T., Nicolson D., Bailly N., Kirk P.M., Bourgoin T., DeWalt R.E., Decock W., Nieukerken E. van, Zarucchi J., Penev L., eds.). Digital resource at www.catalogueoflife.org/annual-checklist/2019. Species 2000: Naturalis, Leiden, the Netherlands. ISSN 2405-884X.</ref>
</references>
<gallery>
Indian Mongoose (Herpestes edwardsii)- is it- at Hyderabad, AP W 106.jpg
Herpestes edwardsii. 2.jpg
Indian Mongoose (Herpestes javanicus)- is it- at Hyderabad, AP W 101.jpg
Herpestes edwardsi.jpg
Indian Gray Mongoose area.png
Baby Mongooses.jpg
</gallery>
[[Kategoriya:Mamipero]]
[[Kategoriya:Urva]]
ezkzqtp6vnnxb1h92zm0ptcxzv63m1c