<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://wikifield.fr/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://wikifield.fr/index.php?action=history&amp;feed=atom&amp;title=Module%3AWikidata%2FR%C3%A9f%C3%A9rences"/>
	<link rel="alternate" type="text/html" href="https://wikifield.fr/index.php?title=Module:Wikidata/R%C3%A9f%C3%A9rences&amp;action=history"/>
	<updated>2026-05-14T08:08:40Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://wikifield.fr/index.php?title=Module:Wikidata/R%C3%A9f%C3%A9rences&amp;diff=270&amp;oldid=prev</id>
		<title>Admin : 1 révision importée</title>
		<link rel="alternate" type="text/html" href="https://wikifield.fr/index.php?title=Module:Wikidata/R%C3%A9f%C3%A9rences&amp;diff=270&amp;oldid=prev"/>
		<updated>2019-04-13T18:16:30Z</updated>

		<summary type="html">&lt;p&gt;1 révision importée&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 13 avril 2019 à 18:16&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&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;!-- diff cache key wikidb:diff:1.41:old-269:rev-270 --&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://wikifield.fr/index.php?title=Module:Wikidata/R%C3%A9f%C3%A9rences&amp;diff=269&amp;oldid=prev</id>
		<title>fr&gt;Tpt : évite d&#039;avoir deux liens vers wikisource en anglais si &quot;url&quot; et &quot;wikisource&quot; sont tout les deux renseignées vers Wikisource</title>
		<link rel="alternate" type="text/html" href="https://wikifield.fr/index.php?title=Module:Wikidata/R%C3%A9f%C3%A9rences&amp;diff=269&amp;oldid=prev"/>
		<updated>2019-02-27T18:03:28Z</updated>

		<summary type="html">&lt;p&gt;évite d&amp;#039;avoir deux liens vers wikisource en anglais si &amp;quot;url&amp;quot; et &amp;quot;wikisource&amp;quot; sont tout les deux renseignées vers Wikisource&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 &amp;#039;Module:Wikidata&amp;#039;&lt;br /&gt;
