# OpenAPI Documentation - JSON format (dot notation)
mimeType = application/json
post.operationId = post-v1-crossref-works-expand
post.description = Récupération des métadonnées associées à un DOI dans ISTEX
post.summary = Récupération à partir d'un tableau d'objets avec à minima un champ value contenant le DOI
post.tags.0 = biblio-tools
post.requestBody.content.application/json.example.0.id = 1
post.requestBody.content.application/json.example.0.value = 10.1093/ageing/afm016
post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream
post.requestBody.required = true
post.responses.default.content.application/json.example.0.id = 1
post.responses.default.content.application/json.example.0.value = { ... }
post.responses.default.content.application/json.schema.$ref = #/components/schemas/JSONStream
post.responses.default.description = Les prefixes DOI en version textuel
post.parameters.0.description = Indenter le JSON résultant
post.parameters.0.in = query
post.parameters.0.name = indent
post.parameters.0.schema.type = boolean
# Necessary plugins
[use]
plugin = basics
# Flow configuration
[JSONParse]
separator = *
# Quelques paramètres modifiables si besoin
[env]
path = size
value = 10
path = indent
value = true
# Début du traitement par lot
[group]
size = env('size')
# Création d'une requete ISTEX graphql avec une liste d'identifiants
[replace]
path = output.0.q
value = self().map('value').filter(Boolean).map(JSON.stringify).join(' ').thru(allIdentifiers => `doi.raw:(${allIdentifiers})`)
path = output.0.rankBy
value = qualityOverRelevance
path = output.0.sid
value = bibilo-tools
path = output.0.total
value = 0
path = output.0queryType
value = querywithARK
path = output.0.output
value = *
path = input
value = self()
[map]
path = output
# Envoi de la requete vers le mirroir
text = AV
[map/URLStream]
url = https://api.istex.fr/document/
json = true
path = .hits.*
timeout = 30000
retries = 3
noerror = false
[map/OBJFlatten]
# Création d'un objet similaire à l'objet reponse
[map/replace]
path = __id
value = get('doi.0')
path = value
value = self().omit(['refBibs', 'enrichments', 'metadata', 'fulltext', 'annexes', 'covers'])
# Reformatage des DOIS (input)
[map]
path = input
[map/replace]
path = __id
value = get('value')
path = value
value = get('value')
# Croissements des resultats et des dois (avec le champ __id comme clé)
[exchange]
value = get('output').unionBy(self.input, '__id')
# Fin du traitement par lot
[ungroup]
# Suppression des champs ajoutés
[exchange]
value = self().omit('__id')
# On marque les réponses qui n'ont pas abouti
[swing]
test = has('value.arkIstex')
reverse = true
[swing/assign]
path = value
value = fix('n/a')
# On marque les réponses qui n'ont pas abouties
[swing]
test = has('value.doi')
reverse = true
[swing/assign]
path = value
value = fix('n/a')
[dump]
indent = env('indent', false)