From 306c5b81cb1d76f7853391bcba5b038f0bb36732 Mon Sep 17 00:00:00 2001 From: Petra Maier Date: Wed, 5 Jun 2024 12:31:03 +0200 Subject: [PATCH 1/6] Adjust describedBy properties according to the fix transformation --- src/test/resources/schemas/describedBy.json | 143 ++++++++++---------- 1 file changed, 72 insertions(+), 71 deletions(-) diff --git a/src/test/resources/schemas/describedBy.json b/src/test/resources/schemas/describedBy.json index 804d1e4045..2bc6910a7e 100644 --- a/src/test/resources/schemas/describedBy.json +++ b/src/test/resources/schemas/describedBy.json @@ -21,76 +21,6 @@ "title": "Label of the description", "type": "string" }, - "dateCreated": { - "title": "Creation date of the metadata record", - "type": "string", - "pattern": "^(((\\d{4})(0[13578]|10|12)(0[1-9]|[12][0-9]|3[01]))|((\\d{4})(0[469]|11)([0][1-9]|[12][0-9]|30))|((\\d{4})(02)(0[1-9]|1[0-9]|2[0-8]))|(([02468][048]00)(02)(29))|(([13579][26]00) (02)(29))|(([0-9][0-9][0][48])(02)(29))|(([0-9][0-9][2468][048])(02)(29))|(([0-9][0-9][13579][26])(02)(29))|(00000000)|(88888888)|(99999999))?$" - }, - "dateModified": { - "title": "Modification date of the metadata record", - "type": "string", - "pattern": "^(((\\d{4})(0[13578]|10|12)(0[1-9]|[12][0-9]|3[01]))|((\\d{4})(0[469]|11)([0][1-9]|[12][0-9]|30))|((\\d{4})(02)(0[1-9]|1[0-9]|2[0-8]))|(([02468][048]00)(02)(29))|(([13579][26]00) (02)(29))|(([0-9][0-9][0][48])(02)(29))|(([0-9][0-9][2468][048])(02)(29))|(([0-9][0-9][13579][26])(02)(29))|(00000000)|(88888888)|(99999999))?$" - }, - "provider": { - "title": "Provider of the metadata record", - "type": "object", - "properties": { - "id": { - "title": "lobid-organisations URI", - "type": "string", - "format": "uri", - "pattern": "^http:\\/\\/lobid.org\\/organisations\\/\\D{1,4}-[A-Za-z0-9-:\\/]{1,11}" - }, - "label": { - "title": "label", - "type": "string" - } - }, - "required": [ - "id", - "label" - ] - }, - "sourceOrganization": { - "title": "Organization that added the record to the union catalog", - "type": "object", - "properties": { - "id": { - "title": "lobid-organisations URI", - "type": "string", - "format": "uri", - "pattern": "^http:\\/\\/lobid.org\\/organisations\\/\\D{1,4}-[A-Za-z0-9-:\\/]{1,11}" - }, - "label": { - "title": "label", - "type": "string" - } - }, - "required": [ - "id", - "label" - ] - }, - "modifiedBy": { - "title": "Organization from which the record was last modified", - "type": "object", - "properties": { - "id": { - "title": "lobid-organisations URI", - "type": "string", - "format": "uri", - "pattern": "^http:\\/\\/lobid.org\\/organisations\\/\\D{1,4}-[A-Za-z0-9-:\\/]{1,11}" - }, - "label": { - "title": "label", - "type": "string" - } - }, - "required": [ - "id", - "label" - ] - }, "inDataset": { "title": "Link to the dataset that contains the record", "type": "object", @@ -154,6 +84,18 @@ "type": "string", "format": "uri" }, + "dateCreated": { + "title": "Creation date of the metadata record", + "type": "string", + "format": "date", + "pattern": "^\\d{4}-\\d{2}-\\d{2}" + }, + "dateModified": { + "title": "Modification date of the metadata record", + "type": "string", + "format": "date", + "pattern": "^\\d{4}-\\d{2}-\\d{2}" + }, "label": { "type": "string" }, @@ -176,6 +118,66 @@ "const": "hbz_unioncatalog" } } + }, + "sourceOrganization": { + "title": "Organization that added the record to the union catalog", + "type": "object", + "properties": { + "id": { + "title": "lobid-organisations URI", + "type": "string", + "format": "uri", + "pattern": "^http:\\/\\/lobid.org\\/organisations\\/\\D{1,4}-[A-Za-z0-9-:\\/]{1,11}" + }, + "label": { + "title": "label", + "type": "string" + } + }, + "required": [ + "id", + "label" + ] + }, + "provider": { + "title": "Provider of the metadata record", + "type": "object", + "properties": { + "id": { + "title": "lobid-organisations URI", + "type": "string", + "format": "uri", + "pattern": "^http:\\/\\/lobid.org\\/organisations\\/\\D{1,4}-[A-Za-z0-9-:\\/]{1,11}" + }, + "label": { + "title": "label", + "type": "string" + } + }, + "required": [ + "id", + "label" + ] + }, + "modifiedBy": { + "title": "Organization from which the record was last modified", + "type": "array", + "properties": { + "id": { + "title": "lobid-organisations URI", + "type": "string", + "format": "uri", + "pattern": "^http:\\/\\/lobid.org\\/organisations\\/\\D{1,4}-[A-Za-z0-9-:\\/]{1,11}" + }, + "label": { + "title": "label", + "type": "string" + } + }, + "required": [ + "id", + "label" + ] } }, "required": [ @@ -226,7 +228,6 @@ "id", "type", "label", - "dateCreated", "inDataset", "resultOf", "license" From cd99bd9f8219c97795ba62c707abb635fa3e85c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Wed, 5 Jun 2024 13:19:19 +0200 Subject: [PATCH 2/6] Format file #1340 --- src/test/resources/schemas/describedBy.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/resources/schemas/describedBy.json b/src/test/resources/schemas/describedBy.json index 2bc6910a7e..631a49c94b 100644 --- a/src/test/resources/schemas/describedBy.json +++ b/src/test/resources/schemas/describedBy.json @@ -86,13 +86,13 @@ }, "dateCreated": { "title": "Creation date of the metadata record", - "type": "string", + "type": "string", "format": "date", "pattern": "^\\d{4}-\\d{2}-\\d{2}" }, "dateModified": { "title": "Modification date of the metadata record", - "type": "string", + "type": "string", "format": "date", "pattern": "^\\d{4}-\\d{2}-\\d{2}" }, @@ -118,7 +118,7 @@ "const": "hbz_unioncatalog" } } - }, + }, "sourceOrganization": { "title": "Organization that added the record to the union catalog", "type": "object", @@ -232,4 +232,4 @@ "resultOf", "license" ] -} \ No newline at end of file +} From c551c6e8b60b8a5a6bc86855c8ebce7b4554c2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Wed, 5 Jun 2024 13:20:19 +0200 Subject: [PATCH 3/6] Adjust array and item structure of `modifiedBy` #1340 --- src/test/resources/schemas/describedBy.json | 33 +++++++++++---------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/test/resources/schemas/describedBy.json b/src/test/resources/schemas/describedBy.json index 631a49c94b..0541324cb9 100644 --- a/src/test/resources/schemas/describedBy.json +++ b/src/test/resources/schemas/describedBy.json @@ -162,22 +162,25 @@ "modifiedBy": { "title": "Organization from which the record was last modified", "type": "array", - "properties": { - "id": { - "title": "lobid-organisations URI", - "type": "string", - "format": "uri", - "pattern": "^http:\\/\\/lobid.org\\/organisations\\/\\D{1,4}-[A-Za-z0-9-:\\/]{1,11}" + "items": { + "properties": { + "id": { + "title": "lobid-organisations URI", + "type": "string", + "format": "uri", + "pattern": "^http:\\/\\/lobid.org\\/organisations\\/\\D{1,4}-[A-Za-z0-9-:\\/]{1,11}" + }, + "label": { + "title": "label", + "type": "string" + } }, - "label": { - "title": "label", - "type": "string" - } - }, - "required": [ - "id", - "label" - ] + "type": "object", + "required": [ + "id", + "label" + ] + } } }, "required": [ From 8b690062b3afa961da79141ae0392400d463c779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Fri, 2 Aug 2024 10:46:18 +0200 Subject: [PATCH 4/6] Make dateCreated a required property #1340 --- src/test/resources/schemas/describedBy.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/resources/schemas/describedBy.json b/src/test/resources/schemas/describedBy.json index 0541324cb9..ee42e1dac1 100644 --- a/src/test/resources/schemas/describedBy.json +++ b/src/test/resources/schemas/describedBy.json @@ -187,7 +187,8 @@ "id", "type", "label", - "inDataset" + "inDataset", + "dateCreated" ] }, "endTime": { From f5cc4e12b839ba1933323bbed84d5a4c2564b92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Fri, 2 Aug 2024 10:51:06 +0200 Subject: [PATCH 5/6] Drop the pattern for provider, sourceOrganization and modifiedBy #1340 This is to allow institutions that are not specified by an ISIL as ebsco or proquest but have OCLC or ALMA institution codes. See https://github.com/hbz/lobid-resources/issues/1438 --- src/test/resources/schemas/describedBy.json | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/test/resources/schemas/describedBy.json b/src/test/resources/schemas/describedBy.json index ee42e1dac1..15d1d48d51 100644 --- a/src/test/resources/schemas/describedBy.json +++ b/src/test/resources/schemas/describedBy.json @@ -126,8 +126,7 @@ "id": { "title": "lobid-organisations URI", "type": "string", - "format": "uri", - "pattern": "^http:\\/\\/lobid.org\\/organisations\\/\\D{1,4}-[A-Za-z0-9-:\\/]{1,11}" + "format": "uri" }, "label": { "title": "label", @@ -146,8 +145,7 @@ "id": { "title": "lobid-organisations URI", "type": "string", - "format": "uri", - "pattern": "^http:\\/\\/lobid.org\\/organisations\\/\\D{1,4}-[A-Za-z0-9-:\\/]{1,11}" + "format": "uri" }, "label": { "title": "label", @@ -167,8 +165,7 @@ "id": { "title": "lobid-organisations URI", "type": "string", - "format": "uri", - "pattern": "^http:\\/\\/lobid.org\\/organisations\\/\\D{1,4}-[A-Za-z0-9-:\\/]{1,11}" + "format": "uri" }, "label": { "title": "label", From f8da109f934a0515c3ded5d7de2b9bd5852e42e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Mon, 5 Aug 2024 09:31:19 +0200 Subject: [PATCH 6/6] Adjust schema for spatial #1340 To validate RPB spatial info. --- src/test/resources/schemas/spatial.json | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/test/resources/schemas/spatial.json b/src/test/resources/schemas/spatial.json index c06a690446..8c633b195a 100644 --- a/src/test/resources/schemas/spatial.json +++ b/src/test/resources/schemas/spatial.json @@ -2,7 +2,7 @@ "$id": "spatial.json", "$schema": "http://json-schema.org/draft-07/schema#", "title": "Spatial", - "description": "Object for NWBib spatial classification", + "description": "Object for NWBib and RPB spatial classification", "type": "array", "items": { "type": "object", @@ -30,7 +30,10 @@ "id": { "type": "string", "format": "uri", - "const": "https://nwbib.de/spatial" + "enum": [ + "https://nwbib.de/spatial", + "https://rpb.lobid.org/spatial" + ] }, "label": { "type": "string" @@ -58,10 +61,12 @@ "type": "object", "properties": { "lat": { - "type": "number" + "type": "string", + "pattern": "[\\d]*\\.[\\d]*" }, "lon": { - "type": "number" + "type": "string", + "pattern": "[\\d]*\\.[\\d]*" } } }