This bot uses AutoWikiBrowser. To stop this bot, make a change to its talk page. The bot will then not make any changes until its owner starts it again. |
Emergency robot shutoff button |
|
Administrators: Use this button if the bot is malfunctioning. (direct link)
Non-administrators can report misbehaving bots to Wikipedia:Administrators' noticeboard. |
Introduction
changeKML files contain map positions for various places, which may be shown as lines or shapes. The {{Attached KML}}
template gives links to download or look at a KML file for an article. WikiMiniAtlas will also show the KML file on top of a map.
As KML files cannot be uploaded directly (see Phab:T28059), they are stored as wikitext. Through the Wikidata property KML file (P3096), an article's Wikidata item can be linked to the item for its related KML file – which may be stored on any wiki connected to Wikidata. Most KML files are located at the English Wikipedia.
Overview
changeThis bot adds {{Attached KML}}
to articles which have KML files available through Wikidata. The basic process is:
- Get a list of Wikidata items which have both a KML file and an article on English Wikipedia
- Remove articles which already have
{{Attached KML}}
, or should not have a KML file - Use AWB to add
{{Attached KML}}
to the end of each article (prior to DEFAULTSORT, interwikis, categories and stub templates)
Problems
changeIf there is a problem with the KML file, you can:
- Fix it on Wikidata (preferred) – if the KML file is not actually related to the article, then you can be bold and fix it! Go to the article's Wikidata item, and adjust the KML file (P3096) statement.
- Use another KML file – add
|wikidata=
or|from=
(see Template:Attached KML/doc) - Undo the change and make the article an exception – add
{{No KML|reason=Specify a reason}}
.[a] If{{No KML}}
is not added, then the bot will again add {{Attached KML}} next time! - Tell the bot's owner – at User talk:KMLbot
Details
changeHere's the full details:
- (1) Get a list of Wikidata items which have both a KML file and an article on English Wikipedia. Filter out articles which already have
{{Attached KML}}
, or are a disambiguation page, or have been excluded through{{No KML|reason=}}
(template adds pages to a hidden category,[[Category:Pages which should not use KML from Wikidata]]
).- Done manually through a PetScan query (which includes a SPARQL query):
- https://petscan.wmflabs.org/?language=simple&project=wikipedia&depth=2&categories=Attached%20KML%20tracking%20categories%0D%0ADisambiguation%0D%0APages%20which%20should%20not%20use%20KML%20from%20Wikidata&combination=union&ns%5B0%5D=1&show_redirects=no&sparql=SELECT%20%3Fitem%20WHERE%20%7B%20%3Fitem%20wdt%3AP3096%20%3Fdummy0%20%7D&manual_list_wiki=enwiki&common_wiki=cats&source_combination=sparql%20NOT%20categories&interface_language=en&active_tab=tab_output
- Output as "Wiki" and save as a UTF-8 text file (for input to AWB)
- (2) Use AWB to add
{{Attached KML}}
to the end of each article (prior to DEFAULTSORT, interwikis, categories and stub templates, applying general fixes if needed).