יחידה:תבנית מידע/אישיות: הבדלים בין גרסאות בדף
תווית "סיבת המוות" משמשת גם כשאין תאריך מוות אך יש פרמטר סיבת מוות. |
מאין תקציר עריכה |
||
| שורה 77: | שורה 77: | ||
else | else | ||
local pageNs = mw.title.getCurrentTitle().namespace | local pageNs = mw.title.getCurrentTitle().namespace | ||
if pageNs==0 then | if pageNs==0 and not infoObj.isNonPerson then | ||
local matching = WikidataCrossValidation.crossValidate(eventPlace, propPlace, entityId ) | local matching = WikidataCrossValidation.crossValidate(eventPlace, propPlace, entityId ) | ||
if matching then | if matching then | ||
| שורה 131: | שורה 131: | ||
else | else | ||
local pageNs = mw.title.getCurrentTitle().namespace | local pageNs = mw.title.getCurrentTitle().namespace | ||
if pageNs==0 then | if pageNs==0 and not infoObj.isNonPerson then | ||
local matching = WikidataCrossValidation.crossValidate(templateArgs[paramName], property, infoObj.args.entityId ) | local matching = WikidataCrossValidation.crossValidate(templateArgs[paramName], property, infoObj.args.entityId ) | ||
if matching then | if matching then | ||
| שורה 139: | שורה 139: | ||
end | end | ||
return usingWikidata | return usingWikidata | ||
end | |||
local function instanceOfViolation(infoObj) | |||
local pageNs = mw.title.getCurrentTitle().namespace | |||
if pageNs~=0 then | |||
return true | |||
end | |||
local wikidataInstanceOf = nil | |||
if infoObj.args.entityId ~= nil then | |||
wikidataInstanceOf = mw.wikibase.getBestStatements(infoObj.args.entityId, 'P31') | |||
wikidataInstanceOf = wikidataInstanceOf and wikidataInstanceOf[1] and wikidataInstanceOf[1].mainsnak | |||
end | |||
if wikidataInstanceOf == nil then | |||
local matching = WikidataCrossValidation.crossValidate('אדם', 'P31', infoObj.args.entityId ) | |||
if matching then | |||
mw.logObject(matching) | |||
table.insert(infoObj.wikidataCats, WikidataCrossValidation.maintainceCategory(matching, 'P31')) | |||
end | |||
else | |||
wikidataInstanceOf = wikidataInstanceOf.datavalue and wikidataInstanceOf.datavalue.value and wikidataInstanceOf.datavalue.value.id | |||
if wikidataInstanceOf ~= 'Q5' then | |||
table.insert(infoObj.wikidataCats, '[[קטגוריה: ויקינתונים - תבניות אישיות למופע לא מתאים]]') | |||
return true | |||
end | |||
end | |||
return false | |||
end | end | ||
| שורה 148: | שורה 176: | ||
local deathLabel = 'פטירה' | local deathLabel = 'פטירה' | ||
infoObj.isNonPerson = instanceOfViolation(infoObj) | |||
-- fill birth/death dates from wikidata is missing | -- fill birth/death dates from wikidata is missing | ||
usingBirthWikidata = fillWikidataParam(templateArgs, 'תאריך לידה', 'P569', infoObj) | usingBirthWikidata = fillWikidataParam(templateArgs, 'תאריך לידה', 'P569', infoObj) | ||