Content deleted Content added
No edit summary |
catch pages that have no connected WIkidata entity |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 1:
local p = {}
p.main = function ( frame )
if
local pRange = ''
-- Run through all prevalence claims - the table prevalenceClaims always exists but may be empty
local prevalenceValue = prevalenceClaim.mainsnak.datavalue and prevalenceClaim.mainsnak.datavalue.value
if prevalenceClaim then▼
if
-- Split multiple claims
-- Maybe line break instead?
if prevalenceValue.lowerBound and prevalenceValue.upperBound then
local lowerBound = prevalenceValue.lowerBound * 100
local upperBound = prevalenceValue.upperBound * 100
if lowerBound ~= upperBound then
pRange = pRange .. '
end
local amount = prevalenceValue.amount * 100
▲ pRange = pRange .. '%'
if prevalenceClaim.qualifiers then▼
-- Qualifiers for prevalence are currently unstandardized.▼
pRange = pRange .. '%'
-- Keep guessing until the right one is found.▼
prevalenceClaim.qualifiers.P1001 or -- applies to jurisdiction▼
prevalenceClaim.qualifiers.P17 -- country▼
if quals then▼
▲ pRange = pRange .. ' ('
for k, qual in pairs(quals) do▼
▲ end
local qualId = qual.datavalue.value[ 'numeric-id' ]▼
-- Certain geographic locales might need a▼
-- manual-ish override for labels. ▼
▲ })[ qualId ] or mw.wikibase.label( 'Q' .. qualId )
})[ qualId ] or mw.wikibase.label( 'Q' .. qualId )
label = '[[' .. link .. '|' .. label .. ']]'
end
pRange = pRange ..
end
end
--[[▼
-- Todo: References▼
▲ end
▲ return pRange
end
end
▲ if prevalenceClaim.references then
end
return
end
|