diff --git a/CHANGELOG.md b/CHANGELOG.md index 74f3445..a65dca0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Changed + +- Updated included schema files, and added instructions on how to do that to the README + ## [0.12.0] - 2021-10-26 ### Added diff --git a/README.md b/README.md index bd15396..f89bfa6 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,30 @@ You can also pass the raw option to see the JSON as it originally came out of th python -m pytest +### Updating schema files in data + +This library contains the actual data files for different versions of the schema, in the `libcovebods/data` directory. + +To update them, you need: + * a install of the Compile To JSON Schema Tool. https://compiletojsonschema.readthedocs.io/en/latest/index.html + * a checkout of the data standard repository. https://github.com/openownership/data-standard + +To update a file: + +First go to your checkout of the data standard repository and make sure you have checked out the correct tag or branch. +ie. To update the `libcovebods/data/schema-0-2-0.json` file, check out `0.2.0` + +Run the compile tool, telling it where the codelists directory is and pipe the output to the file for the version +you have checked out: + + compiletojsonschema -c openownership-data-standard/schema/codelists/ openownership-data-standard/schema/bods-package.json > openownership-lib-cove-bods/libcovebods/data/schema-0-2-0.json + +Due to https://github.com/openownership/data-standard/issues/375 you may have to do some editing by hand. Open the files +in `libcovebods/data`. At the top level there is an `oneOf` with 3 statement types - people, entity, and ownershipOrControl. +In each of these statement types, there is an enum for the `statementType` field. This enum should have one option only - +the value for whatever type of statement it is. (ie The person statement should only have the `personStatement` value) +This tool may have added extra options - if so, remove them by hand. + ## Code for use by external users The only code that should be used directly by users is the `libcovebods.config` and `libcovebods.api` modules. diff --git a/libcovebods/data/schema-0-1-0.json b/libcovebods/data/schema-0-1-0.json index a9b57f9..d16f3e9 100644 --- a/libcovebods/data/schema-0-1-0.json +++ b/libcovebods/data/schema-0-1-0.json @@ -440,9 +440,9 @@ "description": "Use the [personType codelist](#persontype). The ultimate beneficial owner of a legal entity is always a natural person. Where the beneficial owner has been identified, but information about them cannot be disclosed, use 'anonymousPerson'. Where the beneficial owner has not been clearly identified, use 'unknownPerson'. Where the beneficial owner has been identified use knownPerson.", "type": "string", "enum": [ + "knownPerson", "anonymousPerson", - "unknownPerson", - "knownPerson" + "unknownPerson" ], "propertyOrder": 4, "codelist": "personType.csv", diff --git a/libcovebods/data/schema-0-2-0.json b/libcovebods/data/schema-0-2-0.json index d41007e..e111012 100644 --- a/libcovebods/data/schema-0-2-0.json +++ b/libcovebods/data/schema-0-2-0.json @@ -8,7 +8,7 @@ { "id": "entity-statement.json", "$schema": "http://json-schema.org/draft-04/schema#", - "version": "0.1", + "version": "0.2", "title": "Entity statement", "description": "A statement identifying and describing the entity that is the subject of the ownership or control described in an ownership or control statement.", "type": "object", @@ -44,7 +44,7 @@ }, "entityType": { "title": "Type", - "description": "From the [entityType codelist](#entitytype). What kind of entity is this? The 'registeredEntity' code covers any legal entity created through an act of official registration, usually resulting in an identifier being assigned to the entity. The 'legalEntity' code covers other bodies with distinct legal personality (government departments, international institutions etc.). The 'arrangement' code covers artificial entities, described in the data model for the purpose of associating one or more natural or legal persons together in an ownership or control relationship, but without implying that the parties to this arrangement have any other form of collective legal identity.", + "description": "From the entityType codelist. What kind of entity is this? The 'registeredEntity' code covers any legal entity created through an act of official registration, usually resulting in an identifier being assigned to the entity. The 'legalEntity' code covers other bodies with distinct legal personality (government departments, international institutions etc.). The 'arrangement' code covers artificial entities, described in the data model for the purpose of associating one or more natural or legal persons together in an ownership or control relationship, but without implying that the parties to this arrangement have any other form of collective legal identity.", "type": "string", "enum": [ "registeredEntity", @@ -64,7 +64,7 @@ "properties": { "reason": { "title": "Reason", - "description": "The reason that an entity cannot be specified. From the [unspecifiedReason codelist](#unspecifiedreason).", + "description": "The reason that an entity cannot be specified. From the unspecifiedReason codelist.", "type": "string", "enum": [ "no-beneficial-owners", @@ -72,8 +72,8 @@ "interested-party-has-not-provided-information", "subject-exempt-from-disclosure", "interested-party-exempt-from-disclosure", - "information-unknown-to-publisher", - "unknown" + "unknown", + "information-unknown-to-publisher" ], "codelist": "unspecifiedReason.csv", "openCodelist": false @@ -203,7 +203,7 @@ "properties": { "type": { "title": "Type", - "description": "What type of address is this? See the [addressType](#addresstype) codelist.", + "description": "What type of address is this? See the addressType codelist.", "type": "string", "enum": [ "placeOfBirth", @@ -325,7 +325,7 @@ "properties": { "type": { "title": "Source type", - "description": "What type of source is this? Multiple tags can be combined. Values should come from the [source type](#sourcetype) codelist.", + "description": "What type of source is this? Multiple tags can be combined. Values should come from the source type codelist.", "type": "array", "items": { "type": "string", @@ -423,7 +423,7 @@ }, "motivation": { "title": "Motivation", - "description": "The motivation for this annotation, chosen from a codelist. See the [annotationMotivation](#annotationmotivation) codelist.", + "description": "The motivation for this annotation, chosen from a codelist. See the annotationMotivation codelist.", "type": "string", "enum": [ "commenting", @@ -499,7 +499,7 @@ { "id": "person-statement.json", "$schema": "http://json-schema.org/draft-04/schema#", - "version": "0.1", + "version": "0.2", "type": "object", "title": "Person statement", "description": "A person statement describes the information known about a natural person at a particular point in time, or from a given submission of information", @@ -537,12 +537,12 @@ }, "personType": { "title": "Person type", - "description": "Use the [personType codelist](#persontype). The ultimate beneficial owner of a legal entity is always a natural person. Where the beneficial owner has been identified, but information about them cannot be disclosed, use 'anonymousPerson'. Where the beneficial owner has not been clearly identified, use 'unknownPerson'. Where the beneficial owner has been identified use knownPerson. Where a person has the type 'anonymousPerson' or 'unknownPerson' a reason for the absence of information SHOULD be provided in 'unspecifiedPersonDetails')", + "description": "Use the personType codelist. The ultimate beneficial owner of a legal entity is always a natural person. Where the beneficial owner has been identified, but information about them cannot be disclosed, use 'anonymousPerson'. Where the beneficial owner has not been clearly identified, use 'unknownPerson'. Where the beneficial owner has been identified use knownPerson. Where a person has the type 'anonymousPerson' or 'unknownPerson' a reason for the absence of information SHOULD be provided in 'unspecifiedPersonDetails')", "type": "string", "enum": [ + "knownPerson", "anonymousPerson", - "unknownPerson", - "knownPerson" + "unknownPerson" ], "propertyOrder": 4, "codelist": "personType.csv", @@ -555,7 +555,7 @@ "properties": { "reason": { "title": "Reason", - "description": "The reason that an interested party cannot be specified. From the [unspecifiedReason codelist](#unspecifiedreason).", + "description": "The reason that an interested party cannot be specified. From the unspecifiedReason codelist.", "type": "string", "enum": [ "no-beneficial-owners", @@ -591,7 +591,7 @@ "properties": { "type": { "title": "Type", - "description": "What kind of name is this? See the [nameType](#nametype) codelist.", + "description": "What kind of name is this? See the nameType codelist.", "type": "string", "enum": [ "individual", @@ -712,7 +712,7 @@ "properties": { "type": { "title": "Type", - "description": "What type of address is this? See the [addressType](#addresstype) codelist.", + "description": "What type of address is this? See the addressType codelist.", "type": "string", "enum": [ "placeOfBirth", @@ -766,7 +766,7 @@ "properties": { "type": { "title": "Type", - "description": "What type of address is this? See the [addressType](#addresstype) codelist.", + "description": "What type of address is this? See the addressType codelist.", "type": "string", "enum": [ "placeOfBirth", @@ -835,7 +835,7 @@ "properties": { "type": { "title": "Type", - "description": "What type of address is this? See the [addressType](#addresstype) codelist.", + "description": "What type of address is this? See the addressType codelist.", "type": "string", "enum": [ "placeOfBirth", @@ -932,7 +932,7 @@ "properties": { "type": { "title": "Source type", - "description": "What type of source is this? Multiple tags can be combined. Values should come from the [source type](#sourcetype) codelist.", + "description": "What type of source is this? Multiple tags can be combined. Values should come from the source type codelist.", "type": "array", "items": { "type": "string", @@ -1061,7 +1061,7 @@ "properties": { "type": { "title": "Source type", - "description": "What type of source is this? Multiple tags can be combined. Values should come from the [source type](#sourcetype) codelist.", + "description": "What type of source is this? Multiple tags can be combined. Values should come from the source type codelist.", "type": "array", "items": { "type": "string", @@ -1159,7 +1159,7 @@ }, "motivation": { "title": "Motivation", - "description": "The motivation for this annotation, chosen from a codelist. See the [annotationMotivation](#annotationmotivation) codelist.", + "description": "The motivation for this annotation, chosen from a codelist. See the annotationMotivation codelist.", "type": "string", "enum": [ "commenting", @@ -1247,7 +1247,7 @@ { "id": "ownership-or-control-statement.json", "$schema": "http://json-schema.org/draft-04/schema#", - "version": "0.1", + "version": "0.2", "title": "Ownership or control Statement", "description": "An ownership or control statement is made up of an entity, an interested party (a reference to an entity, natural person, arrangement or trust), details of the interest and provenance information for the statement.", "type": "object", @@ -1327,7 +1327,7 @@ "properties": { "reason": { "title": "Reason", - "description": "The reason that an interested party cannot be specified. From the [unspecifiedReason codelist](#unspecifiedreason).", + "description": "The reason that an interested party cannot be specified. From the unspecifiedReason codelist.", "type": "string", "enum": [ "no-beneficial-owners", @@ -1364,7 +1364,7 @@ "properties": { "type": { "title": "Type of interest", - "description": "A codelist value indicating the nature of the interest. See the [interestType codelist](#interesttype)", + "description": "A codelist value indicating the nature of the interest. See the interestType codelist", "type": "string", "enum": [ "shareholding", @@ -1529,7 +1529,7 @@ "properties": { "type": { "title": "Source type", - "description": "What type of source is this? Multiple tags can be combined. Values should come from the [source type](#sourcetype) codelist.", + "description": "What type of source is this? Multiple tags can be combined. Values should come from the source type codelist.", "type": "array", "items": { "type": "string", @@ -1626,7 +1626,7 @@ }, "motivation": { "title": "Motivation", - "description": "The motivation for this annotation, chosen from a codelist. See the [annotationMotivation](#annotationmotivation) codelist.", + "description": "The motivation for this annotation, chosen from a codelist. See the annotationMotivation codelist.", "type": "string", "enum": [ "commenting", @@ -1733,7 +1733,7 @@ "properties": { "reason": { "title": "Reason", - "description": "The reason that an interested party cannot be specified. From the [unspecifiedReason codelist](#unspecifiedreason).", + "description": "The reason that an interested party cannot be specified. From the unspecifiedReason codelist.", "type": "string", "enum": [ "no-beneficial-owners",