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.

return_node_list()

Returns the nodes as a list of Node objects.

__init__() โ†’ None[source]#
Return type:

None

add_node_property(
node: Tuple[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

return_node_list() โ†’ List[Node][source]#

Returns the nodes as a list of Node objects.

Each Node object will have its ID, type, and properties populated.

Returns:

A list of Node objects.

Return type:

List[Node]