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 c = run_app(a, b) creates an Operation of type “RunApp” that takes operation a and b as input, and produces c as output.

After the dag has been launched in a session, an Operation can be executed by passing it to graphscope.Session.run.

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

Creates an Operation.




Signature of its parents’ signatures and its own parameters.



Set Operation’s output value.


BuiltIn operations

create_app(graph, app)

Wrapper for create an CREATE_APP Operation with configuration.

create_graph(session_id, graph_type, **kwargs)

Create an CREATE_GRAPH op, add op to default dag.


Create an op to transform a nx.Graph object to 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(graph, app, *args, **kwargs)

Run 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 a simple graph.

project_dynamic_property_graph(graph, …)

Create project graph operation for nx graph.


Unload a loaded app.


Unload a graph.

context_to_numpy(results[, selector, …])

Retrieve results as a numpy ndarray.

context_to_dataframe(results[, selector, …])

Retrieve results as a pandas DataFrame.

to_vineyard_tensor(results[, 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.