Semantic MediaWikiDit bericht verdwijnt nadat alle relevante taken zijn afgerond.

Er is één onvoltooide of openstaande taak, die nodig is om het bijwerken van Semantic MediaWiki te voltooien. Een beheerder of gebruiker met voldoende rechten kan deze uitvoeren. Dit moet worden gedaan voordat nieuwe gegevens worden toegevoegd om tegenstrijdigheden te voorkomen.

Geen bewerkingssamenvatting
Geen bewerkingssamenvatting
Regel 19: Regel 19:
titelBiblio = mSlot.getValueFromTemplateData( "ws-page-props", titelnr, "Title", "TitelBiblio" )
titelBiblio = mSlot.getValueFromTemplateData( "ws-page-props", titelnr, "Title", "TitelBiblio" )
if titelBiblio == nil or titelBiblio == "" then titelBiblio = titelGew end
if titelBiblio == nil or titelBiblio == "" then titelBiblio = titelGew end
schrijverNrs = mSlot.getValueFromTemplateData( "ws-page-props", titelnr, "Title", "SchrijverNr" )
schrijverNr = mSlot.getValueFromTemplateData( "ws-page-props", titelnr, "Title", "SchrijverNr" )
mw.log( "schrijverNrs: " .. schrijverNrs )
mw.log( "schrijverNr: " .. schrijverNr )
authorNames = p.getAuthorNames( schrijverNrs )
authorNames = p.getAuthorNames( schrijverNr )
-- + get author names of first two authors
-- + get author names of first two authors
end
end
Regel 66: Regel 66:
if authors == "" or authors == nil then return "" end
if authors == "" or authors == nil then return "" end
local authorTbl = mw.text.split( authors, "," )
local authorTbl = mw.text.split( authors, "," )
mw.log( "#authorTbl", #authorTbl )
local nameTbl = {}
local nameTbl = {}
for k,v in ipairs(authorTbl) do
for i,v in ipairs(authorTbl) do
-- first two authors only
-- first two authors only
if k == "1" or k == "2" then
if i == "1" or i == "2" then
local naamGew = mSlot.getValueFromTemplateData( "ws-page-props", mw.text.trim(v), "Person", "NaamGew" )
local naamGew = mSlot.getValueFromTemplateData( "ws-page-props", mw.text.trim(v), "Person", "NaamGew" )
mw.log( "naamGew: " .. naamGew )
mw.log( "naamGew: " .. naamGew )

Versie van 1 okt 2025 17:46

Module:Class/Book




/ De verre Aarde / verre Aarde, De / 1990, 2ᵉdruk, A.W. Bruna & Zoon, Utrecht / 2ᵉdruk (1990), A.W. Bruna & Zoon, Utrecht

https://www.fandata.nl/Persoon/1608

/ Tim 2 / Tim 2 / 1975, Standaard Uitgeverij, Antwerpen/Amsterdam /  (1975), Standaard Uitgeverij, Antwerpen/Amsterdam

Has publication info = (1975), Standaard Uitgeverij, Antwerpen/Amsterdam +

Has publication year = 1975

Has sort label = Tim 2 louis de groof 1975¶

Has sort label by author = Groof, louis de - tim 2¶


local p = {}
local mSlot = require("Module:Slot")

p.set = function( frame ) 
	local uitgeverijnr = frame.args.uitgeverijnr or ""
	local boekpubjaar = frame.args.boekpubjaar or ""
	local druk = frame.args.druk or ""
	local titleAddendum = p.createTitleAddendum( boekpubjaar, druk, uitgeverijnr, false )
	local titleAddendumVariant = p.createTitleAddendum( boekpubjaar, druk, uitgeverijnr, true )
	
	local titelnr = frame.args.titelnr or ""
	--TitelGew
	local titelGew = ""
	local titelBiblio = ""
	local schrijverNrs = ""
	local authorNames = ""
	if titelnr ~= "" then
		titelGew = mSlot.getValueFromTemplateData( "ws-page-props", titelnr, "Title", "TitelGew" )
		titelBiblio = mSlot.getValueFromTemplateData( "ws-page-props", titelnr, "Title", "TitelBiblio" )
		if titelBiblio == nil or titelBiblio == "" then titelBiblio = titelGew end
		schrijverNr = mSlot.getValueFromTemplateData( "ws-page-props", titelnr, "Title", "SchrijverNr" )
		mw.log( "schrijverNr: " .. schrijverNr )
		authorNames = p.getAuthorNames( schrijverNr )
		-- + get author names of first two authors
	end


	return authorNames .. " / " .. titelGew .. " / " .. titelBiblio .. " / " .. titleAddendum .. " / " .. titleAddendumVariant
end

p.createTitleAddendum = function( boekpubjaar, druk, uitgeverijnr, variant )
	local str = ""
	local boekpubjaar = boekpubjaar or "?"
	if boekpubjaar == "" then boekpubjaar = "?" end

	local drukWeergave = ""
	if druk ~= "" then
		local drukN = tonumber(druk)
		if drukN == nil then
			drukWeergave =  "druk: " .. druk
		else
			drukWeergave =  druk .. "ᵉ" .. "druk"
		end
	end

	local uitgeverijnaam = ""
	if uitgeverijnr ~= "" then
		--local slotContent = mSlot.getSlotContent( uitgeverijnr, "ws-page-props", "Publisher" )
		uitgeverijnaam = mSlot.getValueFromTemplateData( "ws-page-props", uitgeverijnr, "Publisher", "Naam" )
	end

	-- concat
	if variant ~= "" and variant == true then
		str = drukWeergave .. " (" .. boekpubjaar .. ")"
		if uitgeverijnaam ~= "" then str = str .. ", " .. uitgeverijnaam end
	else
		str = boekpubjaar
		if drukWeergave ~= "" then str = str .. ", " .. drukWeergave end
		if uitgeverijnaam ~= "" then str = str .. ", " .. uitgeverijnaam end
	end

	return str
end

p.getAuthorNames = function( authors )
	if authors == "" or authors == nil then return "" end
	local authorTbl = mw.text.split( authors, "," )
	mw.log( "#authorTbl", #authorTbl )
	local nameTbl = {}
	for i,v in ipairs(authorTbl) do
		-- first two authors only
		if i == "1" or i == "2" then
			local naamGew = mSlot.getValueFromTemplateData( "ws-page-props", mw.text.trim(v), "Person", "NaamGew" )
			mw.log( "naamGew: " .. naamGew )
			table.insert( nameTbl, naamGew )
		end
	end
	return table.concat( nameTbl, ", ")
end

return p