Modulo:SemBase: differenze tra le versioni

Da Wikitrek.
Vai alla navigazione Vai alla ricerca
mNessun oggetto della modifica
(Mostly test functions)
 
(4 versioni intermedie di uno stesso utente non sono mostrate)
Riga 1: Riga 1:
-- Keyword: wikitrek
-- Keyword: wikitrek
-- Mostly test functions
local p = {}
local p = {}
function p.FirstSemantic(frame)
function p.FirstSemantic(frame)
local query = '[[Category:Episodi || Film]][[Personaggio::' .. mw.title.getCurrentTitle() .. ']]|?Interprete'
local Title = mw.title.getCurrentTitle()
local query = '[[Category:Episodi || Film]][[Personaggio::' .. 'Vina' .. ']]|?Interprete'
--mw.title.getCurrentTitle()
--mw.title.getCurrentTitle()
local result = mw.smw.ask(query)
local result = mw.smw.ask(query)

Versione attuale delle 15:56, 3 giu 2023

La documentazione per questo modulo può essere creata in Modulo:SemBase/man

-- Keyword: wikitrek
-- Mostly test functions
local p = {}
function p.FirstSemantic(frame)
	local Title = mw.title.getCurrentTitle()
	local query = '[[Category:Episodi || Film]][[Personaggio::' .. 'Vina' .. ']]|?Interprete'
	--mw.title.getCurrentTitle()
	local result = mw.smw.ask(query)
	--return result
	
	local List = {}
	for _, Row in pairs(result) do
		local Items = {}
		for _, Field in pairs(Row) do
			Items[#Items + 1] = Field
		end
		List[#List + 1] = "*" .. table.concat(Items, ', ')
	end
	
	return table.concat(List, string.char(10))
end

function p.EsempioDataSem(frame)
	local Date = "2019-03-07"
	
	return "[[Prima TV CBS::" .. Date .. "|" .. frame:expandTemplate{title = 'TimeL', args = {Tipo='ITEstesa', Istante=Date}} .. "]]"
end
return p