# OpenAPI Documentation - JSON format (dot notation) mimeType = application/json post.operationId = post-v1-wos-expand post.description = Récupération des informations associées à DOI dans la base Web of Science 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.4000/edc.9014 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 = une réponse sous forme d'un objet ou n/a pour chaque DOI 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 = @ezs/basics plugin = @ezs/analytics plugin = @ezs/storage # Flow configuration [JSONParse] separator = * [env] path = size value = 10 path = indent value = true path = token value = env('WOS_API_KEY') [assign] path = value value = get('value').toLower() [expand] path = value size = env('size') cacheName = post-v1-wos-expand [expand/bufferize] # On réalise un mapping dynamique sur le champ value (et on sauvegarde les correspondances trouvées) [expand/combine] path = value default = n/a primer = get('bufferID') prepend = buffers append = transit [expand/combine/group] size = env('size') [expand/combine/replace] path = dois value = self().map('value').filter(Boolean).map(x => JSON.stringify(x)).join(' OR ') # On crée un objet contenant tous les valeurs nécessaire pour créer une requete [expand/combine/replace] path = usrQuery value = fix('DO=(', self.dois ,')').join('') path = databaseId value = WOK path = count value = env('size') path = firstRecord value = 1 [expand/combine/URLStream] url = https://wos-api.clarivate.com/api/wos/ header = env('token').prepend('X-ApiKey:') path = Data.Records.records.REC.* timeout = 5000 noerror = true [expand/combine/OBJFlatten] [expand/combine/replace] path = id value = get('dynamic_data/cluster_related/identifiers/identifier').find({ type: 'xref_doi'}).get('value').toLower() path = value value = self() # On supprime de la table de mapping, les réponses qui n'ont pas abouties [expand/combine/remove] test = get('id').isEmpty() # On nettoie l'objet en supprimant les champs temporaires [expand/exchange] value = self().omit('bufferID') [expand/assign] path = value value = get('value.value') ; On supprime uniqument le résulat des documents non trouvés pour ; pour les conserver sans les mettre dans le cache [expand/swing] test = get('value.UID').isEmpty() [expand/swing/exchange] value = self().omit('value') ; Pour les documents sans résulat ; On donne une valeur par défaut [swing] test = get('value.UID').isEmpty() [swing/assign] path = value value = fix('n/a') [dump] indent = env('indent')