From 8aebc6d82a596cd02fa2a88722e11cbabb83cac7 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 4 Nov 2024 10:11:38 -0500 Subject: [PATCH] RF: "upgrade" to datacite v4.5 jsonschema serialization, now from inveniosoftware Done in hope to see "non-standard" identifiers being gone but immediate fail is ___ test_dandimeta_datacite[additional_meta6-datacite_checks6] _ dandischema/tests/test_datacite.py:407: in test_dandimeta_datacite validator.validate(datacite["data"]["attributes"]) venv/3/lib/python3.12/site-packages/jsonschema/validators.py:451: in validate raise error E jsonschema.exceptions.ValidationError: 'DANDI Archive' is not of type 'object' E E Failed validating 'type' in schema['properties']['publisher']: E {'type': 'object', E 'additionalProperties': False, E 'properties': {'name': {'type': 'string'}, E 'publisherIdentifier': {'type': 'string'}, E 'publisherIdentifierScheme': {'type': 'string'}, E 'schemeUri': {'type': 'string', 'format': 'uri'}, E 'lang': {'type': 'string'}}, E 'required': ['name']} E E On instance['publisher']: E 'DANDI Archive' So we need to standardize "publisher" better --- dandischema/datacite.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dandischema/datacite.py b/dandischema/datacite.py index 8833808..0f1a4ce 100644 --- a/dandischema/datacite.py +++ b/dandischema/datacite.py @@ -245,9 +245,12 @@ def to_datacite( def _get_datacite_schema() -> Any: sr = requests.get( - "https://raw.githubusercontent.com/datacite/schema/" - "732cc7ef29f4cad4d6adfac83544133cd57a2e5e/" - "source/json/kernel-4.3/datacite_4.3_schema.json" + # "https://raw.githubusercontent.com/datacite/schema/" + # "732cc7ef29f4cad4d6adfac83544133cd57a2e5e/" + # "source/json/kernel-4.3/datacite_4.3_schema.json" + "https://raw.githubusercontent.com/inveniosoftware/datacite/" + "160250d6c7ebd39f24c93aa5dfdb4dea3169754b/" + "datacite/schemas/datacite-v4.5.json" ) sr.raise_for_status() schema = sr.json()