„Modul:WikidataCheck” változatai közötti eltérés
[ellenőrzött változat] | [ellenőrzött változat] |
Tartalom törölve Tartalom hozzáadva
megegyező |
Frissítés az angol modul mintájára. |
||
2. sor:
function p.wikidatacheck(frame)
local nocatsame = config.nocatsame or ""
local ok = false -- one-way flag to check if we're in a good namespace▼
local qid = config.qid or ""
local ns = mw.title.getCurrentTitle().namespace▼
for v in mw.text.gsplit( namespaces, ",", true) do▼
if tonumber(v) == ns then▼
ok = true▼
end▼
return ""▼
local entity = mw.wikibase.getEntityObject()▼
return "[[Category:" .. catbase .. " not in Wikidata]]"▼
if qid == "" then
local hasProp = claims[property]▼
if not hasProp then -- no claim of that property▼
return "[[Kategória:" .. catbase .. " not in Wikidata]]" -- bad. Bot needs to add the property▼
entity = mw.wikibase.getEntityObject(qid)
if not entity then -- no Wikidata item
if propValue == value then▼
▲ else
if value == "" then
return "[[Kategória:" .. catbase .. " különbözik Wikidatán tárolt értéktől]]" -- needs human review :(▼
return nil -- Using Wikidata
▲ end
end
local claims = entity.claims or {}
▲
end
for i, v in ipairs(hasProp) do -- Now we try to iterate over all possible values?
propValue = (v.mainsnak.datavalue or {}).value
if nocatsame == "" then
▲
else
return nil -- if nocatsame, the "same as" category is not added
end
end
end
▲
end
|