qcif / data-curator

Data Curator - share usable open data
MIT License
265 stars 38 forks source link

Foreign keys being not being saved as an element of the schema #972

Closed pripley123 closed 4 years ago

pripley123 commented 4 years ago

Current Behaviour (for problems)

Data Curator is storing the foreign key and primary key relationships as an element of the resource as opposed to part of the schema element

Expected Behaviour

The foreign key relationship should be an element of the schema

Steps to Reproduce

  1. Import two comma separated csv's
  2. create a foreign key relationship between csvs
  3. fill out information needed to allow data package to be exported
  4. export data package
  5. open data package's datapackage.json
  6. the foreign key relationship is stored as an element of the resource

Your Environment

Windows

ghost commented 4 years ago

Hi @pripley123 I must admit it has been a little while since I checked, but my understanding was that we follow the frictionless specification for table schema. Ah yes, I can see that we've slipped that 1 place too high - I can look at where this is being done.

ghost commented 4 years ago

Reference with example: https://github.com/frictionlessdata/datapackage-js/issues/90

ghost commented 4 years ago

Frictionless spec handled correctly it seems (and possibly importing as both table props and schema props are imported as DataCurator doesn't use 'schema' as a key in properties) - possibly just need to change for export and consider test coverage.

ghost commented 4 years ago

Noticed some to-dos with review of updates to frictionless table: logged in #1009