Altair® Panopticon

 

Supported JSON Structures

Panopticon supports JSON structures that represent one or several records where each record will become a row in a data table. It can be an array of JSON strings, or a set of named JSON string elements. Each record must be on the same record path, e.g., mydata.people. Each name in each record must follow hierarchically directly after the record path, e.g., mydata.people.name. Each record must be a JSON string of name-value pairs. Each name can have the following as value:

q  a single value

q  a JSON string of other name-value pairs

q  a JSON array of values

Each name that has as value a single value or an array of values will become a column in the data table. In case a name has as value an array of multiple values, then each value in the array will result in a column in the data table.

In case the JSON data has a structure where a name does not contain a single value, but instead an array of several values, you can optionally omit this name from the data table when making the column settings in the Panopticon data connector, by manual deletion. This is typically a preferred option when the array contains a large number of values, or when the different records have a large variety in the values, since this will result in a large number of columns, where many of the rows will have a blank value.

Here are examples of supported JSON structures:

Example 1: An array of JSON strings with name-value pairs, each name with a single value:

{

      "mydata": {

            "people": [{

                        "Name": "Peter",

                        "Age": "20"

                  },

                  {

                        "Name": "Paul",

                        "Age": "21"

                  },

                  {

                        "Name": "Mary",

                        "Age": "22"

                  }

            ]

      }

}

 

Example 2: An array of JSON strings with name-value pairs, some names having a single value and some names having a nested JSON string as value:


 

{

      "mydata": {

            "people": [{

                        "Name": "Peter",

                        "Age": "20",

                        "Address": {

                              "Street": "Park Avenue",

                              "Number": "1"

                        }

                  },

                  {

                        "Name": "Paul",

                        "Age": "21",

                        "Address": {

                              "Street": "Mainstreet",

                              "Number": "17"

                        }

                  },

                  {

                        "Name": "Mary",

                        "Age": "22",

                        "Address": {

                              "Street": "Cedar Road",

                              "Number": "5"

                        }

                  }

            ]

      }

}

 

Example 3: Named elements instead of an array, where the element name will be parsed into a column called KeyColumn in the data table:

{

      "Peter": {

            "Age": "20",

            "Address": {

                  "Street": "Park Avenue",

                  "Number": "1"

            }

      },

      "Paul": {

            "Age": "21",

            "Address": {

                  "Street": "Mainstreet",

                  "Number": "17"

            }

      },

      "Mary": {

            "Age": "22",

            "Address": {

                  "Street": "Cedar Road",

                  "Number": "5"

            }

      }

}

 

Example 4: An array of JSON strings with name-value pairs, where some names have as value an array of multiple values. A column will be created in the data table for each unique value in the arrays:

{

      "mydata": {

            "people": [{

                        "Name": "Peter",

                        "Age": "20",

                        "Address": ["Mainstreet", "Whoville"]

                  },

                  {

                        "Name": "Paul",

                        "Age": "21",

                        "Address": ["Backstreet", "Barnburg"]

                  },

                  {

                        "Name": "Mary",

                        "Age": "22",

                        "Address": ["Runroad", "Suburbia"]

                  }

            ]

      }

}