Diferencia entre revisiones de «Módulo:Wd»

Ir a la navegación Ir a la búsqueda
3145 bytes añadidos ,  10 jul 2023
Per edit request
m (1 revisión importada)
Cobra Kai>Pppery
(Per edit request)
Línea 1: Línea 1:
-- Original module located at [[:en:Module:Wd]] and [[:en:Module:Wd/i18n]].
-- Original module located at [[:en:Module:Wd]] and [[:en:Module:Wd/i18n]].


require("strict")
local p = {}
local p = {}
local arg = ...
local arg = ...
Línea 75: Línea 76:
publisher              = "P123",
publisher              = "P123",
importedFrom            = "P143",
importedFrom            = "P143",
wikimediaImportURL      = "P4656",
statedIn                = "P248",
statedIn                = "P248",
pages                  = "P304",
pages                  = "P304",
Línea 95: Línea 97:
inferredFrom            = "P3452",
inferredFrom            = "P3452",
typeOfReference        = "P3865",
typeOfReference        = "P3865",
column                  = "P3903"
column                  = "P3903",
subjectNamedAs          = "P1810",
wikidataProperty        = "P1687",
publishedIn            = "P1433"
}
}


Línea 149: Línea 154:
}
}


local Config = {}
local function replaceAlias(id)
if aliasesP[id] then
id = aliasesP[id]
end


-- allows for recursive calls
return id
function Config:new()
end
local cfg = {}
setmetatable(cfg, self)
self.__index = self


cfg.separators = {
local function errorText(code, param)
-- single value objects wrapped in arrays so that we can pass by reference
local text = i18n["errors"][code]
["sep"]  = {copyTable(defaultSeparators["sep"])},
if param then text = mw.ustring.gsub(text, "$1", param) end
["sep%s"] = {copyTable(defaultSeparators["sep%s"])},
return text
["sep%q"] = {copyTable(defaultSeparators["sep%q"])},
end
["sep%r"] = {copyTable(defaultSeparators["sep%r"])},
["punc"]  = {copyTable(defaultSeparators["punc"])}
}


cfg.entity = nil
local function throwError(errorMessage, param)
cfg.entityID = nil
error(errorText(errorMessage, param))
cfg.propertyID = nil
end
cfg.propertyValue = nil
cfg.qualifierIDs = {}
cfg.qualifierIDsAndValues = {}


cfg.bestRank = true
local function replaceDecimalMark(num)
cfg.ranks = {true, true, false}  -- preferred = true, normal = true, deprecated = false
return mw.ustring.gsub(num, "[.]", i18n['numeric']['decimal-mark'], 1)
cfg.foundRank = #cfg.ranks
end
cfg.flagBest = false
cfg.flagRank = false


cfg.periods = {true, true, true}  -- future = true, current = true, former = true
local function padZeros(num, numDigits)
cfg.flagPeriod = false
local numZeros
cfg.atDate = {parseDate(os.date('!%Y-%m-%d'))}  -- today as {year, month, day}
local negative = false


cfg.mdyDate = false
if num < 0 then
cfg.singleClaim = false
negative = true
cfg.sourcedOnly = false
num = num * -1
cfg.editable = false
end
cfg.editAtEnd = false


cfg.inSitelinks = false
num = tostring(num)
numZeros = numDigits - num:len()


cfg.langCode = mw.language.getContentLanguage().code
for _ = 1, numZeros do
cfg.langName = mw.language.fetchLanguageName(cfg.langCode, cfg.langCode)
num = "0"..num
cfg.langObj = mw.language.new(cfg.langCode)
end


cfg.siteID = mw.wikibase.getGlobalSiteId()
if negative then
num = "-"..num
end


cfg.states = {}
return num
cfg.states.qualifiersCount = 0
end
cfg.curState = nil


cfg.prefetchedRefs = nil
local function replaceSpecialChar(chr)
 
if chr == '_' then
return cfg
-- replace underscores with spaces
return ' '
else
return chr
end
end
end


local State = {}
local function replaceSpecialChars(str)
local chr
local esc = false
local strOut = ""


function State:new(cfg, type)
for i = 1, #str do
local stt = {}
chr = str:sub(i,i)
setmetatable(stt, self)
self.__index = self


stt.conf = cfg
if not esc then
stt.type = type
if chr == '\\' then
esc = true
else
strOut = strOut .. replaceSpecialChar(chr)
end
else
strOut = strOut .. chr
esc = false
end
end


