Node Class API Reference¶
A node in the database. It has a base type, ID, and properties from base type (and it's parent type recursively).
Node class is designed to be instanced by an engine:
Attributes:
-
type_name(str) –Name of base
NodeType. -
id(str) –The unique identifier of node.
Note
idis designed to be persistent and unique across database, you can set in manually or withuuid. Changing ID of a node breaks its references.Tip
Nodes are hashable and comparable by ID, so nodes with same ID is equal in
==operator and will replace each other if added in the same engine. -
values(dict[str, Any]) –A dictionary holding field values. Use
set()andget()methods to use it.Tip
Values can be accessed with
node["field_name"]too. -
type_ref(NodeType | None) –Reference to
NodeType.
Methods: