Skip to content

Check that URLs are valid using format: uri #66

@GraemeWatt

Description

@GraemeWatt

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions