Newer
Older
web-dumps / conditor-dumps / 03-create-fields.ini
# npx ezs 03-create-fields.ini
append = pack

[unpack]

[assign]
# Récupère electronicPublicationDate et publicationDate
# Prend la plus ancienne (= la plus petite)
# Ne garde que l'année
path = ApilPublicationDate
value = get("host.electronicPublicationDate", "9999") \
        .castArray() \
        .concat(_.get(self, "host.publicationDate", "9999")) \
        .min().toString() \
        .thru(str => str.substring(0,4))

[assign]
path = ApilFinancement
value = get('funders').castArray().filter(Boolean).thru(arr => Boolean(arr.length))

# Quand les RNSR ne sont pas fournis dans authors.*.affiliations.*.rnsr
# on utilise les enrichissements et on les met au même niveau dans ApilRnsr
[map]
path = authors

[map/map]
path = affiliations

[map/map/assign]
path = ApilRnsr
value = get("rnsr")

[map/map/swing]
test = get("ApilRnsr").isEmpty()

[map/map/swing/assign]
path = ApilRnsr
value = get("enrichments.rnsr", []) \
        .filter(rnsr => !["200612821P", "200018571R", "199812965F", "201523784S"].includes(rnsr))

# Supprime les champs inutiles pour les études bibliométriques
[exchange]
value = omit(['business','origins','technical'])