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

Imported nested attributes #66

Open
andy-symonds opened this issue Oct 11, 2022 · 2 comments
Open

Imported nested attributes #66

andy-symonds opened this issue Oct 11, 2022 · 2 comments

Comments

@andy-symonds
Copy link

Hi TypeDB-Loaders,
Thank you for open-sourcing such a great tool!

I cannot find any documentation on importing attributes of attributes. The appendAttribute functionality only is documented to work for entities and relations (that I can see). Please could you tell me if this is possible or if it is on the road map?

Thinking if something like the below is possible in the TypeDB-Loader config file, where entityA owns attributeA, and attributeA owns attributeB.

"entities": {
    "entityA": {
        "data": [
            "mydata.csv"
        ],
        "insert": {
            "entity": "entityA",
            "ownerships": [
                {
                    "attribute": "attributeA",
                    "column": "attributeA",
                    "ownerships": [
                        {
                            "attribute": "attributeB",
                            "column": "attributeB"
                        }
                    ]
                }
            ]
        }
    }

This is of course possible directly in TypeQL, with something like (if the entityA and attributeA are already loaded in):

match $a isa attributeA; $a "Foo";
insert $a has attributeB "Bar";

It would just be lovely to do it all using TypeDB Loader :)

Many thanks in advance!
Andy

@flyingsilverfin
Copy link
Member

Hi -
There's no reason it shouldn't be done, we'll have to get around to implementing it :) the syntax should already support it in the "attributes" section actually...

@andy-symonds
Copy link
Author

Hi @flyingsilverfin,
Thanks for confirming that it is possible :) Interested that the syntax should already be supported in "attributes" section.

I am continuing to play around with the syntax to see if I can match and then insert attributes of attributes (no luck so far). If you have any pointers/suggestions please let me know :)

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