Skip to content

Add support for multi-label edge patterns. #2

Description

@glennga

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 *;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions