localp={}functionp.wikidatacheck(frame)localpframe=frame:getParent()localconfig=frame.args-- the arguments passed BY the template, in the wikitext of the template itselflocalargs=pframe.args-- the arguments passed TO the template, in the wikitext that transcludes the templatelocalproperty=config.propertylocalvalue=config.valuelocalcatbase=config.categorylocalnamespaces=config.namespaceslocalok=false-- one-way flag to check if we're in a good namespacelocalns=mw.title.getCurrentTitle().namespaceforvinmw.text.gsplit(namespaces,",",true)doiftonumber(v)==nsthenok=trueendendifnotokthen-- not in one of the approved namespacesreturn""endlocalentity=mw.wikibase.getEntityObject()ifnotentitythen-- no Wikidata itemreturn"[[Category:"..catbase.." nae in Wikidata]]"endlocalclaims=entity.claimsor{}localhasProp=claims[property]ifnothasPropthen-- no claim of that propertyreturn"[[Category:"..catbase.." nae in Wikidata]]"-- bad. Bot needs to add the propertyendlocalpropValue=hasProp[1].mainsnak.datavalue.value-- This should eventually iterate over all possible values?ifpropValue==valuethenreturn"[[Category:"..catbase.." same as Wikidata]]"-- yay!elsereturn"[[Category:"..catbase.." different frae Wikidata]]"-- needs human review :(endendreturnp