Newer
Older
web-dumps / doiwos-dumps / 05-enrich-institutes.ini
# Usage: npx ezs enrich-institutes.ini < data/corpus-simple-etab.json > data/corpus-simple-instituts.json

# To see the enriched notices:
# $ fx < data/corpus-simple-instituts.json '.filter(o => o.ws.rnsr[0]?.length)'


[use]
# JSONParse URLConnect
plugin = basics
# expand aggregate exploding
plugin = analytics

[JSONParse]

# - Instituts du CNRS

[assign]
path = ws.rnsr_id
value = get("ws.rnsr").map(structs => Array.isArray(structs) ? structs.map(struct => struct.num_nat_struct) : "n/a").filter((id) => id !== "n/a").flatten().uniq()

[assign]
path = ws.instituts
value = get("ws.rnsr_id")

[expand]
path = ws.instituts
size = 1

[expand/exploding]

[expand/expand]
path = value
size = 100

[expand/expand/URLConnect]
url = https://mapping-tools.services.inist.fr/v1/rnsr/instituts-cnrs/json
retries = 3
timeout = 6000000
noerror = true

[expand/aggregate]

[assign]
path = ws.instituts
value = get('ws.instituts').uniq()

[dump]
indent = true