frictionlessdata / datapackage-js

A JavaScript library for working with Data Package.
http://frictionlessdata.io/
MIT License
42 stars 15 forks source link

Implementing foreign keys using remote package json #103

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi @Stephen-Gates , @roll Just opening this to make sure I understand the implementation requirements for doing PR for this. To validate a foreign key that has a package URL, noting @roll your comments about place: and integrity check + dereferencing The PR then should include:

Is this correct - is there anything else I need to include?

roll commented 6 years ago

I'm a little bit out of context for now but I guess the main approach I was thinking about - to get a Resource instance from a referenced data package (in the _getRelations function).

That's the only thing that should differ (be extended) compared to the current state. When we get the Resource instance all other code will just work as it works for own package's resources.

Stephen-Gates commented 6 years ago

Some context...

In Data Curator we're implementing the Foreign Keys to Data Packages pattern.

screenshot 2018-04-28 09 26 52

As previously agreed, we're using package not datapackage in the pattern and are waiting on https://github.com/frictionlessdata/specs/pull/611 to be merged. Then we'll merge the associated change to the test data, https://github.com/frictionlessdata/example-data-packages/pull/53.

This change is to add Foreign Keys to Data Packages pattern support to datapackage.js.

ghost commented 6 years ago

Hi @Stephen-Gates I've got some questions to raise in our own code, as I'm not clear now as to why we need datapackage-js in the code highlighted - it seems at odds with what we use in Data Curator for validation.

ghost commented 6 years ago

@Stephen-Gates Don't think, at this stage anyway, we need to do anything with relations other than what is already present.