From 22906fb225ce3464caf22c60addbc5f015eb4837 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 22 Nov 2022 11:11:14 +0000 Subject: [PATCH 1/4] ISSUE-46: Show list of sentences --- DSL.Resql/get_corpora.sql | 1 + DSL.Resql/get_task.sql | 1 + DSL.Ruuter/GET/task.yml | 11 +++++++++++ DSL.Ruuter/GET/tasks.yml | 13 +++++++++++++ README.md | 25 +++++++++++++++++++++++++ 5 files changed, 51 insertions(+) create mode 100644 DSL.Resql/get_corpora.sql create mode 100644 DSL.Resql/get_task.sql create mode 100644 DSL.Ruuter/GET/task.yml create mode 100644 DSL.Ruuter/GET/tasks.yml diff --git a/DSL.Resql/get_corpora.sql b/DSL.Resql/get_corpora.sql new file mode 100644 index 0000000..f9649ec --- /dev/null +++ b/DSL.Resql/get_corpora.sql @@ -0,0 +1 @@ +SELECT * FROM list_corpora_tasks_paginated(:where_condition, :sort_condition, :page, :page_size); \ No newline at end of file diff --git a/DSL.Resql/get_task.sql b/DSL.Resql/get_task.sql new file mode 100644 index 0000000..0f88038 --- /dev/null +++ b/DSL.Resql/get_task.sql @@ -0,0 +1 @@ +select *, 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/DSL.Ruuter/GET/task.yml b/DSL.Ruuter/GET/task.yml new file mode 100644 index 0000000..ffbddc3 --- /dev/null +++ b/DSL.Ruuter/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/DSL.Ruuter/GET/tasks.yml b/DSL.Ruuter/GET/tasks.yml new file mode 100644 index 0000000..5e82603 --- /dev/null +++ b/DSL.Ruuter/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} diff --git a/README.md b/README.md index 41f48bf..c6167eb 100644 --- a/README.md +++ b/README.md @@ -11,5 +11,30 @@ https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Resql/insert_regex.s https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Ruuter/POST/regex.yml +``` +``` + +### Show list of sentences + +https://github.com/buerokratt/Data-Anonymizer/issues/46 + +https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Resql/get_corpora.sql + +``` +``` + +https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Ruuter/GET/tasks.yml + ``` ``` + +https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Resql/get_task.sql + +``` +``` + +https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Ruuter/GET/task.yml + +``` +``` + From c0287cf386e2891d1982b7c60f4b2a8b011e938d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 29 Nov 2022 14:06:04 +0000 Subject: [PATCH 2/4] add sample curl reques --- DSL.Resql/get_corpora.sql | 2 +- DSL.Resql/get_task.sql | 2 +- README.md | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/DSL.Resql/get_corpora.sql b/DSL.Resql/get_corpora.sql index f9649ec..2e63594 100644 --- a/DSL.Resql/get_corpora.sql +++ b/DSL.Resql/get_corpora.sql @@ -1 +1 @@ -SELECT * FROM list_corpora_tasks_paginated(:where_condition, :sort_condition, :page, :page_size); \ No newline at end of file +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/DSL.Resql/get_task.sql b/DSL.Resql/get_task.sql index 0f88038..67ffb11 100644 --- a/DSL.Resql/get_task.sql +++ b/DSL.Resql/get_task.sql @@ -1 +1 @@ -select *, 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 +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/README.md b/README.md index c6167eb..de96994 100644 --- a/README.md +++ b/README.md @@ -21,20 +21,24 @@ https://github.com/buerokratt/Data-Anonymizer/issues/46 https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Resql/get_corpora.sql ``` +curl -H "Content-Type: application/json" -X "POST" "http://localhost:8082/get_corpora" --data '{"where_condition": "corpora_id = '\''c25d0570-dc99-46d6-afb7-80ad46439b3c'\''", "sort_condition": "Corpora_Tasks.\"id\" DESC", "page": "1", "page_size": "30"}' ``` https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Ruuter/GET/tasks.yml ``` +curl "http://localhost:8080/tasks?page=1&page_size=30&where_condition=corpora_id%20=%20%27c25d0570-dc99-46d6-afb7-80ad46439b3c%27&sort_condition=Corpora_Tasks."id"+DESC" ``` https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Resql/get_task.sql ``` +curl -H "Content-Type: application/json" -X "POST" "http://localhost:8082/get_task" --data '{"corpora_id": "c25d0570-dc99-46d6-afb7-80ad46439b3c", "id": 931986}' ``` https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Ruuter/GET/task.yml ``` +curl "http://localhost:8080/task?id=931986&project=c25d0570-dc99-46d6-afb7-80ad46439b3c" ``` From e017cfbf6ae895c123da62d82ab89f03bc2ae120 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 6 Dec 2022 09:46:34 +0000 Subject: [PATCH 3/4] add new line --- DSL.Resql/get_corpora.sql | 2 +- DSL.Resql/get_task.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DSL.Resql/get_corpora.sql b/DSL.Resql/get_corpora.sql index 2e63594..c377447 100644 --- a/DSL.Resql/get_corpora.sql +++ b/DSL.Resql/get_corpora.sql @@ -1 +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 +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); diff --git a/DSL.Resql/get_task.sql b/DSL.Resql/get_task.sql index 67ffb11..7f117fe 100644 --- a/DSL.Resql/get_task.sql +++ b/DSL.Resql/get_task.sql @@ -1 +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 +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; From 7b0d7c2810e56b411d8d09086a7d086ebf99c82d Mon Sep 17 00:00:00 2001 From: root Date: Thu, 15 Dec 2022 10:37:37 +0000 Subject: [PATCH 4/4] ISSUE-46: files for getting corpora info --- DSL.Resql/get_corpora_info.sql | 1 + DSL.Ruuter/GET/corpora_info.yml | 7 +++++++ README.md | 15 ++++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 DSL.Resql/get_corpora_info.sql create mode 100644 DSL.Ruuter/GET/corpora_info.yml diff --git a/DSL.Resql/get_corpora_info.sql b/DSL.Resql/get_corpora_info.sql new file mode 100644 index 0000000..317c16b --- /dev/null +++ b/DSL.Resql/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; diff --git a/DSL.Ruuter/GET/corpora_info.yml b/DSL.Ruuter/GET/corpora_info.yml new file mode 100644 index 0000000..91970cc --- /dev/null +++ b/DSL.Ruuter/GET/corpora_info.yml @@ -0,0 +1,7 @@ +get_project: + call: http.post + args: + url: http://resql:8082/get_corpora_info + result: request_response + +return_value: diff --git a/README.md b/README.md index de96994..f71f92b 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,14 @@ https://github.com/buerokratt/Data-Anonymizer/issues/59 https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Resql/insert_regex.sql ``` + ``` https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Ruuter/POST/regex.yml ``` -``` + +``` ### Show list of sentences @@ -42,3 +44,14 @@ https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Ruuter/GET/task.yml curl "http://localhost:8080/task?id=931986&project=c25d0570-dc99-46d6-afb7-80ad46439b3c" ``` +https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Resql/get_corpora_info.sql + +``` +curl -H "Content-Type: application/json" -X "POST" "http://localhost:8082/get_corpora_info" +``` + +https://github.com/buerokratt/Data-Anonymizer/blob/main/DSL.Ruuter/GET/corpora_info.yml + +``` +curl "http://localhost:8080/corpora_info" +```