diff --git a/conditor-dumps/04-enrich.ini b/conditor-dumps/04-enrich.ini index a707f09..71841e1 100644 --- a/conditor-dumps/04-enrich.ini +++ b/conditor-dumps/04-enrich.ini @@ -17,7 +17,7 @@ # Récupère les infos Loterre 2XK [map/map/assign] path = ws.loterre2xk -value = get("ApilRnsr").map((rnsr,id) => ({id, value: rnsr})) +value = get("ApilRnsr").castArray().filter(Boolean).map((rnsr,id) => ({id, value: rnsr})) [map/map/map] path = ws.loterre2xk @@ -37,7 +37,7 @@ # Les éléments de ws.loterre2xk sont dans le même ordre que ApilRnsr, # et il y en a autant. path = ApilWsLaboIntitule -value = get("ws.loterre2xk") \ +value = get("ws.loterre2xk").castArray().filter(Boolean) \ .map((orga) => orga.value["skos$prefLabel/$t"] ?? "n/a") [map/map/exchange] @@ -58,7 +58,7 @@ # Supprime les accents et met en majuscules path = tmp.ApilWsLaboIntitule -value = get("ApilWsLaboIntitule") \ +value = get("ApilWsLaboIntitule").castArray().filter(Boolean) \ .map(str => str \ .normalize("NFKD").replace(/[\u0300-\u036f]/g, "") \ .toUpperCase() \ @@ -66,7 +66,7 @@ [assign] path = ApilWsSigleLaboIntitule -value = get("ApilWsLaboSigle") \ +value = get("ApilWsLaboSigle").castArray().filter(Boolean) \ .map((sigle,i) => [ \ sigle, \ _.get(self,"tmp.ApilWsLaboIntitule")[i] \ @@ -78,7 +78,7 @@ [assign] path = ApilWsInstitutCnrs -value = get("ApilRnsr").map((value, id) => ({id, value})) +value = get("ApilRnsr").castArray().filter(Boolean).map((value, id) => ({id, value})) [map] path = ApilWsInstitutCnrs @@ -95,7 +95,7 @@ [assign] path = ApilWsInstitutCnrs -value = get("ApilWsInstitutCnrs") \ +value = get("ApilWsInstitutCnrs").castArray().filter(Boolean) \ .map("value") \ .filter(institut => institut && institut !== "n/a") @@ -232,12 +232,12 @@ [assign] path = ApilWsCodeISO -value = get("ws.libpostal") \ +value = get("ws.libpostal").castArray().filter(Boolean) \ .map(n => n.value?.country?.cartographyCode) \ .uniq().filter(Boolean) path = ApilWsCountry -value = get("ws.libpostal") \ +value = get("ws.libpostal").castArray().filter(Boolean) \ .map(n => n.value?.country?.["prefLabel@en"]) \ .uniq().filter(Boolean)