<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AIs_located_in</id>
	<title>Module:Is located in - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AIs_located_in"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Is_located_in&amp;action=history"/>
	<updated>2026-04-21T16:36:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Is_located_in&amp;diff=137058&amp;oldid=prev</id>
		<title>imported&gt;MSGJ: create based on Module:Is instance</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Is_located_in&amp;diff=137058&amp;oldid=prev"/>
		<updated>2022-09-26T17:51:31Z</updated>

		<summary type="html">&lt;p&gt;create based on &lt;a href=&quot;/research/Module:Is_instance&quot; title=&quot;Module:Is instance&quot;&gt;Module:Is instance&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {};&lt;br /&gt;
&lt;br /&gt;
local function checklayer(depth) -- check P131 of items at current depth&lt;br /&gt;
	checklist[depth+1] = {} -- setup next layer of table&lt;br /&gt;
	local j = 0&lt;br /&gt;
	for j = 1,#checklist[depth] do -- loop over items at current depth&lt;br /&gt;
		local subclasses = mw.wikibase.getBestStatements(checklist[depth][j],&amp;quot;P131&amp;quot;) -- get P131 statements&lt;br /&gt;
		for i,statement in ipairs(subclasses) do -- loop through items at next depth&lt;br /&gt;
			if statement.mainsnak.snaktype == &amp;#039;value&amp;#039; then&lt;br /&gt;
				local newitem = statement.mainsnak.datavalue.value.id&lt;br /&gt;
				if newitem == value then&lt;br /&gt;
					isLocated = true&lt;br /&gt;
				else&lt;br /&gt;
					checklist[depth+1][#checklist[depth+1]+1] = newitem -- add item to next depth of checklist table&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return isLocated&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	local pargs = frame:getParent().args&lt;br /&gt;
	value = args.value or pargs.value&lt;br /&gt;
	local qid = args.qid or pargs.qid or &amp;quot;&amp;quot;&lt;br /&gt;
	if qid == &amp;quot;&amp;quot; then&lt;br /&gt;
		qid = mw.wikibase.getEntityIdForCurrentPage()&lt;br /&gt;
	end&lt;br /&gt;
	if not qid then&lt;br /&gt;
		return 0&lt;br /&gt;
	end&lt;br /&gt;
	checklist = {{qid}}&lt;br /&gt;
	local md = args.maxdepth or pargs.maxdepth&lt;br /&gt;
	if md then&lt;br /&gt;
		maxdepth = tonumber(md)&lt;br /&gt;
	else&lt;br /&gt;
		maxdepth = 5&lt;br /&gt;
	end&lt;br /&gt;
	depth = 0 -- current depth&lt;br /&gt;
	isLocated = false -- assume false until match found&lt;br /&gt;
	while not isLocated and depth&amp;lt;maxdepth do&lt;br /&gt;
		depth = depth+1&lt;br /&gt;
		checklayer(depth)&lt;br /&gt;
	end&lt;br /&gt;
	if not isLocated then&lt;br /&gt;
		depth = 0 -- indicates not isLocated&lt;br /&gt;
	end&lt;br /&gt;
	return depth -- return depth that item was found&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;MSGJ</name></author>
	</entry>
</feed>