Creating multiple relations between two nodes

Hi,

I was trying to load many relations with different values of the property between the same source and destination. Tried with Graph Studio and console GSQL console, but only 1 relation is being created and the property values are not assigned as per the file.

Source Node: A
Destination Node: B
Relations: there must be the same 10 relations(connected) between A and B with property sales having different values assigned. How this can be achieved?

Thanks & Regards,
Vinayak

Hi Vinayak,

This behavior is by design. You can only have one edge of a given edge type between two nodes. The edge’s id is based on the id of the source and destination vertices, so multiple edges between the same nodes will have the same id and therefor be the same edge.

From the description of your schema, it sounds like sales should be their own vertex.
A - (Made_Sale) - Sale - (Purchased) - B

Feel free to post your schema if you’re able and I can provide some more specific advice towards schema design.

Thanks,
Dan

1 Like

Hi Dan,

Thank you for the clarification, but there are many scenario’s in which the multiple edges between two nodes will be required. The schema details are shared as follows:

To make the schema creation generic, we are representing all the dimensions as nodes and facts as edge in the graph.

  1. Self Relation similar to BOM
    Dimension: Material, Fact: Parent
    Nodes: Material, Relations: Parent
    Nodes and Relations also contains different properties associated with them.
    There is a case that multiple relations exists between two material with property values differing.

  2. Forecast
    Dimension: Customer, Material Fact: Forecast
    Nodes: Customer with property CustomerId
    Material with property MaterialId
    Relation: forecast_details with properties week no and quantity
    For example: Consider a Material M2 and Customer C9 and 5 weeks of data.
    To represent this 5 weeks of data need to have 5 relationships between same two nodes with week no and quantity different.

Please go through the same and suggest how can I achieve the same.

Thanks & Regards,
Vinayak