Graph Databases

Audit identity before installing the constraint

The only usable ID is unique

The import has duplicate P7 nodes and records without usable IDs. A uniqueness-only report would miss the second problem.

BOTIE

The IDs are the string P1, the number 7 and null. There is no repeated usable string ID. Can a duplicate report alone certify usable keys for the whole batch?
The inputs we are comparing

Unvalidated imported node records

Duplicate and absent keys occur together

[
  {
    "id": "P7",
    "kind": "Asset"
  },
  {
    "id": "P7",
    "kind": "Asset"
  },
  {
    "kind": "Asset"
  },
  {
    "id": "",
    "kind": "Asset"
  },
  {
    "id": "P8",
    "kind": "Asset"
  }
]

Uniqueness passes while presence fails

[
  {
    "id": "P1"
  },
  {
    "id": 7
  },
  {
    "id": null
  }
]
Result for duplicate and absent keys occur together
[
  [
    "P7"
  ],
  2
]
Choose an explanation to test
A duplicate key appears more than twice

This check uses the pieces from “Collect the two independent key checks”.

BOTIE

The unvalidated batch repeats A9 three times and __proto__ twice. It also contains a NULL ID, a numeric ID and a record without an ID. Predict the sorted duplicate list and the count of unusable IDs.
Unvalidated imported node records
[
  {
    "id": "A9"
  },
  {
    "id": "__proto__"
  },
  {
    "id": "A9"
  },
  {
    "id": null
  },
  {
    "id": 0
  },
  {},
  {
    "id": "__proto__"
  },
  {
    "id": "A9"
  },
  {
    "id": "B1"
  }
]

Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.

Build a construction in the workspace above first. This case will test those pieces.

What must happen to existing duplicates before installing a matching uniqueness constraint?

Validation reports guide reconciliation; database constraints enforce the supported invariant for future writes.

These components operate on the supplied records in your browser. They do not run a graph database or interpret Cypher.

Work through the Python challenges →
Continue the courseThe Graph Changed While the Approval Was Waiting →
← The Route with Fewer Stops Takes Longer