In the Profiles mechanism, the schema tools will take all the changes defined in a profile directory and create full profile schemas via a JSON merge patch, into the schema directory. It will also then generate a datapackage.json file based on these schemas.
This is not behaving as expected, since some changes made to the schema via the Profile are not reflected in the datapackage.json. This has a knock-on effect for the ERD diagrams for profiles.
This problem also persists when generating a datapackage manually e.g via hsds_schema.py schemas-to-datapackage schemas/ > test.json, so the root cause may be there.
- New properties are not reflected in datapackage.json
E.g. adding test to funding.json, and running profile-all --clean with the repo URI will not add test as a field inside the funding entry in datapackage.json. This prevents it from being rendered in the ERD. test is present in the schema/funding.json file, so should be reflected in the datapackage.
- Removed properties are not removed from the foreign keys in datapackage.json
Conversely, removed fields are actually removed from the datapackage. The UK profile removes organization_id from funding.json. After running profile-all --clean and opening datapackage.json, it's clear that organization_id is not present inside of resources['funding']/fields. However, it is still referenced inside of resources['funding']/foreignKeys. This causes errors when generating an ERD from the datapackage.
In the Profiles mechanism, the schema tools will take all the changes defined in a
profiledirectory and create full profile schemas via a JSON merge patch, into theschemadirectory. It will also then generate a datapackage.json file based on these schemas.This is not behaving as expected, since some changes made to the schema via the Profile are not reflected in the datapackage.json. This has a knock-on effect for the ERD diagrams for profiles.
This problem also persists when generating a datapackage manually e.g via
hsds_schema.py schemas-to-datapackage schemas/ > test.json, so the root cause may be there.E.g. adding
testtofunding.json, and runningprofile-all --cleanwith the repo URI will not addtestas a field inside thefundingentry indatapackage.json. This prevents it from being rendered in the ERD.testis present in theschema/funding.jsonfile, so should be reflected in the datapackage.Conversely, removed fields are actually removed from the datapackage. The UK profile removes
organization_idfromfunding.json. After runningprofile-all --cleanand openingdatapackage.json, it's clear thatorganization_idis not present inside ofresources['funding']/fields. However, it is still referenced inside ofresources['funding']/foreignKeys. This causes errors when generating an ERD from the datapackage.