Modul: Studienprofil: Unterschied zwischen den Versionen
Aus MAV
MH (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
MH (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
| Zeile 33: | Zeile 33: | ||
local out = '{| class="wikitable sortable"\n' | local out = '{| class="wikitable sortable"\n' | ||
out = out .. '! Gedruckt in !! Disputationstyp !! Ende !! Titel\n' | out = out .. '! Gedruckt in !! Disputationstyp !! Ende !! Titel !! Schlagworte !! Praeses !! Respondent \n' | ||
for _, row in ipairs(searchresult) do | for _, row in ipairs(searchresult) do | ||
Version vom 3. Januar 2026, 23:26 Uhr
Aufruf der Funktion
Bitte exakt nach folgendem Schema in der "Vorlage:MAV" aufrufen
{{#invoke:Studienprofil|combinedStudienprofiles|{{SUBPAGENAME}}}}
local p = {}
function p.getStudents(Beginn, Ende)
local searchresult = ''
searchresult = mw.smw.ask( '[[Kategorie:Ausbildung]][[Beginn::<' .. Ende .. ']][[Ende::>' .. Beginn .. ']][[Geographikum::Universität Wittenberg]]|?Beginn=Beginn|?Ende=Ende|limit=500' )
if not searchresult then
return 'Keine Einträge gefunden'
end
local out = '{| class="wikitable sortable"\n'
out = out .. '! Name !! Beginn !! Ende\n'
for _, row in ipairs(searchresult) do
out = out .. '|-\n'
out = out .. '| ' .. row[1] .. '\n'
out = out .. '| ' .. (row.Beginn or '') .. '\n'
out = out .. '| ' .. (row.Ende or '') .. '\n'
end
out = out .. '|}\n'
return out
end
function p.getPrintedDissertations(Beginn, Ende)
local searchresult = ''
searchresult = mw.smw.ask( '[[Kategorie:Disputation]][[DisputationDatumBeginn::<' .. Ende .. ']][[DisputationDatumEnde::>' .. Beginn .. ']]|?Druck=GedrucktIn|?DisputationTyp=Typ|?DisputationDatumBeginn=Datum|?VDTitel=Titel|?Schlagworte=Schlagworte|?Präses=Praeses|?Respondent=Respondent|limit=500' )
if not searchresult then
return 'Keine Einträge gefunden'
end
local out = '{| class="wikitable sortable"\n'
out = out .. '! Gedruckt in !! Disputationstyp !! Ende !! Titel !! Schlagworte !! Praeses !! Respondent \n'
for _, row in ipairs(searchresult) do
out = out .. '|-\n'
out = out .. '| ' .. row.GedrucktIn .. '\n'
out = out .. '| ' .. (row.Typ or '') .. '\n'
out = out .. '| ' .. (row.Datum or '') .. '\n'
out = out .. '| ' .. (row.Titel or '') .. '\n'
out = out .. '| ' .. (row.Schlagworte or '') .. '\n'
out = out .. '| ' .. (row.Praeses or '') .. '\n'
out = out .. '| ' .. (row.Respondent or '') .. '\n'
end
out = out .. '|}\n'
return out
end
function p.createSingleStudienprofil(Beginn, Ende)
local returnstring = ''
returnstring = returnstring .. "'''Mitstudenten: '''\n" .. p.getStudents(Beginn, Ende)
returnstring = returnstring .. "'''Gedruckte Dissertationen an der Universität Wittenberg: '''\n" .. p.getPrintedDissertations(Beginn, Ende)
return returnstring
end
function p.combinedStudienprofiles(frame)
local queryResult = ''
local pagename = frame.args[1]
local returnvalue = ''
queryResult = mw.smw.ask( '[[Kategorie:Ausbildung]][[Person::' .. pagename .. ']][[Geographikum::Universität Wittenberg]]|mainlabel=-|?Beginn|?Ende|sort=DatumSortiert|format=plainlist' )
if queryResult == nil then
return 'Keine Angaben zu einem Studium in Wittenberg gefunden.'
end
if type( queryResult ) == "table" then
local Beginn = ''
local Ende = ''
for num, row in pairs( queryResult ) do
for property, data in pairs( row ) do
if property == 'Beginn' then
Beginn = data
elseif property == 'Ende' then
Ende = data
end
end
returnvalue = returnvalue .. '=== Studium (von ' .. Beginn .. ' bis ' .. Ende .. ') ===\n' .. p.createSingleStudienprofil(Beginn, Ende)
end
end
return returnvalue
end
return p