Sample dataset configuration

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

It demonstrates the use of:

{
  "metadata": {
    "description": "This dataset contains sample longitudinal data.",
    "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"
      },
      {
        "decimal_places": 2,
        "interval_size": 10,
        "maximum": 100,
        "minimum": 0,
        "name": "AMOUNT",
        "title": "Dollar Amount",
        "type": "number"
      }
    ],
    "notes": "This is just sample data. None of this data is real.",
    "title": "Sample longitudinal dataset",
    "unit": {
      "plural": "people",
      "singular": "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
              }
            ]
          }
        },
        "check_sparsity": {
          "parameters": {
            "a": 0.5,
            "b": 0.75
          }
        },
        "get_aggregated_sql_data": {
          "parameters": {
            "name_in_db": "SAMPLE_LONGITUDINAL"
          }
        },
        "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": "pmatrix1",
            "record_key_name": "RECORD_KEY",
            "s_filename": "smatrix1",
            "smallC": 5,
            "smallN": 7
          }
        }
      }
    }
  },
  "requires_permission_to_query": false,
  "requires_permission_to_see": false,
  "unit_id_name": "UID"
}