| Vorlagenprogrammierung | Diskussionen | Lua | Unterseiten | |||
| Modul | Deutsch | English | Modul: | Dokumentation | ||
WikidataScheme – support creation of new Wikidata data objects (items, „Q“) and completion of existing entries.
For certain objects in the (real) world some input which is always or quite often needed shall be presented for easy access. That covers properties, some typical items for this context and qualifiers. Those things should remind to provide all minimal information and are to be displayed in a comprehensible manner.
See the scenario for a general survey.
1 – JSON data with specification, or name of a Lua page as mw.loadData1 – JSON data with specification, or name of a Lua page as mw.loadData1 – JSON data with specification, or name of a Lua page as mw.loadData2019-12-161 – Minimum version or wikidata or ~{{#invoke:WikidataScheme|failsafe}} yields 2019-12-16{{#invoke:WikidataScheme|failsafe|2001-01-01}} returns: »2019-12-16«{{#invoke:WikidataScheme|failsafe|2099-01-01}} returns: »« – (empty), if minimal version condition not matchedwikidata, result is version ID registered on Wikidata (2019-12-16) or local if not found there.~, result is empty if local and Wikidata version are the same: ().~ and local version is synchronized.wikidata, or local if not found there, or not synchronized.See the scenario which illustrates results on input values.
All functions described above can be used by other modules:
local lucky, WikidataScheme = pcall( require, "Module:WikidataScheme" )
if type( WikidataScheme ) == "table" then
WikidataScheme = WikidataScheme.WikidataScheme()
else
-- In the event of errors, WikidataScheme is an error message.
return "<span class=\"error\">" .. WikidataScheme .. "</span>"
end
Subsequently there are available:
mw.loadData pagemw.loadData pagetrue – symbolic entity names will be resolvedfalse (default) – symbolic entity names will be keptframe object, if availablemw.loadData pageframe object, if availablewikidata or ~ for synchronisationfalseFollow the steps:
Module:WikidataScheme into your project.
WikidataScheme.