diff --git a/conditor-dumps/04-enrich.ini b/conditor-dumps/04-enrich.ini index d03b5b7..8ef58f5 100644 --- a/conditor-dumps/04-enrich.ini +++ b/conditor-dumps/04-enrich.ini @@ -6,6 +6,33 @@ [unpack] +# Quand les RNSR ne sont pas fournis dans authors.*.affiliations.*.rnsr +# on utilise le Web Service qui les met au même niveau dans wsRnsr +[map] +path = authors + +[map/map] +path = affiliations + +[map/map/swing] +test = get("rnsr").isEmpty() + +[map/map/swing/assign] +path = wsRnsr +value = thru(aff => ({\ + address: aff.address \ +})) + +[map/map/swing/expand] +path = wsRnsr +size = 100 + +[map/map/swing/expand/URLConnect] +url = https://affiliations-tools.services.inist.fr/v1/rnsr/json +timeout = 120001 +noerror = true + + # Prépare la structure à envoyer au web service v1/rnsr/info [assign] path = ws.rnsr @@ -47,16 +74,24 @@ path = ApilWsLaboIntitule value = get("ws.rnsr").map("value").flatten().map("intitule") -path = tmp.Rnsr1 -value = get("ws.rnsr").map("value").flatten().map("num_nat_struct") +[assign] +path = tmp.authorsAffiliationsRnsr +value = get("authors") \ + .map("affiliations") \ + .map(affiliations => affiliations.map( \ + affiliation => affiliation.rnsr) \ + ) -path = tmp.Rnsr2 -value = get("authors").flatMap("affiliations").flatMap("rnsr") +; path = tmp.Rnsr1 +; value = get("ws.rnsr").map("value").flatten().map("num_nat_struct") + +; path = tmp.Rnsr2 +; value = get("authors").flatMap("affiliations").flatMap("rnsr") [assign] -# Concatène les deux champs RNSR -path = ApilWsRnsr -value = get("tmp.Rnsr1").concat(_.get(self,"tmp.Rnsr2")).uniq() +; # Concatène les deux champs RNSR +; path = ApilWsRnsr +; value = get("tmp.Rnsr1").concat(_.get(self,"tmp.Rnsr2")).uniq() # Supprime les accents et met en majuscules path = tmp.ApilWsLaboIntitule