Modul:LinkedWiki: Unterschied zwischen den Versionen

766 Bytes hinzugefügt ,  26. April 2021
keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
 
(33 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 4: Zeile 4:
      
      
     local linkedwiki = require 'linkedwiki'
     local linkedwiki = require 'linkedwiki'
local frame = mw.getCurrentFrame()


     -- init the prefix
     -- init the prefix
Zeile 15: Zeile 17:
     local ps = 'http://www.wikidata.org/prop/statement/'
     local ps = 'http://www.wikidata.org/prop/statement/'


     local dateFormat = "d M Y"
     local dateFormat = "Y"


     local subject = f.args.iri or linkedwiki.getCurrentIRI();  --find the iri of the current page
     local subject = f.args.iri or linkedwiki.getCurrentIRI();  --find the iri of the current page
Zeile 27: Zeile 29:
     local objWikidata = nil
     local objWikidata = nil
     local objWikidataTitle = ""
     local objWikidataTitle = ""
    local objWikidataLieuDeces = nil
    local objPapeFonction = nil
     local linkWikidata = ""
     local linkWikidata = ""
local propertyZDB = wdt..'P1042'
local propertyZDB = wdt..'P1042'
local propertyTitel = wdt..'P1476'
local propertyTitel = wdt..'P1476'
local propertyAuthor = wdt..'P2093'
local propertyAuthor = wdt..'P2093'
local propertyJournal = wdt..'P1433'
local propertyIssue = wdt..'P433'
local propertyPubDate = wdt..'P577'
local propertyPage = wdt..'P304'
     if not linkedwiki.isEmpty(f.args['Wikidata ID']) then
     if not linkedwiki.isEmpty(f.args['Wikidata ID']) then
         local idConfigWikidata = 'http://www.wikidata.org'
         local idConfigWikidata = 'http://www.wikidata.org'
         local taglang = 'de'
         local taglang = 'de'
        local datums = nil
        citeq_args = {}
         iriWikidata = wd .. f.args['Wikidata ID']
         iriWikidata = wd .. f.args['Wikidata ID']
         objWikidata = linkedwiki.new(iriWikidata, idConfigWikidata, taglang)
         objWikidata = linkedwiki.new(iriWikidata, idConfigWikidata, taglang)
Zeile 43: Zeile 49:
          
          
         --zdb = 'ZDB: [http://ld.zdb-services.de/resource/'..objWikidata:getValue(propertyZDB)..' '..objWikidata:getValue(propertyZDB)..']'
         --zdb = 'ZDB: [http://ld.zdb-services.de/resource/'..objWikidata:getValue(propertyZDB)..' '..objWikidata:getValue(propertyZDB)..']'
         title = objWikidata:getString(propertyTitel,taglang)
         citeq_args["Titel"] = objWikidata:getString(propertyTitel,taglang)
         autor = objWikidata:getString(propertyAuthor,taglang)
         citeq_args["Autor"] = objWikidata:getValue(propertyAuthor)
        objWikidataJournal= linkedwiki.new(objWikidata:getValue(propertyJournal), idConfigWikidata, taglang)
       
        citeq_args["Sammelwerk"] = objWikidataJournal:getString(propertyTitel,taglang)
        citeq_args["Seiten"] = objWikidata:getValue(propertyPage)
        citeq_args["Nummer"] = objWikidata:getValue(propertyIssue)
        datums = objWikidata:getValue(propertyPubDate)
        citeq_args["Datum"] = string.sub(datums,1,4)
     end
     end




return '{{Literatur|Titel=' .. title ..'|Autor=' .. autor .. '}}'
--return '{{Literatur|Titel=' .. title ..'|Autor=' .. autor .. '}}'
template = 'Literatur'
return frame:expandTemplate{title = template, args = citeq_args}
--return  objWikidata:getValue(propertyAuthor)
end
end


return p
return p
2.621

Bearbeitungen