Overview
The CALL
statement can invoke a system-defined procedure. Ultipa provides a range of built-in procedures for tasks such as managing graph projections, running algorithms, and more.
<call procedure statement> ::=
"CALL" <procedure reference> [ <yield clause> ]
Details
- The
YIELD
clause can be used to select and rename columns from the binding table produced by the procedure (if applicable), making them available for use and reference in subsequent parts of the query.
HDC Projection Procedures
An HDC projection resides in the memory of a HDC (High-Density Computing) server, containing either full or partial data from a graphset loaded from the physical storage of shard servers. Learn more about each procedure mentioned below, see HDC Projections.
Showing HDC Projections
The hdc.graph.show()
procedure retrieves information about HDC projections of the current graphset.
To retrieve all HDC projections:
CALL hdc.graph.show()
To retrieve the HDC projection named hdcGraph_1
:
CALL hdc.graph.show("hdcGraph_1")
Creating an HDC Projection
The hdc.graph.create()
procedure creates an in-memory projection of the current graphset to an HDC server.
To project the entire current graphset to hdc-server-1
as hdcGraph
:
CALL hdc.graph.create("hdc-server-1", "hdcGraph", {
nodes: {"*": ["*"]},
edges: {"*": ["*"]},
direction: "undirected",
load_id: true,
update: "static",
query: "query",
default: true
})
Dropping an HDC Projection
The hdc.graph.drop()
procedure drops any HDC projection of the current graphset from the HDC server.
To delete the HDC projection named hdcGraph_1
:
CALL hdc.graph.drop("hdcGraph_1")
Executing Algorithms
The algo.<algoName>()
procedure runs algorithms on an HDC projection in return modes. The algo.<algoName>.write()
procedure runs algorithms on an HDC projection in writeback modes.
To run the Louvain algorithm on hdcGraph
and return the results:
CALL algo.louvain("hdcGraph", {
params: {
phase1_loop_num: 6,
min_modularity_increase: 0.5
},
return_params: {
type: "stream"
}
}) YIELD r
RETURN r
To run the Degree Centrality algorithm on hdcGraph
and write the results to a file:
CALL algo.degree.write("hdcGraph", {
params: {
order: "desc"
},
return_params: {
file: {
filename: "degree.txt"
}
}
})
Job Procedures
Certain GQL queries, such as projection creation and algorithm writeback, are designed to run as back-end jobs. The results of some jobs, such as files generated by algorithms, are stored in the graphsets on which they are executed and can be retrieved later, unless cleared.
Showing Jobs
The procedure job.show()
retrieves information about jobs in the current graphset.
To retrieve all jobs:
CALL job.show()
To retrieve the job with id 83
:
CALL job.show(83)