Coder Social home page Coder Social logo

Comments (14)

gheber avatar gheber commented on May 22, 2024

This is an ill-defined problem and needs to be translated into a set of well-posed problems.

from hdf5-json.

hyoklee avatar hyoklee commented on May 22, 2024

The first problem is a checker that can determine if JSON contains the correct keywords according to grammar rule.

http://hdf5-json.readthedocs.org/en/latest/bnf/index.html

from hdf5-json.

gheber avatar gheber commented on May 22, 2024

This is a well-posed problem.

from hdf5-json.

jreadey avatar jreadey commented on May 22, 2024

Here is a json schema validator: https://github.com/json-schema/json-schema.
Can we utilize this?

Joe, what is the use case for the json validator?

from hdf5-json.

hyoklee avatar hyoklee commented on May 22, 2024

As a client developer, I've created and sent so many invalid JSON payloads to HPD server / h5serv. I'd like to validate it first before I send. HPD server may benefit too to prevent garbage-in and garbage-out problem.

Users can use such tool before they import h5json files that user edited manually in bulk (e.g., replace all attribute values from " to ') into HPD Server.

from hdf5-json.

 avatar commented on May 22, 2024

FYI, I am working on this functionality in the PD server code. Not as general as it could be but should be sufficient for the PD server. I can push this to Heroku but in that branch the OPeNDAP/THREDDS links are already moved to port 80.

from hdf5-json.

hyoklee avatar hyoklee commented on May 22, 2024

Great, Aleksandar! I hope you guys can pull codes together to create a general validation tool that code generator can benefit from it as well.

from hdf5-json.

hyoklee avatar hyoklee commented on May 22, 2024

The second problem is checking values against its type. Throw an error if a user specified

"type": {
                        "base": "H5T_STD_I8LE", 
                        "class": "H5T_INTEGER"
                    }, 
                    "value": [34234343449,... 

from hdf5-json.

 avatar commented on May 22, 2024

Did you try that with the PD server?

from hdf5-json.

hyoklee avatar hyoklee commented on May 22, 2024

Of course, I did and I'm very happy that server rejects it.

from hdf5-json.

jreadey avatar jreadey commented on May 22, 2024

Aleksandar,
Can you point me at the code in PD server? I'll see if I can extract into a stand-alone script (or maybe as an command line option for jsontoh5.py - don't create an HDF5 file, just validate the json).

from hdf5-json.

 avatar commented on May 22, 2024

@jreadey This is the entry point. All the other helper functions are in the same file.

I think the quickest way to use this code is with a front-end "loader" that would call it for each group/dataset/attribute.

from hdf5-json.

ajelenak avatar ajelenak commented on May 22, 2024

An HD5/JSON validator based on the JSON Schema is now part of the h5json package. It does only HDF5/JSON grammar validation, not any semantic or logical relationships like dimension scales.

I think this issue should be closed but will leave it open for a month to gather comments from others. So, I'll close this issue if no further discussion by end of March 2022. (It's been open for so long, what's one more month. 😄)

from hdf5-json.

ajelenak avatar ajelenak commented on May 22, 2024

Closing due to no further comments.

from hdf5-json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.