<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ar">
	<id>https://www.copticpedia.org/index.php?action=history&amp;feed=atom&amp;title=%D9%88%D8%AD%D8%AF%D8%A9%3ACite</id>
	<title>وحدة:Cite - تاريخ المراجعة</title>
	<link rel="self" type="application/atom+xml" href="https://www.copticpedia.org/index.php?action=history&amp;feed=atom&amp;title=%D9%88%D8%AD%D8%AF%D8%A9%3ACite"/>
	<link rel="alternate" type="text/html" href="https://www.copticpedia.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Cite&amp;action=history"/>
	<updated>2026-04-24T07:27:03Z</updated>
	<subtitle>تاريخ التعديل لهذه الصفحة في الويكي</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://www.copticpedia.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Cite&amp;diff=73170&amp;oldid=prev</id>
		<title>Gerges: مراجعة واحدة</title>
		<link rel="alternate" type="text/html" href="https://www.copticpedia.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Cite&amp;diff=73170&amp;oldid=prev"/>
		<updated>2021-09-14T19:58:20Z</updated>

		<summary type="html">&lt;p&gt;مراجعة واحدة&lt;/p&gt;
&lt;p&gt;&lt;b&gt;صفحة جديدة&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--/-- Creates a timeline for an item based on various properties &lt;br /&gt;
local Known_properties = {&amp;quot;P304&amp;quot;,  &amp;quot;P50&amp;quot;, &amp;quot;P957&amp;quot;,  &amp;quot;P478&amp;quot;, &amp;quot;P98&amp;quot;, &amp;quot;P393&amp;quot;, &amp;quot;P1476&amp;quot;, &amp;quot;P357&amp;quot;, &amp;quot;P123&amp;quot;, &amp;quot;P577&amp;quot;, &amp;quot;P433&amp;quot;, &amp;quot;P275&amp;quot;, &amp;quot;P698&amp;quot;, &amp;quot;P356&amp;quot;, &amp;quot;P958&amp;quot;, &amp;quot;P1433&amp;quot;,  &amp;quot;P1680&amp;quot;, &amp;quot;P1683&amp;quot;, &amp;quot;P387&amp;quot;, &amp;quot;P1065&amp;quot; ,&amp;quot;P212&amp;quot;,&amp;quot;P854&amp;quot;,&amp;quot;P170&amp;quot;,&amp;quot;P248&amp;quot;,&amp;quot;P143&amp;quot;}--,&amp;quot;P345&amp;quot;&lt;br /&gt;
local p = {}&lt;br /&gt;
local wikidata = require('وحدة:Wikidata2').formatStatementsFromLua&lt;br /&gt;
local quall =  require('Module:Cite/quall')&lt;br /&gt;
--local wikidata2 = require('وحدة:Wikidata2').formatEntityId -- table&lt;br /&gt;
local Options = {}&lt;br /&gt;
&lt;br /&gt;
local function make_P345_link( s ) &lt;br /&gt;
	if not s then return nil end&lt;br /&gt;
	local IMDB_Table = {&lt;br /&gt;
	['tt'] = 'https://www.imdb.com/title/$1/',&lt;br /&gt;
	['co'] = 'https://www.imdb.com/search/title?companies=$1',&lt;br /&gt;
	['ev'] = 'https://www.imdb.com/event/$1/',&lt;br /&gt;
	['nm'] = 'https://www.imdb.com/name/$1/',&lt;br /&gt;
	['ni'] = 'https://www.imdb.com/news/$1/',&lt;br /&gt;
	}&lt;br /&gt;
	local s2 = s:sub(1,2)&lt;br /&gt;
	--mw.log(&amp;quot;s2&amp;quot; .. s2 )&lt;br /&gt;
	if IMDB_Table[s2] then &lt;br /&gt;
		local fo = mw.ustring.gsub( IMDB_Table[s2], '$1', s )&lt;br /&gt;
		return '[' .. fo .. ' ' .. fo .. ']' &lt;br /&gt;
	end&lt;br /&gt;
	return s&lt;br /&gt;
end&lt;br /&gt;
local function getentityprop(entity, p , pattern )&lt;br /&gt;
    -- get automatically url&lt;br /&gt;
    local addTracking = &amp;quot;&amp;quot; &lt;br /&gt;
	local Pattern = pattern or 'autourl4' --autourl3&lt;br /&gt;
	if p == &amp;quot;P345&amp;quot; then &lt;br /&gt;
		Pattern = &amp;quot;&amp;quot; &lt;br /&gt;
		addTracking = &amp;quot;&amp;quot; &lt;br /&gt;
		end&lt;br /&gt;
	local tot =  wikidata({textformat = &amp;quot;text&amp;quot;, property = p , pattern = Pattern , numval = 5, noref = 'true', conjunction = ' &amp;amp; ',enlabelcate ='true', addTrackingCat= addTracking&lt;br /&gt;
		, noicon = &amp;quot;t&amp;quot; , raw2  = Options.raw or &amp;quot;&amp;quot;&lt;br /&gt;
	})&lt;br /&gt;
	if not tot or tot == '' then&lt;br /&gt;
		tot =  wikidata({textformat = &amp;quot;text&amp;quot;,entityId = entity, property = p , pattern = Pattern , noref = 'true', conjunction = ' &amp;amp; ',enlabelcate ='true'&lt;br /&gt;
			, addTrackingCat= addTracking , noicon = &amp;quot;t&amp;quot; , raw2  = Options.raw or &amp;quot;&amp;quot;, numval = 5 })&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
    local tot2 = &amp;quot;&amp;quot; &lt;br /&gt;
	if p == &amp;quot;P345&amp;quot; then tot2 = make_P345_link(tot) end&lt;br /&gt;
	if tot2 and tot2 ~= '' then&lt;br /&gt;
		tot = tot2&lt;br /&gt;
	end&lt;br /&gt;
	if tot and tot ~= '' then&lt;br /&gt;
		tot = 'وصلة : ' .. tot&lt;br /&gt;
	end&lt;br /&gt;
	return  tot&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
   يجلب خواص معينة عند وجود مراجع محددة مسبقاً&lt;br /&gt;