stt.results = {}
return strOut
end


stt.parsedFormat = {}
local function buildWikilink(target, label)
stt.separator = {}
if not label or target == label then
stt.movSeparator = {}
return "[[" .. target .. "]]"
stt.puncMark = {}
else
return "[[" .. target .. "|" .. label .. "]]"
end
end


stt.linked = false
-- used to make frame.args mutable, to replace #frame.args (which is always 0)
stt.rawValue = false
-- with the actual amount and to simply copy tables
stt.shortName = false
local function copyTable(tIn)
stt.anyLanguage = false
if not tIn then
stt.unitOnly = false
return nil
stt.singleValue = false
end


return stt
local tOut = {}
end


local function replaceAlias(id)
for i, v in pairs(tIn) do
if aliasesP[id] then
tOut[i] = v
id = aliasesP[id]
end
end


return id
return tOut
end
end


local function errorText(code, param)
-- used to merge output arrays together;
local text = i18n["errors"][code]
-- note that it currently mutates the first input array
if param then text = mw.ustring.gsub(text, "$1", param) end
local function mergeArrays(a1, a2)
return text
for i = 1, #a2 do
a1[#a1 + 1] = a2[i]
end
 
return a1
end
end


local function throwError(errorMessage, param)
local function split(str, del)
error(errorText(errorMessage, param))
local out = {}
end
local i, j = str:find(del)
 
if i and j then
out[1] = str:sub(1, i - 1)
out[2] = str:sub(j + 1)
else
out[1] = str
end


local function replaceDecimalMark(num)
return out
return mw.ustring.gsub(num, "[.]", i18n['numeric']['decimal-mark'], 1)
end
end


local function padZeros(num, numDigits)
local function parseWikidataURL(url)
local numZeros
local id
local negative = false
 
if url:match('^http[s]?://') then
id = split(url, "Q")


if num < 0 then
if id[2] then
negative = true
return "Q" .. id[2]
num = num * -1
end
end
end


num = tostring(num)
return nil
numZeros = numDigits - num:len()
end
 
local function parseDate(dateStr, precision)
precision = precision or "d"


for _ = 1, numZeros do
local i, j, index, ptr
num = "0"..num
local parts = {nil, nil, nil}
end


if negative then
if dateStr == nil then
num = "-"..num
return parts[1], parts[2], parts[3]  -- year, month, day
end
end


return num
-- 'T' for snak values, '/' for outputs with '/Julian' attached
end
i, j = dateStr:find("[T/]")


local function replaceSpecialChar(chr)
if i then
if chr == '_' then
dateStr = dateStr:sub(1, i-1)
-- replace underscores with spaces
return ' '
else
return chr
end
end
end


local function replaceSpecialChars(str)
local from = 1
local chr
 
local esc = false
if dateStr:sub(1,1) == "-" then
local strOut = ""
-- this is a negative number, look further ahead
from = 2
end


for i = 1, #str do
index = 1
chr = str:sub(i,i)
ptr = 1


if not esc then
i, j = dateStr:find("-", from)
if chr == '\\' then
 
esc = true
if i then
else
-- year
strOut = strOut .. replaceSpecialChar(chr)
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10) -- explicitly give base 10 to prevent error
end
 
else
if parts[index] == -0 then
strOut = strOut .. chr
parts[index] = tonumber("0")  -- for some reason, 'parts[index] = 0' may actually store '-0', so parse from string instead
esc = false
end
end
end


return strOut
if precision == "y" then
end
-- we're done
return parts[1], parts[2], parts[3]  -- year, month, day
end


local function buildWikilink(target, label)
index = index + 1
if not label or target == label then
ptr = i + 1
return "[[" .. target .. "]]"
else
return "[[" .. target .. "|" .. label .. "]]"
end
end


-- used to make frame.args mutable, to replace #frame.args (which is always 0)
i, j = dateStr:find("-", ptr)
-- with the actual amount and to simply copy tables
 
function copyTable(tIn)
if i then
if not tIn then
-- month
return nil
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10)
 
if precision == "m" then
-- we're done
return parts[1], parts[2], parts[3]  -- year, month, day
end
 
index = index + 1
ptr = i + 1
end
end
end


local tOut = {}
if dateStr:sub(ptr) ~= "" then
 
-- day if we have month, month if we have year, or year
for i, v in pairs(tIn) do
parts[index] = tonumber(dateStr:sub(ptr), 10)
tOut[i] = v
end
end


