문서 편집 권한이 없습니다. 다음 이유를 확인해주세요: 요청한 명령은 다음 권한을 가진 사용자에게 제한됩니다: 사용자. 문서의 원본을 보거나 복사할 수 있습니다. local p = {} function p.wikidatacheck(frame) local pframe = frame:getParent() local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template local property = config.property local value = config.value or "" local catbase = config.category local namespaces = config.namespaces local ok = false -- one-way flag to check if we're in a good namespace local ns = mw.title.getCurrentTitle().namespace for v in mw.text.gsplit( namespaces, ",", true) do if tonumber(v) == ns then ok = true end end if not ok then -- not in one of the approved namespaces return "" end local entity = mw.wikibase.getEntityObject() if not entity then -- no Wikidata item return "[[분류:위키데이터에 없는 " .. catbase .. "]]" end local claims = entity.claims or {} local hasProp = claims[property] if not hasProp then -- no claim of that property return "[[분류:위키데이터에 없는 " .. catbase .. "]]" -- bad. Bot needs to add the property end local propValue = hasProp[1].mainsnak.datavalue.value -- This should eventually iterate over all possible values? if value == "" then return nil -- Using Wikidata elseif propValue == value then return "[[분류:위키데이터와 같은 " .. catbase .. "]]" -- yay! else return "[[분류:위키데이터와 다른 " .. catbase .. "]]" -- needs human review :( end end return p 이 문서에서 사용한 틀: 모듈:WikidataCheck/설명문서 (원본 보기) 모듈:WikidataCheck 문서로 돌아갑니다.