Adjacency
- class nx_arangodb.classes.dict.adj.AdjListOuterDict(db: StandardDatabase, graph: Graph, default_node_type: str, read_parallelism: int, read_batch_size: int, edge_type_key: str, edge_type_func: Callable[[str, str], str], graph_type: str, symmetrize_edges_if_directed: bool, *args: Any, **kwargs: Any)[source]
The 1st level of the dict of dict (of dict) of dict representing the Adjacency List of a graph.
AdjListOuterDict is keyed by the node ID of the source node.
Parameters
- dbarango.database.StandardDatabase
The ArangoDB database.
- grapharango.graph.Graph
The ArangoDB graph.
- default_node_typestr
The default node type.
- edge_type_keystr
The key used to store the edge type in the edge attribute dictionary.
- edge_type_funcCallable[[str, str], str]
The function to generate the edge type from the source and destination node types.
- graph_typestr
The type of graph (e.g. ‘Graph’, ‘DiGraph’, ‘MultiGraph’, ‘MultiDiGraph’).
- symmetrize_edges_if_directedbool
Whether to add the reverse edge if the graph is directed.
- read_parallelismint
The number of parallel threads to use for reading data in _fetch_all.
- read_batch_sizeint
The number of documents to read in each batch in _fetch_all.
Example
>>> g = nxadb.Graph(name="MyGraph") >>> g.add_edge("node/1", "node/2", foo="bar") >>> g._adj AdjListOuterDict('MyGraph')
- class nx_arangodb.classes.dict.adj.AdjListInnerDict(db: StandardDatabase, graph: Graph, default_node_type: str, edge_type_key: str, edge_type_func: Callable[[str, str], str], graph_type: str, adjlist_outer_dict: AdjListOuterDict | None, *args: Any, **kwargs: Any)[source]
The 2nd level of the dict of dict (of dict) of dict structure representing the Adjacency List of a graph.
AdjListInnerDict is keyed by the node ID of the destination node.
Parameters
- dbarango.database.StandardDatabase
The ArangoDB database.
- grapharango.graph.Graph
The ArangoDB graph.
- default_node_typestr
The default node type.
- edge_type_keystr
The key used to store the edge type in the edge attribute dictionary.
- edge_type_funcCallable[[str, str], str]
The function to generate the edge type from the source and destination node types.
- graph_typestr
The type of graph (e.g. ‘Graph’, ‘DiGraph’, ‘MultiGraph’, ‘MultiDiGraph’).
- adjlist_outer_dictAdjListOuterDict | None
The parent AdjListOuterDict.
Examples
>>> g = nxadb.Graph(name="MyGraph") >>> g.add_edge("node/1", "node/2", foo="bar") >>> g['node/1'] AdjListInnerDict('node/1')
- class nx_arangodb.classes.dict.adj.EdgeKeyDict(db: StandardDatabase, graph: Graph, edge_type_key: str, edge_type_func: Callable[[str, str], str], is_directed: bool, adjlist_inner_dict: AdjListInnerDict | None = None, *args: Any, **kwargs: Any)[source]
The (optional) 3rd level of the dict of dict (of dict) of dict structure representing the Adjacency List of a MultiGraph.
EdgeKeyDict is keyed by ArangoDB Edge IDs.
Unique to MultiGraphs, edges are keyed by ArangoDB Edge IDs, allowing for multiple edges between the same nodes. Alternatively, if an Edge is already fetched, then it can also be keyed by a numerical index. However, this is not recommended because consistent ordering of edges is not guaranteed.
ASSUMPTIONS (for now): - keys must be ArangoDB Edge IDs - key-to-edge mapping is 1-to-1
Parameters
- dbarango.database.StandardDatabase
The ArangoDB database.
- grapharango.graph.Graph
The ArangoDB graph.
- edge_type_keystr
The key used to store the edge type in the edge attribute dictionary.
- edge_type_funcCallable[[str, str], str]
The function to generate the edge type from the source and destination node types.
- is_directedbool
Whether the graph is directed or not.
- adjlist_inner_dictAdjListInnerDict | None
The parent AdjListInnerDict.
Examples
>>> g = nxadb.MultiGraph(name="MyGraph") >>> edge_id = g.add_edge("node/1", "node/2", foo="bar") >>> g["node/1"]["node/2"][edge_id] EdgeAttrDict({'foo': 'bar', '_key': ..., '_id': ...})
- class nx_arangodb.classes.dict.adj.EdgeAttrDict(db: StandardDatabase, graph: Graph, *args: Any, **kwargs: Any)[source]
The innermost-level of the dict of dict (of dict) of dict structure representing the Adjacency List of a graph.
EdgeAttrDict is keyed by the edge attribute key.
Parameters
- dbarango.database.StandardDatabase
The ArangoDB database.
- grapharango.graph.Graph
The ArangoDB graph.
Examples
>>> g = nxadb.Graph(name="MyGraph") >>> g.add_edge("node/1", "node/2", foo="bar") >>> g["node/1"]["node/2"] EdgeAttrDict({'foo': 'bar', '_key': ..., '_id': ...})