Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema: Update bundled schemas and update instructions #73

Merged
1 commit merged into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions libcovebods/data/schema-0-1-0.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
52 changes: 26 additions & 26 deletions libcovebods/data/schema-0-2-0.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -64,16 +64,16 @@
"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",
"subject-unable-to-confirm-or-identify-beneficial-owner",
"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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down