<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://battery.knowledge-graph.eu/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AEntity</id>
	<title>Module:Entity - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://battery.knowledge-graph.eu/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AEntity"/>
	<link rel="alternate" type="text/html" href="https://battery.knowledge-graph.eu/w/index.php?title=Module:Entity&amp;action=history"/>
	<updated>2026-05-01T02:31:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://battery.knowledge-graph.eu/w/index.php?title=Module:Entity&amp;diff=103&amp;oldid=prev</id>
		<title>Maintenance script: Install package: OSW Core</title>
		<link rel="alternate" type="text/html" href="https://battery.knowledge-graph.eu/w/index.php?title=Module:Entity&amp;diff=103&amp;oldid=prev"/>
		<updated>2023-12-15T05:15:12Z</updated>

		<summary type="html">&lt;p&gt;Install package: OSW Core&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {} --p stands for package&lt;br /&gt;
local mwjson = require(&amp;#039;Module:MwJson&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p.process(frame, mode, title)&lt;br /&gt;
	local msg = &amp;quot;Debug Output: &amp;lt;br&amp;gt;&amp;quot; --debug msg&lt;br /&gt;
&lt;br /&gt;
	local res = &amp;quot;&amp;quot;&lt;br /&gt;
	if title == nil then title = mw.title.getCurrentTitle().fullText end&lt;br /&gt;
	local namespace = mwjson.splitString(title, &amp;#039;:&amp;#039;)[1]&lt;br /&gt;
	&lt;br /&gt;
	local jsondata_res = mwjson.loadJson({title=title, slot=mwjson.slots.jsondata})&lt;br /&gt;
	local jsondata = jsondata_res.json&lt;br /&gt;
	local debug = mwjson.defaultArg(jsondata[mwjson.keys.debug], false)&lt;br /&gt;
	msg = msg .. jsondata_res.debug_msg&lt;br /&gt;
	&lt;br /&gt;
	local process_res = nil&lt;br /&gt;
	if (namespace == &amp;quot;Category&amp;quot;) then&lt;br /&gt;
		if (mode == &amp;quot;header&amp;quot;) then process_res = mwjson.processJsondata({frame=frame, jsondata=jsondata, mode=mwjson.mode.header, categories={&amp;quot;Category:Category&amp;quot;}, recursive=true, debug=debug}) end&lt;br /&gt;
		if (mode == &amp;quot;footer&amp;quot;) then process_res = mwjson.processJsondata({frame=frame, jsondata=jsondata, mode=mwjson.mode.footer, categories={&amp;quot;Category:Category&amp;quot;}, recursive=true, debug=debug}) end&lt;br /&gt;
		--mw.smw.set( {[&amp;quot;IsA&amp;quot;]=&amp;quot;Category:Category&amp;quot;}) --Todo: use type / HasType ?&lt;br /&gt;
	else&lt;br /&gt;
		if (mode == &amp;quot;header&amp;quot;) then process_res = mwjson.processJsondata({frame=frame, jsondata=jsondata, mode=mwjson.mode.header, debug=debug}) end&lt;br /&gt;
		if (mode == &amp;quot;footer&amp;quot;) then process_res = mwjson.processJsondata({frame=frame, jsondata=jsondata, mode=mwjson.mode.footer, debug=debug}) end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	res = res .. process_res.wikitext&lt;br /&gt;
	msg = msg .. process_res.debug_msg&lt;br /&gt;
&lt;br /&gt;
	if (debug) then res = msg .. res  end&lt;br /&gt;
	--if (debug) then mw.log(msg) end&lt;br /&gt;
	--mw.logObject(res)&lt;br /&gt;
	return res&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.header(frame, title)&lt;br /&gt;
	return p.process(frame, &amp;quot;header&amp;quot;, title)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.footer(frame, title)&lt;br /&gt;
	return p.process(frame, &amp;quot;footer&amp;quot;, title)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--test: mw.logObject(p.query(mw.getCurrentFrame(), &amp;#039;{&amp;quot;category&amp;quot;:&amp;quot;Category:Hardware&amp;quot;,&amp;quot;manufacturer&amp;quot;:&amp;quot;TestM&amp;quot;}&amp;#039;))&lt;br /&gt;
function p.query(frame, jsondata_str)&lt;br /&gt;
	if (jsondata_str == nil) then jsondata_str = frame.args[&amp;#039;jsondata&amp;#039;] end&lt;br /&gt;
	--local res = mwjson.processJsondata({frame=frame, jsondata=mw.text.jsonDecode(jsondata_str), mode=mwjson.mode.query}).wikitext&lt;br /&gt;
	return jsondata_str --.. &amp;quot;&amp;lt;br&amp;gt;&amp;quot; .. res&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;br /&gt;
&lt;br /&gt;
--DEBUG (direct invoke)&lt;br /&gt;
--[[&lt;br /&gt;
frame = mw.getCurrentFrame() -- Get a frame object&lt;br /&gt;
title=&amp;quot;Item:OSL7d7193567ea14e4e89b74de88983b718&amp;quot;&lt;br /&gt;
newFrame = frame:newChild{ title=title, args = {}}&lt;br /&gt;
mw.log(p.header( newFrame, title ) ) &lt;br /&gt;
--]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>