Module:NBD

local p = {}

function p.NBD(frame) local pframe = frame:getParent local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template

local entity = mw.wikibase.getEntityObject if not entity then -- no Wikidata item return "" end

local property = "P31" local value = 19389637 local claims = entity.claims or {} local hasProp = claims[property]

if not hasProp then -- no claim of that property return "" end if (hasProp and hasProp[1] and hasProp[1].mainsnak.snaktype == "value" and hasProp[1].mainsnak.datavalue.type == "wikibase-entityid" and hasProp[1].mainsnak.datavalue.value["numeric-id"] and hasProp[1].mainsnak.datavalue.value["numeric-id"] == value) then result = "" local property = "P921" hasProp = claims[property] if not hasProp then return " " else local qid2 = "Q" .. hasProp[1].mainsnak.datavalue.value["numeric-id"] local entity2 = mw.wikibase.getEntityObject( qid2 ) local claims2 = entity2.claims or {} local result = ' " .. entity2:getLabel( 'en' ) .. ' ('       	if claims2["P569"] then result = result .. entity2:formatPropertyValues( 'P569' ).value end        	result = result .. "-"        	if claims2["P570"] then result = result .. entity2:formatPropertyValues( 'P570' ).value end        	result = result .. ") " if claims2["P27"] then result = result .. entity2:formatPropertyValues( 'P27' ).value .. ' ' end if claims2["P410"] then result = result .. "Rank: " .. entity2:formatPropertyValues( 'P410' ).value .. ' ' end result = result .. " "       	-- return result .. " "       	return " " end

else return "" end end

return p -- Test pages -- A Naval Biographical Dictionary/Yule, Charles Bampfield -- A Naval Biographical Dictionary/Black, William