--]]&lt;br /&gt;
local function getsomequall(entity, snak, property)&lt;br /&gt;
	if snak[property]&lt;br /&gt;
	and snak[property][1]&lt;br /&gt;
	and snak[property][1].datavalue&lt;br /&gt;
	and snak[property][1].datavalue.value['numeric-id']&lt;br /&gt;
	then &lt;br /&gt;
		id = snak[property][1].datavalue.value['numeric-id'] &lt;br /&gt;
		local l10n = quall[id]&lt;br /&gt;
		if l10n then&lt;br /&gt;
			local q = {}&lt;br /&gt;
			for _, v in pairs(l10n) do&lt;br /&gt;
				mw.log(&amp;quot;Module:Cite finding &amp;quot; .. v[1] .. &amp;quot;, id:&amp;quot; .. id .. &amp;quot;,3:&amp;quot; .. (v[3] or '' ) )&lt;br /&gt;
				b =  getentityprop (entity, v[1] , v[3])&lt;br /&gt;
				if b and b ~= '' &lt;br /&gt;
					then &lt;br /&gt;
						table.insert( q, b ) &lt;br /&gt;
						mw.log(&amp;quot;Module:Cite b &amp;quot; .. b )&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			t =  table.concat( q )&lt;br /&gt;
			if t and t ~= '' then&lt;br /&gt;
				return t&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function get_property_label( Id )&lt;br /&gt;
	local label = mw.wikibase.label( Id )&lt;br /&gt;
	return label&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function geturl(url,text)&lt;br /&gt;
	if url and url ~= '' then &lt;br /&gt;
		return '[' .. url .. ' ' .. (text or url) .. ']'&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function labeel(property,text)&lt;br /&gt;
		local pro = mw.wikibase.label( property ) &lt;br /&gt;
			if not text or text == '' then text = pro end &lt;br /&gt;
		if text then &lt;br /&gt;
			return text&lt;br /&gt;
		end&lt;br /&gt;
end&lt;br /&gt;
local function P1629(property,text)&lt;br /&gt;
	--local pro = wikidata({textformat = &amp;quot;text&amp;quot;,property = 'P1629', nolink = 'true', entityId = property, firstvalue = 'true', noref = 'true',enlabelcate ='true' , label = get_property_label(property) }) &lt;br /&gt;
	local pro = get_property_label(property)&lt;br /&gt;
	if not text or text == '' then text = pro end &lt;br /&gt;
	if text then &lt;br /&gt;
		return text&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function ValueFromItem(items, property,firstvalue)&lt;br /&gt;
	local pattern = 'autourl'&lt;br /&gt;
	if property =='P212' or property =='P957' then pattern = nil end -- no automatic link for ISBN&lt;br /&gt;
	for i, item in pairs(items) do&lt;br /&gt;
		ednumber = wikidata({textformat = &amp;quot;text&amp;quot;,entityId = item, property = property , firstvalue = firstvalue, pattern =pattern&lt;br /&gt;
			, noref = 'true', modifytime = 'longdate',enlabelcate ='true', numval = 5})&lt;br /&gt;
	end&lt;br /&gt;
	return ednumber &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function ValueFromEntityId(entity, property,firstvalue)&lt;br /&gt;
	local pattern = 'autourl'&lt;br /&gt;
	val = wikidata({textformat = &amp;quot;text&amp;quot;,entityId = entity, property = property, firstvalue = firstvalue, pattern = pattern&lt;br /&gt;
		, noref = 'true', modifytime = 'longdate',enlabelcate ='true', numval = 5})&lt;br /&gt;
	if val then &lt;br /&gt;
		return val &lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--local function GetValueFromEntityId(snak,entity, property, firstvalue)&lt;br /&gt;
