JustinGOSSES / wellio.js

JavaScript for converting well-log standard .las file format to json format
https://justingosses.github.io/wellio.js/
MIT License
34 stars 5 forks source link

Wellio-Schema: exploration and discussion: initial commit #36

Closed dcslagel closed 4 years ago

dcslagel commented 4 years ago

This branch and its commits are for exploring and discussing the usefulness of a possible Wellio json-schema. This commit contains an initial wellio.schema.json file that specs out a minimal LAS Version section. The added wellio_sample_2.0.json is the wellio json based on sample2.0.las. The lasio json files are renamed to have 'lasio' as a prefix to distinguish them from wellio json files. This branch also adds the ajv-cli tool to the npm package.json devDependencies. The ajv-cli tool is a JavaScript-based json-schema validation tool.

To run the ajv-cli tool on the sample files use the following command. The expected output is 'assets/json_files/wellio_sample_2.0.json valid'

./node_modules/.bin/ajv -s assets/json_files/wellio.schema.json -d assets/json_files/wellio_sample_2.0.json

Feedback will be appreciated,

DC

JustinGOSSES commented 4 years ago

Yes, love that you put together a proper schema! No brain space right now, but will try to look at this over the weekend.

JustinGOSSES commented 4 years ago

The schema validates to for type and that things are present. Do we want to get more sophisticated than that? I randomly stumbled into yup recently. https://github.com/jquense/yup Looks interesting. Can get more specific in terms of validation & maybe easier ??? to run both front-end & back-end. I don't have a lot of experience with schema validation. Thoughts?

dcslagel commented 4 years ago

One of the main uses of a Wellio.js schema is giving related projects like Lasio the option to use a Wellio.js schema as a json output specification. There has been exploratory interest in outputting Lasio to Wellio.js format. Given my limited knowledge, type and presence are enough schema information for this purpose. Is this direction something that should be pursued?

The Yup tool looks like it has some additional functionality. It can make sense to add Yup integration to the roadmap if use cases are identified and prioritized. That said it doesn't seem a priority feature at the moment. Alternative views welcome. :-)

JustinGOSSES commented 4 years ago

Good comments. Sounds about right. I'm going to tag this with "question" tag and leave it here. There's a variety of issuses like this which are more thoughts. I'll try to tag them with "question".