Sample dataset configuration

This is the file dataset_config/sample_longitudinal.json included in the protari_sample repository.

It demonstrates the use of:

{
  "description": "This dataset contains sample longitudinal data.",
  "main_resource_name": "person",
  "name": "sample_longitudinal",
  "query_class_definitions": {
    "aggregation": {
      "allowed_functions": [
        "count",
        "mean",
        "sum"
      ],
      "run": "sql_tbe_pipeline",
      "transform_definitions": {
        "check_field_exclusions": {
          "parameters": {
            "field_exclusion_rules": [
              {
                "limit": 4
              },
              {
                "fields": [
                  {
                    "name": "COUNTRY"
                  },
                  {
                    "name": "POSTCODE"
                  },
                  {
                    "name": "AMOUNT"
                  }
                ],
                "limit": 2
              }
            ]
          }
        },
        "check_query_size": {
          "parameters": {
            "maximum_output_values_length": 2000
          }
        },
        "get_sql_top_rows": {
          "parameters": {
            "parameters": {
              "number": 4,
              "record_key_name": "{tbe_perturb.record_key_name}",
              "value_tiebreaker_name": "{tbe_perturb.record_key_name}"
            }
          }
        },
        "tbe_perturb": {
          "parameters": {
            "bigN": 1766976779,
            "m": [
              0.5,
              0.3,
              0.15,
              0.05
            ],
            "p_filename": "pmatrix2",
            "primitive_scope_key_declarations_filename": "psk_sample_longitudinal",
            "record_key_name": "RECORD_KEY",
            "s_filename": "smatrix2",
            "smallC": 7,
            "smallN": 60,
            "use_additive_scope_perturbation": true
          }
        }
      }
    }
  },
  "requires_permission_to_query": false,
  "requires_permission_to_see": false,
  "resources": [
    {
      "fields": [
        {
          "is_longitudinal": true,
          "name": "YEAR",
          "title": "Year",
          "type": "integer",
          "values": [
            {
              "name": 2000
            },
            {
              "name": 2005
            }
          ]
        },
        {
          "name": "SEX",
          "title": "Sex",
          "type": "string",
          "values": [
            {
              "name": "F",
              "title": "Female"
            },
            {
              "name": "M",
              "title": "Male"
            },
            {
              "is_sentinel": true,
              "name": "",
              "title": "Not stated"
            }
          ]
        },
        {
          "name": "COUNTRY",
          "title": "Country of Birth",
          "type": "integer",
          "values": [
            {
              "name": 1000,
              "title": "Oceania",
              "values": [
                {
                  "name": 1100,
                  "title": "Australia (including External Territories)",
                  "values": [
                    {
                      "name": 1101,
                      "title": "Australia"
                    },
                    {
                      "name": 1102,
                      "title": "Norfolk Island"
                    },
                    {
                      "name": 1199,
                      "title": "Australian External Territories"
                    }
                  ]
                },
                {
                  "name": 1201,
                  "title": "New Zealand"
                },
                {
                  "name": 1300,
                  "title": "Melanesia",
                  "values": [
                    {
                      "name": 1301,
                      "title": "New Caledonia"
                    },
                    {
                      "name": 1302,
                      "title": "Papua New Guinea"
                    },
                    {
                      "name": 1303,
                      "title": "Solomon Islands"
                    },
                    {
                      "name": 1304,
                      "title": "Vanuatu"
                    }
                  ]
                }
              ]
            },
            {
              "name": 9999,
              "title": "Other"
            },
            {
              "is_sentinel": true,
              "name": null,
              "title": "Not stated"
            }
          ]
        },
        {
          "fields": [
            {
              "name": "DWELL",
              "title": "Dwelling Type",
              "type": "string",
              "values": [
                {
                  "name": "001",
                  "title": "House"
                },
                {
                  "name": "002",
                  "title": "Apartment"
                },
                {
                  "name": "003",
                  "title": "Other"
                }
              ]
            },
            {
              "maximum": 7,
              "minimum": 0,
              "name": "ROOMS",
              "title": "Number of Bedrooms",
              "type": "integer",
              "values": [
                {
                  "name": 0,
                  "title": "None (including bedsits)"
                },
                {
                  "is_sentinel": true,
                  "name": null,
                  "title": "Not stated"
                },
                {
                  "is_sentinel": true,
                  "name": 999,
                  "title": "Not applicable"
                }
              ]
            }
          ],
          "title": "Dwelling"
        },
        {
          "name": "POSTCODE",
          "region_type": "poa",
          "title": "Postcode of usual residence",
          "type": "integer",
          "values": [
            {
              "name": 6722
            },
            {
              "name": 6725
            },
            {
              "name": 6762
            },
            {
              "name": 6642
            },
            {
              "name": 6710
            },
            {
              "name": 6429
            }
          ]
        },
        {
          "decimal_places": 2,
          "interval_size": 10,
          "maximum": 100,
          "minimum": 0,
          "name": "AMOUNT",
          "title": "Dollar Amount",
          "type": "number"
        }
      ],
      "name": "person",
      "table_name": "sample_longitudinal",
      "unit": {
        "plural": "people",
        "singular": "person"
      },
      "unit_id_name": "UID"
    }
  ],
  "title": "Sample longitudinal dataset"
}