HomeGuidesRecipesAPI
HomeGuidesAPILog In

Hierarchical Data

JSON and XML files normally include hierarchical data, in SmartIQ you'll get one of those if you are using one of the following Data Sources:

  • JSON
  • XML
  • Web Service (SOAP)
  • REST

Here two examples of hierarchical data:

<?xml version="1.0" encoding="utf-8"?>
<students>
  <student id="0001">
    <name>Justin</name>
    <lastName>Example</lastName>
    <subjects>
      <subject>
        <name>Science</name>
      </subject>
      <subject>
        <name>Nature History</name>
      </subject>
      <subject>
        <name>Biology</name>
      </subject>
    </subjects>
  </student>
</students>
{
  "students": {
    "student": {
      "-id": "0001",
      "name": "Justin",
      "lastName": "Example",
      "subjects": {
        "subject": [
          { "name": "Science" },
          { "name": "Nature History" },
          { "name": "Biology" }
        ]
      }
    }
  }
}

Level 1

  • name
  • lastName

Level 2

  • subject/name

In order to map these data sources in SmartIQ Design, it is required to have two Data Sources, where the first one will point directly to the root (created in manage) and the second one will point to the previous data source, specifically to the new level root (subjects/subject). Here an example diagram:

295

🚧

Note:

For hierarchical REST datasources, the schema must be supplied in Swagger format.

An example of a project that uses a JSON hierarchical data connection can be found here: