Newer
Older
web-services / biblio-tools / v1 / istex / works / expand.ini
@Nicolas Thouvenin Nicolas Thouvenin on 7 Feb 2022 2 KB add istex, mv upw entrypoint
# 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
plugin = analytics
plugin = storage

# Flow configuration
[JSONParse]
legacy = false
separator = $

[bufferize]

[combine]
path = env('path', 'value')
primer = get('bufferID')
prepend = buffers
append = transit
persistent = true

[combine/exchange]
value = get('value')

[combine/group]
size = 2

[combine/replace]
path = size
value = fix(self.length)

path = q
value = self().map(doi => `"${doi}"`).join(' ').prepend('doi.raw:(').append(')')

path = rankBy
value = qualityOverRelevance

path = sid
value = bibilo-tools

path = total
value = 0

path = queryType
value = querywithARK

path = output
value = *

[combine/URLStream]
url  = https://api.istex.fr/document/
path = .hits.*
timeout = 30000
noerrors = true

; Simplification de la structure à postriori (le faire à priori était également possible)
[combine/exchange]
value = self().omit(['refBibs', 'enrichments', 'metadata', 'fulltext', 'annexes', 'covers'])


[combine/OBJFlatten]

[combine/replace]
path = id
value = get('doi.0')
path = value
value = self().omit('refBibs')

# On nettoie l'objet en supprimant les champs temporaires
[exchange]
value = self().omit('bufferID')

[assign]
path = value
value = get('value.value', '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)