QueryDataAnalysisGraph
Queries the data analytics graph. If the operation parameter is not specified, the full graph is returned based on the data source. If the operation parameter is specified, the corresponding incremental graph operation is executed, such as business domain query, node expansion, search, and data source directory.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
odps:QueryDataAnalysisGraph |
create |
*All Resource
|
None | None |
Request syntax
POST /api/v1/ai/data-graphs/global-graph HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The graph query request body. If the operation parameter is not specified, the request is processed as a full graph query, and datasourceId is required. If the operation parameter is specified, the request is processed as an incremental graph operation. For the applicable operations of each parameter, see the field descriptions. |
|
| datasourceId |
string |
No |
The data source ID. The value must be 1 to 256 characters in length. This parameter is required for full graph queries. For incremental operations, only the global and datasources operations support this parameter. |
ds-01J5ZKQ8M7N2P4R6 |
| operation |
string |
No |
The type of the incremental graph operation. Valid values: global (global graph), domain (business domain graph), expandNode (expand node), expandLayer (expand by layer), search (search node), searchSubgraph (search subgraph), node (node details), crossGraph (cross-graph association), edge (edge details), schema (graph schema), domains (business domain list), and datasources (data source directory). If this parameter is not specified, the request is processed as a full graph query. |
search |
| view |
string |
No |
The visible scope of the graph. Valid values: global (global view, default value) and own (graph visible only to the current account). |
global |
| key |
string |
No |
The node key. The value can be up to 2,000 characters in length. This parameter is required for the node, crossGraph, expandNode, and expandLayer operations. |
metadata/odps_project/sales_orders |
| domain |
string |
No |
The business domain name. The value can be up to 500 characters in length. This parameter is required for the domain operation. |
Sales domain |
| query |
string |
No |
The search keyword. The value can be up to 500 characters in length. This parameter is required for the search and searchSubgraph operations. |
Sales order |
| direction |
string |
No |
The expansion direction. Valid values: in (inbound edge), out (outbound edge, default value), up (upward), and down (downward). This parameter is used for the expandLayer operation. |
out |
| sourceKey |
string |
No |
The source node key of the edge. The value can be up to 2,000 characters in length. This parameter is required for the edge operation. |
metadata/odps_project/sales_orders |
| targetKey |
string |
No |
The target node key of the edge. The value can be up to 2,000 characters in length. This parameter is required for the edge operation. |
metadata/odps_project/customers |
| relationType |
string |
No |
The relationship type. The value can be up to 128 characters in length. It must start with a letter and can contain letters, digits, and underscores. This parameter is required for the edge operation. |
REFERENCES |
| page |
integer |
No |
The page number. Valid values: 1 to 10000. Default value: 1. This parameter is used for the datasources operation. |
1 |
| size |
integer |
No |
The number of entries per page. Valid values: 1 to 1000. Default value: 100. This parameter is used for the datasources operation. |
100 |
| datasourceName |
string |
No |
The data source name filter. The value can be up to 500 characters in length. This parameter is used for the datasources operation. |
Sales data source |
| datasourceType |
string |
No |
The data source type filter. The value can be up to 128 characters in length. This parameter is used for the datasources operation. |
maxcompute |
| limit |
integer |
No |
The maximum number of entries to return. Valid values: 1 to 2000. The limit varies by operation: the maximum value for the search operation is 100 (default value: 100), the maximum value for the searchSubgraph operation is 200 (default value: 100), the maximum value for the crossGraph operation is 500 (default value: 500), and the default value for the expandNode and expandLayer operations is 500. |
100 |
| zone |
string |
No |
The partition filter. Valid values: metadata (metadata), trace (trace), and knowledge (knowledge). This parameter is used for the expandNode operation. |
metadata |
| label |
string |
No |
The node label filter. The value must be 1 to 128 characters in length. This parameter is used for the expandNode operation. |
table |
| scope |
array |
No |
The search partition scope. Valid values: metadata (metadata), trace (trace), and knowledge (knowledge). You can specify up to three items. This parameter is used for the searchSubgraph operation. If this parameter is not specified, all partitions are used by default for the own view, and the metadata partition is used by default for the global view. |
|
|
string |
No |
The partition name. Valid values: metadata, trace, and knowledge. |
metadata |
|
| matchMode |
string |
No |
The match mode. Valid values: exact (exact match, default value) and fuzzy (fuzzy match). This parameter is used for the searchSubgraph operation. |
exact |
| hops |
integer |
No |
The number of hops for subgraph expansion. Valid values: 1 to 3. Default value: 1. This parameter is used for the searchSubgraph operation. |
1 |
| usageFilter |
boolean |
No |
Specifies whether to enable usage filtering. Valid values: true and false. This parameter is used for the global operation. |
|
| maxNodes |
integer |
No |
The maximum number of nodes to return. Valid values: 1 to 50000. The default value for full graph queries is 800. For the domain operation, the maximum value is 2000, and the default value is 1000. |
800 |
| maxEdges |
integer |
No |
The maximum number of edges to return. Valid values: 1 to 20000. The default value for full graph queries is 3000. |
3000 |
| domainRootsOnly |
boolean |
No |
Specifies whether to return only the root nodes of the business domain. Valid values: true and false. The default value for full graph queries is false. |
|
| skeleton |
boolean |
No |
Specifies whether to return only the skeleton graph. Valid values: true and false. The default value for full graph queries is false. |
|
| zoneMode |
string |
No |
The partition mode. Valid values: all (all partitions, default value), metadata (metadata), trace (trace), and knowledge (knowledge). This parameter is used for full graph queries and the global operation. |
all |
| taskRoots |
boolean |
No |
Specifies whether to return the task root nodes. Valid values: true and false. The default value for full graph queries is true. |
|
| maxTaskRoots |
integer |
No |
The maximum number of task root nodes. Valid values: 0 to 200. Default value: 40. |
40 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| requestId |
string |
The request ID. This ID uniquely identifies the request and can be used for troubleshooting and log association. |
A3F5B7C9-1D2E-4F6A-8B9C-0D1E2F3A4B5C |
| httpCode |
integer |
The business status code. This field is not returned if the call is successful. If the call fails, the corresponding HTTP error code is returned, such as 400, 403, 404, or 500. |
400 |
| errorCode |
string |
The error code. This field is not returned if the call is successful. If the call fails, a specific error code is returned to help identify the cause of the error. |
InvalidParameter |
| errorMsg |
string |
The error message. This field is not returned if the call is successful. If the call fails, a readable error description is returned. |
The specified parameter is invalid. |
| isSuccess |
boolean |
Indicates whether the call is successful. A value of true indicates success, and a value of false indicates failure. If the call fails, use the errorCode and errorMsg fields to identify the cause. |
|
| ok |
boolean |
Indicates whether the graph query is successful. A value of true indicates that the upstream graph service returned a successful result. |
|
| data |
any |
The payload of the graph query result. A full graph query returns an object that contains the ok and data fields. The data field contains the nodes (node list) and edges (edge list) fields. An incremental operation returns the result of the corresponding operation. For example, the datasources operation returns a pagination structure that includes the records, total, size, and page fields, and the domains operation returns a domains list. |
{"ok":true,"data":{"nodes":[],"edges":[]}} |
Examples
Success response
JSON format
{
"requestId": "A3F5B7C9-1D2E-4F6A-8B9C-0D1E2F3A4B5C",
"httpCode": 400,
"errorCode": "InvalidParameter",
"errorMsg": "The specified parameter is invalid.",
"isSuccess": false,
"ok": false,
"data": "{\"ok\":true,\"data\":{\"nodes\":[],\"edges\":[]}}"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.