matgraphdb.core.graph_db.GraphDB

class GraphDB(storage_path: str, load_custom_stores: bool = True)

A manager for a graph storing multiple node types and edge types. Each node type and edge type is backed by a separate ParquetDB instance (wrapped by NodeStore or EdgeStore).

__init__(storage_path: str, load_custom_stores: bool = True)
Parameters:

storage_path (str) – The root path for this graph, e.g. ‘/path/to/my_graph’. Subdirectories ‘nodes/’ and ‘edges/’ will be used.

Methods

__init__(storage_path[, load_custom_stores])

add_edge_generator(generator_func[, ...])

Register a user-defined callable that can read from node stores, and then create or update edges as it sees fit.

add_edge_store(edge_store)

add_edge_type(edge_type)

Create (or load) an EdgeStore for the specified edge_type.

add_edges(edge_type, data, **kwargs)

add_generator_dependency(generator_name[, ...])

Add dependencies for a generator.

add_node_generator(generator_func[, ...])

add_node_store(node_store[, overwrite, ...])

add_node_type(node_type)

Create (or load) a NodeStore for the specified node_type.

add_nodes(node_type, data, **kwargs)

construct_table(data[, schema, metadata, ...])

delete_edges(edge_type[, ids, columns])

delete_nodes(node_type[, ids, columns])

edge_exists(edge_type)

edge_is_empty(edge_type)

generator_consistency_check()

get_edge_store(edge_type)

get_generator_dependency_graph(generator_name)

get_generator_type(generator_name)

get_node_store(node_type)

get_nodes(node_type[, ids, columns])

list_edge_types()

list_node_types()

node_exists(node_type)

node_is_empty(node_type)

normalize_all_edges(normalize_kwargs)

normalize_all_nodes(normalize_kwargs)

normalize_edges(edge_type)

normalize_nodes(node_type[, normalize_kwargs])

read_edges(edge_type[, ids, columns])

read_nodes(node_type[, ids, columns])

remove_edge_store(edge_type)

remove_edge_type(edge_type)

remove_node_store(node_type)

remove_node_type(node_type)

run_edge_generator(generator_name[, ...])

run_node_generator(generator_name[, ...])

Execute a previously registered custom node-generation function by name. :Parameters: * generator_name (str) -- The unique name used when registering the function. * generator_args (Dict) -- Additional arguments passed to the generator function. * generator_kwargs (Dict) -- Additional keyword arguments passed to the generator function.

summary([show_column_names])

update_edges(edge_type, data, **kwargs)

update_nodes(node_type, data, **kwargs)

Attributes

n_edge_types

n_edges_per_type

n_node_types

n_nodes_per_type