وحدة:بطاقة/أدوات/مبنى

من ويكيبيديا، الموسوعة الحرة
-- Credits:
-- Original from fr:Infobox/Fonctions/Bâtiment
-- forked and developed by وهراني @arwiki (ar:وحدة:بطاقة/أدوات/مبنى)
-- Version: 20240327

local building = {}
building.description = {}

local generic = require "وحدة:بطاقة/أدوات"

local function keyDate(event)
 if type(event) == "table" then
  for i, j in pairs(event) do
   local s = keyDate(j)
   if s then return s end
  end
 elseif type(event) ~= "string" then
  return error("invalid-datatype !! " .. type(event) .. " != string")
 elseif string.sub(event, 1, 1) == "Q" then
  return  {
   wikimod = "Wikidata.Ca",
   formatting = "table",
   property = "P793",
   qualifier1 = "P642 OR P518",

   qualifier2 = "P585",
   qualifier3 = "P580", qualifier4 = "P582",

   colformat2 = "Y", colformat3 = "Y", colformat4 = "Y", 

   rowsubformat1 = ": $1",
   rowsubformat3 = "$3$4",
   rowsubformat4 = "  إلى $4",
   rowformat = "* $2$3 $1",

   whitelist0 = event
  }
 elseif string.sub(event, 1, 1) == "P" then
  return  {property = event}
 else
  return error("invalid-entity-id : " .. event)
 end
end

building.description["title"] =   generic.description["title"]
function building.title()
 return generic.title()
end

--Image
building.description["mainimage"] =  generic.description["mainimage"]
function building.mainimage(params)
 return generic.mainimage(params)
end

building.description["country"] =  generic.description["country"]
function building.country(params)
    return generic.country(params)
end

building.description["status"] =  ""
function building.status()
 return {
    type = "row",
    label = "الحالة",
    value = {"الوضع_الحالي", "status"},
    wikidata = {property = "P5816"},
    metadata = {
     description = "للدلالة على الوضعية الحالية",
     option = "", 
     type = "string", 
     suggestedvalues = {"مكتمل","مهدم","مدمر","عمليات البناء معلقة"
      ,"قيد الإنشاء","لم يتم بناءه"
      ,"مقترح","موافق على بناءه"},
    }
   }
end

building.description["historicalregion"] =  ""
function building.historicalregion()
 return {-- بالنسبة للمناطق التاريخية
  type = "row",
  value = {"منطقة تاريخية", "historical_region"},
  label = "المنطقة التاريخية",
  wikidata = {property = "P6885"},
  metadata = {
   description = "المنطقة التاريخية القديمة",
   option = "", 
   type = "", 
  }
 }
end

