Deletion

Node, Link, and Network elements are all inherently immutable objects. When updates occur, new revisions of those objects are created. The same is true when deletion occurs. In this way, elements that reference other elements can be made immune to the effects of deletion if they use specific revisions in their references.

Deleting any element has no effect on any existing revisions of itself. Instead, deletion is treated like a special update. A new revision of the element will be created, and this change is only observable via dependent elements if the referencing element holds a reference to the latest revision of the deleted element.

The below examples illustrate this.

Note

Elements may not be updated once they are deleted.

API Examples

Delete

The Node below is deleted and the new revision is returned.

Note

Providing a specific revision for any element to be deleted is optional and has no effect on the outcome.

{
  "id": 1,
  "revision": 1
  "properties": {
    "description": "Node to delete"
  }
}

Request

DeleteNode({
  "id": 1
  "revision": 1
})

Response

{
    "id": 1,
    "revision": 2
}

Deletion of Deleted Element

Request

DeleteNode({
  "id": 1
  "revision": 2
})

Response

Node not found for element ID 1

Immutability of elements

Deletion has no effect on revisions of elements prior to delete. If a Link references two Nodes explicitly prior to deletion of one of the Nodes, no changes are visible to the Link or to the previous revisions of the Nodes.

Existing elements:

Node
{
  "id": 10,
  "revision": 10,
  "properties": {
    "description": "Node 1"
  }
}

Node
{
  "id": 20,
  "revision": 20,
  "properties": {
    "description": "Node 2"
  }
}

A link is created referencing specific revisions of the above Nodes.

Request

CreateLink(
  properties={
    "description": "Link 1"
  },
  source={
    "id": 10,
    "revision": 10
  },
  destination={
    "id": 20,
    "revision": 20
  }
)

Response

{
  "id": 30,
  "revision": 30
}

After deleting either or both Nodes, the Link is unchanged, because it references specific revisions of its source and destination Nodes.

Request

ReadLink(reference={"id": 30})

Response

{
  "id": 30,
  "revision": 30
  "source": {
    "id": 10,
    "revision": 10
  },
  "destination": {
    "id": 20,
    "revision": 20
  }
}