diff --git a/affiliations-tools/README.md b/affiliations-tools/README.md index 4611527..e4f330f 100644 --- a/affiliations-tools/README.md +++ b/affiliations-tools/README.md @@ -1,249 +1,4 @@ # affiliations-tools -L'instance `affiliations-tools` utilise l'application ezmaster -[`lodex-workers`](https://github.com/Inist-CNRS/lodex-workers). - -Elle offre plusieurs services autour des affiliations dans les notices bibliographiques: - -- `netscity`: donne des informations sur les villes envoyées (position - géographique, pays, province, ...) -- `rnsr`: déduit de l'adresse d'une affiliation d'auteur et d'une date de - publication (l'année suffit) zéro, un ou plusieurs identifiants RNSR - (correspondant à une ou plusieurs structures de recherche française(s)). - -Cet appariement suit des [règles -certaines](https://github.com/Inist-CNRS/ezs/blob/master/packages/conditor/README.md#r%C3%A8gles-certaines). - -## Configuration - -Il faut préciser dans le fichier de configuration de l'instance qu'elle utilise des paquets nodes: - -- `@ezs/analytics` -- `@ezs/basics` -- `@ezs/conditor` -- `@ezs/storage` -- `@ezs/libpostal` - -Bien sûr, les dernières versions sont préférables. - -Exemple: - -```json -{ - "packages": [ - "@ezs/analytics@1.18.8", - "@ezs/basics@1.20.0", - "@ezs/conditor@2.8.0", - "@ezs/storage@1.6.3", - "@ezs/libpostal@0.2.1" - ] -} -``` - -> **Attention**: ce serveur doit être une instance de -> `inistcnrs/ezmaster-libpostal`. - -## Utilisation - -- [v1/rnsr/csv](#v1%2frnsr%2fcsv) -- [v1/rnsr/json](#v1%2frnsr%2fjson) -- [v1/rnsr/conditor](#v1%2frnsr%2fconditor) - -### v1/rnsr/csv - -Prend un fichier CSV, avec des colonnes nommées `Adresse` et `Année`, et renvoie -un CSV avec la colonne supplémentaire `RNSR`. - -Les colonnes doivent être séparées par des tabulations, des points-virgules ou -des virgules. - -#### Exemple CSV - -```bash -cat < *Remarque : Quand aucun identifiant n'est trouvé, un tableau vide est -> renvoyé.* - -#### Paramètres de v1/rnsr/json - -| nom | description | -| ------ | -------------------------------------------------- | -| indent | `true` ou `false`, indente le JSON résultat ou non | - -#### Exemple JSON - -```bash -cat < *Remarque : Quand aucun identifiant n'est trouvé, un tableau vide est -> renvoyé.* - -#### Paramètres de v1/rnsr/info - -| nom | description | -| ------ | -------------------------------------------------- | -| indent | `true` ou `false`, indente le JSON résultat ou non | - -#### Exemple Info - -```bash -cat < ([array[0]+char]), [""]) - -path = authors -value = get("Adresse").toArray("Chaîne").reduce((s,c) => [{affiliations:[{address:s[0].affiliations[0].address+c}]}], [{affiliations:[{address:""}]}]) - -[affAlign] - -[replace] -path = Année -value = get("xPublicationDate") - -path = Adresse -value = get("authors.0.affiliations.0.address") - -path = RNSR -value = get("authors.0.affiliations.0.conditorRnsr") - -[CSVString] diff --git a/affiliations-tools/v1/rnsr/examples.http b/affiliations-tools/v1/rnsr/examples.http deleted file mode 100644 index edaf1b5..0000000 --- a/affiliations-tools/v1/rnsr/examples.http +++ /dev/null @@ -1,35 +0,0 @@ -# These examples can be used directly in VSCode, using REST Client extension (humao.rest-client) - -POST http://affiliations-tools-1.tdmservices.intra.inist.fr/v1/rnsr/json?indent=true HTTP/1.1 -Content-Type: application/json - -[ - { "id":1, "value": "CNRS UMR AMAP MONTPELLIER FRA" }, - { "id":2, "value": "IRD UMR AMAP MONTPELLIER FRA" }, - { "id":3, "value": "University of Bordeaux, IMS, CNRS UMR5218, Talence, F-33405, France" }, - { "id":4, "value": "CENBG, CNRS/IN2P3, Chemin du Solarium B. P. 120, Gradignan, F-33175, France" }, - { "id":5, "value": "Nulle part" } -] - -### -POST http://affiliations-tools-1.tdmservices.intra.inist.fr/v1/rnsr/csv HTTP/1.1 -Content-Type: text/csv - -Année,Adresse -2015,CNRS UMR AMAP MONTPELLIER FRA -2015,IRD UMR AMAP MONTPELLIER FRA -2015,"University of Bordeaux, IMS, CNRS UMR5218, Talence, F-33405, France" -2015,"CENBG, CNRS/IN2P3, Chemin du Solarium B. P. 120, Gradignan, F-33175, France" - -### -POST http://affiliations-tools-1.tdmservices.intra.inist.fr/v1/rnsr/conditor HTTP/1.1 -Content-Type: application/json - -[{ - "xPublicationDate": ["2012-01-01"], - "authors": [{ - "affiliations": [{ - "address": "GDR 2989 Université Versailles Saint-Quentin-en-Yvelines, 63009" - }] - }] -}] diff --git a/affiliations-tools/v1/rnsr/info.ini b/affiliations-tools/v1/rnsr/info.ini deleted file mode 100644 index 551ff89..0000000 --- a/affiliations-tools/v1/rnsr/info.ini +++ /dev/null @@ -1,151 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v1-rnsr-info -post.description = Traitement qui prend un objet JSON contenant un `id` et une `value` (contenant une année de publication, `year`, et une adresse `address`) et renvoie un `id` et une `value` (un tableau d'objets avec des informations sur les structures correspondant à l'adresse). -post.tags.0 = affiliations -post.tags.1 = rnsr -post.responses.default.description = Return a JSON, composed of `id`, `value`, where value is found research structures from RNSR -post.responses.default.content.application/json.schema.$ref = #/components/schemas/IdRNSRs -post.summary = Find information for address given in `value`, when possible -post.requestBody.required = true -post.requestBody.content.application/json.schema.$ref = #/components/schemas/IdYearAddresses - -# Examples - -# Paste examples here, using make example-metadata affiliations-tools info -post.requestBody.content.application/json.example.0.id: 1 -post.requestBody.content.application/json.example.0.value.year: 2021 -post.requestBody.content.application/json.example.0.value.address: CNRS UMR AMAP MONTPELLIER FRA -post.requestBody.content.application/json.example.1.id: 3 -post.requestBody.content.application/json.example.1.value.year: 2021 -post.requestBody.content.application/json.example.1.value.address: University of Bordeaux, IMS, CNRS UMR5218, Talence, F-33405, France -post.requestBody.content.application/json.example.2.id: 4 -post.requestBody.content.application/json.example.2.value.year: 2021 -post.requestBody.content.application/json.example.2.value.address: CENBG, CNRS/IN2P3, Chemin du Solarium B. P. 120, Gradignan, F-33175, France -post.requestBody.content.application/json.example.3.id: 5 -post.requestBody.content.application/json.example.3.value.year: 2021 -post.requestBody.content.application/json.example.3.value.address: Nulle part -post.requestBody.content.application/json.example.4.id: 6 -post.requestBody.content.application/json.example.4.value.address: Intemporel -post.requestBody.content.application/json.example.5.id: 7 -post.requestBody.content.application/json.example.5.value.address: Inist-CNRS, UPS76, 2 rue Jean Zay, Vandoeuvre-lès-Nancy -post.responses.default.content.application/json.example.0.id: 1 -post.responses.default.content.application/json.example.0.value.0.num_nat_struct: 200317641S -post.responses.default.content.application/json.example.0.value.0.intitule: botAnique et Modélisation de l'Architecture des Plantes et des végétations -post.responses.default.content.application/json.example.0.value.0.sigle: AMAP -post.responses.default.content.application/json.example.0.value.0.ville_postale: MONTPELLIER CEDEX 5 -post.responses.default.content.application/json.example.0.value.0.code_postal: 34398 -post.responses.default.content.application/json.example.0.value.0.etabAssoc.0.etab.sigle: CNRS -post.responses.default.content.application/json.example.0.value.0.etabAssoc.0.etab.libelle: Centre national de la recherche scientifique -post.responses.default.content.application/json.example.0.value.0.etabAssoc.0.etab.sigleAppauvri: cnrs -post.responses.default.content.application/json.example.0.value.0.etabAssoc.0.etab.libelleAppauvri: centre national de la recherche scientifique -post.responses.default.content.application/json.example.0.value.0.etabAssoc.0.label: UMR -post.responses.default.content.application/json.example.0.value.0.etabAssoc.0.labelAppauvri: umr -post.responses.default.content.application/json.example.0.value.0.etabAssoc.0.numero: 5120 -post.responses.default.content.application/json.example.0.value.0.etabAssoc.1.etab.sigle: IRD -post.responses.default.content.application/json.example.0.value.0.etabAssoc.1.etab.libelle: Institut de recherche pour le developpement -post.responses.default.content.application/json.example.0.value.0.etabAssoc.1.etab.sigleAppauvri: ird -post.responses.default.content.application/json.example.0.value.0.etabAssoc.1.etab.libelleAppauvri: institut de recherche pour le developpement -post.responses.default.content.application/json.example.0.value.0.etabAssoc.1.label: UMR -post.responses.default.content.application/json.example.0.value.0.etabAssoc.1.labelAppauvri: umr -post.responses.default.content.application/json.example.0.value.0.etabAssoc.1.numero: 5120 -post.responses.default.content.application/json.example.0.value.0.etabAssoc.2.etab.sigle: CIRAD -post.responses.default.content.application/json.example.0.value.0.etabAssoc.2.etab.libelle: Centre de Cooperation Internationale en Recherche Agronomique pour le Developpement -post.responses.default.content.application/json.example.0.value.0.etabAssoc.2.etab.sigleAppauvri: cirad -post.responses.default.content.application/json.example.0.value.0.etabAssoc.2.etab.libelleAppauvri: centre de cooperation internationale en recherche agronomique pour le developpement -post.responses.default.content.application/json.example.0.value.0.etabAssoc.2.label: UMR -post.responses.default.content.application/json.example.0.value.0.etabAssoc.2.labelAppauvri: umr -post.responses.default.content.application/json.example.0.value.0.etabAssoc.2.numero: 51 -post.responses.default.content.application/json.example.0.value.0.etabAssoc.3.etab.sigle: MONTPELLIER -post.responses.default.content.application/json.example.0.value.0.etabAssoc.3.etab.libelle: Université de Montpellier (EPE) -post.responses.default.content.application/json.example.0.value.0.etabAssoc.3.etab.sigleAppauvri: montpellier -post.responses.default.content.application/json.example.0.value.0.etabAssoc.3.etab.libelleAppauvri: universite de montpellier (epe) -post.responses.default.content.application/json.example.0.value.0.etabAssoc.3.label: UMR -post.responses.default.content.application/json.example.0.value.0.etabAssoc.3.labelAppauvri: umr -post.responses.default.content.application/json.example.0.value.0.etabAssoc.3.numero: 5120 -post.responses.default.content.application/json.example.0.value.0.etabAssoc.4.etab.sigle: INRAE -post.responses.default.content.application/json.example.0.value.0.etabAssoc.4.etab.libelle: Institut national de recherche pour l'agriculture, l'alimentation et l'environnement -post.responses.default.content.application/json.example.0.value.0.etabAssoc.4.etab.sigleAppauvri: inrae -post.responses.default.content.application/json.example.0.value.0.etabAssoc.4.etab.libelleAppauvri: institut national de recherche pour l agriculture, l alimentation et l environnement -post.responses.default.content.application/json.example.0.value.0.etabAssoc.4.label: UMR -post.responses.default.content.application/json.example.0.value.0.etabAssoc.4.labelAppauvri: umr -post.responses.default.content.application/json.example.0.value.0.etabAssoc.4.numero: 0931 -post.responses.default.content.application/json.example.0.value.0.intituleAppauvri: botanique et modelisation de l architecture des plantes et des vegetations -post.responses.default.content.application/json.example.0.value.0.sigleAppauvri: amap -post.responses.default.content.application/json.example.0.value.0.ville_postale_appauvrie: montpellier cedex 5 -post.responses.default.content.application/json.example.0.value.0.annee_creation: 2001 -post.responses.default.content.application/json.example.0.value.0.an_fermeture: -post.responses.default.content.application/json.example.1.id: 3 -post.responses.default.content.application/json.example.1.value.0.num_nat_struct: 200711887V -post.responses.default.content.application/json.example.1.value.0.intitule: LABORATOIRE D'INTEGRATION DU MATERIAU AU SYSTEME -post.responses.default.content.application/json.example.1.value.0.sigle: IMS -post.responses.default.content.application/json.example.1.value.0.ville_postale: TALENCE CEDEX -post.responses.default.content.application/json.example.1.value.0.code_postal: 33405 -post.responses.default.content.application/json.example.1.value.0.etabAssoc.0.etab.sigle: CNRS -post.responses.default.content.application/json.example.1.value.0.etabAssoc.0.etab.libelle: Centre national de la recherche scientifique -post.responses.default.content.application/json.example.1.value.0.etabAssoc.0.etab.sigleAppauvri: cnrs -post.responses.default.content.application/json.example.1.value.0.etabAssoc.0.etab.libelleAppauvri: centre national de la recherche scientifique -post.responses.default.content.application/json.example.1.value.0.etabAssoc.0.label: UMR -post.responses.default.content.application/json.example.1.value.0.etabAssoc.0.labelAppauvri: umr -post.responses.default.content.application/json.example.1.value.0.etabAssoc.0.numero: 5218 -post.responses.default.content.application/json.example.1.value.0.etabAssoc.1.etab.sigle: BORDEAUX -post.responses.default.content.application/json.example.1.value.0.etabAssoc.1.etab.libelle: Université de Bordeaux -post.responses.default.content.application/json.example.1.value.0.etabAssoc.1.etab.sigleAppauvri: bordeaux -post.responses.default.content.application/json.example.1.value.0.etabAssoc.1.etab.libelleAppauvri: universite de bordeaux -post.responses.default.content.application/json.example.1.value.0.etabAssoc.1.label: UMR -post.responses.default.content.application/json.example.1.value.0.etabAssoc.1.labelAppauvri: umr -post.responses.default.content.application/json.example.1.value.0.etabAssoc.1.numero: 5218 -post.responses.default.content.application/json.example.1.value.0.etabAssoc.2.etab.sigle: Bordeaux INP -post.responses.default.content.application/json.example.1.value.0.etabAssoc.2.etab.libelle: Institut Polytechnique Bordeaux -post.responses.default.content.application/json.example.1.value.0.etabAssoc.2.etab.sigleAppauvri: bordeaux inp -post.responses.default.content.application/json.example.1.value.0.etabAssoc.2.etab.libelleAppauvri: institut polytechnique bordeaux -post.responses.default.content.application/json.example.1.value.0.etabAssoc.2.label: UMR -post.responses.default.content.application/json.example.1.value.0.etabAssoc.2.labelAppauvri: umr -post.responses.default.content.application/json.example.1.value.0.etabAssoc.2.numero: 5218 -post.responses.default.content.application/json.example.1.value.0.intituleAppauvri: laboratoire d integration du materiau au systeme -post.responses.default.content.application/json.example.1.value.0.sigleAppauvri: ims -post.responses.default.content.application/json.example.1.value.0.ville_postale_appauvrie: talence cedex -post.responses.default.content.application/json.example.1.value.0.annee_creation: 2006 -post.responses.default.content.application/json.example.1.value.0.an_fermeture: -post.responses.default.content.application/json.example.2.id: 4 -post.responses.default.content.application/json.example.2.value: [] -post.responses.default.content.application/json.example.3.id: 5 -post.responses.default.content.application/json.example.3.value: [] -post.responses.default.content.application/json.example.4.id: 6 -post.responses.default.content.application/json.example.4.value: [] -post.responses.default.content.application/json.example.5.id: 7 -post.responses.default.content.application/json.example.5.value.0.num_nat_struct: 198822446E -post.responses.default.content.application/json.example.5.value.0.intitule: Institut de l'information scientifique et technique -post.responses.default.content.application/json.example.5.value.0.sigle: INIST -post.responses.default.content.application/json.example.5.value.0.ville_postale: VANDOEUVRE LES NANCY CEDEX -post.responses.default.content.application/json.example.5.value.0.code_postal: 54519 -post.responses.default.content.application/json.example.5.value.0.etabAssoc.0.etab.sigle: CNRS -post.responses.default.content.application/json.example.5.value.0.etabAssoc.0.etab.libelle: Centre national de la recherche scientifique -post.responses.default.content.application/json.example.5.value.0.etabAssoc.0.etab.sigleAppauvri: cnrs -post.responses.default.content.application/json.example.5.value.0.etabAssoc.0.etab.libelleAppauvri: centre national de la recherche scientifique -post.responses.default.content.application/json.example.5.value.0.etabAssoc.0.label: UAR -post.responses.default.content.application/json.example.5.value.0.etabAssoc.0.labelAppauvri: uar -post.responses.default.content.application/json.example.5.value.0.etabAssoc.0.numero: 76 -post.responses.default.content.application/json.example.5.value.0.intituleAppauvri: institut de l information scientifique et technique -post.responses.default.content.application/json.example.5.value.0.sigleAppauvri: inist -post.responses.default.content.application/json.example.5.value.0.ville_postale_appauvrie: vandoeuvre les nancy cedex -post.responses.default.content.application/json.example.5.value.0.annee_creation: 1988 -post.responses.default.content.application/json.example.5.value.0.an_fermeture: - -# Ajouter une ou deux apostrophes pour corriger la coloration syntaxique: ' - -[use] -plugin = basics -plugin = conditor - -[JSONParse] - -[assign] -path = value.year -value = update("value.year", (field) => typeof field === "string" ? field.split("-")[0] : field).get("value.year") - -[getRnsrInfo] - -[JSONString] -indent = env('indent', true) diff --git a/affiliations-tools/v1/rnsr/json.ini b/affiliations-tools/v1/rnsr/json.ini deleted file mode 100644 index 97c4a78..0000000 --- a/affiliations-tools/v1/rnsr/json.ini +++ /dev/null @@ -1,65 +0,0 @@ -# OpenAPI Documentation - JSON format (dot notation) -mimeType = application/json - -post.operationId = post-v1-rnsr-json -post.description = Traitement qui prend un objet JSON content un `id` et une `value` (contenant une année de publication, `year`, et une adresse `address`) et renvoie un `id` et une `value` (un tableau d'identifiants RNSR). -post.tags.0 = affiliations -post.tags.1 = rnsr -post.responses.default.description = Return a JSON, composed of `id`, `value`, where value is found `RNSR`(s) -post.responses.default.content.application/json.schema.$ref = #/components/schemas/IdRNSRs -post.summary = Find RNSR to address given in `value`, when possible -post.requestBody.required = true -post.requestBody.content.application/json.schema.$ref = #/components/schemas/IdYearAddresses - -# Examples - -post.requestBody.content.application/json.example.0.id: 1 -post.requestBody.content.application/json.example.0.value.year: 2021 -post.requestBody.content.application/json.example.0.value.address: CNRS UMR AMAP MONTPELLIER FRA -post.requestBody.content.application/json.example.1.id: 2 -post.requestBody.content.application/json.example.1.value.year: 2021 -post.requestBody.content.application/json.example.1.value.address: IRD UMR AMAP MONTPELLIER FRA -post.requestBody.content.application/json.example.2.id: 3 -post.requestBody.content.application/json.example.2.value.year: 2021 -post.requestBody.content.application/json.example.2.value.address: University of Bordeaux, IMS, CNRS UMR5218, Talence, F-33405, France -post.requestBody.content.application/json.example.3.id: 4 -post.requestBody.content.application/json.example.3.value.year: 2021 -post.requestBody.content.application/json.example.3.value.address: CENBG, CNRS/IN2P3, Chemin du Solarium B. P. 120, Gradignan, F-33175, France -post.requestBody.content.application/json.example.4.id: 5 -post.requestBody.content.application/json.example.4.value.year: 2021 -post.requestBody.content.application/json.example.4.value.address: Nulle part -post.requestBody.content.application/json.example.5.id: 6 -post.requestBody.content.application/json.example.5.value.address: Intemporel -post.requestBody.content.application/json.example.6.id: 7 -post.requestBody.content.application/json.example.6.value.address: Inist-CNRS, UPS76, 2 rue Jean Zay, Vandoeuvre-lès-Nancy -post.responses.default.content.application/json.example.0.id: 1 -post.responses.default.content.application/json.example.0.value.0: 200317641S -post.responses.default.content.application/json.example.1.id: 2 -post.responses.default.content.application/json.example.1.value.0: 200317641S -post.responses.default.content.application/json.example.2.id: 3 -post.responses.default.content.application/json.example.2.value.0: 200711887V -post.responses.default.content.application/json.example.3.id: 4 -post.responses.default.content.application/json.example.3.value: [] -post.responses.default.content.application/json.example.4.id: 5 -post.responses.default.content.application/json.example.4.value: [] -post.responses.default.content.application/json.example.5.id: 6 -post.responses.default.content.application/json.example.5.value: [] -post.responses.default.content.application/json.example.6.id: 7 -post.responses.default.content.application/json.example.6.value.0: 198822446E - -# Ajouter une ou deux apostrophes pour corriger la coloration syntaxique: ' - -[use] -plugin = basics -plugin = conditor - -[JSONParse] - -[assign] -path = value.year -value = update("value.year", (field) => typeof field === "string" ? field.split("-")[0] : field).get("value.year") - -[getRnsr] - -[JSONString] -indent = env('indent', true)