Newer
Older
web-services / affiliations-tools / v1 / expand.ini
@Nicolas Thouvenin Nicolas Thouvenin on 17 Sep 2021 1 KB use only loterre resource
# OpenAPI Documentation - JSON format (dot notation)
post.responses.default.description = Return all objects with enrich fields
post.responses.default.content.application/json.schema.$ref =  #/components/schemas/JSONStream
post.summary = Structure one field of each Object as raw affiliation
post.requestBody.required = true
post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream
post.parameters.0.in = query
post.parameters.0.name = indent
post.parameters.0.schema.type = boolean
post.parameters.0.description = Indent or not the JSON Result

# Necessary plugins
[use]
plugin = basics
plugin = analytics

# Flow configuration
[JSONParse]
separator = *

# ---------  Découpage du champ  avec libpostal (decoupage en champs)
[expand]
path = value
size = 10
cacheName = libpostal
[expand/URLConnect]
url = https://affiliations-libpostal.services.inist.fr/v1/parse
timeout = 5000

# ---------  Enrichissement du resultat libpostal
[expand]
path = value
# size = 1 est obligatoire pour traiter séparement chaque élement du tableau
size = 1

[expand/assign]
path = value.value.id
value = get('value.id')

[expand/assign]
path = value
value = get('value.value')

[expand/assign]
path = value.country
value = get('value.country').replace(/\W/g, ' ').trim()

# --------- Enrichissement du champ country avec le vocabulaire 9SD de Loterre
[expand/expand]
path = value.country
size = 10
cacheName = loterre

[expand/expand/URLConnect]
url = https://loterre-resolvers.services.inist.fr/v1/9SD/identify
timeout = 5000

[dump]
indent = env('indent', false)