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

Add support for array type in tabular manifests #161

Open
7 of 10 tasks
Tracked by #241 ...
sirex opened this issue Nov 18, 2021 · 7 comments · Fixed by #356
Open
7 of 10 tasks
Tracked by #241 ...

Add support for array type in tabular manifests #161

sirex opened this issue Nov 18, 2021 · 7 comments · Fixed by #356
Labels
enhancement New feature or request feature Large task U5

Comments

@sirex
Copy link
Collaborator

sirex commented Nov 18, 2021

When property has prop[] name, then it should be implied, that prop is of array type.

When prop[] ref Model is given, then a many to many relationship between models should be created.

When Model.prop array Other is given, then a many to many relationship between models should be created though Other table instead of using Model/:list/prop hidden table. In this case prop[] type must be ref and must be given. By default, many to many relationship will be created though properties, that matches current and prop[] ref models.

When prop array Model[prop1, prop2] is given, then many to many relationship must be created through prop1 and prop2 properties in Model. This must be used, when several refs are used to the same models used in many to many relationship.

Examples:

d | r | b | m | property    | type    | ref
example                     |         |
                            |         |
  |   |   | Language        |         |
  |   |   |   | name@en     | text    |
                            |         |
  |   |   | Country         |         |
  |   |   |   | name@en     | text    |
  |   |   |   | languages[] | ref     | Language

Here a hidden table example/Country/:list/languages will be created and used as intermediate table for many-to-many relationship with Language.

A custom intermediate table can be specified like this:

d | r | b | m | property    | type    | ref
example                     |         |
                            |         |
  |   |   | Language        |         |
  |   |   |   | name@en     | text    |
                            |         |
  |   |   | Country         |         |
  |   |   |   | name@en     | text    |
  |   |   |   | languages   | array   | CountryLanguage
  |   |   |   | languages[] | ref     | Language
                            |         |
  |   |   | CountryLanguage |         |
  |   |   |   | country     | ref     | Country
  |   |   |   | language    | ref     | Language

Now intermediate table is no longer hidden and CountryLanguage is used instead. CountryLanguage must have two ref type properties pointing to both many-to-many ends.

If there are multiple rel properties pointing to same models and in many-to-many relation, then which properties to be used for many-to-many relation can be specified like this:

d | r | b | m | property    | type    | ref
example                     |         |
                            |         |
  |   |   | Language        |         |
  |   |   |   | name@en     | text    |
  |   |   |   | countries | backref | Country
                            |         |
  |   |   | Country         |         |
  |   |   |   | name@en     | text    |
  |   |   |   | languages   | array   | CountryLanguage[country, language]
  |   |   |   | languages[] | ref     | Language
                            |         |
  |   |   | CountryLanguage |         |
  |   |   |   | country     | ref     | Country
  |   |   |   | language    | ref     | Language

By default data from array properties are not show, for example:

http get /example/Country

Will return following result:

{
    "_data": [
        {
            "name": "Lithuania",
            "languages": []
        }
    ]
}

In order to also get data from array, you need to explicitly requrest data with expand() function, like this:

http get /example/Country?expand()

Then you will get this:

{
    "_data": [
        {
            "name": "Lithuania",
            "languages": [
                {"_id": "..."},
                {"_id": "..."}
            ]
        }
    ]
}

By default expand() will expand all array data, but use should be able to tell which properties to expand like this:

http get /example/Country?expand(languages)

For tabular formats, expanded array data are shown liek this:

_id  name        languages[]._id
---  ----------  ---------------
001  Lithuania   251...
001  Lithuania   252...

Data from main table are repeated for each item in array.

Tasks

Related issues

