diff --git a/biblio-tools/examples.http b/biblio-tools/examples.http index 50636d6..685bf86 100644 --- a/biblio-tools/examples.http +++ b/biblio-tools/examples.http @@ -39,13 +39,13 @@ Content-Type: application/json [ - { "value": "10.1016/j.fuel.2018.07.071" }, - { "value": "10.1007/s10980-018-0699-8" }, - { "value": "10.1159/000490004" }, - { "value": "10.1016/j.memsci.2018.08.024"}, - { "value": "10.1029/2018jd029272"}, - { "value": "10.4000/edc.9014"}, - { "value": "unknown"} + { "id":1, "value": "10.1016/j.fuel.2018.07.071" }, + { "id":2, "value": "10.1007/s10980-018-0699-8" }, + { "id":3, "value": "10.1159/000490004" }, + { "id":4, "value": "10.1016/j.memsci.2018.08.024"}, + { "id":5, "value": "10.1029/2018jd029272"}, + { "id":6, "value": "10.4000/edc.9014"}, + { "id":7, "value": "unknown"} ] ### diff --git a/biblio-tools/v1/unpaywall/corhal.ini b/biblio-tools/v1/unpaywall/corhal.ini index 0bebe13..4a279d5 100644 --- a/biblio-tools/v1/unpaywall/corhal.ini +++ b/biblio-tools/v1/unpaywall/corhal.ini @@ -76,35 +76,17 @@ # Création d'un objet réponse [map/replace] -path = __id +path = id value = get('doi').toLower() - path = value value = self() -# Reformatage des DOIS (input) -[map] -path = input - -# Création d'un objet similaire à l'objet reponse -[map/replace] -path = __id -value = get('value') - -path = value -value = self() - -# Croissements des resultats et des dois (avec le champ __id comme clé) [exchange] -value = get('output').unionBy(self.input, '__id') +value = get('input').map((i) => ({ ...i, value:_.get(_.find(self.output, {id:i.value}), 'value') })) # 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.is_oa')