langchain_experimental.graph_transformers.diffbot
.NodesList¶
- class langchain_experimental.graph_transformers.diffbot.NodesList[source]¶
List of nodes with associated properties.
- nodes¶
Stores nodes as keys and their properties as values. Each key is a tuple where the first element is the node ID and the second is the node type.
- Type
Dict[Tuple, Any]
Methods
__init__
()add_node_property
(node, properties)Adds or updates node properties.
Returns the nodes as a list of Node objects.
- add_node_property(node: Tuple[Union[str, int], str], properties: Dict[str, Any]) None [source]¶
Adds or updates node properties.
If the node does not exist in the list, it’s added along with its properties. If the node already exists, its properties are updated with the new values.
- Parameters
node (Tuple) – A tuple containing the node ID and node type.
properties (Dict) – A dictionary of properties to add or update for the node.
- Return type
None