From 5116c6ad8c461016721ce0c6a2cc6528f2d4581e Mon Sep 17 00:00:00 2001 From: Jonathan Harker Date: Sun, 20 Sep 2026 11:19:27 +1200 Subject: [PATCH] Add template expansion for expression of concern notices --- module_citeq.lua | 28 +++++++++++++++++++++++++++- module_citeq_config.lua | 2 ++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/module_citeq.lua b/module_citeq.lua index 3c3530c..3b56a27 100644 --- a/module_citeq.lua +++ b/module_citeq.lua @@ -835,6 +835,32 @@ local function _cite_q (citeq_args) citeq_args.erratum = nil citeq_args['erratum-checked'] = nil + -- Indicator if item has an expression of concern notice (P14891) + local eoc = "" + if citeq_args['expression-of-concern'] then + opt_cat = opt_cat .. cfg.i18n_t.trackingcats['expression-of-concern'] + local eoc_params = { + citeq = 'yes', + id = frame:expandTemplate{ + title = 'QID', args = {qid = string.gsub(citeq_args['expression-of-concern'], 'Q', '')} + } + } + eoc_params.doi = getValue({"P356", ps = 1, qid = citeq_args['expression-of-concern']}) or nil + eoc_params.doi = eoc_params.doi and eoc_params.doi:lower() or nil + eoc_params.bibcode = getValue({"P819", ps = 1, qid = citeq_args['expression-of-concern']}) or nil + eoc_params.pmc = getValue({"P932", ps = 1, qid = citeq_args['expression-of-concern']}) or nil + eoc_params.pmid = getValue({"P698", ps = 1, qid = citeq_args['expression-of-concern']}) or nil + -- check qualifiers for access=free + eoc_params['doi-access'] = getIdentifierAccess(citeq_args['expression-of-concern'], eoc_params, 'doi') + eoc_params['bibcode-access'] = getIdentifierAccess(citeq_args['expression-of-concern'], eoc_params, 'bibcode') + if 'yes' == citeq_args['eoc-intentional'] then + eoc_params.intentional = 'yes' + end + eoc = ' ' .. frame:expandTemplate{ title = "Expression of concern", args = eoc_params } + end + citeq_args['expression-of-concern'] = nil + citeq_args['eoc-intentional'] = nil + if citeq_args.replaced_by then opt_cat = opt_cat .. cfg.i18n_t.trackingcats.replaced citeq_args.replaced_by = nil @@ -860,7 +886,7 @@ local function _cite_q (citeq_args) title = "Cite "..template, args = citeq_args } .. cfg.i18n_t.trackingcats["unknown-template"] end - return output .. erratumid .. retract .. opt_cat + return output .. erratumid .. eoc .. retract .. opt_cat end local function cite_q (frame) diff --git a/module_citeq_config.lua b/module_citeq_config.lua index d3a72c3..bd209f0 100644 --- a/module_citeq_config.lua +++ b/module_citeq_config.lua @@ -24,6 +24,7 @@ local i18n_t = { ["default"] = "th" }, ["trackingcats"] = { + ['expression-of-concern'] = "[[Category:Cite Q - cites a work with an expression of concern notice]]", ["erratum"] = "[[Category:Cite Q - cites a work with an erratum]]", ["missing-wikidata"] = "[[Category:Articles with missing Wikidata information]]", -- TODO: point to a {{cite q}}-specific category; this one is specific to Module:WikidataIB ['no-label-or-title'] = '[[Category:Cite Q - missing label or title]]', @@ -77,6 +78,7 @@ local simple_properties_t = { retracted_by = {id = "P5824", qidonly=true, maxvals = 1}, -- transient, non-CS1 replaced_by = {id = "P1366", qidonly=true, maxvals = 1}, -- transient, non-CS1 erratum = {id = "P2507", qidonly=true, maxvals = 1}, -- transient, non-CS1 + ['expression-of-concern'] = {id = "P14891", qidonly=true, maxvals = 1}, -- transient, non-CS1 -- citeseerx = {id = "P3784", maxvals = 1}, osti = {id = "P3894", maxvals = 1}, -- take care of |osti-access=? biorxiv = {id = "P3951", maxvals = 1},