|
| 1 | +# How the specification fits together |
| 2 | + |
| 3 | +This note is a short primer on the structure of the planning application data specification and where to find the main pieces within it. |
| 4 | + |
| 5 | +In particular, it explains: |
| 6 | + |
| 7 | +- how applications, modules, fields and codelists relate to each other |
| 8 | +- where to find field datatypes and formats |
| 9 | +- where to find controlled vocabularies and the codelists linked to fields |
| 10 | +- where to use the specification viewer and where to use the GitHub repository |
| 11 | + |
| 12 | +The short version is: |
| 13 | + |
| 14 | +- every field has a definition |
| 15 | +- every field definition includes a datatype |
| 16 | +- if a field uses a controlled list, the field definition names the codelist |
| 17 | +- the codelist then defines the allowed values |
| 18 | + |
| 19 | +## Start here |
| 20 | + |
| 21 | +The easiest place to browse the specification is the viewer site: |
| 22 | + |
| 23 | +- [Planning application data specification](https://digital-land.github.io/planning-application-data-specification/) |
| 24 | +- [Submission specification](https://digital-land.github.io/planning-application-data-specification/submission/) |
| 25 | +- [Decision specification](https://digital-land.github.io/planning-application-data-specification/decision-stage/) |
| 26 | +- [Shared elements](https://digital-land.github.io/planning-application-data-specification/shared-elements/) |
| 27 | +- [Fields](https://digital-land.github.io/planning-application-data-specification/fields/) |
| 28 | +- [Codelists](https://digital-land.github.io/planning-application-data-specification/codelist/) |
| 29 | + |
| 30 | +The underlying canonical files are in GitHub: |
| 31 | + |
| 32 | +- [Repository root](https://github.com/digital-land/planning-application-data-specification) |
| 33 | +- [Specification overview](https://github.com/digital-land/planning-application-data-specification/blob/main/specification/README.md) |
| 34 | +- [Fields folder](https://github.com/digital-land/planning-application-data-specification/tree/main/specification/field) |
| 35 | +- [Codelists folder](https://github.com/digital-land/planning-application-data-specification/tree/main/specification/codelist) |
| 36 | + |
| 37 | +## How the parts fit together |
| 38 | + |
| 39 | +At a high level the specification works like this: |
| 40 | + |
| 41 | +- an application definition says what is needed for a given application type |
| 42 | +- an application uses modules |
| 43 | +- a module groups related fields |
| 44 | +- a field defines an individual data item, including its datatype |
| 45 | +- if the field is controlled, the field definition points to a codelist |
| 46 | +- the codelist defines the allowed values |
| 47 | + |
| 48 | +In other words: |
| 49 | + |
| 50 | +`application -> module -> field -> datatype / codelist` |
| 51 | + |
| 52 | +This is why the field definition is the key place to look when you want to know how a field is defined. |
| 53 | + |
| 54 | +## Where to find the datatype or format for a field |
| 55 | + |
| 56 | +Every field has a datatype defined in its field definition. |
| 57 | + |
| 58 | +The easiest place to browse fields is: |
| 59 | + |
| 60 | +- [Fields in the specification viewer](https://digital-land.github.io/planning-application-data-specification/fields/) |
| 61 | + |
| 62 | +The canonical source files are here: |
| 63 | + |
| 64 | +- [Field definition files in GitHub](https://github.com/digital-land/planning-application-data-specification/tree/main/specification/field) |
| 65 | + |
| 66 | +For example, the field definition for `decision-date` shows the datatype directly: |
| 67 | + |
| 68 | +```yaml |
| 69 | +field: decision-date |
| 70 | +datatype: string |
| 71 | +description: The date when the decision was made, in YYYY-MM-DD format |
| 72 | +``` |
| 73 | +
|
| 74 | +Source: |
| 75 | +
|
| 76 | +- [decision-date field definition](https://github.com/digital-land/planning-application-data-specification/blob/main/specification/field/decision-date.md) |
| 77 | +
|
| 78 | +So if the question is, "Where do I see the format or data type for this field?", the answer is: open the field definition and look for the `datatype` line and, where helpful, the description. |
| 79 | + |
| 80 | +## Where to find which codelist applies to a field |
| 81 | + |
| 82 | +If a field uses a controlled vocabulary, the field definition will show: |
| 83 | + |
| 84 | +- `datatype: enum` |
| 85 | +- `codelist: ...` |
| 86 | + |
| 87 | +For example: |
| 88 | + |
| 89 | +```yaml |
| 90 | +field: application-type |
| 91 | +datatype: enum |
| 92 | +codelist: application-type |
| 93 | +``` |
| 94 | + |
| 95 | +Source: |
| 96 | + |
| 97 | +- [application-type field definition](https://github.com/digital-land/planning-application-data-specification/blob/main/specification/field/application-type.md) |
| 98 | + |
| 99 | +That tells you the field is an enum and that the relevant codelist is `application-type`. |
| 100 | + |
| 101 | +You can then look up that codelist here: |
| 102 | + |
| 103 | +- [Codelists in the specification viewer](https://digital-land.github.io/planning-application-data-specification/codelist/) |
| 104 | +- [application-type codelist definition](https://github.com/digital-land/planning-application-data-specification/blob/main/specification/codelist/application-type.schema.md) |
| 105 | +- [application-type codelist values](https://github.com/digital-land/planning-application-data-specification/blob/main/data/planning-application-type.csv) |
| 106 | + |
| 107 | +So if the question is, "Where do I see which code list applies to this field?", the answer is: open the field definition first. If it is an enum, the field definition will name the codelist. |
| 108 | + |
| 109 | +## A second concrete example |
| 110 | + |
| 111 | +The same pattern applies to other controlled fields. For example: |
| 112 | + |
| 113 | +```yaml |
| 114 | +field: contact-priority |
| 115 | +datatype: enum |
| 116 | +codelist: contact-priority |
| 117 | +``` |
| 118 | + |
| 119 | +Source: |
| 120 | + |
| 121 | +- [contact-priority field definition](https://github.com/digital-land/planning-application-data-specification/blob/main/specification/field/contact-priority.md) |
| 122 | +- [contact-priority codelist definition](https://github.com/digital-land/planning-application-data-specification/blob/main/specification/codelist/contact-priority.schema.md) |
| 123 | + |
| 124 | +## Where spreadsheets and compiled views fit in |
| 125 | + |
| 126 | +The repository also includes generated views that are useful for browsing: |
| 127 | + |
| 128 | +- [Compiled application views](https://github.com/digital-land/planning-application-data-specification/tree/main/generated/info_model/application) |
| 129 | +- [Spreadsheet views](https://github.com/digital-land/planning-application-data-specification/tree/main/generated/spreadsheet) |
| 130 | + |
| 131 | +These are useful reading views, but they are generated from the underlying specification files. If you need the exact datatype or the exact codelist link for a field, the canonical field definition is the most direct place to look. |
| 132 | + |
| 133 | +For example: |
| 134 | + |
| 135 | +- [Full planning permission compiled view](https://github.com/digital-land/planning-application-data-specification/blob/main/generated/info_model/application/full.md) |
| 136 | + |
| 137 | +## Short version you can reuse |
| 138 | + |
| 139 | +If useful, you can send suppliers the following summary: |
| 140 | + |
| 141 | +> Every field in the specification has a field definition. That definition shows the field datatype. If the field uses a controlled list, the same definition also names the codelist. The easiest way to browse these is via the specification viewer, especially the [fields](https://digital-land.github.io/planning-application-data-specification/fields/) and [codelists](https://digital-land.github.io/planning-application-data-specification/codelist/) sections. The underlying canonical files are in the GitHub repository under [`specification/field`](https://github.com/digital-land/planning-application-data-specification/tree/main/specification/field) and [`specification/codelist`](https://github.com/digital-land/planning-application-data-specification/tree/main/specification/codelist). |
0 commit comments