local function GetValueFromEntityId(snak , property , firstvalue)&lt;br /&gt;
	--local A = wikidata({textformat = &amp;quot;text&amp;quot;,property = 'P1629', entityId = property,enlabelcate ='true' , firstvalue = 'true', noref = 'true', label = get_property_label( property )}) &lt;br /&gt;
	local A = get_property_label(property)&lt;br /&gt;
	local Pattern = &amp;quot;autourl&amp;quot;&lt;br /&gt;
	if property == &amp;quot;P345&amp;quot; then Pattern = &amp;quot;&amp;quot; end&lt;br /&gt;
	local prop = wikidata({textformat = &amp;quot;text&amp;quot;,property = property, firstvalue = firstvalue, noref = 'true'&lt;br /&gt;
		, pattern = Pattern, modifytime = 'longdate', numval = 5}, snak)&lt;br /&gt;
	--mw.log(&amp;quot;prop&amp;quot; .. prop )&lt;br /&gt;
	if property == &amp;quot;P345&amp;quot; then prop = make_P345_link(prop) end&lt;br /&gt;
	--mw.log('Module:Cite property:&amp;quot;' .. property .. '&amp;quot;' )&lt;br /&gt;
	--mw.log('Module:Cite prop:&amp;quot;' .. prop .. '&amp;quot;' )&lt;br /&gt;
	--if not prop then prop = ValueFromEntityId(entity, property,firstvalue) end&lt;br /&gt;
	if prop  and prop ~= '' then&lt;br /&gt;
		if A  and A ~= '' then&lt;br /&gt;
			return A .. ': ' .. prop&lt;br /&gt;
		else&lt;br /&gt;
			return prop&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function GetValueFromItem(items, snak, property , text,firstvalue)&lt;br /&gt;
	local pattern = 'autourl'&lt;br /&gt;
	if property =='P212' or property =='P957' then pattern = nil end -- no automatic link for ISBN&lt;br /&gt;
	local prop = wikidata({textformat = &amp;quot;text&amp;quot;,property = property&lt;br /&gt;
		, firstvalue = firstvalue&lt;br /&gt;
		, pattern = pattern&lt;br /&gt;
		, numval = 5&lt;br /&gt;
		, noref = 'true'&lt;br /&gt;
		, modifytime = 'longdate'&lt;br /&gt;
		,enlabelcate ='true'}, snak)&lt;br /&gt;
	if not prop &lt;br /&gt;
		then prop = ValueFromItem(items, property,firstvalue)&lt;br /&gt;
	end&lt;br /&gt;
	if prop and prop ~= '' then&lt;br /&gt;
		if text and text ~= '' then prop  = text ..': '.. prop end&lt;br /&gt;
	end&lt;br /&gt;
	return prop&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function get_number_from_item(items, property)&lt;br /&gt;
	for i, item in pairs(items) do&lt;br /&gt;
		ednumber = wikidata({textformat = &amp;quot;text&amp;quot;,entityId = item, property = property, firstvalue = 'yes',enlabelcate ='true', numval = 5})&lt;br /&gt;
		if ednumber then &lt;br /&gt;
			return ednumber &lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
local function getnumber(items, snak, property,text)&lt;br /&gt;
&lt;br /&gt;
	--local tex = wikidata({textformat = &amp;quot;text&amp;quot;,property = 'P1629', entityId = property, firstvalue = 'true', noref = 'true', label = get_property_label(property ) &lt;br /&gt;
		--, label = wikidata2(property, {nolink = 'true', noref = 'true',enlabelcate ='true'}).value&lt;br /&gt;
	--})&lt;br /&gt;
	local tex = get_property_label(property ) &lt;br /&gt;
&lt;br /&gt;
	local number = wikidata({textformat = &amp;quot;text&amp;quot;,property = property, firstvalue = 'true',enlabelcate ='true', numval = 5}, snak)&lt;br /&gt;
	if not number then&lt;br /&gt;
		number = get_number_from_item(items, property)&lt;br /&gt;
	end&lt;br /&gt;
    if not text then text = tex else end&lt;br /&gt;
&lt;br /&gt;
	if number  and number ~= '' then&lt;br /&gt;
		 if text then&lt;br /&gt;
		 	return text ..': '.. number  &lt;br /&gt;
	 			else return number&lt;br /&gt;
	 		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function GetItemValue(items, snak, property , text,firstvalue)&lt;br /&gt;
	local pattern = 'autourl'&lt;br /&gt;
	--	if property =='P212' or property =='P957' then pattern = nil end -- no automatic link for ISBN&lt;br /&gt;
	local prop = wikidata({textformat = &amp;quot;text&amp;quot;,property = property, firstvalue = (firstvalue or ''), pattern = pattern, noref = 'true', modifytime = 'longdate'&lt;br /&gt;
		,separator='، و',conjunction='، و', numval = 5}, snak)&lt;br /&gt;
		if not prop then prop = ValueFromItem(items, property,(firstvalue or '')) end&lt;br /&gt;
	&lt;br /&gt;
	if prop and prop ~= '' then&lt;br /&gt;
		if text and text ~= '' then prop  = text ..': ' .. prop end&lt;br /&gt;
	end&lt;br /&gt;
	return prop&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function GetNumberFromItem(items, snak, property , text,firstvalue)&lt;br /&gt;
	local prop = wikidata({textformat = &amp;quot;text&amp;quot;,property = property, firstvalue = 't', numval = 5}, snak)&lt;br /&gt;
	for i, item in pairs(items) do&lt;br /&gt;
		ednumber = wikidata({textformat = &amp;quot;text&amp;quot;,entityId = item, property = property , firstvalue = 'true', noref = 'true', numval = 5})&lt;br /&gt;
	end&lt;br /&gt;
		if not prop then prop = ednumber  end&lt;br /&gt;
	if prop and prop ~= '' then&lt;br /&gt;
		if text and text ~= '' then prop  = text .. prop end&lt;br /&gt;
	end&lt;br /&gt;
	return prop&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
  جلب أي وصلة مرجع من الخواص مثل&lt;br /&gt;
     P1065,P854&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
local function getLink(items, snak, property,text)&lt;br /&gt;
	-- local tex = labeel(property,text)&lt;br /&gt;
	local links = wikidata({textformat = &amp;quot;text&amp;quot;,property = property, pattern = 'true', noref = 'true' , firstvalue = 'true', numval = 5}, snak)&lt;br /&gt;
	if links and links ~= '' then&lt;br /&gt;
		if text and text ~= '' &lt;br /&gt;
			then return geturl(links,text)&lt;br /&gt;
			else return links&lt;br /&gt;
 		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
local function get_Link_from_item(items, snak, property,text)&lt;br /&gt;
	local links = ValueFromItem(items, property,'true')&lt;br /&gt;
	local tex = labeel(property,text)&lt;br /&gt;
	if links and links ~= '' then&lt;br /&gt;
		if tex and tex ~= '' &lt;br /&gt;
			then return  tex ..': '.. links&lt;br /&gt;
			else return links&lt;br /&gt;
 		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