local refType = mw.loadData &amp;#039;Module:Wikidata/Références/Types&amp;#039;&lt;br /&gt;
&lt;br /&gt;
local linguistic = require &amp;#039;Module:Linguistique&amp;#039;&lt;br /&gt;
local cite = require &amp;#039;Module:Biblio&amp;#039;&lt;br /&gt;
local langcodes = mw.loadData &amp;#039;Module:Dictionnaire Wikidata/Codes langue&amp;#039;&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 = entity:getBestStatements(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;
		return langcodes[wd.getNumericId(itemlangs[1].mainsnak)]&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 (&lt;br /&gt;
		statement.qualifiers[&amp;#039;P518&amp;#039;] and wd.getId(statement.qualifiers[&amp;#039;P518&amp;#039;][1]) == roleId&lt;br /&gt;
		or statement.qualifiers[&amp;#039;P794&amp;#039;] and wd.getId(statement.qualifiers[&amp;#039;P794&amp;#039;][1]) == roleId&lt;br /&gt;
	)&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;
	-- we extract the link and the label of the author if it is an entity&lt;br /&gt;
	if statement.mainsnak.snaktype == &amp;#039;value&amp;#039; and statement.mainsnak.datatype == &amp;#039;wikibase-item&amp;#039; then&lt;br /&gt;
		local author_id = statement.mainsnak.datavalue.value.id&lt;br /&gt;
		author_label = mw.wikibase.getLabel(author_id)&lt;br /&gt;
		author_link = mw.wikibase.getSitelink(author_id)&lt;br /&gt;
	end&lt;br /&gt;
	-- we use stated in to retrive the proper author label by setting it in statement.mainsnak&lt;br /&gt;
	if statement.qualifiers and statement.qualifiers[&amp;#039;P1932&amp;#039;] then&lt;br /&gt;
		statement.mainsnak = statement.qualifiers[&amp;#039;P1932&amp;#039;][1]&lt;br /&gt;
	end&lt;br /&gt;
	-- and then by getting the label from its value (supports also P2093)&lt;br /&gt;
	if statement.mainsnak.snaktype == &amp;#039;value&amp;#039; and statement.mainsnak.datatype == &amp;#039;string&amp;#039; then&lt;br /&gt;
		author_label = statement.mainsnak.datavalue.value&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if author_link ~= nil and author_link ~= currentPageTitle then&lt;br /&gt;
		return &amp;#039;[[&amp;#039; ..author_link .. &amp;#039;|&amp;#039; .. author_label .. &amp;#039;]]&amp;#039;&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( &amp;#039;Module:Biblio/Références&amp;#039; )&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( &amp;#039;[ -]&amp;#039;, &amp;#039;&amp;#039; ):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;
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 = wd.getEntity(entityId)&lt;br /&gt;
	if not entity then&lt;br /&gt;
		return &amp;#039;invalid entity id&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	if type( options ) ~= &amp;#039;table&amp;#039; 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 = &amp;#039;P629&amp;#039;} -- P629 : édition de&lt;br /&gt;
	if workClaims ~= nil then&lt;br /&gt;
		workEntity = wd.getEntity(wd.getMainId(workClaims[1]))&lt;br /&gt;
	end&lt;br /&gt;
	local journalEntity = nil&lt;br /&gt;
	local journalClaims = wd.getClaims{entity = entity, property = &amp;#039;P1433&amp;#039;}&lt;br /&gt;
	if journalClaims ~= nil then&lt;br /&gt;
		journalEntity = wd.getEntity(wd.getMainId(journalClaims[1]))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local translator = wd.formatStatements{entity = entity, property = &amp;#039;P655&amp;#039;, defaultlink = &amp;#039;-&amp;#039;}&lt;br /&gt;
	local illustrator = wd.formatStatements{entity = entity, property = &amp;#039;P110&amp;#039;, defaultlink = &amp;#039;-&amp;#039;}&lt;br /&gt;
	local preface = &amp;#039;&amp;#039;&lt;br /&gt;
	local postface = &amp;#039;&amp;#039;&lt;br /&gt;
	local photographe = &amp;#039;&amp;#039;&lt;br /&gt;
	local authors = {}&lt;br /&gt;
	local are_director = {}&lt;br /&gt;
	local responsability = {}&lt;br /&gt;
	&lt;br /&gt;
	local author_statements = concatTables(entity:getBestStatements(&amp;#039;P50&amp;#039;), entity:getBestStatements(&amp;#039;P2093&amp;#039;))&lt;br /&gt;
	if next(author_statements) == nil and workEntity ~= nil then --Fallback to work&lt;br /&gt;
		author_statements = concatTables(workEntity:getBestStatements(&amp;#039;P50&amp;#039;), workEntity:getBestStatements(&amp;#039;P2093&amp;#039;))&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[&amp;#039;P1545&amp;#039;] then&lt;br /&gt;
			position = tonumber(statement.qualifiers[&amp;#039;P1545&amp;#039;][1].datavalue.value)&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		authors[position] = buildAuthorLink(statement)&lt;br /&gt;
		are_director[position] = &amp;#039;&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
		--qualifier pour la responsabilité&lt;br /&gt;
		if statement.qualifiers and statement.qualifiers[&amp;#039;P518&amp;#039;] then&lt;br /&gt;
			responsability[position] = wd.formatSnak(statement.qualifiers[&amp;#039;P518&amp;#039;][1], {defaultlink = &amp;#039;-&amp;#039;})&lt;br /&gt;
		else&lt;br /&gt;
			responsability[position] = &amp;#039;&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	for _, statement in pairs(entity:getBestStatements(&amp;#039;P98&amp;#039;)) do&lt;br /&gt;
		table.insert(authors, buildAuthorLink(statement))&lt;br /&gt;
		table.insert(are_director, &amp;#039;y&amp;#039;)&lt;br /&gt;
		table.insert(responsability, &amp;#039;&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for _, statement in pairs(entity:getBestStatements(&amp;#039;P767&amp;#039;)) do&lt;br /&gt;
		if hasRole(statement, &amp;#039;Q670787&amp;#039;) or hasRole(statement, &amp;#039;Q19839393&amp;#039;) then --préface/préfacier&lt;br /&gt;
			preface = buildAuthorLink(statement)&lt;br /&gt;
		elseif hasRole(statement, &amp;#039;Q7234272&amp;#039;) then --postface&lt;br /&gt;
			postface = buildAuthorLink(statement)&lt;br /&gt;
		elseif hasRole(statement, &amp;#039;Q33231&amp;#039;) or hasRole(statement, &amp;#039;Q125191&amp;#039;) 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, &amp;#039;P212&amp;#039;)&lt;br /&gt;
	for _, isbn in pairs(getStringStatementValues(entity, &amp;#039;P957&amp;#039;)) do&lt;br /&gt;
		table.insert(isbns, isbn)&lt;br /&gt;
	end&lt;br /&gt;
	local issns = {}&lt;br /&gt;
	if journalEntity then&lt;br /&gt;
		issns = getStringStatementValues(journalEntity, &amp;#039;P236&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	if #issns == 0 then&lt;br /&gt;
		issns = getStringStatementValues(entity, &amp;#039;P236&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local oclc = getStringStatementValue(entity, &amp;#039;P243&amp;#039;)&lt;br /&gt;
	local bnf = getStringStatementValue(entity, &amp;#039;P268&amp;#039;)&lt;br /&gt;
	local lccn = getStringStatementValue(entity, &amp;#039;P1144&amp;#039;)&lt;br /&gt;
	local dnb = getStringStatementValue(entity, &amp;#039;P1292&amp;#039;)&lt;br /&gt;
	local doi = getStringStatementValue(entity, &amp;#039;P356&amp;#039;)&lt;br /&gt;
	local pmid = getStringStatementValue(entity, &amp;#039;P698&amp;#039;)&lt;br /&gt;
	local jstor = getStringStatementValue(entity, &amp;#039;P888&amp;#039;)&lt;br /&gt;
	local bibcode = getStringStatementValue(entity, &amp;#039;P1300&amp;#039;)&lt;br /&gt;
	local arxiv = getStringStatementValue(entity, &amp;#039;P818&amp;#039;)&lt;br /&gt;
	local pmcid = getStringStatementValue(entity, &amp;#039;P932&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	local ednumber = wd.formatStatements{entity = entity, property = &amp;#039;P393&amp;#039;}&lt;br /&gt;
	local publisher = wd.formatStatements{entity = entity, property = &amp;#039;P123&amp;#039;, defaultlink = &amp;#039;-&amp;#039;}&lt;br /&gt;
	local journal = wd.formatStatements{entity = entity , property = &amp;#039;P1433&amp;#039;, defaultlink = &amp;#039;-&amp;#039;}&lt;br /&gt;
	--TODO fix local journalnumber = wd.formatStatements{entity = entity, property = &amp;#039;P433&amp;#039;}&lt;br /&gt;
	--TODO fix local volume = wd.formatStatements{entity = entity, property = &amp;#039;P478&amp;#039;}&lt;br /&gt;
&lt;br /&gt;
	local publishdate = wd.formatStatements{entity = entity, property = &amp;#039;P577&amp;#039;, linktopic = &amp;#039;-&amp;#039;}&lt;br /&gt;
	local publishplace = wd.formatStatements{entity = entity, property = &amp;#039;P291&amp;#039;, defaultlink = &amp;#039;-&amp;#039;}&lt;br /&gt;
&lt;br /&gt;
	--if no publisher, publication date or place, oclc or bnf: look for them in the item stored in P1433, misnamed here as  &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;}&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 = &amp;#039;P1104&amp;#039;}&lt;br /&gt;
	local title = wd.formatStatements{entity = entity, property = &amp;#039;P1476&amp;#039;, numval = 1 } or wd.getLabel(entity)&lt;br /&gt;
	local titlelink = wd.siteLink(entity)&lt;br /&gt;
	local subtitle = wd.formatStatements{entity = entity, property = &amp;#039;P1680&amp;#039;}&lt;br /&gt;
	local url = getStringStatementValue(entity, &amp;#039;P854&amp;#039;) or getStringStatementValue(entity, &amp;#039;P953&amp;#039;)&lt;br /&gt;
	local wikisource = entity:getSitelink(&amp;#039;frwikisource&amp;#039;)&lt;br /&gt;
	if wikisource ~= nil and url ~= nil and url:find(&amp;#039;%.wikisource%.org&amp;#039;) 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, &amp;#039;P407&amp;#039;)&lt;br /&gt;
	if not language and journalEntity then&lt;br /&gt;
		language = getDirectItemLang(journalEntity, &amp;#039;P407&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local originalLanguage = getDirectItemLang(entity, &amp;#039;P364&amp;#039;) --TODO: be clever? or getDirectItemLang(workEntity, &amp;#039;P407&amp;#039;) or getDirectItemLang(workEntity, &amp;#039;P364&amp;#039;)&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 = &amp;#039;P1476&amp;#039;, numval = 1 } or workEntity:getLabel(originalLanguage)&lt;br /&gt;
	end&lt;br /&gt;
	local page = getStringStatementValue(entity, &amp;#039;P304&amp;#039;)&lt;br /&gt;
	local numero = getStringStatementValue(entity, &amp;#039;P433&amp;#039;)&lt;br /&gt;
	local volume = getStringStatementValue(entity, &amp;#039;P478&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
	-- choose relevant cite type&lt;br /&gt;
	local entitytype = wd.formatStatements{property = &amp;#039;P31&amp;#039;, entity = entity, numval = 1, displayformat = &amp;#039;raw&amp;#039;}&lt;br /&gt;
	local funtype&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
	-- calcul du rendu du titre de l&amp;#039;ouvrage, éventuellement avec un lien vers l&amp;#039;article de l&amp;#039;ouvrage&lt;br /&gt;
&lt;br /&gt;
	-- pas de lien à générer si on est sur la page de l&amp;#039;ouvrage ou si l&amp;#039;é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&amp;#039;est l&amp;#039;édition de quelque chose d&amp;#039;autre&lt;br /&gt;
			titlelink = wd.siteLink(workEntity)&lt;br /&gt;
		end&lt;br /&gt;
		if title and titlelink then&lt;br /&gt;
			title = &amp;#039;[[&amp;#039; .. titlelink .. &amp;#039;|&amp;#039; .. title .. &amp;#039;]]&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- calcul du modèle à utiliser pour rendre l&amp;#039;élémént&lt;br /&gt;
	&lt;br /&gt;
	if (entitytype == &amp;#039;Q3331189&amp;#039;) then --book edition&lt;br /&gt;
		funtype = cite.ouvrage&lt;br /&gt;
		&lt;br /&gt;
		-- TODO : gérer l&amp;#039;édition et l&amp;#039;élément de l&amp;#039;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&amp;#039;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;
	else -- default: output a very simple display&lt;br /&gt;
		local parameters = authors&lt;br /&gt;
		if title then &lt;br /&gt;
			 table.insert(parameters, &amp;#039;&amp;lt;i&amp;gt;&amp;#039; .. title .. &amp;#039;&amp;lt;/i&amp;gt;&amp;#039;)&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 options[&amp;#039;page&amp;#039;] then&lt;br /&gt;
			table.insert(parameters, &amp;#039;p.&amp;#039; .. options[&amp;#039;page&amp;#039;])&lt;br /&gt;
		end&lt;br /&gt;
		if options[&amp;#039;accessdate&amp;#039;] then&lt;br /&gt;
			table.insert(parameters, &amp;#039;consulté le &amp;#039; .. options[&amp;#039;accessdate&amp;#039;])&lt;br /&gt;
		end&lt;br /&gt;
		return linguistic.conj(parameters, &amp;#039;comma&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
	local parameters = {&lt;br /&gt;
		[&amp;#039;traducteur&amp;#039;] = translator,&lt;br /&gt;
		[&amp;#039;illustrateur&amp;#039;] = illustrator,&lt;br /&gt;
		[&amp;#039;préface&amp;#039;] = preface,&lt;br /&gt;
		[&amp;#039;postface&amp;#039;] = postface,&lt;br /&gt;
		[&amp;#039;photographe&amp;#039;] = photographe,&lt;br /&gt;
		[&amp;#039;titre&amp;#039;] = title,&lt;br /&gt;
		[&amp;#039;sous-titre&amp;#039;] = subtitle,&lt;br /&gt;
		--[&amp;#039;volume&amp;#039;] = volume,&lt;br /&gt;
		[&amp;#039;date&amp;#039;] = publishdate,&lt;br /&gt;
		[&amp;#039;lieu&amp;#039;] = publishplace,&lt;br /&gt;
		[&amp;#039;périodique&amp;#039;] = journal,&lt;br /&gt;
		--[&amp;#039;numéro&amp;#039;] = journalnumber,&lt;br /&gt;
		[&amp;quot;numéro d&amp;#039;édition&amp;quot;] = ednumber,&lt;br /&gt;
		[&amp;#039;éditeur&amp;#039;] = publisher,&lt;br /&gt;
		[&amp;#039;pages totales&amp;#039;] = pagenum,&lt;br /&gt;
		[&amp;#039;lire en ligne&amp;#039;] = url,&lt;br /&gt;
		[&amp;#039;wikisource&amp;#039;] = wikisource,&lt;br /&gt;
		[&amp;#039;oclc&amp;#039;] = oclc,&lt;br /&gt;
		[&amp;#039;bnf&amp;#039;] = bnf,&lt;br /&gt;
		[&amp;#039;lccn&amp;#039;] = lccn,&lt;br /&gt;
		[&amp;#039;dnb&amp;#039;] = dnb,&lt;br /&gt;
		[&amp;#039;doi&amp;#039;] = doi,&lt;br /&gt;
		[&amp;#039;pmid&amp;#039;] = pmid,&lt;br /&gt;
		[&amp;#039;jstor&amp;#039;] = jstor,&lt;br /&gt;
		[&amp;#039;bibcode&amp;#039;] = bibcode,&lt;br /&gt;
		[&amp;#039;arxiv&amp;#039;] = arxiv,&lt;br /&gt;
		[&amp;#039;pmcid&amp;#039;] = pmcid,&lt;br /&gt;
		[&amp;#039;langue&amp;#039;] = language,&lt;br /&gt;
		[&amp;#039;langue originale&amp;#039;] = originalLanguage,&lt;br /&gt;
		[&amp;#039;titre original&amp;#039;] = originalTitle,&lt;br /&gt;
		[&amp;#039;page&amp;#039;] = page,&lt;br /&gt;
		[&amp;#039;numéro&amp;#039;] = numero,&lt;br /&gt;
		[&amp;#039;volume&amp;#039;] = volume,&lt;br /&gt;
		[&amp;#039;plume&amp;#039;] = options[&amp;#039;plume&amp;#039;]&lt;br /&gt;
	}&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[&amp;#039;isbn&amp;#039; .. i] = isbn&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for i, issn in pairs(issns) do&lt;br /&gt;
		parameters[&amp;#039;issn&amp;#039; .. 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[&amp;#039;auteur&amp;#039; .. i]  or options[&amp;#039;directeur&amp;#039; .. i] or options[&amp;#039;responsabilité&amp;#039; .. 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[&amp;#039;auteur&amp;#039; .. i] = author&lt;br /&gt;
			parameters[&amp;#039;directeur&amp;#039; .. i] = are_director[i]&lt;br /&gt;
			parameters[&amp;#039;responsabilité&amp;#039; .. 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 == &amp;#039;-&amp;#039; then&lt;br /&gt;
			parameters[parameter] = &amp;#039;&amp;#039;&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;
		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;
-- pour tester&lt;br /&gt;
function reference.citeItem(frame)&lt;br /&gt;
	local args = frame:getParent().args&lt;br /&gt;
	return reference.citeitem(args[1], 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;Tpt</name></author>
	</entry>
</feed>