kg_topology_toolbox.utils

Utility functions

Functions

aggregate_by_relation(edge_topology_df)

Aggregate topology metrics of all triples of the same relation type.

check_kg_df_structure(kg_df, h, r, t)

Utility to perform sanity checks on the structure of the provided DataFrame, to ensure that it encodes a Knowledge Graph in a compatible way.

composition_count(df, chunk_size, workers[, ...])

Compute composition count of a graph.

jaccard_similarity(entities_1, entities_2)

Jaccard Similarity function for two sets of entities.

node_degrees_and_rels(df, column, n_entity, ...)

Aggregate edges by head/tail node and compute associated statistics.