local generic = require( 'وحدة:بطاقة/أدوات' )
local xmath = require("Module:Math")

local function convert_deg2HMS(D)
	local H= math.floor(D / 15)
	local M = math.floor( ((D/15 - H) % 14 )*60) 
	local S= xmath.round({precision = 3, value = (((D/15-H)*60) - M)*60 })

	return string.format("%02d:%02d:%05.3d",H,M,S)
end
--[[
    FROM: module:Coordinates 
   -- 
   Helper function, convert decimal to degrees, minutes, and seconds 
]]
local function convert_dec2dms_dms(coordinate)
	coordinate = xmath._round( coordinate * 60 * 60, 0 );
	local s = coordinate % 60
	coordinate = math.floor( (coordinate - s) / 60 );
	local m = coordinate % 60
	coordinate = math.floor( (coordinate - m) / 60 );
	local d = coordinate % 360 .."°"

	return d .. string.format( "%02d′", m ) .. string.format( "%02d″", s )
end

local d1 = "Q18650988,Q63106470,Q63106482,Q63170811,Q3157041, Q63106520,Q63170831,Q63171248,Q63100559,Q63108234,Q16172167, Q63183653,Q63100584,Q63100595,Q63183392,Q63182478,Q63183687,Q63100601, Q63100611,Q15941028,Q63183538,Q63182937,Q63183721,Q11069306,Q63106574,Q11069306,Q63183636,Q140588"

