Skip to content

[RELATIONSHIPS] Update entity overwrites duplicate relationship keys in a single update #486

Description

@zaeema-n

Summary

When updating an entity with multiple relationships that share the same relationship key (e.g. two MANDATES edges from one Act to different targets), only one relationship is persisted. The other is dropped or overwritten. This blocks valid graph patterns where one source node should have multiple outgoing edges of the same type in one update request.

Environment

  • API: OpenGIN ingestion — PUT /entities/{id}
  • Backend: Neo4j handler (HandleGraphEntityUpdate path, inferred from server logs)
  • Observed: 2026-06-02

Steps to reproduce

  1. Create a source entity (e.g. Universities Act, Document/act).
  2. Create two target entities:
    • Target A: University Grants Commission (organisation)
    • Target B: Commission Meeting (event)
  3. Send one update to the source entity with two relationships, both using key MANDATES and distinct value.id values:
{
  "id": "<source_id>",
  "relationships": [
    {
      "key": "MANDATES",
      "value": {
        "id": "<rel_id_1>",
        "name": "MANDATES",
        "relatedEntityId": "<target_a_id>",
        "startTime": "2026-06-02T00:00:00Z",
        "endTime": ""
      }
    },
    {
      "key": "MANDATES",
      "value": {
        "id": "<rel_id_2>",
        "name": "MANDATES",
        "relatedEntityId": "<target_b_id>",
        "startTime": "2026-06-02T00:00:00Z",
        "endTime": ""
      }
    }
  ]
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions