Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation service: add hierarchy support to categories #2

Open
8 of 9 tasks
khyurri opened this issue Oct 31, 2022 · 3 comments
Open
8 of 9 tasks

Annotation service: add hierarchy support to categories #2

khyurri opened this issue Oct 31, 2022 · 3 comments

Comments

@khyurri
Copy link
Contributor

khyurri commented Oct 31, 2022

Back-end

  • When new job is creating, user can select categories for this job. If user selects category with parents, all parents must be assigned to this job (annotation service). It means, that if user selects sub-category, all parents are also selected

  • Add /annotation/categories/search endpoint with hierarchy support scheme

  • Add /annotation/jobs/{job_id}/categories/search endpoint with hierarchy support scheme

Hierarchy support scheme contains:

  • is_leaf boolean, to show is current node has children
  • parents list of parent categories, ordered from root to current node without current node

Example:

  "data": [
    {
      "name": "Child2",
      "parent": "Child1",
      "type": "box",
      "id": "Child2",
      "is_leaf": true,
      "parents": [
        {
          "name": "Root",
          "type": "box",
          "id": "Root",
          "is_leaf": false
        },
        {
          "name": "Child1",
          "parent": "root",
          "type": "box",
          "id": "Child1",
          "is_leaf": false
        }
      ]
    }
  ]

Front-end

  • [ ]

Filterlib LTREE support

  • Add filter_lib support LTREE for filtering data

Supported operations:
children - returns children of value, to get only root nodes set value as root
children_recursive - returns all children down the tree
parent - returns parent
parents_recursive - returns all parents

Others

  • Add annotation service PUT | POST, migrate Category table to LTREE structure
  • Add endpoint /annotation/jobs/job_id/categoiries/search (search by jobs categories)
  • Add Front-end support: get hierarchy by job_id and search in categories
  • Add Front-end add categories, update and delete?
  • Setup dev internal environment
@khyurri
Copy link
Contributor Author

khyurri commented Nov 17, 2022

Known bugs:

  • Unable to create new category from /categories page with Internal server error
    Example request:
    {"id":"t-root","name":"t-root","metadata":{"color":"#876565"},"type":"box","parent":null}

@MagicTearsAsunder
Copy link
Collaborator

Known bugs:

  • Unable to create new category from /categories page with Internal server error
    Example request:
    {"id":"t-root","name":"t-root","metadata":{"color":"#876565"},"type":"box","parent":null}

Special symbols are not allowed in Ltree path. Allowed: letters [a-z, A-Z], digits [0-9] and underscore ("_").
Solution - add validation on CategoryResponseSchema.

@khyurri
Copy link
Contributor Author

khyurri commented Nov 18, 2022

@MagicTearsAsunder

  • children must contain only current level children

MagicTearsAsunder added a commit that referenced this issue Nov 27, 2022
commit da477d4
Author: Ruslan Khyurri <ruslan.khyurri@gmail.com>
Date:   Thu Nov 24 18:59:09 2022 +0000

    hotfix: patch fetch_bunch_categories_db to skip category checking

commit afe5d07
Author: Denis Rybakov <minefrs@gmail.com>
Date:   Thu Nov 24 18:21:45 2022 +0200

    feat: filter categories parents and childs by job_id

commit 00612d1
Author: Ruslan Khyurri <ruslan.khyurri@gmail.com>
Date:   Tue Nov 22 11:14:56 2022 +0000

    fix isort

commit 6702779
Merge: 71929b8 6acb499
Author: Ruslan Khyurri <ruslan.khyurri@gmail.com>
Date:   Tue Nov 22 09:46:08 2022 +0000

    Merge branch 'add-mock-categoty-relation' of https://github.com/epam/badgerdoc into add-mock-categoty-relation

commit 71929b8
Author: Ruslan Khyurri <ruslan.khyurri@gmail.com>
Date:   Tue Nov 22 09:44:44 2022 +0000

    Return insert_category_tree function

