ماژول:صندخ/ادوات/بنا

ویکی‌پدیا، آزادِ دانشنومه، جه

توضیحات این پودمان می‌تواند در ماژول:صندخ/ادوات/بنا/توضیحات قرار گیرد.

local building = {}
local localdata = require("ماژول:صندخ/دیتا")
local item = localdata.item

local general = require "ماژول:صندخ/ادوات"

local WD = require "Module:Wikidata.Ca"

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 WD.claim {
            property = "P793",
            qualifier = "P518",

            qualifier2 = "P580 or P582", --i
            qualifier3 = "P580", qualifier4 = "P582",
            qualifier5 = "P585",

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

            rowsubformat2 = ' $3 – $4',
            rowsubformat5 = ' $5',

            formatting = "table",
            conjunction = "<br />",
            rowformat = "$1$2$5$R0",
            whitelist0 = event,
            query = "num"
        }
    elseif string.sub(event, 1, 1) == "P" then
        return WD.claim {property = event, query = "num"}
    else
        return error("invalid-entity-id : " .. event)
    end
end

function building.title()
    return general.title()
end

--Image
function building.mainimage()
    return general.mainimage()
end

function building.country()
    return {
        type = "row",
        label = "کشور",
        value = {"دولت", "کشور", "country"},
        wikidata = {
            wikimod = "Wikidata.Ca",
            property = "P17", listrank="bestrank",
            formatting = "table",
            conjunction = "<br />",
            rowformat = "{{flag|$0}}$R0",
            colformat0 = "label"
        },
        metadata = {
			description = "کشوری که این مقاله ونجه ربط دارنه",
			option = "", 
			type = "string", 
        }
    }
end



function building.status()
    return {
                type = "row",
                label = "وضعیت",
                value = {"وضعیت", "status"},
                wikidata = {property = "P5816"},
                metadata = {
                    description = "مثلاً بنا سالم هسته یا نا. یا اونجه کار کننه یا نا و...",
                    option = "", 
                    type = "", 
                }
            }
end

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

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","منطقه نوم 1","subdivision_name1", "subdivision1"},
                label = {"منطقه نوع 1","subdivision_type1"} ,
                defaultlabel = "منطقه 1",
                metadata = {
					description = "",
					option = "", 
					type = "", 
                }
            },
            {
                type = "row",
                value = {"منطقه نوم 2","منطقه_نوم_2","subdivision_name2", "subdivision2"},
                label = {"منطقه نوع 2","subdivision_type2"} ,
                defaultlabel = "منطقه 2",
                metadata = {
					description = "",
					option = "", 
					type = "", 
                }
            },
            {
                type = "row",
                value = {"منطقه نوم 3","منطقه_نوم_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", showDate = "true" },
                metadata = {
					description = "رسماً کشور تقسیمات درون کجه شنه",
					option = "", 
					type = "", 
                }
            },
            building.historicalregion(),
            building.country()
        }
    }
end

function building.onshoreof()
    return {
        type = "row",
        label = "بندر",
        value = {"بندر","on_coast_of","baigné par"},
        wikidata = {property = "P206"},
        metadata = {
			description = "ئو پلی شهرون وسه کار شونه",
			option = "", 
			type = "", 
        }
    }
end

function building.watershed()
    return {
        type = "row",
        label = "روخنه حوضه",
        value = "روخنه حوضه",
        wikidata = {property = "P4614"},
        metadata = {
			description = "",
			option = "", 
			type = "", 
        }
    }
end

function building.protectedarea()
    return {
        type = "row",
        label = "حفاظت‌بئی منطقه",
        plurallabel = "حفاظت‌بئی منطقه",
        value = {"حفاظت‌بئی منطقه", "منطقه حفاظت شده", "protected_area"},
        wikidata = {property = "P3018"},
        metadata = {
			description = "",
			option = "", 
			type = "", 
        }
    }
end

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

function building.mountainrange()
    return {
        type = "row",
        label = "رشته کوه",
        plurallabel = "رشته کوهون",
        value = {"کوهون", "رشته کو", "mountain_range"},
        wikidata = {property = "P4552"},
        metadata = {
			description = "",
			option = "", 
			type = "", 
        }
    }
end

function building.elevation()
    return {
        type = "row",
        label = "بلندی",
        value = {"بلندی", "ارتفاع", "elevation"},
        wikidata = {
            wikimod = "Wikidata.Ca",
            property = "P2044",
            formatting = "unitlinked"
        },
        metadata = {
			description = "ارتفاع از سطح آب",
			option = "", 
			type = "", 
        }
    }
end

function building.coordinates(args)
    return general.coordinates(args)
end

function building.website(args)
    return general.website(args)
end

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


function building.postal_code()
    return {
        type = "row", 
        label = "پستی کد",
        value = {"پستی کد","postal_code"},
        wikidata = {property = "P281"},
        metadata = {
			description = "کد پستی",
			option = "", 
			type = "", 
        }
    }
end

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

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

function building.construction()
    return {
        type = "multi",
        rows = {
            {
                type = "row",
                label = "بساتن شروع",
                value = {"بساتن_شروع", "بساتن شروع", "start_date", "construction_start_date"},
                wikidata = {
                    wikimod = "Wikidata.Ca",
                    property = "P793",
                    qualifier = "P580 or P585",
                    formatting = "table",
                    conjunction = "<br />",
                    rowformat = "$1",
                    whitelist0 = "Q385378,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 = {
                    wikimod = "Wikidata.Ca",
                    property = "P793",
                    qualifier = "P585",
                    formatting = "table",
                    conjunction = "<br />",
                    rowformat = "$1",
                    whitelist0 = "Q1075723"
                },
                metadata = {
					description = "تاریخ نهایه الأعمال الكبرى",
					option = "", 
					type = "date", 
                }
            },
            {
                type = "row",
                label = "تموم بین",
                value = {"تموم بین تاریخ", "تموم بین", "est_completion", "completion_date"},
                wikidata = {
                    wikimod = "Wikidata.Ca",
                    property = "P793",
                    qualifier = "P582",
                    formatting = "table",
                    conjunction = "<br />",
                    rowformat = "$1",
                    whitelist0 = "Q385378"
                },
                metadata = {
					description = "تاریخ أعمال الانتهاء",
					option = "", 
					type = "date", 
                }
            },
            {
                type = "row",
                value = {"بساتن", "ساخت و ساز", "ساخت"},
                label = "بساتن",
                --wikidata = {property='P'},
                metadata = {
					description = "کِی ونه بنا ره بساتنه؟",
					option = "", 
					type = "", 
                }
            }
        }
    }
end

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

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 = keyDate {"P1619"}, 
                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

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

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", 
                }
            },
            building.replacedby(),
        }
    }
end

function building.closure()
    return {
        type = "row",
        value = {"بسته شدن", "بستن", "دوسته بین", "closing_date", "closed"},
        label = "دَوِسته بیّن",
        wikidata = keyDate {"Q5135520"},
        wikidata2 = keyDate {"P3999"},
        wikidata3 = keyDate {"P576"}, 
        metadata = {
			description = "دَوِسته بیّن تاریخ",
			option = "", 
			type = "date", 
        }
    }
end

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

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

function building.operator()
    return {
        type = "row",
        label = "اداره",
        value = {"اپراتور", "کارزن", "کارگیر", "operator", "اداره"},
        wikidata = {
            wikimod = "Wikidata.Ca",
            property = "P137",
            showDate = "true",
            conjunction = "<br />"
        }, 
        metadata = {
			description = "اپراتور ونه کی بییه",
			option = "", 
			type = "", 
        }
    }
end

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

function building.part_of() 
    return {
        type = "row",
        label = "جزئی از",
        value = "جزئی از",
        wikidata = {
            property = "P361"
        }, 
        metadata = {
			description = "",
			option = "", 
			type = "", 
        }
    }
end

function building.orientation()
    return {
        type = "row",
        label = "جهت",
        value = {"جهت", "orientation"},
        wikidata = {property = "P7469", numval = "1"}, 
        metadata = {
			description = "",
			option = "", 
			type = "", 
        }
    }
end

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

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

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

function building.religion()
    return {
        type = "row",
        label = "دین",
        value = {"مذهب", "دین", "religion"},
        wikidata={property = "P140"}, 
        metadata = {
			description = "",
			option = "", 
			type = "", 
        }
    }
end

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

function building.dimensions()
    return {
        type = "multi",
        rows = {
            {
                type = "row",
                label = "بلندی",
                value = {"ارتفاع", "height"},
                wikidata = {
                    wikimod = "Wikidata.Ca",
                    property = "P2048",
                    qualifier = "P1013",
                    colformat0 = "unitlinked",
                    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 = "ارتفاع",
                wikidata = {
                    wikimod = "Wikidata.Ca",
                    property = "P2048",
                    list = "bestrank",
                    colformat0 = "unitlinked",
                    formatting = "table",
                    qualifier = "P1013",
                    rowformat = "$0$R0",
                    whitelist1 = "Q24192182"
                }, 
		        metadata = {
					description = "",
					option = "", 
					type = "", 
		        }
            },
            {
                type = "row",
                label = "هوایی ارتفاع",
                value = {"هوایی برج", "antenna_spire"},
                wikidata = {
                    wikimod = "Wikidata.Ca",
                    property = "P2048",
                    list = "bestrank",
                    colformat0 = "unitlinked",
                    formatting = "table",
                    qualifier = "P1013",
                    rowformat = "$0$R0",
                    whitelist1 = "Q131214,Q852590"
                }, 
		        metadata = {
					description = "",
					option = "", 
					type = "", 
		        }
            },
            {
                type = "row",
                label = "بالاترین طبقه",
                value = {"بالاترین طبقه", "top_floor"},
                wikidata = {
                    wikimod = "Wikidata.Ca",
                    property = "P2048",
                    colformat0 = "unitlinked",
                    formatting = "table",
                    qualifier = "P1013",
                    rowformat = "$0$R0",
                    whitelist1 = "Q31271474"
                }, 
		        metadata = {
					description = "",
					option = "", 
					type = "", 
		        }
            },
            {
                type = "row",
                label = "جولی",
                value = "جولی",
                wikidata = {
                    wikimod = "Wikidata.Ca",
                    property = "P2610",
                    formatting = "unit"
                }, 
		        metadata = {
					description = "",
					option = "", 
					type = "", 
		        }
            },
            {
                type = "row",
                label = "طول",
                value = "طول",
                wikidata = {
                    wikimod = "Wikidata.Ca",
                    property = "P2043",
                    formatting = "unit"
                }, 
		        metadata = {
					description = "",
					option = "", 
					type = "", 
		        }
            },
            {
                type = "row",
                label = "عرض",
                value = "عرض",
                wikidata = {
                    wikimod = "Wikidata.Ca",
                    property = "P2049",
                    formatting = "unit"
                }, 
		        metadata = {
					description = "",
					option = "", 
					type = "", 
		        }
            },
            {
                type = "row",
                label = "بروته بیّه",
                value = "بروته",
                wikidata = {
                    wikimod = "Wikidata.Ca",
                    property = "P2050",
                    formatting = "unit"
                }, 
		        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",
                    formatting = "unit"
                }, 
		        metadata = {
					description = "",
					option = "", 
					type = "", 
		        }
            },
            {
                type = "row",
                label = "گتی",
                value = {"مساحت", "گتی"},
                wikidata = {
                    wikimod = "Wikidata.Ca",
                    property = "P2046",
                    formatting = "table",
                    conjunction = "<br />",
                    qualifier = "P518",
                    rowformat = "$0$R0 $1",
                    rowsubformat1 = "<small>($1)</small>",
                    colformat0 = "unitlinked"
                }, 
		        metadata = {
					description = "",
					option = "", 
					type = "", 
		        }
            },
            {
                type = "row",
                label = "حجم",
                value = {"حجم", "volume"},
                wikidata = {
                    wikimod = "Wikidata.Ca",
                    property = "P2234",
                    formatting = "unit"
                }, 
		        metadata = {
					description = "",
					option = "", 
					type = "", 
		        }
            },
            {
                type = "row",
                label = "زمینی مسافت",
                value = {"مسافت", "clearance"},
                wikidata = {
                    wikimod = "Wikidata.Ca",
                    property = "P2793",
                    formatting = "unit"
                }, 
		        metadata = {
					description = "",
					option = "", 
					type = "", 
		        }
            }
        }
    }
end

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

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

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

function building.colour()
    return {
        type = "row",
        label = "رنگ",
        plurallabel = "رنگ‌ها",
        value = {"رنگ", "رنگ"},
        wikidata={property = "P462"}, 
        metadata = {
			description = "",
			option = "", 
			type = "", 
        }
    }
