diff --git a/biblio-tools/v1/crossref/works/expand.ini b/biblio-tools/v1/crossref/works/expand.ini index 45fb5c9..ddccc40 100644 --- a/biblio-tools/v1/crossref/works/expand.ini +++ b/biblio-tools/v1/crossref/works/expand.ini @@ -49,7 +49,7 @@ path = rows value = fix(self.length) path = filter -value = self().map(x => 'doi:'.concat(x)).join(',') +value = self().filter(x => x.match(/^10.\d{4,9}\/[^\s]+$/i)).map(x => 'doi:'.concat(x)).join(',') # see https://github.com/CrossRef/rest-api-doc#api-overview [combine/URLStream] @@ -57,11 +57,37 @@ path = .items.* timeout = 30000 +; Simplification de la structure à postriori (le faire à priori était également possible) +[combine/exchange] +value = self().omit(['indexed', 'reference']) + + +[combine/OBJFlatten] + + [combine/replace] path = id value = get('DOI') path = value value = self() +# 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)