User:Evad37/KML

__NOINDEX__

Introduction
KML files contain coordinates relating to a feature, including linear features and polygons. The template generates links to download or view an article's related KML file, and enables WikiMiniAtlas to display the KML file. As KML files cannot be uploaded directly (see T28059), they are stored as wikitext. Through the Wikidata property, 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.

Overview
The basic process is:
 * 1) Get a list of Wikidata items which have both a KML file and an article on English Wikipedia
 * 2) Filter out articles which already have, or are a disambiguation page, or have been noted as an exception
 * 3) Use AWB to add to the end of each article (prior to DEFAULTSORT, interwikis, categories and stub templates)

Problems
If 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 statement.
 * Specify a different KML file – add wikidata or from (see Template:Attached KML/doc)
 * Revert the edit and specify the article as an exception – add . If the edit is reverted without specify the article as an exception, then the next AWB run will again add !
 * Report it – at User talk:Evad37/KML

Details
Here's the full details:

A list of s for Wikidata items which have a P3096 statement and enwiki sitelink is obtained through the following SPARQL query: SELECT ?article WHERE {	?article schema:about ?item ;	schema:isPartOf	. ?item wdt:P3096 ?kml. SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } }

Copying into Excel, and using a formula like  (for cell B2) gives percent-encoded page title. Copying into a web-based url decoder gives the un-encoded page titles.

Filtering articles as specified above is done through a PetScan query like the following (pasting the list of articles into the "Manual list" box): https://petscan.wmflabs.org/?language=en&project=wikipedia&categories=Attached%20KML%20with%20same%20name%20as%20article%0D%0AAll%20Disambiguation%20pages%0D%0APages%20which%20should%20not%20use%20KML%20from%20Wikidata&combination=union&ns%5B0%5D=1&manual_list_wiki=enwiki&source_combination=manual%20NOT%20categories&interface_language=en&active_tab=tab_other_sources

The output from PetScan is the input list for AWB. Edit summary: