@@ -217,6 +217,12 @@ def make_source_event_item(self, pdc_hazard_data: HazardEventValidator, pdc_expo
217217 monty .country_codes = list (set (all_iso3 ))
218218
219219 monty .hazard_codes = self ._map_pdc_to_hazard_codes (hazard = pdc_hazard_data .type_ID )
220+
221+ # Generate keywords for discoverability
222+ hazard_keywords = self .hazard_profiles .get_keywords (monty .hazard_codes )
223+ country_keywords = [obj .admin0 for obj in pdc_exposure_data .totalByCountry ] if pdc_exposure_data .totalByCountry else []
224+ item .properties ["keywords" ] = list (set (hazard_keywords + country_keywords ))
225+
220226 # TODO: Deal with correlation id if country_codes is a empty list
221227 if monty .country_codes :
222228 monty .compute_and_set_correlation_id (hazard_profiles = self .hazard_profiles )
@@ -229,31 +235,64 @@ def make_source_event_item(self, pdc_hazard_data: HazardEventValidator, pdc_expo
229235 return item
230236
231237 def _map_pdc_to_hazard_codes (self , hazard : str ) -> List [str ] | None :
232- """Maps the hazard to the standard UNDRR-ISC 2020 Hazard Codes"""
233- hazard_mapping = {
234- "AVALANCHE" : ["MH0050" , "nat-geo-mmd-ava" ],
235- "DROUGHT" : ["MH0035" , "nat-cli-dro-dro" ],
236- "EARTHQUAKE" : ["GH0001" , "nat-geo-ear-gro" ],
237- "EXTREMETEMPERATURE" : ["MH0040" , "MH0047" , "MH0041" , "nat-met-ext-col" , "nat-met-ext-hea" , "nat-met-ext-sev" ],
238- "FLOOD" : ["MH0012" , "nat-hyd-flo-flo" ],
239- "HIGHWIND" : ["MH0060" , "nat-met-sto-sto" ],
240- "LANDSLIDE" : ["nat-geo-mmd-lan" ],
241- "SEVEREWEATHER" : ["nat-met-sto-sev" ],
242- "STORM" : ["nat-met-sto-bli" ],
243- "TORNADO" : ["nat-met-sto-tor" ],
244- "CYCLONE" : ["nat-met-sto-tro" ],
245- "TSUNAMI" : ["MH0029" , "nat-geo-ear-tsu" ],
246- "VOLCANO" : ["GH0020" , "nat-geo-vol-vol" ],
247- "WILDFIRE" : ["EN0013" , "nat-cli-wil-for" ],
248- "WINTERSTORM" : ["nat-met-sto-bli" ],
249- "STORMSURGE" : ["MH0027" , "nat-met-sto-sur" ],
238+ """
239+ Map PDC hazard types to standard classification codes.
240+ Returns codes in order: [UNDRR-ISC 2025, EM-DAT, GLIDE]
241+
242+ The UNDRR-ISC 2025 code is the reference classification for the Monty extension.
243+ All three codes are included for maximum interoperability.
244+
245+ Args:
246+ hazard: PDC hazard type (e.g., 'EARTHQUAKE', 'FLOOD')
247+
248+ Returns:
249+ List of classification codes or None if not found
250+ """
251+ # Natural Hazards
252+ natural_hazards = {
253+ "AVALANCHE" : ["MH0801" , "nat-hyd-mmw-ava" , "AV" ],
254+ "BIOMEDICAL" : ["BI0101" , "nat-bio-epi-dis" , "EP" ],
255+ "DROUGHT" : ["MH0401" , "nat-cli-dro-dro" , "DR" ],
256+ "EARTHQUAKE" : ["GH0101" , "nat-geo-ear-gro" , "EQ" ],
257+ "EXTREMETEMPERATURE" : ["MH0501" , "nat-met-ext-hea" , "HT" ], # Default to heat, may need logic for cold
258+ "FLOOD" : ["MH0600" , "nat-hyd-flo-flo" , "FL" ],
259+ "HIGHSURF" : ["MH0702" , "nat-hyd-wav-wav" , "OT" ],
260+ "LANDSLIDE" : ["GH0300" , "nat-geo-mmd-lan" , "LS" ],
261+ "MARINE" : ["MH0700" , "nat-hyd-wav-wav" , "OT" ],
262+ "SEVEREWEATHER" : ["MH0103" , "nat-met-sto-sto" , "ST" ],
263+ "STORM" : ["MH0103" , "nat-met-sto-sto" , "ST" ],
264+ "TORNADO" : ["MH0305" , "nat-met-sto-tor" , "TO" ],
265+ "CYCLONE" : ["MH0306" , "nat-met-sto-tro" , "TC" ],
266+ "TSUNAMI" : ["MH0705" , "nat-geo-ear-tsu" , "TS" ],
267+ "VOLCANO" : ["GH0201" , "nat-geo-vol-vol" , "VO" ],
268+ "WILDFIRE" : ["EN0205" , "nat-cli-wil-for" , "WF" ],
269+ "WINTERSTORM" : ["MH0403" , "nat-met-sto-bli" , "OT" ],
250270 }
251271
272+ # Geopolitical & Technological Hazards
273+ tech_social_hazards = {
274+ "ACCIDENT" : ["TL0200" , "tec-mis-col-col" , "AC" ],
275+ "ACTIVESHOOTER" : ["SO0201" , "soc-soc-vio-vio" , "OT" ],
276+ "CIVILUNREST" : ["SO0202" , "soc-soc-vio-vio" , "OT" ],
277+ "COMBAT" : ["SO0201" , "soc-soc-vio-vio" , "OT" ],
278+ "CYBER" : ["TL0601" , "" , "OT" ], # No EM-DAT equivalent
279+ "MANMADE" : ["TL0000" , "tec-tec-tec-tec" , "OT" ],
280+ "OCCURRENCE" : ["OT0000" , "" , "OT" ], # No EM-DAT equivalent
281+ "POLITICALCONFLICT" : ["SO0201" , "soc-soc-vio-vio" , "OT" ],
282+ "TERRORISM" : ["SO0203" , "soc-soc-vio-vio" , "OT" ],
283+ "WEAPONS" : ["SO0201" , "soc-soc-vio-vio" , "OT" ],
284+ }
285+
286+ # Combine all mappings
287+ hazard_mapping = {** natural_hazards , ** tech_social_hazards }
288+
252289 if hazard not in hazard_mapping :
253- logger .warning (f"The hazard { hazard } is not in the mapping." )
290+ logger .warning (f"PDC hazard type ' { hazard } ' not found in UNDRR-ISC 2025 mapping." )
254291 return None
255292
256- return hazard_mapping .get (hazard )
293+ codes = hazard_mapping .get (hazard )
294+ # Filter out empty strings (for codes without EM-DAT equivalents)
295+ return [code for code in codes if code ] if codes else None
257296
258297 def make_hazard_item (self , event_item : Item , hazard_data : HazardEventValidator ) -> Item :
259298 """Create Hazard Item"""
@@ -266,10 +305,10 @@ def make_hazard_item(self, event_item: Item, hazard_data: HazardEventValidator)
266305 hazard_item .set_collection (self .get_hazard_collection ())
267306
268307 monty = MontyExtension .ext (hazard_item )
308+ monty .hazard_codes = [self .hazard_profiles .get_undrr_2025_code (hazard_codes = monty .hazard_codes )]
269309 # Hazard Detail
270310 monty .hazard_detail = HazardDetail (
271- cluster = self .hazard_profiles .get_cluster_code (hazard_item ),
272- severity_value = None ,
311+ severity_value = 0.1 , # 0.1 is passed inorder to pass validation it means None in this case
273312 severity_unit = "PDC Severity Score" ,
274313 severity_label = hazard_data .severity_ID ,
275314 estimate_type = MontyEstimateType .PRIMARY ,
0 commit comments