Wikipedia
gpewiki
https://gpe.wikipedia.org/wiki/Main_Page
MediaWiki 1.47.0-wmf.10
first-letter
Media
Special
Talk
User
User talk
Wikipedia
Wikipedia talk
File
File talk
MediaWiki
MediaWiki talk
Template
Template talk
Help
Help talk
Category
Category talk
TimedText
TimedText talk
Module
Module talk
Event
Event talk
Module:Wd
828
9541
106497
41419
2026-07-10T16:54:36Z
Uzume
3415
Update from [[d:Special:GoToLinkedPage/enwiki/Q24733825|master]] using [[mw:Synchronizer| #Synchronizer]]
106497
Scribunto
text/plain
-- Original module located at [[:en:Module:Wd]] and [[:en:Module:Wd/i18n]].
require("strict")
local p = {}
local module_arg = ...
local i18n
local i18nPath
local function loadI18n(aliasesP, frame)
local title
if frame then
-- current module invoked by page/template, get its title from frame
title = frame:getTitle()
else
-- current module included by other module, get its title from ...
title = module_arg
end
if not i18n then
i18nPath = title .. "/i18n"
i18n = require(i18nPath).init(aliasesP)
end
end
p.claimCommands = {
property = "property",
properties = "properties",
qualifier = "qualifier",
qualifiers = "qualifiers",
reference = "reference",
references = "references"
}
p.generalCommands = {
label = "label",
title = "title",
description = "description",
alias = "alias",
aliases = "aliases",
badge = "badge",
badges = "badges"
}
p.flags = {
linked = "linked",
short = "short",
raw = "raw",
multilanguage = "multilanguage",
unit = "unit",
-------------
preferred = "preferred",
normal = "normal",
deprecated = "deprecated",
best = "best",
future = "future",
current = "current",
former = "former",
edit = "edit",
editAtEnd = "edit@end",
mdy = "mdy",
single = "single",
sourced = "sourced"
}
p.args = {
eid = "eid",
page = "page",
date = "date",
globalSiteId = "globalSiteId"
}
local aliasesP = {
coord = "P625",
-----------------------
image = "P18",
author = "P50",
authorNameString = "P2093",
publisher = "P123",
importedFrom = "P143",
wikimediaImportURL = "P4656",
statedIn = "P248",
pages = "P304",
language = "P407",
hasPart = "P527",
publicationDate = "P577",
startTime = "P580",
endTime = "P582",
chapter = "P792",
retrieved = "P813",
referenceURL = "P854",
sectionVerseOrParagraph = "P958",
archiveURL = "P1065",
title = "P1476",
formatterURL = "P1630",
quote = "P1683",
shortName = "P1813",
definingFormula = "P2534",
archiveDate = "P2960",
inferredFrom = "P3452",
typeOfReference = "P3865",
column = "P3903",
subjectNamedAs = "P1810",
wikidataProperty = "P1687",
publishedIn = "P1433",
lastUpdate = "P5017"
}
local aliasesQ = {
percentage = "Q11229",
prolepticJulianCalendar = "Q1985786",
citeWeb = "Q5637226",
citeQ = "Q22321052"
}
local parameters = {
property = "%p",
qualifier = "%q",
reference = "%r",
alias = "%a",
badge = "%b",
separator = "%s",
general = "%x"
}
local formats = {
property = "%p[%s][%r]",
qualifier = "%q[%s][%r]",
reference = "%r",
propertyWithQualifier = "%p[ <span style=\"font-size:85\\%\">(%q)</span>][%s][%r]",
alias = "%a[%s]",
badge = "%b[%s]"
}
local hookNames = { -- {level_1, level_2}
[parameters.property] = {"getProperty"},
[parameters.reference] = {"getReferences", "getReference"},
[parameters.qualifier] = {"getAllQualifiers"},
[parameters.qualifier.."\\d"] = {"getQualifiers", "getQualifier"},
[parameters.alias] = {"getAlias"},
[parameters.badge] = {"getBadge"}
}
-- default value objects, should NOT be mutated but instead copied
local defaultSeparators = {
["sep"] = {" "},
["sep%s"] = {","},
["sep%q"] = {"; "},
["sep%q\\d"] = {", "},
["sep%r"] = nil, -- none
["punc"] = nil -- none
}
local rankTable = {
["preferred"] = 1,
["normal"] = 2,
["deprecated"] = 3
}
local function replaceAlias(id)
if aliasesP[id] then
id = aliasesP[id]
end
return id
end
local function errorText(code, ...)
local text = i18n["errors"][code]
if arg then text = mw.ustring.format(text, unpack(arg)) end
return text
end
local function throwError(errorMessage, ...)
error(errorText(errorMessage, unpack(arg)))
end
local function replaceDecimalMark(num)
return mw.ustring.gsub(num, "[.]", i18n['numeric']['decimal-mark'], 1)
end
local function padZeros(num, numDigits)
local numZeros
local negative = false
if num < 0 then
negative = true
num = num * -1
end
num = tostring(num)
numZeros = numDigits - num:len()
for _ = 1, numZeros do
num = "0"..num
end
if negative then
num = "-"..num
end
return num
end
local function replaceSpecialChar(chr)
if chr == '_' then
-- replace underscores with spaces
return ' '
else
return chr
end
end
local function replaceSpecialChars(str)
local chr
local esc = false
local strOut = ""
for i = 1, #str do
chr = str:sub(i,i)
if not esc then
if chr == '\\' then
esc = true
else
strOut = strOut .. replaceSpecialChar(chr)
end
else
strOut = strOut .. chr
esc = false
end
end
return strOut
end
local function buildWikilink(target, label)
if not label or target == label then
return "[[" .. target .. "]]"
else
return "[[" .. target .. "|" .. label .. "]]"
end
end
-- used to make frame.args mutable, to replace #frame.args (which is always 0)
-- with the actual amount and to simply copy tables
local function copyTable(tIn)
if not tIn then
return nil
end
local tOut = {}
for i, v in pairs(tIn) do
tOut[i] = v
end
return tOut
end
-- used to merge output arrays together;
-- note that it currently mutates the first input array
local function mergeArrays(a1, a2)
for i = 1, #a2 do
a1[#a1 + 1] = a2[i]
end
return a1
end
local function split(str, del)
local out = {}
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
return out
end
local function parseWikidataURL(url)
local id
if url:match('^http[s]?://') then
id = split(url, "Q")
if id[2] then
return "Q" .. id[2]
end
end
return nil
end
local function parseDate(dateStr, precision)
precision = precision or "d"
local i, j, index, ptr
local parts = {nil, nil, nil}
if dateStr == nil then
return parts[1], parts[2], parts[3] -- year, month, day
end
-- 'T' for snak values, '/' for outputs with '/Julian' attached
i, j = dateStr:find("[T/]")
if i then
dateStr = dateStr:sub(1, i-1)
end
local from = 1
if dateStr:sub(1,1) == "-" then
-- this is a negative number, look further ahead
from = 2
end
index = 1
ptr = 1
i, j = dateStr:find("-", from)
if i then
-- year
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10) -- explicitly give base 10 to prevent error
if parts[index] == -0 then
parts[index] = tonumber("0") -- for some reason, 'parts[index] = 0' may actually store '-0', so parse from string instead
end
if precision == "y" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
i, j = dateStr:find("-", ptr)
if i then
-- month
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
if dateStr:sub(ptr) ~= "" then
-- day if we have month, month if we have year, or year
parts[index] = tonumber(dateStr:sub(ptr), 10)
end
return parts[1], parts[2], parts[3] -- year, month, day
end
local function datePrecedesDate(aY, aM, aD, bY, bM, bD)
if aY == nil or bY == nil then
return nil
end
aM = aM or 1
aD = aD or 1
bM = bM or 1
bD = bD or 1
if aY < bY then
return true
end
if aY > bY then
return false
end
if aM < bM then
return true
end
if aM > bM then
return false
end
if aD < bD then
return true
end
return false
end
local function getHookName(param, index)
if hookNames[param] then
return hookNames[param][index]
elseif param:len() > 2 then
return hookNames[param:sub(1, 2).."\\d"][index]
else
return nil
end
end
local function alwaysTrue()
return true
end
-- The following function parses a format string.
--
-- The example below shows how a parsed string is structured in memory.
-- Variables other than 'str' and 'child' are left out for clarity's sake.
--
-- Example:
-- "A %p B [%s[%q1]] C [%r] D"
--
-- Structure:
-- [
-- {
-- str = "A "
-- },
-- {
-- str = "%p"
-- },
-- {
-- str = " B ",
-- child =
-- [
-- {
-- str = "%s",
-- child =
-- [
-- {
-- str = "%q1"
-- }
-- ]
-- }
-- ]
-- },
-- {
-- str = " C ",
-- child =
-- [
-- {
-- str = "%r"
-- }
-- ]
-- },
-- {
-- str = " D"
-- }
-- ]
--
local function parseFormat(str)
local chr, esc, param, root, cur, prev, new
local params = {}
local function newObject(array)
local obj = {} -- new object
obj.str = ""
array[#array + 1] = obj -- array{object}
obj.parent = array
return obj
end
local function endParam()
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
root.req = {}
cur = newObject(root)
prev = nil
esc = false
param = 0
for i = 1, #str do
chr = str:sub(i,i)
if not esc then
if chr == '\\' then
endParam()
esc = true
elseif chr == '%' then
endParam()
if cur.str ~= "" then
cur = newObject(cur.parent)
end
param = 2
elseif chr == '[' then
endParam()
if prev and cur.str == "" then
table.remove(cur.parent)
cur = prev
end
cur.child = {} -- new array
cur.child.req = {}
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
cur.str = cur.str .. replaceSpecialChar(chr)
end
else
cur.str = cur.str .. chr
esc = false
end
prev = nil
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
local function isValueInTable(searchedItem, inputTable)
for _, item in pairs(inputTable) do
if item == searchedItem then
return true
end
end
return false
end
local Config = {}
-- allows for recursive calls
function Config:new()
local cfg = {}
setmetatable(cfg, self)
self.__index = self
cfg.separators = {
-- single value objects wrapped in arrays so that we can pass by reference
["sep"] = {copyTable(defaultSeparators["sep"])},
["sep%s"] = {copyTable(defaultSeparators["sep%s"])},
["sep%q"] = {copyTable(defaultSeparators["sep%q"])},
["sep%r"] = {copyTable(defaultSeparators["sep%r"])},
["punc"] = {copyTable(defaultSeparators["punc"])}
}
cfg.entity = nil
cfg.entityID = nil
cfg.propertyID = nil
cfg.propertyValue = nil
cfg.qualifierIDs = {}
cfg.qualifierIDsAndValues = {}
cfg.bestRank = true
cfg.ranks = {true, true, false} -- preferred = true, normal = true, deprecated = false
cfg.foundRank = #cfg.ranks
cfg.flagBest = false
cfg.flagRank = false
cfg.periods = {true, true, true} -- future = true, current = true, former = true
cfg.flagPeriod = false
cfg.atDate = {parseDate(os.date('!%Y-%m-%d'))} -- today as {year, month, day}
cfg.mdyDate = false
cfg.singleClaim = false
cfg.sourcedOnly = false
cfg.editable = false
cfg.editAtEnd = false
cfg.inSitelinks = false
cfg.langCode = mw.language.getContentLanguage().code
cfg.langName = mw.language.fetchLanguageName(cfg.langCode, cfg.langCode)
cfg.langObj = mw.language.new(cfg.langCode)
cfg.siteID = mw.wikibase.getGlobalSiteId()
cfg.states = {}
cfg.states.qualifiersCount = 0
cfg.curState = nil
cfg.prefetchedRefs = nil
return cfg
end
local State = {}
function State:new(cfg, type)
local stt = {}
setmetatable(stt, self)
self.__index = self
stt.conf = cfg
stt.type = type
stt.results = {}
stt.parsedFormat = {}
stt.separator = {}
stt.movSeparator = {}
stt.puncMark = {}
stt.linked = false
stt.rawValue = false
stt.shortName = false
stt.anyLanguage = false
stt.unitOnly = false
stt.singleValue = false
return stt
end
-- if id == nil then item connected to current page is used
function Config:getLabel(id, raw, link, short)
local label = nil
local prefix, title= "", nil
if not id then
id = mw.wikibase.getEntityIdForCurrentPage()
if not id then
return ""
end
end
id = id:upper() -- just to be sure
if raw then
-- check if given id actually exists
if mw.wikibase.isValidEntityId(id) and mw.wikibase.entityExists(id) then
label = id
end
prefix, title = "d:Special:EntityPage/", label -- may be nil
else
-- try short name first if requested
if short then
label = p._property{aliasesP.shortName, [p.args.eid] = id} -- get short name
if label == "" then
label = nil
end
end
-- get label
if not label then
label = mw.wikibase.getLabel(id)
end
end
if not label then
label = ""
elseif link then
-- build a link if requested
if not title then
if id:sub(1,1) == "Q" then
title = mw.wikibase.getSitelink(id)
elseif id:sub(1,1) == "P" then
-- properties have no sitelink, link to Wikidata instead
prefix, title = "d:Special:EntityPage/", id
end
end
label = mw.text.nowiki(label) -- escape raw label text so it cannot be wikitext markup
if title then
label = buildWikilink(prefix .. title, label)
end
end
return label
end
function Config:getEditIcon()
local value = ""
local prefix = ""
local front = " "
local back = ""
if self.entityID:sub(1,1) == "P" then
prefix = "Property:"
end
if self.editAtEnd then
front = '<span style="float:'
if self.langObj:isRTL() then
front = front .. 'left'
else
front = front .. 'right'
end
front = front .. '">'
back = '</span>'
end
value = "[[File:OOjs UI icon edit-ltr-progressive.svg|frameless|text-top|10px|alt=" .. i18n['info']['edit-on-wikidata'] .. "|link=https://www.wikidata.org/wiki/" .. prefix .. self.entityID .. "?uselang=" .. self.langCode
if self.propertyID then
value = value .. "#" .. self.propertyID
elseif self.inSitelinks then
value = value .. "#sitelinks-wikipedia"
end
value = value .. "|" .. i18n['info']['edit-on-wikidata'] .. "]]"
return front .. value .. back
end
-- used to create the final output string when it's all done, so that for references the
-- function extensionTag("ref", ...) is only called when they really ended up in the final output
function Config:concatValues(valuesArray)
local outString = ""
local j, skip
for i = 1, #valuesArray do
-- check if this is a reference
if valuesArray[i].refHash then
j = i - 1
skip = false
-- skip this reference if it is part of a continuous row of references that already contains the exact same reference
while valuesArray[j] and valuesArray[j].refHash do
if valuesArray[i].refHash == valuesArray[j].refHash then
skip = true
break
end
j = j - 1
end
if not skip then
-- add <ref> tag with the reference's hash as its name (to deduplicate references)
outString = outString .. mw.getCurrentFrame():extensionTag("ref", valuesArray[i][1], {name = valuesArray[i].refHash})
end
else
outString = outString .. valuesArray[i][1]
end
end
return outString
end
function Config:convertUnit(unit, raw, link, short, unitOnly)
local space = " "
local label = ""
local itemID
if unit == "" or unit == "1" then
return nil
end
if unitOnly then
space = ""
end
itemID = parseWikidataURL(unit)
if itemID then
if itemID == aliasesQ.percentage then
return "%"
else
label = self:getLabel(itemID, raw, link, short)
if label ~= "" then
return space .. label
end
end
end
return ""
end
function State:getValue(snak)
return self.conf:getValue(snak, self.rawValue, self.linked, self.shortName, self.anyLanguage, self.unitOnly, false, self.type:sub(1,2))
end
function Config:getValue(snak, raw, link, short, anyLang, unitOnly, noSpecial, type)
if snak.snaktype == 'value' then
local datatype = snak.datavalue.type
local subtype = snak.datatype
local datavalue = snak.datavalue.value
if datatype == 'string' then
if subtype == 'url' and link then
-- create link explicitly
if raw then
-- will render as a linked number like [1]
return "[" .. datavalue .. "]"
else
return "[" .. datavalue .. " " .. datavalue .. "]"
end
elseif subtype == 'commonsMedia' then
if link then
return buildWikilink("c:File:" .. datavalue, datavalue)
elseif not raw then
return "[[File:" .. datavalue .. "]]"
else
return datavalue
end
elseif subtype == 'geo-shape' and link then
return buildWikilink("c:" .. datavalue, datavalue)
elseif subtype == 'math' and not raw then
local attribute = nil
if (type == parameters.property or (type == parameters.qualifier and self.propertyID == aliasesP.hasPart)) and snak.property == aliasesP.definingFormula then
attribute = {qid = self.entityID}
end
return mw.getCurrentFrame():extensionTag("math", datavalue, attribute)
elseif subtype == 'external-id' and link then
local url = p._property{aliasesP.formatterURL, [p.args.eid] = snak.property} -- get formatter URL
if url ~= "" then
url = mw.ustring.gsub(url, "$1", datavalue)
return "[" .. url .. " " .. datavalue .. "]"
else
return datavalue
end
else
return datavalue
end
elseif datatype == 'monolingualtext' then
if anyLang or datavalue['language'] == self.langCode then
return datavalue['text']
else
return nil
end
elseif datatype == 'quantity' then
local value = ""
local unit
if not unitOnly then
-- get value and strip + signs from front
value = mw.ustring.gsub(datavalue['amount'], "^%+(.+)$", "%1")
if raw then
return value
end
-- replace decimal mark based on locale
value = replaceDecimalMark(value)
-- add delimiters for readability
value = i18n.addDelimiters(value)
end
unit = self:convertUnit(datavalue['unit'], raw, link, short, unitOnly)
if unit then
value = value .. unit
end
return value
elseif datatype == 'time' then
local y, m, d, p, yDiv, yRound, yFull, value, calendarID, dateStr
local yFactor = 1
local sign = 1
local prefix = ""
local suffix = ""
local mayAddCalendar = false
local calendar = ""
local precision = datavalue['precision']
if precision == 11 then
p = "d"
elseif precision == 10 then
p = "m"
else
p = "y"
yFactor = 10^(9-precision)
end
y, m, d = parseDate(datavalue['time'], p)
if y < 0 then
sign = -1
y = y * sign
end
-- if precision is tens/hundreds/thousands/millions/billions of years
if precision <= 8 then
yDiv = y / yFactor
-- if precision is tens/hundreds/thousands of years
if precision >= 6 then
mayAddCalendar = true
if precision <= 7 then
-- round centuries/millenniums up (e.g. 20th century or 3rd millennium)
yRound = math.ceil(yDiv)
if not raw then
if precision == 6 then
suffix = i18n['datetime']['suffixes']['millennium']
else
suffix = i18n['datetime']['suffixes']['century']
end
suffix = i18n.getOrdinalSuffix(yRound) .. suffix
else
-- if not verbose, take the first year of the century/millennium
-- (e.g. 1901 for 20th century or 2001 for 3rd millennium)
yRound = (yRound - 1) * yFactor + 1
end
else
-- precision == 8
-- round decades down (e.g. 2010s)
yRound = math.floor(yDiv) * yFactor
if not raw then
prefix = i18n['datetime']['prefixes']['decade-period']
suffix = i18n['datetime']['suffixes']['decade-period']
end
end
if raw and sign < 0 then
-- if BCE then compensate for "counting backwards"
-- (e.g. -2019 for 2010s BCE, -2000 for 20th century BCE or -3000 for 3rd millennium BCE)
yRound = yRound + yFactor - 1
end
else
local yReFactor, yReDiv, yReRound
-- round to nearest for tens of thousands of years or more
yRound = math.floor(yDiv + 0.5)
if yRound == 0 then
if precision <= 2 and y ~= 0 then
yReFactor = 1e6
yReDiv = y / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to millions of years only if we have a whole number of them
precision = 3
yFactor = yReFactor
yRound = yReRound
end
end
if yRound == 0 then
-- otherwise, take the unrounded (original) number of years
precision = 5
yFactor = 1
yRound = y
mayAddCalendar = true
end
end
if precision >= 1 and y ~= 0 then
yFull = yRound * yFactor
yReFactor = 1e9
yReDiv = yFull / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to billions of years if we're in that range
precision = 0
yFactor = yReFactor
yRound = yReRound
else
yReFactor = 1e6
yReDiv = yFull / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to millions of years if we're in that range
precision = 3
yFactor = yReFactor
yRound = yReRound
end
end
end
if not raw then
if precision == 3 then
suffix = i18n['datetime']['suffixes']['million-years']
elseif precision == 0 then
suffix = i18n['datetime']['suffixes']['billion-years']
else
yRound = yRound * yFactor
if yRound == 1 then
suffix = i18n['datetime']['suffixes']['year']
else
suffix = i18n['datetime']['suffixes']['years']
end
end
else
yRound = yRound * yFactor
end
end
else
yRound = y
mayAddCalendar = true
end
if mayAddCalendar then
calendarID = parseWikidataURL(datavalue['calendarmodel'])
if calendarID and calendarID == aliasesQ.prolepticJulianCalendar then
if not raw then
if link then
calendar = " ("..buildWikilink(i18n['datetime']['julian-calendar'], i18n['datetime']['julian'])..")"
else
calendar = " ("..i18n['datetime']['julian']..")"
end
else
calendar = "/"..i18n['datetime']['julian']
end
end
end
if not raw then
local ce = nil
if sign < 0 then
ce = i18n['datetime']['BCE']
elseif precision <= 5 then
ce = i18n['datetime']['CE']
end
if ce then
if link then
ce = buildWikilink(i18n['datetime']['common-era'], ce)
end
suffix = suffix .. " " .. ce
end
value = tostring(yRound)
if m then
dateStr = self.langObj:formatDate("F", "1-"..m.."-1")
if d then
if self.mdyDate then
dateStr = dateStr .. " " .. d .. ","
else
dateStr = d .. " " .. dateStr
end
end
value = dateStr .. " " .. value
end
value = prefix .. value .. suffix .. calendar
else
value = padZeros(yRound * sign, 4)
if m then
value = value .. "-" .. padZeros(m, 2)
if d then
value = value .. "-" .. padZeros(d, 2)
end
end
value = value .. calendar
end
return value
elseif datatype == 'globecoordinate' then
-- logic from https://github.com/DataValues/Geo (v4.0.1)
local precision, unitsPerDegree, numDigits, strFormat, value, globe
local latitude, latConv, latValue, latLink
local longitude, lonConv, lonValue, lonLink
local latDirection, latDirectionN, latDirectionS, latDirectionEN
local lonDirection, lonDirectionE, lonDirectionW, lonDirectionEN
local degSymbol, minSymbol, secSymbol, separator
local latDegrees = nil
local latMinutes = nil
local latSeconds = nil
local lonDegrees = nil
local lonMinutes = nil
local lonSeconds = nil
local latDegSym = ""
local latMinSym = ""
local latSecSym = ""
local lonDegSym = ""
local lonMinSym = ""
local lonSecSym = ""
local latDirectionEN_N = "N"
local latDirectionEN_S = "S"
local lonDirectionEN_E = "E"
local lonDirectionEN_W = "W"
if not raw then
latDirectionN = i18n['coord']['latitude-north']
latDirectionS = i18n['coord']['latitude-south']
lonDirectionE = i18n['coord']['longitude-east']
lonDirectionW = i18n['coord']['longitude-west']
degSymbol = i18n['coord']['degrees']
minSymbol = i18n['coord']['minutes']
secSymbol = i18n['coord']['seconds']
separator = i18n['coord']['separator']
else
latDirectionN = latDirectionEN_N
latDirectionS = latDirectionEN_S
lonDirectionE = lonDirectionEN_E
lonDirectionW = lonDirectionEN_W
degSymbol = "/"
minSymbol = "/"
secSymbol = "/"
separator = "/"
end
latitude = datavalue['latitude']
longitude = datavalue['longitude']
if latitude < 0 then
latDirection = latDirectionS
latDirectionEN = latDirectionEN_S
latitude = math.abs(latitude)
else
latDirection = latDirectionN
latDirectionEN = latDirectionEN_N
end
if longitude < 0 then
lonDirection = lonDirectionW
lonDirectionEN = lonDirectionEN_W
longitude = math.abs(longitude)
else
lonDirection = lonDirectionE
lonDirectionEN = lonDirectionEN_E
end
precision = datavalue['precision']
if not precision or precision <= 0 then
precision = 1 / 3600 -- precision not set (correctly), set to arcsecond
end
-- remove insignificant detail
latitude = math.floor(latitude / precision + 0.5) * precision
longitude = math.floor(longitude / precision + 0.5) * precision
if precision >= 1 - (1 / 60) and precision < 1 then
precision = 1
elseif precision >= (1 / 60) - (1 / 3600) and precision < (1 / 60) then
precision = 1 / 60
end
if precision >= 1 then
unitsPerDegree = 1
elseif precision >= (1 / 60) then
unitsPerDegree = 60
else
unitsPerDegree = 3600
end
numDigits = math.ceil(-math.log10(unitsPerDegree * precision))
if numDigits <= 0 then
numDigits = tonumber("0") -- for some reason, 'numDigits = 0' may actually store '-0', so parse from string instead
end
strFormat = "%." .. numDigits .. "f"
if precision >= 1 then
latDegrees = strFormat:format(latitude)
lonDegrees = strFormat:format(longitude)
if not raw then
latDegSym = replaceDecimalMark(latDegrees) .. degSymbol
lonDegSym = replaceDecimalMark(lonDegrees) .. degSymbol
else
latDegSym = latDegrees .. degSymbol
lonDegSym = lonDegrees .. degSymbol
end
else
latConv = math.floor(latitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits
lonConv = math.floor(longitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits
if precision >= (1 / 60) then
latMinutes = latConv
lonMinutes = lonConv
else
latSeconds = latConv
lonSeconds = lonConv
latMinutes = math.floor(latSeconds / 60)
lonMinutes = math.floor(lonSeconds / 60)
latSeconds = strFormat:format(latSeconds - (latMinutes * 60))
lonSeconds = strFormat:format(lonSeconds - (lonMinutes * 60))
if not raw then
latSecSym = replaceDecimalMark(latSeconds) .. secSymbol
lonSecSym = replaceDecimalMark(lonSeconds) .. secSymbol
else
latSecSym = latSeconds .. secSymbol
lonSecSym = lonSeconds .. secSymbol
end
end
latDegrees = math.floor(latMinutes / 60)
lonDegrees = math.floor(lonMinutes / 60)
latDegSym = latDegrees .. degSymbol
lonDegSym = lonDegrees .. degSymbol
latMinutes = latMinutes - (latDegrees * 60)
lonMinutes = lonMinutes - (lonDegrees * 60)
if precision >= (1 / 60) then
latMinutes = strFormat:format(latMinutes)
lonMinutes = strFormat:format(lonMinutes)
if not raw then
latMinSym = replaceDecimalMark(latMinutes) .. minSymbol
lonMinSym = replaceDecimalMark(lonMinutes) .. minSymbol
else
latMinSym = latMinutes .. minSymbol
lonMinSym = lonMinutes .. minSymbol
end
else
latMinSym = latMinutes .. minSymbol
lonMinSym = lonMinutes .. minSymbol
end
end
latValue = latDegSym .. latMinSym .. latSecSym .. latDirection
lonValue = lonDegSym .. lonMinSym .. lonSecSym .. lonDirection
value = latValue .. separator .. lonValue
if link then
globe = parseWikidataURL(datavalue['globe'])
if globe then
globe = mw.wikibase.getLabelByLang(globe, "en"):lower()
else
globe = "earth"
end
latLink = table.concat({latDegrees, latMinutes, latSeconds}, "_")
lonLink = table.concat({lonDegrees, lonMinutes, lonSeconds}, "_")
value = "[https://geohack.toolforge.org/geohack.php?language="..self.langCode.."¶ms="..latLink.."_"..latDirectionEN.."_"..lonLink.."_"..lonDirectionEN.."_globe:"..globe.." "..value.."]"
end
return value
elseif datatype == 'wikibase-entityid' then
local label
local itemID = datavalue['numeric-id']
if subtype == 'wikibase-item' then
itemID = "Q" .. itemID
elseif subtype == 'wikibase-property' then
itemID = "P" .. itemID
else
return '<strong class="error">' .. errorText('unknown-data-type', subtype) .. '</strong>'
end
label = self:getLabel(itemID, raw, link, short)
if label == "" then
label = nil
end
return label
else
return '<strong class="error">' .. errorText('unknown-data-type', datatype) .. '</strong>'
end
elseif snak.snaktype == 'somevalue' and not noSpecial then
if raw then
return " " -- single space represents 'somevalue'
else
return i18n['values']['unknown']
end
elseif snak.snaktype == 'novalue' and not noSpecial then
if raw then
return "" -- empty string represents 'novalue'
else
return i18n['values']['none']
end
else
return nil
end
end
function Config:getSingleRawQualifier(claim, qualifierID)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[qualifierID] end
if qualifiers and qualifiers[1] then
return self:getValue(qualifiers[1], true) -- raw = true
else
return nil
end
end
function Config:snakEqualsValue(snak, value)
local snakValue = self:getValue(snak, true) -- raw = true
if snakValue and snak.snaktype == 'value' and snak.datavalue.type == 'wikibase-entityid' then value = value:upper() end
return snakValue == value
end
function Config:setRank(rank)
local rankPos
if rank == p.flags.best then
self.bestRank = true
self.flagBest = true -- mark that 'best' flag was given
return
end
if rank:sub(1,9) == p.flags.preferred then
rankPos = 1
elseif rank:sub(1,6) == p.flags.normal then
rankPos = 2
elseif rank:sub(1,10) == p.flags.deprecated then
rankPos = 3
else
return
end
-- one of the rank flags was given, check if another one was given before
if not self.flagRank then
self.ranks = {false, false, false} -- no other rank flag given before, so unset ranks
self.bestRank = self.flagBest -- unsets bestRank only if 'best' flag was not given before
self.flagRank = true -- mark that a rank flag was given
end
if rank:sub(-1) == "+" then
for i = rankPos, 1, -1 do
self.ranks[i] = true
end
elseif rank:sub(-1) == "-" then
for i = rankPos, #self.ranks do
self.ranks[i] = true
end
else
self.ranks[rankPos] = true
end
end
function Config:setPeriod(period)
local periodPos
if period == p.flags.future then
periodPos = 1
elseif period == p.flags.current then
periodPos = 2
elseif period == p.flags.former then
periodPos = 3
else
return
end
-- one of the period flags was given, check if another one was given before
if not self.flagPeriod then
self.periods = {false, false, false} -- no other period flag given before, so unset periods
self.flagPeriod = true -- mark that a period flag was given
end
self.periods[periodPos] = true
end
function Config:qualifierMatches(claim, id, value)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[id] end
if qualifiers then
for _, v in pairs(qualifiers) do
if self:snakEqualsValue(v, value) then
return true
end
end
elseif value == "" then
-- if the qualifier is not present then treat it the same as the special value 'novalue'
return true
end
return false
end
function Config:rankMatches(rankPos)
if self.bestRank then
return (self.ranks[rankPos] and self.foundRank >= rankPos)
else
return self.ranks[rankPos]
end
end
function Config:timeMatches(claim)
local startTime = nil
local startTimeY = nil
local startTimeM = nil
local startTimeD = nil
local endTime = nil
local endTimeY = nil
local endTimeM = nil
local endTimeD = nil
if self.periods[1] and self.periods[2] and self.periods[3] then
-- any time
return true
end
startTime = self:getSingleRawQualifier(claim, aliasesP.startTime)
if startTime and startTime ~= "" and startTime ~= " " then
startTimeY, startTimeM, startTimeD = parseDate(startTime)
end
endTime = self:getSingleRawQualifier(claim, aliasesP.endTime)
if endTime and endTime ~= "" and endTime ~= " " then
endTimeY, endTimeM, endTimeD = parseDate(endTime)
end
if startTimeY ~= nil and endTimeY ~= nil and datePrecedesDate(endTimeY, endTimeM, endTimeD, startTimeY, startTimeM, startTimeD) then
-- invalidate end time if it precedes start time
endTimeY = nil
endTimeM = nil
endTimeD = nil
end
if self.periods[1] then
-- future
if startTimeY and datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD) then
return true
end
end
if self.periods[2] then
-- current
if (startTimeY == nil or not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD)) and
(endTimeY == nil or datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD)) then
return true
end
end
if self.periods[3] then
-- former
if endTimeY and not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD) then
return true
end
end
return false
end
function Config:processFlag(flag)
if not flag then
return false
end
if flag == p.flags.linked then
self.curState.linked = true
return true
elseif flag == p.flags.raw then
self.curState.rawValue = true
if self.curState == self.states[parameters.reference] then
-- raw reference values end with periods and require a separator (other than none)
self.separators["sep%r"][1] = {" "}
end
return true
elseif flag == p.flags.short then
self.curState.shortName = true
return true
elseif flag == p.flags.multilanguage then
self.curState.anyLanguage = true
return true
elseif flag == p.flags.unit then
self.curState.unitOnly = true
return true
elseif flag == p.flags.mdy then
self.mdyDate = true
return true
elseif flag == p.flags.single then
self.singleClaim = true
return true
elseif flag == p.flags.sourced then
self.sourcedOnly = true
return true
elseif flag == p.flags.edit then
self.editable = true
return true
elseif flag == p.flags.editAtEnd then
self.editable = true
self.editAtEnd = true
return true
elseif flag == p.flags.best or flag:match('^'..p.flags.preferred..'[+-]?$') or flag:match('^'..p.flags.normal..'[+-]?$') or flag:match('^'..p.flags.deprecated..'[+-]?$') then
self:setRank(flag)
return true
elseif flag == p.flags.future or flag == p.flags.current or flag == p.flags.former then
self:setPeriod(flag)
return true
elseif flag == "" then
-- ignore empty flags and carry on
return true
else
return false
end
end
function Config:processFlagOrCommand(flag)
local param = ""
if not flag then
return false
end
if flag == p.claimCommands.property or flag == p.claimCommands.properties then
param = parameters.property
elseif flag == p.claimCommands.qualifier or flag == p.claimCommands.qualifiers then
self.states.qualifiersCount = self.states.qualifiersCount + 1
param = parameters.qualifier .. self.states.qualifiersCount
self.separators["sep"..param] = {copyTable(defaultSeparators["sep%q\\d"])}
elseif flag == p.claimCommands.reference or flag == p.claimCommands.references then
param = parameters.reference
else
return self:processFlag(flag)
end
if self.states[param] then
return false
end
-- create a new state for each command
self.states[param] = State:new(self, param)
-- use "%x" as the general parameter name
self.states[param].parsedFormat = parseFormat(parameters.general) -- will be overwritten for param=="%p"
-- set the separator
self.states[param].separator = self.separators["sep"..param] -- will be nil for param=="%p", which will be set separately
if flag == p.claimCommands.property or flag == p.claimCommands.qualifier or flag == p.claimCommands.reference then
self.states[param].singleValue = true
end
self.curState = self.states[param]
return true
end
function Config:processSeparators(args)
local sep
for i, v in pairs(self.separators) do
if args[i] then
sep = replaceSpecialChars(args[i])
if sep ~= "" then
self.separators[i][1] = {sep}
else
self.separators[i][1] = nil
end
end
end
end
function Config:setFormatAndSeparators(state, parsedFormat)
state.parsedFormat = parsedFormat
state.separator = self.separators["sep"]
state.movSeparator = self.separators["sep"..parameters.separator]
state.puncMark = self.separators["punc"]
end
-- determines if a claim has references by prefetching them from the claim using getReferences,
-- which applies some filtering that determines if a reference is actually returned,
-- and caches the references for later use
function State:isSourced(claim)
self.conf.prefetchedRefs = self:getReferences(claim)
return (#self.conf.prefetchedRefs > 0)
end
function State:resetCaches()
-- any prefetched references of the previous claim must not be used
self.conf.prefetchedRefs = nil
end
function State:claimMatches(claim)
local matches, rankPos
-- first of all, reset any cached values used for the previous claim
self:resetCaches()
-- if a property value was given, check if it matches the claim's property value
if self.conf.propertyValue then
matches = self.conf:snakEqualsValue(claim.mainsnak, self.conf.propertyValue)
else
matches = true
end
-- if any qualifier values were given, check if each matches one of the claim's qualifier values
for i, v in pairs(self.conf.qualifierIDsAndValues) do
matches = (matches and self.conf:qualifierMatches(claim, i, v))
end
-- check if the claim's rank and time period match
rankPos = rankTable[claim.rank] or 4
matches = (matches and self.conf:rankMatches(rankPos) and self.conf:timeMatches(claim))
-- if only claims with references must be returned, check if this one has any
if self.conf.sourcedOnly then
matches = (matches and self:isSourced(claim)) -- prefetches and caches references
end
return matches, rankPos
end
function State:out()
local result -- collection of arrays with value objects
local valuesArray -- array with value objects
local sep = nil -- value object
local out = {} -- array with value objects
local function walk(formatTable, result)
local valuesArray = {} -- array with value objects
for i, v in pairs(formatTable.req) do
if not result[i] or not result[i][1] then
-- we've got no result for a parameter that is required on this level,
-- so skip this level (and its children) by returning an empty result
return {}
end
end
for _, v in ipairs(formatTable) do
if v.param then
valuesArray = mergeArrays(valuesArray, result[v.str])
elseif v.str ~= "" then
valuesArray[#valuesArray + 1] = {v.str}
end
if v.child then
valuesArray = mergeArrays(valuesArray, walk(v.child, result))
end
end
return valuesArray
end
-- iterate through the results from back to front, so that we know when to add separators
for i = #self.results, 1, -1 do
result = self.results[i]
-- if there is already some output, then add the separators
if #out > 0 then
sep = self.separator[1] -- fixed separator
result[parameters.separator] = {self.movSeparator[1]} -- movable separator
else
sep = nil
result[parameters.separator] = {self.puncMark[1]} -- optional punctuation mark
end
valuesArray = walk(self.parsedFormat, result)
if #valuesArray > 0 then
if sep then
valuesArray[#valuesArray + 1] = sep
end
out = mergeArrays(valuesArray, out)
end
end
-- reset state before next iteration
self.results = {}
return out
end
-- level 1 hook
function State:getProperty(claim)
local value = {self:getValue(claim.mainsnak)} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getQualifiers(claim, param)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[self.conf.qualifierIDs[param]] end
if qualifiers then
-- iterate through claim's qualifier statements to collect their values;
-- return array with multiple value objects
return self.conf.states[param]:iterate(qualifiers, {[parameters.general] = hookNames[parameters.qualifier.."\\d"][2], count = 1}) -- pass qualifier state with level 2 hook
else
return {} -- return empty array
end
end
-- level 2 hook
function State:getQualifier(snak)
local value = {self:getValue(snak)} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getAllQualifiers(claim, param, result, hooks)
local out = {} -- array with value objects
local sep = self.conf.separators["sep"..parameters.qualifier][1] -- value object
-- iterate through the output of the separate "qualifier(s)" commands
for i = 1, self.conf.states.qualifiersCount do
-- if a hook has not been called yet, call it now
if not result[parameters.qualifier..i] then
self:callHook(parameters.qualifier..i, hooks, claim, result)
end
-- if there is output for this particular "qualifier(s)" command, then add it
if result[parameters.qualifier..i] and result[parameters.qualifier..i][1] then
-- if there is already some output, then add the separator
if #out > 0 and sep then
out[#out + 1] = sep
end
out = mergeArrays(out, result[parameters.qualifier..i])
end
end
return out
end
-- level 1 hook
function State:getReferences(claim)
if self.conf.prefetchedRefs then
-- return references that have been prefetched by isSourced
return self.conf.prefetchedRefs
end
if claim.references then
-- iterate through claim's reference statements to collect their values;
-- return array with multiple value objects
return self.conf.states[parameters.reference]:iterate(claim.references, {[parameters.general] = hookNames[parameters.reference][2], count = 1}) -- pass reference state with level 2 hook
else
return {} -- return empty array
end
end
-- level 2 hook
function State:getReference(statement)
local citeParamMapping = i18n['cite']['param-mapping']
local citeConfig = i18n['cite']['config']
local citeTypes = i18n['cite']['output-types']
-- will hold rendered properties of the reference which are not directly from statement.snaks,
-- Namely, is URL generated from an external ID.
local additionalProcessedProperties = {}
-- for each citation type, there will be an associative array that associates lists of rendered properties
-- to citation-template parameters
local candidateParams = {}
-- like above, but only associates one rendered property to each parameter; if the above variable
-- contains more strings for a parameter, the strings will be assigned to numbered params (e.g. "author1")
local citeParams = {}
local citeErrors = {}
local referenceEmpty = true -- will be set to false if at least one parameter is left unremoved
local version = 12 -- increment this each time the below logic is changed to avoid conflict errors
if not statement.snaks then
return {}
end
-- don't use bot-added references referencing Wikimedia projects or containing "inferred from" (such references are not usable on Wikipedia)
if statement.snaks[aliasesP.importedFrom] or statement.snaks[aliasesP.wikimediaImportURL] or statement.snaks[aliasesP.inferredFrom] then
return {}
end
-- don't include "type of reference"
if statement.snaks[aliasesP.typeOfReference] then
statement.snaks[aliasesP.typeOfReference] = nil
end
-- don't include "image" to prevent littering
if statement.snaks[aliasesP.image] then
statement.snaks[aliasesP.image] = nil
end
-- don't include "language" if it is equal to the local one
if self:getReferenceDetail(statement.snaks, aliasesP.language) == self.conf.langName then
statement.snaks[aliasesP.language] = nil
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 link from it and use the link in the reference
-- find the "Wikidata property" properties in the item from "stated in"
local 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
local tempLink = self:getReferenceDetail(statement.snaks, wikidataPropertyOfSource, false, true) -- not raw, linked
if mw.ustring.match(tempLink, "^%[%Z- %Z+%]$") then -- getValue returned a URL in square brackets.
-- the link is in wiki markup, so strip the square brackets and the display text
-- gsub also returns another, discarted value, therefore the result is assigned to tempLink first
tempLink = mw.ustring.gsub(tempLink, "^%[(%Z-) %Z+%]$", "%1")
additionalProcessedProperties[aliasesP.referenceURL] = {tempLink}
statement.snaks[wikidataPropertyOfSource] = nil
break
end
end
end
end
-- initialize candidateParams and citeParams
for _, citeType in ipairs(citeTypes) do
candidateParams[citeType] = {}
citeParams[citeType] = {}
end
-- fill candidateParams
for _, citeType in ipairs(citeTypes) do
-- This will contain value--priority pairs for each param name.
local candidateValuesAndPriorities = {}
-- fill candidateValuesAndPriorities
for refProperty in pairs(statement.snaks) do
if citeErrors[citeType] then
break
end
repeat -- just a simple wrapper to emulate "continue"
-- set mappingKey and prefix
local mappingKey
local prefix = ""
if statement.snaks[refProperty][1].datatype == 'external-id' then
mappingKey = "external-id"
prefix = self.conf:getLabel(refProperty)
if prefix ~= "" then
prefix = prefix .. " "
end
else
mappingKey = refProperty
end
local paramName = citeParamMapping[citeType][mappingKey]
-- skip properties with empty parameter name
if paramName == "" then
break -- skip this property for this value of citeType
end
-- handle unknown properties in the reference
if not paramName then
referenceEmpty = false
local error_message = errorText("unknown-property-in-ref", refProperty)
assert(error_message) -- Should not be nil
citeErrors[citeType] = error_message
break
end
-- set processedProperty
local processedProperty
local raw = false -- if the value is wanted raw
if isValueInTable(paramName, citeConfig[citeType]["raw-value-params"] or {}) then
raw = true
end
if isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then
-- Multiple values may be given.
processedProperty = self:getReferenceDetails(statement.snaks, refProperty, raw, self.linked, true) -- anyLang = true
else
-- If multiple values are given, all but the first suitable one are discarted.
processedProperty = {self:getReferenceDetail(statement.snaks, refProperty, raw, self.linked and (statement.snaks[refProperty][1].datatype ~= 'url'), true)} -- link = true/false, anyLang = true
end
if #processedProperty == 0 then
break
end
referenceEmpty = false
-- add an empty entry to candidateValuesAndPriorities, if there isn't one already
if not candidateValuesAndPriorities[paramName] then
candidateValuesAndPriorities[paramName] = {}
end
-- find the priority of refProperty
local thisPropertyPriority = -1
local thisParamPrioritization = citeConfig[citeType]["prioritization"][paramName]
if thisParamPrioritization then
for i_priority, i_property in ipairs(thisParamPrioritization) do
if i_property == refProperty then
thisPropertyPriority = i_priority
end
end
end
for _, propertyValue in pairs(processedProperty) do
table.insert(
candidateValuesAndPriorities[paramName],
{prefix .. propertyValue, thisPropertyPriority}
)
end
until true
end
-- fill candidateParams[citeType]
if not citeErrors[citeType] then
local compareValuePriorities = function(pair1, pair2)
if pair1[2] == -1 and pair2[2] ~= -1 then
return false
end
if pair1[2] ~= -1 and pair2[2] == -1 then
return true
end
return pair1[2] < pair2[2]
end
-- fill candidateParams[citeType][paramName] for each used param
for paramName, _ in pairs(candidateValuesAndPriorities) do
table.sort(candidateValuesAndPriorities[paramName], compareValuePriorities)
candidateParams[citeType][paramName] = {}
for _, valuePriorityPair in ipairs(candidateValuesAndPriorities[paramName]) do
table.insert(candidateParams[citeType][paramName], valuePriorityPair[1])
end
end
end
end
-- handle additional properties
for refProperty in pairs(additionalProcessedProperties) do
for _, citeType in ipairs(citeTypes) do
repeat
-- skip if there already have been errors
if citeErrors[citeType] then
break
end
local paramName = citeParamMapping[citeType][refProperty]
-- handle unknown properties in the reference
if not paramName then
-- Skip this additional property, but do not cause an error.
break
end
if paramName == "" then
break
end
referenceEmpty = false
if not candidateParams[citeType][paramName] then
candidateParams[citeType][paramName] = {}
end
for _, propertyValue in pairs(additionalProcessedProperties[refProperty]) do
table.insert(candidateParams[citeType][paramName], propertyValue)
end
until true
end
end
-- fill citeParams
for _, citeType in ipairs(citeTypes) do
for paramName, paramValues in pairs(candidateParams[citeType]) do
if #paramValues == 1 or not isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then
citeParams[citeType][paramName] = paramValues[1]
else
-- There is more than one value for this parameter - the values will
-- go into separate numbered parameters (e.g. "author1", "author2")
for paramNum, paramValue in pairs(paramValues) do
citeParams[citeType][paramName .. paramNum] = paramValue
end
end
end
end
-- handle missing mandatory parameters for the templates
for _, citeType in ipairs(citeTypes) do
for _, requiredCiteParam in pairs(citeConfig[citeType]["mandatory-params"] or {}) do
if not citeParams[citeType][requiredCiteParam] then -- The required param is not present.
if citeErrors[citeType] then -- Do not override the previous error, if it exists.
break
end
local error_message = errorText("missing-mandatory-param", requiredCiteParam)
assert(error_message) -- Should not be nil
citeErrors[citeType] = error_message
end
end
end
local citeTypeToUse = nil
-- choose the output template
for _, citeType in ipairs(citeTypes) do
if not citeErrors[citeType] then
citeTypeToUse = citeType
break
end
end
-- set refContent
local refContent = ""
if citeTypeToUse then
local templateToUse = citeConfig[citeTypeToUse]["template"]
local paramsToUse = citeParams[citeTypeToUse]
if not templateToUse or templateToUse == "" then
throwError("no-such-reference-template", tostring(templateToUse), i18nPath, citeTypeToUse)
end
-- if this module is being substituted then build a regular template call, otherwise expand the template
if mw.isSubsting() then
for i, v in pairs(paramsToUse) do
refContent = refContent .. "|" .. i .. "=" .. v
end
refContent = "{{" .. templateToUse .. refContent .. "}}"
else
xpcall(
function () refContent = mw.getCurrentFrame():expandTemplate{title=templateToUse, args=paramsToUse} end,
function () throwError("no-such-reference-template", templateToUse, i18nPath, citeTypeToUse) end
)
end
-- If the citation couldn't be displayed using any template, but is not empty (barring ignored propeties), throw an error.
elseif not referenceEmpty then
refContent = errorText("malformed-reference-header")
for _, citeType in ipairs(citeTypes) do
refContent = refContent .. errorText("template-failure-reason", citeConfig[citeType]["template"], citeErrors[citeType])
end
refContent = refContent .. errorText("malformed-reference-footer")
end
-- wrap refContent
local ref = {}
if refContent ~= "" then
ref = {refContent}
if not self.rawValue then
-- this should become a <ref> tag, so save the reference's hash for later
ref.refHash = "wikidata-" .. statement.hash .. "-v" .. (tonumber(i18n['version']) + version)
end
return {ref}
else
return {}
end
end
-- gets a detail of one particular type for a reference
function State:getReferenceDetail(snaks, dType, raw, link, anyLang)
local switchLang = anyLang
local value = nil
if not snaks[dType] then
return nil
end
-- if anyLang, first try the local language and otherwise any language
repeat
for _, v in ipairs(snaks[dType]) do
value = self.conf:getValue(v, raw, link, false, anyLang and not switchLang, false, true) -- noSpecial = true
if value then
break
end
end
if value or not anyLang then
break
end
switchLang = not switchLang
until anyLang and switchLang
return value
end
-- gets the details of one particular type for a reference
function State:getReferenceDetails(snaks, dType, raw, link, anyLang)
local values = {}
if not snaks[dType] then
return {}
end
for _, v in ipairs(snaks[dType]) do
-- if nil is returned then it will not be added to the table
values[#values + 1] = self.conf:getValue(v, raw, link, false, anyLang, false, true) -- noSpecial = true
end
return values
end
-- level 1 hook
function State:getAlias(object)
local value = object.value
local title = nil
if value and self.linked then
if self.conf.entityID:sub(1,1) == "Q" then
title = mw.wikibase.getSitelink(self.conf.entityID)
elseif self.conf.entityID:sub(1,1) == "P" then
title = "d:Property:" .. self.conf.entityID
end
if title then
value = buildWikilink(title, value)
end
end
value = {value} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getBadge(value)
value = self.conf:getLabel(value, self.rawValue, self.linked, self.shortName)
if value == "" then
value = nil
end
value = {value} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
function State:callHook(param, hooks, statement, result)
-- call a parameter's hook if it has been defined and if it has not been called before
if not result[param] and hooks[param] then
local valuesArray = self[hooks[param]](self, statement, param, result, hooks) -- array with value objects
-- add to the result
if #valuesArray > 0 then
result[param] = valuesArray
result.count = result.count + 1
else
result[param] = {} -- an empty array to indicate that we've tried this hook already
return true -- miss == true
end
end
return false
end
-- iterate through claims, claim's qualifiers or claim's references to collect values
function State:iterate(statements, hooks, matchHook)
matchHook = matchHook or alwaysTrue
local matches = false
local rankPos = nil
local result, gotRequired
for _, v in ipairs(statements) do
-- rankPos will be nil for non-claim statements (e.g. qualifiers, references, etc.)
matches, rankPos = matchHook(self, v)
if matches then
result = {count = 0} -- collection of arrays with value objects
local function walk(formatTable)
local miss
for i2, v2 in pairs(formatTable.req) do
-- call a hook, adding its return value to the result
miss = self:callHook(i2, hooks, v, result)
if miss then
-- we miss a required value for this level, so return false
return false
end
if result.count == hooks.count then
-- we're done if all hooks have been called;
-- returning at this point breaks the loop
return true
end
end
for _, v2 in ipairs(formatTable) do
if result.count == hooks.count then
-- we're done if all hooks have been called;
-- returning at this point prevents further childs from being processed
return true
end
if v2.child then
walk(v2.child)
end
end
return true
end
gotRequired = walk(self.parsedFormat)
-- only append the result if we got values for all required parameters on the root level
if gotRequired then
-- if we have a rankPos (only with matchHook() for complete claims), then update the foundRank
if rankPos and self.conf.foundRank > rankPos then
self.conf.foundRank = rankPos
end
-- append the result
self.results[#self.results + 1] = result
-- break if we only need a single value
if self.singleValue then
break
end
end
end
end
return self:out()
end
local function getEntityId(arg, eid, page, allowOmitPropPrefix, globalSiteId)
local id = nil
local prop = nil
if arg then
if arg:sub(1,1) == ":" then
page = arg
eid = nil
elseif arg:sub(1,1):upper() == "Q" or arg:sub(1,9):lower() == "property:" or allowOmitPropPrefix then
eid = arg
page = nil
else
prop = arg
end
end
if eid then
if eid:sub(1,9):lower() == "property:" then
id = replaceAlias(mw.text.trim(eid:sub(10)))
if id:sub(1,1):upper() ~= "P" then
id = ""
end
else
id = replaceAlias(eid)
end
elseif page then
if page:sub(1,1) == ":" then
page = mw.text.trim(page:sub(2))
end
id = mw.wikibase.getEntityIdForTitle(page, globalSiteId) or ""
end
if not id then
id = mw.wikibase.getEntityIdForCurrentPage() or ""
end
id = id:upper()
if not mw.wikibase.isValidEntityId(id) then
id = ""
end
return id, prop
end
local function nextArg(args)
local arg = args[args.pointer]
if arg then
args.pointer = args.pointer + 1
return mw.text.trim(arg)
else
return nil
end
end
local function claimCommand(args, funcName)
local cfg = Config:new()
cfg:processFlagOrCommand(funcName) -- process first command (== function name)
local lastArg, parsedFormat, formatParams, claims, value
local hooks = {count = 0}
-- set the date if given;
-- must come BEFORE processing the flags
if args[p.args.date] then
cfg.atDate = {parseDate(args[p.args.date])}
cfg.periods = {false, true, false} -- change default time constraint to 'current'
end
-- process flags and commands
repeat
lastArg = nextArg(args)
until not cfg:processFlagOrCommand(lastArg)
-- get the entity ID from either the positional argument, the eid argument or the page argument
cfg.entityID, cfg.propertyID = getEntityId(lastArg, args[p.args.eid], args[p.args.page], false, args[p.args.globalSiteId])
if cfg.entityID == "" then
return "" -- we cannot continue without a valid entity ID
end
cfg.entity = mw.wikibase.getEntity(cfg.entityID)
if not cfg.propertyID then
cfg.propertyID = nextArg(args)
end
cfg.propertyID = replaceAlias(cfg.propertyID)
if not cfg.entity or not cfg.propertyID then
return "" -- we cannot continue without an entity or a property ID
end
cfg.propertyID = cfg.propertyID:upper()
if not cfg.entity.claims or not cfg.entity.claims[cfg.propertyID] then
return "" -- there is no use to continue without any claims
end
claims = cfg.entity.claims[cfg.propertyID]
if cfg.states.qualifiersCount > 0 then
-- do further processing if "qualifier(s)" command was given
if #args - args.pointer + 1 > cfg.states.qualifiersCount then
-- claim ID or literal value has been given
cfg.propertyValue = nextArg(args)
end
for i = 1, cfg.states.qualifiersCount do
-- check if given qualifier ID is an alias and add it
cfg.qualifierIDs[parameters.qualifier..i] = replaceAlias(nextArg(args) or ""):upper()
end
elseif cfg.states[parameters.reference] then
-- do further processing if "reference(s)" command was given
cfg.propertyValue = nextArg(args)
end
-- check for special property value 'somevalue' or 'novalue'
if cfg.propertyValue then
cfg.propertyValue = replaceSpecialChars(cfg.propertyValue)
if cfg.propertyValue ~= "" and mw.text.trim(cfg.propertyValue) == "" then
cfg.propertyValue = " " -- single space represents 'somevalue', whereas empty string represents 'novalue'
else
cfg.propertyValue = mw.text.trim(cfg.propertyValue)
end
end
-- parse the desired format, or choose an appropriate format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
elseif cfg.states.qualifiersCount > 0 then -- "qualifier(s)" command given
if cfg.states[parameters.property] then -- "propert(y|ies)" command given
parsedFormat, formatParams = parseFormat(formats.propertyWithQualifier)
else
parsedFormat, formatParams = parseFormat(formats.qualifier)
end
elseif cfg.states[parameters.property] then -- "propert(y|ies)" command given
parsedFormat, formatParams = parseFormat(formats.property)
else -- "reference(s)" command given
parsedFormat, formatParams = parseFormat(formats.reference)
end
-- if a "qualifier(s)" command and no "propert(y|ies)" command has been given, make the movable separator a semicolon
if cfg.states.qualifiersCount > 0 and not cfg.states[parameters.property] then
cfg.separators["sep"..parameters.separator][1] = {";"}
end
-- if only "reference(s)" has been given, set the default separator to none (except when raw)
if cfg.states[parameters.reference] and not cfg.states[parameters.property] and cfg.states.qualifiersCount == 0
and not cfg.states[parameters.reference].rawValue then
cfg.separators["sep"][1] = nil
end
-- if exactly one "qualifier(s)" command has been given, make "sep%q" point to "sep%q1" to make them equivalent
if cfg.states.qualifiersCount == 1 then
cfg.separators["sep"..parameters.qualifier] = cfg.separators["sep"..parameters.qualifier.."1"]
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hooks that should be called (getProperty, getQualifiers, getReferences);
-- only define a hook if both its command ("propert(y|ies)", "reference(s)", "qualifier(s)") and its parameter ("%p", "%r", "%q1", "%q2", "%q3") have been given
for i, v in pairs(cfg.states) do
-- e.g. 'formatParams["%q1"] or formatParams["%q"]' to define hook even if "%q1" was not defined to be able to build a complete value for "%q"
if formatParams[i] or formatParams[i:sub(1, 2)] then
hooks[i] = getHookName(i, 1)
hooks.count = hooks.count + 1
end
end
-- the "%q" parameter is not attached to a state, but is a collection of the results of multiple states (attached to "%q1", "%q2", "%q3", ...);
-- so if this parameter is given then this hook must be defined separately, but only if at least one "qualifier(s)" command has been given
if formatParams[parameters.qualifier] and cfg.states.qualifiersCount > 0 then
hooks[parameters.qualifier] = getHookName(parameters.qualifier, 1)
hooks.count = hooks.count + 1
end
-- create a state for "properties" if it doesn't exist yet, which will be used as a base configuration for each claim iteration;
-- must come AFTER defining the hooks
if not cfg.states[parameters.property] then
cfg.states[parameters.property] = State:new(cfg, parameters.property)
-- if the "single" flag has been given then this state should be equivalent to "property" (singular)
if cfg.singleClaim then
cfg.states[parameters.property].singleValue = true
end
end
-- if the "sourced" flag has been given then create a state for "reference" if it doesn't exist yet, using default values,
-- which must exist in order to be able to determine if a claim has any references;
-- must come AFTER defining the hooks
if cfg.sourcedOnly and not cfg.states[parameters.reference] then
cfg:processFlagOrCommand(p.claimCommands.reference) -- use singular "reference" to minimize overhead
end
-- set the parsed format and the separators (and optional punctuation mark);
-- must come AFTER creating the additonal states
cfg:setFormatAndSeparators(cfg.states[parameters.property], parsedFormat)
-- process qualifier matching values, analogous to cfg.propertyValue
for i, v in pairs(args) do
i = tostring(i)
if i:match('^[Pp]%d+$') or aliasesP[i] then
v = replaceSpecialChars(v)
-- check for special qualifier value 'somevalue'
if v ~= "" and mw.text.trim(v) == "" then
v = " " -- single space represents 'somevalue'
end
cfg.qualifierIDsAndValues[replaceAlias(i):upper()] = v
end
end
-- first sort the claims on rank to pre-define the order of output (preferred first, then normal, then deprecated)
claims = sortOnRank(claims)
-- then iterate through the claims to collect values
value = cfg:concatValues(cfg.states[parameters.property]:iterate(claims, hooks, State.claimMatches)) -- pass property state with level 1 hooks and matchHook
-- if desired, add a clickable icon that may be used to edit the returned values on Wikidata
if cfg.editable and value ~= "" then
value = value .. cfg:getEditIcon()
end
return value
end
local function generalCommand(args, funcName)
local cfg = Config:new()
cfg.curState = State:new(cfg)
local lastArg
local value = nil
repeat
lastArg = nextArg(args)
until not cfg:processFlag(lastArg)
-- get the entity ID from either the positional argument, the eid argument or the page argument
cfg.entityID = getEntityId(lastArg, args[p.args.eid], args[p.args.page], true, args[p.args.globalSiteId])
if cfg.entityID == "" or not mw.wikibase.entityExists(cfg.entityID) then
return "" -- we cannot continue without an entity
end
-- serve according to the given command
if funcName == p.generalCommands.label then
value = cfg:getLabel(cfg.entityID, cfg.curState.rawValue, cfg.curState.linked, cfg.curState.shortName)
elseif funcName == p.generalCommands.title then
cfg.inSitelinks = true
if cfg.entityID:sub(1,1) == "Q" then
value = mw.wikibase.getSitelink(cfg.entityID)
end
if cfg.curState.linked and value then
value = buildWikilink(value)
end
elseif funcName == p.generalCommands.description then
value = mw.wikibase.getDescription(cfg.entityID)
else
local parsedFormat, formatParams
local hooks = {count = 0}
cfg.entity = mw.wikibase.getEntity(cfg.entityID)
if funcName == p.generalCommands.alias or funcName == p.generalCommands.badge then
cfg.curState.singleValue = true
end
if funcName == p.generalCommands.alias or funcName == p.generalCommands.aliases then
if not cfg.entity.aliases or not cfg.entity.aliases[cfg.langCode] then
return "" -- there is no use to continue without any aliasses
end
local aliases = cfg.entity.aliases[cfg.langCode]
-- parse the desired format, or parse the default aliases format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
else
parsedFormat, formatParams = parseFormat(formats.alias)
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hook that should be called (getAlias);
-- only define the hook if the parameter ("%a") has been given
if formatParams[parameters.alias] then
hooks[parameters.alias] = getHookName(parameters.alias, 1)
hooks.count = hooks.count + 1
end
-- set the parsed format and the separators (and optional punctuation mark)
cfg:setFormatAndSeparators(cfg.curState, parsedFormat)
-- iterate to collect values
value = cfg:concatValues(cfg.curState:iterate(aliases, hooks))
elseif funcName == p.generalCommands.badge or funcName == p.generalCommands.badges then
if not cfg.entity.sitelinks or not cfg.entity.sitelinks[cfg.siteID] or not cfg.entity.sitelinks[cfg.siteID].badges then
return "" -- there is no use to continue without any badges
end
local badges = cfg.entity.sitelinks[cfg.siteID].badges
cfg.inSitelinks = true
-- parse the desired format, or parse the default aliases format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
else
parsedFormat, formatParams = parseFormat(formats.badge)
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hook that should be called (getBadge);
-- only define the hook if the parameter ("%b") has been given
if formatParams[parameters.badge] then
hooks[parameters.badge] = getHookName(parameters.badge, 1)
hooks.count = hooks.count + 1
end
-- set the parsed format and the separators (and optional punctuation mark)
cfg:setFormatAndSeparators(cfg.curState, parsedFormat)
-- iterate to collect values
value = cfg:concatValues(cfg.curState:iterate(badges, hooks))
end
end
value = value or ""
if cfg.editable and value ~= "" then
-- if desired, add a clickable icon that may be used to edit the returned value on Wikidata
value = value .. cfg:getEditIcon()
end
return value
end
-- modules that include this module should call the functions with an underscore prepended, e.g.: p._property(args)
local function establishCommands(commandList, commandFunc)
for _, commandName in pairs(commandList) do
local function wikitextWrapper(frame)
local args = copyTable(frame.args)
args.pointer = 1
loadI18n(aliasesP, frame)
return commandFunc(args, commandName)
end
p[commandName] = wikitextWrapper
local function luaWrapper(args)
args = copyTable(args)
args.pointer = 1
loadI18n(aliasesP)
return commandFunc(args, commandName)
end
p["_" .. commandName] = luaWrapper
end
end
establishCommands(p.claimCommands, claimCommand)
establishCommands(p.generalCommands, generalCommand)
-- main function that is supposed to be used by wrapper templates
function p.main(frame)
if not mw.wikibase then return nil end
local f, args
loadI18n(aliasesP, frame)
-- get the parent frame to take the arguments that were passed to the wrapper template
frame = frame:getParent() or frame
if not frame.args[1] then
throwError("no-function-specified")
end
f = mw.text.trim(frame.args[1])
if f == "main" then
throwError("main-called-twice")
end
assert(p["_"..f], errorText('no-such-function', f))
-- copy arguments from immutable to mutable table
args = copyTable(frame.args)
-- remove the function name from the list
table.remove(args, 1)
return p["_"..f](args)
end
return p
j5a6l03tjwodgrvfnv3lb4x5up93wlv
Module:Wd/i18n
828
9542
106496
41421
2026-07-10T16:54:31Z
Uzume
3415
Update from [[d:Special:GoToLinkedPage/enwiki/Q29879601|master]] using [[mw:Synchronizer| #Synchronizer]]
106496
Scribunto
text/plain
-- The values and functions in this submodule should be localized per wiki.
local p = {}
function p.init(aliasesP)
p = {
["version"] = "8", -- increment this each time the below parameters are changed to avoid reference conflict errors
["errors"] = {
["unknown-data-type"] = "Unknown or unsupported datatype '%s'.",
["missing-required-parameter"] = "No required parameters defined, needing at least one",
["extra-required-parameter"] = "Parameter '%s' must be defined as optional",
["no-function-specified"] = "You must specify a function to call", -- equal to the standard module error message
["main-called-twice"] = 'The function "main" cannot be called twice',
["no-such-function"] = 'The function "%s" does not exist', -- equal to the standard module error message
["no-such-reference-template"] = 'Error: template "%s", which is set in %s as the output template for the citation-output type "%s", does not exist',
-- Parts of the error message signalling a malformed reference.
["malformed-reference-header"] = "<span style=\"color:#dd3333\">\nError: Unable to display the reference from Wikidata properly. Technical details:\n",
["malformed-reference-footer"] = "See [[Module:wd/doc#References|the documentation]] for further details.\n</span>\n[[Category:Module:Wd reference errors]]",
["template-failure-reason"] = "* Reason for the failure of {{tl|%s}}: %s\n",
["missing-mandatory-param"] = 'The output template call would miss the mandatory parameter <code>%s</code>.',
["unknown-property-in-ref"] = 'The Wikidata reference contains the property {{property|%s}}, which is not assigned to any parameter of this template.'
},
["info"] = {
["edit-on-wikidata"] = "Edit this on Wikidata"
},
["numeric"] = {
["decimal-mark"] = ".",
["delimiter"] = ","
},
["datetime"] = {
["prefixes"] = {
["decade-period"] = ""
},
["suffixes"] = {
["decade-period"] = "s",
["millennium"] = " millennium",
["century"] = " century",
["million-years"] = " million years",
["billion-years"] = " billion years",
["year"] = " year",
["years"] = " years"
},
["julian-calendar"] = "Julian calendar", -- linked page title
["julian"] = "Julian",
["BCE"] = "BCE",
["CE"] = "CE",
["common-era"] = "Common Era" -- linked page title
},
["coord"] = {
["latitude-north"] = "N",
["latitude-south"] = "S",
["longitude-east"] = "E",
["longitude-west"] = "W",
["degrees"] = "°",
["minutes"] = "'",
["seconds"] = '"',
["separator"] = ", "
},
["values"] = {
["unknown"] = "unknown",
["none"] = "none"
},
["cite"] = {
["output-types"] = {"web", "q"}, -- In this order, the output types will be tried
["param-mapping"] = {
["web"] = {
-- <= left side: all allowed reference properties for *web page sources* per https://www.wikidata.org/wiki/Help:Sources
-- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite web]] (if non-existent, keep empty i.e. "")
[aliasesP.statedIn] = "website",
[aliasesP.referenceURL] = "url",
[aliasesP.publicationDate] = "date",
[aliasesP.lastUpdate] = "date",
[aliasesP.retrieved] = "access-date",
[aliasesP.title] = "title",
[aliasesP.subjectNamedAs] = "title",
[aliasesP.archiveURL] = "archive-url",
[aliasesP.archiveDate] = "archive-date",
[aliasesP.language] = "language",
[aliasesP.author] = "author",
[aliasesP.authorNameString] = "author",
[aliasesP.publisher] = "publisher",
[aliasesP.quote] = "quote",
[aliasesP.pages] = "pages", -- extra option
[aliasesP.publishedIn] = "website",
[aliasesP.sectionVerseOrParagraph] = "at"
},
["q"] = {
-- <= left side: all allowed reference properties for *sources other than web pages* per https://www.wikidata.org/wiki/Help:Sources
-- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite Q]] (if non-existent, keep empty i.e. "")
[aliasesP.statedIn] = "1",
[aliasesP.pages] = "pages",
[aliasesP.column] = "at",
[aliasesP.chapter] = "chapter",
[aliasesP.sectionVerseOrParagraph] = "section",
["external-id"] = "id", -- used for any type of database property ID
[aliasesP.title] = "title",
[aliasesP.publicationDate] = "date",
[aliasesP.lastUpdate] = "date",
[aliasesP.retrieved] = "access-date"
}
},
["config"] = {
-- supported fields:
-- - template: name of the template used for output
-- - numbered-params: citation params accepting an arbitrary number of values by numbering the params (e.g. author1, author2)
-- - raw-value-params: params taking a raw value (which means the property is rendered with getValue with raw=true)
-- - mandatory-params: params that are required be in the template call (after potentially appending numbers to params listed in numbered-params)
-- - prioritization: table associating a list of properties, in the order in which they are preferred, to template parameters;
-- properties not mentioned here have the lowest priority;
-- prioritization of properties handled through additionalProcessedProperties is unsupported;
-- no key of this table can be from numbered-params
-- Leaving out the "template" field causes the output type to be ignored.
["web"] = {
["template"] = "Cite web",
["numbered-params"] = {"author"},
["mandatory-params"] = {"url"},
["prioritization"] = {
["date"] = {aliasesP.lastUpdate, aliasesP.publicationDate},
["title"] = {aliasesP.title, aliasesP.subjectNamedAs}
}
},
["q"] = {
["template"] = "Cite Q",
["raw-value-params"] = {"1"}, -- the first, unnamed parameter of CiteQ takes a QID, not the name of the item cited
["mandatory-params"] = {"1"},
["prioritization"] = {
["date"] = {aliasesP.lastUpdate, aliasesP.publicationDate}
}
}
}
}
}
p.getOrdinalSuffix = function(num)
if tostring(num):sub(-2,-2) == '1' then
return "th" -- 10th, 11th, 12th, 13th, ... 19th
end
num = tostring(num):sub(-1)
if num == '1' then
return "st"
elseif num == '2' then
return "nd"
elseif num == '3' then
return "rd"
else
return "th"
end
end
p.addDelimiters = function(n)
local left, num, right = string.match(n, "^([^%d]*%d)(%d*)(.-)$")
if left and num and right then
return left .. (num:reverse():gsub("(%d%d%d)", "%1" .. p['numeric']['delimiter']):reverse()) .. right
else
return n
end
end
return p
end
return p
pgkxz3kqyoyu0zj2nmtkjkdr0ntnin5
Freshwater acidification
0
27928
106499
105930
2026-07-10T18:52:31Z
DaSupremo
9
Make sum corrections
106499
wikitext
text/x-wiki
{{Databox}}
'''Freshwater acidification''' dey happen wen acidic inputs enter body of fresh water thru weathering of rocks, invasion of acidifying gas (e.g. carbon dioxide), anaa by reduction of acid anions like sulfate den nitrate inside lake, pond, anaa reservoir.<ref name="Psenner-1994">{{Cite journal|last=Psenner|first=Roland|date=March 1994|title=Environmental impacts on freshwaters: acidification as a global problem|journal=Science of the Total Environment|volume=143|issue=1|pages=53–61|bibcode=1994ScTEn.143...53P|doi=10.1016/0048-9697(94)90532-0|issn=0048-9697}}</ref> Freshwater acidification mainly dey caused by sulfur oxides (SOx) den nitrogen oxides (NOx) wey dey enter water through atmospheric deposition den soil leaching.<ref name="Psenner-1994" /> Carbonic acid den dissolved carbon dioxide sanso fit enter freshwater in similar way thru runoff from carbon dioxide-rich soils.<ref name="Psenner-1994" /> Runoff wey carry these compounds fit bring hydrogen ions den inorganic aluminum insyd water, wey fit toxic to aquatic organisms.<ref name="Psenner-1994" /> Acid rain sef dey contribute to freshwater acidification.<ref>{{Cite journal|last1=Irwin|first1=J.G.|last2=Williams|first2=M.L.|author2-link=Martin Williams (environmental scientist)|date=1988|title=Acid rain: Chemistry and transport|journal=Environmental Pollution|volume=50|issue=1–2|pages=29–59|doi=10.1016/0269-7491(88)90184-4|issn=0269-7491|pmid=15092652}}</ref> One well-known case of freshwater acidification be Adirondack Lakes for New York wey show up for 1970s, wey be caused by acid rain from industrial sulfur dioxide (SO<sub>2</sub>) den nitrogen oxide (NOx) emissions.<ref name=":3">{{Cite journal |last=Driscoll |first=C. T |last2=Postek |first2=K. M |last3=Mateti |first3=D |last4=Sequeira |first4=K |last5=Aber |first5=J. D |last6=Kretser |first6=W. J |last7=Mitchell |first7=M. J |last8=Raynal |first8=D. J |date=1998-08-01 |title=The response of lake water in the Adirondack region of New York to changes in acidic deposition |url=https://linkinghub.elsevier.com/retrieve/pii/S1462901198000288 |journal=Environmental Science & Policy |volume=1 |issue=3 |pages=185–198 |doi=10.1016/S1462-9011(98)00028-8 |issn=1462-9011 |doi-access=free}}</ref>
== Causes ==
=== Natural ===
CO<sub>2</sub> from atmosphere anaa decomposition of organic matter fit affect freshwater acidity.<ref>{{Cite book |title=Ocean acidification |date=2011 |publisher=Oxford University Press |isbn=978-0-19-959108-4 |editor=Jean-Pierre Gattuso |oclc=975179973 |editor2=Lina Hansson}}</ref> CO<sub>2</sub> wey dissolve insyd water form carbonic acid. Dis carbonic acid go break into hydrogen ions (H+) den bicarbonate (HCO<sub>3</sub><sup>-</sup>) wey go increase H+ ions den reduce pH level.<ref>{{Cite journal |last=Wurts |first=William A. |last2=Durborow |first2=Robert M. |title=Interactions of pH, Carbon Dioxide, Alkalinity and Hardness in Fish Ponds |url=https://lee-phillips.org/Backyard/cache/464fs.pdf |journal=SRAC Publication |publication-date=1992 |issue=464 |pages=1–4}}</ref>
CO<sub>2</sub> + H<sub>2</sub>O → H<sub>2</sub>CO<sub>3</sub>; H<sub>2</sub>CO<sub>3</sub> ⇌ H<sup>+</sup> + HCO<sub>3</sub><sup>-</sup>
Microbial activity wey dey break down organic matter release organic acids like humic den fulvic acids. Dese acids fit collect insyd water bodies, especially forest den wetland areas.<ref>{{Cite journal |last1=Berner |first1=Robert A. |last2=Lasaga |first2=Antonio C. |date=1989 |title=Modeling the Geochemical Carbon Cycle |url=https://www.jstor.org/stable/24987179 |journal=Scientific American |volume=260 |issue=3 |pages=74–81 |doi=10.1038/scientificamerican0389-74 |jstor=24987179 |issn=0036-8733|url-access=subscription }}</ref> Peatlands den wetlands dey often produce acidic water secof high organic matter decomposition.<ref name=":2">{{Cite journal |last=Nordstrom |first=D. K. |date=2011 |title=Mine waters: Acidic to circumneutral |url=https://pubs.geoscienceworld.org/msa/elements/article/7/6/393/137913/Mine-Waters-Acidic-to-Circmneutral |journal=Elements |volume=7 |issue=6 |pages=393–398 |doi=10.2113/gselements.7.6.393|url-access=subscription }}</ref>
Volcanic activity fit release sulfur dioxide (SO<sub>2</sub>) den other acidic oxides enter atmosphere.<ref name=":0">{{Cite journal |last=Schindler |first=D. W. |date=1988-01-08 |title=Effects of Acid Rain on Freshwater Ecosystems |url=https://www.science.org/doi/10.1126/science.239.4836.149 |journal=Science |volume=239 |issue=4836 |pages=149–157 |doi=10.1126/science.239.4836.149 |pmid=17732976 |issn=0036-8075|url-access=subscription }}</ref> Insyd air, sulfur dioxide convert to sulfuric acid:<ref name="Henriksen-1992">{{Cite journal |last1=Henriksen |first1=Arne |last2=Kämäri |first2=Juha |last3=Posch |first3=Maximilian |last4=Wilander |first4=Anders |date=1992 |title=Critical Loads of Acidity: Nordic Surface Waters |journal=Ambio |volume=21 |issue=5 |pages=356–363 |issn=0044-7447 |jstor=4313961}}</ref>
SO<sub>2</sub> + <sup>1</sup>⁄<sub>2</sub> O<sub>2</sub> + H<sub>2</sub>O → H<sub>2</sub>SO<sub>4</sub>; H<sub>2</sub>SO<sub>4</sub> → 2H<sup>+</sup> + SO<sub>4</sub><sup>2-</sup>
=== Anthropogenic ===
[[File:Rio tinto river CarolStoker NASA Ames Research Center.jpg|thumb|Rio Tinto river for Spain show acid drainage from natural den mining origin]]
Human activities dey increase freshwater acidification plenty. Burning of fossil fuels release sulfur dioxide (SO<sub>2</sub>) den nitrogen oxides (NOx). Dese gases react plus water den air form sulfuric acid (H<sub>2</sub>SO<sub>4</sub>) den nitric acid (HNO<sub>3</sub>).<ref name=":0" /><ref>{{Cite journal |last1=Likens |first1=Gene E. |last2=Bormann |first2=F. Herbert |date=1974-06-14 |title=Acid Rain: A Serious Regional Environmental Problem |url=https://www.science.org/doi/10.1126/science.184.4142.1176 |journal=Science |volume=184 |issue=4142 |pages=1176–1179 |doi=10.1126/science.184.4142.1176 |pmid=17756304 |issn=0036-8075|url-access=subscription }}</ref> Nitric acid sef go dissociate into hydrogen ions H<sup>+</sup>) den nitrate ions (NO<sub>3</sub><sup>-</sup>), wey reduce pH.<ref name="Cardoso-2009">{{cite encyclopedia |encyclopedia=Encyclopedia of Inland Waters |publisher=Elsevier |last1=Cardoso |first1=A.C. |date=2009 |pages=310–331 |doi=10.1016/b978-012370626-3.00244-1 |isbn=978-0-12-370626-3 |last2=Free |first2=G. |last3=Nõges |first3=P. |last4=Kaste |first4=Ø. |last5=Poikane |first5=S. |last6=Solheim |first6=A. Lyche |chapter=Lake Management, Criteria}}</ref>
NO<sub>x</sub> + H<sub>2</sub>O + <sup>1</sup>⁄<sub>2</sub> O<sub>2</sub> → HNO<sub>3</sub>; HNO<sub>3</sub> → H<sup>+</sup> + NO<sub>3</sub><sup>-</sup>
Dis process worse for areas wer water buffering capacity low. Mining too dey contribute thru acid mine drainage. Wen pyrite (FeS<sub>2</sub>) meet air den water, e form sulfuric acid.<ref name="Nordstrom 393–398">{{Cite journal |last=Nordstrom |first=D. K. |date=2011-12-01 |title=Mine Waters: Acidic to Circmneutral |url=https://pubs.geoscienceworld.org/elements/article/7/6/393-398/137913 |journal=Elements |volume=7 |issue=6 |pages=393–398 |doi=10.2113/gselements.7.6.393 |issn=1811-5209|url-access=subscription }}</ref>
== Buffering Capacity ==
[[File:Atlantic Canada - Natural Earth.jpg|thumb|Map of Atlantic Canada]]
Buffering capacity of ecosystem dey help resist pH change. Bicarbonate (HCO<sub>3</sub><sup>-</sup>) den carbonate (CO<sub>3</sub><sup>2-</sup>) ions insyd freshwater systems fi neutralize de income hydrogen ions (H<sup>+</sup>).
HCO<sub>3</sub><sup>-</sup> + H<sup>+</sup> → CO<sub>2</sub> + H<sub>2</sub>O
But areas with low alkalinity (like silicate bedrock regions) no get strong buffering system, so pH fit drop fast.<ref>{{Cite journal |last=Schindler |first=D. W. |date=1988-01-08 |title=Effects of Acid Rain on Freshwater Ecosystems |url=https://www.science.org/doi/10.1126/science.239.4836.149 |journal=Science |volume=239 |issue=4836 |pages=149–157 |doi=10.1126/science.239.4836.149 |issn=0036-8075|url-access=subscription }}</ref>
For example, Atlantic region of [[Canada]] get low acid deposition but still get very acidic water because buffering capacity low den natural organic acids from wetlands dey add more acidity.<ref name="Clair-2007">{{Cite journal|last1=Clair|first1=Thomas A.|last2=Dennis|first2=Ian F.|last3=Scruton|first3=David A.|last4=Gilliss|first4=Mallory|date=December 2007|title=Freshwater acidification research in Atlantic Canada: a review of results and predictions for the future|journal=Environmental Reviews|volume=15|issue=NA|pages=153–167|doi=10.1139/a07-004|issn=1181-8700}}</ref>
== Effects on ecosystems ==
[[File:Nationaal Park Drents-Friese Wold. Locatie Fochteloërveen. Waterveenmos (Sphagnum cuspidatum), Veenpluis (Eriophorum angustifolium) 03.JPG|thumb|Pond with plenty Sphagnum]]
Freshwater acidification fit reduce biodiversity den change ecosystem structure den function.<ref name="Henriksen-1992" /> Macro-invertebrates den big vertebrates suffer higher death rate den lower reproduction under acidic conditions. Some algae den moss like Sphagnum fit even thrive den dominate, push other species out. Sphagnum fit exchange H<sup>+</sup> for basic cations insyd freshwater, wey e fit reduce nutrient cycling by blocking water-sediment exchange.<ref name="Henriksen-1992" /> Aquatic biomonitoring dey used to check ecosystem health. Acid soil fit affect agriculture too.<ref name="Chen-2022">{{Cite journal |last1=Chen |first1=Changan |last2=Lin |first2=Juntong |last3=Liu |first3=Yuhang |last4=Ren |first4=Xiangru |date=2022 |title=Effects of freshwater acidification and countermeasures |journal=IOP Conference Series: Earth and Environmental Science |volume=1011 |issue=1 |article-number=012035 |bibcode=2022E&ES.1011a2035C |s2cid=248122033 |doi=10.1088/1755-1315/1011/1/012035 |doi-access=free}}</ref> Some animals like frogs den perch fit survive pH 4.<ref name="Landuse.alberta.ca">{{cite web |title=Effects of Acid Rain - Surface Waters and Aquatic Animals |url=https://landuse.alberta.ca/Forms%20and%20Applications/RFR_ACFN%20Reply%20to%20Crown%20Submission%205%20-%20TabD9%20AcidRain_2014-08_PUBLIC.pdf |access-date=19 April 2022 |website=Landuse.alberta.ca}}</ref> Buh chaw organisms like clams den snails no fit survive low pH; dema shells dey weaken den protection reduce.<ref name="Landuse.alberta.ca" />
== Minimizing acidification ==
Agricultural runoff (nitrogen den phosphorus) be major cause. Best management practices like reduce fertilizer use, improve manure management, den precision agriculture fit reduce pollution.<ref name=jac>{{Cite journal |last1=Camargo |first1=Julio A. |last2=Alonso |first2=Álvaro |date=August 2006 |title=Ecological and toxicological effects of inorganic nitrogen pollution in aquatic ecosystems: A global assessment |url=https://linkinghub.elsevier.com/retrieve/pii/S0160412006000602 |journal=Environment International |volume=32 |issue=6 |pages=831–849 |doi=10.1016/j.envint.2006.05.002|pmid=16781774 |hdl=10261/294824 |url-access=subscription |hdl-access=free }}</ref> Riparian buffer zones (vegetation strips near water) fit filter pollutants before dem enter freshwater.<ref name=":1">{{Cite journal |last1=Mayer |first1=Paul M. |last2=Jr. Reynolds |first2=Steven K. |last3=Canfield |first3=Timothy J. |last4=McCutchen |first4=Marshall D. |date=2005 |title=Riparian Buffer Width, Vegetative Cover, and Nitrogen Removal Effectiveness: A Review of Current Science and Regulations |url=https://www.epa.gov/sites/default/files/2019-02/documents/riparian-buffer-width-2005.pdf |journal=Journal of the American Water Resources Association |volume=43 |issue=2 |pages=311–324}}</ref> Wetlands den peatlands dey absorb pollutants den control water flow, so dem help buffer systems.<ref>{{Cite journal |last=Gorham |first=Eville |date=May 1991 |title=Northern Peatlands: Role in the Carbon Cycle and Probable Responses to Climatic Warming |url=https://esajournals.onlinelibrary.wiley.com/doi/10.2307/1941811 |journal=Ecological Applications |volume=1 |issue=2 |pages=182–195 |doi=10.2307/1941811 |jstor=1941811 |pmid=27755660 |issn=1051-0761}}</ref> Liming (adding calcium carbonate CaCO<sub>3</sub>) dey raise pH den restore habitat condition.<ref name="Mant-2013">{{Cite journal |last1=Mant |first1=Rebecca C. |last2=Jones |first2=David L. |last3=Reynolds |first3=Brian |last4=Ormerod |first4=Steve J. |last5=Pullin |first5=Andrew S. |date=2013-08-01 |title=A systematic review of the effectiveness of liming to mitigate impacts of river acidification on fish and macro-invertebrates |journal=Environmental Pollution |volume=179 |pages=285–293 |doi=10.1016/j.envpol.2013.04.019 |pmid=23707951 |issn=0269-7491|doi-access=free |bibcode=2013EPoll.179..285M }}</ref> Mining acid drainage fit treat through biological processes den alkaline materials.<ref name="Nordstrom 393–398" /> Circular economy approach (reduce, reuse, recycle) too fit reduce pollution overall.<ref>{{Cite journal |last=Morseletto |first=Piero |date=2020-02-01 |title=Targets for a circular economy |url=https://linkinghub.elsevier.com/retrieve/pii/S0921344919304598 |journal=Resources, Conservation and Recycling |volume=153 |article-number=104553 |doi=10.1016/j.resconrec.2019.104553 |issn=0921-3449|hdl=1871.1/c4c1f149-0a90-46fb-9105-cbf7157cf3f8 |hdl-access=free }}</ref>
== Regulations ==
Control of SO<sub>x</sub> den NO<sub>x</sub> emissions fit reduce acid rain den acid water.<ref>{{Cite journal |last1=Menz |first1=Fredric C. |last2=Seip |first2=Hans M. |date=2004-08-01 |title=Acid rain in Europe and the United States: an update |url=https://www.sciencedirect.com/science/article/pii/S1462901104000590 |journal=Environmental Science & Policy |volume=7 |issue=4 |pages=253–265 |doi=10.1016/j.envsci.2004.05.005 |issn=1462-9011|url-access=subscription }}</ref> Canada-United States Air Quality Agreement reduce acid rain by 78% for Canada den 92% for US as of 2020.<ref>{{Cite web |last=Canada |first=Environment and Climate Change |date=2005-01-25 |title=Canada-United States Air Quality Agreement: overview |url=https://www.canada.ca/en/environment-climate-change/services/air-pollution/issues/transboundary/canada-united-states-air-quality-agreement-overview.html |access-date=2023-03-25 |website=www.canada.ca}}</ref> Research investment den monitoring help build policy solutions. Government sanso fit support companies to reduce pollution den use better production methods.<ref name="Chen-2022" /> Examples include Acid Rain Program in US (1995) den Gothenburg Protocol by UNECE.<ref>{{Cite web |title=Protocol to Abate Acidification, Eutrophication and Ground-level Ozone {{!}} UNECE |url=https://unece.org/environment-policy/air/protocol-abate-acidification-eutrophication-and-ground-level-ozone |access-date=2023-03-25 |website=unece.org}}</ref>
== Case Study: Freshwater Acidification insyd de Adirondack Lakes, New York ==
[[File:Adirondack Lake - 2055193932.jpg|thumb|Adirondack Lake, USA]]
Adirondack Lakes be one major case study of freshwater acidification. From 1970s, lakes show acidification secof low Acid Neutralizing Capacity den industrial emissions of SO<sub>2</sub> den NO<sub>x</sub> wey dey cause acid rain.<ref name=":3" /> Pollutants move from Midwest US go Adirondack region, reduce pH of water den soil.<ref>{{Cite journal |last=DRISCOLL |first=CHARLES T. |last2=LAWRENCE |first2=GREGORY B. |last3=BULGER |first3=ARTHUR J. |last4=BUTLER |first4=THOMAS J. |last5=CRONAN |first5=CHRISTOPHER S. |last6=EAGAR |first6=CHRISTOPHER |last7=LAMBERT |first7=KATHLEEN F. |last8=LIKENS |first8=GENE E. |last9=STODDARD |first9=JOHN L. |last10=WEATHERS |first10=KATHLEEN C. |date=2001 |title=Acidic Deposition in the Northeastern United States: Sources and Inputs, Ecosystem Effects, and Management Strategies |url=https://academic.oup.com/bioscience/article/51/3/180/256122 |journal=BioScience |volume=51 |issue=3 |page=180 |doi=10.1641/0006-3568(2001)051[0180:aditnu]2.0.co;2 |issn=0006-3568}}</ref> Dis cause decline insyd biodiversity, wey dey include fish den crustacean disappearance.<ref>{{Cite report |url=https://www.osti.gov/biblio/6173689 |title=Adirondack lakes survey: An interpretive analysis of fish communities and water chemistry, 1984--1987 |last=Baker |first=J. P. |last2=Gherini |first2=S. A. |date=1990-01-01 |publisher=Oak Ridge National Lab. (ORNL), Oak Ridge, TN (United States); Adirondack Lakes Survey Corp., Ray Brook, NY (USA) |issue=ORNL/M-1148 |doi=10.2172/6173689 |osti=6173689 |language=English |last3=Munson |first3=R. K. |last4=Christensen |first4=S. W. |last5=Driscoll |first5=C. T. |last6=Gallagher |first6=J. |last7=Newton |first7=R. M. |last8=Reckhow |first8=K. H. |last9=Schofield |first9=C. L.}}</ref> Clean Air Act of 1990 help reduce SO<sub>2</sub> den NO<sub>x</sub> emissions.<ref name=":3" /> Water quality improve, buh ecosystem recovery still slow because soil still hold acid effect.<ref>{{Cite journal |last=Stoddard |first=J. L. |last2=Jeffries |first2=D. S. |last3=Lükewille |first3=A. |last4=Clair |first4=T. A. |last5=Dillon |first5=P. J. |last6=Driscoll |first6=C. T. |last7=Forsius |first7=M. |last8=Johannessen |first8=M. |last9=Kahl |first9=J. S. |last10=Kellogg |first10=J. H. |last11=Kemp |first11=A. |last12=Mannio |first12=J. |last13=Monteith |first13=D. T. |last14=Murdoch |first14=P. S. |last15=Patrick |first15=S. |date=1999 |title=Regional trends in aquatic recovery from acidification in North America and Europe |url=https://www.nature.com/articles/44114 |journal=Nature |volume=401 |issue=6753 |pages=575–578 |doi=10.1038/44114 |issn=0028-0836|url-access=subscription }}</ref>
== Read further ==
*{{Cite web|title=Measurements and observations: OCB-OA|url=http://www.whoi.edu/OCB-OA/page.do?pid=112157|access-date=2019-03-24|website=Whoi.edu|language=en-US}}
== References ==
[[Category:Water pollution]]
[[Category:Greenhouse gas emissions]]
[[Category:Water chemistry]]
[[Category:Environmental science]]
[[Category:Hydrology]]
tbvfbvu4oiqxkrvaqe295jzq1pa4lfv
Water testing
0
27929
106502
105932
2026-07-10T19:18:09Z
DaSupremo
9
Make sum corrections
106502
wikitext
text/x-wiki
{{Databox}}'''Water testing''' be general description for different procedures wey dem dey use check water quality. Millions of water quality tests dey happen every day to meet regulatory requirements den to maintain safety.<ref name="Water testing – pass or fail">{{cite web|title=Water testing – pass or fail?|url=http://www.globalwaterintel.com/archive/10/6/market-insight/water-testing-pass-or-fail.html|publisher=Global Water Intelligence|accessdate=21 March 2013}}</ref>
Dem fit carry out testing to check:
* '''ambient anaa environmental water quality''' – how surface water body fit support aquatic life as ecosystem. ''See'' Environmental monitoring, Freshwater environmental quality parameters den Bioindicator.
* '''wastewater''' – how polluted water be (domestic sewage anaa industrial waste) before treatment anaa after treatment. ''See'' Environmental chemistry den Wastewater quality indicators.
* '''"raw water" quality''' – how water source be before treatment for domestic use (drinking water). ''See'' Bacteriological water analysis den specific tests like turbidity den hard water.
* '''"finished" water quality''' – water wey dem treat for municipal water purification plant. ''See'' Bacteriological water analysis den Category:Water quality indicators.
* whether water fit serve for industrial uses like laboratory work, manufacturing anss equipment cooling. ''See'' purified water.
==Government regulation==
Government rules wey relate to water testing den water quality for some major countries dey below.
===China===
====Ministry of Environmental Protection====
Ministry of Environmental Protection of People's Republic of China be de country environmental protection department wey dey handle protection of air, water den land from pollution. E dey under State Council,wey by law e get power to enforce environmental policies den regulations. E sanso dey support research den development.<ref>{{cite web|title=MEP Mission|url=http://english.mep.gov.cn/About_SEPA/Mission/200803/t20080318_119444.htm|accessdate=20 March 2013|archive-date=26 January 2013|archive-url=https://web.archive.org/web/20130126120712/http://english.mep.gov.cn/About_SEPA/Mission/200803/t20080318_119444.htm|url-status=dead}}</ref>
====Regulatory challenges den debates====
For late 2009, survey wey China Ministry of Housing and Urban-Rural Development do show say water quality of urban supply for cities no meet standard for at least 1,000 water treatment plants out of over 4,000 wey dem check. The result no release officially, but later Century Weekly publish am for 2012. Government official later talk say 80% of urban tap water dey okay based on pilot data from 2011.
China new drinking water standard get 106 indicators. But only 40% of 35 major cities fit test all 106 indicators. Some agencies dey negotiate results for over 60 indicators, so dem no dey test everything strictly. Water quality grading dey based on average 95% compliance. Inspection dey happen twice every year.<ref>{{cite web|last=Gong|first=Jing|title=What's coming out of China's taps?|date=7 June 2012 |url=http://www.chinadialogue.net/article/show/single/en/4962-What-s-coming-out-of-China-s-taps-|publisher=China Dialogue|accessdate=20 March 2013}}</ref>
===Pakistan===
====Pakistan Council of Research in Water Resources====
Dis organization start for 1964. E dey conduct, organize den promote research for all water resources areas. E dey focus on applied and basic research for water sector development.<ref>{{cite web|title=About PCRWR|url=http://www.pcrwr.gov.pk/About.aspx|publisher=PCRWR|accessdate=25 March 2013|archive-date=16 April 2013|archive-url=https://web.archive.org/web/20130416000532/http://www.pcrwr.gov.pk/About.aspx|url-status=dead}}</ref>
====Recent developments====
For March 2013, minister for Science and Technology talk say only 15–18% groundwater samples for Pakistan dey safe for drinking. Government set up 24 water testing labs, produce water test kits, filters den treatment sachets, and train over 2,660 professionals. Dem sanso survey 10,000 out of 12,000 water supply systems.<ref>{{cite web|title=24 water quality testing laboratories set up in country: NA told|date=13 March 2013 |url=http://www.brecorder.com/pakistan/industries-a-sectors/110480-24-water-quality-testing-laboratories-set-up-in-country-na-told.html|publisher=Business Recorder|accessdate=25 March 2013}}</ref>
===United Kingdom===
====Drinking Water Inspectorate====
Drinking Water Inspectorate be department under Environment, Food and Rural Affairs wey dey regulate public water supply companies for England den Wales.<ref>{{cite web|title=Drinking Water Inspectorate Home Page|url=http://dwi.defra.gov.uk/|accessdate=20 March 2013}}</ref> Local environmental health offices sanso fit carry out water testing.<ref>{{cite web|title=Drinking water quality|url=http://dwi.defra.gov.uk/consumers/drinking-water-quality/index.htm|publisher=DWI|accessdate=20 March 2013}}</ref>
===United States===
====Environmental Protection Agency====
[[File:A scientist inspects a water sample. (15011059180).jpg|thumb|U.S. EPA scientist dey inspect water sample]]
Main federal laws wey control water testing be Safe Drinking Water Act (SDWA) den Clean Water Act. U.S. Environmental Protection Agency (EPA) dey set rules den test methods under dese laws.<ref>{{cite web |title=Regulatory Agendas and Regulatory Plans |url=https://www.epa.gov/laws-regulations/regulatory-agendas-and-regulatory-plans |date=2025-08-11 |publisher=U.S. Environmental Protection Agency (EPA) |location=Washington, D.C.}}</ref>
;Drinking water analysis
Under SDWA, public water systems must regularly test treated water for contaminants using EPA-approved methods. Only certified labs fit do de testing.<ref name="EPA DW methods">{{cite web |url=https://www.epa.gov/dwanalyticalmethods/learn-about-drinking-water-analytical-methods |title=Learn about Drinking Water Analytical Methods |date=2025-06-30 |publisher=EPA}}</ref> Revised Total Coliform Rule (2013) den 1989 version apply to all public water systems. Dem control microbial contamination den require reporting of Escherichia coli wen e exceed safe level.<ref>{{cite web |title=Revised Total Coliform And Total Coliform Rule |url=https://www.epa.gov/dwreginfo/revised-total-coliform-rule-and-total-coliform-rule |date=2025-02-19 |publisher=EPA}}</ref>
Acute toxicity testing fit take 24–96 hours to detect contamination.<ref name="Performance Verification Testing">{{cite web |title=Performance Verification Testing |date=6 August 2014 |url=http://water.epa.gov/infrastructure/watersecurity/upload/2004_04_01_watersecurity_fs_security_rapid-tox.pdf |publisher=EPA |archive-url=https://web.archive.org/web/20150906121916/http://water.epa.gov/infrastructure/watersecurity/upload/2004_04_01_watersecurity_fs_security_rapid-tox.pdf |archive-date=2015-09-06}}</ref>
;Wastewater analysis
All facilities wey dey discharge wastewater into rivers, lakes anaa sea must get permit under National Pollutant Discharge Elimination System (NPDES). Dem must test wastewater regularly den report results.<ref name="NPDES basics">{{cite web |url=https://www.epa.gov/npdes/npdes-permit-basics |title=NPDES Permit Basics |date=2025-06-03 |publisher=EPA}}</ref>
====Private wells====
Private wells no get federal regulation. Owners dem be responsible for testing their water. Some states fit require testing for bacteria like coliform den E. coli den other contaminants like nitrates anaa arsenic.<ref>{{cite web |url=https://www.epa.gov/privatewells |title=Private Drinking Water Wells |date=2025-08-11 |publisher=EPA}}</ref>
====Publication of test methods====
Test methods dey published by government agencies, research organizations den international bodies. Approved methods must be used for regulatory compliance.<ref>{{cite web |title=Clean Water Act Analytical Methods |url=https://www.epa.gov/cwa-methods |date=2025-09-09 |publisher=EPA}}</ref>
====Homeland security====
EPA dey responsible for water sector security under U.S. homeland security policies. Threats fit include chemical contamination anaa physical attack on water systems.<ref>{{cite web |title=Water and Wastewater Systems Sector Cybersecurity |url=https://www.epa.gov/climate-change-water-sector/water-and-wastewater-systems-sector-cybersecurity |date=2025-06-17 |publisher=EPA}}</ref>
====Regulatory challenges====
=====Hydraulic fracturing=====
Some oil den gas companies no dey fully disclose chemicals used insyd hydraulic fracturing secof legal exemptions. Dis dey raise concerns about water safety.<ref>{{cite web |title=Regulation of Hydraulic Fracturing Under the Safe Drinking Water Act |date=15 January 2013 |url=http://water.epa.gov/type/groundwater/uic/class2/hydraulicfracturing/wells_hydroreg.cfm |publisher=EPA |accessdate=20 March 2013}}</ref> Studies later link some groundwater contamination to fracking activities in some regions.<ref>{{cite web |last=Lustgarten |first=Abrahm |title=Feds Link Water Contamination to Fracking for the First Time |date=8 December 2011 |url=https://www.propublica.org/article/feds-link-water-contamination-to-fracking-for-first-time |publisher=Pro Publica}}</ref>
=====Pharmaceuticals den personal care products=====
Small traces of pharmaceuticals dey insyd drinking water, but most treatment systems no fully remove am. No strong federal limits exist yet for most of these chemicals.<ref>{{cite web|last=McNabb|first=John|title=Testimony to Oversight Hearing|url=http://www.cleanwateraction.org/files/publications/ma/testimony-drugsinwater-mcnabb.pdf|publisher=Clean Water Action}}</ref>
====International organizations====
International Maritime Organization dey handle water-related environmental issues like ballast water management to prevent spread of invasive species.<ref>{{cite web|title=About IMO|url=http://www.imo.org/|publisher=IMO}}</ref>
==Water test initiatives==
===EarthEcho Water Challenge===
EarthEcho Water Challenge be global program wey dey encourage people test local water bodies den report results like pH, temperature, turbidity den dissolved oxygen.<ref name="monitoring challenge">{{cite web |url=http://www.worldwatermonitoringday.org |title=EarthEcho Water Challenge |publisher=EarthEcho International}}</ref>
==Water test market==
===Market size and structure===
Global water testing market around 2009 worth about US$3.6 billion, wey dey include labs, instruments den monitoring systems.<ref name="Something in the water">{{cite web|title=Something in the water|url=http://www.globalwaterintel.com/archive/10/6/market-insight/something-water.html|publisher=Global Water Intelligence}}</ref>
===Product offering===
Market include analytical systems, instruments and chemical reagents used for testing water quality. Equipment include field devices den advanced lab machines like mass spectrometry, gas chromatography denand liquid chromatography systems.<ref name="Something in the water" />
===New developments===
Digital sensors and improved dissolved oxygen meters dey replace older technologies.<ref name="Water Sector Primer">{{cite web|title=Water Sector Primer|url=http://www.fullermoney.com/content/2005-07-01/IainLittleGoldmanSachsWaterPrimer61505.pdf|publisher=Goldman Sachs}}</ref>
==="Razor and Razor-blade" business model===
Companies dey make money from both equipment den consumables like reagents, which people dey use repeatedly for testing.<ref name="Water Sector Primer"/>
===Suppliers===
Major suppliers include Lovibond, Merck, LaMotte, Siemens, Hach den Thermo Scientific.<ref name="Something in the water"/>
==Water testing facilities==
Two main types of labs dey: commercial labs den in-house labs.
===In-house laboratories===
Dese dey insyd water plants, breweries den industries. Dem handle about half of all tests.<ref name="Water testing – pass or fail"/>
===Commercial laboratories===
Small private labs dey do testing for clients. Big groups also exist and handle large share of tests.<ref name="Water testing – pass or fail"/>
==References==
[[Category:Drinking water]]
[[Category:Water pollution]]
[[Category:Water chemistry]]
[[Category:Water treatment]]
9r3rrcpodukt2orhev9jlqdo0ochdpl
Onilahy River
0
27930
106503
105933
2026-07-10T19:23:45Z
DaSupremo
9
Make sum corrections
106503
wikitext
text/x-wiki
{{Databox}}
'''Onilahy''' be a river insyd Atsimo-Andrefana den Anosy (Toliara Province), southern [[Madagascar]]. E dey flow down from de hills near Betroka to de Mozambique Channel. E dey empty at St. Augustin, den into de Bay of Saint-Augustin.
Two species of cichlids be endemic to de river basin, buh ''Ptychochromis onilahy'' be probably already extinct<ref>Stiassny, M., and Sparks, J. S. (2006).</ref> den de remaining range of ''Ptychochromoides betsileanus'' dey cover less than 10 square kilometres (3.9 mi2).<ref>{{Cite report |url=https://www.iucnredlist.org/species/18832/177066640 |title=Ptychochromoides betsileanus: Ravelomanana, T. & Sparks, J.S.: The IUCN Red List of Threatened Species 2020: e.T18832A177066640 |last=IUCN |date=2016-06-28 |publisher=International Union for Conservation of Nature |doi=10.2305/IUCN.UK.2020-3.RLTS.T18832A177066640.en |language=en}}</ref><ref>{{Cite journal |last=Walaszczyk |first=I. |last2=Marcinowski |first2=R. |last3=Praszkier |first3=T. |last4=Dembicz |first4=K. |last5=Bieńkowska |first5=M. |date=August 2004 |title=Biogeographical and stratigraphical significance of the latest Turonian and Early Coniacian inoceramid/ammonite succession of the Manasoa section on the Onilahy River, south-west Madagascar |journal=Cretaceous Research |volume=25 |issue=4 |pages=543–576 |doi=10.1016/j.cretres.2004.05.001 |issn=0195-6671}}</ref>
[[File:Onilahy_Basin_OSM.png|thumb|Onilahy Basin]]
== Geography ==
Sources of de Onilahy river be near Beadabo. E dey flow thru Ankilimary, to Benenitra, Ehara, Bezaha den Antanimena. E be crossed by de RN 10 near Tameantsoa. De mouth of de Onilahy river dey situate insyd de Indian Ocean at Saint Augustin, Madagascar, 35 km south of Toliara (Tuléar).
Ein main affluentes from ein south be Sakamena river, Evasy River, Ianapera River, Isoanala river den de Ihazofotsy River. From de north dese be Sakondry, Taheza, Sakamare den de Imatoto rivers.
== References ==
<references />
== External links ==
{{Commons}}
[[Category:Rivers of Madagascar]]
[[Category:Mozambique Channel]]
[[Category:Ramsar sites insyd Madagascar]]
[[Category:Rivers of Atsimo-Andrefana]]
[[Category:Rivers of Anosy]]
h096rn694kvo1bnjm3ttuz5l8n8im1d
Karenge Drinking Water Supply System
0
27932
106504
106192
2026-07-10T19:49:51Z
DaSupremo
9
Make sum corrections
106504
wikitext
text/x-wiki
{{Databox}}
'''Karenge Drinking Water Supply System''' ('''KDWSS'''), wey dem dey call am '''Karenge Water Supply System''' too, be water intake, water treatment, den water distribution system for Rwanda. De system dey supply water give some parts of de capital city, Kigali, plus de neighboring Rwamagana District.<ref name="1R">{{cite web|work=Afrik21.africa
|url=https://www.afrik21.africa/en/rwanda-the-capacity-of-the-karenge-water-plant-will-be-tripled-with-2m-from-ofid/
|title=Rwanda: The capacity of the Karenge water plant will be tripled with $2M from OFID |date=13 November 2023 |author=Inès Magoum |access-date=16 November 2023 |location=Paris, France}}</ref>
==Location==
De water treatment den distribution facility dey for de lakeside community wey dem dey call ''Karenge'', Rwamagana District, for Eastern Province of Rwanda, for de shore of Lake Mugesera. E dey about {{convert|50|km|0}} by road southeast from Kigali, de national capital.<ref name="1R"/>
==Overview==
Dem establish KDWSS for 1975 plus processing capacity of {{convert|3840|m3|0}} every day. For 1985, dem increase de capacity go {{convert|7200|m3|0}} every day. For 2008, de daily output increase reach {{convert|12000|m3|0}}. As of October 2020, de system dey produce {{convert|15000|m3|0}} clean drinking water every day. Out of dat amount, {{convert|12000|m3|0}} (80 percent) dey go through pipeline enter Kigali, while {{convert|3000|m3|0}} (20 percent) dem dey distribute inside Rwamagana District.<ref name="2R">{{cite web|date=7 October 2020 | url=https://www.mininfra.gov.rw/updates/news-details/government-to-increase-production-capacity-of-karenge-water-treatment-plant-and-strengthen-its-distribution-network |title=Government To Increase Production Capacity off Karenge Water Treatment Plant And Strengthen Its Distribution Network |work=Rwanda Ministry of Infrastructure (Mininfra) |author=Mininfra |access-date=16 November 2023 | location=Kigali, Rwanda}}</ref>
==Expansion==
For 2020, Rwanda government, through ein subsidiary ''Water and Sanitation Corporation'' (WASAC Limited), decide say dem go increase de processing capacity of dis plant go {{convert|48000|m3|0}} every day.<ref name="1R"/><ref name="2R"/> De expansion work include:<ref name="1R"/>
* Upgrade de raw water source
* Build new raw water intake pumps
* Upgrade de raw water intake pipes
* Move de intake pumping station go new location
* Improve de capacity of de motors den pumps
* Build new drinking water storage tanks
* Expand de drinking water transport den distribution network by laying {{convert|33|km|0}} of new distribution pipes.<ref name="1R"/>
==Construction den funding==
De estimated cost for de expansion be US$164.3 million. De organizations below dey provide money for de construction.<ref name="1R"/>
{| class="wikitable sortable" style="margin: 0.5em auto"
|+ Karenge Water System Expansion Funding
! Rank !! Development Partner !! Contribution in USD !! Percentage !! Notes
|-
| 1 || OPEC Fund for International Development (OFID) ||21.0 million ||12.8 || Loan<ref name="1R"/>
|-
| 2 || Abu Dhabi Fund for Development (ADFD) || || || Loan<ref name="1R"/>
|-
| 3 || Saudi Fund for Development (SFD) || || || Loan<ref name="1R"/>
|-
| 4 || Arab Bank for Economic Development in Africa (BADEA) || || || Loan<ref name="1R"/>
|-
| 5 || Exim Bank of Hungary ||52.0 ||31.6 || Loan<ref name="4R">{{cite web| work=Construction Review Online | url=https://constructionreviewonline.com/construction-news/52-million-to-be-utilized-in-karenge-water-treatment-plant-upgrade-in-rwanda/ |title=$52 Million to be Utilized in Karenge Water Treatment Plant Upgrade in Rwanda |date=29 September 2023
|author=Mike Kubwa |access-date=16 November 2023 | location=Nairobi, Kenya}}</ref>
|-
| || '''Total''' || '''164.3 million'''|| '''100.00'''||
|-
|}
==Other considerations==
De expanded plant be part of de Rwanda authorities dema plan make 100 percent of everybody for de country get access to clean drinking water by December 2024.<ref name="1R"/><ref name="2R"/><ref name="4R"/>
==References==
[[Category:Water resources management]]
<references />
==External links==
* [https://web.archive.org/web/20250513211642/https://www.wasac.rw/home Website of WASAC Limited]
* [https://web.archive.org/web/20241202071532/https://wasac.rw/fileadmin/user_upload/karenge_water_treatment_plant.pdf Profile of Karenge Water Treatment Plant]
n0t471sxyo8z5rxrl7mgd584w8nllz5
106505
106504
2026-07-10T19:51:33Z
DaSupremo
9
Add categories
106505
wikitext
text/x-wiki
{{Databox}}
'''Karenge Drinking Water Supply System''' ('''KDWSS'''), wey dem dey call am '''Karenge Water Supply System''' too, be water intake, water treatment, den water distribution system for Rwanda. De system dey supply water give some parts of de capital city, Kigali, plus de neighboring Rwamagana District.<ref name="1R">{{cite web|work=Afrik21.africa
|url=https://www.afrik21.africa/en/rwanda-the-capacity-of-the-karenge-water-plant-will-be-tripled-with-2m-from-ofid/
|title=Rwanda: The capacity of the Karenge water plant will be tripled with $2M from OFID |date=13 November 2023 |author=Inès Magoum |access-date=16 November 2023 |location=Paris, France}}</ref>
==Location==
De water treatment den distribution facility dey for de lakeside community wey dem dey call ''Karenge'', Rwamagana District, for Eastern Province of Rwanda, for de shore of Lake Mugesera. E dey about {{convert|50|km|0}} by road southeast from Kigali, de national capital.<ref name="1R"/>
==Overview==
Dem establish KDWSS for 1975 plus processing capacity of {{convert|3840|m3|0}} every day. For 1985, dem increase de capacity go {{convert|7200|m3|0}} every day. For 2008, de daily output increase reach {{convert|12000|m3|0}}. As of October 2020, de system dey produce {{convert|15000|m3|0}} clean drinking water every day. Out of dat amount, {{convert|12000|m3|0}} (80 percent) dey go through pipeline enter Kigali, while {{convert|3000|m3|0}} (20 percent) dem dey distribute inside Rwamagana District.<ref name="2R">{{cite web|date=7 October 2020 | url=https://www.mininfra.gov.rw/updates/news-details/government-to-increase-production-capacity-of-karenge-water-treatment-plant-and-strengthen-its-distribution-network |title=Government To Increase Production Capacity off Karenge Water Treatment Plant And Strengthen Its Distribution Network |work=Rwanda Ministry of Infrastructure (Mininfra) |author=Mininfra |access-date=16 November 2023 | location=Kigali, Rwanda}}</ref>
==Expansion==
For 2020, Rwanda government, through ein subsidiary ''Water and Sanitation Corporation'' (WASAC Limited), decide say dem go increase de processing capacity of dis plant go {{convert|48000|m3|0}} every day.<ref name="1R"/><ref name="2R"/> De expansion work include:<ref name="1R"/>
* Upgrade de raw water source
* Build new raw water intake pumps
* Upgrade de raw water intake pipes
* Move de intake pumping station go new location
* Improve de capacity of de motors den pumps
* Build new drinking water storage tanks
* Expand de drinking water transport den distribution network by laying {{convert|33|km|0}} of new distribution pipes.<ref name="1R"/>
==Construction den funding==
De estimated cost for de expansion be US$164.3 million. De organizations below dey provide money for de construction.<ref name="1R"/>
{| class="wikitable sortable" style="margin: 0.5em auto"
|+ Karenge Water System Expansion Funding
! Rank !! Development Partner !! Contribution in USD !! Percentage !! Notes
|-
| 1 || OPEC Fund for International Development (OFID) ||21.0 million ||12.8 || Loan<ref name="1R"/>
|-
| 2 || Abu Dhabi Fund for Development (ADFD) || || || Loan<ref name="1R"/>
|-
| 3 || Saudi Fund for Development (SFD) || || || Loan<ref name="1R"/>
|-
| 4 || Arab Bank for Economic Development in Africa (BADEA) || || || Loan<ref name="1R"/>
|-
| 5 || Exim Bank of Hungary ||52.0 ||31.6 || Loan<ref name="4R">{{cite web| work=Construction Review Online | url=https://constructionreviewonline.com/construction-news/52-million-to-be-utilized-in-karenge-water-treatment-plant-upgrade-in-rwanda/ |title=$52 Million to be Utilized in Karenge Water Treatment Plant Upgrade in Rwanda |date=29 September 2023
|author=Mike Kubwa |access-date=16 November 2023 | location=Nairobi, Kenya}}</ref>
|-
| || '''Total''' || '''164.3 million'''|| '''100.00'''||
|-
|}
==Other considerations==
De expanded plant be part of de Rwanda authorities dema plan make 100 percent of everybody for de country get access to clean drinking water by December 2024.<ref name="1R"/><ref name="2R"/><ref name="4R"/>
==References==
<references />
==External links==
* [https://web.archive.org/web/20250513211642/https://www.wasac.rw/home Website of WASAC Limited]
* [https://web.archive.org/web/20241202071532/https://wasac.rw/fileadmin/user_upload/karenge_water_treatment_plant.pdf Profile of Karenge Water Treatment Plant]
[[Category:1975 establishments insyd Rwanda]]
[[Category:Buildings den structures insyd Rwanda]]
[[Category:Eastern Province, Rwanda]]
[[Category:Water resources management]]
nma669jasbgahmqa03jk5yjtkgreiqy
Bethanie Desalination Plant
0
27933
106511
105986
2026-07-10T20:16:53Z
DaSupremo
9
Make sum corrections
106511
wikitext
text/x-wiki
{{Databox}}
'''Bethanie Desalination Plant''', wey dem dey call am '''Bethany Desalination Plant''' too, be brackish water desalination plant wey dey Bethanie town for southern Namibia. Namibia Water Corporation (NamWater) own am den dem build am. De clean drinking water wey dis plant dey produce, plus e capacity of {{convert|487|m3|liter}} per day, go fit supply Bethanie town till 2037.<ref name="1R">{{cite web| url=https://www.afrik21.africa/en/namibia-desalination-plant-supplies-water-to-the-people-of-bethany/ |url-access=subscription |title=Namibia: Desalination plant supplies water to the people of Bethany | work=Afrik21.africa |date=12 August 2022 |author=Inès Magoum | access-date=15 August 2022 |location=Paris, France}}</ref>
==Location==
De desalination plant dey Bethanie town for ǁKaras Region of Namibia. Bethanie dey about {{convert|140|km|0}} west of Keetmanshoop, wey be de capital of ǁKaras Region.<ref name="1R"/><ref>{{Cite web |date=15 August 2022 |title=Road Distance Between Keetmanshoop, Namibia And Bethanie, Namibia (Map) |url=https://www.google.com/maps/dir/Bethanien,+Namibia/Keetmanshoop,+Namibia/@-26.5455978,17.4605607,10z/data=!4m14!4m13!1m5!1m1!1s0x1c14f3302cf4817f:0x20f7dffa494a2cfb!2m2!1d17.1514061!2d-26.5090889!1m5!1m1!1s0x1c16835d6f27aa79:0xa253f1bc79e8f4ba!2m2!1d18.1310083!2d-26.5642351!3e0 |access-date=2026-07-10 |website=Google Maps |language=en}}</ref> Bethanie dey about {{convert|535|km|0}} south of Windhoek, wey be de capital den de biggest city for de country.<ref>{{Cite web |date=15 August 2022 |title=Road Distance Between Bethanie, Namibia And Windhoek, Namibia (Map) |url=https://www.google.com/maps/dir/Bethanien,+Namibia/Windhoek,+Namibia/@-25.3031376,19.1605852,4.75z/data=!4m14!4m13!1m5!1m1!1s0x1c14f3302cf4817f:0x20f7dffa494a2cfb!2m2!1d17.1514061!2d-26.5090889!1m5!1m1!1s0x1c0b1b5cb30c01ed:0xe4b84940cc445d3b!2m2!1d17.0657549!2d-22.5608807!3e0 |access-date=2026-07-10 |website=Google Maps |language=en}}</ref>
==Overview==
De main aim of dis project be make e improve de amount den quality of drinking water wey people for Bethanie fit get. Dem develop am as [[pilot project]] make dem test whether e go possible to desalinate brackish [[ground water]] for house use den small commercial use. Dis one be part of Namibia government ein effort to increase water supply for de people from 85 percent for 2022 reach 100 percent.<ref name="4R">{{cite web| url=https://www.namibian.com.na/114344/read/Desalination-plant-opened-at-Bethanie |title=Desalination plant opened at Bethanie | work=[[The Namibian]] |date=18 July 2022 |author=Matthew Dlamini |access-date=15 August 2022 |location=Windhoek, Namibia}}</ref><ref name="5R">{{cite news| newspaper=[[Namibia Economist]] | url=https://economist.com.na/71900/agriculture/bethanie-village-to-get-clean-accessible-water-as-hybrid-renewable-energy-powered-desalination-plant-commisioned/ |title=Clean Accessible Water For Bethanie From Hybrid-Power Desalination Plant |date=15 July 2022 | location=Windhoek, Namibia}}</ref> Namibia set target say by 2030, 100 percent of di citizens den residents go get clean drinking water.<ref name="6R">{{cite web| work=Afrik21.africa | url=https://www.afrik21.africa/en/namibia-3-mini-desalination-plants-for-irrigation-in-daures/ |title=Namibia: 3 mini desalination plants for irrigation in Daures |date=16 September 2022 |author=Benoit-Ivan Wansi |access-date=17 September 2022 | location=Paris, France}}</ref>
De plant dey process raw brackish ground water thru desalination equipment wey include reverse osmosis membranes. Secof de place dey rural area, dem choose renewable energy sources. Dem install solar panels so say sunlight go provide de power wey de desalination process need.<ref name="1R"/><ref name="5R"/>
==Development==
Plenty national den international stakeholders work together design, build den fund dis desalination plant. De table below show de organisations wey support de project.<ref name="1R"/>
{| class="wikitable sortable" style="margin: 0.5em auto"
|+ Stakeholders for Bethanie Desalination Plant development
! Rank !! Member !! Domicile !! !! Notes
|-
| 1 ||NamWater || Namibia || National water parastatal utility company. Owner/operator. ||<ref name="1R"/>
|-
| 2 || Desert Research Foundation of Namibia || Namibia || National research institution ||<ref name="1R"/>
|-
| 3 || Adaptation Fund || United States || International climate change organisation ||<ref name="1R"/>
|-
| 4 || Namibian Ministry of Environment, Forestry and Tourism || Namibia || Namibian Government Ministry ||<ref name="1R"/>
|-
|}
De Multilateral Environmental Agreements Division of de Namibian Ministry of Environment, Forestry and Tourism be one of de stakeholders wey support de development of dis plant.<ref name="1R"/>
==Funding den timeline==
According to reports, de construction cost N$37 million (about US$2.3 million). De stakeholders wey dey de previous section fund am. Construction happen between "October 2020 den October 2021", then dem officially start commercial operation for July 2022.<ref name="1R"/><ref name="4R"/><ref name="5R"/>
==References==
<references />
==External links==
* [https://www.adaptation-fund.org/project/pilot-rural-desalination-plants-using-renewable/ Pilot rural desalination plants using renewable power and membrane technology]
[[Category:Buildings den structures insyd de ǁKharas Region]]
[[Category:2022 establishments insyd Namibia]]
[[Category:Infrastructure insyd Namibia]]
[[Category:Infrastructure dem plete insyd 2022]]
[[Category:Water resources management]]
59rkf9oe9qa3s2lpvrzftt4ex4bzo1s
Witsand Solar Desalination Plant
0
27934
106516
105989
2026-07-10T20:26:31Z
DaSupremo
9
Make sum corrections
106516
wikitext
text/x-wiki
{{Databox}}
'''Witsand Solar Desalination Plant''' ('''WSDP''') be solar-powered desalination plant wey dey seaside town of Witsand, Hessequa Municipality, Western Cape Province, for mouth of Breede River.<ref name="2R">{{cite web |author=Melanie Gosling |date=18 July 2018 |title=Revolutionary Solar-Power Desalination Plant Could Provide Cheaper Option, but It Needs Space |url=https://www.news24.com/Green/News/revolutionary-solar-power-desalination-plant-could-provide-cheaper-option-but-it-needs-space-20180718 |access-date=23 July 2018 |publisher=News24Wire.com |location=Cape Town}}</ref>
==Overview==
Witsand be tourist place, plus e get around 300 people wey dey live there during low tourist season. During tourist high season, de population fit pass 3,000 people, wey dey cause shortage of fresh water for de town. Western Cape Government help sponsor de plant through dema drought relief fund, plus French Treasury too support am through one fund wey dem set up to help implement innovative green technologies.<ref name="official launch">{{Cite web |title=Official launch of first Solar Desalination Plant in SA – Hessequa Municipality |url=https://www.hessequa.gov.za/official-launch-of-first-solar-desalination-plant-in-sa/ |access-date=2025-04-03 |website=www.hessequa.gov.za}}</ref>
==Technology==
WSDP be de first solar-powered desalination plant for South Africa. De new technology wey dem use make am possible say dem no need storage batteries insyd de design again.<ref name="3R">{{cite web |last=Ensor |first=Linda |date=16 July 2018 |title=France to help drought-hit Witsand with solar-power desalination plant |url=https://www.businesslive.co.za/bd/national/2018-07-16-france-to-help-drought-hit-witsand-with-solar-power-desalination-plant/ |access-date=23 July 2018 |publisher=Business Day (South Africa)}}</ref> French company Mascara Renewable Water develop de OSMOSUN® technology, den dema local partner TWS-Turnkey Water Solutions bring am come South Africa.<ref name="official launch" />
De plant ein new Osmosun technology dey use one special "intelligent" membrane wey fit continue dey do reverse osmosis even when cloud cover de sun, so de reduction for solar energy no go stop de system from working. When de clouds move comot, de solar energy go increase again.
Dis ability to reduce de effect of changes for de energy wey dey come help protect de reverse osmosis membrane. For night time, wen sun no dey, de design allow de plant make e switch go normal grid electricity den continue dey work till de next morning wen de sun rise.<ref name="2R"/>
==Construction den cost==
De project cost R9 million (US$605,000), wey e start full operation from 20 December 2018.<ref name="1R">{{Cite web |last=Ferreira |first=Emsie |title=France co-funds R8.6m desalination plant in Western Cape |url=https://www.iol.co.za/news/south-africa/western-cape/france-co-funds-r86m-desalination-plant-in-western-cape-16055049 |access-date=2025-04-03 |website=www.iol.co.za |language=en}}</ref><ref>{{Cite web |title=AFRICA’S FIRST SOLAR POWERED DESALINATION PLANT PASSES THE 10,000,000 Liters MARK – Invest {{!}} Wesgro |url=https://www.wesgro.co.za/invest/news/2019/africas-first-solar-powered-desalination-plant-passes-the-10-000-000-liters-mark |access-date=2025-04-03 |website=www.wesgro.co.za |language=en}}</ref>
De cost to produce purified water for dis plant dey between R7 den R8 (US$0.52 to US$0.60) for every {{convert|1000|liters|0}}. If dem compare am to de temporary diesel-powered desalination plant for Strandfontein, Cape Town, dem dey produce drinking water for R35 to R40 (US$2.62 to US$3.00) for every 1,000 liters.<ref name="2R" />
==Challenges==
Secof electricity cost too high for de operation of de plant, dem go only operate am during crisis periods den holiday seasons.<ref>{{Cite web |title=WITSAND DESALINATION PLANT – Hessequa Municipality |url=https://www.hessequa.gov.za/witsand-desalination-plant/ |access-date=2025-04-03 |website=www.hessequa.gov.za}}</ref>
==References==
<references />
==External links==
*[https://www.news24.com/SouthAfrica/water_crisis Special Report: Water Crisis] As at 23 July 2018.
{{DEFAULTSORT:Witsand Solar Desalination Plant}}
[[Category:Buildings den structures insyd South Africa]]
[[Category:Water resources management]]
[[Category:2018 establishments insyd South Africa]]
[[Category:Economy of de Western Cape]]
[[Category:Garden Route District Municipality]]
nr1gxqi19800cc5tce265w4shvk3dg5
Erongo Desalination Plant
0
27935
106525
106190
2026-07-11T10:26:08Z
DaSupremo
9
Make sum corrections
106525
wikitext
text/x-wiki
{{Databox}}
De '''Erongo Desalination Plant''', wey dem dey call am '''Orano Desalination Plant''' too, be seawater desalination plant wey dey Namibia. Dem build de facility between 2008 den 2010 by Orano Mining Namibia, wey be part of de French nuclear fuel cycle company Orano. For dat time, dem dey call am Areva Ressources Namibia, wey be part of Areva.
Dem build de desalination plant make e supply water give Orano ein Trekkopje Uranium Mine. Wen dem officially open dis plant, e be de biggest reverse osmosis desalination plant for Southern Africa.<ref name="1R">{{cite web|work=[[Namibia Economist]] |date=3 June 2020 |url=https://economist.com.na/53372/environment/erongo-desalination-plant-provides-55-million-cubic-meters-potable-water-to-the-region-during-10-year-operation-period/ | title=Erongo Desalination Plant Provided 55 Million Cubic Meters Potable Water To The Region During 10-Year Operation Period | author=Donald Matthys |access-date=21 August 2021 | place=Windhoek, Namibia}}</ref><ref name="2R">{{cite web| url=https://www.afrik21.africa/en/namibia-towards-the-construction-of-a-new-desalination-plant-in-the-coastal-zone/ | title=Namibia: Towards the construction of a new desalination plant in the coastal zone |work=Afrik21.africa |date=14 June 2021 |author=Inès Magoum |access-date=21 August 2021 |place=Paris, France}}</ref>
==Location==
De desalination plant dey inside Namib Desert, near de town of Wlotzkasbaken, for Erongo Region of Namibia. De plant dey about {{convert|35|km|0}} north of Swakopmund, wey be de nearest big town.<ref name="1R"/> Swakopmund sef dey about {{convert|391|km|0}} by road west of Windhoek, de capital den biggest city for de country.<ref>{{Cite web |date=21 August 2021 |title=Road Distance Between Windhoek, Namibia And Wlotzkasbaken, Namibia With Interactive Map |url=https://www.google.com/maps/dir/Windhoek,+Namibia/Wlotzkasbaken,+Namibia/@-22.5992371,15.9665902,7.75z/data=!4m14!4m13!1m5!1m1!1s0x1c0b1b5cb30c01ed:0xe4b84940cc445d3b!2m2!1d17.0657549!2d-22.5608807!1m5!1m1!1s0x1c764892b69b457f:0xcff2f660ca943074!2m2!1d14.4504954!2d-22.4086945!3e0 |access-date=2026-07-11 |website=Google Maps |language=en}}</ref> De geographical coordinates of Erongo Desalination Plant be 22°22'19.0"S, 14°26'28.0"E (Latitude:-22.371944; Longitude:14.441111).<ref>{{Cite web |date=21 August 2021 |title=Location of Erongo Desalination Plant (Map) |url=https://www.google.com/maps/place/22%C2%B022'19.0%22S+14%C2%B026'28.0%22E/@-22.372892,14.440059,696m/data=!3m1!1e3!4m5!3m4!1s0x0:0x0!8m2!3d-22.3719444!4d14.4411111 |access-date=2026-07-11 |website=Google Maps |language=en}}</ref>
==Overview==
Orano Resources Namibia (wey before dem dey call Areva Resources Namibia) develop den own de Erongo Desalination Plant. De purified drinking water dem mainly plan am make e serve Orano ein uranium mine wey dem dey call Trekkopje Mine, wey dey near Arandis, Namibia.<ref name="5R">{{cite web|url=https://www.namibian.com.na/196085/archive-read/Desalination-plant-output-hits-record-high |date=5 December 2019 |title=Desalination plant output hits record high
|work=[[The Namibian]] |access-date=21 August 2021 |author=Adam Hartman |location=Windhoek, Namibia}}</ref> Dem dey pump de clean water from de plant go Arandis, wey straight-line distance be about {{convert|60|km|0}} den road distance be about {{convert|90|km|0}}.<ref>{{Cite web |date=21 August 2021 |title=Road Distance Between Wlotzkasbaken, Namibia And Arandis, Namibia With Map (Map) |url=https://www.google.com/maps/dir/Wlotzkasbaken,+Namibia/Arandis,+Namibia/@-22.5350506,14.4414523,10z/data=!3m1!4b1!4m14!4m13!1m5!1m1!1s0x1c764892b69b457f:0xcff2f660ca943074!2m2!1d14.4504954!2d-22.4086945!1m5!1m1!1s0x1c7676f1577c6dd1:0x5cffbd871e885c5c!2m2!1d14.9797753!2d-22.4193386!3e0 |access-date=2026-07-11 |website=Google Maps |language=en}}</ref> Nafasi Water, wey be "water technology and water utility service company" wey base for Rosebank, Gauteng, South Africa, dem wey dey operate de plant.<ref name="1R"/>
Dem dey sell de potable water give NamWater, de national water utility company, make dem distribute am go Swakopmund, de nearby mines den oda places for Erongo Region. De present infrastructure fit produce between {{convert|12000000|m3|liter}} den {{convert|26000000|m3|liter}} every year depending on demand. If demand increase, dem fit add new infrastructure make de supply reach {{convert|45000000|m3|liter}} every year.<ref name="1R"/><ref name="5R"/>
De raw seawater dey pass through dis processes before e go become clean water: (a) screen filtration (b) ultrafiltration (c) reverse osmosis (d) limestone contact den (e) chlorination.<ref name="5R"/>
==Cost==
E cost N$2.5 billion (about US$153 million) for 2010 to develop dis water treatment plant.<ref name="1R"/><ref name="7R"/>
==Oda developments==
For July 2022, de owners of dis facility sign power purchase agreement (PPA) plus InnoSun (wey be subsidiary of de French company InnoVent) make dem design, build, own, operate den maintain one 5 MW solar power station den supply dat power give Erongo Desalination Plant under one 10-year contract, wey go start from de commercial commissioning date. Dem expect construction to start for de second half of 2022, wey make dem commission am for 2023. Orano expect say de new solar farm go reduce de desalination plant ein carbon dioxide emissions by 30 percent anaa nearly 10,000 metric tonnes every year.<ref name="7R">{{cite web| date=5 July 2022 |url=https://www.afrik21.africa/en/namibia-orano-to-equip-its-erongo-desalination-plant-with-a-5-mwp-solar-park/ | title=Namibia: Orano to equip its Erongo desalination plant with a 5 MWp solar park |work=Afrik21.africa |author=Jean Marie Takouleu |access-date=5 July 2022 |location=Paris, France}}</ref>
==Sanso spy==
* [[Witsand Solar Desalination Plant]]
* [[Namwater Desalination Plant]]
* [[Bethanie Desalination Plant]]
==References==
<references />
==External links==
* [https://web.archive.org/web/20210821211619/https://www.namibian.com.na/200986/archive-read/Orano-gives-Erongo-desalinated-water Orano gives Erongo desalinated water] As of 18 May 2020.
[[Category:Buildings den structures insyd Erongo Region]]
[[Category:Water resources management]]
[[Category:2010 establishments insyd Namibia]]
[[Category:Mining insyd Namibia]]
[[Category:Infrastructure insyd Namibia]]
6xibv9e3pc1gczo29ept5z0720t89v2
Namwater Desalination Plant
0
27936
106521
105991
2026-07-11T09:47:01Z
DaSupremo
9
Make sum corrections
106521
wikitext
text/x-wiki
{{Databox}}
De '''Namwater Desalination Plant''' be one sea water desalination plant wey dem dey develop for Namibia. Namwater, de national water utility parastatal company for Namibia, dey develop de facility. Dem plan am make e help solve de serious water scarcity problem for central coastal area of Namibia, insyd de Erongo Region, plus de capital city, Windhoek.<ref name="1R">{{cite web| work=[[Xinhua News Agency]] |author=Huaxia | url=https://english.news.cn/20240626/8fa72ba7ab4f487fa6404b9a2c4b8b3f/c.html |title=Namibia to construct new desalination plant to meet rising water demand |date=26 June 2024 |access-date=28 June 2024 |location=Beijing, China}}</ref><ref name="2R">{{cite web| work=[[New Era (Namibia)]] |url=https://neweralive.na/posts/second-desalination-plant-coming |title=Second Desalination Plant Coming |date=16 April 2024 |author=Eveline de Klerk |access-date=28 June 2024 |location=Windhoek, Namibia}}</ref>
==Location==
De desalination plant go dey for Namib Desert, near de town of Wlotzkasbaken, for Erongo Region of Namibia. Dis new plant go dey side by side plus de privately owned Erongo Desalination Plant, wey dem officially start commercial operation for 2010. De land wey go host de new plant be Erongo Regional Council donate am give Namwater.<ref name="3R">{{cite web| work=[[The Namibian]] | url=https://www.namibian.com.na/govt-gets-land-for-coastal-desalination-plant-namwater/ |title=Government Gets Land For Coastal Desalination Plant – NamWater |date=31 May 2023
|author=Andreas Thomas |access-date=28 June 2024 |location=Windhoek, Namibia}}</ref>
Wlotzkasbaken dey about {{convert|35|km|0}} north of Swakopmund, de nearest big town, den about {{convert|390|km|0}} by road west of Windhoek, de national capital den biggest city for de country.<ref>{{Cite web |date=28 June 2024 |title=Road Distance Between Windhoek, Namibia And Wlotzkasbaken, Namibia (Map) |url=https://www.google.com/maps/dir/Windhoek,+Namibia/Wlotzkasbaken,+Namibia/@-22.418532,15.966196,8z/data=!4m13!4m12!1m5!1m1!1s0x1c0b1b5cb30c01ed:0xe4b84940cc445d3b!2m2!1d17.0842147!2d-22.5649344!1m5!1m1!1s0x1c764892b69b457f:0xcff2f660ca943074!2m2!1d14.4504954!2d-22.4086945?entry=ttu |access-date=11 July 2026 |website=Google Maps}}</ref>
==Overview==
Namibia be dry country wey dey face serious water shortage.<ref name="5R">{{cite web|url=https://english.news.cn/africa/20240301/42cae2ca368a43ba9fbd1fb2b3b5a2c0/c.html |title=Namibia Approves Urgent Measures To Combat Looming Water Crisis |work=[[Xinhua News Agency]] |date=1 March 2024 |author=Huaxia |access-date=28 June 2024 |location=Beijing, China}}</ref> As of 2024, Erongo Region dey get ein drinking water from (a) groundwater aquifers from de ''Omaruru Delta'', (b) de ''Kuiseb Delta'', den (c) desalinated water from de Erongo Desalination Plant. Dem connect all dis water sources thru one network of pumping stations, pipelines den reservoirs.<ref name="1R"/><ref name="AppR">{{cite web| url=https://economist.com.na/89020/agriculture/government-approves-construction-of-second-desalination-plant/ |title=Government Approves Construction of Second Desalination Plant |date=27 June 2024 |work=[[Namibia Economist]] |author=Namibia Economist
|access-date=24 July 2024 |location=Windhoek, Namibia}}</ref>
But secof town population dey increase, mining activities dey increase, agricultural production dey increase den industries too dey demand more water, all de three water sources almost reach dia maximum capacity. Together dem dey provide just under {{convert|30000000|m3|liter}} of [[potable water]] every year.<ref name="5R"/><ref name="AppR"/>
Secof dat, for 2024, de government of Namibia approve make dem build one new modular desalination plant wey go produce {{convert|20000000|m3|liter}} of potable water every year as de first phase. Dem fit increase de capacity later anytime e become necessary.<ref name="1R"/><ref name="5R"/><ref name="AppR"/>
==Developers==
De national water utility [[parastatal]], Namwater, be de owner den main developer of dis project. De Chinese-owned ''Swakop Uranium Mine'' dey collaborate plus Namwater on de project. Dem dey plan dis development since 1998.<ref name="3R"/><ref name="5R"/> Dem update de plans for 2016 after de government reject offer to buy de privately owned Erongo Desalination Plant for NAD3 billion (about US$164 million for 2024 value).<ref name="3R"/><ref name="5R"/> De matter cam be more serious secof de severe drought wey dey affect countries for Southern Africa, wey dey include Namibia, during de third decade of de 21st century (2021–2030).<ref name="6R">{{cite web| date=22 April 2024
|url=https://earthobservatory.nasa.gov/images/152711/severe-drought-in-southern-africa | work=[[NASA Earth Observatory]] |title=Severe Drought in Southern Africa |author=NASA Earth Observatory | access-date=28 June 2024 |location=United States}}</ref>
==Cost==
Dem estimate say de development of dis water treatment plant go cost N$3.5 billion (about US$191 million) for 2024.<ref name="2R"/>
* Note: US$1.00 = NAD18.34 on 28 June 2024.
==Timetable==
Construction suppose start for Q1 2025, wey dem plan make de plant begin commercial operation for H1 2027.<ref name="2R"/><ref name="8R">{{cite web| work=[[The Namibian]] | url=https://www.namibian.com.na/desalination-plant-construction-set-for-january/ | title=Desalination plant construction set for January |date=6 August 2024
|author=Shania Lazarus |access-date=6 August 2024 |location=Windhoek, Namibia}}</ref>
==Sanso spy==
* [[Desalination]]
* [[Erongo Desalination Plant]]
* [[Bethanie Desalination Plant]]
==References==
<references />
==External links==
* [https://www.namwater.com.na/ Website of Namwater Limited]
[[Category:Buildings den structures insyd Erongo Region]]
[[Category:2020s establishments insyd Namibia]]
[[Category:Mining insyd Namibia]]
[[Category:Infrastructure insyd Namibia]]
[[Category:Water resources management]]
rvqtjcaqp6lozs4wtfx6hp14lyc30rm
Mbezi River
0
27978
106498
106107
2026-07-10T17:30:07Z
DaSupremo
9
Improve article
106498
wikitext
text/x-wiki
{{Databox}}
'''Mbezi River''' (''Mto Mbezi'' insyd Swahili) be located insyd de Dar es Salaam Region of Tanzania. E dey begin insyd Kwembe ward insyd Ubungo MC den eventually dey drain into Zanzibar Channel at Kawe ward of Kinondoni MC. Several neighborhoods den two wards be named give de river.<ref>Justin, Mhina Given, et al. "Mapping the gap of water and erosion control measures in the rapidly urbanizing Mbezi river catchment of Dar es Salaam." Water 10.1 (2018): 64.</ref><ref>Mhina, G. J., et al. "Suitability of storm water runoff for water supply in fast urbanizing cities: The case of Mbezi River catchment in Dar es Salaam City, Tanzania." Journal of Building and Land Development 21.1 (2020): 1–13.</ref>
== Threats ==
=== Metal contamination ===
Like all de rivers insyd de city, de Mbezi River face environmental degradation over decades. Geo-accumulation index, contamination factor, degree of contamination, modified degree of contamination, potential contamination index, den environmental toxicity quotient all dem indicate say sediments from Dar ein rivers be polluted, plus Msimbazi den Kizinga river sediments be more polluted. Dis be true even though enrichment factor dey indicate varying contamination status of heavy metals insyd rivers.
Metal contamination levels for Cd, Pb, Cr, Ni, Cu, Al, Mn, Fe, den Zn be assessed dey use sediments from de Kizinga, Mbezi, Msimbazi, den Mzinga coastal rivers. Na dem find chaw of de higher concentrations of Cd, Pb, Cr, Al, Mn, Fe, den Zn insyd de Msimbazi River. While na dem find higher Ni den Cu concentrations insyd de Kizinga River, higher Mn concentrations be found insyd de Mbezi River. Except for Mn, Mzinga River get de lowest amounts of most metals. Mn concentrations be lowest insyd de Kizinga River.<ref>Mihale, Matobola J. "Metal contamination in sediments of coastal rivers around Dar es Salaam, Tanzania." Huria: Journal of the Open University of Tanzania 27.2 (2021).</ref>
=== Erosion ===
Residents of de historic hamlet wey dey live insyd de river plain near de outlet insyd de informal settlement of Ukwamani. De area be declared a flood danger zone by de government, den habitation anaa construction be outlawed der. De authorities begin dey relocate de citizens; owners be given compensation, buh de majority reject de transfer. Dis region ein river dey serve as a garbage disposal site, agriculture, den backyard. De most abrupt event among river behaviors, unexpected [[Flood|floods]] frequently dey affect de residents of Ukwamani.<ref>{{Cite web |title=When the River Crosses a City: Dar es Salaam and the Mbezi |url=https://chartercitiesinstitute.org/blog-posts/when-the-river-crosses-a-city-dar-es-salaam-and-the-mbezi/ |access-date=4 August 2023}}</ref>
=== Quarry mining ===
De middle den lower reaches of de river be home to seasonal sand miners. Sand be removed from de dried riverbed wey dem sell as de primary ingredient insyd brickmaking. Although mining be a lucrative river-related industry, na e be made illegal to safeguard de banks. De practice ein outlawry result in de establishment of criminal enterprises wey now run de industry.<ref>{{Cite web |title=When the River Crosses a City: Dar es Salaam and the Mbezi |url=https://chartercitiesinstitute.org/blog-posts/when-the-river-crosses-a-city-dar-es-salaam-and-the-mbezi/ |access-date=4 August 2023}}</ref>
== References ==
<references />
[[Category:Rivers of Kilimanjaro Region]]
[[Category:Rivers of Tanzania]]
810gab6v33qwism10nr63o1yzvyk9y3
Category:Greenhouse gas emissions
14
28130
106500
2026-07-10T18:53:15Z
DaSupremo
9
Fresh category
106500
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:Water chemistry
14
28131
106501
2026-07-10T18:53:37Z
DaSupremo
9
Fresh category
106501
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:Buildings den structures insyd Rwanda
14
28132
106506
2026-07-10T19:52:00Z
DaSupremo
9
Fresh category
106506
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:1975 establishments insyd Rwanda
14
28133
106507
2026-07-10T19:52:08Z
DaSupremo
9
Fresh category
106507
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:Eastern Province, Rwanda
14
28134
106508
2026-07-10T19:52:21Z
DaSupremo
9
Fresh category
106508
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Template:Delete
10
28135
106509
2026-07-10T19:58:44Z
Icodense
2720
+ speedy deletion template
106509
wikitext
text/x-wiki
<div name="Deletion notice" class="boilerplate metadata" id="delete" style="background-color: #fee; margin: 0 1em; padding: 0 10px; border: 1px solid #aaa;">
'''This {{{2|page}}} is a [[:Category:Candidates for speedy deletion|candidate for speedy deletion]].'''
The reason is: "''{{{1|no reason given}}}''"
If you disagree with its speedy deletion, please explain why on this page.
<!--
If this page obviously does not meet the criteria for speedy deletion, or you intend to fix it, please remove this notice, but do not remove this notice from pages that you have created yourself.
Make sure no other pages [[Special:Whatlinkshere/{{FULLPAGENAME}}|link here]] and check the page's [{{fullurl:{{FULLPAGENAME}}|action=history}} history] before deleting.
-->
</div>
<includeonly>[[Category:Candidates for speedy deletion]]</includeonly><noinclude>
Usage:
<code><nowiki>{{Delete|Spam}}</nowiki></code> gives <code>Spam</code> as reason.
<code><nowiki>{{Delete|Spam|category}}</nowiki></code> gives the same reason, but the first sentence will be: “This category is a candidate for speedy deletion.”
</noinclude>
4i76k2ho9i7noa8pdoev7r8g06qgn2i
Category:Candidates for speedy deletion
14
28136
106510
2026-07-10T19:59:24Z
Icodense
2720
for connection to wikidata, feel free to translate
106510
wikitext
text/x-wiki
* Pages marked with [[Template:Delete|<nowiki>{{delete}}</nowiki>]] will be listed here. (Please feel free to translate to the local language if you wish)
06uzdcyte4xbn3vwk7wvvavb8kismy8
Category:Buildings den structures insyd de ǁKharas Region
14
28137
106512
2026-07-10T20:17:29Z
DaSupremo
9
Fresh category
106512
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:2022 establishments insyd Namibia
14
28138
106513
2026-07-10T20:17:45Z
DaSupremo
9
Fresh category
106513
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:Infrastructure insyd Namibia
14
28139
106514
2026-07-10T20:17:58Z
DaSupremo
9
Fresh category
106514
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:Infrastructure dem plete insyd 2022
14
28140
106515
2026-07-10T20:18:21Z
DaSupremo
9
Fresh category
106515
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:Economy of de Western Cape
14
28141
106517
2026-07-10T20:27:30Z
DaSupremo
9
Fresh category
106517
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:Buildings den structures insyd South Africa
14
28142
106518
2026-07-10T20:27:39Z
DaSupremo
9
Fresh category
106518
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:2018 establishments insyd South Africa
14
28143
106519
2026-07-10T20:27:49Z
DaSupremo
9
Fresh category
106519
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:Garden Route District Municipality
14
28144
106520
2026-07-10T20:28:09Z
DaSupremo
9
Fresh category
106520
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:Buildings den structures insyd Erongo Region
14
28145
106522
2026-07-11T09:52:08Z
DaSupremo
9
Fresh category
106522
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:2020s establishments insyd Namibia
14
28146
106523
2026-07-11T09:52:17Z
DaSupremo
9
Fresh category
106523
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:Mining insyd Namibia
14
28147
106524
2026-07-11T09:52:29Z
DaSupremo
9
Fresh category
106524
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
Category:2010 establishments insyd Namibia
14
28148
106526
2026-07-11T10:36:19Z
DaSupremo
9
Fresh category
106526
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1