@sirex sirex moved this to Todo in Portalo plėtra May 6, 2022
@sirex sirex removed the status in Portalo plėtra Jun 7, 2022
@sirex sirex moved this to Todo in Portalo plėtra Jun 8, 2022
@sirex sirex removed the status in Portalo plėtra Jun 8, 2022
@adp-atea adp-atea moved this to In Progress in Portalo plėtra Feb 3, 2023
@adp-atea adp-atea linked a pull request Feb 7, 2023 that will close this issue
@adp-atea adp-atea moved this from In Progress to Todo in Portalo plėtra Feb 8, 2023
@adp-atea adp-atea moved this from Todo to In Progress in Portalo plėtra Feb 8, 2023
@adp-atea adp-atea moved this from In Progress to Todo in Portalo plėtra Feb 8, 2023
@adp-atea adp-atea moved this from Todo to In Progress in Portalo plėtra Feb 13, 2023
@adp-atea adp-atea moved this from In Progress to Review in Portalo plėtra Feb 15, 2023
@sirex sirex moved this from Review to Todo in Portalo plėtra Feb 16, 2023
@adp-atea adp-atea moved this from Todo to In Progress in Portalo plėtra Feb 17, 2023
@adp-atea adp-atea moved this from In Progress to Todo in Portalo plėtra Feb 20, 2023
@adp-atea adp-atea moved this from Todo to In Progress in Portalo plėtra Feb 21, 2023
@adp-atea adp-atea moved this from In Progress to Review in Portalo plėtra Feb 24, 2023
@sirex sirex mentioned this issue Mar 1, 2023
3 tasks
@sirex sirex moved this from Review to Todo in Portalo plėtra Mar 1, 2023
@adp-atea adp-atea moved this from Todo to In Progress in Portalo plėtra Apr 7, 2023
@adp-atea adp-atea moved this from In Progress to Todo in Portalo plėtra Apr 7, 2023
@adp-atea adp-atea moved this from Todo to In Progress in Portalo plėtra Apr 18, 2023
@adp-atea adp-atea moved this from In Progress to Todo in Portalo plėtra Apr 18, 2023
@adp-atea adp-atea moved this from Todo to In Progress in Portalo plėtra May 29, 2023
@adp-atea adp-atea moved this from Todo to In Progress in Portalo plėtra Sep 28, 2023
@adp-atea adp-atea moved this from In Progress to Review in Portalo plėtra Oct 3, 2023
@sirex sirex moved this from Review to Todo in Portalo plėtra Oct 6, 2023
@adp-atea adp-atea moved this from Todo to In Progress in Portalo plėtra Oct 6, 2023
@adp-atea adp-atea moved this from In Progress to Review in Portalo plėtra Oct 9, 2023
@github-project-automation github-project-automation bot moved this from Review to Done in Portalo plėtra Oct 9, 2023
@adp-atea adp-atea moved this from Done to Deploy in Portalo plėtra Oct 9, 2023
@sirex sirex moved this from Deploy to Test in Portalo plėtra Oct 24, 2023
@sirex
Copy link
Collaborator Author

sirex commented Nov 22, 2023

Opening this task, because exposed intermediate tables are not yet implemented.

@sirex sirex reopened this Nov 22, 2023
@JuliusLADP
Copy link
Collaborator

JuliusLADP commented Mar 15, 2024

Reikia atskirti į atsikiras užduotįs jas detalizuojant

  1. Exposed intermediate table
  2. RDF support 161 support for array types in tabular #356 (review)
  3. ir tikriausiai Push data

@ATEAanalyst
Copy link

Reikalingi detalesni užduoties aprašymai. Šiuo metu nėra aišku, ką norite, kad atliktume.

@JuliusLADP
Copy link
Collaborator

Kad Justinui viskas kaip ir aišku

@JustinasKen
Copy link
Contributor

Reikia tas 3 dalis išskaidyti į atskiras užduotis ir detalizuoti kiekvieną, pateikiant kaip bus naudojama, kokie turės būti rezultatai, kaip buvo įsivaizduota kad veiks.

@sirex
Copy link
Collaborator Author

sirex commented Jun 21, 2024

Sukurta atskira užduotis:

@JuliusLADP
Copy link
Collaborator

JuliusLADP commented Sep 2, 2024

Iškelta į atskiras užuotis:
Push data #760
RDF support #761

@sirex sirex added the feature Large task label Sep 10, 2024
@sirex sirex removed their assignment Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature Large task U5
Projects
Status: Test
Development

Successfully merging a pull request may close this issue.

4 participants