Other clauses
GQL also offers other clauses such as YIELD, AT SCHEMA, and USE GRAPH.
The YIELD clause
The YIELD clause is instrumental for selecting and renaming variables from the current working table. It specifies which variables are available for subsequent statements. The YIELD clause can be utilized with either CALL named procedure statements or MATCH statements.
To select only the g variable from the working table containing p and g, use the following:
GQL:
MATCH p=(g:Lang) YIELDRETURN g g
You can select results from a named procedure as follows (this query needs the support of HDC services – you will explore how to use HDC services in Chapter 7):
GQL:
CALL hdc.algo.degree("gql_g1",{
params: {}
}) YIELD results
RETURN results
This query calls a procedure provided by GQL Playground. The procedure is a graph algorithm that calculates degree centrality for nodes in the "gql_g1" graph using default parameters. The result...