Paradigm.Graph behaviour (paradigm v0.1.0)

Defines the behaviour for Graph implementations. This decouples operations (conformance, abstraction, transforms) from the underlying graph storage.

Summary

Types

class_id()

@type class_id() :: Paradigm.id()

graph()

@type graph() :: term()

node_id()

@type node_id() :: Paradigm.id()

Callbacks

follow_reference(graph, node_id, any)

@callback follow_reference(graph(), node_id(), any()) :: Node.t() | nil

get_all_classes(graph)

@callback get_all_classes(graph()) :: [class_id()]

get_all_nodes(graph)

@callback get_all_nodes(graph()) :: [node_id()]

get_all_nodes_of_class(graph, arg2)

@callback get_all_nodes_of_class(graph(), class_id() | [class_id()]) :: [node_id()]

get_node(graph, node_id)

@callback get_node(graph(), node_id()) :: Node.t() | nil

get_node_data(graph, node_id, any, any)

@callback get_node_data(graph(), node_id(), any(), any()) :: any()

insert_node(graph, node_id, class_id, map)

@callback insert_node(graph(), node_id(), class_id(), map()) :: graph()

insert_nodes(graph, arg2)

@callback insert_nodes(graph(), map() | list()) :: graph()

new()

@callback new() :: graph()