Assign Entities
-
Download resource from CDN
First, we need to manually download the resource directly from the CDN. For this, we require the resource hash which can be found in the
reporting_latest_endpoints
datasette. The link has an example endpoint populated, just replace this with the actual endpoint.Once you have the resource hash, edit the following link with the correct information
https://files.planning.data.gov.uk/[collection-name]-collection/collection/resource/[resource-hash]
Here is an example link with ‘tree-preservation-order-collection’ as collection-name and ed778c73ea51338d6576fb5992b189f2b94d9f3d5e199f46c1af520d6b0b3e6c as resource-hash:
Download the file to your local config repository and add it to the config. The location does not matter but this example puts it in a resource folder in the dataset’s collection folder.
-
Run assign-entities script
Run the following command with your corresponding variables:
digital-land assign-entities [PATH_TO_RESOURCE] [ENDPOINT] [COLLECTION-NAME] [DATASET] [ORGANISATION] -c ./collection/[COLLECTION-NAME]/ -p ./pipeline/[COLLECTION-NAME]/
For example, using the example from step 1, the script would look like this:
digital-land assign-entities collection/tree-preservation-order/resource/4e0de67249898504311f4dde8ebf11bcb1bac52652320505113f4dc85635ea3e 3aeef0b2fb0bb0c85a25bd4491b3c56f70924d6a8ae9d9e22764885965a2b4c7 tree-preservation-order tree-preservation-order local-authority-eng:MDW -c ./collection/tree-preservation-order/ -p ./pipeline/tree-preservation-order/
- Check results
Confirm the desired result in the lookup.csv file, the amount of entities that needed to be assigned should be the same amount that have been added in the lookup file.