From 2dedff183be23dcf7d511096d121a598427c9b59 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 6 Dec 2022 11:16:17 +0000 Subject: [PATCH 1/2] ISSUE-46|ISSUE-47: Show list of sentences and Filter sentences by ID --- Docker_Project/README.md | 16 ++++++++++++---- .../Resql/templates/production/get_corpora.sql | 1 + .../Resql/templates/production/get_task.sql | 1 + .../Resql/templates/production/project.sql | 1 + Docker_Project/Ruuter/DSL/GET/project.yml | 8 ++++++++ Docker_Project/Ruuter/DSL/GET/task.yml | 11 +++++++++++ Docker_Project/Ruuter/DSL/GET/tasks.yml | 13 +++++++++++++ 7 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 Docker_Project/Resql/templates/production/get_corpora.sql create mode 100644 Docker_Project/Resql/templates/production/get_task.sql create mode 100644 Docker_Project/Resql/templates/production/project.sql create mode 100644 Docker_Project/Ruuter/DSL/GET/project.yml create mode 100644 Docker_Project/Ruuter/DSL/GET/task.yml create mode 100644 Docker_Project/Ruuter/DSL/GET/tasks.yml diff --git a/Docker_Project/README.md b/Docker_Project/README.md index d916d18..5b95d9c 100644 --- a/Docker_Project/README.md +++ b/Docker_Project/README.md @@ -33,7 +33,6 @@ https://github.com/buerokratt/Data-Anonymizer/issues/86 Add [Ruuter DSL File](Ruuter/DSL/GET/regex.yml) and [Resql Query](Resql/templates/production/list_regex.sql) to list regex patterns. - ### Delete added Regex pattern from database https://github.com/buerokratt/Data-Anonymizer/issues/63 @@ -44,11 +43,20 @@ Add [Ruuter DSL File](Ruuter/DSL/GET/delete_regex.yml) and [Resql Query](Resql/t https://github.com/buerokratt/Data-Anonymizer/issues/59 - - Add [Ruuter DSL File](Ruuter/DSL/POST/regex.yml) and [Resql Query](Resql/templates/production/insert_regex.sql) to add a regex pattern. - - Add [Ruuter DSL File](Ruuter/DSL/GET/entity.yml) and [Resql Query](Resql/templates/production/list_entity.sql) to list entities. +- Add [Ruuter DSL File](Ruuter/DSL/POST/regex.yml) and [Resql Query](Resql/templates/production/insert_regex.sql) to add a regex pattern. +- Add [Ruuter DSL File](Ruuter/DSL/GET/entity.yml) and [Resql Query](Resql/templates/production/list_entity.sql) to list entities. ### Add new entity https://github.com/buerokratt/Data-Anonymizer/issues/89 -Add [Ruuter DSL File](Ruuter/DSL/POST/entity.yml) and [Resql Query](Resql/templates/production/insert_entity.sql) to add an entity. \ No newline at end of file +Add [Ruuter DSL File](Ruuter/DSL/POST/entity.yml) and [Resql Query](Resql/templates/production/insert_entity.sql) to add an entity. + +### Show list of sentences and Filter sentences by ID + +https://github.com/buerokratt/Data-Anonymizer/issues/46 +https://github.com/buerokratt/Data-Anonymizer/issues/47 + +- Add [Ruuter DSL File](Ruuter/DSL/GET/tasks.yml) and [Resql Query](Resql/templates/production/get_corpora.sql) to list corpora tasks based on pagination and filters. +- Add [Ruuter DSL File](Ruuter/DSL/GET/task.yml) and [Resql Query](Resql/templates/production/get_task.sql) to get a particular task detail. +- Add [Ruuter DSL File](Ruuter/DSL/GET/project.yml) and [Resql Query](Resql/templates/production/project.sql) to get latest corpora id. diff --git a/Docker_Project/Resql/templates/production/get_corpora.sql b/Docker_Project/Resql/templates/production/get_corpora.sql new file mode 100644 index 0000000..2e63594 --- /dev/null +++ b/Docker_Project/Resql/templates/production/get_corpora.sql @@ -0,0 +1 @@ +SELECT id, corpora_id, created_at, full_count, is_private, predictions, raw_text FROM list_corpora_tasks_paginated(:where_condition, :sort_condition, :page, :page_size); \ No newline at end of file diff --git a/Docker_Project/Resql/templates/production/get_task.sql b/Docker_Project/Resql/templates/production/get_task.sql new file mode 100644 index 0000000..67ffb11 --- /dev/null +++ b/Docker_Project/Resql/templates/production/get_task.sql @@ -0,0 +1 @@ +select id, corpora_id, created_at, is_private, raw_text, sentences_annotations::text AS predictions from Corpora_Tasks where corpora_id = :corpora_id and id = :id ORDER BY created_at DESC limit 1; \ No newline at end of file diff --git a/Docker_Project/Resql/templates/production/project.sql b/Docker_Project/Resql/templates/production/project.sql new file mode 100644 index 0000000..2d3c5d9 --- /dev/null +++ b/Docker_Project/Resql/templates/production/project.sql @@ -0,0 +1 @@ +select corpora_id from corpora_tasks order by id desc limit 1; \ No newline at end of file diff --git a/Docker_Project/Ruuter/DSL/GET/project.yml b/Docker_Project/Ruuter/DSL/GET/project.yml new file mode 100644 index 0000000..a746836 --- /dev/null +++ b/Docker_Project/Ruuter/DSL/GET/project.yml @@ -0,0 +1,8 @@ +get_project: + call: http.post + args: + url: http://resql:8082/project + result: request_response + +return_value: + return: ${request_response.response.body} diff --git a/Docker_Project/Ruuter/DSL/GET/task.yml b/Docker_Project/Ruuter/DSL/GET/task.yml new file mode 100644 index 0000000..ffbddc3 --- /dev/null +++ b/Docker_Project/Ruuter/DSL/GET/task.yml @@ -0,0 +1,11 @@ +get_task: + call: http.post + args: + url: http://resql:8082/get_task + body: + id: ${parseInt(incoming.params.id)} + corpora_id: ${incoming.params.project} + result: request_response + +return_value: + return: ${request_response.response.body[0]} diff --git a/Docker_Project/Ruuter/DSL/GET/tasks.yml b/Docker_Project/Ruuter/DSL/GET/tasks.yml new file mode 100644 index 0000000..5e82603 --- /dev/null +++ b/Docker_Project/Ruuter/DSL/GET/tasks.yml @@ -0,0 +1,13 @@ +list_task_by_corpora_id: + call: http.post + args: + url: http://resql:8082/get_corpora + body: + page: ${incoming.params.page} + page_size: ${incoming.params.page_size} + where_condition: ${incoming.params.where_condition} + sort_condition: ${incoming.params.sort_condition} + result: request_response + +return: + return: ${request_response.response.body} From 7e67c2d19143073f0da1565b82c6a185f450702a Mon Sep 17 00:00:00 2001 From: root Date: Wed, 11 Jan 2023 16:57:33 +0000 Subject: [PATCH 2/2] ISSUE-46-47 --- Docker_Project/README.md | 2 +- Docker_Project/Resql/templates/production/get_corpora_info.sql | 1 + Docker_Project/Resql/templates/production/project.sql | 1 - Docker_Project/Ruuter/DSL/GET/{project.yml => corpora_info.yml} | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 Docker_Project/Resql/templates/production/get_corpora_info.sql delete mode 100644 Docker_Project/Resql/templates/production/project.sql rename Docker_Project/Ruuter/DSL/GET/{project.yml => corpora_info.yml} (73%) diff --git a/Docker_Project/README.md b/Docker_Project/README.md index 5b95d9c..da85a32 100644 --- a/Docker_Project/README.md +++ b/Docker_Project/README.md @@ -59,4 +59,4 @@ https://github.com/buerokratt/Data-Anonymizer/issues/47 - Add [Ruuter DSL File](Ruuter/DSL/GET/tasks.yml) and [Resql Query](Resql/templates/production/get_corpora.sql) to list corpora tasks based on pagination and filters. - Add [Ruuter DSL File](Ruuter/DSL/GET/task.yml) and [Resql Query](Resql/templates/production/get_task.sql) to get a particular task detail. -- Add [Ruuter DSL File](Ruuter/DSL/GET/project.yml) and [Resql Query](Resql/templates/production/project.sql) to get latest corpora id. +- Add [Ruuter DSL File](Ruuter/DSL/GET/corpora_info.yml) and [Resql Query](Resql/templates/production/get_corpora_info.sql) to get latest corpora info. diff --git a/Docker_Project/Resql/templates/production/get_corpora_info.sql b/Docker_Project/Resql/templates/production/get_corpora_info.sql new file mode 100644 index 0000000..c0ca028 --- /dev/null +++ b/Docker_Project/Resql/templates/production/get_corpora_info.sql @@ -0,0 +1 @@ +select corpora_id, source_file_name, source_file_size, created_at, trained_at from Corpora_Info order by created_at desc limit 1; \ No newline at end of file diff --git a/Docker_Project/Resql/templates/production/project.sql b/Docker_Project/Resql/templates/production/project.sql deleted file mode 100644 index 2d3c5d9..0000000 --- a/Docker_Project/Resql/templates/production/project.sql +++ /dev/null @@ -1 +0,0 @@ -select corpora_id from corpora_tasks order by id desc limit 1; \ No newline at end of file diff --git a/Docker_Project/Ruuter/DSL/GET/project.yml b/Docker_Project/Ruuter/DSL/GET/corpora_info.yml similarity index 73% rename from Docker_Project/Ruuter/DSL/GET/project.yml rename to Docker_Project/Ruuter/DSL/GET/corpora_info.yml index a746836..53eac74 100644 --- a/Docker_Project/Ruuter/DSL/GET/project.yml +++ b/Docker_Project/Ruuter/DSL/GET/corpora_info.yml @@ -1,7 +1,7 @@ get_project: call: http.post args: - url: http://resql:8082/project + url: http://resql:8082/get_corpora_info result: request_response return_value: