Skip to content

Core

Graph analytics executor and data types.

Bundle dataclass ¤

A collection of DataFrames and other data.

Can efficiently represent a knowledge graph (homogeneous or heterogeneous) or tabular data.

By convention, if it contains a single DataFrame, it is called df. If it contains a homogeneous graph, it is represented as two DataFrames called nodes and edges.

ATTRIBUTE DESCRIPTION
dfs

Named DataFrames.

TYPE: dict[str, DataFrame]

relations

Metadata that describes the roles of each DataFrame. Can be empty, if the bundle is just one or more DataFrames.

TYPE: list[RelationDefinition]

other

Other data, such as a trained model.

TYPE: dict[str, Any]

copy ¤

copy()

Returns a shallow copy of the bundle. The Bundle and its containers are new, but the DataFrames and RelationDefinitions are shared. (The contents of other are also shared.)

metadata ¤

metadata()

JSON-serializable information about the bundle, metadata only.

to_dict ¤

to_dict(limit: int = 100)

JSON-serializable representation of the bundle, including some data.

RelationDefinition dataclass ¤

Defines a set of edges.

ATTRIBUTE DESCRIPTION
df

The name of the DataFrame that contains the edges.

TYPE: str

source_column

The column in the edge DataFrame that contains the source node ID.

TYPE: str

target_column

The column in the edge DataFrame that contains the target node ID.

TYPE: str

source_table

The name of the DataFrame that contains the source nodes.

TYPE: str

target_table

The name of the DataFrame that contains the target nodes.

TYPE: str

source_key

The column in the source table that contains the node ID.

TYPE: str

target_key

The column in the target table that contains the node ID.

TYPE: str

name

Descriptive name for the relation.

TYPE: str | None

df_for_frontend ¤

df_for_frontend(df: DataFrame, limit: int) -> DataFrame

Returns a DataFrame with values that are safe to send to the frontend.

disambiguate_edges ¤

disambiguate_edges(ws: Workspace)

If an input plug is connected to multiple edges, keep only the last edge.

nx_node_attribute_func ¤

nx_node_attribute_func(name)

Decorator for wrapping a function that adds a NetworkX node attribute.