diff --git a/loterre-resolvers/v1/9SD.cfg b/loterre-resolvers/v1/9SD.cfg new file mode 100644 index 0000000..cf19aa5 --- /dev/null +++ b/loterre-resolvers/v1/9SD.cfg @@ -0,0 +1,15 @@ +[env] +path = primer +value = env("TABLE_SERVER_URL", "http://mapping-tables.daf.intra.inist.fr/").concat("loterre-pays.xml").join("") + +path = loterreID +value = fix('9SD') + +path = weekNumber +value = thru(() => new Date()).thru(currentDate => Math.floor((currentDate - (new Date(currentDate.getFullYear(), 0, 1)))/(24 * 60 * 60 * 1000))).thru(days => Math.ceil(days / 7)) + + +# +# A noter : +# L'utilisation d'un fichier .cfg évite de faire apparaitre ce fichier comme une route dans la documentation openAPI +# diff --git a/loterre-resolvers/v1/9SD/annotate.ini b/loterre-resolvers/v1/9SD/annotate.ini new file mode 100644 index 0000000..023fa8b --- /dev/null +++ b/loterre-resolvers/v1/9SD/annotate.ini @@ -0,0 +1,42 @@ +# OpenAPI Documentation - JSON format (dot notation) +post.operationId = post-v1-9SD-annotate +post.responses.default.description = Return all objects with annotate fields +post.responses.default.content.application/json.schema.$ref = #/components/schemas/JSONStream +post.summary = Annotate field of each Object with a SKOS concept +post.requestBody.required = true +post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream +post.parameters.0.in = query +post.parameters.0.name = path +post.parameters.0.schema.type = string +post.parameters.0.description = The path in each object to enrcih with a SKOS Cocnept +post.parameters.1.in = query +post.parameters.1.name = indent +post.parameters.1.schema.type = boolean +post.parameters.1.description = Indent or not the JSON Result + +[use] +plugin = basics + +[delegate] +file = ./v1/9SD.cfg + +[JSONParse] +separator = * + +[assign] +path = skos-file +value = fix(`${env('TMPDIR', '/tmp')}/${env('loterreID', 'noid')}.skos`) + +[expand] +path = skos-file +file = ./v1/fetch.cfg +cacheName = fix(`${env('loterreID', 'noid')}-${env('weekNumber')}`) + + +; [xslt] +; stylesheet = ./v1/annotate.xsl +; param = fix('FR').prepend('lang=') +; param = get('skosFilename').prepend('vocabulary=') + +[dump] +indent = env('indent', false) diff --git a/loterre-resolvers/v1/9SD/expand.ini b/loterre-resolvers/v1/9SD/expand.ini index e450af8..5a0b7d7 100644 --- a/loterre-resolvers/v1/9SD/expand.ini +++ b/loterre-resolvers/v1/9SD/expand.ini @@ -14,12 +14,8 @@ post.parameters.1.schema.type = boolean post.parameters.1.description = Indent or not the JSON Result -[env] -path = primer -value = env("TABLE_SERVER_URL", "http://mapping-tables.daf.intra.inist.fr/").concat("loterre-pays.xml").join("") - -path = loterreID -value = fix('9SD') +[delegate] +file = ./v1/9SD.cfg [delegate] file = ./v1/process.ini diff --git a/loterre-resolvers/v1/9SD/identify.ini b/loterre-resolvers/v1/9SD/identify.ini index b7fbe63..23d724c 100644 --- a/loterre-resolvers/v1/9SD/identify.ini +++ b/loterre-resolvers/v1/9SD/identify.ini @@ -26,12 +26,8 @@ post.parameters.0.name = indent post.parameters.0.schema.type = boolean -[env] -path = primer -value = env("TABLE_SERVER_URL", "http://mapping-tables.daf.intra.inist.fr/").concat("loterre-pays.xml").join("") - -path = loterreID -value = fix('9SD') +[delegate] +file = ./v1/9SD.cfg [delegate] file = ./v1/process.ini