--[[&lt;br /&gt;
  جلب أي تاريخ من الخواص مثل&lt;br /&gt;
     P813,P577&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
local function getdate( snak, property,text)&lt;br /&gt;
	-- local tex = labeel(property,text)&lt;br /&gt;
	if snak[property] then&lt;br /&gt;
		local dat = wikidata({textformat = &amp;quot;text&amp;quot;,property = property, pattern = 'true', noref = 'true', modifytime = 'longdate', numval = 5}, snak)&lt;br /&gt;
		if dat and dat ~= '' then&lt;br /&gt;
			if text and text ~= '' &lt;br /&gt;
				then return text .. ': '.. dat&lt;br /&gt;
				else return dat&lt;br /&gt;
	 		end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getdate1(items, snak, property,text)&lt;br /&gt;
	for i, item in pairs(items) do&lt;br /&gt;
		local datetime1 = wikidata({textformat = &amp;quot;text&amp;quot;,entityId = item, property =property, noref = 'true',enlabelcate ='true', modifytime = 'longdate' , numval = 5})&lt;br /&gt;
	end&lt;br /&gt;
	if text then&lt;br /&gt;
		return text ..': '.. datetime1&lt;br /&gt;
			else return datetime1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getedition(items, snak )&lt;br /&gt;
	local ordning = {'الأول', 'الثاني', 'الثالث', 'الرابع', 'الخامس', 'السادس', 'السابع', 'الثامن', 'التاسع', 'العاشر', 'الحادي عشر', 'الثاني عشر'}&lt;br /&gt;
	local ednumber;&lt;br /&gt;
	if snak['P393'] then&lt;br /&gt;
		ednumber = wikidata({textformat = &amp;quot;text&amp;quot;,property = 'P393', firstvalue = 'true',enlabelcate ='true', numval = 5}, snak)&lt;br /&gt;
	else&lt;br /&gt;
		ednumber = get_number_from_item(items, &amp;quot;P393&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	if not ednumber then &lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if not tonumber(ednumber) then&lt;br /&gt;
		return  ' الاصدار ' .. ednumber &lt;br /&gt;
	end&lt;br /&gt;
	if ordning[tonumber(ednumber)] then&lt;br /&gt;
		return  ' الاصدار ' .. ordning[tonumber(ednumber)] &lt;br /&gt;
	end&lt;br /&gt;
	local sist = string.sub(ednumber, string.len(ednumber))&lt;br /&gt;
	if sist == '1' or sist == '2' then&lt;br /&gt;
		return  ' : الاصدار ' .. ednumber &lt;br /&gt;
	else&lt;br /&gt;
		return ' : الاصدار ' .. ednumber &lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getsubtitle(items, snak)-- needs i18n some languages do not use this format&lt;br /&gt;
	local s = {}&lt;br /&gt;
	if snak['P1680'] then&lt;br /&gt;
		table.insert(s, wikidata({textformat = &amp;quot;text&amp;quot;,property = 'P1680', firstvalue = 'true',enlabelcate ='true', numval = 5}, snak))&lt;br /&gt;
	else&lt;br /&gt;
		for i, item in pairs( items) do&lt;br /&gt;
			local lab = wikidata({textformat = &amp;quot;text&amp;quot;,property = 'P1680',enlabelcate ='true', entityId = item, firstvalue = 'true', noref = 'true', numval = 5})&lt;br /&gt;
			local sitelink = mw.wikibase.sitelink( item )&lt;br /&gt;
			if sitelink and lab then&lt;br /&gt;
				table.insert(s, '[[:' .. sitelink .. '|' .. lab .. ']]')&lt;br /&gt;
			elseif sitelink then&lt;br /&gt;
				table.insert(s, '[[:' .. sitelink .. ']]')&lt;br /&gt;
			elseif lab then&lt;br /&gt;
				table.insert(s, lab)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	tot = table.concat(s, ' — ')&lt;br /&gt;
	if tot and tot ~= '' then&lt;br /&gt;
		return tot&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 gettitle(items, snak)&lt;br /&gt;
	local link = getLink(items, snak, 'P854') or getLink(items, snak, 'P1065','')  -- the title will be with the link&lt;br /&gt;
	local title = GetItemValue(items, snak, 'P1476' ,  'العنوان ' ,' ')&lt;br /&gt;
	local subtitle = GetItemValue(items, snak, 'P1680' ,  'العنوان ' ,' ')&lt;br /&gt;
		if not title or title =='' then title = subtitle end&lt;br /&gt;
		if link and link ~= ''&lt;br /&gt;
		then&lt;br /&gt;
			return '' &lt;br /&gt;
		else &lt;br /&gt;
			return title&lt;br /&gt;
		end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getwhatever(snak, property)&lt;br /&gt;
	if snak[property] then&lt;br /&gt;
		--mw.log(&amp;quot;Module:Cite getwhatever property &amp;quot; .. property)&lt;br /&gt;
		local a = get_property_label(property)&lt;br /&gt;
		--local a = wikidata({textformat = &amp;quot;text&amp;quot;,property = 'P1629', entityId = property, firstvalue = 'true', noref = 'true',enlabelcate ='true', label =  get_property_label(property)}) &lt;br /&gt;
			&lt;br /&gt;
		local s = {}&lt;br /&gt;
		--local items = {}&lt;br /&gt;
		--mw.log(&amp;quot;Module:Cite find snak.property &amp;quot; .. property)&lt;br /&gt;
		for j, prop in pairs(snak[property]) do&lt;br /&gt;
			if prop.snaktype == 'value' then&lt;br /&gt;
				item = 'Q' .. prop.datavalue.value['numeric-id']&lt;br /&gt;
				--table.insert(items, item)&lt;br /&gt;
				faso =  wikidata({textformat = &amp;quot;text&amp;quot;,entityId = item, property = property, noref = 'true', conjunction = ', ',enlabelcate ='true', numval = 5})&lt;br /&gt;
				table.insert( s, faso )&lt;br /&gt;
			end &lt;br /&gt;
		end&lt;br /&gt;
		if property == &amp;quot;P143&amp;quot; then a = 'مستورد من ' end&lt;br /&gt;
		if property == &amp;quot;P248&amp;quot; then a = &amp;quot;'''مذكور في'''&amp;quot; end&lt;br /&gt;
		--table.insert(s, wikidata({textformat = &amp;quot;text&amp;quot;,property = property, conjunction = ', ',enlabelcate ='true'}, snak))&lt;br /&gt;
		if #s &amp;gt; 0 then&lt;br /&gt;
			return (a or  '') .. &amp;quot;''':''' &amp;quot; .. table.concat(s, ', ')&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--local function gettherest(snak, entity)&lt;br /&gt;
local function gettherest(snak)&lt;br /&gt;
	local s = {}&lt;br /&gt;
	for property, j in pairs(snak) do&lt;br /&gt;
		Known = false&lt;br /&gt;
		for k, l in pairs(Known_properties) do&lt;br /&gt;
			if property == l then &lt;br /&gt;
				Known = true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if not Known then&lt;br /&gt;
			local entity1 = mw.wikibase.getEntityObject( property )&lt;br /&gt;
			if entity1.claims and ( entity1.datatype == 'string' or entity1.datatype == 'external-id' ) then&lt;br /&gt;
				--local vaa =  GetValueFromEntityId(snak , entity , property , 'true' )&lt;br /&gt;
				local vaa =  GetValueFromEntityId(snak , property , 'true' )&lt;br /&gt;
				--mw.log(&amp;quot;Module:Cite gettherest property:&amp;quot; .. property )&lt;br /&gt;
				table.insert(s, vaa) &lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if #s &amp;gt; 0 then&lt;br /&gt;
		return table.concat(s, ' — ')&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function numbers( items, snak)&lt;br /&gt;
	local section  = GetNumberFromItem(items, snak, 'P958','الباب: ')&lt;br /&gt;
	local volume  = GetNumberFromItem(items, snak, 'P478','المجلد: ')&lt;br /&gt;
	local page = GetNumberFromItem(items, snak, 'P304','الصفحة: ')&lt;br /&gt;
	local issue = GetNumberFromItem(items, snak, 'P433','العدد: ')&lt;br /&gt;
&lt;br /&gt;
	field = {}&lt;br /&gt;
		if section and section ~= '' then 	table.insert(field, section)	end&lt;br /&gt;
		if volume and volume ~= '' then 	table.insert(field, volume)	end&lt;br /&gt;
		if page and page ~= '' then 	table.insert(field, page)	end&lt;br /&gt;
		if issue and issue ~= '' then 	table.insert(field, issue)	end&lt;br /&gt;
	return table.concat(field, ' — ')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getISBN(items, snak)&lt;br /&gt;
	local ISBN13 = GetNumberFromItem(items, snak, 'P212' ,'ISBN ','yes') --ISBN 13&lt;br /&gt;
	local ISBN10 = GetNumberFromItem(items, snak, 'P957' ,'ISBN ','yes')  --ISBN 10&lt;br /&gt;
		if not ISBN13 or ISBN13 =='' then ISBN13 = ISBN10 end&lt;br /&gt;
	return ISBN13  &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function doipmid( items, snak)&lt;br /&gt;
	local doi = GetValueFromItem(items, snak, &amp;quot;P356&amp;quot; )-- Digital Object Identifier&lt;br /&gt;
	local pmid = GetValueFromItem(items, snak, &amp;quot;P698&amp;quot; )-- Identifier for journal &lt;br /&gt;
	local pmc = GetValueFromItem(items, snak,'P932')-- identifier issued by PubMed Central&lt;br /&gt;
	field = {}&lt;br /&gt;
	if doi and doi ~= '' then 	table.insert(field, doi)	end&lt;br /&gt;
	if pmid and pmid ~= '' then 	table.insert(field, pmid)	end&lt;br /&gt;
	if pmc and pmc ~= '' then 	table.insert(field, pmc)	end&lt;br /&gt;
	return table.concat(field, ' — ')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function Getquall(snak , entity)&lt;br /&gt;
	local quall = getsomequall(entity, snak, &amp;quot;P143&amp;quot; )&lt;br /&gt;
	local quall1 = getsomequall(entity, snak, &amp;quot;P248&amp;quot; )&lt;br /&gt;
		if not quall or quall =='' then quall = quall1 end&lt;br /&gt;
	return quall&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function getMultiLink(items, snak , entity)&lt;br /&gt;
	local title = GetItemValue(items, snak, 'P1476' ,'' ,'')&lt;br /&gt;
	local link = getLink(items, snak, 'P854',title)--,'وصلة مرجع'&lt;br /&gt;
	local link1 = get_Link_from_item(items, snak, 'P854') -- &lt;br /&gt;
	--local therest = gettherest(snak, entity)&lt;br /&gt;
	local therest = gettherest(snak)&lt;br /&gt;
	local quall = Getquall(snak , entity)&lt;br /&gt;
	local fulltext = get_Link_from_item(items, snak, 'P953') -- &lt;br /&gt;
	local accessdate =getdate(snak, 'P813','تاريخ الاطلاع')&lt;br /&gt;
	local archive  = getLink(items, snak, 'P1065','')&lt;br /&gt;
	field = {}&lt;br /&gt;
	if link and link ~= '' 					then newtab = link  --We don't need to search for some links if they here already&lt;br /&gt;
	elseif therest and therest ~= ''  		then newtab = therest &lt;br /&gt;
	elseif quall and quall ~= ''  			then newtab = quall &lt;br /&gt;
	elseif link1 and link1 ~= ''  			then newtab = link1  -- last thing we want to see&lt;br /&gt;
	elseif fulltext and fulltext ~= ''  	then newtab = fulltext&lt;br /&gt;
	end&lt;br /&gt;
	if link and link ~='' then if archive and archive ~='' then archiveandlink = 't' end end&lt;br /&gt;
		if newtab and newtab ~= '' then&lt;br /&gt;
			table.insert(field, newtab) &lt;br /&gt;
			if accessdate and accessdate ~= '' then table.insert(field, accessdate)  end&lt;br /&gt;
		end&lt;br /&gt;
	if archiveandlink and archiveandlink ~= '' &lt;br /&gt;
	then &lt;br /&gt;
		return '' &lt;br /&gt;
	else&lt;br /&gt;
		return table.concat(field, ' — ')&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function getarchiveLink(items, snak , entity)&lt;br /&gt;
	local title = GetItemValue(items, snak, 'P1476' ,'' ,'')&lt;br /&gt;
	local link = getLink(items, snak, 'P854','')&lt;br /&gt;
&lt;br /&gt;
	local archive  = getLink(items, snak, 'P1065','')&lt;br /&gt;
	local archive1  = getLink(items, snak, 'P1065','وصلة ارشيفية')&lt;br /&gt;
	local archivedate =getdate(snak, 'P2960','')-- تاريخ الأرشفة&lt;br /&gt;
	local accessdate =getdate(snak, 'P813','تاريخ الاطلاع')&lt;br /&gt;
	local aa =  geturl((archive or link),title)&lt;br /&gt;
	&lt;br /&gt;
	field = {}&lt;br /&gt;
	if archive and archive ~= '' then &lt;br /&gt;
		if aa and aa ~= '' then table.insert(field, aa) end&lt;br /&gt;
		if link and link ~='' then&lt;br /&gt;
			org = geturl(link,'الأصل')&lt;br /&gt;
			if accessdate and accessdate ~= '' then table.insert(field, accessdate)  end&lt;br /&gt;
		end&lt;br /&gt;
			a =  ' مؤرشف من ' .. (org or 'الأصل')&lt;br /&gt;
			if archivedate and archivedate ~= ''  then a =a ..   ' في ' 	.. archivedate end&lt;br /&gt;
			table.insert(field, a)&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(field, ' — ')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function getreftable( items, snak , hash , options )&lt;br /&gt;
    local entity = options.entityId&lt;br /&gt;
	local author = GetValueFromItem(items, snak, 'P50','المؤلف')&lt;br /&gt;
	--local editor = getEditor(items, snak )&lt;br /&gt;
	local editor = GetValueFromItem(items, snak, 'P98','المحرر')&lt;br /&gt;
	local title = gettitle(items, snak )&lt;br /&gt;
	local publisher = GetValueFromItem(items, snak, 'P123','الناشر')&lt;br /&gt;
	local creator = GetValueFromItem(items, snak, 'P170','المخترع')&lt;br /&gt;
	local publishedin = GetValueFromItem(items, snak, 'P1433','نشر في')&lt;br /&gt;
&lt;br /&gt;
	--local publishedin = getpublishedin(items, snak )&lt;br /&gt;
	--local publishdate = getPublishdate(items, snak )&lt;br /&gt;
	local publishdate = getdate( snak, 'P577','تاريخ النشر')&lt;br /&gt;
	local edition = getedition(items, snak )&lt;br /&gt;
	local number = numbers( items, snak)&lt;br /&gt;
	local doipmid = doipmid( items , snak)&lt;br /&gt;
	local isbn = getISBN(items, snak ) --0&lt;br /&gt;
&lt;br /&gt;
	--local whatever= whatever(items, snak, &amp;quot;P212&amp;quot; )&lt;br /&gt;
	local import = getwhatever(snak, &amp;quot;P143&amp;quot; ) or getwhatever(snak, &amp;quot;P248&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
	local MultiLink = getMultiLink(items, snak , entity)&lt;br /&gt;
	local archiveLink = getarchiveLink(items, snak , entity)&lt;br /&gt;
	&lt;br /&gt;
	local license = GetItemValue(items, snak, 'P275','الرخصة')&lt;br /&gt;
	local quote =  GetItemValue(items, snak, 'P1683' ,  'إقتباس' ,' ') --  &lt;br /&gt;
	if title and title ~= '' and subtitle and subtitle ~= '' then &lt;br /&gt;
		--title = title .. ' : ' .. subtitle&lt;br /&gt;
	end&lt;br /&gt;
	for i, item in pairs(items) do&lt;br /&gt;
		if item == 'Q36578' &lt;br /&gt;
			then edition,author  = nil,nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	field = {}&lt;br /&gt;
	--if whatever and whatever ~= '' then table.insert(field,whatever) end&lt;br /&gt;
	if import and import ~= '' then table.insert(field, import) end&lt;br /&gt;
	&lt;br /&gt;
	if MultiLink and MultiLink ~= '' then table.insert(field, MultiLink)  end&lt;br /&gt;
	if archiveLink and archiveLink ~= '' then table.insert(field, archiveLink)  end&lt;br /&gt;
&lt;br /&gt;
	if author and author ~= '' then table.insert(field, author) end&lt;br /&gt;
	if editor and editor ~= '' then table.insert(field, editor) end&lt;br /&gt;
	if title and title ~= '' then table.insert(field, title) end&lt;br /&gt;
	if edition and edition ~= '' then table.insert(field, edition) end&lt;br /&gt;
	if number and number ~= '' then 	table.insert(field, number)	end&lt;br /&gt;
&lt;br /&gt;
	if publisher and publisher ~= '' then table.insert(field, publisher) end&lt;br /&gt;
	if creator and creator ~= '' then table.insert(field, creator) end&lt;br /&gt;
	if publishedin and publishedin ~= '' then table.insert(field, publishedin) end&lt;br /&gt;
	if publishdate and publishdate ~= '' then table.insert(field, publishdate) end&lt;br /&gt;
    if appliestopart and appliestopart ~= '' then table.insert(field, appliestopart) end&lt;br /&gt;
	if isbn and isbn ~= '' then 	table.insert(field, isbn)	end&lt;br /&gt;
	if doipmid and doipmid ~= '' then 	table.insert(field, doipmid)	end&lt;br /&gt;
&lt;br /&gt;
	if quote and quote  ~= '' then table.insert(field, quote ) end&lt;br /&gt;
	if license and license ~= '' and #field &amp;gt; 0 then table.insert(field, license) end&lt;br /&gt;
	&lt;br /&gt;
	local doo =  table.concat(field, ' — ')&lt;br /&gt;
	if doo and doo ~= '' then&lt;br /&gt;
		return doo --mw.getCurrentFrame():extensionTag( 'ref', doo, {name = hash} )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function findblacklist(items)&lt;br /&gt;
	 -- function to ignore Sister projects&lt;br /&gt;
	local val = 'false'&lt;br /&gt;
	local s = {}&lt;br /&gt;
		for i, item in pairs(items) do&lt;br /&gt;
			function qoo(item,property)&lt;br /&gt;
				return wikidata({textformat = &amp;quot;text&amp;quot;,entityId = item, property = property , noref = 'true',firstvalue='1',formatting = 'raw', numval = 5})&lt;br /&gt;
			end&lt;br /&gt;
			local wiki = qoo(item, 'P1800') or qoo(item, 'P1566') or qoo(item,'P21') -- all wikimedia site ,GeoNames ,gender&lt;br /&gt;
			local wik2 = qoo(item, 'P31')&lt;br /&gt;
			local blackk = {&amp;quot;Q20651139&amp;quot;&lt;br /&gt;
				,  &amp;quot;Q465&amp;quot;&lt;br /&gt;
				, &amp;quot;Q15241312&amp;quot; &lt;br /&gt;
				, &amp;quot;Q30069253&amp;quot; -- ظهور مشكلة غير معروفة السبب في كريستوفر_تولكين [[موضوع:Veus9rhajrejwaho]]&lt;br /&gt;
				, 'Q52'  -- Wikipedia &lt;br /&gt;
				} &lt;br /&gt;
			for k, b in pairs(blackk) do&lt;br /&gt;
				if item == b then  val = 'true' end&lt;br /&gt;
			end&lt;br /&gt;
			if wiki and wiki  ~= ''&lt;br /&gt;
				then val = 'true'&lt;br /&gt;
				elseif wik2 == 'Q5' -- Human is not a direct reference&lt;br /&gt;
					or wik2 == 'Q184188'  -- Also Canton&lt;br /&gt;
					or wik2 == 'Q1250464' then val = 'true' -- Also places&lt;br /&gt;
			end&lt;br /&gt;
	end&lt;br /&gt;
	return val&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local ref_cash = {}&lt;br /&gt;
&lt;br /&gt;
function p.citeitem( items, snak , hash , options , notag)&lt;br /&gt;
	Options = options&lt;br /&gt;
	if hash and hash ~= &amp;quot;&amp;quot; and ref_cash[hash] then &lt;br /&gt;
		--mw.log(&amp;quot;Module:Cite ref_cash[hash] = &amp;quot; .. hash)&lt;br /&gt;
		return ref_cash[hash] &lt;br /&gt;
	end&lt;br /&gt;
	if not items and not snak then return nil end&lt;br /&gt;
	if type(items) == 'string' then&lt;br /&gt;
		items= {items}&lt;br /&gt;
	end&lt;br /&gt;
	items= {}&lt;br /&gt;
	if snak.P248 then&lt;br /&gt;
		for j, prop in pairs(snak.P248) do&lt;br /&gt;
			if prop.snaktype == 'value' then&lt;br /&gt;
				table.insert(items, 'Q' .. prop.datavalue.value['numeric-id'])&lt;br /&gt;
			end &lt;br /&gt;
		end&lt;br /&gt;
	elseif snak.P143 then&lt;br /&gt;
		for j, prop in pairs(snak.P143) do&lt;br /&gt;
			if prop.snaktype == 'value' then&lt;br /&gt;
			table.insert(items, 'Q' .. prop.datavalue.value['numeric-id'])&lt;br /&gt;
			end &lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local blacklist1 = findblacklist(items)&lt;br /&gt;
	if blacklist1 == 'true' then return nil end&lt;br /&gt;
	--local findtype = FindTypeOfRefrence(items, snak, options)&lt;br /&gt;
	local refrence = getreftable( items, snak , hash , options )&lt;br /&gt;
	if refrence and refrence ~=''  then&lt;br /&gt;
		if notag and notag ~=''  then&lt;br /&gt;
			refrence = refrence&lt;br /&gt;
		else&lt;br /&gt;
			refrence = mw.getCurrentFrame():extensionTag( 'ref', refrence, {name = hash} )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if hash and hash ~= &amp;quot;&amp;quot; then &lt;br /&gt;
		ref_cash[hash] = refrence&lt;br /&gt;
	end&lt;br /&gt;
	return refrence&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.citeitem2( ref , options , notag)&lt;br /&gt;
	Options = options&lt;br /&gt;
	if not ref then return nil end&lt;br /&gt;
	local hash = ref.hash&lt;br /&gt;
	local snak = ref.snaks&lt;br /&gt;
	local snnaks = &amp;quot;&amp;quot;&lt;br /&gt;
	if hash and hash ~= &amp;quot;&amp;quot; and ref_cash[hash] then &lt;br /&gt;
		--mw.log(&amp;quot;Module:Cite ref_cash[hash] = &amp;quot; .. hash)&lt;br /&gt;
		return ref_cash[hash] &lt;br /&gt;
	end&lt;br /&gt;
	for Px, prope in pairs(snak) do&lt;br /&gt;
		snnaks = snnaks .. &amp;quot;,&amp;quot; .. Px&lt;br /&gt;
	end&lt;br /&gt;
	--mw.log( &amp;quot;Module:Cite Citeitem2 hash: &amp;quot; ..  hash )&lt;br /&gt;
	--mw.log( &amp;quot;Module:Cite *snnaks : &amp;quot; ..  snnaks )&lt;br /&gt;
	items= {}&lt;br /&gt;
	if snak.P248 then&lt;br /&gt;
		for j, prop in pairs(snak.P248) do&lt;br /&gt;
			if prop.snaktype == 'value' then&lt;br /&gt;
				table.insert(items, 'Q' .. prop.datavalue.value['numeric-id'])&lt;br /&gt;
			end &lt;br /&gt;
		end&lt;br /&gt;
	elseif snak.P143 then&lt;br /&gt;
		for j, prop in pairs(snak.P143) do&lt;br /&gt;
			if prop.snaktype == 'value' then&lt;br /&gt;
			table.insert(items, 'Q' .. prop.datavalue.value['numeric-id'])&lt;br /&gt;
			end &lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local blacklist1 = findblacklist(items)&lt;br /&gt;
	if blacklist1 == 'true' then return nil end&lt;br /&gt;
	--local findtype = FindTypeOfRefrence(items, snak, options)&lt;br /&gt;
	local refrence = getreftable( items, snak , hash , options )&lt;br /&gt;
	if refrence and refrence ~='' then&lt;br /&gt;
		if notag and notag ~='' then&lt;br /&gt;
			refrence = refrence&lt;br /&gt;
			else&lt;br /&gt;
			refrence = mw.getCurrentFrame():extensionTag( 'ref', refrence, {name = hash} )&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	if hash and hash ~= &amp;quot;&amp;quot; then &lt;br /&gt;
		ref_cash[hash] = refrence&lt;br /&gt;
	end&lt;br /&gt;
	return refrence&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.reflist(frame)&lt;br /&gt;
	local list = mw.text.split( frame.args.item, ' ')&lt;br /&gt;
	local s = {}&lt;br /&gt;
	for i, j in pairs(list) do&lt;br /&gt;
    	local item = mw.wikibase.getEntityObject( mw.text.trim(j) )&lt;br /&gt;
		local str = p.citeitem( {mw.text.trim(j)} , item.claims, mw.text.trim(j)..i , frame.args , 't')&lt;br /&gt;
		if str then table.insert(s, '*'.. str) end&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(s, '\n')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.cite(frame)&lt;br /&gt;
    	local item = mw.wikibase.getEntityObject( frame.args.item )&lt;br /&gt;
    	if not item then return 'no item ' end&lt;br /&gt;
    		return p.citeitem( {frame.args.item} , item.claims, frame.args.item, frame.args , 't')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.listquall(frame)&lt;br /&gt;
	local list = mw.html.create(&amp;quot;table&amp;quot;)&lt;br /&gt;
	list:addClass(&amp;quot;wikitable sortable collapsible&amp;quot;)&lt;br /&gt;
	local head = list:tag(&amp;quot;tr&amp;quot;)&lt;br /&gt;
	head:tag(&amp;quot;th&amp;quot;):wikitext(&amp;quot;#&amp;quot;)&lt;br /&gt;
	head:tag(&amp;quot;th&amp;quot;):wikitext(&amp;quot;العنصر&amp;quot;)&lt;br /&gt;
	head:tag(&amp;quot;th&amp;quot;):wikitext(&amp;quot;الخاصية&amp;quot;)&lt;br /&gt;
	local number = 0&lt;br /&gt;
	for v, nam in pairs(quall) do&lt;br /&gt;
		for _1, nam1 in pairs(nam) do&lt;br /&gt;
			number = number + 1&lt;br /&gt;
			local row = list:tag(&amp;quot;tr&amp;quot;)&lt;br /&gt;
			row:tag(&amp;quot;td&amp;quot;):tag(&amp;quot;span&amp;quot;):wikitext(number)&lt;br /&gt;
			local th = row:tag(&amp;quot;td&amp;quot;)&lt;br /&gt;
			local rr = row:tag(&amp;quot;td&amp;quot;)&lt;br /&gt;
			local dd = frame:preprocess(&amp;quot;{{Q|Q&amp;quot;.. v ..&amp;quot;}}&amp;quot;) &lt;br /&gt;
			th:tag(&amp;quot;span&amp;quot;):wikitext(dd)&lt;br /&gt;
			local u = frame:preprocess(&amp;quot;{{P|&amp;quot;.. nam1[1] ..&amp;quot;}}&amp;quot;) &lt;br /&gt;
			rr:tag(&amp;quot;span&amp;quot;):wikitext(u)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return list&lt;br /&gt;
end	&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Gerges</name></author>
	</entry>
</feed>