Json Data File

Json (JavaScript Object Notation) is an open standard file and data interchange format that uses human-readable text to store and transmit data objects. Json Data Files have been introduced in DEXiWin to provide a rich and flexible way of storing all components of a DEXi model, including model components and data about alternatives, in a form that can be easily reviewed and interchanged with other software, web services, etc. Also, the format addresses the issue of having multiple equally-named attributes in a single model, which caused difficulties while using other data formats.

Json Data Files are exported and imported through File Menu commands: File/Export model..., File/Export alternatives... File/Import model... and File/Import alternatives..., after choosing the Json format in the corresponding save file dialogues.

The exact contents of exported files depend on File/Settings/Json, where it is possible to define many formatting options, including the selection of individual elements to be included in the file.

When importing a Json data file, DEXiWin tries to recognize the specific format settings that had been used while writing the file. Nevertheless, it is recommended to export and import Json data using the same settings.

Recommendation

Given so many options for altering the Json Data File format, we suggest to experiment by changing File/Settings/Json and observing the effects on the exported data file(s).

Example

Example shows the Car Evaluation model, exported by File/Export model..., using the following Json settings: Flat file structure, using Text values, including both model components and alternatives’ data, and including the default data items. Only an excerpt from the exported file is shown below for illustration.

{
"name": "Car",
"structureFormat": "flat",
"valueFormat": "text",
"valueStrings": true,
"distrFormat": "dict",
"model": [
  {
    "name": "CAR",
    "description": "Quality of a car",
    "path": "/CAR",
    "id": "CAR",
    "type": "aggregate",
    "scale": {
      "order": "ascending",
      "interval": true,
      "type": "discrete",
      "values": [
        {
          "name": "unacc",
          "description": "unacceptable car",
          "group": "bad"
        },

Other CAR scale values omitted … Follows the definition of CAR’s aggregation function:

"function": {
  "table": {
    "dimension": "3;4",
    "rules": [
      {
        "args": "0;0",
        "value": "0",
        "entered": true
      },

Other CAR function rules omitted … Follows the list of CAR’s descendant attributes:

},
"inputs": [
  {
    "name": "PRICE",
    "description": "Price of a car",
    "path": "/CAR/PRICE",
    "id": "PRICE",
    "type": "aggregate",
    "scale": {

Further attribute data omitted … Follows the list of alternatives and associated data:

"alternatives": [
  {
    "name": "Car1",
    "values": [
      {
        "name": "CAR",
        "path": "/CAR",
        "id": "CAR",
        "string": "3",
        "value": "exc"
      },
      {
        "name": "PRICE",
        "path": "/CAR/PRICE",
        "id": "PRICE",
        "string": "2",
        "value": "low"
      },

Further alternatives’ data omitted…