building.description["adminlocation"] =  ""
function building.adminlocation()
 return {
  type = "multi",
  rows = {
   {
    type = "row",
    value = {"عنوان", "address"},
    label = "العنوان",
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P6375",
     list = 2,
     conjunction = "<br />",
     formatting = "$text {{Language icon|NoCat=y|$language}}"
    },
    metadata = {
     description = "ما توفر من : الرقم واسم الشارع والحي",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    value = {"اسم المنطقة 1","subdivision_name1", "subdivision1"},
    label = {"نوع المنطقة 1","subdivision_type1"} ,
    defaultlabel = "المنطقة 1",
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    value = {"اسم المنطقة 2","subdivision_name2", "subdivision2"},
    label = {"نوع المنطقة 2","subdivision_type2"} ,
    defaultlabel = "المنطقة 2",
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    value = {"اسم المنطقة 3","subdivision_name3", "subdivision3"},
    label = {"نوع المنطقة 3","subdivision_type3"} ,
    defaultlabel = "المنطقة 3",
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {-- بالنسبة للمناطق الإدارية
    type = "row",
    value = {"منطقة_إدارية", "administrative_territorial "},
    label = "المنطقة الإدارية",
    wikidata = {wikimod = "Wikidata.Ca", property = "P131", listrank='bestrank', showDate = "true"},
    metadata = {
     description = "الإقليم التابع له إداريا",
     option = "", 
     type = "", 
    }
   },
   building.historicalregion(),
   building.country()
  }
 }
end

building.description["onshoreof"] =  ""
function building.onshoreof()
 return {
  type = "row",
  label = "على ضفاف",
  value = {"على_ضفاف","on_coast_of","baigné par"},
  wikidata = {property = "P206"},
  metadata = {
   description = "موجود بالقرب من المسطح المائي",
   option = "", 
   type = "", 
  }
 }
end

building.description["watershed"] =  ""
function building.watershed()
 return {
  type = "row",
  label = "مستجمع مائي",
  value = "مستجمع مائي",
  wikidata = {property = "P4614"},
  metadata = {
   description = "",
   option = "", 
   type = "", 
  }
 }
end

building.description["protectedarea"] =  ""
function building.protectedarea()
 return {
  type = "row",
  label = "منطقة محمية",
  plurallabel = "مناطق محمية",
  value = {"منطقة محمية", "protected_area"},
  wikidata = {property = "P3018"},
  metadata = {
   description = "",
   option = "", 
   type = "", 
  }
 }
end

building.description["island"] =  ""
function building.island()
 return {
  type = "row",
  label = "جزيرة",
  plurallabel = "جزر",
  value = {"جزيرة", "island"},
  wikidata={property = "P5130"},
  metadata = {
   description = "",
   option = "", 
   type = "", 
  }
 }
end

building.description["mountainrange"] =  ""
function building.mountainrange()
 return {
  type = "row",
  label = "السلسلة الجبلية",
  plurallabel = "السلاسل الجبلية",
  value = {"جبل", "سلسلة جبلية", "mountain_range"},
  wikidata = {property = "P4552"},
  metadata = {
   description = "",
   option = "", 
   type = "", 
  }
 }
end

building.description["elevation"] =  ""
function building.elevation()
 return {
  type = "row",
  label = "الارتفاع",
  value = {"ارتفاع", "elevation"},
  wikidata = {
   wikimod = "Wikidata.Ca",
   property = "P2044",
   formatting = "unitlinked"
  },
  metadata = {
   description = "الارتفاع عن مستوى البحر",
   option = "", 
   type = "", 
  }
 }
end

building.description["coordinates"] =  generic.description["coordinates"]
function building.coordinates(args)
 return generic.coordinates(args)
end

building.description["website"] =  generic.description["website"]
function building.website(args)
 return generic.website(args)
end

building.description["phone_number"] =  ""
function building.phone_number()
 return {
    type = "row", 
    label = "رقم الهاتف",
    value = {"رقم الهاتف", "رقم_الهاتف","phone_number"},
    valueStyle = {direction = "LTR", ["text-align"] = "left"},
    wikidata = {property = "P1329"},
    metadata = {
     description = "رقم الهاتف",
     option = "", 
     type = "string", 
    }
   }
end

building.description["postal_code"] =  ""
function building.postal_code()
 return {
  type = "row", 
  label = "الرمز البريدي",
  value = {"الرمز_البريدي","postal_code"},
  wikidata = {property = "P281"},
  metadata = {
   description = "معرف السلطة البريد لمنطقة أو مبنى",
   option = "", 
   type = "", 
  }
 }
end

building.description["open_days"] =  ""
function building.open_days()
 return {
   type = 'row' , 
   label = 'مفتوح في' , 
   value = {'مفتوح','open_days'} , 
   wikidata = {
    wikimod = "Wikidata.Ca",
    property='P3025', formatting='table',
    qualifier='P3027', qualifier2='P3028', 
    qualifier3='P3026', 
    qualifier4='P8626',qualifier5='P8627',
    rowformat= '$0$R0 $1$4$3', 
    rowsubformat1='<small><br/>$1 – $2</small>',
    rowsubformat3='<small><br/> مغلق يوم: $3</small>',
    rowsubformat4='<small><br/>$4 – $5</small>',
  },
  metadata = {
   description = "توقيت الفتح والغلق",
   option = "", 
   type = "", 
  }
 }
end

building.description["cornerstonelaying"] =  ""
function building.cornerstonelaying()
 return {
  type = "multi",
  rows = {
   {
    type = "row",
    value = {"حجر_الأساس", "تاريخ_وضع_حجر_الأساس", "groundbreaking_date", "broke_ground", "broke ground"},
    label = "وضع حجر الأساس",
    wikidata = keyDate("Q18752057"),
    metadata = {
     description = "تاريخ وضع حجر الأساس للموضوع",
     option = "", 
     type = "date", 
    }
   }
  }
 }
end

building.description["construction"] =  ""
function building.construction()
 return {
  type = "multi",
  rows = {
   {
    type = "row",
    label = "بداية التشييد",
    value = {"بداية_التشييد", "تاريخ_بدء_البناء", "start_date", "construction_start_date"},
    wikidata = keyDate("Q27136782"), 
    --wikidata2 = {property = "P571"},
    metadata = {
     description = "تاريخ بداية التشييد",
     option = "", 
     type = "date", 
    }
   },
   {
    type = "row",
    label = "توقف التشييد",
    value = {"توقف_التشييد", "توقف_البناء", "stop_date", "construction_stop_date"},
    --, wikidata = {property='P'},
    metadata = {
     description = "تاريخ توقف التشييد",
     option = "", 
     type = "date", 
    }
   },
   {
    type = "row",
    label = "نهاية الأعمال الكبرى",
    value = {"نهاية_الأعمال_الكبرى", "topped_out_date"},
    wikidata = keyDate("Q1075723"), 
    metadata = {
     description = "تاريخ نهاية الأعمال الكبرى",
     option = "", 
     type = "date", 
    }
   },
   {
    type = "row",
    label = "الانتهاء",
    value = {"نهاية_التشييد", "تاريخ_الانتهاء", "est_completion", "completion_date"},
    wikidata = keyDate("Q59913255"), 
    metadata = {
     description = "تاريخ أعمال الانتهاء",
     option = "", 
     type = "date", 
    }
   },
   {
    type = "row",
    value = {"تشييد", "التشييد", "التشييد"},
    label = "التشييد",
    wikidata = keyDate("Q385378"), 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   }
  }
 }
end

building.description["reconstruction"] =  ""
function building.reconstruction()
 return {
  type = "multi",
  rows = {
   {
    type = "row",
    value = {"بداية إعادة التشييد", "reconstruction_start_date"},
    label = "بداية إعادة التشييد",
    metadata = {
     description = "",
     option = "", 
     type = "date", 
    }
   },
   {
    type = "row",
    value = {"نهاية إعادة التشييد", "reconstruction_completion_date"},
    label = "نهاية إعادة التشييد",
    metadata = {
     description = "",
     option = "", 
     type = "date", 
    }
   },
   {
    type = "row",
    value = {"إعادة التشييد", "تاريخ إعادة التشييد"},
    label = "إعادة التشييد",
    wikidata = keyDate("Q1370468"),
    metadata = {
     description = "",
     option = "", 
     type = "date", 
    }
   }
  }
 }
end

building.description["opening"] =  ""
function building.opening()
 return {
  type = "multi",
  rows = {
   {
    type = "row",
    value = {"تاريخ الافتتاح", "تاريخ_الافتتاح", "opened", "opening_date", "opening"},
    label = "الافتتاح",
    blockers = "افتتاح",
    wikidata = keyDate {"Q1417098,Q15051339"},
    metadata = {
     description = "",
     option = "", 
     type = "date", 
    }
   },
   {
    type = "row",
    value = {"تاريخ_الافتتاح_الرسمي", "inauguration_date"},
    label = "الافتتاح الرسمي",
    blockers = "افتتاح",
    -- P1619 = الافتتاح الرسمي, وليس دائما الافتتاح الفعلي
    wikidata = {wikimod = "Wikidata.Ca", property = "P1619", listrank="bestrank",

     qualifier = "P518 OR P1013",

     formatting = "table",
     conjunction = "<br />",
     rowformat = "* $1 $0$R0",
     rowsubformat1 = "$1 : ",
},
    metadata = {
     description = "",
     option = "", 
     type = "date", 
    }
   },
   {
    type = "row",
    label = "التكريس",
    value = {"تكريس", "consecration"},
    blockers = "افتتاح",
    wikidata = keyDate {"Q125375"}, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    value = "أول ضوء",
    label = "[[|أول ضوء (علم الفلك)|]]",
    blockers = "افتتاح",
    wikidata = keyDate {"Q1306940"}, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   }
  }
 }
end

building.description["renovation"] =  ""
function building.renovation()
 return {
  type = "multi",
  rows = {
   {
    type = "row",
    description = "تاريخ التحديث",
    label = "التحديث",
    value = {"تاريخ_تحديث_المبنى", "renovation_date"},
    --, wikidata = {property='P'}, 
    metadata = {
     description = "",
     option = "", 
     type = "date", 
    }
   },
   {
    type = "row",
    description = "تاريخ الترميم",
    value = {"ترميم", "restoration"},
    label = "الترميم",
    wikidata = keyDate {"Q217102"},
    blockers = "تجديد", 
    metadata = {
     description = "",
     option = "", 
     type = "date", 
    }
   },
   {
    type = "row",
    description = "تاريخ التجديد",
    value = {"تجديد", "renovation"},
    label = "التجديد",
    wikidata = keyDate {"Q2144402"},
    blockers = "ترميم", 
    metadata = {
     description = "",
     option = "", 
     type = "date", 
    }
   },
   {
    type = "row",
    description = "تاريخ التوسعة",
    value = {"توسعة", "التوسعة", "expansion"},
    label = "التوسعة",
    wikidata = keyDate {"Q9073584"},
    blockers = "تجديد", 
    metadata = {
     description = "",
     option = "", 
     type = "date", 
    }
   },
   {
    type = "row",
    value = "أشغال أخرى",
    label = "أشغال أخرى", 
    metadata = {
     description = "تاريخ أشغال أخرى",
     option = "", 
     type = "date", 
    }
   }
  }
 }
end

building.description["demolition"] =  ""
function building.demolition()
 return {
  type = "multi",
  rows = {
   {
    type = "row",
    label = "الهدم",
    value = {"تاريخ_هدم_المبنى", "date_demolished", "demolished_date"},
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P576",
     qualifier = "P770",
     formatting = "table",
     conjunction = "<br />",
     rowformat = "$0$R0 $1",
     rowsubformat1 = "<small>($1)</small>"
    },
    wikidata2 = keyDate("Q331483"), 
    metadata = {
     description = "تاريخ الهدم",
     option = "", 
     type = "date", 
    }
   },
   {
    type = "row",
    label = "التدمير",
    value = {"تاريخ_تدمير_المبنى", "destruction_date", "destroyed"},
    wikidata = {property = "P3082"},
    wikidata2 = keyDate("Q17781833"), 
    metadata = {
     description = "تاريخ التدمير",
     option = "", 
     type = "date", 
    }
   },
   {
    type = "row",
    value = {"تخريب", "vandalism"},
    label = "التخريب",
    wikidata = keyDate("Q6160"), 
    metadata = {
     description = "تاريخ التخريب",
     option = "", 
     type = "date", 
    }
   },
  }
 }
end

building.description["closure"] =  ""
function building.closure()
 return {
  type = "row",
  value = {"الإقفال", "تاريخ_الإقفال", "تاريخ_الإغلاق", "closing_date", "closed"},
  label = "الإقفال",
  wikidata = keyDate {"Q5135520"},
  wikidata2 = {property = "P3999"},

  metadata = {
   description = "تاريخ الإغلاق",
   option = "", 
   type = "date", 
  }
 }
end

building.description["maintenance"] =  ""
function building.maintenance()
 return {
  type = "row",
  value = {"صيانة", "maintenance"},
  label = "الصيانة",
  wikidata = {
   wikimod = "Wikidata.Ca",
   property = "P126",
   showDate = "true",
   conjunction = "<br />"
  }, 
  metadata = {
   description = "تاريخ الصيانة",
   option = "", 
   type = "date", 
  }
 }
end

building.description["usage"] =  ""
function building.usage()
 return {
  type = "row",
  label = "الاستعمال",
  value = {"استعمال","الاستعمال","usage"},
  wikidata = {
   wikimod = "Wikidata.Ca",
   property = "P366",
   showDate = "true",
   conjunction = "<br />",
   list = "bestrank"
  }, 
  metadata = {
   description = "الاستخدام الرئيسي  (الحالي والسابق)",
   option = "", 
   type = "", 
  }
 }
end

building.description["operator"] =  ""
function building.operator()
 return {
  type = "row",
  label = "الإدارة",
  value = {"إدارة", "مسير", "المشغل", "operator", "الإدارة"},
  wikidata = {
   wikimod = "Wikidata.Ca",
   property = "P137",
   showDate = "true",
   conjunction = "<br />"
  }, 
  metadata = {
   description = "الشخص أو الهيئة التي تدير المرفق",
   option = "", 
   type = "", 
  }
 }
end

building.description["transport"] =  ""
function building.transport()
 return {
  type = "multi",
  rows = {
   {type = "row", label = "الموقف", value = "موقف"},
   {type = "row", label = "محطة", value = "محطة"},
   {type = "row", label = "الميترو", value = "ميترو"},
   {type = "row", label = "ترمواي", value = {"قطار", "ترمواي"}},
   {type = "row", label = "حافلة", value = {"باص", "حافلة"}}
  }
 }
end

building.description["part_of"] =  ""
function building.part_of() 
 return {
  type = "row",
  label = "جزء من",
  value = "جزء من",
  wikidata = {
   property = "P361"
  }, 
  metadata = {
   description = "",
   option = "", 
   type = "", 
  }
 }
end

building.description["orientation"] =  ""
function building.orientation()
 return {
  type = "row",
  label = "الإتجاه",
  value = {"إتجاه", "orientation"},
  wikidata = {property = "P7469", numval = "1"}, 
  metadata = {
   description = "",
   option = "", 
   type = "",
   suggestedvalues = {"شمال","جنوب","شرق","غرب","شمال-شرق","شمال-غرب","جنوب-شرق","جنوب-غرب"},
  }
 }
end

building.description["archistyle"] =  ""
function building.archistyle()
 return {
  type = "multi",
  rows = {
   {
    type = "row",
    label = "النمط المعماري",
    plurallabel = "الأنماط المعمارية",
    value = {"النمط_المعماري", "طراز_معماري", "architectural_style", "architecture"},
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P149 OR P135"
    }, 
    metadata = {
     description = "النمط المعماري المنتهج في التشييد",
     option = "", 
     type = "", 
    }
   }
  }
 }
end

building.description["creator"] =  ""
function building.creator()
 return {
  type = "multi",
  rows = {
   {
    type = "row",
    label = "المهندس المعماري",
    plurallabel = "المهندسون المعماريون",
    value = {"معماري", "المهندس المعماري", "المهندس_المعماري", "architect"},
    wikidata = {property = "P84", conjunction = "<br />"}, 
    metadata = {
     description = "المهندس المعماري",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "المهندس المدني",
    plurallabel = "المهندسون المدنيون",
    value = {"مهندس_مدني", "المهندس_المدني", "civil_engineer"},
    --wikidata = {property = "P", conjunction = "<br />"}, 
    metadata = {
     description = "المهندس المدني",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "المهندس الإنشائي",
    plurallabel = "المهندسون الإنشائيون",
    value = {"مهندس", "المهندس_الإنشائي"},
    "structural_engineer",
    wikidata = {property = "P631", conjunction = "<br />"}, 
    metadata = {
     description = "المهندس الإنشائي",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "المصمم",
    plurallabel = "المصممون",
    value = {"مصمم", "المصمم", "designer"},
    wikidata = {property = "P170", conjunction = "<br />"}, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "مصممون آخرون",
    value = {"مصممين_آخرون", "other_designers"}, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   }
  }
 }
end

building.description["owner"] =  ""
function building.owner()
 return {
  type = "multi",
  rows = {
   {
    type = "row",
    description = "المالك لأرض المبنى",
    label = "مالك الأرض",
    value = {"مالك_الأرض", "landlord"},
    --, wikidata = {property='P'}, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "المالك الأول",
    plurallabel = "الملاك الأوائل",
    value = "المالك الأول", 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "المالك الحالي",
    plurallabel = "الملاك الحاليون",
    value = "المالك الحالي", 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "المالك",
    plurallabel = "الملاك",
    value = {"مالك", "owner", "المالك"},
    wikidata = {
     wikimod = "Wikidata.Ca", 
     property = "P127",
     conjunction="<br />",
     showDate="true"
    }, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   }
  }
 }
end

building.description["religion"] =  ""
function building.religion()
 return {
  type = "row",
  label = "الديانة",
  value = {"ديانة", "دين", "religion"},
  wikidata={property = "P140"}, 
  metadata = {
   description = "الديانة التي تمارس طقوسها في هذا المبنى",
   option = "", 
   type = "", 
  }
 }
end

building.description["shape"] =  ""
function building.shape()
 return {
  type = "row",
  label = "الشكل",
  value = {"شكل", "shape"},
  property = "P1419", 
  metadata = {
   description = "الشكل الهندسي",
   option = "", 
   type = "", 
  }
 }
end

building.description["dimensions"] =  ""
function building.dimensions()
 return {
  type = "multi",
  rows = {
   {
    type = "row",
    label = "الارتفاع",
    value = {"ارتفاع", "height"},
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P2048",
     qualifier = "P518 OR P1013",
     list = "bestrank",
     colformat0 = "unit",
     formatting = "table",
     conjunction = "<br />",
     rowformat = "$0$R0 $1",
     rowsubformat1 = "<small><br />($1)</small>",
     blacklist1 = "Q31271474,Q24192182,Q131214,Q852590"
    }, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "الارتفاع الهندسي",
    value = {"ارتفاع هندسي","architectural height"},
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P2048",
     colformat0 = "unit",
     formatting = "table",
     qualifier1 = "P1013 OR P518",
     rowformat = "$0$R0",
     whitelist1 = "Q24192182"
    }, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "ارتفاع الهوائي",
    value = {"برج_الهوائي", "antenna_spire"},
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P2048",
     colformat0 = "unit",
     formatting = "table",
     qualifier = "P1013 OR P518",
     rowformat = "$0$R0",
     whitelist1 = "Q131214,Q852590"
    }, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "أعلى طابق",
    value = {"أعلى طابق", "top_floor"},
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P2048",
     qualifier = "P518 OR P1013",
     list = "bestrank",
     colformat0 = "unit",
     formatting = "table",
     conjunction = "<br />",
     rowformat = "$0$R0 $1",
     rowsubformat1 = "<small><br />($1)</small>",

     whitelist1 = "Q31271474"
    }, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "العمق",
    value = "عمق",
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P2610",

     qualifier = "P518 OR P1013",
     list = "bestrank",
     colformat0 = "unit",
     formatting = "table",
     conjunction = "<br />",
     rowformat = "$0$R0 $1",
     rowsubformat1 = "<small><br />($1)</small>",
    }, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "الطول",
    value = {"طول","length"},
    wikidata = {
     wikimod = "Wikidata.Ca", 
     formatting="table",
     property = "P2043", qualifier2="P560",

     qualifier = "P518 OR P1013",
     list = "bestrank",
     colformat0 = "unit",
     formatting = "table",
     conjunction = "<br />",
     rowformat = "$0$R0 $1$2",
     rowsubformat1 = "<small><br />($1)</small>",
    }, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "العرض",
    value = {"عرض","width"},
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P2049",

     qualifier = "P518 OR P1013",
     list = "bestrank",
     colformat0 = "unit",
     formatting = "table",
     conjunction = "<br />",
     rowformat = "$0$R0 $1",
     rowsubformat1 = "<small><br />($1)</small>",
    }, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "الباع",
    value = {"باع","span"},
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P2050",

     qualifier = "P518 OR P1013",
     list = "bestrank",
     colformat0 = "unit",
     formatting = "table",
     conjunction = "<br />",
     rowformat = "$0$R0 $1",
     rowsubformat1 = "<small><br />($1)</small>",
    }, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "القطر",
    value = {"قطر", "قطر_المبنى", "diameter"},
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P2386",
     formatting = "unit"
    }, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "المحيط",
    value = {"محيط", "محيط_المبنى", "circumference"},
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P2547",

     qualifier = "P518 OR P1013",
     list = "bestrank",
     colformat0 = "unit",
     formatting = "table",
     conjunction = "<br />",
     rowformat = "$0$R0 $1",
     rowsubformat1 = "<small><br />($1)</small>",
    }, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "المساحة",
    value = {"المساحة", "مساحة","area"},
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P2046",
     formatting = "table",
     conjunction = "<br />",
     qualifier = "P518",
     rowformat = "$0$R0 $1",
     rowsubformat1 = "<small>($1)</small>",
     colformat0 = "unit"
    }, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "الحجم",
    value = {"حجم", "volume"},
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P2234",

     qualifier = "P518 OR P1013",
     list = "bestrank",
     colformat0 = "unit",
     formatting = "table",
     conjunction = "<br />",
     rowformat = "$0$R0 $1",
     rowsubformat1 = "<small><br />($1)</small>",
    }, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "المسافة التحتية",
    value = {"مسافة تحتية", "clearance"},
    wikidata = {
     wikimod = "Wikidata.Ca",
     property = "P2793",
     formatting = "unit"
    }, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   }
  }
 }
end

building.description["floors"] =  ""
function building.floors()
 return {
  type = "multi",
  rows = {
   {
    type = "row",
    label = "مساحة الطابق",
    value = {"مساحة_الطابق_الواحد", "floor_area"}, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "الطوابق",
    value = {
     "الطوابق",
     "طوابق",
     "عدد الطوابق",
     "عدد_الطوابق",
     "طوابق_فوق_الأرض",
     "floors above ground",
     "floor_count"
    },
    wikidata={property = "P1101"}, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   },
   {
    type = "row",
    label = "الطوابق الأرضية",
    value = {
     "الطوابق الأرضية",
     "طوابق أرضية",
     "عدد الطوابق الأرضية",
     "طوابق تحت الأرض",
     "floors below ground"
    },
    wikidata={property = "P1139"}, 
    metadata = {
     description = "",
     option = "", 
     type = "", 
    }
   }
  }
 }
end

building.description["causeOfDestruction"] =  ""
function building.causeOfDestruction()
 return {
  type = "row",
  label = "سبب الدمار",
  value = {"سبب الدمار", "cause of destruction"},
  wikidata = {property = "P770"}, 
  metadata = {
   description = "",
   option = "", 
   type = "", 
  }
 }
end
building.destroyedby = building.causeOfDestruction

building.description["material"] =  ""
function building.material()
 return {
  type = "row",
  label = "مادة البناء",
  plurallabel = "مواد البناء",
  value = {"مادة البناء", "المواد_المستخدمة", "material"},
  wikidata = {
   wikimod = "Wikidata.Ca",
   property = "P186",
   qualifier = "P518",
   formatting = "table",
   conjunction = "<br />",
   rowformat = "$0$R0 $1",
   rowsubformat1 = "<small>($1)</small>"
  }, 
  metadata = {
   description = "",
   option = "", 
   type = "", 
  }
 }
end

building.description["colour"] =  ""
function building.colour()
 return {
  type = "row",
  label = "اللون",
  plurallabel = "الألوان",
  value = {"لون", "ألوان"},
  wikidata={property = "P462"}, 
  metadata = {
   description = "",
   option = "", 
   type = "", 
  }
 }
end

building.description["inscription"] =  ""
function building.inscription()
 return {
  type = "row",
  label = "لافتة",
  value = {"لافتة", "يافطة"},
  wikidata = {
   wikimod = "Wikidata.Ca",
   property = "P1684",
   listmax = 1
  }, 
  metadata = {
   description = "النقوش والعلامات والتوقيعات على الموضوع",
   option = "", 
   type = "", 
  }
 }
end

building.description["equipment"] =  ""
function building.equipment()
 return {
  type = "row",
  description = "التجهيزات التي يتم توفيرها",
  label = "التجهيز",
  plurallabel = "التجهيزات",
  value = {"تجهيز", "التجهيز"},
  wikidata={property = "P912"}, 
  metadata = {
   description = "",
   option = "", 
   type = "", 
  }
 }
end

building.description["replaces"] =  generic.description["replaces"]
function building.replaces()
 return generic.replaces()
end

building.description["replacedby"] =  generic.description["replacedby"]
function building.replacedby()
 return generic.replacedby()
end

building.description["visitors"] =  ""
function building.visitors()
 return {
  type = "row",
  label = "عدد الزوار سنويا",
  value = {"الزوار", "عدد الزوار سنويا", "زوار"},
  wikidata = {
   wikimod = "Wikidata.Ca",
   property = "P1174",
   showDate = "true",
   conjunction = "<br />",
   list = "bestrank"
  }, 
  metadata = {
   description = "",
   option = "", 
   type = "", 
  }
 }
end

building.description["protection"] =  ""
function building.protection()
 return {
  type = "row",
  label = "Statut patrimonial",
  value = {"classement", "protection"},
  --wikidata = {property ='P1425'}, 
  metadata = {
   description = "",
   option = "", 
   type = "", 
  }
 }
end

building.description["WHS_unesco"] =  "نشر بيانات حول تصنيف اليونيسكو للتراث العالمي"
function building.WHS_unesco()
 local subtitle = "[[ملف:World Heritage Logo.svg|20px]] [[موقع تراث عالمي|موقع اليونيسكو للتراث العالمي]]" 
 return {
        type = "multi",
        rows = {
        	{type="row1col", 
        		style={['background-color'] = '#F3F3F3',['font-weight'] = 'bold'},
        		wikidata = {wikimod = "Wikidata.Ca", property = "P1435", list=1,
			    	whitelist0 = "Q43113623,Q16617071,Q52683527,Q52683530,Q1459900", 
			    	formatting="table", editicon='false',
			    	rowformat= subtitle 
        		},
                wikidata2 = {wikimod = "Wikidata.Ca", 
                	property = "P2614 OR P757",  editicon='false', list=1,
                	formatting ="table", 
			    	rowformat= subtitle
                }
        	},
        	{
			    type = "row",
			    label = "النوع",
			    value = {"نوع_موقع_تراث_عالمي","WH type"},
			    wikidata = {wikimod = "Wikidata.Ca", 
			    	property = "P1435", 
			    	whitelist0 = "Q9259,Q43113623,Q16617071,Q52683527,Q52683530,Q1459900", 
			    	formatting="table", 
			    	rowformat="* $0$R0 $1", qualifier1='P361', 
			    	rowsubformat1='<small><br />(جزء من $1)</small>'
			    },
			    metadata = {
			    	description = "",
			    	option = "", 
			    	type = "", 
			    }
		    },
			{
				type = "row",
			    label = "السنة",
			    value = {"سنة_موقع_تراث_عالمي","WH year"},
			    wikidata = {wikimod = "Wikidata.Ca", 
			     property = "P1435",
			     whitelist0 = "Q43113623,Q9259,Q16617071,Q52683527,Q52683530,Q1459900",
			     qualifier1 = "P580", qualifier2 = "P582",
			     colformat1='Y', colformat2='Y',
			     formatting="table", rowformat="$1",
			     rowsubformat1 = "$1$2", rowsubformat2 = "&nbsp; إلى $2"
			    }, 
			    metadata = {
			    	description = "",
			    	option = "", 
			    	type = "", 
			    }
			},
            {
                type = "row",
                label = "[[موقع_تراث_عالمي#معايير_الاختيار|المعايير]]",
                value = {"معيار_موقع_تراث_عالمي","WH criteria"},
                wikidata = {wikimod = "Wikidata.Ca", 
                	property = "P2614", colformat0="label", formatting="table", rowformat="$0",
                	case=function(v) 

                        if(type(v) == 'string') then 
                			return mw.ustring.gsub( v, "معيار تقدير القيمة العالمية الاستثنائية", "" )
                		end
                		return v
                	end
                },
			    metadata = {
			    	description = "",
			    	option = "", 
			    	type = "", 
			    }
            },
            {
                type = "row",
                label = "رقم التعريف",
                value = {"رقم_موقع_تراث_عالمي","WH id"},
                wikidata = {
                	wikimod = "Wikidata.Ca", 
                	property = "P1435", qualifier = "P217 or /P757", 
                	whitelist0 = "Q43113623,Q9259,Q16617071,Q52683527,Q52683530,Q1459900",
                	formatting ="table",
                	rowformat = "[https://whc.unesco.org/ar/list/$1 $1]"},
                metadata = {
					description = "",
					option = "", 
					type = "", 
                }
            }
        }
    }
