GraphGroup Documentation

execute_procedure

通过bolt执行procedure方法

函数声明

def execute_procedure(self, procedure_name: str, *input_params: Any) -> BoltStatementResult

参数说明

Parameter

Optional

Type

DESC

procedure_name

Y

bool

procedure方法名, 不能为空

input_params

N

Any

入参(需按照procedure方法的参数顺序)。

异常

Type

DESC

ParamException

参数格式不正确。

DatabaseException

数据库内部异常

示例

from graphdbapi.v1.graph import GraphGroup
from contextlib import ExitStack
uri = "bolt://127.0.0.1:7687"
user = "admin"
pwd = "admin"

driver = GraphDb.connect(uri, user, pwd)
with ExitStack() as stack:
    stack.callback(driver.close)
    graph = GraphGroup(driver, "test_01", "test_02", "test_03")
    for _ in graph.execute_procedure("dbms.procedures"):
        print(_)

stop_procedure

停止正在执行的procedure方法

函数声明

def stop_procedure(self, procedure_id: int) ->None

参数说明

Parameter

Optional

Type

DESC

procedure_id

Y

int

在执行的procedure标识

异常

Type

DESC

ParamException

参数格式不正确。

DatabaseException

数据库内部异常

示例

from graphdbapi.v1.graph import GraphGroup
from contextlib import ExitStack
uri = "bolt://127.0.0.1:7687"
user = "admin"
pwd = "admin"

driver = GraphDb.connect(uri, user, pwd)
with ExitStack() as stack:
    stack.callback(driver.close)
    graph = GraphGroup(driver, "test_01", "test_02", "test_03")
    graph.stop_procedure(10)