return tOut
return parts[1], parts[2], parts[3]  -- year, month, day
end
end


-- used to merge output arrays together;
local function datePrecedesDate(aY, aM, aD, bY, bM, bD)
-- note that it currently mutates the first input array
if aY == nil or bY == nil then
local function mergeArrays(a1, a2)
return nil
for i = 1, #a2 do
a1[#a1 + 1] = a2[i]
end
end
aM = aM or 1
aD = aD or 1
bM = bM or 1
bD = bD or 1


return a1
if aY < bY then
end
return true
end


local function split(str, del)
if aY > bY then
local out = {}
return false
local i, j = str:find(del)
end


if i and j then
if aM < bM then
out[1] = str:sub(1, i - 1)
return true
out[2] = str:sub(j + 1)
else
out[1] = str
end
end


return out
if aM > bM then
end
return false
end


local function parseWikidataURL(url)
if aD < bD then
local id
return true
end


if url:match('^http[s]?://') then
return false
id = split(url, "Q")
end


if id[2] then
local function getHookName(param, index)
return "Q" .. id[2]
if hookNames[param] then
end
return hookNames[param][index]
elseif param:len() > 2 then
return hookNames[param:sub(1, 2).."\\d"][index]
else
return nil
end
end
end


return nil
local function alwaysTrue()
return true
end
end


function parseDate(dateStr, precision)
-- The following function parses a format string.
precision = precision or "d"
--
 
-- The example below shows how a parsed string is structured in memory.
local i, j, index, ptr
-- Variables other than 'str' and 'child' are left out for clarity's sake.
local parts = {nil, nil, nil}
--
 
-- Example:
if dateStr == nil then
-- "A %p B [%s[%q1]] C [%r] D"
return parts[1], parts[2], parts[3] -- year, month, day
--
end
-- Structure:
 
-- [
-- 'T' for snak values, '/' for outputs with '/Julian' attached
--   {
i, j = dateStr:find("[T/]")
--    str = "A "
 
--  },
if i then
--  {
dateStr = dateStr:sub(1, i-1)
--    str = "%p"
end
--  },
 
--  {
local from = 1
--    str = " B ",
 
--    child =
if dateStr:sub(1,1) == "-" then
--    [
-- this is a negative number, look further ahead
--      {
from = 2
--        str = "%s",
end
--         child =
 
--        [
index = 1
--          {
ptr = 1
--            str = "%q1"
 
--          }
i, j = dateStr:find("-", from)
--        ]
 
--      }
if i then
--    ]
-- year
--  },
parts[index] = tonumber(mw.ustring.gsub(dateStr:sub(ptr, i-1), "^\+(.+)$", "%1"), 10)  -- remove '+' sign (explicitly give base 10 to prevent error)
--  {
--    str = " C ",
--    child =
--    [
--       {
--        str = "%r"
--      }
--    ]
--  },
--  {
--    str = " D"
--  }
-- ]
--
local function parseFormat(str)
local chr, esc, param, root, cur, prev, new
local params = {}


if parts[index] == -0 then
local function newObject(array)
parts[index] = tonumber("0")  -- for some reason, 'parts[index] = 0' may actually store '-0', so parse from string instead
local obj = {}  -- new object
end
obj.str = ""


if precision == "y" then
array[#array + 1] = obj -- array{object}
-- we're done
obj.parent = array
return parts[1], parts[2], parts[3] -- year, month, day
end


index = index + 1
return obj
ptr = i + 1
end


i, j = dateStr:find("-", ptr)
local function endParam()
 
if param > 0 then
if i then
if cur.str ~= "" then
-- month
cur.str = "%"..cur.str
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10)
cur.param = true
 
params[cur.str] = true
if precision == "m" then
cur.parent.req[cur.str] = true
-- we're done
prev = cur
return parts[1], parts[2], parts[3]  -- year, month, day
cur = newObject(cur.parent)
end
end
 
param = 0
index = index + 1
ptr = i + 1
end
end
end
end


if dateStr:sub(ptr) ~= "" then
root = {}  -- array
-- day if we have month, month if we have year, or year
root.req = {}
parts[index] = tonumber(dateStr:sub(ptr), 10)
cur = newObject(root)
end
prev = nil


return parts[1], parts[2], parts[3]  -- year, month, day
esc = false
end
param = 0


local function datePrecedesDate(aY, aM, aD, bY, bM, bD)
for i = 1, #str do
if aY == nil or bY == nil then
chr = str:sub(i,i)
return nil
end
aM = aM or 1
aD = aD or 1
bM = bM or 1
bD = bD or 1


if aY < bY then
if not esc then
return true
if chr == '\\' then
end
endParam()
 
esc = true
if aY > bY then
elseif chr == '%' then
return false
endParam()
end
if cur.str ~= "" then
 
cur = newObject(cur.parent)
if aM < bM then
end
return true
param = 2
end
elseif chr == '[' then
 
endParam()
if aM > bM then
if prev and cur.str == "" then
return false
table.remove(cur.parent)
end
cur = prev
 
end
if aD < bD then
cur.child = {}  -- new array
return true
cur.child.req = {}
end
cur.child.parent = cur
cur = newObject(cur.child)
elseif chr == ']' then
endParam()
if cur.parent.parent then
new = newObject(cur.parent.parent.parent)
if cur.str == "" then
table.remove(cur.parent)
end
cur = new
end
else
if param > 1 then
param = param - 1
elseif param == 1 then
if not chr:match('%d') then
endParam()
end
end


return false
cur.str = cur.str .. replaceSpecialChar(chr)
end
end
else
cur.str = cur.str .. chr
esc = false
end


local function getHookName(param, index)
prev = nil
if hookNames[param] then
end
return hookNames[param][index]
 
elseif param:len() > 2 then
endParam()
return hookNames[param:sub(1, 2).."\\d"][index]
 
else
-- make sure that at least one required parameter has been defined
return nil
if not next(root.req) then
throwError("missing-required-parameter")
end
 
-- make sure that the separator parameter "%s" is not amongst the required parameters
if root.req[parameters.separator] then
throwError("extra-required-parameter", parameters.separator)
end
end
return root, params
end
end


local function alwaysTrue()
local function sortOnRank(claims)
return true
local rankPos
end
local ranks = {{}, {}, {}, {}}  -- preferred, normal, deprecated, (default)
local sorted = {}


-- The following function parses a format string.
for _, v in ipairs(claims) do
--
rankPos = rankTable[v.rank] or 4
-- The example below shows how a parsed string is structured in memory.
ranks[rankPos][#ranks[rankPos] + 1] = v
-- Variables other than 'str' and 'child' are left out for clarity's sake.
end
--
 
-- Example:
sorted = ranks[1]
-- "A %p B [%s[%q1]] C [%r] D"
sorted = mergeArrays(sorted, ranks[2])
--
sorted = mergeArrays(sorted, ranks[3])
-- Structure:
 
-- [
return sorted
--  {
end
--     str = "A "
 
--  },
local Config = {}
--  {
 
--     str = "%p"
-- allows for recursive calls
--  },
function Config:new()
--  {
local cfg = {}
--    str = " B ",
setmetatable(cfg, self)
--    child =
self.__index = self
--    [
 
--      {
cfg.separators = {
--        str = "%s",
-- single value objects wrapped in arrays so that we can pass by reference
--        child =
["sep"]  = {copyTable(defaultSeparators["sep"])},
--        [
["sep%s"] = {copyTable(defaultSeparators["sep%s"])},
--          {
["sep%q"] = {copyTable(defaultSeparators["sep%q"])},
--            str = "%q1"
["sep%r"] = {copyTable(defaultSeparators["sep%r"])},
--          }
["punc"]  = {copyTable(defaultSeparators["punc"])}
--        ]
}
--      }
 
--    ]
cfg.entity = nil
--  },
cfg.entityID = nil
--  {
cfg.propertyID = nil
--    str = " C ",
cfg.propertyValue = nil
--    child =
cfg.qualifierIDs = {}
--    [
cfg.qualifierIDsAndValues = {}
--      {
--        str = "%r"
--      }
--    ]
--  },
--  {
--    str = " D"
--  }
-- ]
--
local function parseFormat(str)
local chr, esc, param, root, cur, prev, new
local params = {}


local function newObject(array)
cfg.bestRank = true
local obj = {}  -- new object
cfg.ranks = {true, true, false}  -- preferred = true, normal = true, deprecated = false
obj.str = ""
cfg.foundRank = #cfg.ranks
cfg.flagBest = false
cfg.flagRank = false


array[#array + 1] = obj -- array{object}
cfg.periods = {true, true, true} -- future = true, current = true, former = true
obj.parent = array
cfg.flagPeriod = false
cfg.atDate = {parseDate(os.date('!%Y-%m-%d'))}  -- today as {year, month, day}


return obj
cfg.mdyDate = false
end
cfg.singleClaim = false
cfg.sourcedOnly = false
cfg.editable = false
cfg.editAtEnd = false


local function endParam()
cfg.inSitelinks = false
if param > 0 then
if cur.str ~= "" then
cur.str = "%"..cur.str
cur.param = true
params[cur.str] = true
cur.parent.req[cur.str] = true
prev = cur
cur = newObject(cur.parent)
end
param = 0
end
end


root = {} -- array
cfg.langCode = mw.language.getContentLanguage().code
root.req = {}
cfg.langName = mw.language.fetchLanguageName(cfg.langCode, cfg.langCode)
cur = newObject(root)
cfg.langObj = mw.language.new(cfg.langCode)
prev = nil
 
cfg.siteID = mw.wikibase.getGlobalSiteId()
 
cfg.states = {}
cfg.states.qualifiersCount = 0
cfg.curState = nil
 
cfg.prefetchedRefs = nil


esc = false
return cfg
param = 0
end


for i = 1, #str do
local State = {}
chr = str:sub(i,i)


if not esc then
function State:new(cfg, type)
if chr == '\\' then
local stt = {}
endParam()
setmetatable(stt, self)
esc = true
self.__index = self
elseif chr == '%' then
 
endParam()
stt.conf = cfg
if cur.str ~= "" then
stt.type = type
cur = newObject(cur.parent)
 
end
stt.results = {}
param = 2
 
elseif chr == '[' then
stt.parsedFormat = {}
endParam()
stt.separator = {}
if prev and cur.str == "" then
stt.movSeparator = {}
table.remove(cur.parent)
stt.puncMark = {}
cur = prev
 
end
stt.linked = false
cur.child = {} -- new array
stt.rawValue = false
cur.child.req = {}
stt.shortName = false
cur.child.parent = cur
stt.anyLanguage = false
cur = newObject(cur.child)
stt.unitOnly = false
elseif chr == ']' then
stt.singleValue = false
endParam()
if cur.parent.parent then
new = newObject(cur.parent.parent.parent)
if cur.str == "" then
table.remove(cur.parent)
end
cur = new
end
else
if param > 1 then
param = param - 1
elseif param == 1 then
if not chr:match('%d') then
endParam()
end
end


cur.str = cur.str .. replaceSpecialChar(chr)
return stt
end
end
else
cur.str = cur.str .. chr
esc = false
end


prev = nil
-- if id == nil then item connected to current page is used
end
 
endParam()
 
-- make sure that at least one required parameter has been defined
if not next(root.req) then
throwError("missing-required-parameter")
end
 
-- make sure that the separator parameter "%s" is not amongst the required parameters
if root.req[parameters.separator] then
throwError("extra-required-parameter", parameters.separator)
end
 
return root, params
end
 
local function sortOnRank(claims)
local rankPos
local ranks = {{}, {}, {}, {}}  -- preferred, normal, deprecated, (default)
local sorted = {}
 
for _, v in ipairs(claims) do
rankPos = rankTable[v.rank] or 4
ranks[rankPos][#ranks[rankPos] + 1] = v
end
 
sorted = ranks[1]
sorted = mergeArrays(sorted, ranks[2])
sorted = mergeArrays(sorted, ranks[3])
 
return sorted
end
 
-- if id == nil then item connected to current page is used
function Config:getLabel(id, raw, link, short)
function Config:getLabel(id, raw, link, short)
local label = nil
local label = nil
Línea 871: Línea 876:
if not unitOnly then
if not unitOnly then
-- get value and strip + signs from front
-- get value and strip + signs from front
value = mw.ustring.gsub(datavalue['amount'], "^\+(.+)$", "%1")
value = mw.ustring.gsub(datavalue['amount'], "^%+(.+)$", "%1")


if raw then
if raw then
Línea 1283: Línea 1288:
lonLink = table.concat({lonDegrees, lonMinutes, lonSeconds}, "_")
lonLink = table.concat({lonDegrees, lonMinutes, lonSeconds}, "_")


value = "[https://tools.wmflabs.org/geohack/geohack.php?language="..self.langCode.."&params="..latLink.."_"..latDirectionEN.."_"..lonLink.."_"..lonDirectionEN.."_globe:"..globe.." "..value.."]"
value = "[https://geohack.toolforge.org/geohack.php?language="..self.langCode.."&params="..latLink.."_"..latDirectionEN.."_"..lonLink.."_"..lonDirectionEN.."_globe:"..globe.." "..value.."]"
end
end


Línea 1808: Línea 1813:
     local numAuthorParameters = 0
     local numAuthorParameters = 0
     local numAuthorNameStringParameters = 0
     local numAuthorNameStringParameters = 0
    local tempLink
    local additionalRefProperties = {}  -- will hold properties of the reference which are not in statement.snaks, namely backup title from "subject named as" and URL from an external ID
    local wikidataPropertiesOfSource  -- will contain "Wikidata property" properties of the item in stated in, if any


local version = 2 -- increment this each time the below logic is changed to avoid conflict errors
local version = 4 -- increment this each time the below logic is changed to avoid conflict errors


if statement.snaks then
if statement.snaks then
Línea 1815: Línea 1823:
if statement.snaks[aliasesP.importedFrom] then
if statement.snaks[aliasesP.importedFrom] then
statement.snaks[aliasesP.importedFrom] = nil
statement.snaks[aliasesP.importedFrom] = nil
end
-- don't include "Wikimedia import URL"
if statement.snaks[aliasesP.wikimediaImportURL] then
statement.snaks[aliasesP.wikimediaImportURL] = nil
-- don't include "retrieved" if no "referenceURL" is present,
-- as "retrieved" probably belongs to "Wikimedia import URL"
if statement.snaks[aliasesP.retrieved] and not statement.snaks[aliasesP.referenceURL] then
statement.snaks[aliasesP.retrieved] = nil
end
end
end


Línea 1836: Línea 1854:
statement.snaks[aliasesP.language] = nil
statement.snaks[aliasesP.language] = nil
end
end
       
        if statement.snaks[aliasesP.statedIn] and not statement.snaks[aliasesP.referenceURL] then
        -- "stated in" was given but "reference URL" was not.
        -- get "Wikidata property" properties from the item in "stated in"
        -- if any of the returned properties of the external-id datatype is in statement.snaks, generate a URL from it and use the URL in the reference
       
        -- find the "Wikidata property" properties in the item from "stated in"
        wikidataPropertiesOfSource = mw.text.split(p._properties{p.flags.raw, aliasesP.wikidataProperty, [p.args.eid] = self.conf:getValue(statement.snaks[aliasesP.statedIn][1], true, false)}, ", ", true)
        for i, wikidataPropertyOfSource in pairs(wikidataPropertiesOfSource) do
        if statement.snaks[wikidataPropertyOfSource] and statement.snaks[wikidataPropertyOfSource][1].datatype == "external-id" then
        tempLink = self.conf:getValue(statement.snaks[wikidataPropertyOfSource][1], false, true)  -- not raw, linked
        if mw.ustring.match(tempLink, "^%[%Z- %Z+%]$") then  -- getValue returned a URL.
            additionalRefProperties[aliasesP.referenceURL] = mw.ustring.gsub(tempLink, "^%[(%Z-) %Z+%]$", "%1")  -- the URL is in wiki markup, so strip the square brackets and the display text
            statement.snaks[wikidataPropertyOfSource] = nil
            break
        end
        end
        end
        end
       
        -- don't include "subject named as", but use it as the title when "title" is not present but a URL is
        if statement.snaks[aliasesP.subjectNamedAs] then
        if not statement.snaks[aliasesP.title] and (statement.snaks[aliasesP.referenceURL] or additionalRefProperties[aliasesP.referenceURL]) then
        additionalRefProperties[aliasesP.title] = statement.snaks[aliasesP.subjectNamedAs][1].datavalue.value
        end
        statement.snaks[aliasesP.subjectNamedAs] = nil
        end


-- retrieve all the parameters
-- retrieve all the parameters
Línea 1910: Línea 1955:
end
end
end
end
end
end
end
-- use additional properties
for i in pairs(additionalRefProperties) do
for j in pairs(citeParams) do
if not citeMismatch[j] and i18n["cite"][j][i] then
citeParams[j][i18n["cite"][j][i]] = additionalRefProperties[i]
else
citeMismatch[j] = true
end
end
end
end
Usuario anónimo
Las cookies nos ayudan a ofrecer nuestros servicios. Al utilizar nuestros servicios, aceptas nuestro uso de cookies.

Menú de navegación