end

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

function building.equipment()
    return {
        type = "row",
        description = "تجهیزاتی که ونه دله کار بزونه",
        label = "تجهیزات",
        plurallabel = "تجهیزات",
        value = {"تجهیزات"},
        wikidata={property = "P912"}, 
        metadata = {
			description = "",
			option = "", 
			type = "", 
        }
    }
end

function building.replaces()
    return {
        type = "row",
        label = "تغییر مکان",
        value = {"تغییر مکان","replaces"},
        wikidata={property = "P1398"}, 
        metadata = {
			description = "",
			option = "", 
			type = "", 
        }
    }
end

function building.replacedby()
    return {
        type = "row",
        label = "تغییر مکان توسط",
        value = {"تغییر مکان توسط","replaced_by"},
        wikidata={property = "P167"}, 
        metadata = {
			description = "",
			option = "", 
			type = "", 
        }
    }
end

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

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

function building.unesco()
    local id = localdata["رقم"]
    if (id == "-") then
        return nil
    end
    if id then
        id = "[http://whc.unesco.org/ar/list/" .. id .. " " .. id .. "]"
    else
        id = wd.formatAndCat {entity = item, property = "P757", urlpattern = "http://whc.unesco.org/ar/list/$1"}
    end
    if (not id) then
        return nil
    end
    return {
        type = "table",
        title = "[[File:World Heritage Emblem.svg|15px|alt=Logo du patrimoine mondial|link=موقع تراث عالمی]] تراث عالمی",
        rows = {
            {type = "row", label = "Désignation", value = "nom unesco"},
            {
                type = "row",
                label = "نوع",
                value = "نوع",
                wikidata = {property = "P1435", targetvalue = {"Q16617071", "Q52683527", "Q52683530"}}, 
		        metadata = {
					description = "",
					option = "", 
					type = "", 
		        }
            },
            {
                type = "row",
                label = "سال",
                value = "سال",
                wikidata = {
                    property = "P1435",
                    targetvalue = {"Q9259", "Q16617071", "Q52683527", "Q52683530"},
                    showonlyqualifier = {"P580"}
                }, 
		        metadata = {
					description = "",
					option = "", 
					type = "", 
		        }
            },
            {
                type = "row",
                label = "رقم التعریف",
                value = function()
                    return id
                end, 
		        metadata = {
					description = "",
					option = "", 
					type = "", 
		        }
            },
            {
                type = "row",
                label = "معیارون",
                singularlabel = "معیار",
                value = function(localdata)
                    if localdata["معیارون"] then
                        return "[http://whc.unesco.org/ar/criteres/" .. localdata["معیارون"] .. "]"
                    end
                end,
                wikidata = function(item)
                    local str, numclaims =
                        wd.formatStatements {
                        entity = item,
                        property = "P2614",
                        link = "-",
                        conjtype = " ",
                        returnnumberofvalues = true
                    }
                    if str then
                        return wd.formatAndCat {
                            value = "[http://whc.unesco.org/ar/criteres/$1 " .. str .. "]",
                            entity = item,
                            property = "P2614"
                        }, numclaims
                    end
                end, 
		        metadata = {
					description = "",
					option = "", 
					type = "", 
		        }
            },
            {type = "row", label = "Surface", value = "surface unesco"},
            {type = "row", label = "Zone tampon", value = "surface zone tampon unesco"}
        }
    }
end

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

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

function building.geoloc(params)
    return general.geoloc(params)
end

function building.awards()
    return general.awards(params)
end

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

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 <small>$3</small>",
            rowsubformat2 = "$2 :",
            rowsubformat3 = "<br />($3$4)",
            rowsubformat4 = "&nbsp; - $4",
            rowformat = "* $2 $0 $1 $R0",

            conjunction = "<br />",
            blacklist0 = "Q18752057,Q385378,Q1370468,Q15051339,Q1417098," ..
                "Q125375,Q1306940,Q217102,Q2144402,Q18621193,Q331483," .. "Q17781833,Q6160,Q5135520"
        }, 
        metadata = {
			description = "مهم مهم اتفاقونی که ونه وسه دکته",
			option = "", 
			type = "", 
        }
    }
end

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