commit 6acb499
Author: Ruslan <ruslan.khyurri@gmail.com>
Date:   Mon Nov 21 18:58:08 2022 +0000

    Add is_leaf, change extraction parents algorithm (#34)

commit 3cb671a
Author: Ruslan Khyurri <ruslan.khyurri@gmail.com>
Date:   Mon Nov 21 18:56:12 2022 +0000

    Add is_leaf, change extraction parents algorithm

commit fa12b30
Author: Ruslan Khyurri <ruslan.khyurri@gmail.com>
Date:   Fri Nov 18 21:44:59 2022 +0000

    feat: make tests more robust. Add LTREE installation on start-up

commit 12c1ff9
Author: Svetlana Bilevich <69203629+sbilevich@users.noreply.github.com>
Date:   Fri Nov 18 17:52:40 2022 +0400

    fix:tree view sync with API (#33)

    Co-authored-by: Svetlana Bilevich <svetlana_bilevich@epam.com>

commit 80abfc2
Author: Magic Tears Asunder <The.Magic.Tears.Asunder@protonmail.com>
Date:   Thu Nov 17 17:16:29 2022 +0400

    fix: merge conflict (#29)

    * ci/cd: fix env vars, add parameters to charts and docker files (#6)

    Repalce artifactory url with ECR. Add as default value to docker files
    and helm charts.
    Remove env vars flow control to simplify deployment.

    * docs: add CONTRIBUTING.md

    * Feature: LTREE supported operations#2 (#19)

    * feat: Add ltree operations support
    * Ltree operations support to create_filter function.
    * Add visit_LTREE method monkey-patching for SQLiteTypeCompiler
    * Add sqlalchemy_utils dependency

    * feat: Add LTREE filter tests
    * Add Category table to conftest.py.
    * Add tests to cover ltree filter functionality

    * feat: Add new operations to registry
    * To _FilterOperations
    * To README.md

    * docs: Add comment to filter_lib/tests/conftest.pyt

    * feat: Add ltree not supported operation test

    * feature: add arrow to link target side (#26)

    * feat: add arrow to link target side

    * delete comments

    Co-authored-by: Svetlana Bilevich <svetlana_bilevich@epam.com>

    * feat: support multilabeling (#25)

    Co-authored-by: Svetlana Bilevich <svetlana_bilevich@epam.com>

    Co-authored-by: theoriginmm <theorigin.mm@gmail.com>
    Co-authored-by: Denis Rybakov <minefrs@gmail.com>
    Co-authored-by: minev-dev <90937832+minev-dev@users.noreply.github.com>
    Co-authored-by: Svetlana Bilevich <69203629+sbilevich@users.noreply.github.com>
    Co-authored-by: Svetlana Bilevich <svetlana_bilevich@epam.com>
    Co-authored-by: Kirill Sosnovskiy <Kirill_Sosnovskii@epam.com>

commit f7fa3e9
Author: Magic Tears Asunder <The.Magic.Tears.Asunder@protonmail.com>
Date:   Thu Nov 17 13:52:38 2022 +0400

    refactor: add compatibility with filter_lib (#23)

commit 805cd43
Author: Ruslan <ruslan.khyurri@gmail.com>
Date:   Mon Nov 14 14:00:57 2022 +0000

    Get CI/CD pipelines into category hierarchy branch (#20)

commit 335108c
Author: Magic Tears Asunder <The.Magic.Tears.Asunder@protonmail.com>
Date:   Mon Nov 14 14:44:57 2022 +0400

    feat: add hierarchy support to categories

    #2

commit 4c45cbc
Author: Svetlana Bilevich <svetlana_bilevich@epam.com>
Date:   Tue Nov 8 12:24:14 2022 +0400

    feat: add categories tree, categories search

commit c084311
Author: Magic Tears Asunder <The.Magic.Tears.Asunder@protonmail.com>
Date:   Mon Nov 7 11:45:22 2022 +0300

    Add category hierarchy response (#5)

    This PR adds hierarchy categories support to responses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants