diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..5f3108a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "markdown.extension.toc.updateOnSave": false +} \ No newline at end of file diff --git a/mapping-tools/README.md b/mapping-tools/README.md index 327409f..4f8ecbc 100644 --- a/mapping-tools/README.md +++ b/mapping-tools/README.md @@ -29,7 +29,158 @@ ## Utilisation -- [v1/rnsr/instituts-cnrs/json](#v1%2frnsr%2finstituts-cnrs%2fjson) +- [v1/halAuthorId/idRef/json](#v1/halauthorid/idref/json) +- [v1/homogenize/documentType/json](#v1/homogenize/documenttype/json) +- [v1/homogenize/publisher/json](#v1/homogenize/publisher/json) +- [v1/homogenize/source/json](#v1/homogenize/source/json) +- [v1/idRef/orcid/json](#v1/idref/orcid/json) +- [v1/rnsr/instituts-cnrs/json](#v1/rnsr/instituts-cnrs/json) + +### v1/halAuthorId/idRef/json + +Renvoie l'idRef associé au halAuthorId fourni. + +Prend en entrée du JSON avec deux champs: `id` et `value`, et renvoie un JSON +avec l'idRef associé au halAuthorId fourni. + +#### Paramètres de v1/halAuthorId/idRef/json + +| nom | description | +| :----- | :--------------------------------------------------------------------- | +| indent | `true` ou `false`, indente le JSON résultat ou non (`true` par défaut) | + +#### Exemple de v1/halAuthorId/idRef/json + +Avec le halAuthorId . + +```bash +curl -X POST "http://mapping-tools.tdmservices.intra.inist.fr/v1/halAuthorId/idRef/json" -H "accept: application/json" -H "Content-Type: application/json" -d "[{\"id\":0,\"value\":\"https://data.archives-ouvertes.fr/author/1458607\"}]" +``` + +Sortie: + +```json +[ + { + "id": 0, + "value": "http://www.idref.fr/190260483/id" + } +] +``` + +### v1/homogenize/documentType/json + +Homogénéise le type de document d'une notice. + +Prend en entrée du JSON avec deux champs: `id` et `value`, et renvoie un JSON +avec la forme canonique du type de document. + +#### Paramètres de v1/homogenize/documentType/json + +| nom | description | +| :----- | :--------------------------------------------------------------------- | +| indent | `true` ou `false`, indente le JSON résultat ou non (`true` par défaut) | + +#### Exemple de v1/homogenize/documentType/json + +Avec la valeur `"ART"`. + +```bash +curl -X POST "http://mapping-tools.tdmservices.intra.inist.fr/v1/homogenize/documentType/json" -H "accept: application/json" -H "Content-Type: application/json" -d "[{\"id\":0,\"value\":\"ART\"}]" +``` + +Sortie: + +```json +[ + { + "id": 0, + "value": "Article" + } +] +``` + +### v1/homogenize/publisher/json + +Prend en entrée du JSON avec deux champs: `id` et `value`, et renvoie un JSON +avec la forme canonique de l'éditeur envoyé dans le champ `value`. + +#### Paramètres de v1/homogenize/publisher/json + +| nom | description | +| :----- | :--------------------------------------------------------------------- | +| indent | `true` ou `false`, indente le JSON résultat ou non (`true` par défaut) | + +#### Exemple de v1/homogenize/publisher/json + +```bash +curl -X POST "https://mapping-tools.services.inist.fr/v1/homogenize/publisher/json" -H "accept: application/json" -H "Content-Type: application/json" -d "[{\"id\":0,\"value\":\"Springer Verlag\"}]" +``` + +Sortie: + +```json +[ + { + "id": 0, + "value": "SPRINGER" + } +] +``` + +### v1/homogenize/source/json + +Prend en entrée du JSON avec deux champs: `id` et `value`, et renvoie un JSON +avec la forme canonique de la source envoyée dans le champ `value`. + +#### Paramètres de v1/homogenize/source/json + +| nom | description | +| :----- | :--------------------------------------------------------------------- | +| indent | `true` ou `false`, indente le JSON résultat ou non (`true` par défaut) | + +#### Exemple de v1/homogenize/source/json + +```bash +curl -X POST "https://mapping-tools.services.inist.fr/v1/homogenize/source/json" -H "accept: application/json" -H "Content-Type: application/json" -d "[{\"id\":0,\"value\":\"« Gilets jaunes » Hypothèses sur un mouvement\"}]" +``` + +Sortie: + +```json +[ + { + "id": 0, + "value": "\"GILETS JAUNES\" : HYPOTHESES SUR UN MOUVEMENT" + } +] +``` + +### v1/idRef/orcid/json + +Prend en entrée du JSON avec deux champs: `id` et `value`, et renvoie un JSON +avec les ORCID correspondant à l'idRef envoyé dans le champ `value`. + +#### Paramètres de v1/idRef/orcid/json + +| nom | description | +| :----- | :--------------------------------------------------------------------- | +| indent | `true` ou `false`, indente le JSON résultat ou non (`true` par défaut) | + +#### Exemple v1/idRef/orcird/json + +```bash +curl -X POST "https://mapping-tools.services.inist.fr/v1/idRef/orcid/json" -H "accept: application/json" -H "Content-Type: application/json" -d "[{\"id\":0,\"value\":\"http://www.idref.fr/190260483/id\"}]" +``` + +Sortie: + +```json +[{ + "id": 0, + "value": "https://orcid.org/0000-0003-1301-3305" +}] +``` ### v1/rnsr/instituts-cnrs/json diff --git a/mapping-tools/examples.http b/mapping-tools/examples.http index e9ea79d..264e996 100644 --- a/mapping-tools/examples.http +++ b/mapping-tools/examples.http @@ -1,13 +1,6 @@ # Ces exemples peuvent être exécutés directement dans VSCode, en utilisant # l'extension REST Client (humao.rest-client) -# Pour pouvoir les tester, lancez le serveur, à partir du répertoire -# mapping-tools: -# npx ezs -v -d . - -# Pour chauffer le cache rapidement, utiliser un seul cœur: -# EZS_CONCURRENCY=1 npx ezs -v -d . - # Trouver l'Institut du CNRS associé à une structure de recherche POST https://mapping-tools.services.inist.fr/v1/rnsr/instituts-cnrs/json?indent=true HTTP/1.1 Content-Type: application/json diff --git a/mapping-tools/v1/halAuthorId/idRef/json.ini b/mapping-tools/v1/halAuthorId/idRef/json.ini index 876b0a4..2207a67 100644 --- a/mapping-tools/v1/halAuthorId/idRef/json.ini +++ b/mapping-tools/v1/halAuthorId/idRef/json.ini @@ -2,13 +2,17 @@ mimeType = application/json post.operationId = post-v1-halauthorid-idref-json -post.description = Retrouve l identifiant idRef correspondant à l identifiant halAuthorId envoyé. -post.responses.default.description = Renvoie un JSON, composé d `id`, `value`, avec `value` étant un idRef. -post.responses.default.content.application/json.schema.$ref = #/components/schemas/IdIdRefs -post.tags.0: mapping -post.summary: Trouve l idRef associé à un halAuthorId. +post.requestBody.content.application/json.example.0.id = 0 +post.requestBody.content.application/json.example.0.value = https://data.archives-ouvertes.fr/author/1458607 +post.requestBody.content.application/json.schema.$ref = #/components/schemas/IdChaines post.requestBody.required = true -post.requestBody.content.application/json.schema.$ref = #/components/schemas/IdHalAuthorIds +post.responses.default.content.application/json.example.0.id = 0 +post.responses.default.content.application/json.example.0.value = http://www.idref.fr/190260483/id +post.responses.default.content.application/json.schema.$ref = #/components/schemas/IdChaines +post.description = Renvoie l'identifiant idRef correspondant à l'identifiant halAuthorId envoyé. +post.responses.default.description = Renvoie un JSON, composé d `id`, `value`, avec `value` étant un idRef. +post.tags.0: mapping +post.summary: Trouve un idRef associé à un halAuthorId. [use] plugin = basics diff --git a/mapping-tools/v1/homogenize/documentType/json.ini b/mapping-tools/v1/homogenize/documentType/json.ini index 609fc00..c29f069 100644 --- a/mapping-tools/v1/homogenize/documentType/json.ini +++ b/mapping-tools/v1/homogenize/documentType/json.ini @@ -2,13 +2,17 @@ mimeType = application/json post.operationId = post-v1-homogenize-document-type-json -post.description = Homogénéise le type de document d une notice. -post.responses.default.description = Renvoie un JSON, composé d `id`, `value`, avec `value` étant le type de document homogénéisé. -post.responses.default.content.application/json.schema.$ref = #/components/schemas/IdChaines -post.tags.0: mapping -post.summary: Homogénéise le type de document d une notice -post.requestBody.required = true +post.description = Homogénéise le type de document donné. +post.requestBody.content.application/json.example.0.id = 0 +post.requestBody.content.application/json.example.0.value = ART post.requestBody.content.application/json.schema.$ref = #/components/schemas/IdChaines +post.requestBody.required = true +post.responses.default.content.application/json.example.0.id = 0 +post.responses.default.content.application/json.example.0.value = Article +post.responses.default.content.application/json.schema.$ref = #/components/schemas/IdChaines +post.responses.default.description = Renvoie un JSON, composé d `id`, `value`, avec `value` étant le tyoe de document homogénéisé. +post.tags.0: mapping +post.summary: Homogénéise le type de document donné [use] plugin = basics diff --git a/mapping-tools/v1/homogenize/publisher/json.ini b/mapping-tools/v1/homogenize/publisher/json.ini index e6fe9bb..5f8e5c3 100644 --- a/mapping-tools/v1/homogenize/publisher/json.ini +++ b/mapping-tools/v1/homogenize/publisher/json.ini @@ -2,13 +2,17 @@ mimeType = application/json post.operationId = post-v1-homogenize-publisher-json -post.description = Homogénéise la forme d écriture de l éditeur d une notice. -post.responses.default.description = Renvoie un JSON, composé d `id`, `value`, avec `value` étant l éditeur homogénéisé. +post.requestBody.content.application/json.example.0.id = 0 +post.requestBody.content.application/json.example.0.value = Springer Verlag +post.requestBody.content.application/json.schema.$ref = #/components/schemas/IdChaines +post.requestBody.required = true +post.responses.default.content.application/json.example.0.id = 0 +post.responses.default.content.application/json.example.0.value = SPRINGER post.responses.default.content.application/json.schema.$ref = #/components/schemas/IdChaines +post.responses.default.description = Renvoie un JSON, composé d `id`, `value`, avec `value` étant l éditeur homogénéisé. +post.description = Homogénéise la forme d écriture de l éditeur d une notice. post.tags.0: mapping post.summary: Homogénéise l éditeur dans une notice -post.requestBody.required = true -post.requestBody.content.application/json.schema.$ref = #/components/schemas/IdChaines [use] plugin = basics diff --git a/mapping-tools/v1/homogenize/source/json.ini b/mapping-tools/v1/homogenize/source/json.ini index 0b4664e..81d44c3 100644 --- a/mapping-tools/v1/homogenize/source/json.ini +++ b/mapping-tools/v1/homogenize/source/json.ini @@ -2,13 +2,17 @@ mimeType = application/json post.operationId = post-v1-homogenize-source-json -post.description = Homogénéise la source d une notice (passe tout en majuscules, ...). -post.responses.default.description = Renvoie un JSON, composé d `id`, `value`, avec `value` étant la source homogénéisée. -post.responses.default.content.application/json.schema.$ref = #/components/schemas/IdChaines -post.tags.0: mapping -post.summary: Homogénéise la forme de la source d une notice -post.requestBody.required = true +post.requestBody.content.application/json.example.0.id = 0 +post.requestBody.content.application/json.example.0.value = « Gilets jaunes » Hypothèses sur un mouvement post.requestBody.content.application/json.schema.$ref = #/components/schemas/IdChaines +post.requestBody.required = true +post.responses.default.content.application/json.example.0.id = 0 +post.responses.default.content.application/json.example.0.value = \"GILETS JAUNES\" : HYPOTHESES SUR UN MOUVEMENT +post.responses.default.content.application/json.schema.$ref = #/components/schemas/IdChaines +post.responses.default.description = Renvoie un JSON, composé d `id`, `value`, avec `value` étant la source homogénéisée. +post.description = Homogénéise la source d une notice (passe tout en majuscules, ...). +post.summary: Homogénéise la forme de la source d une notice +post.tags.0: mapping [use] plugin = basics