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

Formalise schema #7

Open
iancoleman opened this issue Sep 27, 2017 · 5 comments
Open

Formalise schema #7

iancoleman opened this issue Sep 27, 2017 · 5 comments

Comments

@iancoleman
Copy link
Owner

When the parser becomes a bit more mature it would be good to have a formal schema available

Something like http://json-schema.org/

I have a feeling there's still some bits and pieces that are inconsistent

eg I think percentage values are represented in two different ways

{"percent": 1.5}
vs
{"value": 1.5, "units": "%"}
@iancoleman
Copy link
Owner Author

Some additional useful links from datasets/registry issue 201 referenced above

i'm thinking about packaging (some of the data) as tabular data packages:

http://frictionlessdata.io/data-packages/
http://frictionlessdata.io/guides/tabular-data-package/

https://specs.frictionlessdata.io/tabular-data-resource/

Especially adding a Table Schema https://specs.frictionlessdata.io/table-schema/

@rufuspollock
Copy link

rufuspollock commented Oct 3, 2017

@iancoleman note that Table Schema has a pattern for adding units: frictionlessdata/specs#216.

@NinerXrayBravoTwoTwo
Copy link

The JSON names are not in Pascal Case. If they were converted to PascalCase they would directly translate into classes better.

Currently I get an automatic JSON conversion to a C# class that looks as follows. As you can see this is less than optimal from the var/method naming deserialization perspective.


public class Electricity
{
    public Access access { get; set; }
    public Production production { get; set; }
    public Consumption consumption { get; set; }
    public Exports exports { get; set; }
    public Imports imports { get; set; }
    public InstalledGeneratingCapacity installed_generating_capacity { get; set; }
    public BySource by_source { get; set; }
}

@NinerXrayBravoTwoTwo
Copy link

Is it possible for the names to be in pascal case? This would make importing it more consistent and deserializing it directly to objects cleaner.

@iancoleman
Copy link
Owner Author

I did some looking at conventions and the best I came up with (google JSON style guide) recommends camelCase.

Would camelCase be ok or would you specifically prefer PascalCase?

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

3 participants