diff --git a/biblio-tools/v1/conditor/works/expand.ini b/biblio-tools/v1/conditor/works/expand.ini deleted file mode 100644 index 74f9315..0000000 --- a/biblio-tools/v1/conditor/works/expand.ini +++ /dev/null @@ -1,93 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v1-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 = 5 -noerror = false - -[map/OBJFlatten] - -# 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/v1/conditor/works/expandByHalid.ini b/biblio-tools/v1/conditor/works/expandByHalid.ini deleted file mode 100644 index b0e6ecd..0000000 --- a/biblio-tools/v1/conditor/works/expandByHalid.ini +++ /dev/null @@ -1,95 +0,0 @@ -# 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/v1/crossref/prefixes/expand.ini b/biblio-tools/v1/crossref/prefixes/expand.ini deleted file mode 100644 index 28d5f17..0000000 --- a/biblio-tools/v1/crossref/prefixes/expand.ini +++ /dev/null @@ -1,76 +0,0 @@ -# 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 = 30000 -retries = 5 -; évite l'arret du traitement, en cas d'erreur, on retourne la valeur non traitée -noerror = true - -[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/v1/crossref/works/expand.ini b/biblio-tools/v1/crossref/works/expand.ini deleted file mode 100644 index 87d2249..0000000 --- a/biblio-tools/v1/crossref/works/expand.ini +++ /dev/null @@ -1,99 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v1-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 = 5 -noerror = false - -[map/OBJFlatten] - -# 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/v1/datacite/works/expand.ini b/biblio-tools/v1/datacite/works/expand.ini deleted file mode 100644 index 4d64ce7..0000000 --- a/biblio-tools/v1/datacite/works/expand.ini +++ /dev/null @@ -1,61 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v1-datacite-works-expand -post.description = Récupération des métadonnées associées à un DOI dans Datacite -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-v1-datacite-works-expand - -[expand/URLFetch] - -url = get('value').prepend('https://api.datacite.org/dois/') -json = true -target = fix('value') -timeout = 30000 -retries = 5 -; évite l'arret du traitement, en cas d'erreur, on retourne la valeur non traitée -noerror = true - -; Prendre uniquement data -[expand/replace] -path = id -value = get('id') -path = value -value = get('value.data') - -# 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/hal/works/expand.ini b/biblio-tools/v1/hal/works/expand.ini deleted file mode 100644 index 128e0a0..0000000 --- a/biblio-tools/v1/hal/works/expand.ini +++ /dev/null @@ -1,128 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v1-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 = 5 -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/v1/inspirehep/works/expand.ini b/biblio-tools/v1/inspirehep/works/expand.ini deleted file mode 100644 index f427254..0000000 --- a/biblio-tools/v1/inspirehep/works/expand.ini +++ /dev/null @@ -1,89 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v1-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 = 30000 -retries = 5 -; évite l'arret du traitement, en cas d'erreur, on retourne la valeur non traitée -noerror = true - -; Simplification de la structure de la notice -[expand/exchange] -value = omit(['value.metadata.references']) - -[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 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/v1/istex/works/expand.ini b/biblio-tools/v1/istex/works/expand.ini deleted file mode 100644 index bbe1710..0000000 --- a/biblio-tools/v1/istex/works/expand.ini +++ /dev/null @@ -1,102 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v1-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 = 5 -noerror = false - -[map/OBJFlatten] - -# Création d'un objet réponse -[map/replace] -path = id -value = get('doi').toLower() -path = value -value = self().omit(['refBibs', 'enrichments', 'metadata', 'fulltext', 'annexes', 'covers']) - -# 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/v1/openalex/works/expand.ini b/biblio-tools/v1/openalex/works/expand.ini deleted file mode 100644 index f776d07..0000000 --- a/biblio-tools/v1/openalex/works/expand.ini +++ /dev/null @@ -1,84 +0,0 @@ -# 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] - -[expand] -path = value -cacheName = post-v1-openalex-works-expand - -[expand/URLFetch] -url = get('value').prepend('https://api.openalex.org/works/doi:').append(`?api_key=${env('OPENALEX_API_KEY')}`) -json = true -target = fix('value') -timeout = 30000 -retries = 5 -; évite l'arret du traitement, en cas d'erreur, on retourne la valeur non traitée -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/rdg/works/expand.ini b/biblio-tools/v1/rdg/works/expand.ini deleted file mode 100644 index 24fbbed..0000000 --- a/biblio-tools/v1/rdg/works/expand.ini +++ /dev/null @@ -1,61 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v1-rdg-works-expand -post.description = Récupération des métadonnées associées à un DOI dans Recherche Data Gouv -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-v1-rdg-works-expand - -[expand/URLFetch] - -url = get('value').prepend('https://entrepot.recherche.data.gouv.fr/api/datasets/:persistentId?persistentId=doi:') -json = true -target = fix('value') -timeout = 30000 -retries = 5 -; évite l'arret du traitement, en cas d'erreur, on retourne la valeur non traitée -noerror = true - -; Prendre uniquement data -[expand/replace] -path = id -value = get('id') -path = value -value = get('value.data') - -# On marque les réponses qui n'ont pas abouties -[swing] -test = has('value.latestVersion.datasetPersistentId') -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 deleted file mode 100644 index 08f4379..0000000 --- a/biblio-tools/v1/unpaywall/corhal.ini +++ /dev/null @@ -1,101 +0,0 @@ -# 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/v1/unpaywall/expand.ini b/biblio-tools/v1/unpaywall/expand.ini deleted file mode 100644 index 52db65f..0000000 --- a/biblio-tools/v1/unpaywall/expand.ini +++ /dev/null @@ -1,114 +0,0 @@ -# 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 = 5 -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/v1/unpaywall/is_oa.ini b/biblio-tools/v1/unpaywall/is_oa.ini deleted file mode 100644 index 5c60d29..0000000 --- a/biblio-tools/v1/unpaywall/is_oa.ini +++ /dev/null @@ -1,102 +0,0 @@ -# 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/v1/unpaywall/works/expand.ini b/biblio-tools/v1/unpaywall/works/expand.ini deleted file mode 100644 index 0aca497..0000000 --- a/biblio-tools/v1/unpaywall/works/expand.ini +++ /dev/null @@ -1,101 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v1-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 = 5 -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/v1/wos/fetch.ini b/biblio-tools/v1/wos/fetch.ini deleted file mode 100644 index edd9692..0000000 --- a/biblio-tools/v1/wos/fetch.ini +++ /dev/null @@ -1,79 +0,0 @@ -# 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 -; évite l'arret du traitement, en cas d'erreur, on retourne la valeur non traitée -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/v1/wos/works/expand.ini b/biblio-tools/v1/wos/works/expand.ini deleted file mode 100644 index 10ab7d8..0000000 --- a/biblio-tools/v1/wos/works/expand.ini +++ /dev/null @@ -1,112 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v1-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 = 5 -noerror = false - -# Suppression des réponses qui n'ont pas abouties -[map/remove] -test = get('UID').isEmpty() - -[map/OBJFlatten] - -# 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) - diff --git a/biblio-tools/v1/wos/works/expandByUT.ini b/biblio-tools/v1/wos/works/expandByUT.ini deleted file mode 100644 index 02ee03f..0000000 --- a/biblio-tools/v1/wos/works/expandByUT.ini +++ /dev/null @@ -1,107 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v1-wos-works-expand -post.description = Récupération des informations associées à un UT dans la base Web of Science -post.summary = Récupération à partir d'un tableau d'objets avec à minima un champ value contenant le UT -post.tags.0 = biblio-tools -post.requestBody.content.application/json.example.0.id = 1 -post.requestBody.content.application/json.example.0.value = WOS:001039810800001 -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 UT -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') - -# 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 => `UT=(${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() - -[map/OBJFlatten] - -# Création d'un objet réponse -[map/replace] -path = id -value = get('UID') -path = value -value = self() - -# Croisements des resultats et des ut -[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) - diff --git a/biblio-tools/v2/conditor/works/expand.ini b/biblio-tools/v2/conditor/works/expand.ini deleted file mode 100644 index cc46ee0..0000000 --- a/biblio-tools/v2/conditor/works/expand.ini +++ /dev/null @@ -1,91 +0,0 @@ -# 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 = 5 -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 deleted file mode 100644 index b0e6ecd..0000000 --- a/biblio-tools/v2/conditor/works/expandByHalid.ini +++ /dev/null @@ -1,95 +0,0 @@ -# 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 deleted file mode 100644 index 28d5f17..0000000 --- a/biblio-tools/v2/crossref/prefixes/expand.ini +++ /dev/null @@ -1,76 +0,0 @@ -# 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 = 30000 -retries = 5 -; évite l'arret du traitement, en cas d'erreur, on retourne la valeur non traitée -noerror = true - -[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 deleted file mode 100644 index 49f06d2..0000000 --- a/biblio-tools/v2/crossref/works/expand.ini +++ /dev/null @@ -1,97 +0,0 @@ -# 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 = 5 -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/datacite/works/expand.ini b/biblio-tools/v2/datacite/works/expand.ini deleted file mode 100644 index 590389f..0000000 --- a/biblio-tools/v2/datacite/works/expand.ini +++ /dev/null @@ -1,61 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v2-datacite-works-expand -post.description = Récupération des métadonnées associées à un DOI dans Datacite -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-datacite-works-expand - -[expand/URLFetch] - -url = get('value').prepend('https://api.datacite.org/dois/') -json = true -target = fix('value') -timeout = 30000 -retries = 5 -; évite l'arret du traitement, en cas d'erreur, on retourne la valeur non traitée -noerror = true - -; Prendre uniquement data -[expand/replace] -path = id -value = get('id') -path = value -value = get('value.data') - -# 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/v2/hal/works/expand.ini b/biblio-tools/v2/hal/works/expand.ini deleted file mode 100644 index 3cfde5f..0000000 --- a/biblio-tools/v2/hal/works/expand.ini +++ /dev/null @@ -1,128 +0,0 @@ -# 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 = 5 -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 deleted file mode 100644 index 107a527..0000000 --- a/biblio-tools/v2/inspirehep/works/expand.ini +++ /dev/null @@ -1,67 +0,0 @@ -# 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 = 30000 -retries = 5 -; évite l'arret du traitement, en cas d'erreur, on retourne la valeur non traitée -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 deleted file mode 100644 index 3299101..0000000 --- a/biblio-tools/v2/istex/works/expand.ini +++ /dev/null @@ -1,101 +0,0 @@ -# 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 = 5 -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 deleted file mode 100644 index 10b6b91..0000000 --- a/biblio-tools/v2/openalex/works/expand.ini +++ /dev/null @@ -1,54 +0,0 @@ -# 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:').append(`?api_key=${env('OPENALEX_API_KEY')}`) -json = true -target = fix('value') -timeout = 30000 -retries = 5 -; évite l'arret du traitement, en cas d'erreur, on retourne la valeur non traitée -noerror = true - -# 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/rdg/works/expand.ini b/biblio-tools/v2/rdg/works/expand.ini deleted file mode 100644 index e177a65..0000000 --- a/biblio-tools/v2/rdg/works/expand.ini +++ /dev/null @@ -1,61 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v2-rdg-works-expand -post.description = Récupération des métadonnées associées à un DOI dans Recherche Data Gouv -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-rdg-works-expand - -[expand/URLFetch] - -url = get('value').prepend('https://entrepot.recherche.data.gouv.fr/api/datasets/:persistentId?persistentId=doi:') -json = true -target = fix('value') -timeout = 30000 -retries = 5 -; évite l'arret du traitement, en cas d'erreur, on retourne la valeur non traitée -noerror = true - -; Prendre uniquement data -[expand/replace] -path = id -value = get('id') -path = value -value = get('value.data') - -# On marque les réponses qui n'ont pas abouties -[swing] -test = has('value.latestVersion.datasetPersistentId') -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 deleted file mode 100644 index 08f4379..0000000 --- a/biblio-tools/v2/unpaywall/corhal.ini +++ /dev/null @@ -1,101 +0,0 @@ -# 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 deleted file mode 100644 index e2f404d..0000000 --- a/biblio-tools/v2/unpaywall/expand.ini +++ /dev/null @@ -1,114 +0,0 @@ -# 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 deleted file mode 100644 index 5c60d29..0000000 --- a/biblio-tools/v2/unpaywall/is_oa.ini +++ /dev/null @@ -1,102 +0,0 @@ -# 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 deleted file mode 100644 index 287254c..0000000 --- a/biblio-tools/v2/unpaywall/works/expand.ini +++ /dev/null @@ -1,101 +0,0 @@ -# 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 = 5 -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 deleted file mode 100644 index edd9692..0000000 --- a/biblio-tools/v2/wos/fetch.ini +++ /dev/null @@ -1,79 +0,0 @@ -# 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 -; évite l'arret du traitement, en cas d'erreur, on retourne la valeur non traitée -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 deleted file mode 100644 index c707e8c..0000000 --- a/biblio-tools/v2/wos/works/expand.ini +++ /dev/null @@ -1,115 +0,0 @@ -# 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 -post.parameters.1.in = header -post.parameters.1.name = X-Wos-Api-key -post.parameters.1.schema.type = string -post.parameters.1.schema.format = string -post.parameters.1.required = false - -# 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', env('headers.x-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 = 5 -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) - diff --git a/biblio-tools/v2/wos/works/expandByUT.ini b/biblio-tools/v2/wos/works/expandByUT.ini deleted file mode 100644 index b29a734..0000000 --- a/biblio-tools/v2/wos/works/expandByUT.ini +++ /dev/null @@ -1,110 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v1-wos-works-expand -post.description = Récupération des informations associées à un UT dans la base Web of Science -post.summary = Récupération à partir d'un tableau d'objets avec à minima un champ value contenant le UT -post.tags.0 = biblio-tools -post.requestBody.content.application/json.example.0.id = 1 -post.requestBody.content.application/json.example.0.value = WOS:001039810800001 -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 UT -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 -post.parameters.1.in = header -post.parameters.1.name = X-Wos-Api-key -post.parameters.1.schema.type = string -post.parameters.1.schema.format = string -post.parameters.1.required = false - -# 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', env('headers.x-wos-api-key')) - -# 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 => `UT=(${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('UID') -path = value -value = self() - -# Croisements des resultats et des ut -[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) -