<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://encyclopedieacadienne.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AWikidata%2FR%C3%A9f%C3%A9rences</id>
	<title>Module:Wikidata/Références - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://encyclopedieacadienne.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AWikidata%2FR%C3%A9f%C3%A9rences"/>
	<link rel="alternate" type="text/html" href="https://encyclopedieacadienne.org/index.php?title=Module:Wikidata/R%C3%A9f%C3%A9rences&amp;action=history"/>
	<updated>2026-11-25T18:20:37Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.39.15</generator>
	<entry>
		<id>https://encyclopedieacadienne.org/index.php?title=Module:Wikidata/R%C3%A9f%C3%A9rences&amp;diff=3488&amp;oldid=prev</id>
		<title>WikiSysop : 1 version importée</title>
		<link rel="alternate" type="text/html" href="https://encyclopedieacadienne.org/index.php?title=Module:Wikidata/R%C3%A9f%C3%A9rences&amp;diff=3488&amp;oldid=prev"/>
		<updated>2026-01-03T03:17:52Z</updated>

		<summary type="html">&lt;p&gt;1 version importée&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 2 janvier 2026 à 23:17&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;fr&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Aucune différence)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://encyclopedieacadienne.org/index.php?title=Module:Wikidata/R%C3%A9f%C3%A9rences&amp;diff=3487&amp;oldid=prev</id>
		<title>fr&gt;Louperivois : propriété supprimée de wikidata</title>
		<link rel="alternate" type="text/html" href="https://encyclopedieacadienne.org/index.php?title=Module:Wikidata/R%C3%A9f%C3%A9rences&amp;diff=3487&amp;oldid=prev"/>
		<updated>2024-11-28T06:12:23Z</updated>

		<summary type="html">&lt;p&gt;propriété supprimée de wikidata&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local reference = {}&lt;br /&gt;
