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

Allow defining a rel table with multiple src/dst node tables #1888

Closed
ray6080 opened this issue Aug 4, 2023 · 5 comments
Closed

Allow defining a rel table with multiple src/dst node tables #1888

ray6080 opened this issue Aug 4, 2023 · 5 comments

Comments

@ray6080
Copy link
Contributor

ray6080 commented Aug 4, 2023

Real world applications can contain relationships with a large number of SRC/DST node table combinations.
Right now, we strictly force a rel table to be defined only with one src and one dst node table, which is best optimized. However, in terms of better user experience, we should gradually relax this restriction to support defining a rel table with multiple src/dst node tables.

@crtomirmajer
Copy link

This is currently indeed an awkward limitation when working with more generic relationships, such as eg. Likes, Owns, PartOf, that are usually connecting various node types. It would be great to have the ability to provide an expression that easily matches eg. "all things user likes", as (a:User)-[:Likes]-(b:Song:Playlist:User). Without the need to define individual UserLikesSong, UserLikesPlaylist, UserLikesUser REL TABLES, which complicates the given match example.

CREATE REL TABLE could probably be modified in a non-breaking way to support this behavior, by allowing multiple FROM {sources} TO {destinations}, {multiplicity} expressions, where both sources and targets are lists, and REL is created for all combinations:

CREATE REL TABLE Likes (
        FROM User TO Song, Playlist, User, ONE_MANY,
	FROM A, B TO C, D, ONE_ONE
);

This would make User->Song, User->Playlist, User->User, A->C, A->D, B->C, and B->D connections possible.

@ray6080
Copy link
Contributor Author

ray6080 commented Aug 12, 2023

Hi @crtomirmajer , thanks for the suggestion! Yeah, indeed the syntax you propose makes a lot sense to me. It is quite close to what we have discussed internally 😄

@crtomirmajer
Copy link

What's the priority of this issue? Any ETA?

@ray6080
Copy link
Contributor Author

ray6080 commented Aug 13, 2023

Hi @crtomirmajer , we hope to add the support of this feature before the end of Aug, so it will be available on our master branch by then. But the release of it will wait until an official release in the mid of Sep.

@andyfengHKU
Copy link
Contributor

This should be available now with CREATE REL TABLE GROUP

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

3 participants