diff --git a/biblio-tools/v1/istex/works/expand.ini b/biblio-tools/v1/istex/works/expand.ini index 808fe5a..93d1231 100644 --- a/biblio-tools/v1/istex/works/expand.ini +++ b/biblio-tools/v1/istex/works/expand.ini @@ -18,82 +18,103 @@ post.parameters.0.name = indent post.parameters.0.schema.type = boolean - # Necessary plugins [use] plugin = basics -plugin = analytics -plugin = storage # Flow configuration [JSONParse] separator = * -[bufferize] - -[combine] -path = env('path', 'value') -primer = get('bufferID') -prepend = buffers -append = transit -cacheName = post-v1-crossref-works-expand - -[combine/exchange] -value = get('value') - -[combine/group] -size = 2 - -[combine/replace] +# Quelques paramètres modifiables si besoin +[env] path = size -value = fix(self.length) +value = 10 -path = q -value = self().map(doi => `"${doi}"`).join(' ').prepend('doi.raw:(').append(')') +path = indent +value = true -path = rankBy +# 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 = sid +path = output.0.sid value = bibilo-tools -path = total +path = output.0.total value = 0 -path = queryType +path = output.0queryType value = querywithARK -path = output +path = output.0.output value = * -[combine/URLStream] -url = https://api.istex.fr/document/ +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 -noerrors = true +retries = 3 +noerror = false -; Simplification de la structure à postriori (le faire à priori était également possible) -[combine/exchange] +[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 -[combine/OBJFlatten] +[map/replace] +path = __id +value = get('value') -[combine/replace] -path = id -value = get('doi.0') path = value -value = self().omit('refBibs') +value = get('value') -# On nettoie l'objet en supprimant les champs temporaires +# Croissements des resultats et des dois (avec le champ __id comme clé) [exchange] -value = self().omit('bufferID') +value = get('output').unionBy(self.input, '__id') -[assign] +# 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 = get('value.value', 'n/a') - - +value = fix('n/a') # On marque les réponses qui n'ont pas abouties [swing] test = has('value.doi')