Skip to content

operations

assemble.network_data

Documentation

Create a 'network_data' instance from one or two tables.

This module needs at least one table as input, providing the edges of the resulting network data set. If no further table is created, basic node information will be automatically created by using unique values from the edges source and target columns.

If no source_column_name (and/or target_column_name) is provided, kiara will try to auto-detect the most likely of the existing columns to use. If that is not possible, an error will be raised.

Inputs
field name type description required default
edges table A table that contains the edges data. yes
source_column string The name of the source column name in the edges table. no
target_column string The name of the target column name in the edges table. no
edges_column_map dict An optional map of original column name to desired. no
nodes table A table that contains the nodes data. no
id_column string The name (before any potential column mapping) of the node-table column that contains the node identifier (used in the edges table). no
label_column string The name of a column that contains the node label (before any potential column name mapping). If not specified, the value of the id value will be used as label. no
nodes_column_map dict An optional map of original column name to desired. no
Outputs
field name type description required default
network_data network_data The network/graph data. yes

create.network_data.from.file

Documentation

Create a table from a file, trying to auto-determine the format of said file.

Supported file formats (at the moment):

  • gml
  • gexf
  • graphml (uses the standard xml library present in Python, which is insecure - see xml for additional information. Only parse GraphML files you trust)
  • pajek
  • leda
  • graph6
  • sparse6
Inputs
field name type description required default
file file The source value (of type 'file'). yes
Outputs
field name type description required default
network_data network_data The result value (of type 'network_data'). yes

export.network_data.as.adjlist_file

Documentation

Export network data as adjacency list file.

Inputs
field name type description required default
network_data network_data A value of type 'network_data'. yes
base_path string The directory to export the file(s) to. no
name string The (base) name of the exported file(s). no
export_metadata boolean Whether to also export the value metadata. no False
Outputs
field name type description required default
export_details dict Details about the exported files/folders. yes

export.network_data.as.edgelist_file

Documentation

Export network data as edgelist file.

Inputs
field name type description required default
network_data network_data A value of type 'network_data'. yes
base_path string The directory to export the file(s) to. no
name string The (base) name of the exported file(s). no
export_metadata boolean Whether to also export the value metadata. no False
Outputs
field name type description required default
export_details dict Details about the exported files/folders. yes

export.network_data.as.gexf_file

Documentation

Export network data as gexf file.

Inputs
field name type description required default
network_data network_data A value of type 'network_data'. yes
base_path string The directory to export the file(s) to. no
name string The (base) name of the exported file(s). no
export_metadata boolean Whether to also export the value metadata. no False
Outputs
field name type description required default
export_details dict Details about the exported files/folders. yes

export.network_data.as.graphml_file

Documentation

Export network data as graphml file.

Inputs
field name type description required default
network_data network_data A value of type 'network_data'. yes
base_path string The directory to export the file(s) to. no
name string The (base) name of the exported file(s). no
export_metadata boolean Whether to also export the value metadata. no False
Outputs
field name type description required default
export_details dict Details about the exported files/folders. yes

export.network_data.as.multiline_adjlist_file

Documentation

Export network data as multiline adjacency list file.

Inputs
field name type description required default
network_data network_data A value of type 'network_data'. yes
base_path string The directory to export the file(s) to. no
name string The (base) name of the exported file(s). no
export_metadata boolean Whether to also export the value metadata. no False
Outputs
field name type description required default
export_details dict Details about the exported files/folders. yes

export.network_data.as.network_text_file

Documentation

Export network data as network text file (with a '.network' extension).

Inputs
field name type description required default
network_data network_data A value of type 'network_data'. yes
base_path string The directory to export the file(s) to. no
name string The (base) name of the exported file(s). no
export_metadata boolean Whether to also export the value metadata. no False
Outputs
field name type description required default
export_details dict Details about the exported files/folders. yes

network_data.extract_components

Documentation

Extract the largest connected component from this network data.

This module analyses network data and checks if it contains clusters, and if so, how many. If all nodes are connected, all nodes will have '0' as value in the component_id field.

Otherwise, the nodes will be assigned 'component_id'-s according to the component they belong to, with the largest component having '0' as component_id, the second largest '1' and so on. If two components have the same size, who gets the higher component_id is not determinate.

Inputs
field name type description required default
network_data network_data The network data to analyze. yes
Outputs
field name type description required default
network_data network_data The network_data, with a new column added to the nodes table, indicating the component the node belongs to. yes
number_of_components integer The number of components in the graph. yes
is_connected boolean Whether the graph is connected or not. yes

network_data.extract_cut_points

Documentation

Create a list of nodes that are cut-points.

Cut-points are any node in a network whose removal disconnects members of the network, creating one or more new distinct components.

Uses the rustworkx.articulation_points function.

Inputs
field name type description required default
network_data network_data The network graph being queried. yes
Outputs
field name type description required default
network_data network_data The network_data, with a new column added to the nodes table, indicating whether the node is a cut-point or not. The column is named 'is_cut_point' and is of type 'boolean'. yes

network_data.redefine_edges

Documentation

Redefine edges by merging duplicate edges and applying aggregation functions to certain edge attributes.

Inputs
field name type description required default
network_data network_data The network data to flatten. yes
attribute_map_strategies kiara_model_list A list of specs on how to map existing attributes onto the target network edge data. no
Outputs
field name type description required default
network_data network_data The network_data, with a new column added to the nodes table, indicating the component the node belongs to. yes

network_data_filter.component

Documentation

Retrieve a single sub-component from a network data object.

Inputs
field name type description required default
value network_data A value of type 'network_data'. yes
component_id string The id of the component to extract. no 0
component_column string The name of the colum that contains the component id. no component_id
Outputs
field name type description required default
value network_data The filtered value. yes