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

validate the submitted OSTI record against a schema #56

Closed
tloubrieu-jpl opened this issue Aug 6, 2020 · 5 comments
Closed

validate the submitted OSTI record against a schema #56

tloubrieu-jpl opened this issue Aug 6, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@tloubrieu-jpl
Copy link
Member

tloubrieu-jpl commented Aug 6, 2020

Plug the OSTI schema updated by Ron in the code at the DOI validation step.

See comments for schema to use.

@tloubrieu-jpl tloubrieu-jpl added enhancement New feature or request triage-needed labels Aug 6, 2020
@tloubrieu-jpl
Copy link
Member Author

Add a private method to the schematron_validator (osti_validator): _validate_schema().

Add a call to this method in the public validate() method.

@tloubrieu-jpl
Copy link
Member Author

tloubrieu-jpl commented Aug 18, 2020

@jordanpadams
Copy link
Member

New XSD and schema:
iad_1.0.0_20200819.zip

qchaupds pushed a commit that referenced this issue Sep 1, 2020
…ng, add code to compare DOIs, modify config for correctness to OSTI version, modify feature files for ease of search, add implementation in steps.py, add keyword as parameter to 'draft' action, fix bug in 'reserve' action if exception occurred due to issue with 'title', add writing of output files to 'draft' unit tests, add logic when first_name and last_name are swapped by user, fix bug with missing InputFormatException in osti_web_parser.py
@tloubrieu-jpl tloubrieu-jpl added this to the PDS.25 (ends 2020-09-09) milestone Sep 3, 2020
@tloubrieu-jpl
Copy link
Member Author

Comments on the schema:

  • as we use the schema to validate records submitted to OSTI, id and doi should be optional
  • we don't send date_record_added, date_record_updated to OSTI either. Should we ? They are mandatory in the XSD
  • authors/contributors:
    • the order of tags does not feel intuitive (last_name is first). Is there a reason for that ?
    • middle_name is mandatory should that be so ? We can set it empty but I would prefer not to send it if there is none. In the PDS4 example we used we did not find a middle_name, only first_name initial and last_name (see https://pds-imaging.jpl.nasa.gov/data/nsyt/insight_cameras/bundle.xml).
  • contact_name, contact_org, contact_email, contact_phone where in our initial test case, it is not in the XSD, is it missing there or should we remove them from our output ?
  • product_nos is not in the XSD but I think we added that a some point in the development process.

@tloubrieu-jpl
Copy link
Member Author

After feedback from @ron and @jordanpadams Jordan, decision to resolve discrepancies between current DOI output and schema are:

  • in output, if 'id' and 'doi' and not defined yet, empty tags are provided (@qchaupds )
  • date_record_added and date_record_updated are be added to the output (@qchaupds )
  • authors/contributors:
    • in XSD, sequence should be first_name, middle_name, last_name (@ron)
    • in software, the middle_name tag is always generated. It is empty when no value is known (@qchaupds )
  • contact_name, contact_org, contact_email, contact_phone are added to the xsd schema (@ron)
  • product_nos is removed from the software output (@qchaupds ).

@qchaupds, you should implement the necessary code updates for empty tag management in the object which read and write doi object from osti record format. This might also have an impact on the verification rule, hopefully not.

qchaupds pushed a commit that referenced this issue Sep 9, 2020
…lidation, modify templates for 'reserve' and 'draft' to conform to XSD, add config for XSD file, modify features files for 'behave' testing, modify steps.py to match feature verbiage, fix bug with input to 'release' to contain URN instead of URL, add XSD validation to 'draft', 'release' and 'reserve', fix reserve_test.py to conform to new parameters, remove date check with schematron from osti_input_validator.py as XSD would of caught it, add 'date_record_added' to DOI as XSD requires it, add function create_osti_doi_release_record to osti.py, add parsing of 'authors' field in osti_web_parser.py if found, add XSD valildation to doi_validator.py and fix bug with accesing 'doi' fields that are None, modify doi_xml_differ.py logic to handle 'id', 'date_record_added' and clean up print statements.
qchaupds pushed a commit that referenced this issue Sep 14, 2020
… and 'reserve' features. Fix bug with parsing for 'modification_date' when more than one is available, fix bug with 'first_name' and 'last_name' when leading spaces exist, add safeguard when 'publication_date' is string instead of datetime, add parsing of 'product_nos' when 'identifier_value' is not available for some DOI in doi_xml_differ.py
tloubrieu-jpl pushed a commit that referenced this issue Sep 25, 2020
…ng, add code to compare DOIs, modify config for correctness to OSTI version, modify feature files for ease of search, add implementation in steps.py, add keyword as parameter to 'draft' action, fix bug in 'reserve' action if exception occurred due to issue with 'title', add writing of output files to 'draft' unit tests, add logic when first_name and last_name are swapped by user, fix bug with missing InputFormatException in osti_web_parser.py
tloubrieu-jpl pushed a commit that referenced this issue Sep 25, 2020
…lidation, modify templates for 'reserve' and 'draft' to conform to XSD, add config for XSD file, modify features files for 'behave' testing, modify steps.py to match feature verbiage, fix bug with input to 'release' to contain URN instead of URL, add XSD validation to 'draft', 'release' and 'reserve', fix reserve_test.py to conform to new parameters, remove date check with schematron from osti_input_validator.py as XSD would of caught it, add 'date_record_added' to DOI as XSD requires it, add function create_osti_doi_release_record to osti.py, add parsing of 'authors' field in osti_web_parser.py if found, add XSD valildation to doi_validator.py and fix bug with accesing 'doi' fields that are None, modify doi_xml_differ.py logic to handle 'id', 'date_record_added' and clean up print statements.
@rchenatjpl rchenatjpl reopened this Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants