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 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.

Operation.as_op_def()

Operation.key

Operation.signature

Signature of its parents’ signatures and its own parameters.

Operation.eval()

Operation.set_output(output)

Set Operation’s output value.

Operation.evaluated

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.

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(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_app(app)

Unload a loaded app.

unload_graph(graph)

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.