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

Decide how to deal with extras #27

Closed
vitorbaptista opened this issue Dec 4, 2015 · 0 comments
Closed

Decide how to deal with extras #27

vitorbaptista opened this issue Dec 4, 2015 · 0 comments
Assignees

Comments

@vitorbaptista
Copy link
Contributor

Currently we put the extras inside the root-level of the datapackage.json. That's good, because we set the pattern of putting in extras whatever we don't recognize, but it also creates an issue: what if an extra's key clashes with a datapackage key? For example, what if there's an extra with a key "sources"?

CKAN validates that there're no extras with keys that clashes with its values (e.g. name, author, etc.), but there're many fields in datapackage that have different names (or don't exist) in CKAN (e.g. sources and license), so CKAN doesn't prohibits them.

We could either add those validations ourselves or not add the extras into the datapackage.json's root level. I would rather not add validations, so I'm thinking the second option is the best. The issue is that when we import a datapackage with, say:

{
    "name": "gdp",
    "last_updated": "2011-09-21"
}

There's no field in CKAN for last_updated, so it must go inside extras. Then, when we export the created CKAN dataset, it'll become:

{
    "name": "gdp",
    "extras": {
        "last_updated": "2011-09-21"
    }
}

I would prefer the exported datapackage to be the same as the imported one, but it would complicate the code, so it's probably not worth it.

97a5c3e

@vitorbaptista vitorbaptista self-assigned this Dec 4, 2015
@vitorbaptista vitorbaptista changed the title Decide how to deal with "extras" Decide how to deal with extras Dec 4, 2015
@vitorbaptista vitorbaptista added this to the Importing and Exporting Data Packages on CKAN 2.4 milestone Dec 4, 2015
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

1 participant