p = -- an empty table
local function test(qid, pid) statementstbl = mw.wikibase.getBestStatements(qid, pid) local labels = "" for k, v in ipairs(statementstbl) do local dtype = v.mainsnak.datatype labels = labels .. "
" .. dtype if dtype
local maanden = local function getmonthname(m) m = 1*m local s = type(maanden[m])
local function getitems(qid, pid) statementstbl = mw.wikibase.getBestStatements(qid, pid) local result = for k, v in ipairs(statementstbl) do local dtype = v.mainsnak.datatype if dtype
nil or link
label then newlabel = "" .. label .. "" else newlabel = "" .. label .. "" end end elseif dtype
local function getlabel(pid) local label = mw.wikibase.getLabel(pid) return labelend
local function getprops local props = table.insert(props, "P735") table.insert(props, "P734") table.insert(props, "P19") table.insert(props, "P569") table.insert(props, "P106") table.insert(props, "P26") table.insert(props, "P570") return propsend
function p.getinfo(frame) local qid = frame.args.qid or "Q42" local props = getprops local htmlTable = mw.html.create("table") :addClass("wikitable") local headerRow = htmlTable :tag("tr") headerRow :tag("th") :attr("colspan", "2") :wikitext("Wikidata for " .. getlabel(qid)) for k,v in pairs(props) do local row = htmlTable:tag("tr") local cell = row:tag("td") cell:wikitext(getlabel(v)) local cell = row:tag("td") cell:wikitext(getitems(qid, v)) end return htmlTableend
function p.test(frame) local qid = frame.args.qid or "Q42" result = test(qid, "P570") return resultend
-- reizigersinformatie van een station
local function getmostrecentdate(qid) statementstbl = mw.wikibase.getAllStatements(qid, 'P1373') local maxtime = for k, v in ipairs(statementstbl) do local dtype = v.mainsnak.datatype if dtype
local function getNMBStelling(qid, gezochtjaar) statementstbl = mw.wikibase.getAllStatements(qid, 'P1373') local aantaldoordeweek = '-' local aantalzaterdag = '-' local aantalzondag = '-' local labels = "" for k, v in ipairs(statementstbl) do local dtype = v.mainsnak.datatype if dtype
if jaar
'work week' then aantaldoordeweek = amount else if weekdag
'Sunday' then aantalzondag = amount end end end end end end labels = '' return labelsend
function p.getvoyagers(frame) local qid = frame.args.qid or "Q601108" local date = getmostrecentdate(qid) local result = getNMBStelling(qid, date) return resultend
return p