return 	{
    maincolor = '#CEDEFF', -- اللون المستعمل لعنوان البطاقة
    wikimod = 'Wikidata.Ca',
    parts = { -- محتويات البطاقة
		generic.title(),
        generic.logo(),

        generic.mainimage({wikidata={property = 'P18 OR P2716 OR P6802 OR P3451'}}),
		generic.coat_of_arms(),
        generic.geoloc(),
        generic.locationmap(),

		{type = 'subtitle', value = {'اختصار','acronym','short name'},
			wikidata= {property = 'P1813',formatting = '$text {{Language icon|NoCat=y|$language}}'}
		},
		
		{type = 'subtitle', value = {"v_hurricane_level"},
			wikidata= {
				property = 'P31' , qualifier = 'P31' , qualifier2 = 'P459' , qualifier3 = 'P518'
                            , list = 'bestrank', formatting = 'table' , conjunction="<br />"
                            , whitelist0= d1  
                            , rowformat = "$1"
                            , rowsubformat1="$1$3 ($2)"
                            , colformat0 = "raw" , colformat1 = "ucfirst" , 
							case2 = "infoboxdata", rowsubformat3=", ''{{small|$3}}''"}
		},

	{type = 'table' , title ='معلومات عامة', rows = {
		{type = 'row' , label = 'الاسم الأصلي',
			value = {'الاسم الأصلي',"v_p1705"},
			wikidata= {property = 'P1559 OR P1705',formatting = '$text {{Language icon|NoCat=y|$language}}'}
        },
		{type = 'row' , label = 'المعرّف القانوني',
			value = {'معرف قانوني',"law identifier","v_p8550"},
			wikidata = {property='P8550'},
		},
		{type = 'row' , label = 'اللقب',
			value = {'لقب',"nickname","v_p1449"},
			wikidata = {property='P1449'},
		},
		{type = 'row' , label = 'الشعار النصي',
			value = {'شعار نصي',"motto text","v_p1451"},
			--wikidata = {property='P1451',formatting = '$text {{Language icon|NoCat=y|$language}}'},
		},
		{type = 'row' , label = 'النشيد',
			value = {'النشيد',"anthem","v_p85"},
			wikidata = {property = 'P85', list = false, showDate="true" },
		},
			
		{type = 'row' , label = 'النوع',
			value = {'نوع',"type","v_p31"},
			wikidata = {property='P31', list='bestrank' , formatting='table' ,
				blacklist0= "Q15221623", -- skip when hurricane, et al. 
				qualifier='P642' , rowsubformat1= ' $1' , rowformat = '$0$R0 $1'}
		},
		{type = 'row' , label = 'مبرر الجائزة',
			value = {'مبرر الجائزة',"description","v_p6208"},
			wikidata = {property='P6208',list='lang'},
		},

		{type = 'row' , label = 'سمي باسم',
			value = {'سمي باسم',"named after","v_p138"},
			wikidata = {property='P138'},
		},
		{type = 'row' , label = 'احتفالاً بـ',
			value = {'احتفالا بـ',"commemorates","v_p547"},
			wikidata = {property='P547'},
		},
		{type = 'row' , label = 'الموقع الجغرافي',
			value = {'موقع جغرافي',"geographical region","v_p706"},
			wikidata = {property='P706'},
		},
		{type = 'row' , label = 'جزء من',
			value = {'جزء من',"part of","v_p361"},
			wikidata = {property='P361'},
		},

		{type = 'row' , label = 'الصلاحية القانونية',
			value = {"v_validity","vigencia"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'فترة المراقبة',
			value = {"v_p837_per"},
			wikidata = {property = 'P837' , formatting = 'table' , list = false
                               , qualifier = 'P3027' , qualifier2 = 'P3028' 
                               , rowsubformat2="&nbsp;- $2" , rowformat = "$1$2"},
		},
		{type = 'row' , 
			label='يوم',
			value = {"day","v_p837"},
			wikidata = {property = 'P837' , formatting = 'table' , list = 'bestrank'
                               , qualifier = 'P518' , rowsubformat1="&nbsp;($1)" , rowformat = "$0$R0$1"},
		},
		{type = 'row' , label = 'يوم الأسبوع ',
			value = {"v_p2894"},
			wikidata = {property = 'P2894' , list = 'bestrank'},
		},
		{type = 'row' , label = 'فترة زمنية',
			value = {"v_p580_raw"},
			-- wikidata = {property=''},
		},              
   
		{type = 'row' , label = 'تاريخ التقويم',
			value = {"v_p585","data"},
			-- wikidata = {property=''},
		},

		{type = 'row' , label = 'نقطة في الزمن',
			value = {"v_point_time","hora"},
			-- wikidata = {property=''},
		},

		{type = 'row' , label = 'المُؤَلِّف',
			value = {"autor","v_p50"},
			wikidata = {property='P50'},
		},
		{type = 'row' , label = 'تعميم',
			value = {"data_promulgada","v_p7589"},
			wikidata = {property='P7589 OR P467'},
		},
		{type = 'row' , label = 'صادق عليه',
			value = {"votat_per","v_p9681"},
			wikidata = { 
				property = 'P9681'  
                        , qualifier = 'P585'  , rowsubformat1="&nbsp;<small>($1)</small>" 
                        , qualifier2 = 'P8683' , qualifier3 = 'P8682' , qualifier4 = 'P5043' , qualifier5 = 'P393'
                        , rowsubformat2="&nbsp;$2[[File:Dark_green_check.svg|13px|عدد الأصوات بـ نعم]]"   
                        , rowsubformat3=", $3 [[File:Cancelled cross.svg|13px|عدد الأصوات بـ لا]]"  
                        , rowsubformat4=", $4[[File:Neutral gray circle icon.png|16px|عدد الممتنعين]]" 
                        , rowsubformat5="&nbsp;<small>(الجلسة:$5)</small>" 
                        , formatting = 'table' , rowformat = "$0$R0$5$1<br/>$2$3$4"
			},
           wikidata2 = { 
           	property = 'P9681'  , formatting = 'table' , rowformat = "$0$R0$3$1$2"
                        , qualifier = 'P585'  , rowsubformat1="&nbsp;<small>($1)</small> "
                        , qualifier2 = 'P5102' , rowsubformat2=",&nbsp;<small>($2)</small>" , 
						qualifier3 = 'P393' , rowsubformat3="&nbsp;<small>(الجلسة:$3)</small>" 
		   },
		},
		{type = 'row' , label = 'تاريخ التوقيع',
			value = {"v_date_signature","data_signatura"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'تصديق',
			value = {"ratificacio","v_p6193"},
			wikidata = {property = 'P6193' , qualifier = 'P585'   
                         , formatting = 'table' , rowformat = "$0$R0 $1 ", rowsubformat1="($1)"},
		},

		{type = 'row' , label = 'تاريخ النشر',
			value = {"publicacio","v_p577"},
			wikidata = {property='P577'},
		},

		{type = 'row' , label = 'دخول حيز التنفيذ',
			value = {"efectivitat","v_p7588"},
			wikidata = {property='P7588'},
		},

		{type = 'row' , label = 'يبطل',
			value = {"revoca","v_p3148"},
			wikidata = {property='P3148'},
		},

		{type = 'row' , label = 'ألغيت بموجب',
			value = {"revocat_per","v_p2568"},
			wikidata = {property='P2568'},
		},

-- Fi BLOC especial per dates____________________________________________________ -->
		{type = 'row' , label = 'المدة',
			value = {'مدة',"duration","v_p2047"},
			wikidata = {property='P2047',formatting='unit'},
		},

		{type = 'row' , label = 'تكرار الحدث',
			value = {'تكرار',"frequency","v_p2257"},
			wikidata = {
				property='P2257' ,formatting= 'table' ,tablesort=1,
				qualifier='P580' ,qualifier2='P582' ,
				colformat0='unit' ,colformat1='Y' ,colformat2='Y' ,
				rowsubformat1='($1–$2)'  ,rowformat = "$0$R0 $1"},
		},
		{type = 'row' , label = 'الفترة الزمنية',
			value = {'فترة',"period","v_p2348"},
			wikidata = {property='P2348'},
		},
		{type = 'row' , label = 'اشتق من',
			value = {"basat_en","v_p144"},
			wikidata = {property='P144',qualifier='P50', formatting='table' , rowformat = "$0$R0 $1",rowsubformat1='($1)'},
		},
		{type = 'row' , label = 'الطبعة',
			value = {'طبعة',"edition","v_p393"},
			wikidata = {property='P393'},
			wikidata2 = {property = 'P179' , qualifier = 'P1545' , list = false}
		},
		{type = 'row' , label = 'المؤسس',
			value = {'المؤسس',"founder","v_p112"},
			wikidata = {property='P112'},
		},
		{type = 'row' , label = 'سوابق',
			value = {'سابقة',"antecedents","v_antecedent"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = '',
			value = {"block_serie","bloc_precedencia"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'الموضوع الرئيسي',
			value = {'موضوع رئيسي',"theme","v_p921"},
			wikidata = {
				property = 'P921' , qualifier = 'P642'   
                               , formatting = 'table' , list = 'bestrank'   
                               , rowformat = "$0$R0 $1 ", rowsubformat1="$1"},
		},
		{type = 'row' , label = 'تراتب اجتماعي',
			value = {"block_rank","rang"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'الثقافة',
			value = {'ثقافة',"culture","v_p2596"},
			wikidata = {property='P2596'},
		},
		{type = 'row' , label = 'المكان',
			value = {'مكان',"location","v_p6375"},
			wikidata = {property='P6375'},
			wikidata2 = { 
				sep=", ",
				wikidata = {
					property = 'P276' , formatting = 'table' 
					, list = 'bestrank'  , case0 = "location"
					, qualifier = 'P585'  , rowsubformat1= "$1:&nbsp;"
					, qualifier2 = 'P580' , rowsubformat2= "$2&nbsp;-&nbsp;" 
					, qualifier3 = 'P582' , rowsubformat3= "$3:&nbsp;"
					, rowformat = "$1$2$3$0$R0"},
				wikidata2 = {
					property = 'P31' , list = 'bestrank', formatting = 'table'
                                               , qualifier ="/P706"
                                               , blacklist0= d1 
                                               , rowformat = "$1"},
				wikidata3 = {
					property = 'P131' , formatting = 'table' 
                                               , list = 'bestrank' , case0 = "location" , rowformat = "$0$R0"},
			
			}
		},
		{type = 'row' , label = 'البلد',
			value = {'بلد',"country","v_p17"},
			wikidata = {property='P17 OR P495'},
		},              

		{type = 'row' , label = 'الحدود',
			value = {'حدود',"frontier","v_p4777"},
			wikidata = {
				property='P4777' ,qualifier='P4777/P2043',list = false ,formatting='table',
                        rowformat = "'$0$R0 $1' ",rowsubformat1='<small>($1)</small>' ,colformat1='unitcode'},
		},
		{type = 'row' , label = 'القارة',
			value = {'قارة',"continent","v_p30"},
			wikidata = {property='P30'},
		},
		{type = 'row' , label = 'المساحة',
			value = {'مساحة',"area","v_p2046"},
			wikidata = {property='P2046 ',formatting='unitcode'},
		},
		{type = 'row' , label = 'الاختصاص',
			value = {"jurisdiccio","v_p1001"},
			wikidata = {property='P1001'},
		}, 
		{type = 'row' , label = 'القيادة',
			value = {'قيادة',"commandment","v_p4791"},
			wikidata = {property='P4791'},
		},
		{type = 'row' , label = 'المنظم',
			value = {'منظم',"organizer","v_p664"},
			wikidata = {property='P664'},
		},          

		{type = 'row' , label = 'المقدم',
			value = {'مقدم',"presenter","v_p371"},
			wikidata = {
				property = 'P371' , qualifier = 'P276' , formatting = 'table' 
                                  , rowformat = "$0$R0$1 ", rowsubformat1="&nbsp;($1)"},
		},
		{type = 'row' , label = 'المخرج',
			value = {'مخرج',"director","v_p57"},
			wikidata = {property='P57'},
		},
		{type = 'row' , label = 'المنتج',
			value = {"productor","v_p162"},
			wikidata = {property='P162'},   
		},
		{type = 'row' , label = 'المكتشف / المخترع',
			value = {'مكتشف','مخترع',"inventor","discoverer","v_p61"},
			wikidata = {property='P61'},
		},
		{type = 'row' , label = 'المتحدثون',
			value = {'متحدثون',"locators","v_p823"},
			wikidata = {property='P823'},
		},
		{type = 'row' , label = 'عدد الموظفين',
			value = {"empleats","v_p1128"},
			wikidata = {
				property = 'P1128' , qualifier = 'P585' 
                      , formatting = 'table' , rowformat = "$0$R0 $1", 
					  colformat0 = "unit" , rowsubformat1= '<small>($1)</small>'
			},
		},
		{type = 'row' , label = 'عدد المتطوعين',
			value = {"voluntaris","v_p6125"},
			wikidata = {
				property = 'P6125' , qualifier = 'P585' 
                      , formatting = 'table' , rowformat = "$0$R0 $1", 
					  colformat0 = "unit" , rowsubformat1= '<small>($1)</small>'
			},
		},

		{type = 'row' , label = 'شخصيات هامة',
			value = {'شخصيات هامة',"significant person","v_p3342"},
			wikidata = {
				property = 'P3342' , formatting = 'table' , list = 'bestrank' 
                           , tablesort = 5
							, qualifier = 'P3831' , colformat1 = "ucfirst" 
							
							, qualifier2 = 'P1534', rowsubformat2= ", &rarr; $2"
							, qualifier3 = 'P1365' , rowsubformat3= "«» $3"
							, qualifier4 = 'P4100/P1813 OR P102/P1813' , rowsubformat4="&nbsp;– $4" 
							, qualifier5 = 'P1545'

							, showDate='true'
							, rowformat = "<p>''' $1 '''<br />$0$R0$4 $3$2</p>"
							--, separator=|conjunction=</tr><tr>
			},
		},
		{type = 'row' , label = 'تمثله',
			value = {"representat_per","v_p1875"},
			wikidata = {property='P1875'},
		},
		{type = 'row' , label = 'المشاركون',
			value = {'مشاركون',"participants"},
			wikidata = {
				property = 'P710'  
                      , formatting = 'table' , rowformat = "* $0$R0$2$3$4 $1 "
                      , qualifier = 'P585'  , rowsubformat1= '<small><br />($1)</small>'
                      , qualifier2 = 'P1268', rowsubformat2="<br>&nbsp;يمثل: $2" 
                      , qualifier3 = 'P1875', rowsubformat3="<br>&nbsp;تمثله: $3"
                      , qualifier4 = 'P3831', rowsubformat4="&nbsp;($4)"
			},
			wikidata2 = {
				property = 'P1132' , colformat0 = "unit" ,
				formatting = 'table', rowformat = "* $2 $0$R0 $1", 
				qualifier = 'P585',  rowsubformat1= '<small><br />($1)</small>',
				qualifier2 = 'P518', rowsubformat2="$2:" },
		}, 

		{type = 'row' , label = 'المُراجِع',
			value = {"revisat_per","v_p4032"},
			wikidata = {property='P4032'},
		},
		{type = 'row' , label = 'الموقعون',
			value = {"signataris","v_p1891"},
			wikidata = {
				property = 'P1891' , formatting = 'table' , list = 'bestrank'
                      , qualifier = 'P585'  , rowsubformat1= '<small>($1)</small>'
                      , qualifier2 = 'P1268', rowsubformat2="<br>&nbsp;يمثل: $2" 
                      , qualifier3 = 'P1875', rowsubformat3="<br>&nbsp;تمثله: $3" 
                      , rowformat = "$0$R0$2$3 $1 "},
		},        
		{type = 'row' , label = 'المودع',
			value = {"dipositari","v_p2058"},
			wikidata = {property='P2058'},
		},
		{type = 'row' , label = 'ناقل',
			value = {"impulsors","v_p859"},
			wikidata = {
				property = 'P859' , list = 'bestrank'
                      , formatting = 'table' , rowformat = "$0$R0$2$3 $1 "
                      , qualifier = 'P585'  , rowsubformat1= '<small>($1)</small>'
                      , qualifier2 = 'P1268', rowsubformat2="<br>&nbsp;يمثل: $2" 
                      , qualifier3 = 'P1875', rowsubformat3="<br>&nbsp;تمثله: $3" },
		},
		{type = 'row' , label = 'المؤدي',
			value = {"interpret","v_p175"},
			wikidata = {property='P175'},
		},

		{type = 'row' , label = 'وسيلة النقل',	
			value = {"tipus_aeronau","v_p121","vehicle"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'المركبة',
			value = {"v_p1876"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'نوع الطائرة',
			value = {"vehicle","tipus_aeronau"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'الخط الرابط',
			value = {"linia","v_p81"},
			wikidata = {property='P81'},
		},
		{type = 'row' , label = 'نقطة البداية',
			value = {"origen","v_p1427"},
			wikidata = {
				property = 'P1427', formatting = 'table', list = 'bestrank' , 
				rowformat = "$0$R0$2$1" , case0 = "location", 
				qualifier = 'P426' , rowsubformat1="&nbsp;<small>($1)</small>", 
				qualifier2 = 'P2825' , rowsubformat2=", موقع التوقف $2"
			},
		},
		{type = 'row' , label = 'الوجهة',
			value = {'وجهة',"destination","v_p1444"},
			wikidata = {
				property = 'P1444'  , case0 = "location",
				formatting = 'table', list = 'bestrank' , 
				rowformat = "$0$R0$2$1", 
				qualifier = 'P426' , rowsubformat1="&nbsp;<small>($1)</small>", 
				qualifier2 = 'P2825' , rowsubformat2=", موقع التوقف $2"
			},
		},
		{type = 'row' , label = 'آخر توقف',
			value = {'آخر توقف',"v_last_layover","ultima_escala"},
			wikidata = {
				property = 'P2825'  , formatting = 'table', list = 'bestrank'
                            , rowformat = "$0$R0-$1   ", qualifier = 'P3831' , whitelist1='Q67203981'},
		},
		{type = 'row' , label = 'المشغل',
			value = {'مشغل',"operador","v_p137"},
			wikidata = {property='P137'},
		},
		{type = 'row' , label = 'تسجيل الطائرة',
			value = {'تسجيل الطائرة',"matricula","v_p426"},
			wikidata = {property='P426'},
		},
		{type = 'row' , label = 'رقم الرحلة الجوية',
			value = {'رقم الرحلة',"vol","v_p3090"},
			wikidata = {property='P3090'},
		},
		{type = 'row' , label = 'الركاب',
			value = {'ركاب',"v_passenger","passatgers"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'الطاقم',
			value = {"v_crew","طاقم"},
			-- wikidata = {property=''},
		},

		{type = 'row' , label = 'وقت الاكتشاف',
			value = {"data_descobriment","v_p575"},
			wikidata = {property='P575'},
		},
		{type = 'row' , label = 'موقع الاكتشاف الفلكي',
			value = {"lloc_descobriment","v_p65"},
			wikidata = {property='P65'},
		},
		{type = 'row' , label = 'الصنف الطيفي',
			value = {"tipus_espectral","v_p215"},
			wikidata = {property='P215'},
		},
		{type = 'row' , label = 'الكوكبة',
			value = {"constellacio","v_p59"},
			wikidata = {property='P59'},         
		},
		{type = 'row' , label = 'الحقبة',
			value = {"epoch","v_p6259"},
			wikidata = {property='P6259' ,formatting='$1'},
		},
		{type = 'row' , label = 'يتبع كوكب',
			value = {'يتبع كوكب',"pare","v_p397"},
			wikidata = {property='P397'},
		},
		{type = 'row' , label = 'المسافة من الأرض',
			value = {'المسافة من الأرض',"distance","v_p2583"},
			wikidata = {
				property = 'P2583' , qualifier = 'P1013' , qualifier2 = 'P518' 
                      , list = 'bestrank' , formatting = 'table' , rowformat = "$0$R0 $2$1 "
                      , colformat0 = "unitcode" , rowsubformat2='($2)' , rowsubformat1= '↔$1'},
		},
		{type = 'row' , label = 'الانزياح الأحمر',
			value = {'الانزياح الأحمر',"desplaça_roig","v_p1090"},
			wikidata = {
				property = 'P1090' , list = 'bestrank' , formatting =  "unitcode" },
		},
		{type = 'row' , label = 'القدر الظاهري',
			value = {'القدر الظاهري',"mag_v","v_p1215"},
			wikidata = {
				property = 'P1215', 
				qualifier = 'P1227', rowsubformat1 = '<small>($1)</small>',
				formatting = 'table', list = 'bestrank' ,  
				rowformat = "$0$R0 $1 "
			},
		},
		{type = 'row' , label = 'المطلع المستقيم',
			value = {'المطلع المستقيم',"right ascension","v_p6257"},
			wikidata = {property = 'P6257' , formatting = 'table' , list = false, case=convert_deg2HMS },
		},
		{type = 'row' , label = 'الميل',
			value = {'الميل',"dec","v_p6258"},
			wikidata = {property = 'P6258' , list = false, case = convert_dec2dms_dms},
		},
		{type = 'row' , label = 'مؤشر اللون',
			value = {'مؤشر اللون',"b","v_p1458"},
			wikidata = {
				property = 'P1458' , qualifier = 'P1227' , formatting = 'table' , 
				list = 'bestrank' , conjunction='</br>'  , 
				rowformat = "$1 $0$R0 ", rowsubformat1='$1='},
		},
		{type = 'row' , label = 'السرعة',
			value = {'سرعة',"velocitat","v_p2052"},
			wikidata = {property = 'P2052'  , formatting = 'unitcode' },
		},
		{type = 'row' , label = 'رمز الفهرس',
			value = {'رمز الفهرس',"catalog code","v_p528"},
			wikidata = {property='P528'},
		},
		{type = 'row' , label = 'لغة العمل',
			value = {'لغة',"language","v_p407"},
			wikidata = {property='P407'},
		},
		{type = 'row' , label = 'الدِّين',
			value = {'دين',"religion","v_p140"},
			wikidata = {property='P140'},
		},
		{type = 'row' , label = 'منطقة',
			value = {'منطقة',"operating area","v_p2541"},
			wikidata = {property='P2541'},
		},
		{type = 'row' , label = 'الطقوس',
			value = {'طقوس',"ritual"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'النوع الفني',
			value = {'النوع الفني',"genre","v_p136"},
			wikidata = {property='P136'},
		},
		{type = 'row' , label = 'قيمة الجائزة',
			value = {'قيمة الجائزة',"prize value","v_p2121"},
			wikidata = {property='P2121' ,formatting='unitcode'},
		},
		{type = 'row' , label = 'جالب الحظ',
			value = {'جالب الحظ',"mascota","v_p822"},
			wikidata = {property='P822'},
		},
		{type = 'row' , label = 'الرياضة',
			value = {'رياضة',"sport","v_p641"},
			wikidata = {property='P641'},
		},
		{type = 'row' , label = 'تمنحها',
			value = {'تمنحها',"awarded by","v_p1027"},
			wikidata = {property='P1027'},
		},
		{type = 'row' , label = 'الثمن',
			value = {'ثمن',"price","v_p2284"},
			wikidata = {property = 'P2284'  , formatting = 'unitcode'},
		},
		{type = 'row' , label = 'الهدف',
			value = {'هدف',"target","v_p533"},
			wikidata = {property='P533 OR P3712'}, --P533=militar/terrorist target; P3712=project/event goal 
		},
		{type = 'row' , label = 'السبب',
			value = {'سبب',"cause","v_p1478"},
			wikidata = {
				property = 'P1478 OR P828' , qualifier = 'P585' , qualifier2 = 'P642'   
                , formatting = 'table' , list = 'bestrank'   
                , rowformat = "* $0$R0 $2 $1 "   
                , rowsubformat1= '<small><br />($1)</small>' , rowsubformat2="$2"},
		},
		{type = 'row' , label = 'الصراعات',
			value = {'صراعات',"conflicts","v_p607"},
			wikidata = {
				property = 'P607' , qualifier = 'P585' , qualifier2 = 'P1012'   
                , formatting = 'table' , list = 'bestrank'   
                , rowformat = "$0$R0$2 $1 ", rowsubformat1= '<small>($1)</small>' , rowsubformat2=", $2"},
		},
		{type = 'row' , label = 'الظروف',
			value = {'الظروف',"conditions"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'فعل',
			value = {'فعل',"action"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'العروض',
			value = {'عروض',"representations","v_p5027"},
			wikidata = {
				property = 'P5027' , qualifier = 'P585' , qualifier2 = 'P276'  
                , formatting = 'table' , list = 'bestrank'   
                , rowformat = "$0$R0 $2 $1 ",    
                rowsubformat1 = "<small><br />($1)</small>" , rowsubformat2 ="→ $2"},
		},
		{type = 'row' , label = 'النتائج',
			value = {'نتائج',"resultats"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'المخلفات',
			value = {'مخلفات',"consequences","v_p1542"},
			wikidata = {
				property = 'P1542 OR P1536'
                , qualifier = 'P585' , qualifier2 = 'P642'
                , formatting = 'table' , list = 'bestrank'  
                , rowformat = "$0$R0 $2 $1"
                , rowsubformat1= '<small><br />($1)</small>' , rowsubformat2="$2"},
		},
		{type = 'row' , label = 'الميزانية',
			value = {'ميزانية',"budget","v_p2769"},
			wikidata = {property='P2769',formatting='unitcode', case=generic.FormatNumVal},
		},
		{type = 'row' , label = 'مقياس درجة العزم',
			value = {'درجة العزم',"magnitude","v_p2527"},
			wikidata = {
				property = 'P2527'   
                , formatting = 'table' , qualifier = 'P585'
                , rowformat = "$0$R0 $1", rowsubformat1= '<small><br />($1)</small>' },
		},
		{type = 'row' , label = 'مقياس ريختر',
			value = {'ريختر',"richter","v_p2528"},
			wikidata = {
				property = 'P2528'  
                , formatting = 'table' , qualifier = 'P585'
                , rowformat = "$0$R0 $1", rowsubformat1= '<small><br />($1)</small>'},
		},
		{type = 'row' , label = 'مقياس ميركالي المعدل',
			value = {'ميركالي',"mercalli","v_p2784"},
			wikidata = {
				property = 'P2784' 
                , formatting = 'table' , qualifier = 'P585'
                , rowformat = "$0$R0 $1", rowsubformat1= '<small><br />($1)</small>' },
		},  

		{type = 'row' , label = 'العمق',
			value = {'عمق',"depth","v_p4511"},
			wikidata = {
				property = 'P4511' , 
				qualifier = 'P1013' , qualifier2 = 'P518 OR P642' , 
				rowformat = "$1 $0$R0 $2 ", 
				rowsubformat1= "$1:" , rowsubformat2="($2)" , colformat0 = "unitcode"},
		},

		{type = 'row' , label = 'سرعة الرياح القصوى',
			value = {'رياح',"winds","v_p2895"},
			wikidata = {
				property = 'P2895' , qualifier = 'P2047' , list = false , 
				formatting = 'table', rowformat = "$0$R0 $1 ", 
				colformat0 = "unitcode" , convert0='default2', 
				rowsubformat1=", $1" , colformat1 = "unit"
			},
		},
		{type = 'row' , label = 'أدنى ضغط جوي',
			value = {'ضغط جوي',"pression","v_p2532"},
			wikidata = {property = 'P2532' , formatting = 'unitcode' , convert='default'},
		}, 

		{type = 'row' , label = 'بيانات عن الحالات',
			value = {"v_p8204"},
			wikidata = {
				property = 'P8204'  , list = false , formatting = 'table' 
                               , rowformat = "[[c:$0$R0|قائمة]]"
                               , qualifier = 'P1433' },
		},
		{type = 'row' , label = 'أول حالة مسجلة',
			value = {"v_p1660"},
			wikidata = {property='P1660'},
		},
		{type = 'row' , label = 'عدد الاختبارات السريرية',
			value = {"v_p8011"},
			wikidata = {
				property = 'P8011' , qualifier = 'P585' , qualifier2 = 'P3005' , 
				formatting = 'table' , list = false , 
				tablesort=1 , sorting=-1  , 
				rowformat = "$2 $0$R0 $1 ", 
				rowsubformat1= '<small>($1)</small>' , 
				rowsubformat2="$2:"},
		},
		{type = 'row' , label = 'الحالات',
			value = {'حالات',"v_p1603"},
			wikidata = {
				property = 'P1603' , 
				qualifier = 'P585' , qualifier2 = 'P3005' , 
				formatting = 'table' , list = 'bestrank' , tablesort=1 , 
				rowformat = "$2 $0$R0 $1 ", rowsubformat1= '<small>($1)</small>' , 
				rowsubformat2="$2:" },
		},
		{type = 'row' , label = 'الحالات في المستشفى',
			value = {'حالات في المستشفى',"v_p8049"},
			wikidata = {
				property = 'P8049' , qualifier = 'P585', 
				formatting = 'table' , list = false , 
				tablesort=1 , sorting=-1 ,
                rowformat = "$0$R0 $1 ", rowsubformat1= '<small>($1)</small>'},
		},
		{type = 'row' , label = 'حالات الشفاء',
			value = {'حالات الشفاء',"v_p8010"},
			wikidata = {
				property = 'P8010' , qualifier = 'P585' , qualifier2 = 'P3005', 
				formatting = 'table' , list = false , 
				tablesort=1 , sorting=-1,  
				rowformat = "$2 $0$R0 $1 ", rowsubformat1= '<small>($1)</small>' , 
				rowsubformat2="$2:"},
		},
		{type = 'row' , label = 'عدد التلقيحات الطبية',
			value = {"v_p9107"},
			wikidata = {
				property = 'P9107' , qualifier = 'P585' , 
				formatting = 'table' , list = 'bestrank' , tablesort=1 , 
				rowformat = "$0$R0 $1 ", rowsubformat1= '<small>($1)</small>' },
		},
		{type = 'row' , label = 'استجابة منظمة تتعلق بالحدث',
			value = {"v_p8045"},
			wikidata = {property='P8045'},
		},
		{type = 'row' , label = 'الهزة الارتدادية',
			value = {"repliques","v_p2320"},
			wikidata = {
				property = 'P2320' , 
				qualifier = 'P585' , qualifier2 = 'P276' , 
				formatting = 'table' , list = 'bestrank' , tablesort=1, 
				rowformat = "$2 $0$R0 $1 ", 
				rowsubformat1= '<small><br />($1)</small>' , rowsubformat2="$2:" },
		},
		{type = 'row' , label = 'ضحية',
			value = {"victimes","v_p8032"},
			wikidata = {
				property = 'P8032' , 
				qualifier = 'P518 or P3831' , qualifier2 = 'P276 OR P426'   , 
				formatting = 'table' , list = 'bestrank' , tablesort=2, 
				rowformat = "$2$4 $0$R0 $1 $3 ", 
				rowsubformat1="$1" , rowsubformat2="$2:" , 
				qualifier3 = 'P585' , rowsubformat3 = "<small><br />($3)</small>" , 
				qualifier4 = 'P1480/P487 or P1480', rowsubformat4 = "&nbsp;$4" },
		},
		{type = 'row' , label = 'الوفيات',
			value = {'وفيات',"deaths","v_p1120"},
			wikidata = { conjunction ='<br />',
				property = 'P1120' , qualifier = 'P518', qualifier2 = 'P276 OR P426 OR P17'  
                , formatting = 'table' , list = 'bestrank' , tablesort=2
                , rowformat = "$2$4 $0$R0 $1 $3 ", rowsubformat1="$1" , rowsubformat2="$2:" 
                , qualifier3 = 'P585' , rowsubformat3 = "<small><br />($3)</small>"  
                , qualifier4 = 'P1480/P487 or P1480', rowsubformat4 = "&nbsp;$4"},
		},
		{type = 'row' , label = 'الإصابات',
			value = {'إصابات',"injuries","v_p1339"},
			wikidata = {conjunction ='<br />',
				property = 'P1339' , qualifier = 'P518' , qualifier2 = 'P276 OR P426'   
                , formatting = 'table' , list = 'bestrank' , tablesort=2 
                , rowformat = "$2$4 $0$R0 $1 $3 ", rowsubformat1="$1" , rowsubformat2="$2:" 
                , qualifier3 = 'P585' , rowsubformat3 = "<small><br />($3)</small>"  
                , qualifier4 = 'P1480/P487 or P1480', rowsubformat4 = "&nbsp;$4" },
		},
		{type = 'row' , label = 'المفقودون',
			value = {'مفقودون',"missing","v_p1446"},
			wikidata = {conjunction ='<br />',
				property = 'P1446' , qualifier = 'P518' , qualifier2 = 'P276 OR P426'   
                , formatting = 'table' , list = 'bestrank' , tablesort=2
                , rowformat = "$2$4 $0$R0 $1 $3 ", rowsubformat1="$1" , rowsubformat2="$2:" 
                , qualifier3 = 'P585' , rowsubformat3 = "<small><br />($3)</small>"  
                , qualifier4 = 'P1480/P487 or P1480', rowsubformat4 = "&nbsp;$4" },
		},
		{type = 'row' , label = 'الناجون',
			value = {'ناجون',"survivors","v_p1561"},
			wikidata = {conjunction ='<br />',
				property = 'P1561' , qualifier = 'P518'  , qualifier2 = 'P276 OR P426'   
                , formatting = 'table' , list = 'bestrank' , tablesort=2
                , rowformat = "$2 $0$R0 $1 $3", rowsubformat1="$1" , rowsubformat2="$2:" 
                , qualifier3 = 'P585' , rowsubformat3 = "<small>(<br />$3)</small>"},
		},
		{type = 'row' , label = 'الخسائر',
			value = {'خسائر',"damaged","v_p3081"},
			wikidata = {conjunction ='<br />',
				property = 'P3081' , qualifier = 'P1114' , 
				formatting = 'table' , list = 'bestrank', 
				rowformat = "$1 $0$R0 $4 $2 $3 ", rowsubformat1="$1" , 
				tablesort="2/1", 
				qualifier2 = 'P585' , rowsubformat2 = "<small><br />($2)</small>" , 
				qualifier3 = 'P1107'  , rowsubformat3 = "($3)", 
				qualifier4 = 'P642'},
		},
		{type = 'row' , label = 'تكلفة الخسائر',
			value = {'تكلفة الخسائر',"cost of damage","v_p2630"},
			wikidata = {
				property = 'P2630' , qualifier = 'P518 OR P642' , 
				formatting = 'table' , list = 'bestrank' , tablesort="2/1", 
				rowformat = "* $1 $0$R0 $2 $3 ", 
				colformat0 = "unit" , case0=generic.FormatNumVal , 
				rowsubformat1="$1:", 
				qualifier2 = 'P585', rowsubformat2 = "<small><br />($2)</small>" , 
				qualifier3 = 'P459', rowsubformat3 = "($3)" },
		},
		{type = 'row' , label = 'الدمار',
			value = {'دمار',"destruction","v_p3082"},
			wikidata = {
				property = 'P3082' , qualifier = 'P1114'     
                , formatting = 'table' , list = 'bestrank'
                , rowformat = "* $1 $0$R0 $4 $2 $3 ", rowsubformat1="$1" , tablesort="2/1"
                , qualifier2 = 'P585' , rowsubformat2 = "<small>($2)</small>" 
                , qualifier3 = 'P1107'  , rowsubformat3 = "<small><br/>($3)</small>"
                , case3= function(v) return string.format("%5.0f&#37;",v*100) end
                , qualifier4 = 'P642'},
		},
		{type = 'row' , label = 'تسجيل',
			value = {"v_recording"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'الجمهور',
			value = {'جمهور',"spectators","v_p5436"},
			wikidata = {
				property = 'P5436' , qualifier = 'P585' , 
				formatting = 'table' , rowformat = "$0$R0 $1", 
				--colformat0 = "unit" , 
				rowsubformat1= '<small>($1)</small>'},
			wikidata2 = {
				property = 'P1110' , qualifier = 'P585' , 
				formatting = 'table' , 
				rowformat = "$0$R0 $1", colformat0 = "unit" , 
				rowsubformat1= '<small>($1)</small>'},
		}, 

		{type = 'row' , label = 'الفائز',
			value = {"winner"},
			wikidata = {
				property = 'P1346' , qualifier = 'P585' , 
				formatting = 'table' , tablesort="1", 
				rowformat = "$0$R0$3$2 $1 ", 
				rowsubformat1= '<small>($1)</small>' , 
				qualifier2 = 'P1686' , rowsubformat2 = ", عن عمل ''$2'' ", 
				qualifier3 = 'P1268 or P17', rowsubformat3 =" ↔ $3"},
		},
		{type = 'row' , label = 'إيرادات شباك التذاكر',
			value = {'إيرادات',"box office","v_p2142"},
			wikidata = {
				property = 'P2142' , qualifier = 'P585'  
                      , formatting = 'table' , rowformat = "$0$R0 $1", colformat0 = "unit", case0=generic.FormatNumVal , rowsubformat1= '<small>($1)</small>'},
		},

		{type = 'row' , label = 'المنصب المتنازع عليه',
			value = {'منصب',"office","v_p541"},
			wikidata = {
				property = 'P541' , qualifier = 'P1114' , 
				rowformat = "$0$R0 $1 ", rowsubformat1="($1)"},
		},
		{type = 'row' , label = 'المرشحون',
			value = {'مرشحون',"candidats","v_p726"},
			wikidata = {
				property = 'P726' ,
				formatting = 'table' ,  
				qualifier = 'P1111' , rowformat = "$0$R0 $1 ", rowsubformat1="($1)"},
		},
		{type = 'row' , label = 'المرشح الناجح',
			value = {"elegit","v_p991"},
			wikidata = {formatting = 'table' , property = 'P991' , qualifier = 'P1111' 
                    , rowformat = "$0$R0 $1 ", rowsubformat1="($1)"},
		},

		{type = 'row' , label = 'التحقيق',
			value = {'التحقيق',"investigation","v_p1840"},
			wikidata = {property='P1840'},
		},
		{type = 'row' , label = 'التحريات القضائية',
			value = {'تحريات قضائية',"judicial_investigation"},
			-- wikidata = {property=''},
		}, 
		{type = 'row' , label = 'المدعي',
			value = {'مدعي',"instructor","v_p1592"},
			wikidata = {property='P1592'},
		},
		{type = 'row' , label = 'المشتبه به',
			value = {'مشتبه به',"suspect"},
			-- wikidata = {property=''},
		},

		{type = 'row' , label = 'المُجرِم',
			value = {'مجرم',"perpetrator","v_p8031"},
			wikidata = {property = 'P8031' , qualifier = 'P3831' , formatting = 'table' 
                                    , rowformat = "$0$R0 $1 ", rowsubformat1="($1)"},
		},
		{type = 'row' , label = 'السلاح',
			value = {'سلاح',"armament","v_p520"},
			wikidata = {property = 'P520' , qualifier = 'P1114' , formatting = 'table' 
                                    , rowformat = "$1$0$R0 ", rowsubformat1='$1&nbsp;'},
		},
		{type = 'row' , label = 'الاعتقالات',
			value = {'اعتقالات',"arrests","v_p5582"},
			wikidata = {
				property = 'P5582' , qualifier = 'P518'  , qualifier2 = 'P276 OR P426'   , 
				formatting = 'table' , list = 'bestrank' , tablesort=2, 
				rowformat = "$2$4 $0$R0 $1 $3 ", rowsubformat1="$1" , rowsubformat2="$2:" , 
				qualifier3 = 'P585' , rowsubformat3 = "<small>($3)</small>"  , 
				qualifier4 = 'P1480/P487 or P1480', rowsubformat4 = '&nbsp;&nbsp;$4' },
		},
		{type = 'row' , label = 'المحاكمة',
			value = {'محاكمة',"trial"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'المدعي',
			value = {"مدعي","plaintiff","v_p1620"},
			wikidata = {property='P1620'}, 
		},
		{type = 'row' , label = 'المدعى عليه',
			value = {'مدعى عليه',"accused","v_p1591"},
			wikidata = {property='P1591'}, 
		},
		{type = 'row' , label = 'التهمة',
			value = {"carrecs","v_p1595"},
			wikidata = {property='P1595'},
		},
		{type = 'row' , label = 'الدفاع',
			value = {"defensor","v_p1593"},
			wikidata = {property='P1593'},
		},
		{type = 'row' , label = 'المحكمة',
			value = {'محكمة',"tribunal","v_p4884"},
			wikidata = {
				property = 'P4884' , qualifier = 'P1594 OR P488' , 
				formatting = 'table', rowformat = "$0$R0 $1 ", 
				rowsubformat1="(رئيس: $1)" },
		},
		{type = 'row' , label = 'القاضي',
			value = {'قاضي',"judge","v_p1594"},
			wikidata = {property='P1594'},
		},
		{type = 'row' , label = 'حكم (قانون)',
			value = {'حكم',"verdict","v_verdict"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'إدانة',
			value = {'إدانة',"condemnation","v_convict"},
			-- wikidata = {property=''},
		},
		{type = 'row' , label = 'العقوبة',
			value = {'عقوبة',"sentence","v_p1596"},
			wikidata = {
				property = 'P1596' , qualifier = 'P1591'  
                          , formatting = 'table' , list = 'bestrank'
                          , rowformat = "$1 $0$R0$3$4 ($2$5) ", rowsubformat1="$1:" , tablesort="2/1"
                          , qualifier2 = 'P585'   , rowsubformat2 = "<small>($2)</small>"
                          , qualifier3 = 'P2047'  , rowsubformat3 = ", $3." , colformat3 = "unit"
                          , qualifier4 = 'P2284'  , rowsubformat4 = ", $4." , colformat4 = "unitcode"
                          , qualifier5 = 'P4884'  , rowsubformat5 = ", $5" },
		},
	}},
	{type = 'table' , title ='وسائط', rows = {
		{type = 'row' , label = 'شبكة البث الأصلية',
			value = {'شبكة البث الأصلية',"original broadcaster","v_p449"},
			wikidata = {property='P449'},
		},
		{type = 'row' , label = 'ملف صوتي',
			value = {"video","v_p10"},
			wikidata = {property='P10'},
		},
		{type = 'row' , label = 'شبكة البث',
			value = {'شبكة البث',"broadcaster"},
			wikidata = {property='P3301'},

		},
		{type = 'row' , label = 'ملف مرئي',
			value = {'ملف مرئي',"audio","v_p51"},
			wikidata = {property='P51'},
		},
	}},
	{type = 'table' , title ='كرونولوجيا', rows = {
		{type = 'row' , 
			value = {'كرونولوجيا',"chronology","v_p793"},
			wikidata = {formatting = 'table', property = 'P793'  
                                      , qualifier = 'P585' , qualifier2 = 'P580'  
                                      , qualifier3 = 'P582' 
									  , rowsubformat2="$2-$3"
                                      , qualifier4 = 'P1591' -- P710 OR P1346 ....participant  
                                      , rowsubformat4="<br>مُدان:$4"
                                      , qualifier5 = 'P1399' -- condemned by 
                                      , rowsubformat5="<br>&rArr; $5"
                                      , qualifier6 = 'P828' -- has cause 
                                      , rowsubformat6="&nbsp;الأسباب $6"
                                      , qualifier7 = 'P1596' -- condemna 
									  , rowsubformat7="<br/>&rArr; $8 $7 "
                                      , qualifier8 = 'P1114 or P2047' -- quant./time 
									  , colformat8 = "unit"
                                      --,separator="</tr><tr>",conjunction="</tr><tr>"     
                                      , colformat0 = "ucfirst"     
                                      , rowformat = "* $1 $2 : $0$R0$5$4$7$6"},
		},
	}},
	{type = 'table' , title ='أخرى ',rows = {

		{type = 'row' , label = 'أجزاء من الصنف',
			value = {"elements","v_p2670"},
			wikidata = {property = 'P2670' , formatting = 'table' , list = 'bestrank' 
                                , colformat0 = "ucfirst" , case0 = "plural" 
                                , qualifier = 'P1114' , qualifier2 = 'P518' 
                                , rowsubformat1 = "<small><br/>العدد: $1</small>" , rowsubformat2 = "<small><br/>($2)</small>" 
                                , rowformat = "* $0$R0'''$1 $2"
			},
		},
		{type = 'row' , label = 'الأجزاء',
			value = {'الأجزاء',"has_part","v_p527"},
			wikidata = {property = 'P527' , formatting = 'table' 
                                , rowformat = "* $5 '''$0$R0''' $4 $2", tablesort="1/9/3"
                                , qualifier = 'P1545' , rowsubformat1 = "ordre:$1," 
                                , qualifier2 = 'P580' -- OR P527/P580 --> 
								, rowsubformat2 = "($2&nbsp;–&nbsp;$3)"  
                                , qualifier3 = 'P582' -- OR P527/P582 --> 
								, rowsubformat3 = "$3" 
                                , qualifier4 = 'P585' -- OR P527/P585 --> 
								, rowsubformat4 = "($4)"
                                , qualifier5 = 'P527/P2425'  , rowsubformat5 = "[[File:$5|30px|link=]]"
                                , qualifier6 = 'P1346' , rowsubformat6 = "$6"
                                , qualifier7 = 'P1686' , rowsubformat7 = ", عن عمل ''$7''" 
                                , qualifier8 = 'P518'  , rowsubformat8 = "ينطبق على جزء:$8" 
                                , qualifier9 = 'P585 or P580 '},
		},
		{type = 'row' , label = 'مختصر القانون',
			value = {'مختصر القانون',"law digest","v_p9376"},
			wikidata = {property='P9376'},
		},
	  }},
	{type = 'table' , title ='التراث الثقافي', rows = {
		{type = 'row' , label = 'الوضع',
			value = {"وضع التراث","v_p3259"},
			wikidata = {property='P3259'},
		},			
	}},

	{type = 'table' , title ='الوثائق',rows = {

		{type = 'row' , label = 'العمل مُتاحٌ في',
			value = {'العمل متاح في',"text_complet","v_p953"},
			wikidata = {property = 'P953' , list = false, formatting = 'weblink'},
		},
		generic.website(),
	}}
}}