&lt;br /&gt;
local wd = require 'Module:Wikidata'&lt;br /&gt;
local refType = mw.loadData 'Module:Wikidata/Références/Types'&lt;br /&gt;
&lt;br /&gt;
local cite = require 'Module:Biblio'&lt;br /&gt;
local langcodes = mw.loadData 'Module:Dictionnaire Wikidata/Codes langue'&lt;br /&gt;
&lt;br /&gt;
local function concatTables(t1,t2)&lt;br /&gt;
	local results = {}&lt;br /&gt;
	for _,e in pairs(t1) do&lt;br /&gt;
    	table.insert(results, e)&lt;br /&gt;
    end&lt;br /&gt;
    for _,e in pairs(t2) do&lt;br /&gt;
    	table.insert(results, e)&lt;br /&gt;
    end&lt;br /&gt;
    return results&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getStringStatementValues(entity, propertyId)&lt;br /&gt;
	local statements = mw.wikibase.getBestStatements(entity, propertyId)&lt;br /&gt;
	for i, statement in pairs(statements) do&lt;br /&gt;
		statements[i] = statement.mainsnak.datavalue.value&lt;br /&gt;
	end&lt;br /&gt;
	return statements&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getStringStatementValue(entity, propertyId)&lt;br /&gt;
	local statements = getStringStatementValues(entity, propertyId)&lt;br /&gt;
	if #statements &amp;gt; 0 then&lt;br /&gt;
		return statements[1]&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getDirectItemLang(workentity, property)&lt;br /&gt;
	local itemlangs = wd.getClaims{entity = workentity, property = property}&lt;br /&gt;
	if itemlangs ~= nil then&lt;br /&gt;
		local codes = {}&lt;br /&gt;
		for i = 1, #itemlangs do&lt;br /&gt;
			codes[#codes + 1] = langcodes[wd.getNumericId(itemlangs[i].mainsnak)]&lt;br /&gt;
		end&lt;br /&gt;
		return table.concat(codes, &amp;quot;, &amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function hasRole(statement, roleId)&lt;br /&gt;
	return statement.qualifiers and statement.qualifiers['P518'] and wd.getId(statement.qualifiers['P518'][1]) == roleId&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
local currentPageTitle = mw.title.getCurrentTitle().prefixedText&lt;br /&gt;
&lt;br /&gt;
local function buildAuthorLink(statement)&lt;br /&gt;
	local author_label = nil&lt;br /&gt;
	local author_link = nil&lt;br /&gt;
	-- getting the label directly from its value to support &amp;quot;author name string&amp;quot; (P2093)&lt;br /&gt;
	if statement.mainsnak.snaktype == 'value' and statement.mainsnak.datatype == 'string' then&lt;br /&gt;
		author_label = statement.mainsnak.datavalue.value&lt;br /&gt;
	elseif statement.qualifiers and statement.qualifiers['P1932'] and statement.qualifiers['P1932'][1].snaktype == 'value' then&lt;br /&gt;
		-- we use &amp;quot;stated in&amp;quot; (P1932) to retrieve the proper author label&lt;br /&gt;
		author_label = statement.qualifiers['P1932'][1].datavalue.value&lt;br /&gt;
	end&lt;br /&gt;
	-- we extract the link and the label of the author if it is an entity&lt;br /&gt;
	if statement.mainsnak.snaktype == 'value' and statement.mainsnak.datatype == 'wikibase-item' then&lt;br /&gt;
		local author_id = statement.mainsnak.datavalue.value.id&lt;br /&gt;
		if author_label == nil then&lt;br /&gt;
			-- fallback on author's item label, if it exists&lt;br /&gt;
			author_label = mw.wikibase.getLabel(author_id)&lt;br /&gt;
		end&lt;br /&gt;
		author_link = mw.wikibase.getSitelink(author_id)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if author_link ~= nil and author_link ~= currentPageTitle then&lt;br /&gt;
		return '[[' ..author_link .. '|' .. author_label .. ']]'&lt;br /&gt;
	else&lt;br /&gt;
		return author_label&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function remove_same_isbn(isbns)&lt;br /&gt;
	-- input a table of isbns&lt;br /&gt;
	-- return a table of ibns without duplicate&lt;br /&gt;
	-- asked in https://fr.wikipedia.org/wiki/Discussion_mod%C3%A8le:Bibliographie#ISBN-10_et_ISBN-13&lt;br /&gt;
	local References = require( 'Module:Biblio/Références' )&lt;br /&gt;
	local result = {}&lt;br /&gt;
	for _, isbn1 in ipairs(isbns) do&lt;br /&gt;
		local same = false&lt;br /&gt;
		for index_isbn2, isbn2 in ipairs(result) do&lt;br /&gt;
			if  References.same_isbn(isbn1, isbn2) then&lt;br /&gt;
				if isbn2:gsub( '[ -]', '' ):len() == 13 then&lt;br /&gt;
					table.remove(result, index_isbn2)&lt;br /&gt;
					table.insert(result, isbn1)&lt;br /&gt;
				end&lt;br /&gt;
				same = true&lt;br /&gt;
				break&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if not same then&lt;br /&gt;
			table.insert(result, isbn1)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function labelformatP1813(e)&lt;br /&gt;
	-- input: an entity&lt;br /&gt;
	-- returns a formatted string using the &amp;quot;short name&amp;quot; (P1813) if one is declared&lt;br /&gt;
	return wd.formatStatements{entity = e, property = 'P1813', defaultlink= '-', numval=1} or wd.getLabel(e)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function abbr(texte, signification)&lt;br /&gt;
	return '&amp;lt;abbr class=&amp;quot;abbr&amp;quot; title=&amp;quot;' .. signification .. '&amp;quot;&amp;gt;' .. texte .. '&amp;lt;/abbr&amp;gt;'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function reference.citeitem(entityId, options)&lt;br /&gt;
	if not entityId then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local entity = entityId&lt;br /&gt;
	if type( options ) ~= 'table' then&lt;br /&gt;
		options = {}&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	--work entity if it exists&lt;br /&gt;
	local workEntity = nil&lt;br /&gt;
	local workClaims = wd.getClaims{entity = entity, property = 'P629'} -- P629 : édition de&lt;br /&gt;
	if workClaims ~= nil then&lt;br /&gt;
		workEntity = wd.getMainId(workClaims[1])&lt;br /&gt;
	end&lt;br /&gt;
	local journalEntity = nil&lt;br /&gt;
	local journalClaims = wd.getClaims{entity = entity, property = 'P1433'}&lt;br /&gt;
	if journalClaims ~= nil then&lt;br /&gt;
		journalEntity = wd.getMainId(journalClaims[1])&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local translator = wd.formatStatements{entity = entity, property = 'P655', defaultlink = '-'}&lt;br /&gt;
	local illustrator = wd.formatStatements{entity = entity, property = 'P110', defaultlink = '-'}&lt;br /&gt;
	local preface = wd.formatStatements{entity = entity, property = 'P2679', defaultlink = '-'}&lt;br /&gt;
	local postface = wd.formatStatements{entity = entity, property = 'P2680', defaultlink = '-'}&lt;br /&gt;
	local photographe = ''&lt;br /&gt;
	local authors = {}&lt;br /&gt;
	local authors_id = {}&lt;br /&gt;
	local are_director = {}&lt;br /&gt;
	local responsability = {}&lt;br /&gt;
	&lt;br /&gt;
	local author_statements = concatTables(mw.wikibase.getBestStatements(entity, 'P50'), mw.wikibase.getBestStatements(entity, 'P2093'))&lt;br /&gt;
	if next(author_statements) == nil and workEntity ~= nil then --Fallback to work&lt;br /&gt;
		author_statements = concatTables(&lt;br /&gt;
			mw.wikibase.getBestStatements(workEntity, 'P50'), &lt;br /&gt;
			mw.wikibase.getBestStatements(workEntity, 'P2093')&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
	for _, statement in pairs(author_statements) do&lt;br /&gt;
		local position = #authors + 1&lt;br /&gt;
		if statement.qualifiers and statement.qualifiers['P1545'] then&lt;br /&gt;
			position = tonumber(statement.qualifiers['P1545'][1].datavalue.value)&lt;br /&gt;
		end&lt;br /&gt;
		if statement.mainsnak.snaktype == 'value' and statement.mainsnak.datatype == 'wikibase-item' then&lt;br /&gt;
			authors_id[position] = statement.mainsnak.datavalue.value.id&lt;br /&gt;
		end&lt;br /&gt;
		authors[position] = buildAuthorLink(statement)&lt;br /&gt;
		are_director[position] = ''&lt;br /&gt;
	&lt;br /&gt;
		--qualifier pour la responsabilité&lt;br /&gt;
		if statement.qualifiers and statement.qualifiers['P518'] then&lt;br /&gt;
			responsability[position] = wd.formatSnak(statement.qualifiers['P518'][1], {defaultlink = '-'})&lt;br /&gt;
		else&lt;br /&gt;
			responsability[position] = ''&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	for _, statement in pairs(mw.wikibase.getBestStatements(entity, 'P98')) do&lt;br /&gt;
		local isduplicate = false&lt;br /&gt;
		for id_key, id in pairs(authors_id) do&lt;br /&gt;
		if statement.mainsnak.snaktype == 'value' and statement.mainsnak.datatype == 'wikibase-item' and id == statement.mainsnak.datavalue.value.id then&lt;br /&gt;
				are_director[id_key] = 'y'&lt;br /&gt;
				isduplicate = true&lt;br /&gt;
				break&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if not isduplicate then&lt;br /&gt;
			table.insert(authors, buildAuthorLink(statement))&lt;br /&gt;
			table.insert(are_director, 'y')&lt;br /&gt;
			table.insert(responsability, '')&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for _, statement in pairs(mw.wikibase.getBestStatements(entity, 'P767')) do&lt;br /&gt;
		if hasRole(statement, 'Q670787') or hasRole(statement, 'Q19839393') then --préface/préfacier&lt;br /&gt;
			preface = buildAuthorLink(statement)&lt;br /&gt;
		elseif hasRole(statement, 'Q7234272') then --postface&lt;br /&gt;
			postface = buildAuthorLink(statement)&lt;br /&gt;
		elseif hasRole(statement, 'Q33231') or hasRole(statement, 'Q125191') then --photographe/photographie&lt;br /&gt;
			photographe = buildAuthorLink(statement)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local isbns = getStringStatementValues(entity, 'P212')&lt;br /&gt;
	for _, isbn in pairs(getStringStatementValues(entity, 'P957')) do&lt;br /&gt;
		table.insert(isbns, isbn)&lt;br /&gt;
	end&lt;br /&gt;
	if journalEntity then&lt;br /&gt;
		for _, isbnpublishedin in pairs(getStringStatementValues(journalEntity, 'P212')) do&lt;br /&gt;
			table.insert(isbns, isbnpublishedin)&lt;br /&gt;
		end&lt;br /&gt;
		for _, isbnpublishedin in pairs(getStringStatementValues(journalEntity, 'P957')) do&lt;br /&gt;
			table.insert(isbns, isbnpublishedin)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local issns = {}&lt;br /&gt;
	if journalEntity then&lt;br /&gt;
		issns = getStringStatementValues(journalEntity, 'P236')&lt;br /&gt;
	end&lt;br /&gt;
	if #issns == 0 then&lt;br /&gt;
		issns = getStringStatementValues(entity, 'P236')&lt;br /&gt;
	end&lt;br /&gt;
	local oclc = getStringStatementValue(entity, 'P243')&lt;br /&gt;
	local bnf = getStringStatementValue(entity, 'P268')&lt;br /&gt;
	local gallica = getStringStatementValue(entity, 'P4258')&lt;br /&gt;
	local lccn = getStringStatementValue(entity, 'P1144')&lt;br /&gt;
	local dnb = getStringStatementValue(entity, 'P1292')&lt;br /&gt;
	local doi = getStringStatementValue(entity, 'P356')&lt;br /&gt;
	local pmid = getStringStatementValue(entity, 'P698')&lt;br /&gt;
	local jstor = getStringStatementValue(entity, 'P888')&lt;br /&gt;
	local bibcode = getStringStatementValue(entity, 'P1300')&lt;br /&gt;
	local arxiv = getStringStatementValue(entity, 'P818')&lt;br /&gt;
	local pmcid = getStringStatementValue(entity, 'P932')&lt;br /&gt;
	&lt;br /&gt;
	local ednumber = wd.formatStatements{entity = entity, property = 'P393'}&lt;br /&gt;
&lt;br /&gt;
	local publisher = wd.formatStatements{entity = entity, property = 'P123', defaultlink = '-', labelformat = labelformatP1813 }&lt;br /&gt;
	local journal = wd.formatStatements{entity = entity , property = 'P1433', defaultlink = '-'}&lt;br /&gt;
&lt;br /&gt;
	local numero = ''&lt;br /&gt;
	if journalClaims and wd.hasQualifier(journalClaims[1], 'P433') then&lt;br /&gt;
		numero = wd.getFormattedQualifiers(journalClaims[1], 'P433')&lt;br /&gt;
	else&lt;br /&gt;
		numero = getStringStatementValue(entity, 'P433')&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local volume = ''&lt;br /&gt;
	if journalClaims and wd.hasQualifier(journalClaims[1], 'P478') then&lt;br /&gt;
		volume = wd.getFormattedQualifiers(journalClaims[1], 'P478')&lt;br /&gt;
	else&lt;br /&gt;
		volume = getStringStatementValue(entity, 'P478')&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local chapter = ''&lt;br /&gt;
	if journalClaims and wd.hasQualifier(journalClaims[1], 'P792') then&lt;br /&gt;
		chapter = wd.getFormattedQualifiers(journalClaims[1], 'P792')&lt;br /&gt;
	else&lt;br /&gt;
		chapter = getStringStatementValue(entity, 'P792')&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local page = ''&lt;br /&gt;
	if journalClaims and wd.hasQualifier(journalClaims[1], 'P304') then&lt;br /&gt;
		page = wd.getFormattedQualifiers(journalClaims[1], 'P304')&lt;br /&gt;
	else&lt;br /&gt;
		page = getStringStatementValue(entity, 'P304')&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local publishdate = wd.formatStatements{entity = entity, property = 'P577', linktopic = '-'}&lt;br /&gt;
	local publishplace = wd.formatStatements{entity = entity, property = 'P291', defaultlink = '-'}&lt;br /&gt;
&lt;br /&gt;
	--si pas d'éditeur (publisher), lieu ou date de publication, oclc ou bnf : on le cherche dans l'item renseigné sous P1433 (publié dans), appelé ici &amp;quot;journalEntity&amp;quot;&lt;br /&gt;
	if (not publisher) and journalEntity then&lt;br /&gt;
		publisher = wd.formatStatements{entity = journalEntity, property = &amp;quot;P123&amp;quot;, defaultlink = &amp;quot;P577&amp;quot;, labelformat = labelformatP1813}&lt;br /&gt;
	end&lt;br /&gt;
	if (not publishdate) and journalEntity then&lt;br /&gt;
		publishdate = wd.formatStatements{entity = journalEntity, property = &amp;quot;P577&amp;quot;, linktopic = &amp;quot;P577&amp;quot;}&lt;br /&gt;
	end&lt;br /&gt;
	if (not publishplace) and journalEntity then&lt;br /&gt;
		publishplace = wd.formatStatements{entity = journalEntity, property = &amp;quot;P291&amp;quot;, defaultlink = &amp;quot;P577&amp;quot;}&lt;br /&gt;
	end&lt;br /&gt;
	if (not oclc) and journalEntity then&lt;br /&gt;
		oclc = wd.formatStatements{entity = journalEntity, property = &amp;quot;P243&amp;quot;, defaultlink = &amp;quot;P577&amp;quot;}&lt;br /&gt;
	end&lt;br /&gt;
	if (not bnf) and journalEntity then&lt;br /&gt;
		bnf = wd.formatStatements{entity = journalEntity, property = &amp;quot;P268&amp;quot;, defaultlink = &amp;quot;P577&amp;quot;}&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local pagenum = wd.formatStatements{entity = entity, property = 'P1104'}&lt;br /&gt;
	&lt;br /&gt;
	local title&lt;br /&gt;
	local titlestatement = wd.getClaims{entity = entity, property = 'P1476', numval = 1}&lt;br /&gt;
	if titlestatement  then &lt;br /&gt;
		title = wd.getFormattedQualifiers(titlestatement[1], 'P6833') -- htmltitle &lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	title = title or wd.formatStatements{entity = entity, property = 'P1476', numval = 1 } or wd.getLabel(entity)&lt;br /&gt;
	&lt;br /&gt;
	local titlelink = wd.siteLink(entity)&lt;br /&gt;
	local subtitle = titlestatement and wd.getFormattedQualifiers(titlestatement[1], 'P1680') or wd.formatStatements{entity = entity, property = 'P1680'}&lt;br /&gt;
	local url = getStringStatementValue(entity, 'P2699') or getStringStatementValue(entity, 'P854') or getStringStatementValue(entity, 'P953') or (gallica and &amp;quot;https://gallica.bnf.fr/ark:/12148/&amp;quot; .. gallica)&lt;br /&gt;
	-- à faire : transmettre l'&amp;quot;url de la référence&amp;quot; dans les options comme url prioritaire&lt;br /&gt;
	local wikisource = mw.wikibase.getSitelink(entity, 'frwikisource')&lt;br /&gt;
	if wikisource ~= nil and url ~= nil and url:find('%.wikisource%.org') then&lt;br /&gt;
		url = nil -- we make sure to not have two links to Wikisource&lt;br /&gt;
	end&lt;br /&gt;
	local language = getDirectItemLang(entity, 'P407')&lt;br /&gt;
	if not language and journalEntity then&lt;br /&gt;
		language = getDirectItemLang(journalEntity, 'P407')&lt;br /&gt;
	end&lt;br /&gt;
	local originalLanguage = getDirectItemLang(entity, 'P364') --TODO: be clever? or getDirectItemLang(workEntity, 'P407') or getDirectItemLang(workEntity, 'P364')&lt;br /&gt;
	if not language or language == originalLanguage then&lt;br /&gt;
		originalLanguage = nil -- We are actually not sure if it has been translated from this language&lt;br /&gt;
	end&lt;br /&gt;
	local originalTitle = nil&lt;br /&gt;
	if workEntity and originalLanguage then&lt;br /&gt;
		originalTitle = wd.formatStatements{entity = workEntity, property = 'P1476', numval = 1 } &lt;br /&gt;
		if not originalTitle then&lt;br /&gt;
			originalTitle = mw.wikibase.getLabelByLang(workEntity, originalLanguage)&lt;br /&gt;
			originalTitle = &amp;quot;&amp;lt;span lang='&amp;quot; .. originalLanguage .. &amp;quot;'&amp;gt;'&amp;quot;..originalTitle..&amp;quot;&amp;lt;/span&amp;gt;&amp;quot; &lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local citation = wd.formatStatements{entity = entity, property = 'P1683'}&lt;br /&gt;
&lt;br /&gt;
	-- choix ddu type de citation adapté&lt;br /&gt;
	local entitytype = wd.formatStatements{property = 'P31', entity = entity, numval = 1, displayformat = 'raw'}&lt;br /&gt;
	local funtype&lt;br /&gt;
		&lt;br /&gt;
	-- calcul du rendu du titre de l'ouvrage, éventuellement avec un lien vers l'article de l'ouvrage&lt;br /&gt;
&lt;br /&gt;
	-- pas de lien à générer si on est sur la page de l'ouvrage ou si l'élément cité est une édition de cet ouvrage&lt;br /&gt;
	if not ( wd.isPageOfQId(entityId) or &lt;br /&gt;
	   workEntity and wd.isPageOfQId(wd.entityId(workEntity)) )&lt;br /&gt;
	then&lt;br /&gt;
		if not titlelink and workEntity then&lt;br /&gt;
			-- si pas de lien, on peut essayer de voir si c'est l'édition de quelque chose d'autre&lt;br /&gt;
			titlelink = wd.siteLink(workEntity)&lt;br /&gt;
		end&lt;br /&gt;
		if title and titlelink then&lt;br /&gt;
			title = '[[' .. titlelink .. '|' .. title .. ']]'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- calcul du modèle à utiliser pour rendre l'élémént&lt;br /&gt;
	&lt;br /&gt;
	if (entitytype == 'Q3331189') then --book edition&lt;br /&gt;
		funtype = cite.ouvrage&lt;br /&gt;
		&lt;br /&gt;
		-- TODO : gérer l'édition et l'élément de l'oeuvre. &lt;br /&gt;
		&lt;br /&gt;
	elseif refType.isOuvrage[entitytype] then -- ouvrage sans édition connue ?&lt;br /&gt;
		&lt;br /&gt;
		-- TODO : gérer le cas ou un ouvrage est cité mais que Wikidata en connait des éditions.&lt;br /&gt;
		-- TODO : refuser ce genre d'items ?&lt;br /&gt;
		&lt;br /&gt;
		funtype = cite.ouvrage&lt;br /&gt;
		&lt;br /&gt;
	elseif refType.isArticle[entitytype] then -- article&lt;br /&gt;
		funtype = cite.article&lt;br /&gt;
	elseif refType.isChapitre[entitytype] then -- chapitre&lt;br /&gt;
		funtype = cite.chapitre&lt;br /&gt;
	else -- par défaut : un rendu simple&lt;br /&gt;
		local biblioCommun = require 'Module:Biblio/Commun'&lt;br /&gt;
		local linguistic = require 'Module:Linguistique'&lt;br /&gt;
&lt;br /&gt;
		local parameters = authors&lt;br /&gt;
		if title then&lt;br /&gt;
			local titleblock = '&amp;lt;i&amp;gt;' .. title .. '&amp;lt;/i&amp;gt;' -- à faire : mise en italique ou pas selon la nature de l'objet&lt;br /&gt;
			 if entitytype and wd.getLabel(entitytype) then&lt;br /&gt;
				titleblock = titleblock .. ' (' .. wd.getLabel(entitytype) .. ')'&lt;br /&gt;
			 end&lt;br /&gt;
			table.insert(parameters, titleblock)&lt;br /&gt;
		end&lt;br /&gt;
		if publisher then&lt;br /&gt;
			table.insert(parameters, publisher)&lt;br /&gt;
		end&lt;br /&gt;
		if publishplace then&lt;br /&gt;
			table.insert(parameters, publishplace)&lt;br /&gt;
		end&lt;br /&gt;
		if publishdate then&lt;br /&gt;
			table.insert(parameters, publishdate)&lt;br /&gt;
		end&lt;br /&gt;
		if url then&lt;br /&gt;
			table.insert(parameters, mw.getCurrentFrame():expandTemplate{title=&amp;quot;lire en ligne&amp;quot;,args={url=url}})&lt;br /&gt;
		end&lt;br /&gt;
		if options['page'] then&lt;br /&gt;
			table.insert(parameters, biblioCommun.formatePassage(options['page']))&lt;br /&gt;
		end&lt;br /&gt;
		if options['accessdate'] then&lt;br /&gt;
			table.insert(parameters, 'consulté le ' .. options['accessdate'])&lt;br /&gt;
		end&lt;br /&gt;
		parameters[#parameters] = parameters[#parameters] .. '.'&lt;br /&gt;
		parameters[#parameters] = wd.addLinkBack(parameters[#parameters], entity)&lt;br /&gt;
		return linguistic.conj(parameters, 'comma')&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
	local parameters = {&lt;br /&gt;
		['traducteur'] = translator,&lt;br /&gt;
		['illustrateur'] = illustrator,&lt;br /&gt;
		['préface'] = preface,&lt;br /&gt;
		['postface'] = postface,&lt;br /&gt;
		['photographe'] = photographe,&lt;br /&gt;
		['titre'] = title,&lt;br /&gt;
		['sous-titre'] = subtitle,&lt;br /&gt;
		['date'] = publishdate,&lt;br /&gt;
		['lieu'] = publishplace,&lt;br /&gt;
		['périodique'] = journal,&lt;br /&gt;
		[&amp;quot;numéro d'édition&amp;quot;] = ednumber,&lt;br /&gt;
		['éditeur'] = publisher,&lt;br /&gt;
		['pages totales'] = pagenum,&lt;br /&gt;
		['lire en ligne'] = url,&lt;br /&gt;
		['wikisource'] = wikisource,&lt;br /&gt;
		['oclc'] = oclc,&lt;br /&gt;
		['bnf'] = bnf,&lt;br /&gt;
		['lccn'] = lccn,&lt;br /&gt;
		['dnb'] = dnb,&lt;br /&gt;
		['doi'] = doi,&lt;br /&gt;
		['pmid'] = pmid,&lt;br /&gt;
		['jstor'] = jstor,&lt;br /&gt;
		['bibcode'] = bibcode,&lt;br /&gt;
		['arxiv'] = arxiv,&lt;br /&gt;
		['pmcid'] = pmcid,&lt;br /&gt;
		['langue'] = language,&lt;br /&gt;
		['langue originale'] = originalLanguage,&lt;br /&gt;
		['titre original'] = originalTitle,&lt;br /&gt;
		['page'] = page,&lt;br /&gt;
		['numéro'] = numero,&lt;br /&gt;
		['volume'] = volume,&lt;br /&gt;
		['citation'] = citation,&lt;br /&gt;
		['plume'] = options['plume']&lt;br /&gt;
	}&lt;br /&gt;
	if refType.isChapitre[entitytype] and journalClaims then -- chapitre&lt;br /&gt;
		parameters['titre'] = journal&lt;br /&gt;
		parameters['sous-titre'] = '' -- TODO&lt;br /&gt;
		parameters['lien titre'] = '' -- TODO&lt;br /&gt;
		parameters['auteurs ouvrage'] = '' --TODO&lt;br /&gt;
		parameters['numéro chapitre'] = chapter&lt;br /&gt;
		parameters['titre chapitre'] = title&lt;br /&gt;
		parameters['sous-titre chapitre'] = subtitle&lt;br /&gt;
		parameters['traduction titre chapitre'] = '' -- TODO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	isbns = remove_same_isbn(isbns)&lt;br /&gt;
	for i, isbn in pairs(isbns) do&lt;br /&gt;
		parameters['isbn' .. i] = isbn&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for i, issn in pairs(issns) do&lt;br /&gt;
		parameters['issn' .. i] = issn&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- try to find if there is an author set in options&lt;br /&gt;
	local setAuthors = true&lt;br /&gt;
	for i=1, 15 do&lt;br /&gt;
		if options['auteur' .. i]  or options['directeur' .. i] or options['responsabilité' .. i] then&lt;br /&gt;
			setAuthors = false&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if setAuthors then&lt;br /&gt;
		for i, author in pairs(authors) do&lt;br /&gt;
			parameters['auteur' .. i] = author&lt;br /&gt;
			parameters['directeur' .. i] = are_director[i]&lt;br /&gt;
			parameters['responsabilité' .. i] = responsability[i]&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for parameter, value in pairs(options) do&lt;br /&gt;
		if value == '-' then&lt;br /&gt;
			parameters[parameter] = ''&lt;br /&gt;
		else&lt;br /&gt;
			parameters[parameter] = value&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local val = funtype(parameters)&lt;br /&gt;
&lt;br /&gt;
	if val then&lt;br /&gt;
		val = val .. '.'&lt;br /&gt;
		return wd.addRefAnchor(wd.addLinkBack(val, entity), wd.entityId(entity))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return wd.formatError()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- cette fonction est utilisée par [[Modèle:Bibliographie]]&lt;br /&gt;
function reference.citeItem(frame)&lt;br /&gt;
	local args = frame:getParent().args&lt;br /&gt;
	local entityId = mw.text.trim(args[1] or '')&lt;br /&gt;
&lt;br /&gt;
	if entityId == '' then&lt;br /&gt;
		error('Un identifiant d\'entité Wikidata doit être renseigné')&lt;br /&gt;
		-- il y a quelques utilisations du modèle sans paramètre, l'erreur Lua permet de les détecter&lt;br /&gt;
		-- une fois ces utilisations corrigées, on pourra remplacer par une erreur classique :&lt;br /&gt;
		--return '&amp;lt;span class=&amp;quot;error&amp;quot;&amp;gt;Un identifiant d\'entité Wikidata doit être renseigné.&amp;lt;/span&amp;gt;'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if not mw.wikibase.entityExists(entityId) then&lt;br /&gt;
		error('L\'entité Wikidata ' .. entityId .. ' n\'existe pas')&lt;br /&gt;
		-- plus élégant (pas d'erreur Lua), mais aurait besoin d'une catégorisation&lt;br /&gt;
		-- (car il est possible que l'entité soit supprimée plus tard) :&lt;br /&gt;
		--return '&amp;lt;span class=&amp;quot;error&amp;quot;&amp;gt;L\'entité Wikidata ' .. mw.text.nowiki(entityId) .. ' n\'existe pas.&amp;lt;/span&amp;gt;'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return reference.citeitem(entityId, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--used to test the duplicate isbn functions, use in the console like this&lt;br /&gt;
-- p.test()&lt;br /&gt;
reference.test = function()&lt;br /&gt;
	test_same_isbn()&lt;br /&gt;
	test_remove_same_isbn()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return reference&lt;/div&gt;</summary>
		<author><name>fr&gt;Louperivois</name></author>
	</entry>
</feed>