diff --git a/biblio-tools/examples.http b/biblio-tools/examples.http index 3d67f28..f25a107 100644 --- a/biblio-tools/examples.http +++ b/biblio-tools/examples.http @@ -6,7 +6,8 @@ { "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.1016/j.memsci.2018.08.024"}, + { "value": "unknown"} ] ### @@ -21,7 +22,8 @@ { "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.1029/2018jd029272"}, + { "value": "unknown"} ] ### @@ -35,7 +37,8 @@ { "value": "10.1159/000490004" }, { "value": "10.1016/j.memsci.2018.08.024"}, { "value": "10.1029/2018jd029272"}, - { "value": "10.4000/edc.9014"} + { "value": "10.4000/edc.9014"}, + { "value": "unknown"} ] ### @@ -48,7 +51,8 @@ { "value": "10.1016" }, { "value": "10.1007" }, { "value": "10.1159" }, - { "value": "10.1037"} + { "value": "10.1037"}, + { "value": "unknown"} ] ### @@ -64,6 +68,39 @@ { "value": "10.1159/000490004" }, { "value": "10.1016/j.memsci.2018.08.024"}, { "value": "10.1029/2018jd029272"}, - { "value": "10.4000/edc.9014"} + { "value": "10.4000/edc.9014"}, + { "value": "unknown"} +] +### + +# inspirehep/works/expand +POST https://biblio-tools.services.inist.fr/v1/inspirehep/works/expand?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "value": "10.1103/PhysRevLett.19.1264"}, + { "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"} +] +### + +# openalex/works/expand +POST https://biblio-tools.services.inist.fr/v1/openalex/works/expand?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "value": "10.1103/PhysRevLett.19.1264"}, + { "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"} ] ### diff --git a/biblio-tools/v1/crossref/prefixes/expand.ini b/biblio-tools/v1/crossref/prefixes/expand.ini index f697aea..66586cc 100644 --- a/biblio-tools/v1/crossref/prefixes/expand.ini +++ b/biblio-tools/v1/crossref/prefixes/expand.ini @@ -32,7 +32,7 @@ [expand] path = value size = 1 -cacheName = prefixes +cacheName = crossref-prefixes [expand/assign] path = value diff --git a/biblio-tools/v1/crossref/works/expand.ini b/biblio-tools/v1/crossref/works/expand.ini index 267ac17..45fb5c9 100644 --- a/biblio-tools/v1/crossref/works/expand.ini +++ b/biblio-tools/v1/crossref/works/expand.ini @@ -27,7 +27,6 @@ # Flow configuration [JSONParse] -[JSONParse] legacy = false separator = $ diff --git a/biblio-tools/v1/inspirehep/works/expand.ini b/biblio-tools/v1/inspirehep/works/expand.ini new file mode 100644 index 0000000..02ca9d6 --- /dev/null +++ b/biblio-tools/v1/inspirehep/works/expand.ini @@ -0,0 +1,84 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v1-openalex-works-expand +post.description = Récupération des métadonnées associées à un DOI dans openAlex +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 = 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 = $ + +[expand] +path = value +cacheName = inspirehep-works + +[expand/URLFetch] +url = get('value').prepend('https://inspirehep.net/api/doi/') +json = true +target = fix('value') +timeout = 5000 +noerror = true + +; Suppression de certains champs +[expand/exchange] +value = omit(['value.metadata.references']) + +; Simplification de la structure de la notice +[expand/OBJFlatten] + + +[expand/replace] +path = id +value = get('id') +path = value +value = self().omit('id').mapKeys((val, key) => key.replace('value/', '')) + +; Simplification de la structure du champs authorships +[expand/expand] +path = value.metadata/authors + +[expand/expand/exploding] + +[expand/expand/OBJFlatten] + +[expand/expand/replace] +path = id +value = get('id') +path = value +value = self().omit('id').mapKeys((val, key) => key.replace('value/', '')) + +[expand/expand/aggregate] + +# On marque les réponses qui n'ont pas abouties +[swing] +test = has('value.id') +reverse = true + +[swing/assign] +path = value +value = fix('n/a') + +[dump] +indent = env('indent', false) diff --git a/biblio-tools/v1/openalex/works/expand.ini b/biblio-tools/v1/openalex/works/expand.ini new file mode 100644 index 0000000..a787749 --- /dev/null +++ b/biblio-tools/v1/openalex/works/expand.ini @@ -0,0 +1,84 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v1-openalex-works-expand +post.description = Récupération des métadonnées associées à un DOI dans openAlex +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 = 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 = $ + +[expand] +path = value +cacheName = openalex-works + +[expand/URLFetch] +url = get('value').prepend('https://api.openalex.org/works/doi:') +json = true +target = fix('value') +timeout = 5000 +noerror = true + +; Suppression de certains champs +[expand/exchange] +value = omit(['value.referenced_works', 'value.related_works', 'value.abstract_inverted_index']) + +; Simplification de la structure de la notice +[expand/OBJFlatten] + +[expand/replace] +path = id +value = get('id') +path = value +value = self().omit('id').mapKeys((val, key) => key.replace('value/', '')) + +; Simplification de la structure du champs authorships +[expand/expand] +path = value.authorships + +[expand/expand/exploding] + +[expand/expand/OBJFlatten] + +[expand/expand/replace] +path = id +value = get('id') +path = value +value = self().omit('id').mapKeys((val, key) => key.replace('value/', '')) + +[expand/expand/aggregate] + + +# 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) diff --git a/biblio-tools/v1/unpaywall/corhal.ini b/biblio-tools/v1/unpaywall/corhal.ini index b8d52aa..1f59d41 100644 --- a/biblio-tools/v1/unpaywall/corhal.ini +++ b/biblio-tools/v1/unpaywall/corhal.ini @@ -81,9 +81,6 @@ [spawn/combine/drop] path = is_oa -[spawn/combine/debug] -text = graphql.output - # On créé l'object attendu par combine { id, value } pour faire le mapping [spawn/combine/replace] path = id @@ -111,5 +108,14 @@ path = value value = get('value.value', self.value) +# On marque les réponses qui n'ont pas abouties +[swing] +test = has('value.is_oa') +reverse = true + +[swing/assign] +path = value +value = fix('n/a') + [dump] indent = env('indent') diff --git a/biblio-tools/v1/unpaywall/expand.ini b/biblio-tools/v1/unpaywall/expand.ini index 03460c1..66efff0 100644 --- a/biblio-tools/v1/unpaywall/expand.ini +++ b/biblio-tools/v1/unpaywall/expand.ini @@ -107,5 +107,14 @@ path = value value = get('value.value', self.value) +# On marque les réponses qui n'ont pas abouties +[swing] +test = has('value.is_oa') +reverse = true + +[swing/assign] +path = value +value = fix('n/a') + [dump] indent = env('indent')