MutableNode
Methods
| Method | Description |
|---|
add_metadata | Add metadata to a node in the graph. |
add_updates | Add updates to a node in the graph at a specified time. |
set_node_type | Set the type on the node. This only works if the type has not been previously set, otherwise will |
update_metadata | Update metadata of a node in the graph overwriting existing values. |
Method Details
Signature: add_metadata(metadata)
Add metadata to a node in the graph.
This function is used to add properties to a node that do not
change over time. These properties are fundamental attributes of the node.
Parameters
| Name | Type | Default | Description |
|---|
metadata | PropInput | - | A dictionary of properties to be added to the node. Each key is a string representing the property name, and each value is of type Prop representing the property value. |
Returns
Signature: add_updates(t, properties=None, event_id=None)
Add updates to a node in the graph at a specified time.
This function allows for the addition of property updates to a node within the graph. The updates are time-stamped, meaning they are applied at the specified time.
Parameters
| Name | Type | Default | Description |
|---|
t | TimeInput | - | The timestamp at which the updates should be applied. |
properties | PropInput, optional | None | A dictionary of properties to update. Each key is a string representing the property name, and each value is of type Prop representing the property value. If None, no properties are updated. |
event_id | int, optional | None | The optional integer which will be used as an event id. |
Returns
| Type | Description |
|---|
| None | This function does not return a value, if the operation is successful. |
Raises
| Exception | Description |
|---|
GraphError | If the operation fails. |
Signature: set_node_type(new_type)
Set the type on the node. This only works if the type has not been previously set, otherwise will
throw an error
Parameters
| Name | Type | Default | Description |
|---|
new_type | str | - | The new type to be set |
Returns
Signature: update_metadata(metadata)
Update metadata of a node in the graph overwriting existing values.
This function is used to add properties to a node that do not
change over time. These properties are fundamental attributes of the node.
Parameters
| Name | Type | Default | Description |
|---|
metadata | PropInput | - | A dictionary of properties to be added to the node. Each key is a string representing the property name, and each value is of type Prop representing the property value. |
Returns