From 9cf049a92081be0e718676bd229f1827f769996b Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Thu, 1 Oct 2020 17:25:21 -0400 Subject: [PATCH 1/3] add note fixtures --- fixtures/invalid/collection/invalid-format.json | 4 ++-- fixtures/invalid/collection/invalid-type.json | 4 ++-- fixtures/invalid/collection/no-category.json | 4 ++-- fixtures/invalid/collection/no-creators.json | 4 ++-- fixtures/invalid/collection/no-dates.json | 4 ++-- fixtures/invalid/collection/no-extents.json | 4 ++-- .../collection/no-external-identifiers.json | 4 ++-- fixtures/invalid/collection/no-formats.json | 4 ++-- fixtures/invalid/collection/no-group.json | 4 ++-- fixtures/invalid/collection/no-languages.json | 4 ++-- fixtures/invalid/collection/no-online.json | 4 ++-- fixtures/invalid/collection/no-title.json | 4 ++-- fixtures/invalid/collection/no-type.json | 4 ++-- fixtures/invalid/note/invalid-subnote-content.json | 14 ++++++++++++++ fixtures/invalid/note/invalid-subnote-items.json | 12 ++++++++++++ fixtures/invalid/note/invalid-subnote-type.json | 14 ++++++++++++++ fixtures/invalid/note/invalid-type.json | 14 ++++++++++++++ fixtures/invalid/note/missing-source.json | 13 +++++++++++++ fixtures/invalid/note/missing-subnote-type.json | 13 +++++++++++++ fixtures/invalid/note/missing-subnotes.json | 6 ++++++ fixtures/invalid/note/missing-title.json | 14 ++++++++++++++ fixtures/invalid/note/missing-type.json | 13 +++++++++++++ .../collection/3pnr9kariwnqpin5fohkv2hzs2.json | 4 ++-- .../collection/3y5m8r7tfh7sffmctu3j3sf7i2.json | 2 +- .../collection/6fhp4ngwucppqic8zexd5ni6u3.json | 14 +++++++------- fixtures/valid/note/1.json | 14 ++++++++++++++ 26 files changed, 163 insertions(+), 36 deletions(-) create mode 100644 fixtures/invalid/note/invalid-subnote-content.json create mode 100644 fixtures/invalid/note/invalid-subnote-items.json create mode 100644 fixtures/invalid/note/invalid-subnote-type.json create mode 100644 fixtures/invalid/note/invalid-type.json create mode 100644 fixtures/invalid/note/missing-source.json create mode 100644 fixtures/invalid/note/missing-subnote-type.json create mode 100644 fixtures/invalid/note/missing-subnotes.json create mode 100644 fixtures/invalid/note/missing-title.json create mode 100644 fixtures/invalid/note/missing-type.json create mode 100644 fixtures/valid/note/1.json diff --git a/fixtures/invalid/collection/invalid-format.json b/fixtures/invalid/collection/invalid-format.json index eeee170..76a43cd 100644 --- a/fixtures/invalid/collection/invalid-format.json +++ b/fixtures/invalid/collection/invalid-format.json @@ -204,7 +204,7 @@ } ], "title": "Arrangement:", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -218,7 +218,7 @@ } ], "title": "Summary:", - "type": "multipart" + "type": "abstract" } ], "online": false, diff --git a/fixtures/invalid/collection/invalid-type.json b/fixtures/invalid/collection/invalid-type.json index 4be4657..c08a0b7 100644 --- a/fixtures/invalid/collection/invalid-type.json +++ b/fixtures/invalid/collection/invalid-type.json @@ -204,7 +204,7 @@ } ], "title": "Arrangement:", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -218,7 +218,7 @@ } ], "title": "Summary:", - "type": "multipart" + "type": "abstract" } ], "online": false, diff --git a/fixtures/invalid/collection/no-category.json b/fixtures/invalid/collection/no-category.json index 036ceb5..0afec2b 100644 --- a/fixtures/invalid/collection/no-category.json +++ b/fixtures/invalid/collection/no-category.json @@ -203,7 +203,7 @@ } ], "title": "Arrangement:", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -217,7 +217,7 @@ } ], "title": "Summary:", - "type": "multipart" + "type": "abstract" } ], "online": false, diff --git a/fixtures/invalid/collection/no-creators.json b/fixtures/invalid/collection/no-creators.json index c0daa05..bab5ece 100644 --- a/fixtures/invalid/collection/no-creators.json +++ b/fixtures/invalid/collection/no-creators.json @@ -177,7 +177,7 @@ } ], "title": "Arrangement:", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -191,7 +191,7 @@ } ], "title": "Summary:", - "type": "multipart" + "type": "abstract" } ], "online": false, diff --git a/fixtures/invalid/collection/no-dates.json b/fixtures/invalid/collection/no-dates.json index d47c995..5e58f3a 100644 --- a/fixtures/invalid/collection/no-dates.json +++ b/fixtures/invalid/collection/no-dates.json @@ -195,7 +195,7 @@ } ], "title": "Arrangement:", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -209,7 +209,7 @@ } ], "title": "Summary:", - "type": "multipart" + "type": "abstract" } ], "online": false, diff --git a/fixtures/invalid/collection/no-extents.json b/fixtures/invalid/collection/no-extents.json index 0149e9c..35acad6 100644 --- a/fixtures/invalid/collection/no-extents.json +++ b/fixtures/invalid/collection/no-extents.json @@ -195,7 +195,7 @@ } ], "title": "Arrangement:", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -209,7 +209,7 @@ } ], "title": "Summary:", - "type": "multipart" + "type": "abstract" } ], "online": false, diff --git a/fixtures/invalid/collection/no-external-identifiers.json b/fixtures/invalid/collection/no-external-identifiers.json index fe0b9ce..56dbf65 100644 --- a/fixtures/invalid/collection/no-external-identifiers.json +++ b/fixtures/invalid/collection/no-external-identifiers.json @@ -199,7 +199,7 @@ } ], "title": "Arrangement:", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -213,7 +213,7 @@ } ], "title": "Summary:", - "type": "multipart" + "type": "abstract" } ], "online": false, diff --git a/fixtures/invalid/collection/no-formats.json b/fixtures/invalid/collection/no-formats.json index 325be2f..c7fa564 100644 --- a/fixtures/invalid/collection/no-formats.json +++ b/fixtures/invalid/collection/no-formats.json @@ -202,7 +202,7 @@ } ], "title": "Arrangement:", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -216,7 +216,7 @@ } ], "title": "Summary:", - "type": "multipart" + "type": "abstract" } ], "online": false, diff --git a/fixtures/invalid/collection/no-group.json b/fixtures/invalid/collection/no-group.json index b82ba64..1cb90b9 100644 --- a/fixtures/invalid/collection/no-group.json +++ b/fixtures/invalid/collection/no-group.json @@ -199,7 +199,7 @@ } ], "title": "Arrangement:", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -213,7 +213,7 @@ } ], "title": "Summary:", - "type": "multipart" + "type": "abstract" } ], "online": false, diff --git a/fixtures/invalid/collection/no-languages.json b/fixtures/invalid/collection/no-languages.json index 4b18755..e66de38 100644 --- a/fixtures/invalid/collection/no-languages.json +++ b/fixtures/invalid/collection/no-languages.json @@ -199,7 +199,7 @@ } ], "title": "Arrangement:", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -213,7 +213,7 @@ } ], "title": "Summary:", - "type": "multipart" + "type": "abstract" } ], "online": false, diff --git a/fixtures/invalid/collection/no-online.json b/fixtures/invalid/collection/no-online.json index e7c6066..9ab43fd 100644 --- a/fixtures/invalid/collection/no-online.json +++ b/fixtures/invalid/collection/no-online.json @@ -204,7 +204,7 @@ } ], "title": "Arrangement:", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -218,7 +218,7 @@ } ], "title": "Summary:", - "type": "multipart" + "type": "abstract" } ], "organizations": [ diff --git a/fixtures/invalid/collection/no-title.json b/fixtures/invalid/collection/no-title.json index 8b0d5d8..63c77b6 100644 --- a/fixtures/invalid/collection/no-title.json +++ b/fixtures/invalid/collection/no-title.json @@ -204,7 +204,7 @@ } ], "title": "Arrangement:", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -218,7 +218,7 @@ } ], "title": "Summary:", - "type": "multipart" + "type": "abstract" } ], "online": false, diff --git a/fixtures/invalid/collection/no-type.json b/fixtures/invalid/collection/no-type.json index 9b34eed..0797a80 100644 --- a/fixtures/invalid/collection/no-type.json +++ b/fixtures/invalid/collection/no-type.json @@ -204,7 +204,7 @@ } ], "title": "Arrangement:", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -218,7 +218,7 @@ } ], "title": "Summary:", - "type": "multipart" + "type": "abstract" } ], "online": false, diff --git a/fixtures/invalid/note/invalid-subnote-content.json b/fixtures/invalid/note/invalid-subnote-content.json new file mode 100644 index 0000000..aa7cec4 --- /dev/null +++ b/fixtures/invalid/note/invalid-subnote-content.json @@ -0,0 +1,14 @@ +{ + "source": "archivesspace", + "subnotes": [ + { + "content": [ + {"key": "value"} + ], + "items": [], + "type": "text" + } + ], + "title": "Conditions Governing Access", + "type": "accessrestrict" +} diff --git a/fixtures/invalid/note/invalid-subnote-items.json b/fixtures/invalid/note/invalid-subnote-items.json new file mode 100644 index 0000000..306261d --- /dev/null +++ b/fixtures/invalid/note/invalid-subnote-items.json @@ -0,0 +1,12 @@ +{ + "source": "archivesspace", + "subnotes": [ + { + "content": [], + "items": ["Open for research with select materials restricted as noted. Brittle or damaged items are available at the discretion of RAC.\n\nResearchers interested in accessing digital media (floppy disks, CDs, DVDs, etc.) or audiovisual material (audio cassettes, VHS, etc.) in this collection must use an access surrogate. The original items may not be accessed because of preservation concerns. To request an access surrogate be made, or if you are unsure if there is an access surrogate, please contact an archivist."], + "type": "text" + } + ], + "title": "Conditions Governing Access", + "type": "accessrestrict" +} diff --git a/fixtures/invalid/note/invalid-subnote-type.json b/fixtures/invalid/note/invalid-subnote-type.json new file mode 100644 index 0000000..7e5af31 --- /dev/null +++ b/fixtures/invalid/note/invalid-subnote-type.json @@ -0,0 +1,14 @@ +{ + "source": "archivesspace", + "subnotes": [ + { + "content": [ + "Open for research with select materials restricted as noted. Brittle or damaged items are available at the discretion of RAC.\n\nResearchers interested in accessing digital media (floppy disks, CDs, DVDs, etc.) or audiovisual material (audio cassettes, VHS, etc.) in this collection must use an access surrogate. The original items may not be accessed because of preservation concerns. To request an access surrogate be made, or if you are unsure if there is an access surrogate, please contact an archivist." + ], + "items": [], + "type": "accessrestrict" + } + ], + "title": "Conditions Governing Access", + "type": "accessrestrict" +} diff --git a/fixtures/invalid/note/invalid-type.json b/fixtures/invalid/note/invalid-type.json new file mode 100644 index 0000000..5053f9d --- /dev/null +++ b/fixtures/invalid/note/invalid-type.json @@ -0,0 +1,14 @@ +{ + "source": "archivesspace", + "subnotes": [ + { + "content": [ + "Open for research with select materials restricted as noted. Brittle or damaged items are available at the discretion of RAC.\n\nResearchers interested in accessing digital media (floppy disks, CDs, DVDs, etc.) or audiovisual material (audio cassettes, VHS, etc.) in this collection must use an access surrogate. The original items may not be accessed because of preservation concerns. To request an access surrogate be made, or if you are unsure if there is an access surrogate, please contact an archivist." + ], + "items": [], + "type": "text" + } + ], + "title": "Conditions Governing Access", + "type": "multipart" +} diff --git a/fixtures/invalid/note/missing-source.json b/fixtures/invalid/note/missing-source.json new file mode 100644 index 0000000..701b46a --- /dev/null +++ b/fixtures/invalid/note/missing-source.json @@ -0,0 +1,13 @@ +{ + "subnotes": [ + { + "content": [ + "Open for research with select materials restricted as noted. Brittle or damaged items are available at the discretion of RAC.\n\nResearchers interested in accessing digital media (floppy disks, CDs, DVDs, etc.) or audiovisual material (audio cassettes, VHS, etc.) in this collection must use an access surrogate. The original items may not be accessed because of preservation concerns. To request an access surrogate be made, or if you are unsure if there is an access surrogate, please contact an archivist." + ], + "items": [], + "type": "text" + } + ], + "title": "Conditions Governing Access", + "type": "accessrestrict" +} diff --git a/fixtures/invalid/note/missing-subnote-type.json b/fixtures/invalid/note/missing-subnote-type.json new file mode 100644 index 0000000..a633413 --- /dev/null +++ b/fixtures/invalid/note/missing-subnote-type.json @@ -0,0 +1,13 @@ +{ + "source": "archivesspace", + "subnotes": [ + { + "content": [ + "Open for research with select materials restricted as noted. Brittle or damaged items are available at the discretion of RAC.\n\nResearchers interested in accessing digital media (floppy disks, CDs, DVDs, etc.) or audiovisual material (audio cassettes, VHS, etc.) in this collection must use an access surrogate. The original items may not be accessed because of preservation concerns. To request an access surrogate be made, or if you are unsure if there is an access surrogate, please contact an archivist." + ], + "items": [] + } + ], + "title": "Conditions Governing Access", + "type": "accessrestrict" +} diff --git a/fixtures/invalid/note/missing-subnotes.json b/fixtures/invalid/note/missing-subnotes.json new file mode 100644 index 0000000..5e064a6 --- /dev/null +++ b/fixtures/invalid/note/missing-subnotes.json @@ -0,0 +1,6 @@ +{ + "source": "archivesspace", + "subnotes": [], + "title": "Conditions Governing Access", + "type": "accessrestrict" +} diff --git a/fixtures/invalid/note/missing-title.json b/fixtures/invalid/note/missing-title.json new file mode 100644 index 0000000..8df7148 --- /dev/null +++ b/fixtures/invalid/note/missing-title.json @@ -0,0 +1,14 @@ +{ + "source": "archivesspace", + "subnotes": [ + { + "content": [ + "Open for research with select materials restricted as noted. Brittle or damaged items are available at the discretion of RAC.\n\nResearchers interested in accessing digital media (floppy disks, CDs, DVDs, etc.) or audiovisual material (audio cassettes, VHS, etc.) in this collection must use an access surrogate. The original items may not be accessed because of preservation concerns. To request an access surrogate be made, or if you are unsure if there is an access surrogate, please contact an archivist." + ], + "items": [], + "type": "text" + } + ], + "type": "accessrestrict", + "title": "" +} diff --git a/fixtures/invalid/note/missing-type.json b/fixtures/invalid/note/missing-type.json new file mode 100644 index 0000000..285d19a --- /dev/null +++ b/fixtures/invalid/note/missing-type.json @@ -0,0 +1,13 @@ +{ + "source": "archivesspace", + "subnotes": [ + { + "content": [ + "Open for research with select materials restricted as noted. Brittle or damaged items are available at the discretion of RAC.\n\nResearchers interested in accessing digital media (floppy disks, CDs, DVDs, etc.) or audiovisual material (audio cassettes, VHS, etc.) in this collection must use an access surrogate. The original items may not be accessed because of preservation concerns. To request an access surrogate be made, or if you are unsure if there is an access surrogate, please contact an archivist." + ], + "items": [], + "type": "text" + } + ], + "title": "Conditions Governing Access" +} diff --git a/fixtures/valid/collection/3pnr9kariwnqpin5fohkv2hzs2.json b/fixtures/valid/collection/3pnr9kariwnqpin5fohkv2hzs2.json index 2fe869b..700b4b4 100644 --- a/fixtures/valid/collection/3pnr9kariwnqpin5fohkv2hzs2.json +++ b/fixtures/valid/collection/3pnr9kariwnqpin5fohkv2hzs2.json @@ -204,7 +204,7 @@ } ], "title": "Arrangement:", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -218,7 +218,7 @@ } ], "title": "Summary:", - "type": "multipart" + "type": "scopecontent" } ], "online": false, diff --git a/fixtures/valid/collection/3y5m8r7tfh7sffmctu3j3sf7i2.json b/fixtures/valid/collection/3y5m8r7tfh7sffmctu3j3sf7i2.json index 67f705f..cf7a1a1 100644 --- a/fixtures/valid/collection/3y5m8r7tfh7sffmctu3j3sf7i2.json +++ b/fixtures/valid/collection/3y5m8r7tfh7sffmctu3j3sf7i2.json @@ -139,7 +139,7 @@ } ], "title": "Other Finding Aids", - "type": "multipart" + "type": "otherfindaid" } ], "online": false, diff --git a/fixtures/valid/collection/6fhp4ngwucppqic8zexd5ni6u3.json b/fixtures/valid/collection/6fhp4ngwucppqic8zexd5ni6u3.json index f7d0228..9d7c338 100644 --- a/fixtures/valid/collection/6fhp4ngwucppqic8zexd5ni6u3.json +++ b/fixtures/valid/collection/6fhp4ngwucppqic8zexd5ni6u3.json @@ -148,7 +148,7 @@ } ], "title": "Arrangement", - "type": "multipart" + "type": "arrangement" }, { "source": "archivesspace", @@ -162,7 +162,7 @@ } ], "title": "Related Archival Materials", - "type": "multipart" + "type": "relatedmaterial" }, { "source": "archivesspace", @@ -176,7 +176,7 @@ } ], "title": "Scope and Contents", - "type": "multipart" + "type": "scopecontent" }, { "source": "archivesspace", @@ -190,7 +190,7 @@ } ], "title": "Biographical / Historical", - "type": "multipart" + "type": "bioghist" }, { "source": "archivesspace", @@ -204,7 +204,7 @@ } ], "title": "Preferred Citation", - "type": "multipart" + "type": "prefercite" }, { "source": "archivesspace", @@ -218,7 +218,7 @@ } ], "title": "File Plan", - "type": "multipart" + "type": "fileplan" }, { "source": "archivesspace", @@ -232,7 +232,7 @@ } ], "title": "Conditions Governing Access", - "type": "multipart" + "type": "accessrestrict" } ], "online": false, diff --git a/fixtures/valid/note/1.json b/fixtures/valid/note/1.json new file mode 100644 index 0000000..7c57cab --- /dev/null +++ b/fixtures/valid/note/1.json @@ -0,0 +1,14 @@ +{ + "source": "archivesspace", + "subnotes": [ + { + "content": [ + "Open for research with select materials restricted as noted. Brittle or damaged items are available at the discretion of RAC.\n\nResearchers interested in accessing digital media (floppy disks, CDs, DVDs, etc.) or audiovisual material (audio cassettes, VHS, etc.) in this collection must use an access surrogate. The original items may not be accessed because of preservation concerns. To request an access surrogate be made, or if you are unsure if there is an access surrogate, please contact an archivist." + ], + "items": [], + "type": "text" + } + ], + "title": "Conditions Governing Access", + "type": "accessrestrict" +} From 111e216f1f5cf9e5264d1c654283090f721bcec4 Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Thu, 1 Oct 2020 17:25:40 -0400 Subject: [PATCH 2/3] update note schema --- rac_schemas/schemas/base.json | 106 ++++++++++++++++------------------ rac_schemas/schemas/note.json | 9 +++ 2 files changed, 58 insertions(+), 57 deletions(-) create mode 100644 rac_schemas/schemas/note.json diff --git a/rac_schemas/schemas/base.json b/rac_schemas/schemas/base.json index 28fab59..1db84e3 100644 --- a/rac_schemas/schemas/base.json +++ b/rac_schemas/schemas/base.json @@ -90,7 +90,6 @@ }, "source": { "type": "string", - "minItems": 1, "title": "Date Source", "examples": [ "wikidata", @@ -271,53 +270,50 @@ "$id": "#/definitions/note/properties/type", "type": "string", "minLength": 1, - "items": { - "type": "string", - "enum": [ - "accessrestrict", - "accruals", - "acquinfo", - "altformavail", - "appraisal", - "arrangement", - "bibliography", - "bioghist", - "custodhist", - "fileplan", - "index", - "odd", - "otherfindaid", - "originalsloc", - "phystech", - "prefercite", - "processinfo", - "relatedmaterial", - "scopecontent", - "separatedmaterial", - "userestrict", - "dimensions", - "legalstatus", - "summary", - "edition", - "extent", - "note", - "inscription", - "langmaterial", - "physdesc", - "physloc", - "materialspec", - "physfacet", - "rights_statement", - "rights_statement_act", - "materials", - "type_note", - "additional_information", - "expiration", - "extension", - "permissions", - "restrictions" - ] - }, + "enum": [ + "accessrestrict", + "accruals", + "acquinfo", + "altformavail", + "appraisal", + "arrangement", + "bibliography", + "bioghist", + "custodhist", + "fileplan", + "index", + "odd", + "otherfindaid", + "originalsloc", + "phystech", + "prefercite", + "processinfo", + "relatedmaterial", + "scopecontent", + "separatedmaterial", + "userestrict", + "dimensions", + "legalstatus", + "summary", + "edition", + "extent", + "note", + "inscription", + "langmaterial", + "physdesc", + "physloc", + "materialspec", + "physfacet", + "rights_statement", + "rights_statement_act", + "materials", + "type_note", + "additional_information", + "expiration", + "extension", + "permissions", + "restrictions" + ], "title": "Note Types", "description": "The type of note being used", "examples": [ @@ -339,7 +335,6 @@ "source": { "title": "Notes Source", "type": "string", - "minLength": 1, "examples": [ "wikidata" ], @@ -697,14 +692,11 @@ "type": { "$id": "#/definitions/subnote/properties/type", "type": "string", - "items": { - "type": "string", - "enum": [ - "definedlist", - "orderedlist", - "text" - ] - }, + "enum": [ + "definedlist", + "orderedlist", + "text" + ], "title": "Subnote Type", "minLength": 1, "examples": [ diff --git a/rac_schemas/schemas/note.json b/rac_schemas/schemas/note.json new file mode 100644 index 0000000..f76612c --- /dev/null +++ b/rac_schemas/schemas/note.json @@ -0,0 +1,9 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "note.json", + "type": "object", + "title": "Note schema", + "allOf": [{ + "$ref": "base.json#/definitions/note" + }] +} From 6fccd3517daf1325a58a69d60d5f32b30231e91f Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Thu, 1 Oct 2020 17:25:46 -0400 Subject: [PATCH 3/3] version bump --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5df6f6b..830274d 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ long_description = fh.read() setup(name='rac_schemas', - version='0.23', + version='0.24', description='RAC JSON Schemas and validators', url='http://github.com/RockefellerArchiveCenter/rac_schemas', author='Rockefeller Archive Center',