Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile API feedback #20

Closed
roll opened this issue Jul 6, 2017 · 1 comment
Closed

Profile API feedback #20

roll opened this issue Jul 6, 2017 · 1 comment

Comments

@roll
Copy link
Member

roll commented Jul 6, 2017

Overview

Based on this readme listing I'm adding feedback based on existent implementations and expected lib user competencies (as we target many almost non-tech users - publisher, data wranglers etc).

use frictionlessdata\datapackage;

// register custom datapackage or resource classes which can override / extend core classes
// these custom classes run a test against the schema to decide whether to handle a given descriptor or not
Factory::registerDatapackageClass("my\\custom\\DatapackageClass");
Factory::registerResourceClass("my\\custom\\ResourceClass");

// register custom profiles and related schemas for validation
Registry::registerSchema("my-custom-profile-id", "path/to/my-custom-profile.schema.json");

Profiles handling

Just want to share how we handle it in Python/Javascript. After all back and forth with profiles on specs and libs level for now we have a simple system for main libs (and Ruby is syncing). It's described here -
frictionlessdata/datapackage-rb#31 (comment) and based on descriptor.profile which could be:

  • profile id
  • profile url

That's the very lightweight approach which could be considered instead of registering classes/jsonschemas etc (which could be like too difficult for ordinary users if I've got current API correctly)

Schema term

Minor thing (if naming could be minor) but across all implementations we're leaning toward following terminology:

  • schema - Table Schema
  • profile - JSON Schema to validate descriptor
  • jsonschema - profile representation as a dict/object
@OriHoch
Copy link
Collaborator

OriHoch commented Jul 30, 2017

it is working using profile as you describe, but I guess it should be made clearer in README, I'll add a comment to #22 to do that

I removed the examples you referred to from the README - they are meant for more advanced use case, if you want to add custom logic based on profile, in #22 I'll update the README with full API details and make it clear it's for advanced use only.

Regarding terms, I opened an issue to handle it there - #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants