Module:Coordinates: Difference between revisions

per request
m (1 revision imported: Wikipedia)
(per request)
Line 490:
local function makeWikidataCategories(qid)
local ret
local qid = qid or mw.wikibase.getEntityIdForCurrentPage()
if mw.wikibase and current_page.namespace == 0 then
localif entityqid =and mw.wikibase.entityExists(qid) and mw.wikibase.getEntityObjectgetBestStatements(qid, "P625") orand mw.wikibase.getEntityObjectgetBestStatements(qid, "P625")[1] then
local snaktype = entitymw.claimswikibase.getBestStatements(qid, "P625")[1].mainsnak.snaktype
if entity and entity.claims and entity.claims.P625 and entity.claims.P625[1] then
local snaktype = entity.claims.P625[1].mainsnak.snaktype
if snaktype == 'value' then
-- coordinates exist both here and on Wikidata, and can be compared.
Anonymous user