diff --git a/biblio-tools/examples.http b/biblio-tools/examples.http index 6aa0503..fcd0c14 100644 --- a/biblio-tools/examples.http +++ b/biblio-tools/examples.http @@ -226,3 +226,229 @@ ] ### + + +### +# @name v2UnpaywallIsOa +# unpaywall/is_oa +POST {{baseUrl}}/v2/unpaywall/is_oa?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "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"} +] + +### +# @name v2UnpaywallExpand +# unpaywall/expand +POST {{baseUrl}}/v2/unpaywall/expand?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "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"} +] + +### +# @name v2UnpaywallCorhal +# unpaywall/corhal +POST {{baseUrl}}/v2/unpaywall/corhal?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "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"} +] + +### +# @name v2UnpaywallWorksExpand +# unpaywall/works/expand +POST {{baseUrl}}/v2/unpaywall/works/expand?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "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"} +] + +### +# @name v2CrossrefPrefixesExpand +# crossref/prefixes/1 +POST {{baseUrl}}/v2/crossref/prefixes/expand?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "id":1, "value": "10.3998"}, + { "id":2, "value": "10.1016" }, + { "id":3, "value": "10.1007" }, + { "id":4, "value": "10.1159" }, + { "id":5, "value": "10.1037"}, + { "id":6, "value": "unknown"} +] + +### +# @name v2CrossrefWorksExpand2 +# crossref/works/2 +POST {{baseUrl}}/v2/crossref/works/expand?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "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"} +] + +### +# @name v2InspirehepWorksExpand +# inspirehep/works/expand +POST {{baseUrl}}/v2/inspirehep/works/expand?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "id":1, "value": "10.1103/PhysRevLett.19.1264"}, + { "id":2, "value": "10.1016/j.fuel.2018.07.071" }, + { "id":3, "value": "10.1007/s10980-018-0699-8" }, + { "id":4, "value": "10.1159/000490004" }, + { "id":5, "value": "10.1016/j.memsci.2018.08.024"}, + { "id":6, "value": "10.1029/2018jd029272"}, + { "id":7, "value": "10.4000/edc.9014"}, + { "id":8, "value": "unknown"} +] + +### +# @name v2OpenalexWorksExpand +# openalex/works/expand +POST {{baseUrl}}/v2/openalex/works/expand?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "id":1, "value": "10.1103/PhysRevLett.19.1264"}, + { "id":2, "value": "10.1016/j.fuel.2018.07.071" }, + { "id":3, "value": "10.1007/s10980-018-0699-8" }, + { "id":4, "value": "10.1159/000490004" }, + { "id":5, "value": "10.1016/j.memsci.2018.08.024"}, + { "id":6, "value": "10.1029/2018jd029272"}, + { "id":7, "value": "10.4000/edc.9014"}, + { "id":8, "value": "unknown"} +] + +### +# @name v2IstexWorksExpand +# istex/works/expand +POST {{baseUrl}}/v2/istex/works/expand?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "id":1, "value": "10.1016/S0047-6374(98)00099-2"}, + { "id":2, "value": "10.1016/S0167-4943(01)00186-8"}, + { "id":3, "value": "10.1093/ageing/afm016"}, + { "id":4, "value": ""} +] + +### +# @name v2WosFetch +# wos/fecth +POST {{baseUrl}}/v2/wos/fetch?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { + "query": "0", + "value": "XX" + }, + { + "query" :"I", + "value": { + "databaseId": "WOK", + "usrQuery": "TS=(cadmium)", + "count": "5", + "firstRecord": "1" + } + }, + { + "query" :"II", + "value": { + "databaseId": "WOK", + "usrQuery": "TS=(cadmium)", + "count": "5", + "firstRecord": "6" + } + } +] + +### +# @name v2WosWorksExpand +# wos/works/expand +POST {{baseUrl}}/v2/wos/works/expand?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "id":1, "value": "10.1016/S0047-6374(98)00099-2"}, + { "id":2, "value": "10.1016/S0167-4943(01)00186-8"}, + { "id":3, "value": "10.1093/ageing/afm016"}, + { "id":4, "value": ""} +] + +### +# @name v2HalWorksExpand +# hal/works/expand +POST {{baseUrl}}/v2/hal/works/expand?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "id":1, "value": "10.1016/S0047-6374(98)00099-2"}, + { "id":2, "value": "10.35562/arabesques.1222"}, + { "id":3, "value": "10.3324/haematol.2016.148908"}, + { "id":4, "value": ""} +] + +### +# @name v2ConditorWorksExpand +# conditor/works/expand +POST {{baseUrl}}/v2/conditor/works/expand?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "id":1, "value": "10.1016/S0047-6374(98)00099-2"}, + { "id":2, "value": "10.35562/arabesques.1222"}, + { "id":3, "value": "10.3324/haematol.2016.148908"}, + { "id":4, "value": ""} +] + +### +# @name v2ConditorWorksExpandByHalid +# conditor/works/expandByHalid +POST {{baseUrl}}/v2/conditor/works/expandByHalid?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "id":1, "value": "hal-03008165"}, + { "id":4, "value": ""} +] + +### diff --git a/biblio-tools/v2/conditor/works/expand.ini b/biblio-tools/v2/conditor/works/expand.ini new file mode 100644 index 0000000..9289717 --- /dev/null +++ b/biblio-tools/v2/conditor/works/expand.ini @@ -0,0 +1,91 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v2-conditor-works-expand +post.description = Récupération des métadonnées associées à un DOI dans Conditor +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.35562/arabesques.1222 +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 + +# Flow configuration +[JSONParse] +separator = * + +# Quelques paramètres modifiables si besoin +[env] +path = size +value = 10 + +path = indent +value = true + +# Début du traitement par lot +[group] +size = env('size') + +# Création d'une requete avec une liste d'identifiants +[replace] +path = output.0.q +value = self().map('value').filter(Boolean).map(JSON.stringify).join(' ').thru(allIdentifiers => `doi:(${allIdentifiers})`) + +path = output.0.size +value = env('size') + +path = output.0.envelope +value = false + +path = input +value = self() + +[map] +path = output + +# Envoi de la requete +[map/URLStream] +url = https://corhal-api.inist.fr/mergedDocuments +json = true +path = .* +timeout = 30000 +retries = 3 +noerror = false + +# Création d'un objet réponse +[map/replace] +path = id +value = get('doi').toLower() +path = value +value = self() + +# Croisements des resultats et des dois +[exchange] +value = get('input').map((i) => ({ ...i, value:_.get(_.find(self.output, {id:i.value}), 'value') })) + +# Fin du traitement par lot +[ungroup] + +# On marque les réponses qui n'ont pas abouti +[swing] +test = has('value.sourceUids') +reverse = true + +[swing/assign] +path = value +value = fix('n/a') + +[dump] +indent = env('indent', false) diff --git a/biblio-tools/v2/conditor/works/expandByHalid.ini b/biblio-tools/v2/conditor/works/expandByHalid.ini new file mode 100644 index 0000000..b0e6ecd --- /dev/null +++ b/biblio-tools/v2/conditor/works/expandByHalid.ini @@ -0,0 +1,95 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v1-conditor-works-expandByHalid +post.description = Récupération des métadonnées associées à un HALid dans Conditor +post.summary = Récupération à partir d'un tableau d'objets avec à minima un champ value contenant le HALid +post.tags.0 = biblio-tools +post.requestBody.content.application/json.example.0.id = 1 +post.requestBody.content.application/json.example.0.value = hal-03008165 +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 documents Conditor en version JSON flat +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 + +# Flow configuration +[JSONParse] +separator = * + +# Quelques paramètres modifiables si besoin +[env] +path = size +value = 10 + +path = indent +value = true + +# Début du traitement par lot +[group] +size = env('size') + +# Création d'une requete avec une liste d'identifiants +[replace] +path = output.0.q +value = self().map('value').filter(Boolean).map(JSON.stringify).join(' ').thru(allIdentifiers => `halId:(${allIdentifiers})`) + +path = output.0.size +value = env('size') + +path = output.0.envelope +value = false + +path = input +value = self() + +[map] +path = output + +[map/debug] +# Envoi de la requete +[map/URLStream] +url = https://corhal-api.inist.fr/mergedDocuments +json = true +path = .* +timeout = 30000 +retries = 3 +noerror = false + +[map/debug] +[map/OBJFlatten] + +# Création d'un objet réponse +[map/replace] +path = id +value = get('halId').toLower() +path = value +value = self() + +# Croisements des resultats et des dois +[exchange] +value = get('input').map((i) => ({ ...i, value:_.get(_.find(self.output, {id:i.value}), 'value') })) + +# Fin du traitement par lot +[ungroup] + +# On marque les réponses qui n'ont pas abouti +[swing] +test = has('value.sourceUids') +reverse = true + +[swing/assign] +path = value +value = fix('n/a') + +[dump] +indent = env('indent', false) diff --git a/biblio-tools/v2/crossref/prefixes/expand.ini b/biblio-tools/v2/crossref/prefixes/expand.ini new file mode 100644 index 0000000..e293be1 --- /dev/null +++ b/biblio-tools/v2/crossref/prefixes/expand.ini @@ -0,0 +1,75 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v1-crossref-prefixes-expand +post.description = Verbalisation du préfixe DOI à partir d'un DOI complet ou juste à partir du préfixe +post.summary = verbalisation à 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 = OpenEdition +post.responses.default.content.application/json.schema.$ref = #/components/schemas/JSONStream +post.responses.default.description = Les prefixes DOI en verion 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 + +# Flow configuration +[JSONParse] +separator = * + +[expand] +path = value +size = 1 +cacheName = post-v1-crossref-prefixes-expand + +[expand/assign] +path = value +value = get('value').split('/').filter(i => i.match(/^10./)).pop() + +# On crée une URL uniqument avec les prefixes non vides +[expand/swing] +test = get('value').isEmpty() +reverse = true + +[expand/swing/assign] +path = url +value = fix('https://api.crossref.org/prefixes', self.value).join('/') + +[expand/swing/URLFetch] +target = result +url = get('url') +json = true +timeout = 60000 +noerror = true +retries = 1 + +[expand/swing/replace] +path = id +value = get('id') + +path = value +value = get('result.message.name', 'n/a') + +[expand/transit] + +# On marque les prefixes vides (qui n'ont pas été traité par le swing précédent) +[expand/swing] +test = get('value').isEmpty() + +[expand/swing/assign] +path = value +value = fix('n/a') + +[dump] +indent = env('indent', false) diff --git a/biblio-tools/v2/crossref/works/expand.ini b/biblio-tools/v2/crossref/works/expand.ini new file mode 100644 index 0000000..acdf3ee --- /dev/null +++ b/biblio-tools/v2/crossref/works/expand.ini @@ -0,0 +1,97 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v2-crossref-works-expand +post.description = Récupération des métadonnées associées à un DOI +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 + +# Rétablissons la coloration syntaxique (une ou deux apostrophes selon les besoins): ' +value = fix('').join('') + +# Necessary plugins +[use] +plugin = basics + +# Flow configuration +[JSONParse] +separator = * + +# Quelques paramètres modifiables si besoin +[env] +path = size +value = 10 + +path = indent +value = true + +# Passage des doi en minuscule pour être compatible unpaywall +[assign] +path = value +value = get('value').toLower() + +# Début du traitement par lot +[group] +size = env('size') + +# Création d'une requete avec une liste d'identifiants +[replace] +path = output.0.rows +value = fix(self.length) + +path = output.0.filter +value = self().map('value').filter(Boolean).filter(x => x.match(/^10.\d{4,9}\/[^\s]+$/i)).map(x => 'doi:'.concat(x)).join(',') + +path = input +value = self() + +[map] +path = output + +# Envoi de la requete +[map/URLStream] +# see https://github.com/CrossRef/rest-api-doc#api-overview +url = https://api.crossref.org/works +path = .items.* +json = true +timeout = 30000 +retries = 3 +noerror = false + +# Création d'un objet réponse +[map/replace] +path = id +value = get('DOI').toLower() +path = value +value = self().omit(['indexed', 'reference']) + +# Croisements des resultats et des dois +[exchange] +value = get('input').map((i) => ({ ...i, value:_.get(_.find(self.output, {id:i.value}), 'value') })) + +# Fin du traitement par lot +[ungroup] + +# On marque les réponses qui n'ont pas abouti +[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/v2/hal/works/expand.ini b/biblio-tools/v2/hal/works/expand.ini new file mode 100644 index 0000000..f5e7742 --- /dev/null +++ b/biblio-tools/v2/hal/works/expand.ini @@ -0,0 +1,128 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v2-hal-works-expand +post.description = Récupération des métadonnées associées à un DOI dans HAL +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.35562/arabesques.1222 +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 + +# Flow configuration +[JSONParse] +separator = * + +# Quelques paramètres modifiables si besoin +[env] +path = size +value = 10 + +path = indent +value = true + +# Début du traitement par lot +[group] +size = env('size') + +# Création d'une requete avec une liste d'identifiants +#?q=doiId_s:(10.3324/haematol.2016.148908%20OR%2010.35562/arabesques.1222)&wt=json&fl=label_xml +[replace] +path = output.0.q +value = self().map('value').filter(Boolean).map(JSON.stringify).join(' OR ').thru(allIdentifiers => `doiId_s:(${allIdentifiers})`) + +path = output.0.wt +value = json + +path = output.0.fl +value = label_xml + +path = output.0.rows +value = env('size') + +path = input +value = self() + +[map] +path = output + +# Envoi de la requete +[map/URLStream] +url = https://api.archives-ouvertes.fr/search/ +json = true +path = response.docs.* +timeout = 30000 +retries = 3 +noerror = false + + +# Création d'un objet réponse +[map/exchange] +value = get('label_xml') + +[map/spawn] +[map/spawn/XMLParse] +separator = /TEI +[map/spawn/OBJFlatten] +[map/spawn/replace] +path = id1 +value = get('text/body/listBibl/biblFull/sourceDesc/biblStruct/idno').filter({type: 'doi'}).first().get('$t') + +path = id2 +value = get('text/body/listBibl/biblFull/sourceDesc/biblStruct/idno/$t') + +path = value +value = self() + +[map/spawn/replace] +path = id +value = fix(self.id1, self.id2).filter(Boolean).first() + +path = value +value = get('value') + +# Croisements des resultats et des dois +[exchange] +value = get('input').map((i) => ({ ...i, value:_.get(_.find(self.output, {id:i.value}), 'value') })) + +# Fin du traitement par lot +[ungroup] + +# On marque les réponses qui n'ont pas abouti +[swing] +test = has('value.xmlns$hal') +reverse = true + +[swing/assign] +path = value +value = fix('n/a') + +# Prevents keys from containing the $ character (which is forbidden by nodejs mongoDB driver) +[OBJFlatten] +separator = fix('/') +safe = false + +[exchange] +value = self().mapKeys((value, key) => key.replace(/\$/g, '_')) + +[OBJFlatten] +separator = fix('/') +reverse = true +safe = false +# ... + +[dump] +indent = env('indent', false) diff --git a/biblio-tools/v2/inspirehep/works/expand.ini b/biblio-tools/v2/inspirehep/works/expand.ini new file mode 100644 index 0000000..943195b --- /dev/null +++ b/biblio-tools/v2/inspirehep/works/expand.ini @@ -0,0 +1,66 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v2-inspirehep-works-expand +post.description = Récupération des métadonnées associées à un DOI dans inspireHEP +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.1103/PhysRevLett.19.1264 +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] +separator = * + +[expand] +path = value +cacheName = post-v1-inspirehep-works-expand + +[expand/URLFetch] +url = get('value').prepend('https://inspirehep.net/api/doi/') +json = true +target = fix('value') +timeout = 3000 +retries = 2 +noerror = true + +[expand/replace] +path = id +value = get('id') +path = value +value = self().omit('id') + +; 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.id').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.id').isEmpty() +[swing/assign] +path = value +value = fix('n/a') + +[dump] +indent = env('indent', false) diff --git a/biblio-tools/v2/istex/works/expand.ini b/biblio-tools/v2/istex/works/expand.ini new file mode 100644 index 0000000..c7ec53f --- /dev/null +++ b/biblio-tools/v2/istex/works/expand.ini @@ -0,0 +1,101 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v2-istex-works-expand +post.description = Récupération des métadonnées associées à un DOI dans ISTEX +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.1093/ageing/afm016 +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 + +# Flow configuration +[JSONParse] +separator = * + +# Quelques paramètres modifiables si besoin +[env] +path = size +value = 10 + +path = indent +value = true + +# Début du traitement par lot +[group] +size = env('size') + +# Création d'une requete 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 = output.0.sid +value = bibilo-tools + +path = output.0.total +value = 0 + +path = output.0queryType +value = querywithARK + +path = output.0.output +value = * + +path = input +value = self() + +[map] +path = output + +# Envoi de la requete +[map/URLStream] +url = https://api.istex.fr/document/ +json = true +path = .hits.* +timeout = 30000 +retries = 3 +noerror = false + + +# Création d'un objet réponse +[map/replace] +path = id +value = get('doi').toLower() +path = value +value = self() + +# Croisements des resultats et des dois +[exchange] +value = get('input').map((i) => ({ ...i, value:_.get(_.find(self.output, {id:i.value}), 'value') })) + +# Fin du traitement par lot +[ungroup] + +# On marque les réponses qui n'ont pas abouti +[swing] +test = has('value.arkIstex') +reverse = true + +[swing/assign] +path = value +value = fix('n/a') + +[dump] +indent = env('indent', false) diff --git a/biblio-tools/v2/openalex/works/expand.ini b/biblio-tools/v2/openalex/works/expand.ini new file mode 100644 index 0000000..a87c70b --- /dev/null +++ b/biblio-tools/v2/openalex/works/expand.ini @@ -0,0 +1,58 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v2-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] + +[expand] +path = value +cacheName = post-v2-openalex-works-expand + +[expand/URLFetch] +url = get('value').prepend('https://api.openalex.org/works/doi:') +json = true +target = fix('value') +timeout = 5000 +noerror = true + +[expand/replace] +path = id +value = get('id') +path = value +value = self().omit('id') + +# 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/v2/unpaywall/corhal.ini b/biblio-tools/v2/unpaywall/corhal.ini new file mode 100644 index 0000000..08f4379 --- /dev/null +++ b/biblio-tools/v2/unpaywall/corhal.ini @@ -0,0 +1,101 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v1-unpaywall-corhal +post.description = Récupération de certaines métadonnées associées à un DOI dans la base Unpaywall +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 + +# Rétablissons la coloration syntaxique (une ou deux apostrophes selon les besoins): ' +value = fix('').join('') + +# Necessary plugins +[use] +plugin = basics + +# Flow configuration +[JSONParse] +separator = * + +# Quelques paramètres modifiables si besoin +[env] +path = size +value = 10 + +path = indent +value = true + +path = token +value = env('UNPAYWALL_API_KEY') + +# Passage des doi en minuscule pour être compatible unpaywall +[assign] +path = value +value = get('value').toLower() + +# Début du traitement par lot +[group] +size = env('size') + +# Création d'une requete graphql avec une liste de DOI +[replace] +path = output.0.query +value = self().map('value').filter(Boolean).map(x => JSON.stringify(x)).join(',').thru(allIdentifiers => `{GetByDOI(dois:[${allIdentifiers}]){doi,is_oa,oa_status,has_repository_copy,oa_locations{host_type,is_best,license,url,url_for_landing_page,url_for_pdf,version}}}`) + +path = input +value = self() + +[map] +path = output + +# Envoi de la requete +[map/URLStream] +url = https://unpaywall.inist.fr/api/graphql +header = env('token').prepend('x-api-key:') +path = data.GetByDOI.* +timeout = 30000 +retries = 3 +noerror = false + +# Suppression des réponses qui n'ont pas abouties +[map/remove] +test = has('is_oa') +reverse = true + +# Création d'un objet réponse +[map/replace] +path = id +value = get('doi').toLower() +path = value +value = self() + +# Croisements des resultats et des dois +[exchange] +value = get('input').map((i) => ({ ...i, value:_.get(_.find(self.output, {id:i.value}), 'value') })) + +# Fin du traitement par lot +[ungroup] + +# On marque les réponses qui n'ont pas abouti +[swing] +test = has('value.is_oa') +reverse = true + +[swing/assign] +path = value +value = fix('n/a') + +[dump] +indent = env('indent', false) diff --git a/biblio-tools/v2/unpaywall/expand.ini b/biblio-tools/v2/unpaywall/expand.ini new file mode 100644 index 0000000..e2f404d --- /dev/null +++ b/biblio-tools/v2/unpaywall/expand.ini @@ -0,0 +1,114 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v1-unpaywall-expand +post.description = Récupération des informations OA associées à DOI dans la base Unpaywall +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 + +# Rétablissons la coloration syntaxique (une ou deux apostrophes selon les besoins): ' +value = fix('').join('') + +# Necessary plugins +[use] +plugin = basics + +# Flow configuration +[JSONParse] +separator = * + +# Quelques paramètres modifiables si besoin +[env] +path = size +value = 10 + +path = indent +value = true + +path = token +value = env('UNPAYWALL_API_KEY') + +# Passage des doi en minuscule pour être compatible unpaywall +[assign] +path = value +value = get('value').toLower() + +# Début du traitement par lot +[group] +size = env('size') + +# Création d'une requete graphql avec une liste de DOI +[replace] +path = output.0.query +value = self().map('value').map(x => JSON.stringify(x)).join(',').thru(allIdentifiers => `{GetByDOI(dois:[${allIdentifiers}]){doi,is_oa,oa_status,has_repository_copy,best_oa_location{host_type},oa_locations{host_type,is_best,license,url,url_for_landing_page,url_for_pdf,version}}}`) + +path = input +value = self() + +[map] +path = output + +# Envoi de la requete +[map/URLStream] +url = https://unpaywall.inist.fr/api/graphql +header = env('token').prepend('x-api-key:') +path = data.GetByDOI.* +timeout = 30000 +retries = 3 +noerror = false + +# Suppression des réponses qui n'ont pas abouties +[map/remove] +test = has('is_oa') +reverse = true + +# Création d'un objet réponse +[map/replace] +path = id +value = get('doi').toLower() +path = value +value = self().omit('best_oa_location', 'oa_locations') + +path = value.is_oa +value = get('is_oa') + +path = value.oa_status +value = get('oa_status') + +path = value.host_type +value = get('best_oa_location.host_type', 'n/a') + +path = value.has_repository_copy +value = get('has_repository_copy', 'n/a') + + +# Croisements des resultats et des dois +[exchange] +value = get('input').map((i) => ({ ...i, value:_.get(_.find(self.output, {id:i.value}), 'value') })) + +# Fin du traitement par lot +[ungroup] + +# On marque les réponses qui n'ont pas abouti +[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/v2/unpaywall/is_oa.ini b/biblio-tools/v2/unpaywall/is_oa.ini new file mode 100644 index 0000000..5c60d29 --- /dev/null +++ b/biblio-tools/v2/unpaywall/is_oa.ini @@ -0,0 +1,102 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v1-unpaywall-is_oa +post.description = Vérification si le document associé au DOI est en openaccess ou non selon la base Unpaywall +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 true ou false 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 + +# Rétablissons la coloration syntaxique (une ou deux apostrophes selon les besoins): ' +value = fix('').join('') + +# Necessary plugins +[use] +plugin = basics + +# Flow configuration +[JSONParse] +separator = * + +# Quelques paramètres modifiables si besoin +[env] +path = size +value = 10 + +path = indent +value = true + +path = token +value = env('UNPAYWALL_API_KEY') + +# Passage des doi en minuscule pour être compatible unpaywall +[assign] +path = value +value = get('value').toLower() + +# Début du traitement par lot +[group] +size = env('size') + +# Création d'une requete graphql avec une liste de DOI +[replace] +path = output.0.query +value = self().map('value').filter(Boolean).map(x => JSON.stringify(x)).join(',').thru(allIdentifiers => `{GetByDOI(dois:[${allIdentifiers}]){doi,is_oa}}`) + +path = input +value = self() + +[map] +path = output + +# Envoi de la requete +[map/URLStream] +url = https://unpaywall.inist.fr/api/graphql +header = env('token').prepend('x-api-key:') +path = data.GetByDOI.* +timeout = 30000 +retries = 3 +noerror = false + +# Suppression des réponses qui n'ont pas abouties +[map/remove] +test = has('is_oa') +reverse = true + +# Création d'un objet réponse +[map/replace] +path = id +value = get('doi').toLower() +path = value +value = get('is_oa') + + +# Croisements des resultats et des dois +[exchange] +value = get('input').map((i) => ({ ...i, value:_.get(_.find(self.output, {id:i.value}), 'value') })) + +# Fin du traitement par lot +[ungroup] + +# On marque les réponses qui n'ont pas abouti +[swing] +test = get('value').isBoolean() +reverse = true + +[swing/assign] +path = value +value = fix('n/a') + +[dump] +indent = env('indent', false) diff --git a/biblio-tools/v2/unpaywall/works/expand.ini b/biblio-tools/v2/unpaywall/works/expand.ini new file mode 100644 index 0000000..fc76f7e --- /dev/null +++ b/biblio-tools/v2/unpaywall/works/expand.ini @@ -0,0 +1,101 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v2-unpaywall-works-expand +post.description = Récupération des informations associées à un DOI dans la base Unpaywall +post.summary = Récupération à partir d'un tableau d'objets avec a 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 + +# Rétablissons la coloration syntaxique (une ou deux apostrophes selon les besoins): ' +value = fix('').join('') + +# Necessary plugins +[use] +plugin = basics + +# Flow configuration +[JSONParse] +separator = * + +# Quelques paramètres modifiables si besoin +[env] +path = size +value = 10 + +path = indent +value = true + +path = token +value = env('UNPAYWALL_API_KEY') + +# Passage des doi en minuscule pour être compatible unpaywall +[assign] +path = value +value = get('value').toLower() + +# Début du traitement par lot +[group] +size = env('size') + +# Création d'une requete graphql avec une liste de DOI +[replace] +path = output.0.query +value = self().map('value').filter(Boolean).map(x => JSON.stringify(x)).join(',').thru(allIdentifiers => `{GetByDOI(dois:[${allIdentifiers}]){doi,data_standard,genre,is_paratext,is_oa,journal_is_in_doaj,journal_is_oa,journal_issns,journal_issn_l,journal_name,oa_status,has_repository_copy,published_date,publisher,title,updated,year,oa_locations{host_type,is_best,license,url,url_for_landing_page,url_for_pdf},first_oa_location{host_type,is_best,license,pmh_id,updated,url,url_for_landing_page,url_for_pdf,version}}}`) + +path = input +value = self() + +[map] +path = output + +# Envoi de la requete +[map/URLStream] +url = https://unpaywall.inist.fr/api/graphql +header = env('token').prepend('x-api-key:') +path = data.GetByDOI.* +timeout = 30000 +retries = 3 +noerror = false + +# Suppression des réponses qui n'ont pas abouties +[map/remove] +test = has('is_oa') +reverse = true + +# Création d'un objet réponse +[map/replace] +path = id +value = get('doi').toLower() +path = value +value = self() + +# Croisements des resultats et des dois +[exchange] +value = get('input').map((i) => ({ ...i, value:_.get(_.find(self.output, {id:i.value}), 'value') })) + +# Fin du traitement par lot +[ungroup] + +# On marque les réponses qui n'ont pas abouti +[swing] +test = has('value.is_oa') +reverse = true + +[swing/assign] +path = value +value = fix('n/a') + +[dump] +indent = env('indent', false) diff --git a/biblio-tools/v2/wos/fetch.ini b/biblio-tools/v2/wos/fetch.ini new file mode 100644 index 0000000..d13c1a2 --- /dev/null +++ b/biblio-tools/v2/wos/fetch.ini @@ -0,0 +1,78 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v1-wos-fetch +post.description = Recherche et récuperation dans le Web of science +post.summary = Récupération de notices WOS à partir d'un tableau de requetes +post.tags.0 = biblio-tools +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.requestBody.content.application/json.example.0.value.databaseId = WOK +post.requestBody.content.application/json.example.0.value.usrQuery = TS=(cadmium) +post.requestBody.content.application/json.example.0.value.count = 5 +post.requestBody.content.application/json.example.0.value.firstRecord = 1 +post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream +post.requestBody.required = true +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 + +# Flow configuration +[JSONParse] +separator = * + +[env] +path = indent +value = true + +path = token +value = env('WOS_API_KEY') + +[expand] +path = value +size = 1 +cacheName = post-v1-wos-fetch + +[expand/URLFetch] +path = value +target = value +url = https://wos-api.clarivate.com/api/wos/ +json = true +timeout = 60000 +noerror = true +header = accept: application/json +header = env('token').prepend('X-ApiKey:') +header = Content-Type: application/json + +[expand/replace] +path = id +value = get('id') +path = value +value = get('value.Data.Records.records.REC', 'n/a') + +[replace] +path = id +value = self().omit('value') +path = value +value = get('value', 'n/a') + +[exploding] +id = id +value = value + +[assign] +path = id.value +value = get('value') + +[exchange] +value = get('id') + +[dump] +indent = env('indent', false) diff --git a/biblio-tools/v2/wos/works/expand.ini b/biblio-tools/v2/wos/works/expand.ini new file mode 100644 index 0000000..b3b0a77 --- /dev/null +++ b/biblio-tools/v2/wos/works/expand.ini @@ -0,0 +1,110 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v2-wos-works-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 + +# Rétablissons la coloration syntaxique (une ou deux apostrophes selon les besoins): ' +value = fix('').join('') + +# Necessary plugins +[use] +plugin = basics + +# Flow configuration +[JSONParse] +separator = * + +# Quelques paramètres modifiables si besoin +[env] +path = size +value = 10 + +path = indent +value = true + +path = token +value = env('WOS_API_KEY') + +# Passage des doi en minuscule pour être compatible unpaywall +[assign] +path = value +value = get('value').toLower() + +# Début du traitement par lot +[group] +size = env('size') + +# Création d'une requete avec une liste d'identifiants +[replace] +path = output.0.usrQuery +value = self().map('value').filter(Boolean).map(x => JSON.stringify(x)).join(' OR ').thru(allIdentifiers => `DO=(${allIdentifiers})`) + +path = output.0.databaseId +value = WOK + +path = output.0.count +value = env('size') + +path = output.0.firstRecord +value = 1 + +path = input +value = self() + +[map] +path = output + +# Envoi de la requete +[map/URLStream] +url = https://wos-api.clarivate.com/api/wos/ +header = env('token').prepend('X-ApiKey:') +path = Data.Records.records.REC.* +json = true +timeout = 30000 +retries = 3 +noerror = false + +# Suppression des réponses qui n'ont pas abouties +[map/remove] +test = get('UID').isEmpty() + +# Création d'un objet réponse +[map/replace] +path = id +value = get('dynamic_data/cluster_related/identifiers/identifier').find(item => (['xref_doi', 'doi'].indexOf(item.type) >= 0)).get('value').toLower() +path = value +value = self() + +# Croisements des resultats et des dois +[exchange] +value = get('input').map((i) => ({ ...i, value:_.get(_.find(self.output, {id:i.value}), 'value') })) + +# Fin du traitement par lot +[ungroup] + +# On marque les réponses qui n'ont pas abouti +[swing] +test = get('value.UID').isEmpty() + +[swing/assign] +path = value +value = fix('n/a') + +[dump] +indent = env('indent', false) +