/get/graph/entities

URL: http://<db.host>:<db.port>/get/graph/entities

Retrieves node or edge entities from an existing graph, with pagination support via offset and limit. Use /show/graph to obtain the total number of nodes and edges.

Input Parameter Description

NameTypeDescription
graph_namestringName of the graph from which to retrieve entities.
offsetlongStarting index of the entities to retrieve (0-based). The default value is 0.
limitlongNumber of entities to retrieve starting from input parameter offset. A value of -1 returns all entities from the offset to the end. Note: the output parameter entities_int or output parameter entities_string array size will be 2x this value for nodes (stride 2) or 4x for edges (stride 4). The default value is 10000.
optionsmap of string to strings

Optional parameters. The default value is an empty map ( {} ).

Supported Parameters (keys)Parameter Description
entity_type

The type of entity to retrieve. The default value is edge.

Supported ValuesDescription
edgeRetrieve edge entities (default).
nodeRetrieve node entities.
server_idIndicates which graph server to send the request to. Required when the graph is distributed across multiple servers. The default value is '0'.

Output Parameter Description

The GPUdb server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query. Here is a description of the various fields of the wrapper:

NameTypeDescription
statusString'OK' or 'ERROR'
messageStringEmpty if success or an error message
data_typeString'get_graph_entities_response' or 'none' in case of an error
dataStringEmpty string
data_strJSON or String

This embedded JSON represents the result of the /get/graph/entities endpoint:

NameTypeDescription
resultbooleanIndicates a successful retrieval.
entities_intarray of longsFlat array of entity data for integer-identifier graphs with a repeating stride. For node entities (stride 2): [node_id, label_index, ...]. For edge entities (stride 4): [edge_id, node1_id, node2_id, label_index, ...]. Populated when the graph uses integer identifiers; empty otherwise. The label_index is a 1-based index into the output parameter labels array; 0 indicates no label.
entities_stringarray of stringsFlat array of entity data for name-identifier or WKT-identifier (geo/XY) graphs with a repeating stride. For node entities (stride 2): [node_name, label_index, ...] or [wkt_point, label_index, ...]. For edge entities (stride 4): [edge_id, node1_name, node2_name, label_index, ...] or [edge_id, node1_wkt, node2_wkt, label_index, ...]. Populated when the graph uses string/name identifiers or geo/XY coordinate identifiers; empty otherwise. For geo/XY graphs, node identifiers are formatted as 'POINT(x y)' WKT strings. The label_index is a string representation of a 1-based index into the output parameter labels array; '0' indicates no label.
labelsarray of stringsArray of distinct label strings. The label_index values in output parameter entities_int or output parameter entities_string are 1-based indexes into this array; index 0 means no label.
infomap of string to stringsAdditional information map. Contains the following keys: 'identifier_type' — set to 'int' (integer node IDs in output parameter entities_int), 'string' (name-based node IDs in output parameter entities_string), or 'wkt' (geo/XY graph with 'POINT(x y)' node identifiers in output parameter entities_string). 'total_count' — total number of live (non-deleted) entities available in the graph for the requested entity_type, used for pagination. 'status_message' — set to 'Cancelled' if the request was cancelled mid-iteration (with output parameter result set to false).

Empty string in case of an error.