Module:Sandbox/RexxS/TA98

From blackwiki
< Module:Sandbox‎ | RexxS
Revision as of 22:46, 21 September 2014 by blackwiki>RexxS (see the props table)
Jump to navigation Jump to search

Usage

{{#invoke:Sandbox/RexxS|getTAValue}}

This is used to get the TA98 (Terminologia Anatomica first edition 1998) values (property P1323) - example: 'A01.1.00.005'

These are then linked to the corresponding urls - example: http://www.unifr.ch/ifaa/Public/EntryPage/TA98%20Tree/Entity%20TA98%20EN/01.1.00.005%20Entity%20TA98%20EN.htm

This is a test module, now incorporated into Module:Wikidata



local p = {}

-- This is used to get the TA98 (Terminologia Anatomica first edition 1998) values like 'A01.1.00.005' (property P1323)
-- which are then linked to http://www.unifr.ch/ifaa/Public/EntryPage/TA98%20Tree/Entity%20TA98%20EN/01.1.00.005%20Entity%20TA98%20EN.htm
p.getTAValue = function(frame)
	local ent = mw.wikibase.getEntityObject()
	local props = ent:formatPropertyValues('P1323')
	local out = {}
	for k, v in pairs(props) do
--		if k == 'value' then
			out[#out + 1] = "k = " .. k .. " --- v = " .. v
--		end
	end
	ret = table.concat(out, "<br> ")
	if #ret == 0 then
		ret = "Invalid TA"
	end
	return ret
end

return p