diff --git a/mapping-tools/examples.http b/mapping-tools/examples.http index c3b73fb..beac3d3 100644 --- a/mapping-tools/examples.http +++ b/mapping-tools/examples.http @@ -143,4 +143,15 @@ { "id":9, "value": "Other" }, { "id":10, "value": "Theory-Nucl" } ] -### \ No newline at end of file +### + +# @name v1RnsrYearInstitutsCnrs +# Trouver l'Institut du CNRS associé à une structure de recherche et une année +POST {{baseUrl}}/v1/rnsr-year/instituts-cnrs?indent=true HTTP/1.1 +Content-Type: application/json + +[ + {"id":1, "value": "200919362L|2020"}, + {"id":2, "value": "200112440X|2022"} +] +### diff --git a/mapping-tools/v1/rnsr-year/instituts-cnrs.ini b/mapping-tools/v1/rnsr-year/instituts-cnrs.ini new file mode 100644 index 0000000..54d57b7 --- /dev/null +++ b/mapping-tools/v1/rnsr-year/instituts-cnrs.ini @@ -0,0 +1,43 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v1-rnsr-year-instituts-cnrs +post.description = Retrouve le ou les institut(s) du CNRS dans lequel se trouve la structure de recherche française dont l'identifiant RNSR et l'année sont fournis. +post.responses.default.description = Renvoie un JSON, composé d `id`, `value`, avec `value` étant un ou plusieurs institut(s) du CNRS +post.responses.default.content.application/json.schema.$ref = #/components/schemas/IdInstitutes +post.tags.0: mapping +post.summary: Trouve le ou les institut(s) du CNRS dans lequel se trouve une structure de recherche +post.requestBody.required = true +post.requestBody.content.application/json.schema.$ref = #/components/schemas/IdRNSRs1 +post.requestBody.content.application/json.example.0.id = 1 +post.requestBody.content.application/json.example.0.value = 200919362L|2020 +post.requestBody.content.application/json.example.1.id = 2 +post.requestBody.content.application/json.example.1.value = 200112440X|2022 +post.responses.default.content.application/json.example.0.id = 1 +post.responses.default.content.application/json.example.0.value = INEE (P) +post.responses.default.content.application/json.example.1.id = 2 +post.responses.default.content.application/json.example.1.value = INS2I (P);INSIS (S) + +[use] +plugin = basics +plugin = analytics + +[JSONParse] + +[expand] +path = value +cacheName = post-v1-rnsr-year-instituts-cnrs + +[expand/combine] +path = value +default = n/a +primer = env("TABLE_SERVER_URL", "https://inist-wsdata.dboard.inist.fr/") \ + .concat("rnsr-year-instituts-cnrs.tsv").join("") +file = ./rnsr-year-instituts-cnrs.ini + +[assign] +path = value +value = get("value.value") + +[JSONString] +indent = env('indent', true) diff --git a/mapping-tools/v1/rnsr-year/rnsr-year-instituts-cnrs.ini b/mapping-tools/v1/rnsr-year/rnsr-year-instituts-cnrs.ini new file mode 100644 index 0000000..ef836de --- /dev/null +++ b/mapping-tools/v1/rnsr-year/rnsr-year-instituts-cnrs.ini @@ -0,0 +1,17 @@ +# Lit le fichier CSV, et renvoie du JSON [{id, value}] +[use] +plugin = basics +plugin = analytics + +[URLStream] +path = false + +[CSVParse] +separator = fix("\t") +[CSVObject] +[replace] +path = id +value = get('From') + +path = value +value = get("To")