end

building.description["heritage"] =  ""
function building.heritage()
 return {
		    type = "row",
		    label = "تصنيف تراثي",
		    plurallabel = "تصنيفات تراثية",
		    value = {"تراث","heritage"},
		    wikidata = {wikimod = "Wikidata.Ca", 
		    	property = "P1435", 
		    	blacklist0 = "Q9259,Q43113623,Q16617071,Q52683527,Q52683530,Q1459900", 
		    	formatting="table", 
		    	rowformat="* $0$R0", showDate='true'
		    },
		    metadata = {
		    	description = "",
		    	option = "", 
		    	type = "", 
		    }
	    }
end

building.description["danger"] =  ""
function building.danger()
 return {
  type = "row",
  label = "الخطر",
  plurallabel = "الأخطار",
  value = {"خطر", "danger", "dangers"},
  wikidata = {
   wikimod = "Wikidata.Ca",
   property = "P3335",
   listmax = 5
  }, 
  metadata = {
   description = "المخاطر التي يتعرض لها",
   option = "", 
   type = "", 
  }
 }
end

building.description["policy"] =  ""
function building.policy()
 return {
  type = "row",
  label = "القانون",
  plurallabel = "القوانين",
  value = {"قانون", "policy"},
  wikidata = {
   wikimod = "Wikidata.Ca",
   property = "P5023",
   listmax = 5
  }, 
  metadata = {
   description = "السياسة والقوانين المتبعة",
   option = "", 
   type = "", 
  }
 }
end

building.description["geoloc"] =  generic.description["geoloc"]
function building.geoloc(params)
 return generic.geoloc(params)
end

building.description["awards"] =  generic.description["awards"]
function building.awards()
 return generic.awards(params)
end

building.description["recordheld"] =  ""
function building.recordheld()
 return {
  type = "row",
  label = "رقم قياسي",
  plurallabel = "أرقام قياسية",
  value = {"رقم_قياسي", "record"},
  wikidata = {
   wikimod = "Wikidata.Ca",
   property = "P1000",
   showDate = "true",
   listmax = 3,
   conjunction = "<br />"
  }, 
  metadata = {
   description = "الأرقام القياسية المسجلة",
   option = "", 
   type = "", 
  }
 }
end

building.description["significantEvent"] =  ""
function building.significantEvent()
 return {
  type = "row",
  label = "أحداث مهمة",
  value = {"أحداث", "تواريخ_مهمة", "significant_event", "events"},
  wikidata = {
   wikimod = "Wikidata.Ca",
   formatting = "table",
   property = "P793",
   qualifier1 = "P642",
   qualifier2 = "P585",
   qualifier3 = "P580",
   qualifier4 = "P582",
   rowsubformat1 = "$1 $3",
   rowsubformat2 = "$2 :",
   rowsubformat3 = "<small><br />($3$4)</small>",
   rowsubformat4 = "&nbsp; - $4",
   rowformat = "* $2 $0 $1 $R0",

   --conjunction = '<div />',
   blacklist0 = "Q18752057,Q385378,Q1370468,Q15051339,Q1417098," 
    .. "Q125375,Q1306940,Q217102,Q2144402,Q18621193,Q331483," 
    .. "Q17781833,Q6160,Q5135520,Q27136782,Q59913255"
  }, 
  metadata = {
   description = "أهم الأحداث التي شهدها",
   option = "", 
   type = "", 
  }
 }
end

building.description["facilities"] =  ""
function building.facilities()
 return {
  type = "row", 
  label = "المرافق",
  value = {"مرافق", "facilities"},
  wikidata = {
   wikimod = "Wikidata.Ca",
   property = "P2670",
   formatting = "table",
   qualifier1 = "P1114 OR P31 OR P580 OR P582 OR P149",
   qualifier6 = "P1114",
   qualifier2 = "P31",
   qualifier3 = "P580",
   qualifier4 = "P582",
   qualifier5 = "P149",
   rowsubformat1 = ":<small>$6$2$3$5</small>",
   rowsubformat6 = "&nbsp;العدد $6",
   rowsubformat2 = "<br />&nbsp;$2",
   rowsubformat3 = "<br />&nbsp;(منذ $3$4)",
   rowsubformat4 = "&nbsp; حتى $4",
   rowsubformat5 = "&nbsp;''الطراز المعماري'': $5",
   rowformat = "* '''$0'''$R0 $1"
  },
  metadata = {
   description = "مرافق المبنى الخاصة",
   option = "", 
   type = "string", 
  }
 }
end


return building