append = pack [use] # URLConnect plugin = basics [unpack] # Prépare la structure à envoyer au web service v1/rnsr/info [assign] path = ws.rnsr value = get("authors") \ .flatMap("affiliations") \ .map("address").uniq() \ .map((address, id) => ({ \ id, \ value: { \ year: _.get(self,"ApilPublicationDate"), \ address \ } \ })) [map] path = ws.rnsr [map/expand] path = value size = 100 [map/expand/URLConnect] url = https://affiliations-tools.services.inist.fr/v1/rnsr/info timeout = 1000 noerror = true # Récupère les informations [assign] path = ApilIsCnrs value = get("ws.rnsr").map("value").flatten() \ .map("etabAssoc").flatten() \ .map("etab.sigle") \ .filter(sigle => sigle === "CNRS") \ .thru(arr => Boolean(arr.length)) path = ApilLaboSigle value = get("ws.rnsr").map("value").flatten().map("sigle") path = ApilLaboIntitule value = get("ws.rnsr").map("value").flatten().map("intitule") path = ApilRnsr value = get("ws.rnsr").map("value").flatten().map("num_nat_struct") [assign] path = ApilSigleLaboIntitule value = get("ApilLaboSigle") \ .map((sigle,i) => [ \ sigle, \ _.get(self,"ApilLaboIntitule")[i] \ ].join(" - ")) # Récupère les instituts du CNRS à partir des RNSR [assign] path = ApilInstitutCnrs value = get("ApilRnsr").map((value, id) => ({id, value})) [map] path = ApilInstitutCnrs [map/expand] path = value size = 100 [map/expand/URLConnect] url = https://mapping-tools.services.inist.fr/v1/rnsr/instituts-cnrs/json timeout = 1000 error = true [assign] path = ApilInstitutCnrs value = get("ApilInstitutCnrs").map("value") # Suppression des champs non voulus [exchange] value = omit(['business','origins','technical','ws'])