Operation

Operation object

class graphscope.framework.operation.Operation(session_id, op_type, inputs=None, output_types=None, config=None, query_args=None)[source]

Represents a dag op that performs computation on tensors.

For example g2 = g1.add_vertices("path") create an Operation of type “ADD_LABELS” that takes operation of g1 as input, and produces a graph dag node g2 which contains this operation as output.

After the dag has been launched in a session, an Operation can be executed by :code`op.eval()` or passing it to session.run.

Operation.__init__(session_id, op_type[, …])

Creates an graphscope.framework.operation.Operation.

Operation.as_op_def()

Operation.key

Unique key for each op_def_pb2.OpDef

Operation.signature

Signature of its parents’ signatures and its own parameters.

Operation.eval([leaf])

Evaluate by sess.run.

Operation.evaluated

BuiltIn operations

create_app(app_assets)

Wrapper for create an CREATE_APP Operation with configuration.

create_graph(session_id, graph_type[, inputs])

Create an CREATE_GRAPH op, add op to default dag.

dynamic_to_arrow(graph)

Create an op to transform a nx.Graph object to Graph.

arrow_to_dynamic(graph)

Transform a Graph object to nx.Graph.

modify_edges(graph, modify_type, edges)

Create modify edges operation for nx graph.

modify_vertices(graph, modify_type, vertices)

Create modify vertices operation for nx graph.

run_app(app, *args, **kwargs)

Run bound app on the graph.

report_graph(graph, report_type[, node, …])

Create report operation for nx graph.

project_arrow_property_graph(graph, …)

project_arrow_property_graph_to_simple(graph)

Project arrow property graph to a simple graph.

project_dynamic_property_graph(graph, …)

Create project graph operation for nx graph.

unload_app(app)

Unload a loaded app.

unload_graph(graph)

Unload a graph.

context_to_numpy(context[, selector, …])

Retrieve results as a numpy ndarray.

context_to_dataframe(context[, selector, …])

Retrieve results as a pandas DataFrame.

to_vineyard_tensor(context[, selector, …])

Retrieve results as vineyard tensor.

add_column(graph, results, selector)

Add a column to graph, produce a new graph.

graph_to_numpy(graph[, selector, vertex_range])

Retrieve graph raw data as a numpy ndarray.

graph_to_dataframe(graph[, selector, …])

Retrieve graph raw data as a pandas DataFrame.