Module:InfoboxBuilder/Common queries
Apparence
La documentation pour ce module peut être créée à Module:InfoboxBuilder/Common queries/doc
-- Helper Functions --
local wikidata = require('Module:Wikidata')
local function dateandplace(thedate, theplace)
if thedate and theplace then
return thedate .. '<br />' .. theplace
else
return thedate or theplace --retourne tout ce qu'il trouve
end
end
-- Queries --
return {
['mainimage'] = {
type = 'images',
imageparameters = {'image'},
defaultimage = function() return template.defaultimage end,
captionparameter = 'légende',
defaultcaption = function() return template.defaultcaption end,
wikidata = function() return wikidata.formatStatements({property = 'p18', first = 'true', returntype = 'table'}) end, -- Wikidata uniquement pour les images, pas la légende
},
['birth'] = {
type = 'mixed',
label = 'Naissance',
value = function() return dateandplace(localdata['naissance'], localdata['lieu de naissance']) end,
wikidata = dateandplace(
wikidata._formatStatements({property= 'p569', rank = 'best', conjunction= ' ou '}),
wikidata._formatStatements({property= 'p19', rank = 'best', conjunction= ' ou '})
),
},
['death'] = {
type = 'mixed',
label = 'Décès',
value = function() return dateandplace(localdata['décès'], localdata['lieu de décès']) end,
wikidata = dateandplace(
wikidata._formatStatements({property= 'p570', rank = 'best', conjunction= ' ou '}),
wikidata._formatStatements({property= 'p20', rank = 'best', conjunction= ' ou '})
),
},
['nationality'] = {
type = 'mixed',
label = 'Nationalité',
-- property = 'p27' , pays de nationalité
value = 'nationalité'
},
['influencedby'] = {
type = 'mixed',
label = 'Influencé par',
property = 'p737',
value = 'influencé par',
},
['influenced'] = {
type = 'mixed',
label = 'A influencé',
property = 'p738',
value = 'a influencé'
}
}