bp / bp/resqpy

Validate models against XSD schema

Open
#96 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
67
Forks
18
Avg merge
2h 26m
Merged PRs (30d)
1

Description

We could validate the XML part of models against the published RESQML schema, to check for errors.

This could be available as a function `validate_model` or similar. It could also be used in our test suite, to ensure we are creating each object correctly.

RE implementation, lxml looks promising as it is already a dependency:

- Example here: https://lxml.de/validation.html
- This class looks like it can be used for validation: https://lxml.de/apidoc/lxml.etree.html#lxml.etree.XMLSchema

We would presumably need to have the XSD files available to the code. We should probably check whether we're allowed to include them in the repo; and in the mean time, we could try to get it working against a local copy of the XSDs outside version control.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the proposed validate_model entry point and the lxml XMLSchema documentation, then determine how a local copy of the RESQML XSD files can be supplied. Check whether the schemas may be included in the repository and consider how validation would be used in the test suite; done means model XML is checked against the published schema and errors are reported.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.