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 multi-label edge patterns. #2

Open
glennga opened this issue Oct 6, 2023 · 0 comments
Open

Add support for multi-label edge patterns. #2

glennga opened this issue Oct 6, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@glennga
Copy link
Member

glennga commented Oct 6, 2023

Currently, we only support edge patterns with a single label. Again, it would be nice to support more complex edge patterns in queries. For now, users have to simulate multi-label edges by using composition in the edge definition body (given in the workaround below):

FROM
  GRAPH MyGraph
    (u1:User)-[:IS_FRIENDS_WITH|IS_BEST_FRIENDS_WITH]->(u2:User)
SELECT *;

must be written as:

WITH
  GRAPH MyTemporaryGraph AS
    VERTEX (:User)
      PRIMARY KEY (user_id)
      AS Users,
    EDGE (:User)-[:IS_FRIENDS_OR_BEST_FRIENDS_WITH]->(:User)
      SOURCE KEY (source_id)
      DESTINATION KEY (dest_id)
      AS (
        <IS_FRIENDS_WITH edge definition>
        UNION ALL
        <IS_BEST_FRIENDS_WITH edge definition>
      )
FROM
  GRAPH MyTemporaryGraph
    (u1:User)-[:IS_FRIENDS_OR_BEST_FRIENDS_WITH]->(u2:User)
SELECT *;
@glennga glennga added the enhancement New feature or request label Oct 6, 2023
@glennga glennga moved this to In Progress in Graphix Project Oct 6, 2023
@glennga glennga moved this from In Progress to Todo in Graphix Project Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant