<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="cs">
	<id>https://wiki.czchan.org/w/index.php?action=history&amp;feed=atom&amp;title=Modul%3AWikidata%2Flib</id>
	<title>Modul:Wikidata/lib - Historie editací</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.czchan.org/w/index.php?action=history&amp;feed=atom&amp;title=Modul%3AWikidata%2Flib"/>
	<link rel="alternate" type="text/html" href="https://wiki.czchan.org/w/index.php?title=Modul:Wikidata/lib&amp;action=history"/>
	<updated>2026-05-13T18:43:57Z</updated>
	<subtitle>Historie editací této stránky</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://wiki.czchan.org/w/index.php?title=Modul:Wikidata/lib&amp;diff=82&amp;oldid=prev</id>
		<title>Sneedmaster: naimportována 1 revize</title>
		<link rel="alternate" type="text/html" href="https://wiki.czchan.org/w/index.php?title=Modul:Wikidata/lib&amp;diff=82&amp;oldid=prev"/>
		<updated>2026-01-10T14:49:44Z</updated>

		<summary type="html">&lt;p&gt;naimportována 1 revize&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;cs&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Starší verze&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Verze z 10. 1. 2026, 14:49&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;cs&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Žádný rozdíl)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key nuwiki-nuwiki-:diff:1.41:old-81:rev-82 --&gt;
&lt;/table&gt;</summary>
		<author><name>Sneedmaster</name></author>
	</entry>
	<entry>
		<id>https://wiki.czchan.org/w/index.php?title=Modul:Wikidata/lib&amp;diff=81&amp;oldid=prev</id>
		<title>wp&gt;Matěj Suchánek: ještě jeden výskyt</title>
		<link rel="alternate" type="text/html" href="https://wiki.czchan.org/w/index.php?title=Modul:Wikidata/lib&amp;diff=81&amp;oldid=prev"/>
		<updated>2025-05-01T14:16:40Z</updated>

		<summary type="html">&lt;p&gt;ještě jeden výskyt&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nová stránka&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require &amp;#039;strict&amp;#039;&lt;br /&gt;
