Newer
Older
web-dumps / conditor-dumps / 04-enrich.ini
append = dump?indent=true

[use]
# JSONParse URLConnect
plugin = basics

[JSONParse]

# 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 = IsCnrs
value = get("ws.rnsr").map("value").flatten() \
        .map("etabAssoc").flatten() \
        .map("etab.sigle") \
        .filter(sigle => sigle === "CNRS") \
        .thru(arr => Boolean(arr.length))

path = LaboSigle
value = get("ws.rnsr").map("value").flatten().map("sigle")

path = LaboIntitule
value = get("ws.rnsr").map("value").flatten().map("intitule")

path = Rnsr
value = get("ws.rnsr").map("value").flatten().map("num_nat_struct")

# Récupère les instituts du CNRS à partir des RNSR

[assign]
path = InstitutCnrs
value = get("Rnsr").map((value, id) => ({id, value}))

[map]
path = InstitutCnrs

[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 = InstitutCnrs
value = get("InstitutCnrs").map("value")

[exchange]
value = omit("ws")