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

Create json schemas describing both data models #56

Open
areleu opened this issue Aug 12, 2022 · 7 comments
Open

Create json schemas describing both data models #56

areleu opened this issue Aug 12, 2022 · 7 comments

Comments

@areleu
Copy link
Contributor

areleu commented Aug 12, 2022

Overview

Hello, I have been working on integrating this data model without friction into frictionless. This requires effort in different repositories Here are the pull requests and issues:

Frictionless:
frictionlessdata/frictionless-py#1229
frictionlessdata/frictionless-py#1228

oemetadata:

OpenEnergyPlatform/oemetadata#91

If these changes take place then validating the models will work directly with frictionless. I think the next step is being able to validate the structure of the tables themselves, to do this we would need descriptors in json format.

Task

Write a data descriptors for the data model. These would comprise of the json schema representation of the packages:

I can contribute to this next month but if someone starts this that would be great.

@jh-RLI
Copy link
Collaborator

jh-RLI commented Sep 15, 2022

@areleu
I have updated the json schema in the oemetadata repo. There were some wrong entries :/. Now the validation is running successfully. Is this what you meant by this issue?
Regarding OpenEnergyPlatform/oemetadata#91, I will also leave this open for now, but I think it is no longer necessary (did I understand that correctly?)

@areleu
Copy link
Contributor Author

areleu commented Sep 15, 2022

@areleu I have updated the json schema in the oemetadata repo. There were some wrong entries :/. Now the validation is running successfully. Is this what you meant by this issue? Regarding OpenEnergyPlatform/oemetadata#91, I will also leave this open for now, but I think it is no longer necessary (did I understand that correctly?)

i think OpenEnergyPlatform/oemetadata#91 is no longer relevant. I think is better if we have a schema specific to the packages. I Started to write one but I am not done. Let me upload what I have as a github gist

@areleu
Copy link
Contributor Author

areleu commented Sep 15, 2022

@areleu I have updated the json schema in the oemetadata repo. There were some wrong entries :/. Now the validation is running successfully. Is this what you meant by this issue? Regarding OpenEnergyPlatform/oemetadata#91, I will also leave this open for now, but I think it is no longer necessary (did I understand that correctly?)

It is correct, i think OpenEnergyPlatform/oemetadata#91 is no longer relevant. I think is better if we have a schema specific to the packages. I Started to write one but I am not done. Let me upload what I have as a github gist

https://gist.github.com/areleu/6fe09323f26ec3ed4d83bc9084ab7ea9

As I said, this is not yet completely functional.

@areleu
Copy link
Contributor Author

areleu commented Sep 15, 2022

The justification for having such a thing is that. You can validate if the metadata complies with the OEMetadata but you can't really check if it is a valid OEdatamodel implementation. For doing so one would need to write a schema that extends the OEMetadata to check for the particular constraints of the OEDatamodel.

This way you can validate very easily if an user is filling their tables correctly.

If we have these schemas, I think we can even use frictionless for validation out of the box.

@jh-RLI
Copy link
Collaborator

jh-RLI commented Sep 19, 2022

@henhuy you mentioned some updates to the oedatamodel. @areleu is working on a json schema that can be used with frionless to validate data. Maybe it is useful to share the changes so we can also create a schema for the updated version.

@jh-RLI
Copy link
Collaborator

jh-RLI commented Oct 17, 2022

@henhuy I think you have already implemented this in the oeadatamodel api?

@henhuy
Copy link

henhuy commented Oct 17, 2022

Yes. I implemented an API for our project, which loads metadata from existing OEP table, creates frictionless schema from OEMetadata schema and validates incoming data from CSV file via frictionless resource. If everything is okay, data gets uploaded otherwise a frictionless error report is returned to user.
Here the corresponding code for loading and validating data via OEMetadata (you have to look into upload module)

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