&lt;br /&gt;
local p = {&lt;br /&gt;
	props = {&lt;br /&gt;
		begin = { &amp;#039;P569&amp;#039;, &amp;#039;P580&amp;#039; },&lt;br /&gt;
		ending = { &amp;#039;P570&amp;#039;, &amp;#039;P582&amp;#039; },&lt;br /&gt;
		lang = { &amp;#039;P364&amp;#039;, &amp;#039;P407&amp;#039; },&lt;br /&gt;
		point = { &amp;#039;P571&amp;#039;, &amp;#039;P577&amp;#039;, &amp;#039;P585&amp;#039; },&lt;br /&gt;
	},&lt;br /&gt;
	datatypeToValueType = {&lt;br /&gt;
		[&amp;#039;commonsMedia&amp;#039;] = &amp;#039;string&amp;#039;,&lt;br /&gt;
		[&amp;#039;external-id&amp;#039;] = &amp;#039;string&amp;#039;,&lt;br /&gt;
		[&amp;#039;geo-shape&amp;#039;] = &amp;#039;string&amp;#039;,&lt;br /&gt;
		[&amp;#039;globe-coordinate&amp;#039;] = &amp;#039;globecoordinate&amp;#039;,&lt;br /&gt;
		[&amp;#039;math&amp;#039;] = &amp;#039;string&amp;#039;,&lt;br /&gt;
		[&amp;#039;monolingualtext&amp;#039;] = &amp;#039;monolingualtext&amp;#039;,&lt;br /&gt;
		[&amp;#039;musical-notation&amp;#039;] = &amp;#039;string&amp;#039;,&lt;br /&gt;
		[&amp;#039;quantity&amp;#039;] = &amp;#039;quantity&amp;#039;,&lt;br /&gt;
		[&amp;#039;score&amp;#039;] = &amp;#039;string&amp;#039;,&lt;br /&gt;
		[&amp;#039;string&amp;#039;] = &amp;#039;string&amp;#039;,&lt;br /&gt;
		[&amp;#039;tabular-data&amp;#039;] = &amp;#039;string&amp;#039;,&lt;br /&gt;
		[&amp;#039;time&amp;#039;] = &amp;#039;time&amp;#039;,&lt;br /&gt;
		[&amp;#039;url&amp;#039;] = &amp;#039;string&amp;#039;,&lt;br /&gt;
		[&amp;#039;wikibase-item&amp;#039;] = &amp;#039;wikibase-entityid&amp;#039;,&lt;br /&gt;
		[&amp;#039;wikibase-property&amp;#039;] = &amp;#039;wikibase-entityid&amp;#039;,&lt;br /&gt;
		[&amp;#039;wikibase-lexeme&amp;#039;] = &amp;#039;wikibase-entityid&amp;#039;,&lt;br /&gt;
		[&amp;#039;wikibase-form&amp;#039;] = &amp;#039;wikibase-entityid&amp;#039;,&lt;br /&gt;
		[&amp;#039;wikibase-sense&amp;#039;] = &amp;#039;wikibase-entityid&amp;#039;,&lt;br /&gt;
	},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function p.addWdClass(str)&lt;br /&gt;
	return &amp;#039;&amp;lt;span class=&amp;quot;wd&amp;quot;&amp;gt;&amp;#039; .. str .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.category(key, ...)&lt;br /&gt;
	local i18n = mw.loadData(&amp;#039;Modul:Wikidata/i18n&amp;#039;)&lt;br /&gt;
	local Category = require &amp;#039;Modul:Kategorie&amp;#039;&lt;br /&gt;
	local title = mw.title.getCurrentTitle()&lt;br /&gt;
	if i18n.categories[key] ~= &amp;#039;-&amp;#039; then&lt;br /&gt;
		return Category.makeCategory(mw.ustring.format(i18n.categories[key], ...), &amp;#039;0,14&amp;#039;, title.text)&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.getInterwikiPrefix(wiki)&lt;br /&gt;
	local prefixMap = {&lt;br /&gt;
		wiki = &amp;#039;w:&amp;#039;,&lt;br /&gt;
		wikibooks = &amp;#039;b:&amp;#039;,&lt;br /&gt;
		wikidata = &amp;#039;d:&amp;#039;,&lt;br /&gt;
		wikinews = &amp;#039;n:&amp;#039;,&lt;br /&gt;
		wikipedia = &amp;#039;w:&amp;#039;,&lt;br /&gt;
		wikiquote = &amp;#039;q:&amp;#039;,&lt;br /&gt;
		wikisource = &amp;#039;s:&amp;#039;,&lt;br /&gt;
		wikiversity = &amp;#039;v:&amp;#039;,&lt;br /&gt;
		wikivoyage = &amp;#039;voy:&amp;#039;,&lt;br /&gt;
		wiktionary = &amp;#039;wikt:&amp;#039;,&lt;br /&gt;
	}&lt;br /&gt;
	if prefixMap[wiki] then&lt;br /&gt;
		return prefixMap[wiki]&lt;br /&gt;
	end&lt;br /&gt;
	local code, family = string.match(wiki, &amp;#039;^(.+)(wik.-)$&amp;#039;)&lt;br /&gt;
	if prefixMap[code] and family == &amp;#039;wiki&amp;#039; then&lt;br /&gt;
		return prefixMap[code]&lt;br /&gt;
	end&lt;br /&gt;
	if not code then&lt;br /&gt;
		code = wiki&lt;br /&gt;
	end&lt;br /&gt;
	local prefix = string.gsub(code, &amp;#039;_&amp;#039;, &amp;#039;-&amp;#039;) .. &amp;#039;:&amp;#039;&lt;br /&gt;
	return (prefixMap[family] or &amp;#039;&amp;#039;) .. prefix&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.augmentArgs(args, defaults, prefix)&lt;br /&gt;
	local out = {}&lt;br /&gt;
	prefix = prefix or &amp;#039;&amp;#039;&lt;br /&gt;
	setmetatable(out, {&lt;br /&gt;
		__index = function (t, key)&lt;br /&gt;
			if args[prefix .. key] ~= nil then&lt;br /&gt;
				return args[prefix .. key]&lt;br /&gt;
			end&lt;br /&gt;
			return defaults[key]&lt;br /&gt;
		end,&lt;br /&gt;
	})&lt;br /&gt;
	return out&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.formatDateRange(snaks, options)&lt;br /&gt;
	local i18n = mw.loadData(&amp;#039;Modul:Wikidata/i18n&amp;#039;)&lt;br /&gt;
	local Formatters = require &amp;#039;Modul:Wikidata/Formatters&amp;#039;&lt;br /&gt;
	local Y = require(&amp;#039;Modul:Time&amp;#039;).PRECISION.YEAR&lt;br /&gt;
	local defaults = { precision = Y }&lt;br /&gt;
	local options = p.augmentArgs(options, defaults)&lt;br /&gt;
&lt;br /&gt;
	local begin_raw, ending_raw&lt;br /&gt;
	if snaks.begin then&lt;br /&gt;
		begin_raw = Formatters.getRawValue(snaks.begin, options)&lt;br /&gt;
	end&lt;br /&gt;
	if snaks.ending then&lt;br /&gt;
		ending_raw = Formatters.getRawValue(snaks.ending, options)&lt;br /&gt;
	end&lt;br /&gt;
	if not begin_raw or begin_raw == &amp;#039;novalue&amp;#039; then&lt;br /&gt;
		if not ending_raw or ending_raw == &amp;#039;novalue&amp;#039; then&lt;br /&gt;
			return &amp;#039;&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		return mw.ustring.format(options[&amp;#039;end-format&amp;#039;] or i18n.date[&amp;#039;end&amp;#039;],&lt;br /&gt;
			Formatters.formatRawValue(ending_raw, &amp;#039;time&amp;#039;, options))&lt;br /&gt;
	end&lt;br /&gt;
	if not ending_raw or ending_raw == &amp;#039;novalue&amp;#039; then&lt;br /&gt;
		return mw.ustring.format(options[&amp;#039;begin-format&amp;#039;] or i18n.date[&amp;#039;start&amp;#039;],&lt;br /&gt;
			Formatters.formatRawValue(begin_raw, &amp;#039;time&amp;#039;, options))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local begin, ending&lt;br /&gt;
	local connector = &amp;#039; – &amp;#039;&lt;br /&gt;
	if begin_raw ~= &amp;#039;somevalue&amp;#039; and ending_raw ~= &amp;#039;somevalue&amp;#039; then&lt;br /&gt;
		local begin_precision = math.min(options.precision, begin_raw.precision)&lt;br /&gt;
		local ending_precision = math.min(options.precision, ending_raw.precision)&lt;br /&gt;
		local showera = {&lt;br /&gt;
			begin_raw.year &amp;lt;= 0 and ending_raw.year &amp;gt; 0,&lt;br /&gt;
			begin_raw.year &amp;lt;= 0 or ending_raw.year &amp;lt; 0,&lt;br /&gt;
		}&lt;br /&gt;
		while true do&lt;br /&gt;
			-- TODO: implement merging (1st - 2nd January 2020, 3rd January - 4th February 2020, etc.)&lt;br /&gt;
			defaults.precision = begin_precision&lt;br /&gt;
			begin = Formatters.formatRawValue(begin_raw, &amp;#039;time&amp;#039;, options)&lt;br /&gt;
			defaults.precision = ending_precision&lt;br /&gt;
			ending = Formatters.formatRawValue(ending_raw, &amp;#039;time&amp;#039;, options)&lt;br /&gt;
			if begin ~= ending then&lt;br /&gt;
				-- this must happen after equality test&lt;br /&gt;
				defaults.precision = begin_precision&lt;br /&gt;
				defaults.showera = showera[1]&lt;br /&gt;
				begin = Formatters.formatRawValue(begin_raw, &amp;#039;time&amp;#039;, options)&lt;br /&gt;
				defaults.precision = ending_precision&lt;br /&gt;
				defaults.showera = showera[2]&lt;br /&gt;
				ending = Formatters.formatRawValue(ending_raw, &amp;#039;time&amp;#039;, options)&lt;br /&gt;
				break&lt;br /&gt;
			end&lt;br /&gt;
			-- assumption: if the dates are same, they have the same precision&lt;br /&gt;
			if begin_precision == begin_raw.precision or ending_precision == ending_raw.precision then&lt;br /&gt;
				break&lt;br /&gt;
			end&lt;br /&gt;
			begin_precision = begin_precision + 1&lt;br /&gt;
			ending_precision = ending_precision + 1&lt;br /&gt;
		end&lt;br /&gt;
		if begin_precision == Y and ending_precision == Y and not showera[1] then&lt;br /&gt;
			connector = &amp;#039;–&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		begin = Formatters.formatRawValue(begin_raw, &amp;#039;time&amp;#039;, options)&lt;br /&gt;
		ending = Formatters.formatRawValue(ending_raw, &amp;#039;time&amp;#039;, options)&lt;br /&gt;
	end&lt;br /&gt;
	if begin == ending then&lt;br /&gt;
		return begin&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat( { begin, ending }, connector )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.formatError(key, ...)&lt;br /&gt;
	local i18n = mw.loadData(&amp;#039;Modul:Wikidata/i18n&amp;#039;)&lt;br /&gt;
	return mw.ustring.format(i18n.errors[key], ...)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.formatFromPattern(str, pattern)&lt;br /&gt;
	local escaped = mw.ustring.gsub(str, &amp;#039;%%&amp;#039;, &amp;#039;%%%%&amp;#039;)&lt;br /&gt;
	return mw.ustring.gsub(pattern, &amp;#039;$1&amp;#039;, escaped) .. &amp;#039;&amp;#039; --Hack to get only the first result of the function&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.formatTextInLanguage(text, language)&lt;br /&gt;
	return mw.text.tag(&amp;#039;span&amp;#039;, { lang = language }, text)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- @deprecated&lt;br /&gt;
function p.getEntityIdFromValue(value)&lt;br /&gt;
	local entityType = value[&amp;#039;entity-type&amp;#039;]&lt;br /&gt;
	if entityType == &amp;#039;item&amp;#039; then&lt;br /&gt;
		return &amp;#039;Q&amp;#039; .. value[&amp;#039;numeric-id&amp;#039;]&lt;br /&gt;
	elseif entityType == &amp;#039;property&amp;#039; then&lt;br /&gt;
		return &amp;#039;P&amp;#039; .. value[&amp;#039;numeric-id&amp;#039;]&lt;br /&gt;
	else&lt;br /&gt;
		return error(p.formatError(&amp;#039;unknown-entity-type&amp;#039;, entityType))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.getItemIdFromURI(uri)&lt;br /&gt;
	return mw.ustring.match(uri, &amp;#039;(Q%d+)&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.getLabelInLanguage(entityId, langs)&lt;br /&gt;
	langs = p.textToTable(langs)&lt;br /&gt;
	local label, lang = mw.wikibase.getLabelWithLang(entityId)&lt;br /&gt;
	if label then&lt;br /&gt;
		for _, lg in ipairs(langs) do&lt;br /&gt;
			if lg == lang then&lt;br /&gt;
				return label, lang&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return nil, nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.getLinkWhenNonexistingLabel(entityId)&lt;br /&gt;
	local i18n = mw.loadData(&amp;#039;Modul:Wikidata/i18n&amp;#039;)&lt;br /&gt;
	local ImageFormatter = require &amp;#039;Modul:ImageFormatter&amp;#039;&lt;br /&gt;
	return ImageFormatter.makeImage(&amp;#039;Wikidata-edit.svg&amp;#039;, {&lt;br /&gt;
		description = i18n[&amp;#039;missing-label&amp;#039;],&lt;br /&gt;
		link = &amp;#039;d:&amp;#039; .. entityId,&lt;br /&gt;
		size = &amp;#039;27x17px&amp;#039;&lt;br /&gt;
	}) .. &amp;#039;&amp;lt;code&amp;gt;[[d:&amp;#039; .. entityId .. &amp;#039;|&amp;#039; .. entityId .. &amp;#039;]]&amp;lt;/code&amp;gt;&amp;#039; .. p.category(&amp;#039;missing-label&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.IsOptionTrue(options, key)&lt;br /&gt;
	if options[key] then&lt;br /&gt;
		if tostring(options[key]) == &amp;#039;true&amp;#039; or tostring(options[key]) == &amp;#039;yes&amp;#039; or tostring(options[key]) == &amp;#039;1&amp;#039; then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.isPropertyId(value)&lt;br /&gt;
	return mw.ustring.match(value, &amp;#039;^[Pp][1-9]%d-$&amp;#039;) and true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.IsSnakValue(snak)&lt;br /&gt;
	return snak.snaktype == &amp;#039;value&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.raiseInvalidDatatype(method, allowed, provided)&lt;br /&gt;
	if type(allowed) ~= &amp;#039;table&amp;#039; then&lt;br /&gt;
		allowed = { allowed }&lt;br /&gt;
	end&lt;br /&gt;
	return p.formatError(&amp;#039;invalid-datatype2&amp;#039;, method, mw.text.listToText(allowed, &amp;#039;“, „&amp;#039;, &amp;#039;“ nebo „&amp;#039;), provided)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.simpleCompare(first, second)&lt;br /&gt;
	if first == second then&lt;br /&gt;
		return 0&lt;br /&gt;
	end&lt;br /&gt;
	if first &amp;lt; second then&lt;br /&gt;
		return -1&lt;br /&gt;
	else&lt;br /&gt;
		return 1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.textToTable(something, options)&lt;br /&gt;
	if type(something) ~= &amp;#039;table&amp;#039; then&lt;br /&gt;
		local options = options or {}&lt;br /&gt;
		local split_pattern = options.split_pattern or &amp;#039;%s*,%s*&amp;#039;&lt;br /&gt;
		something = mw.text.split(something, split_pattern)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local Functions = require &amp;#039;Modul:Functions&amp;#039;&lt;br /&gt;
	return Functions.cleanArgs(something)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wp&gt;Matěj Suchánek</name></author>
	</entry>
</feed>