Dokumentation [visa] [redigera] [historik] [rensa sidcachen]


Den här modulen anropas av mallen {{Använder Wikidata}} för att hämta information om egenskaper (properties) från Wikidata.

local p = {}

function p.usesProperty(frame)
	local parent = frame.getParent(frame)
	local result = ''
	local ii = 1
	local s = {}
	while true do
		local p_num = mw.text.trim(parent.args[ii] or '')
		if p_num ~= '' then
			local label = mw.wikibase.label(p_num) or "Ingen etikett"
			result = result .. "<li><b><i>[[d:Property:" .. p_num .. "|" .. label .. " <small>(" .. string.upper(p_num) .. ")</small>]]</i></b> (se [[d:Property talk:" .. p_num .. "|disk.]]; [[d:Special:WhatLinksHere/Property:" .. p_num .. "|användning]])</li>"
			if p_num == 'P214' then
				table.insert(s, 'Kategori:Wikipediaartiklar med identifierare från VIAF]]')
			else
				table.insert(s, '[[Kategori:Mallar och moduler som använder Property:' .. p_num .. ']]')
			end
			ii = ii + 1
		else break
		end
	end
	return result .. mw.text.tag('includeonly', {}, table.concat(s))
end
 
return p