Moduuli:Fr:Infobox/Saari

Wikipediasta
Siirry navigaatioon Siirry hakuun
Omenainen
Sijainti
Sijaintipaikka
Vesialue
Ikä
Väestö
Luokitus
Rekisteröity arkeologinen kohde Suomessa[1]View and modify data on Wikidata
Kartta



  1. muinaisjäännösrekisteriView and modify data on Wikidata . Tieto on haettu Wikidatasta.
local building = require "Module:Fr:Infobox/Fonctions/Bâtiment"
local area = require "Module:Fr:Infobox/Fonctions"
local wd = require "Module:Fr:Wikidata"
local localdata = require "Module:Fr:Infobox/Localdata" 

local function skip_wikidata_if_exists(localdata, dataparam, matchparam, property)
	local sourcestr=localdata[dataparam] 
	if sourcestr ~= '-' then
		local match=wd.formatStatements{ entity= localdata.item, property = property, link="-"} 
		if (sourcestr and match and string.find(sourcestr,match)) then
			return nil
		elseif (sourcestr and match and match == "Tyynimeri" and string.find(sourcestr,"Tyyni valtameri") ) then
			return nil
		end
	end
	return sourcestr
end

return 
	{
	parts =
    	{
		area.title('entete map', {}, 'alkuperäinen nimi', {property = 'P1705', showlang = false} ),    		
		area.mainimage(),
		{type = 'table', rows = {
			{type = 'row', label = "Muut nimet", value = "muut nimet" },
--			{type = 'row', label = "Tyyppi", value = "Tyyppi", wikidata = {property = 'P31', excludevalues = {'Q23442', 'Q10864048', 'Q473972'}, defaultlinkquery = {property = {'P2354', 'P137'}}}},
			building.adminlocation(),
			building.islandlocation(),
			{type = 'row', label = "Saariryhmä", value = function() return skip_wikidata_if_exists(localdata, 'saariryhmä', '-', 'P131') end  },			
			building.geographiclocation(),
			{type = 'row', label = 'Vesialue', value = 'vesialue', blockers= { 'merialue' }, wikidata = {property = 'P206', defaultlink = 'querylabel', defaultlinkquery = {property = 'P361'}} },
			{type = 'row', label = 'Merialue', value = function() return skip_wikidata_if_exists(localdata, 'merialue', 'vesialue', 'P206') end  },			
			building.mountainrange(),
			{type = 'row', label = 'Korkein kohta',	plurallabel = 'Korkeimmat kohdat',value = 'korkein kohta', wikidata = {property = {'P610','P2044'}, showsource=true } },
--			building.elevation(),
			{type = 'row', label = "Pinta-ala", value = function()  return  building.getLocalValueWithDefaultUnit(localdata, 'pinta-ala',
				{
					type='desimaaliluku', 
					allowedunits='m²,ha,km²m²,km²', 
					templatename='Malline:Saari WD', 
					defaultunit='km²', 
					errormessage='Esimerkkiarvo: 10 km²', 
					minvalue=0,
					maxvalue=1000000,
					skiptests=""
				} ) end,
			wikidata = {property = 'P2046', showsource=true, targetunit = 'sqkm', rounding = '1', withsource = 'any'} },			
			{type = 'row', label = '[[Topografinen prominenssi|Prominenssi]]', 
				value = function()  return  building.getLocalValueWithDefaultUnit(localdata, 'Prominenssi',
				{
					type='desimaaliluku', 
					allowedunits='m', 
					templatename='Malline:Saari WD', 
					defaultunit='m', 
					errormessage='Esimerkkiarvo: 10 m', 
					minvalue=0,
					maxvalue=50000,
					skiptests=""
				} ) end, 
				wikidata = {property = 'P2660', targetunit = 'm', showsource=true, rounding = '0', removedupes = true, conjtype = ' tai ', withsource = 'any'}
			},
			building.protectedarea(),
			{type = 'row', label = 'Ikä', value = 'ikä', property = 'P2348', showsource=true, withsource = 'any' },
			{type = 'row', label = 'Purkautunut viimeksi', value = 'Purkautunut viimeksi', 
				wikidata = {
					property = 'P793', 
					showsource=true, 
					targetvalue = 'Q29575458', 
					showonlyqualifier = {'P585', 'P580', 'P582'}, 
					conjtype = ' - ',
					sourceproperty = 'P123,P248,P854', 
					withsource = 'any', 
				}},	
			{type = 'row', label = "Laji", plurallabel = "Lajit", value = "lajit", wikidata = {property = 'P1990', numval = '5', showsource=true}},
			},
		},
		{type = 'table', title = 'Väestö', rows = {
			{type = 'row', label = "Asukasluku", value = "väkiluku", 
				wikidata = {
					property = 'P1082', 
					showdate = 'true', 
					precision= 'year',
					sourceproperty = 'P123,P248,P854', 
					withsource = 'any', 
					showsource=true, 
					sorttype= 'inverse', 
					numval=1, 
				}},
			{type = 'row', label = "Suurin kaupunki", value = "suurin kaupunki"},
			{type = 'row', label = "Asutuskeskukset", value = "asutuskeskukset"},
--			{type = 'row', label = "Kieli", plurallabel = "Kielet", value = "kielet", wikidata = {property = 'P2936', showdate = 'true', showsource=true, defaultlink='-'}},			
			{type = 'row', label = "Kieli", plurallabel = "Kielet", value = "kielet"},			

			{type = 'row', label = "Luokitus", value = "luokitus", wikidata = {property = 'P1435', excludevalues = 'Q9259', showdate = 'true', textformat = 'minimum', sorttype = 'chronological', showsource=true, defaultlink='-'}},
--			{type = 'row', label = "Info", value = "info", wikidata = {property = 'P2872', numval = '5'}},
			},
		},
--		building.unesco(),
		building.geoloc({pointtype = 'aire protégée', maptype = 'relief', marker = 'park', default_zoom = 3}),
		{type = 'table',  rows = {
--			building.coordinates(),
			}
		}
	},
}