Documentation[créer] [purger]
local wd = require "Module:Wikidata"

local p = {}

function p.subdivisions(frame)
    local returnstring = ''
	local entity = frame.args[1] or mw.wikibase.getEntityIdForCurrentPage()
    local claims = wd.getClaims({entity=entity, property='P10254'})
    for i in pairs(claims) do
    	local subentity = claims[i].mainsnak.datavalue.value.id
    	local pop = wd.formatStatements({entity=subentity, property='P1082', linkback="true"})
    	returnstring = returnstring .. '* ' .. mw.wikibase.getLabel(subentity) .. ' (' .. pop .. ' hab.)\n'
    end
    return returnstring
end

function p.cadastre(frame)
	local entity = frame.args[1] or mw.wikibase.getEntityIdForCurrentPage()
	return wd.formatStatements({entity=entity, property='P10254', link="-", linkback="true"})
end

return p