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 ad6edbe..fd459ee 100644 --- a/loterre-resolvers/v1/9SD/expand.ini +++ b/loterre-resolvers/v1/9SD/expand.ini @@ -16,7 +16,10 @@ [env] path = primer -value = https://www.loterre.fr/wp-content/uploads/2019/12/Pays.xml +value = https://inist-wsdata.dboard.inist.fr/loterre-resolvers-pays.xml + +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)) # Necessary plugins [use] @@ -26,13 +29,12 @@ # Flow configuration [JSONParse] -legacy = false -separator = $ +separator = * [expand] path = value size = 1 -cacheName = env('primer').append('expand') +cacheName = env('weekNumber').prepend('post-v1-9SD-expand-week') [expand/assign] path = value @@ -42,7 +44,23 @@ path = value primer = env('primer') file = ./v1/combine.ini -cacheName = post-v1-9SD-expand +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 7c60027..408eb15 100644 --- a/loterre-resolvers/v1/9SD/identify.ini +++ b/loterre-resolvers/v1/9SD/identify.ini @@ -28,7 +28,10 @@ [env] path = primer -value = https://www.loterre.fr/wp-content/uploads/2019/12/Pays.xml +value = https://inist-wsdata.dboard.inist.fr/loterre-resolvers-pays.xml + +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)) # Necessary plugins [use] @@ -43,7 +46,7 @@ [expand] path = value size = 1 -cacheName = env('primer').append('identify') +cacheName = env('weekNumber').prepend('post-v1-9SD-identify-week') [expand/assign] path = value @@ -53,7 +56,7 @@ path = value primer = env('primer') file = ./v1/combine.ini -cacheName = post-v1-9SD-identify +cacheName = env('weekNumber').prepend('post-v1-9SD-combine-week') [expand/remove] test = get('value.value').isString() @@ -98,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 d5b9678..13dbb05 100644 --- a/loterre-resolvers/v1/D63/expand.ini +++ b/loterre-resolvers/v1/D63/expand.ini @@ -16,7 +16,10 @@ [env] path = primer -value = https://www.loterre.fr/wp-content/uploads/2020/07/Communes.xml +value = https://inist-wsdata.dboard.inist.fr/loterre-resolvers-communes.xml + +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)) # Necessary plugins [use] @@ -26,13 +29,12 @@ # Flow configuration [JSONParse] -legacy = false -separator = $ +separator = * [expand] path = value size = 1 -cacheName = env('primer').append('expand') +cacheName = env('weekNumber').prepend('post-v1-D63-expand-week') [expand/assign] path = value @@ -42,7 +44,23 @@ path = value primer = env('primer') file = ./v1/combine.ini -cacheName = post-v1-D63-expand +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 9161cce..17874f9 100644 --- a/loterre-resolvers/v1/D63/identify.ini +++ b/loterre-resolvers/v1/D63/identify.ini @@ -28,7 +28,10 @@ [env] path = primer -value = https://www.loterre.fr/wp-content/uploads/2022/06/Communes.xml +value = https://inist-wsdata.dboard.inist.fr/loterre-resolvers-communes.xml + +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)) # Necessary plugins [use] @@ -43,7 +46,7 @@ [expand] path = value size = 1 -cacheName = env('primer').append('identify') +cacheName = env('weekNumber').prepend('post-v1-D63-identify-week') [expand/assign] path = value @@ -53,7 +56,7 @@ path = value primer = env('primer') file = ./v1/combine.ini -cacheName = post-v1-D63-identify +cacheName = env('weekNumber').prepend('post-v1-D63-combine-week') [expand/remove] test = get('value.value').isString() @@ -98,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 51ccd22..a7c058c 100644 --- a/loterre-resolvers/v1/P66/expand.ini +++ b/loterre-resolvers/v1/P66/expand.ini @@ -174,7 +174,10 @@ [env] path = primer -value = https://www.loterre.fr/wp-content/uploads/2022/07/Memoire.xml +value = https://inist-wsdata.dboard.inist.fr/loterre-resolvers-memoire.xml + +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)) # Necessary plugins [use] @@ -184,13 +187,12 @@ # Flow configuration [JSONParse] -legacy = false -separator = $ +separator = * [expand] path = value size = 1 -cacheName = env('primer').append('expand') +cacheName = env('weekNumber').prepend('post-v1-P66-expand-week') [expand/assign] path = value @@ -200,7 +202,23 @@ path = value primer = env('primer') file = ./v1/combine.ini -cacheName = post-v1-P66-expand +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 25a2c2a..47f0199 100644 --- a/loterre-resolvers/v1/P66/identify.ini +++ b/loterre-resolvers/v1/P66/identify.ini @@ -35,7 +35,10 @@ [env] path = primer -value = https://www.loterre.fr/wp-content/uploads/2022/07/Memoire.xml +value = https://inist-wsdata.dboard.inist.fr/loterre-resolvers-memoire.xml + +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)) # Necessary plugins [use] @@ -49,8 +52,9 @@ [expand] path = value +default = n/a size = 1 -cacheName = env('primer').append('identify') +cacheName = env('weekNumber').prepend('post-v1-P66-identify-week') [expand/assign] path = value @@ -60,7 +64,7 @@ path = value primer = env('primer') file = ./v1/combine.ini -cacheName = post-v1-P66-identify +cacheName = env('weekNumber').prepend('post-v1-P66-combine-week') [expand/remove] test = get('value.value').isString() @@ -87,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)