استعمال تعديل

الصق اللى بعد كده فى صفحة باراك اوباما، النتيجة ستكون كالتالي:

مناصب
عضو مجلس شيوخ امريكا [1]   تعديل قيمة خاصية المنصب (P39) في ويكي بيانات
عضو خلال الفترة
3 يناير 2005  – 3 يناير 2007 
فترة برلمانية كونجرس امريكا ال109  
بيتر فيتزجيرالد  
 
عضو مجلس شيوخ امريكا [1]   تعديل قيمة خاصية المنصب (P39) في ويكي بيانات
عضو خلال الفترة
3 يناير 2007  – 16 نوفمبر 2008 
فترة برلمانية كونجرس امريكا ال110  
 
رولاند بوريس  
رئيس امريكا المنتخب [2][3] (35 )   تعديل قيمة خاصية المنصب (P39) في ويكي بيانات
في المنصب
4 نوفمبر 2008  – 20 يناير 2009 
انتخب في انتخابات رياسة امريكا سنة 2008  
جورج ووكر بوش  
دونالد ترامب  
رئيس امريكا [4][5] (44 )   تعديل قيمة خاصية المنصب (P39) في ويكي بيانات
في المنصب
20 يناير 2009  – 20 يناير 2017 
انتخب في انتخابات رياسة امريكا سنة 2008 و انتخابات رياسة امريكا سنة 2012  
جورج ووكر بوش  
دونالد ترامب  
{{ص.م/فتح}}
{{معلومات صاحب منصب/منصب ويكي بيانات}}
{{ص.م/غلق}}

  1. مُعرِّف سيرة شخصر في الكونغرس الأمريكي (congbio): https://bioguide.congress.gov/search/bio/O000167 — تاريخ الاطلاع: 29 يناير 2021 — العنوان : Biographical Directory of the United States Congress — الناشر: مكتب النشر لحكومة الولايات المتحدة
  2. https://www.gala.fr/stars_et_gotha/barack_obama
  3. https://www.voici.fr/bios-people/barack-obama
  4. وصلة : مُعرِّف ملف الضبط الاستنادي الافتراضي الدَّولي (VIAF)  — الناشر: مركز المكتبة الرقمية على الإنترنت — الرخصة: Open Data Commons Attribution License
  5. Barack Obama — تاريخ الاطلاع: 9 مايو 2018
local p = {}

function p.office3( statement , options) -- used by قالب:معلومات صاحب منصب/منصب ويكي بيانات
		local value = statement.mainsnak.datavalue.value
		local start , finish , before , after , constituency , series ,electedin ,P1001 ,P108 ,P642 ,president ,premier , p5054 , P2937 = ""
   		local entit = getEntityIdFromValue( value )
    	local s = formatSnak( statement.mainsnak, options ).value
		if s then
		        local entit = getEntityIdFromValue( value )
        		local ca1 = formatStatements( {property ='P154', entityId = entit
        			, noref ='true' ,rank='all'	,size ='35',image ='image', firstvalue='true',separator='',conjunction=''})
        		local ca2 = formatStatements( {property ='P41', entityId = entit
        			, noref ='true' ,rank='all'	,size ='35',image ='image', firstvalue='true',separator='',conjunction=''})
        		if ca1 and ca1 ~= '' then  caca  =  ca1  else  caca  = ca2 end

        		local asdf = formatEntityId( entit , options ).value
        			if asdf and asdf  ~= '' then
        		if caca and caca  ~= '' then  s =  caca .. ' '.. asdf   else  s = asdf   end
				end
		if statement.references then
			if options.reff and options.reff ~= ''  then
				reff  = formatReferences( statement, options )
				s = s..reff
			end 
		end
		----------
		function qua(property, enbarten, modifytime)
			ca = formatStatements({property = property,illwd2= "t" ,  firstvalue= enbarten ,modifytime = modifytime}, statement.qualifiers) or ''
			if ca and ca ~='' 
			then
				return addTrackingCategory(ca ,{property=property,noicon='t'})
			else 
				return ca
			end
		end
		----------
	--if options.office2 and options.office2 ~= '' then
		if statement.qualifiers
			then
				if statement.qualifiers.P580 or statement.qualifiers.P582 or statement.qualifiers.P1365 or statement.qualifiers.P1366 
				then
					start	=	qua("P580", 'true', 'longdate')
					finish	=	qua("P582", 'true', 'longdate')
					before	=	qua("P1365", 'true', '')
					after	=	qua("P1366", 'true', '')
					constituency	=	qua("P768", '', '')
					series	=	qua("P1545", 'true', '')
					electedin	=qua("P2715", '', '')
					P1001	=	qua("P1001", '', '')
					P108	=	qua("P108", '', '')
					P642 = qua("P642", '', '')
					president = qua("P325", '', '')
					premier= qua("P6", '', '')
					p5054= qua("P5054", '', '')
					P2937= qua("P2937", '', '')
			end
				--if entit == "Q140686" and not P642 or P642 == "" then return s end
			end
		end
	s = mw.getCurrentFrame():expandTemplate{ title = "معلومات صاحب منصب/منصب ويكي بيانات/نواة"	, 
	args = {
		  office 		= s
		, termstart 	= start
		, termend 		= finish
		, constituency 	= constituency
		, predecessor	= before
		, successor 	= after
		, president		= president
		, premier 		= premier
		, series		= series
		, electedin		= electedin
		, jurisdiction	= P1001
		, employer		= P108
		, of			= P642
		, P2937			=  P2937
		, q = entit
		, P5054 = p5054
		, entityId		= options.entityId
		, co		= options.co
		}
	} 
	--end
	return s 
end

return p