Reportviews

class nx_arangodb.classes.reportviews.ArangoNodeView(graph)[source]

The ArangoNodeView class is an experimental subclass of the NodeView class.

Contrary to the original NodeView class, the ArangoNodeView is writable to allow for bulk updates to the graph in the DB.

data(data=True, default=None)[source]

Return a read-only view of node data.

Parameters

databool or node data key, default=True

If data=True (the default), return a NodeDataView object that maps each node to all of its attributes. data may also be an arbitrary key, in which case the NodeDataView maps each node to the value for the keyed attribute. In this case, if a node does not have the data attribute, the default value is used.

defaultobject, default=None

The value used when a node does not have a specific attribute.

Returns

NodeDataView

The layout of the returned NodeDataView depends on the value of the data parameter.

Notes

If data=False, returns a NodeView object without data.

See Also

NodeDataView

update(data)[source]

Update a set of nodes within the graph.

The benefit of this method is that it allows for bulk API updates, as opposed to G.add_nodes_from, which currently makes one API request per node.

Example

>>> G = nxadb.Graph(name="MyGraph")
>>> G.nodes.update(
    {
        'node/1': {"node/1", "foo": "bar"},
        'node/2': {"node/2", "foo": "baz"},
        ...
    })
class nx_arangodb.classes.reportviews.ArangoNodeDataView(nodedict, data=False, default=None)[source]

The ArangoNodeDataView class is an experimental subclass of the NodeDataView class.

The main use for this class is to iterate through node-data pairs. The data can be the entire data-dictionary for each node, or it can be a specific attribute (with default) for each node.

In the event that the data is a specific attribute, the data is filtered server-side, instead of in Python. This is done by using the ArangoDB Query Language (AQL) to filter the data.

class nx_arangodb.classes.reportviews.ArangoEdgeView(G)[source]

The ArangoEdgeView class is an experimental subclass of the EdgeView class.

The __len__ method is overridden to count the number of edges in the graph by querying the database, instead of iterating through the edges in Python.

dataview

alias of ArangoEdgeDataView

class nx_arangodb.classes.reportviews.ArangoEdgeDataView(viewer, nbunch=None, data=False, *, default=None)[source]

The ArangoEdgeDataView class is an experimental subclass of the EdgeDataView class.

This view is primarily used to iterate over the edges reporting edges as node-tuples with edge data optionally reported.

In the event that the data is a specific attribute, the data is filtered server-side, instead of in Python. This is done by using the ArangoDB Query Language (AQL) to filter the data.