diff --git a/biblio-tools/v1/crossref/expand.ini b/biblio-tools/v1/crossref/expand.ini new file mode 100644 index 0000000..b6d1d2d --- /dev/null +++ b/biblio-tools/v1/crossref/expand.ini @@ -0,0 +1,45 @@ +# Necessary plugins +[use] +plugin = basics +plugin = analytics +plugin = storage + +# Flow configuration +[JSONParse] +separator = * + +[bufferize] + +[combine] +path = env('path', 'value') +primer = get('bufferID') +prepend = buffers +append = transit +persistent = true + +[combine/exchange] +value = get('value') + +[combine/group] +size = 100 + +[combine/replace] +path = rows +value = fix(self.length) +path = filter +value = self().map(x => 'doi:'.concat(x)).join(',') + +# see https://github.com/CrossRef/rest-api-doc#api-overview +[combine/URLStream] +url = https://api.crossref.org/works +path = .items.* +timeout = 30000 + +[combine/replace] +path = id +value = get('DOI') +path = value +value = self() + +[dump] +indent = env('indent', false) diff --git a/biblio-tools/v1/unpaywall/README.md b/biblio-tools/v1/unpaywall/README.md new file mode 100644 index 0000000..04c2ef4 --- /dev/null +++ b/biblio-tools/v1/unpaywall/README.md @@ -0,0 +1,54 @@ +# Web service d'extraction de terms "clés" - Teeft - pour des textes en Français + +Exemple d'utilisation : + +```bash + +cat < JSON.stringify(x)).join(',') + +# On crée un objet contenant tous les valeurs nécessaire pour créer une requete +[spawn/combine/replace] +path = query +value = fix('{getDataUPW(dois:[', self.dois, ']){doi, is_oa}}').join('') + +[spawn/combine/URLStream] +url = https://unpaywall.inist.fr/graphql +path = data.getDataUPW.* +timeout = 5000 +noerror = true + +# On supprime les réponses qui n'ont pas abouties ( +[spawn/combine/drop] +path = is_oa + +# On créé l'object attendu par combine { id, value } pour faire le mapping +[spawn/combine/replace] +path = id +value = get('doi') + +path = value +value = get('is_oa', 'n/a') + +# On nettoie l'objet en supprimant les champs temporaires +[spawn/exchange] +value = self().omit('bufferID') + +# On simplifie la structure +[assign] +path = value +value = get('value.value', self.value) + +[dump] +indent = env('indent') diff --git a/bibliographic-enrichment/v1/crossref/expand.ini b/bibliographic-enrichment/v1/crossref/expand.ini deleted file mode 100644 index b6d1d2d..0000000 --- a/bibliographic-enrichment/v1/crossref/expand.ini +++ /dev/null @@ -1,45 +0,0 @@ -# Necessary plugins -[use] -plugin = basics -plugin = analytics -plugin = storage - -# Flow configuration -[JSONParse] -separator = * - -[bufferize] - -[combine] -path = env('path', 'value') -primer = get('bufferID') -prepend = buffers -append = transit -persistent = true - -[combine/exchange] -value = get('value') - -[combine/group] -size = 100 - -[combine/replace] -path = rows -value = fix(self.length) -path = filter -value = self().map(x => 'doi:'.concat(x)).join(',') - -# see https://github.com/CrossRef/rest-api-doc#api-overview -[combine/URLStream] -url = https://api.crossref.org/works -path = .items.* -timeout = 30000 - -[combine/replace] -path = id -value = get('DOI') -path = value -value = self() - -[dump] -indent = env('indent', false) diff --git a/bibliographic-enrichment/v1/unpaywall/README.md b/bibliographic-enrichment/v1/unpaywall/README.md deleted file mode 100644 index 04c2ef4..0000000 --- a/bibliographic-enrichment/v1/unpaywall/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# Web service d'extraction de terms "clés" - Teeft - pour des textes en Français - -Exemple d'utilisation : - -```bash - -cat < JSON.stringify(x)).join(',') - -# On crée un objet contenant tous les valeurs nécessaire pour créer une requete -[spawn/combine/replace] -path = query -value = fix('{getDataUPW(dois:[', self.dois, ']){doi, is_oa}}').join('') - -[spawn/combine/URLStream] -url = https://unpaywall.inist.fr/graphql -path = data.getDataUPW.* -timeout = 5000 -noerror = true - -# On supprime les réponses qui n'ont pas abouties ( -[spawn/combine/drop] -path = is_oa - -# On créé l'object attendu par combine { id, value } pour faire le mapping -[spawn/combine/replace] -path = id -value = get('doi') - -path = value -value = get('is_oa', 'n/a') - -# On nettoie l'objet en supprimant les champs temporaires -[spawn/exchange] -value = self().omit('bufferID') - -# On simplifie la structure -[assign] -path = value -value = get('value.value', self.value) - -[dump] -indent = env('indent')