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

As a user, I want to throw a WARNING when a product's schematron version does not match the schema version #628

Closed
Tracked by #712
jordanpadams opened this issue Apr 12, 2023 · 3 comments Β· Fixed by #634

Comments

@jordanpadams
Copy link
Member

jordanpadams commented Apr 12, 2023

Checked for duplicates

Yes - I've already checked

πŸ§‘β€πŸ”¬ User Persona(s)

Data User, Archivist

πŸ’ͺ Motivation

...so that I can ensure the versions of the schematron and schema are the same.

πŸ“– Additional Details

Unfortunately, the only way we can really check this is via the filenames in the xml-model element and schemaLocation, but it is better than nothing.

Acceptance Criteria

Given a product label with a v1H00 schematron and a v1J00 schema
When I perform validation of the product
Then I expect a WARNING to be thrown for a version mismatch

Given a product label with a v1H00 schematron and a v1H00 schema
When I perform validation of the product
Then I expect the product to validate successfully

(probably only need a test case for the first acceptance criteria)

βš™οΈ Engineering Details

Test data:
mp2_flat_20061109.xml.txt

@jordanpadams jordanpadams self-assigned this Apr 12, 2023
@jordanpadams jordanpadams changed the title As a user, I want to throw a WARNING is the IM version for a product's schematron does not match its schema As a user, I want to throw a WARNING when a product's schematron version does not match the schema version Apr 12, 2023
@jordanpadams jordanpadams removed their assignment Apr 12, 2023
@jordanpadams jordanpadams added Epic and removed Epic labels Apr 12, 2023
@github-project-automation github-project-automation bot moved this to Release Backlog in B14.0 Apr 12, 2023
@al-niessner
Copy link
Contributor

@jordanpadams

A test set with a successful and failure condition would be helpful. Grepped the code for the versions you listed and found nothing. Not sure where these version numbers exist and how they are used. Therefore, need a good example or test case.

@jordanpadams
Copy link
Member Author

@al-niessner test data added. note schemaLocation references https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1J00.xsd and xml-model references https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1I00.sch

@al-niessner
Copy link
Contributor

@jordanpadams @nutjob4life @tloubrieu-jpl

Worked through the schema loading and schematron loading. Unfortunately the schema is loaded via 3rd party library for validation reasons and the file names are ignored by the label check. The schematron are kept in a Java Map within the label check. It means after schema is loaded, validation takes place, and the schematron is run then the schema filenames will have to be loaded again and compared against the schematron Map. It is a little clunky because it means reading the XML one more time to extract the schema names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: 🏁 Done
Development

Successfully merging a pull request may close this issue.

3 participants