# Usage: npx ezs -e enrich-rnsr.ini # To see the enriched notices: # $ fx < data/corpus-simple-rnsr-50.json '.filter(o => o.ws.rnsr[0]?.length)' [use] # JSONParse URLConnect FILELoad FILESave plugin = basics # expand plugin = analytics [exchange] value = [ "corpus-simple-50.json" ] [JSONParse] [FILELoad] location = data [JSONParse] #1 - Informations RNSR [assign] path = ws.rnsr value = get('affiliations').map(address => ({ year: _.get(self, 'publication_year'), address})) [expand] path = ws.rnsr size = 1 #cacheName = affiliations-tools-v1-rnsr-info [expand/exploding] [expand/expand] path = value size = 100 [expand/expand/URLConnect] url = https://affiliations-tools.services.inist.fr/v1/rnsr/info retries = 3 timeout = 3000 noerror = true [expand/aggregate] ; # Concaténation des sigles et libellés des établissements associés ; [assign] ; path = etab ; value = get('ws.rnsr', []).map(structs => structs.map(struct => `${struct.sigle}; ${struct.intitule}`)) [dump] indent = true [FILESave] location = data identifier = corpus-simple-rnsr-50.json [dump] indent = true