Jump to content
Panguna nga menu
Panguna nga menu
move to sidebar
tagoa
Tabok-tabok
Unang Panid
Tubaan
Mga bag-ong giusab
Bisan unsang panid
Tabang
Pangita
Pangitaa
Appearance
Mga donasyon
Paghimo og akawnt
Sulod
Personal nga galamiton
Mga donasyon
Contribute
Paghimo og akawnt
Sulod
Pages for logged out editors
learn more
Panghisgot-hisgot alang niining IP
Nagausab sa
Module:Cite
Idugang ang mga pinulongan
Module
Panaghisgot-hisgot
English
Basaha
Usba ang wikitext
Tan-awa ang kaagi
Mga galamiton
Mga galamiton
move to sidebar
tagoa
Actions
Basaha
Usba ang wikitext
Tan-awa ang kaagi
Heneral
Unsay mga misumpay dinhi
Mga may kalabotang kausaban
Pagsumiter og payl
Impormasyon kabahin sa panid
Pagkuha og pinamubo nga URL
Download QR code
Appearance
move to sidebar
tagoa
Pahimangno:
Wala ka mailhi sa balayan. Ang imong
IP adress
makita sa publiko kon mohimo ka og mga pag-usab. Kon
mo-
log in
ka o
mohimo og akawnt
, ang imong mga pag-usab ingalan sa imong
username
, lakip na ang uban pang kaayohan.
Pagkontra sa
spam
.
Ayaw</stong> ni sudli!
--/-- Creates a timeline for an item based on various properties local propsamling = {"P143", "P304", "P50", "P212", "P957", "P854", "P478", "P98", "P393", "P1476", "P357", "P123", "P577", "P248", "P433", "P275", "P698", "P356", "P958", "P1433", "P1680", 'P1683', 'P387', 'P518'} local p = {} local olampliga = {'Q11032', -- tidning 'Q1110794', -- dagstidning 'Q2016362'} -- morgontidning local wikidata = require('Module:Wikidata2').formatStatementsFromLua local wikidata2 = require('Module:Wikidata2').formatEntityId local function itemcheck(items) if items then for i, item in pairs(items) do local typer = wikidata({entityId = item, property = 'P31', noref = 'true', raw = 'true'}) if typer then for j, typ in pairs(typer) do for k, olamplig in pairs(olampliga) do if typ.item == olamplig then return '[[Kategoriya:Panid uban sa dili kaayo angay nga paggamit sa P248]]' end end end end end end end local function helpednumber(items, property) for i, item in pairs(items) do local ednumber = wikidata({entityId = item, property = property, enbarten = 'yes'}) if ednumber then return ednumber end end end local function getPage(items, refsnak) local page = wikidata({property = 'P304', enbarten = 'true'}, refsnak) if not page then page = helpednumber(items, "P304") end if page then return 's. ' .. page end end local function getarticle(items, refsnak) local s = {} for i, item in pairs(items) do local s2 = wikidata({entityId = item, property = 'P958', noref = 'true'}) if s2 then table.insert(s, '”' .. s2 .. '”') end end local s3 = wikidata({property = 'P958'}, refsnak) if s3 then table.insert(s, '”' .. s3 .. '”') end return table.concat(s, ', ') end local function getquote(items, refsnak) local s = {} for i, item in pairs(items) do local s2 = wikidata({entityId = item, property = 'P1683', noref = 'true'}) if s2 then table.insert(s, '”' .. s2 .. '”') end end local s3 = wikidata({property = 'P1683'}, refsnak) if s3 then table.insert(s, '”' .. s3 .. '”') end for i, item in pairs(items) do local s2 = wikidata({entityId = item, property = 'P387', noref = 'true'}) if s2 then table.insert(s, '”' .. s2 .. '”') end end local s4 = wikidata({property = 'P387'}, refsnak) if s4 then table.insert(s, '”' .. s4 .. '”') end return table.concat(s, ', ') end local function getauthor(items, refsnak) local s = {} for i, item in pairs(items) do if item ~= 'Q36578' then table.insert(s, wikidata({entityId = item, property = 'P50', noref = 'true', conjunction = ' & '})) end end table.insert(s, wikidata({property = 'P50', conjunction = ' & '}, refsnak)) return table.concat(s, ', ') end local function getappliestopart(items, refsnak) local s = {} for i, item in pairs(items) do table.insert(s, wikidata({entityId = item, property = 'P518', noref = 'true'})) end table.insert(s, wikidata({property = 'P518'}, refsnak)) return table.concat(s, ', ') end local function getISBN(items, refsnak) local ISBN = nil for i, item in pairs(items) do ISBN = wikidata({entityId = item, property = 'P212', enbarten = 'yes', noref = 'true'}) --ISBN 13 if ISBN then return 'ISBN ' .. ISBN end end ISBN = wikidata({property = 'P212', enbarten = 'true'}, refsnak) if ISBN then return 'ISBN ' .. ISBN end for i, item in pairs(items) do ISBN = wikidata({entityId = item, property = 'P957', enbarten = 'yes', noref = 'true'}) --ISBN 10 if ISBN then return 'ISBN ' .. ISBN end end ISBN = wikidata({property = 'P957', enbarten = 'true'}, refsnak) if ISBN then return 'ISBN ' .. ISBN end return nil end local function getLink(items, refsnak ) local links = {} for i, item in pairs(items) do table.insert(links, wikidata({entityId = item, property = 'P854', label = 'läs online', noref = 'true'})) end table.insert(links, wikidata({property = 'P854', label = 'pagbasa sa online'}, refsnak)) return table.concat(links) end local function getHamtdatum(items, refsnak ) local hamtdatum = {} for i, item in pairs(items) do table.insert(hamtdatum, wikidata({entityId = item, property = 'P813', noref = 'true', modifytime = 'longdate' })) end table.insert(hamtdatum, wikidata({property = 'P813', modifytime = 'longdate'}, refsnak)) local tot = table.concat(hamtdatum) if tot and tot ~= '' then return 'läst: ' .. tot end end local function getVolume(items, refsnak ) local page = wikidata({property = 'P478', enbarten = 'true'}, refsnak) or helpednumber(items, "P478") if page then return 'vol. ' .. page end end local function getMost(items, refsnak, property ) local B = {wikidata({property = property, enbarten = 'true', pattern = 'auktoritetsdata2'}, refsnak)} for i, item in pairs(items) do table.insert(B, wikidata({entityId = item, property = property, pattern = 'auktoritetsdata2', noref = 'true'})) end if #B > 0 then return table.concat(B) end end local function getEditor(items, refsnak ) local s = {} for i, item in pairs(items) do table.insert(s, wikidata({entityId = item, property = 'P98', noref = 'true', conjunction = ' & '})) end table.insert(s, wikidata({property = 'P98', conjunction = ' & '}, refsnak)) local tot = table.concat(s, ', ') if tot and tot ~= '' then return tot .. ' (red.)' end end local function getedition(items, refsnak ) local ordning = {'första', 'andra', 'tredje', 'fjärde', 'femte', 'sjätte', 'sjunde', 'åttonde', 'nionde', 'tionde', '11:e', '12:e'} local ednumber = wikidata({property = 'P393', enbarten = 'true'}, refsnak) if not ednumber then ednumber = helpednumber(items, "P393") end if not ednumber then return nil end if not tonumber(ednumber) then return ednumber .. ' edisyon' end if ordning[tonumber(ednumber)] then return ordning[tonumber(ednumber)] .. ' edisyon' end local sist = string.sub(ednumber, string.len(ednumber)) if sist == '1' or sist == '2' then return ednumber .. ' edisyon' else return ednumber .. ' edisyon' end end local function getsubtitle(items, refsnak)-- needs i18n some languages do not use this format local s = {} table.insert(s, wikidata({property = 'P1680', enbarten = 'true'}, refsnak)) for i, item in pairs( items ) do local lab = wikidata({property = 'P1680', entityId = item, enbarten = 'true', noref = 'true'}) local sitelink = mw.wikibase.sitelink( item ) if sitelink and lab then table.insert(s, '[[:' .. sitelink .. '|' .. lab .. ']]') elseif lab then table.insert(s, lab) end end tot = table.concat(s, ', ') if tot and tot ~= '' then return tot else return nil end end local function gettitle(items, refsnak)-- needs i18n some languages do not use this format local subtitle = getsubtitle(items, refsnak) local s = {} table.insert(s, wikidata({property = 'P1476', enbarten = 'true'}, refsnak) or wikidata({property = 'P357', enbarten = 'true'}, refsnak)) for i, item in pairs( items ) do local lab = wikidata({property = 'P1476', entityId = item, enbarten = 'true', noref = 'true'}) or wikidata({property = 'P357', entityId = item, enbarten = 'true', noref = 'true'}) if not lab then lab = wikidata2(item, {nolink = 'true', noref = 'true'}).value end local sitelink = mw.wikibase.sitelink( item ) if sitelink then table.insert(s, '[[:' .. sitelink .. '|' .. lab .. ']]') else table.insert(s, lab) end end tot = table.concat(s, ', ') if tot and tot ~= '' then if subtitle and subtitle ~= '' then return '<i>' .. tot .. ' : ' .. subtitle .. '</i>' else return '<i>' .. tot .. '</i>' end else return nil end end local function getissue(items, refsnak) local issue = wikidata({property = 'P433', enbarten = 'true'}, refsnak) if not issue then issue = helpednumber(items, "P433") end if issue then return issue end end local function getpublisher(items, refsnak ) local s = {} for i, item in pairs(items) do table.insert(s, wikidata({entityId = item, property = 'P123', noref = 'true'})) end table.insert(s, wikidata({property = 'P123'}, refsnak)) local tot = table.concat(s, ', ') if tot and tot ~= '' then return tot end end local function getpublishedin(items, refsnak ) local s = {} for i, item in pairs(items) do table.insert(s, wikidata({entityId = item, property = 'P1433', noref = 'true'})) end table.insert(s, wikidata({property = 'P1433'}, refsnak)) local tot = table.concat(s, ', ') if tot and tot ~= '' then return tot end end local function getPublishdate(items, refsnak ) local publishdate = {} for i, item in pairs(items) do table.insert(publishdate, wikidata({entityId = item, property = 'P577', noref = 'true', modifytime = 'longdate' })) end table.insert(publishdate, wikidata({property = 'P577', modifytime = 'longdate'}, refsnak)) local tot = table.concat(publishdate) if tot and tot ~= '' then return tot end end local function getwhatever(items, refsnak, property) local a = wikidata({property = 'P1629', entityId = property, enbarten = 'true', noref = 'true', label = wikidata2(property, {nolink = 'true', noref = 'true'}).value}) if property == "P143" then a = '[[Kategoriya:Mga artikulo sa imported nga mga datos sa Wikidata]] moabut gikan sa' end local s = {} for i, item in pairs(items) do table.insert(s, wikidata({entityId = item, property = property, noref = 'true', conjunction = ', '})) end table.insert(s, wikidata({property = property, conjunction = ', '}, refsnak)) if #s > 0 then return a .. ': ' .. table.concat(s, ', ') end end local function gettherest(items, refsnak) local s = {} for i, j in pairs(refsnak) do finns = false for k, l in pairs(propsamling) do if i == l then finns = true end end if not finns then local entity = mw.wikibase.getEntityObject( i ) if ( entity.datatype == 'string' or entity.datatype == 'external-id' ) and entity.claims and entity.claims.P1629 then table.insert(s, getMost(items, refsnak, i)) end end end if #s > 0 then return table.concat(s) end end local function citebook(item, lang, page) local publishdate = getpublishdate(item ) local author = getauthor(item ) local editor = getEditor(item ) local title = getbooktitle(item ) local publisher = getpublisher(item ) local publishedin = getpublishedin(item ) local edition = getedition(item ) local isbn = getISBN(item ) local doi = getDoi(item ) local pmid = getPmid(item ) local link = getLink(item ) local volume = getVolume(item ) local pagenumber = formatpage(page, lang) local license = getlicense(item ) local fields = {} table.insert(fields, author) table.insert(fields, editor) table.insert(fields, title) table.insert(fields, edition) table.insert(fields, volume) table.insert(fields, publisher) table.insert(fields, publishedin) table.insert(fields, publishdate) table.insert(fields, pagenumber) table.insert(fields, isbn) table.insert(fields, doi) table.insert(fields, pmid) table.insert(fields, link) table.insert(fields, license) return linguistic.conj(fields, lang, "comma") end local function citearticle(item, lang, page) local fields = {} table.insert(fields, author) table.insert(fields, title) table.insert(fields, publisher) table.insert(fields, publishedin) table.insert(fields, journal) table.insert(fields, volume) table.insert(fields, issue) table.insert(fields, publishdate) table.insert(fields, pagenumber) table.insert(fields, doi) table.insert(fields, pmid) table.insert(fields, link) table.insert(fields, license) return linguistic.conj(fields, lang, "comma") end function p.citeitem(items, refsnak, options) if not items and not refsnak then return nil end if type(items) == 'string' then items = {items} end local author = getauthor(items, refsnak ) local appliestopart = getappliestopart(items, refsnak) local editor = getEditor(items, refsnak ) local article = getarticle(items, refsnak ) local title = gettitle(items, refsnak ) local publisher = getpublisher(items, refsnak ) local publishedin = getpublishedin(items, refsnak ) local publishdate = getPublishdate(items, refsnak ) local edition = getedition(items, refsnak ) local issue = getissue(items, refsnak ) local page = getPage(items, refsnak ) local isbn = getISBN(items, refsnak ) local doi = getMost(items, refsnak, "P356" ) local pmid = getMost(items, refsnak, "P698" ) local import = getwhatever(items, refsnak, "P143" ) local link = getLink(items, refsnak ) local hamtdatum = getHamtdatum(items, refsnak ) local volume = getVolume(items, refsnak ) local license = getwhatever(items, refsnak, "P275" ) local therest = gettherest(items, refsnak) local citatet = getquote(items, refsnak) local checket = itemcheck(items) if title and title ~= '' and subtitle and subtitle ~= '' then --title = title .. ' : ' .. subtitle end local field = {} local barap854 = false -- Flagga för att se om "bara" P854 används i källan if import and import ~= '' then table.insert(field, import) end if author and author ~= '' then table.insert(field, author) end if editor and editor ~= '' then table.insert(field, editor) end if article and article ~= '' then table.insert(field, article) end if title and title ~= '' then table.insert(field, title) end if edition and edition ~= '' then table.insert(field, edition) end if volume and volume ~= '' then table.insert(field, volume) end if issue and issue ~= '' then table.insert(field, issue) end if publisher and publisher ~= '' then table.insert(field, publisher) end if publishedin and publishedin ~= '' then table.insert(field, publishedin) end if publishdate and publishdate ~= '' then table.insert(field, publishdate) end if appliestopart and appliestopart ~= '' then table.insert(field, appliestopart) end if page and page ~= '' then table.insert(field, page) end if isbn and isbn ~= '' then table.insert(field, isbn) end if doi and doi ~= '' then table.insert(field, doi) end if pmid and pmid ~= '' then table.insert(field, pmid) end if therest and therest ~= '' then table.insert(field, therest) end if link and link ~= '' then if #field < 1 then barap854 = true end table.insert(field, link) end if hamtdatum and hamtdatum ~= '' then table.insert(field, hamtdatum) end if license and license ~= '' then table.insert(field, license) end if citatet and citatet ~= '' then table.insert(field, citatet) end if checket and checket ~= '' then table.insert(field, checket) end if barap854 then table.insert(field, '[[Kategoriya:Mga artikulo sa huyang nga sa Wikipedia based nga mga pakisayran]]') end return table.concat(field, ', ') end function p.cite(frame) local lang = frame.args.lang if not lang or lang == '' then lang = frame:preprocess('{{int:lang}}') end local page = frame.args.page if page == '' then page = nil end return p.citeitem(frame.args.item, lang, page) end return p
Mubong sugid
Pinaagi sa pagtipig sa mga pagbag-o, miuyon ka sa
Terms of Use
, ug dili mabakwi nga miuyon ka nga ipagawas ang imong kontribusyon ubos sa
org/licenses/by-sa/4.0/ CC BY-SA 4.0 License
ug ang
GFDL
. Miuyon ka nga usa ka hyperlink o Ang URL igo nga pagpaila ubos sa lisensya sa Creative Commons.
I-way bili
Tabang sa pag-usab
(maabli sa laing window)
Preview page with this template
Wikidata entities used in this page
Module:Cite
: Sitelink, Description: en
Ang plantilya nga gigagamit niining panid:
Module:Cite/doc
(
usba
)
Pangita
Pangitaa
Nagausab sa
Module:Cite
Idugang ang mga pinulongan
Pagdugang og topiko