query_graph
- query_graph(
graph_name: string,
queries: string[],
restrictions?: string[],
adjacency_table?: string,
rings?: number,
options?: Record<string, string>,
callback?: GPUdbCallback,
): Promise<QueryGraphResponse>Parameters
- graph_name: string
Name of the graph resource to query.
- queries: string[]
Nodes or edges to be queried specified using query identifiers. Identifiers can be used with existing column names, e.g., ‘table.column AS QUERY_NODE_ID’, raw values, e.g., ‘0, 2 AS QUERY_NODE_ID’, or expressions, e.g., ‘ST_MAKEPOINT(table.x, table.y) AS QUERY_NODE_WKTPOINT’. Multiple values can be provided as long as the same identifier is used for all values. If using raw values in an identifier combination, the number of values specified must match across the combination.
Optionalrestrictions: string[]Additional restrictions to apply to the nodes/edges of an existing graph. Restrictions must be specified using identifiers; identifiers are grouped as combinations. Identifiers can be used with existing column names, e.g., ‘table.column AS RESTRICTIONS_EDGE_ID’, expressions, e.g., ‘column/2 AS RESTRICTIONS_VALUECOMPARED’, or raw values, e.g., ‘0, 0, 0, 1 AS RESTRICTIONS_ONOFFCOMPARED’. If using raw values in an identifier combination, the number of values specified must match across the combination.
Optionaladjacency_table: stringName of the table to store the resulting adjacencies, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria. If left blank, the query results are instead returned in the response. If the ‘QUERY_TARGET_NODE_LABEL’ query identifier is used in
queries, then two additional columns will be available: ‘PATH_ID’ and ‘RING_ID’. See Using Labels for more information.Optionalrings: numberSets the number of rings around the node to query for adjacency, with ‘1’ being the edges directly attached to the queried node. Also known as number of hops. For example, if it is set to ‘2’, the edge(s) directly attached to the queried node(s) will be returned; in addition, the edge(s) attached to the node(s) attached to the initial ring of edge(s) surrounding the queried node(s) will be returned. If the value is set to ‘0’, any nodes that meet the criteria in
queriesandrestrictionswill be returned. This parameter is only applicable when querying nodes.Optionaloptions: Record<string, string>Additional parameters.
Optionalcallback: GPUdbCallbackOptional callback function
Returns Promise<QueryGraphResponse>
Promise<Types.QueryGraphResponse> - Promise resolving to the response
- Defined in src/GPUdb.ts:12147
- graph_name: string
query_graph_request
- query_graph_request(
request: QueryGraphRequest,
callback?: GPUdbCallback,
): Promise<QueryGraphResponse>Employs a topological query on a graph generated a-priori by
create_graphand returns a list of adjacent edge(s) or node(s), also known as an adjacency list, depending on what’s been provided to the endpoint; providing edges will return nodes and providing nodes will return edges.To determine the node(s) or edge(s) adjacent to a value from a given column, provide a list of values to
queries. This field can be populated with column values from any table as long as the type is supported by the given identifier. See Query Identifiers for more information.To return the adjacency list in the response, leave
adjacency_tableempty.IMPORTANT: It’s highly recommended that you review the Graphs and Solvers concepts documentation, the Graph REST Tutorial, and/or some /match/graph examples before using this endpoint.
Parameters
- request: QueryGraphRequest
Request object containing the parameters for the operation
Optionalcallback: GPUdbCallbackOptional callback function
Returns Promise<QueryGraphResponse>
Promise<Types.QueryGraphResponse> - Promise resolving to the response
- Defined in src/GPUdb.ts:12099
- request: QueryGraphRequest
Employs a topological query on a graph generated a-priori by
create_graphand returns a list of adjacent edge(s) or node(s), also known as an adjacency list, depending on what’s been provided to the endpoint; providing edges will return nodes and providing nodes will return edges.To determine the node(s) or edge(s) adjacent to a value from a given column, provide a list of values to
queries. This field can be populated with column values from any table as long as the type is supported by the given identifier. See Query Identifiers for more information.To return the adjacency list in the response, leave
adjacency_tableempty.IMPORTANT: It’s highly recommended that you review the Graphs and Solvers concepts documentation, the Graph REST Tutorial, and/or some /match/graph examples before using this endpoint.