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

Check that URLs are valid using format: uri #66

Open
GraemeWatt opened this issue Feb 3, 2025 · 0 comments
Open

Check that URLs are valid using format: uri #66

GraemeWatt opened this issue Feb 3, 2025 · 0 comments

Comments

@GraemeWatt
Copy link
Member

The ATLAS record ins2762099 contains:

additional_resources:
- {description: web page with auxiliary material, location: 'https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/PAPERS/STDM-2020-01
    :2024'}

in the submitted submission.yaml file, which appears in the JSON format as:

"resources":[{"description":"web page with auxiliary material","type":"html","url":"https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/PAPERS/STDM-2020-01 :2024"}]

The INSPIRE schema requires URLs to be well-formed using format: uri, creating problems when HEPData metadata with invalid URLs is harvested by INSPIRE. The HEPData JSON schema should be made more strict using format: uri for fields corresponding to URLs, namely, the location in additional_resources_schema.json (only if the location starts with http, since this field is also used for a local resource file), the url of a license in additional_resources_schema.json, the url of a data_license in submission_schema.json, and the data_schema in submission_schema.json.

See Validating Formats for help with the implementation. Note that additional dependencies need to be installed with pip install jsonschema[format] and an argument format_checker=jsonschema.FormatChecker() needs to be passed to the jsonschema.validate function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do
Development

No branches or pull requests

1 participant