From dc9e19881ad203cccb5d8f9b58f94dfbc03437fa Mon Sep 17 00:00:00 2001 From: claravox Date: Mon, 16 Dec 2024 11:12:31 +0100 Subject: [PATCH] Switch subject to lowercase to match datacite json --- json_datacite.py | 6 ------ json_landing_page.py | 2 +- schemas/epos-msl-0/metadata.json | 8 ++++---- schemas/epos-msl-0/uischema.json | 2 +- templates/landingpage.html.j2 | 6 +++--- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/json_datacite.py b/json_datacite.py index bdf08edce..b2b7ce8cf 100644 --- a/json_datacite.py +++ b/json_datacite.py @@ -177,16 +177,10 @@ def get_subjects(combi): # Assume that there is only one keyword field, # either called HierarchicalKeyword or Keyword - # TODO combine with the json_landing_page one? if "HierarchicalKeyword" in combi: subjects.extend(combi["HierarchicalKeyword"]) - # for keyword in combi["HierarchicalKeyword"]: - # keyword['subject'] = keyword['Subject'] - # del keyword['Subject'] - # subjects.append(keyword) else: for keyword in combi.get('Keyword', []): - # TODO why is this not uppercase here? subjects.append({'subject': keyword, 'subjectScheme': 'Keyword'}) # for backward compatibility. Tag will become obsolete diff --git a/json_landing_page.py b/json_landing_page.py index a20a253f1..bb630bbfe 100644 --- a/json_landing_page.py +++ b/json_landing_page.py @@ -105,7 +105,7 @@ def json_landing_page_create_json_landing_page(ctx, zone, template_name, combi_j keywords.extend(json_data.get("HierarchicalKeyword")) else: for keyword in json_data.get('Keyword', []): - keywords.append({'Subject': keyword, 'subjectScheme': 'Keyword'}) + keywords.append({'subject': keyword, 'subjectScheme': 'Keyword'}) try: disciplines = [] diff --git a/schemas/epos-msl-0/metadata.json b/schemas/epos-msl-0/metadata.json index 2dc435991..36c991d39 100644 --- a/schemas/epos-msl-0/metadata.json +++ b/schemas/epos-msl-0/metadata.json @@ -1005,7 +1005,7 @@ "type": "object", "additionalProperties": false, "properties": { - "Subject": { + "subject": { "$ref": "#/definitions/stringNormal", "title": "Keyword name" }, @@ -1013,16 +1013,16 @@ "$ref": "#/definitions/stringNormal", "title": "Name of the subject scheme" }, - "schemeURI": { + "schemeUri": { "$ref": "#/definitions/stringNormal", "title": "URI of the subject identifier scheme" }, - "valueURI": { + "valueUri": { "$ref": "#/definitions/stringNormal", "title": "URI of the subject term" } }, - "required": ["Subject"] + "required": ["subject"] } }, "Related_Resource": { diff --git a/schemas/epos-msl-0/uischema.json b/schemas/epos-msl-0/uischema.json index 766ebe135..ccc1c37aa 100644 --- a/schemas/epos-msl-0/uischema.json +++ b/schemas/epos-msl-0/uischema.json @@ -49,7 +49,7 @@ "ui:field": "hierarchical_keyword_selector", "ui:data": "https://raw.githubusercontent.com/UtrechtUniversity/msl_vocabularies/refs/heads/main/vocabularies/combined/editor/1.3/editor_1-3.json", "ui:subjectScheme": "EPOS MSL", - "ui:schemeURI": "https://github.com/UtrechtUniversity/msl_vocabularies" + "ui:schemeUri": "https://github.com/UtrechtUniversity/msl_vocabularies" }, "Related_Resource": { "items": { diff --git a/templates/landingpage.html.j2 b/templates/landingpage.html.j2 index 5d76d2d81..d129c2b67 100644 --- a/templates/landingpage.html.j2 +++ b/templates/landingpage.html.j2 @@ -62,12 +62,12 @@
{% for keyword in keywords %} - {% if "valueURI" in keyword %} + {% if "valueUri" in keyword %} - {{ keyword.Subject }} + {{ keyword.subject }} {% else %} - {{ keyword.Subject }} + {{ keyword.subject }} {% endif %} {% endfor %}