Paradigm.Graph protocol (paradigm v0.3.0)

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

Summary

Types

t()

All the types that implement this protocol.

Types

class_id()

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

node_id()

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

t()

@type t() :: term()

All the types that implement this protocol.

Functions

follow_reference(graph, node_id, reference)

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

get_all_classes(graph)

@spec get_all_classes(t()) :: [class_id()]

get_all_nodes(graph)

@spec get_all_nodes(t()) :: [node_id()]

get_all_nodes_of_class(graph, class_id)

@spec get_all_nodes_of_class(t(), class_id() | [class_id()]) :: [node_id()]

get_content_hash(graph)

@spec get_content_hash(t()) :: String.t() | nil

get_description(graph)

@spec get_description(t()) :: String.t() | nil

get_name(graph)

@spec get_name(t()) :: String.t() | nil

get_node(graph, node_id)

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

insert_node(graph, node)

@spec insert_node(t(), Paradigm.Graph.Node.t()) :: t()

insert_nodes(graph, nodes)

@spec insert_nodes(t(), [Paradigm.Graph.Node.t()]) :: t()

stream_all_nodes(graph)

@spec stream_all_nodes(t()) :: Enumerable.t(Node.t())