diff --git a/loterre-resolvers/examples.http b/loterre-resolvers/examples.http index 3309c7d..8278f2d 100644 --- a/loterre-resolvers/examples.http +++ b/loterre-resolvers/examples.http @@ -1,10 +1,11 @@ -@baseUrl = https://loterre-resolvers.services.inist.fr +@baseUrl = http://localhost:31976 # @name 9SD_expand POST {{baseUrl}}/v1/9SD/expand?indent=true HTTP/1.1 Content-Type: application/json [ + { "value": "toto"}, { "value": "Pérou" }, { "value": "Pays de la Loire" }, { "value": "Grand-Duché de Luxembourg" }, @@ -17,6 +18,7 @@ Content-Type: application/json [ + { "value": "toto"}, { "value": "Pérou" }, { "value": "Pays de la Loire" }, { "value": "Grand-Duché de Luxembourg" }, @@ -30,6 +32,7 @@ Content-Type: application/json [ + { "value": "toto"}, { "value": "Nancy" }, { "value": "Ecrouves" }, { "value": "Pagny sur Moselle" }, diff --git a/loterre-resolvers/v1/9SD/expand.ini b/loterre-resolvers/v1/9SD/expand.ini index d54a5fe..fd459ee 100644 --- a/loterre-resolvers/v1/9SD/expand.ini +++ b/loterre-resolvers/v1/9SD/expand.ini @@ -29,12 +29,10 @@ # Flow configuration [JSONParse] -legacy = false -separator = $ +separator = * [expand] path = value -default = n/a size = 1 cacheName = env('weekNumber').prepend('post-v1-9SD-expand-week') @@ -48,5 +46,21 @@ file = ./v1/combine.ini cacheName = env('weekNumber').prepend('post-v1-9SD-combine-week') +[expand/remove] +test = get('value.value').isString() + +[expand/replace] +path = id +value = get('id') +path = value +value = get('value.value') + +; Pour les documents sans résulat, on donne une valeur par défaut +[swing] +test = get('value.rdf$about').isEmpty() +[swing/assign] +path = value +value = fix('n/a') + [dump] indent = env('indent', false) diff --git a/loterre-resolvers/v1/9SD/identify.ini b/loterre-resolvers/v1/9SD/identify.ini index 008588d..408eb15 100644 --- a/loterre-resolvers/v1/9SD/identify.ini +++ b/loterre-resolvers/v1/9SD/identify.ini @@ -46,7 +46,6 @@ [expand] path = value size = 1 -default = n/a cacheName = env('weekNumber').prepend('post-v1-9SD-identify-week') [expand/assign] @@ -102,6 +101,12 @@ path = value.localization@fr value = get('value.value.localization').map((x) => x.skos$prefLabel.filter(y => (y.xml$lang === 'fr')).map(x => x.$t).shift()) +; Pour les documents sans résulat, on donne une valeur par défaut +[swing] +test = get('value.id').isEmpty() +[swing/assign] +path = value +value = fix('n/a') [dump] indent = env('indent', false) diff --git a/loterre-resolvers/v1/D63/expand.ini b/loterre-resolvers/v1/D63/expand.ini index 598536f..13dbb05 100644 --- a/loterre-resolvers/v1/D63/expand.ini +++ b/loterre-resolvers/v1/D63/expand.ini @@ -29,18 +29,13 @@ # Flow configuration [JSONParse] -legacy = false -separator = $ +separator = * [expand] path = value -default = n/a size = 1 cacheName = env('weekNumber').prepend('post-v1-D63-expand-week') -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)) - [expand/assign] path = value value = fix(_.deburr(String(self.value).replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/\s]/g, '').toLowerCase())) @@ -51,5 +46,21 @@ file = ./v1/combine.ini cacheName = env('weekNumber').prepend('post-v1-D63-combine-week') +[expand/remove] +test = get('value.value').isString() + +[expand/replace] +path = id +value = get('id') +path = value +value = get('value.value') + +; Pour les documents sans résulat, on donne une valeur par défaut +[swing] +test = get('value.rdf$about').isEmpty() +[swing/assign] +path = value +value = fix('n/a') + [dump] indent = env('indent', false) diff --git a/loterre-resolvers/v1/D63/identify.ini b/loterre-resolvers/v1/D63/identify.ini index 4b87429..17874f9 100644 --- a/loterre-resolvers/v1/D63/identify.ini +++ b/loterre-resolvers/v1/D63/identify.ini @@ -46,7 +46,6 @@ [expand] path = value size = 1 -default = n/a cacheName = env('weekNumber').prepend('post-v1-D63-identify-week') [expand/assign] @@ -102,6 +101,12 @@ path = value.localization@fr value = get('value.value.localization').map((x) => x.skos$prefLabel.filter(y => (y.xml$lang === 'fr')).map(x => x.$t).shift()) +; Pour les documents sans résulat, on donne une valeur par défaut +[swing] +test = get('value.id').isEmpty() +[swing/assign] +path = value +value = fix('n/a') [dump] indent = env('indent', false) diff --git a/loterre-resolvers/v1/P66/expand.ini b/loterre-resolvers/v1/P66/expand.ini index 31bfb55..a7c058c 100644 --- a/loterre-resolvers/v1/P66/expand.ini +++ b/loterre-resolvers/v1/P66/expand.ini @@ -187,12 +187,10 @@ # Flow configuration [JSONParse] -legacy = false -separator = $ +separator = * [expand] path = value -default = n/a size = 1 cacheName = env('weekNumber').prepend('post-v1-P66-expand-week') @@ -206,5 +204,21 @@ file = ./v1/combine.ini cacheName = env('weekNumber').prepend('post-v1-P66-combine-week') +[expand/remove] +test = get('value.value').isString() + +[expand/replace] +path = id +value = get('id') +path = value +value = get('value.value') + +; Pour les documents sans résulat, on donne une valeur par défaut +[swing] +test = get('value.rdf$about').isEmpty() +[swing/assign] +path = value +value = fix('n/a') + [dump] indent = env('indent', false) diff --git a/loterre-resolvers/v1/P66/identify.ini b/loterre-resolvers/v1/P66/identify.ini index 9a57a35..47f0199 100644 --- a/loterre-resolvers/v1/P66/identify.ini +++ b/loterre-resolvers/v1/P66/identify.ini @@ -91,5 +91,12 @@ path = value.localization@fr value = get('value.value.localization').map((x) => x.skos$prefLabel.filter(y => (y.xml$lang === 'fr')).map(x => x.$t).shift()) +; Pour les documents sans résulat, on donne une valeur par défaut +[swing] +test = get('value.id').isEmpty() +[swing/assign] +path = value +value = fix('n/a') + [dump] indent = env('indent', false)