Unify and manage your data

Get Tree

This API request returns a tree of entities built on specified graph type relations.

Request

GET {TenantURL}/{entity object URI}/_tree
Table 1. Parameters
Parameter Name Required Details
Headers Authorization Yes This parameter provides information about the authentication access token using the format, Bearer <accessToken> (For more information see Authentication API.
Query graphTypeURIs Yes Comma-separated list of graph types URIs for graphs to be traversed. For more information, see Configuring Graph Types.
select No Comma-separated list of properties from the object structure that should be returned in a response. Allows you to return a partial object. This parameter can be used to include the following fields:
  • entity label (using the label keyword)
  • entity secondaryLabel (using the secondaryLabel keyword)
  • entity attributes (prefixing entities before the attributes keyword)
    Note: The select parameter supports all attributes.
The following query returns data for all fields:
select=label,secondaryLabel,entities.attributes
Note: Data is also returned for all fields if the select parameter is not used in the request.
options No This is a comma-separated list of different options, which affect on entity's JSON content in a response. Available options:
  • sendHidden- disabled by default, entity's JSON will contain hidden attributes if this option is enabled.
  • ovOnly- return only attribute values that have ov=true flag.
  • nonOvOnly- return only attribute values that have ov=false flag. If you have a nested or reference attribute value where ov=true, but sub-attributes where ov=false, then these sub attributes will not appear in the response.
  • reverseRelations - return hierarchy with reversed directions of all relations. This means relations' start objects will be treated as end objects and vice versa.

Response

This request will return the tree (built on specified graph type relations) that contains:

1. Initial entity (specified by the {id} parameter).

2. The entity's parent.

3. All the parent's children.

4. The parent's parent (with all its children) and so on... Till the last parent in the tree.

Also, each node will contain the number of child elements inside it.

The format of the result (success response) is the following:

{
	"success": "true",
	"root": {
		"entity": "entity content, including label/secondaryLabel, attributes",
		"total": 50,
		"children": [{
				"entity": "entity content, including label/secondaryLabel, attributes",
				"relation": "relation content which connects the entity with its parent",
				"parent": "URI of parent entity",
				"total": 0
			},
			{
				"entity": "entity content, including label/secondaryLabel, attributes",
				"relation": "relation content which connects the entity with its parent",
				"parent": "URI of parent entity",
				"total": 5,
				"children": [
					...
				]
			},
			....
		]
	}
}

In the case of an entity that has several parents, the parent attribute of the response is an array of URIs, and the relation attribute is an array of relations.

Note: Reltio recommends that you do not use the _tree request in scripts for the following reasons:
  • _tree request always reads several graph levels for tree definition and consumes many platform resources. These requests fetch large volumes of data and can cause slowness in the process.
  • The response could take a long time (up to several minutes) for large hierarchies.