How to call procedures
You can use the methods call()
and yield_()
to construct queries that will
call procedure and return results from them.
call(procedure: str, arguments: Optional[str] = None)
- Call the procedureprocedure
with the argumentsarguments
.yield_(results: Optional[Dict[str, str]])
- Yield results from a procedure with aliases formatted askey AS value
.
Call procedure with no arguments
To call a procedure with no arguments, don't specify the arguments in the
call()
method:
- GQLAlchemy
- Cypher
from gqlalchemy import Call
query = Call("pagerank.get").yield_().return_().execute()
CALL pagerank.get() YIELD * RETURN *;
Call procedure with arguments
To call a procedure with arguments, specify the arguments as a string in the
call()
method:
- GQLAlchemy
- Cypher
from gqlalchemy import Call
query = Call("json_util.load_from_url", "https://some-url.com")
.yield_(results="objects")
.return_(results="objects")
.execute()
CALL json_util.load_from_url("https://some-url.com") YIELD objects RETURN objects;