openc_bot 0.0.16 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitmodules +3 -0
- data/.travis.yml +2 -1
- data/examples/basic/lib/basic.rb +3 -2
- data/lib/openc_bot/helpers/register_methods.rb +2 -1
- data/lib/openc_bot/templates/lib/simple_bot.rb +3 -2
- data/lib/openc_bot/version.rb +1 -1
- data/lib/simple_openc_bot.rb +2 -2
- data/openc_bot.gemspec +13 -0
- data/publish.sh +12 -0
- data/schemas/.gitignore +13 -0
- data/schemas/.travis.yml +5 -0
- data/schemas/Gemfile +9 -0
- data/schemas/Gemfile.lock +34 -0
- data/schemas/README.md +2 -0
- data/schemas/Rakefile +46 -0
- data/schemas/lib/base-statement.json +22 -0
- data/schemas/lib/snippets/financial-payment-base.json +4 -0
- data/schemas/lib/snippets/licence-base.json +4 -0
- data/schemas/{company-schema.json → schemas/company-schema.json} +0 -0
- data/schemas/schemas/financial-payment-schema.json +27 -0
- data/schemas/{includes → schemas/includes}/address.json +0 -0
- data/schemas/{includes → schemas/includes}/alternative_name.json +1 -1
- data/schemas/{includes → schemas/includes}/company.json +2 -0
- data/schemas/{includes → schemas/includes}/filing.json +0 -0
- data/schemas/schemas/includes/financial-payment-data-object.json +60 -0
- data/schemas/{includes → schemas/includes}/industry_code.json +0 -0
- data/schemas/{includes/license-data.json → schemas/includes/licence-data-object.json} +13 -4
- data/schemas/{includes → schemas/includes}/officer.json +0 -0
- data/schemas/{includes → schemas/includes}/previous_name.json +0 -0
- data/schemas/{includes → schemas/includes}/share-parcel-data.json +0 -0
- data/schemas/{includes → schemas/includes}/share-parcel.json +0 -0
- data/schemas/{includes → schemas/includes}/subsidiary-relationship-data.json +4 -9
- data/schemas/{includes → schemas/includes}/total-shares.json +0 -0
- data/schemas/schemas/licence-schema.json +27 -0
- data/schemas/schemas/primary-data-schema.json +17 -0
- data/schemas/{share-parcel-schema.json → schemas/share-parcel-schema.json} +0 -0
- data/schemas/schemas/simple-financial-payment-schema.json +85 -0
- data/schemas/schemas/simple-licence-schema.json +54 -0
- data/schemas/schemas/simple-subsidiary-schema.json +62 -0
- data/schemas/schemas/subsidiary-relationship-schema.json +27 -0
- data/schemas/spec/sample-data/invalid/company-01.json +4 -0
- data/schemas/spec/sample-data/invalid/company-02.json +5 -0
- data/schemas/spec/sample-data/invalid/company-03.json +5 -0
- data/schemas/spec/sample-data/invalid/company-04.json +5 -0
- data/schemas/spec/sample-data/invalid/company-05.json +5 -0
- data/schemas/spec/sample-data/invalid/company-06.json +6 -0
- data/schemas/spec/sample-data/invalid/company-07.json +8 -0
- data/schemas/spec/sample-data/invalid/company-08.json +7 -0
- data/schemas/spec/sample-data/invalid/company-09.json +9 -0
- data/schemas/spec/sample-data/invalid/company-10.json +7 -0
- data/schemas/spec/sample-data/invalid/company-11.json +9 -0
- data/schemas/spec/sample-data/invalid/company-12.json +11 -0
- data/schemas/spec/sample-data/invalid/company-13.json +11 -0
- data/schemas/spec/sample-data/invalid/company-14.json +7 -0
- data/schemas/spec/sample-data/invalid/company-15.json +7 -0
- data/schemas/spec/sample-data/invalid/company-16.json +7 -0
- data/schemas/spec/sample-data/invalid/company-17.json +9 -0
- data/schemas/spec/sample-data/invalid/company-18.json +9 -0
- data/schemas/spec/sample-data/invalid/company-19.json +9 -0
- data/schemas/spec/sample-data/invalid/company-20.json +9 -0
- data/schemas/spec/sample-data/invalid/company-21.json +11 -0
- data/schemas/spec/sample-data/invalid/company-22.json +11 -0
- data/schemas/spec/sample-data/invalid/company-23.json +7 -0
- data/schemas/spec/sample-data/invalid/company-24.json +12 -0
- data/schemas/spec/sample-data/invalid/company-25.json +9 -0
- data/schemas/spec/sample-data/invalid/company-26.json +11 -0
- data/schemas/spec/sample-data/invalid/company-27.json +7 -0
- data/schemas/spec/sample-data/invalid/company-28.json +9 -0
- data/schemas/spec/sample-data/invalid/company-29.json +12 -0
- data/schemas/spec/sample-data/invalid/company-30.json +16 -0
- data/schemas/spec/sample-data/invalid/company-31.json +14 -0
- data/schemas/spec/sample-data/invalid/company-32.json +11 -0
- data/schemas/spec/sample-data/invalid/company-33.json +7 -0
- data/schemas/spec/sample-data/invalid/company-34.json +9 -0
- data/schemas/spec/sample-data/invalid/company-35.json +9 -0
- data/schemas/spec/sample-data/invalid/company-36.json +10 -0
- data/schemas/spec/sample-data/invalid/company-37.json +7 -0
- data/schemas/spec/sample-data/invalid/company-38.json +9 -0
- data/schemas/spec/sample-data/invalid/company-39.json +11 -0
- data/schemas/spec/sample-data/invalid/company-40.json +12 -0
- data/schemas/spec/sample-data/invalid/company-41.json +12 -0
- data/schemas/spec/sample-data/invalid/company-42.json +7 -0
- data/schemas/spec/sample-data/invalid/company-43.json +9 -0
- data/schemas/spec/sample-data/invalid/company-44.json +11 -0
- data/schemas/spec/sample-data/invalid/company-45.json +11 -0
- data/schemas/spec/sample-data/invalid/company-46.json +7 -0
- data/schemas/spec/sample-data/invalid/company-47.json +9 -0
- data/schemas/spec/sample-data/invalid/company-48.json +9 -0
- data/schemas/spec/sample-data/invalid/company-49.json +9 -0
- data/schemas/spec/sample-data/invalid/company-50.json +9 -0
- data/schemas/spec/sample-data/invalid/company-51.json +9 -0
- data/schemas/spec/sample-data/invalid/company-52.json +9 -0
- data/schemas/spec/sample-data/invalid/company-53.json +10 -0
- data/schemas/spec/sample-data/invalid/company-54.json +9 -0
- data/schemas/spec/sample-data/invalid/company-55.json +9 -0
- data/schemas/spec/sample-data/invalid/financial-payment-01.json +24 -0
- data/schemas/spec/sample-data/invalid/licence-01.json +18 -0
- data/schemas/spec/sample-data/invalid/licence-02.json +18 -0
- data/schemas/spec/sample-data/invalid/licence-03.json +12 -0
- data/schemas/spec/sample-data/invalid/licence-04.json +18 -0
- data/schemas/spec/sample-data/invalid/licence-05.json +18 -0
- data/schemas/spec/sample-data/invalid/licence-06.json +18 -0
- data/schemas/spec/sample-data/invalid/licence-07.json +20 -0
- data/schemas/spec/sample-data/invalid/licence-08.json +21 -0
- data/schemas/spec/sample-data/invalid/primary-data-01.json +4 -0
- data/schemas/spec/sample-data/invalid/primary-data-02.json +4 -0
- data/schemas/spec/sample-data/invalid/simple-licence-01.json +9 -0
- data/schemas/spec/sample-data/invalid/simple-licence-02.json +8 -0
- data/schemas/spec/sample-data/invalid/simple-licence-03.json +9 -0
- data/schemas/spec/sample-data/invalid/simple-subsidiary-01.json +13 -0
- data/schemas/{licence-schema.json → spec/sample-data/licence-schema.json.old} +1 -1
- data/schemas/spec/sample-data/valid/company-01.json +6 -0
- data/schemas/spec/sample-data/valid/company-02.json +7 -0
- data/schemas/spec/sample-data/valid/company-03.json +8 -0
- data/schemas/spec/sample-data/valid/company-04.json +7 -0
- data/schemas/spec/sample-data/valid/company-05.json +7 -0
- data/schemas/spec/sample-data/valid/company-06.json +12 -0
- data/schemas/spec/sample-data/valid/company-07.json +9 -0
- data/schemas/spec/sample-data/valid/company-08.json +9 -0
- data/schemas/spec/sample-data/valid/company-09.json +20 -0
- data/schemas/spec/sample-data/valid/company-10.json +9 -0
- data/schemas/spec/sample-data/valid/company-11.json +7 -0
- data/schemas/spec/sample-data/valid/company-12.json +7 -0
- data/schemas/spec/sample-data/valid/company-13.json +7 -0
- data/schemas/spec/sample-data/valid/company-14.json +15 -0
- data/schemas/spec/sample-data/valid/company-15.json +8 -0
- data/schemas/spec/sample-data/valid/company-16.json +9 -0
- data/schemas/spec/sample-data/valid/company-17.json +9 -0
- data/schemas/spec/sample-data/valid/company-18.json +9 -0
- data/schemas/spec/sample-data/valid/company-19.json +26 -0
- data/schemas/spec/sample-data/valid/company-20.json +9 -0
- data/schemas/spec/sample-data/valid/company-21.json +26 -0
- data/schemas/spec/sample-data/valid/company-22.json +20 -0
- data/schemas/spec/sample-data/valid/company-23.json +9 -0
- data/schemas/spec/sample-data/valid/company-24.json +12 -0
- data/schemas/spec/sample-data/valid/company-25.json +12 -0
- data/schemas/spec/sample-data/valid/company-26.json +12 -0
- data/schemas/spec/sample-data/valid/company-27.json +28 -0
- data/schemas/spec/sample-data/valid/company-28.json +9 -0
- data/schemas/spec/sample-data/valid/company-29.json +10 -0
- data/schemas/spec/sample-data/valid/company-30.json +9 -0
- data/schemas/spec/sample-data/valid/company-31.json +17 -0
- data/schemas/spec/sample-data/valid/company-32.json +9 -0
- data/schemas/spec/sample-data/valid/company-33.json +24 -0
- data/schemas/spec/sample-data/valid/company-34.json +9 -0
- data/schemas/spec/sample-data/valid/company-35.json +9 -0
- data/schemas/spec/sample-data/valid/company-36.json +9 -0
- data/schemas/spec/sample-data/valid/company-37.json +9 -0
- data/schemas/spec/sample-data/valid/company-38.json +9 -0
- data/schemas/spec/sample-data/valid/company-39.json +9 -0
- data/schemas/spec/sample-data/valid/company-40.json +9 -0
- data/schemas/spec/sample-data/valid/company-41.json +9 -0
- data/schemas/spec/sample-data/valid/company-42.json +10 -0
- data/schemas/spec/sample-data/valid/financial-payment-01.json +25 -0
- data/schemas/spec/sample-data/valid/financial-payment-02.json +29 -0
- data/schemas/spec/sample-data/valid/licence-01.json +19 -0
- data/schemas/spec/sample-data/valid/licence-02.json +21 -0
- data/schemas/spec/sample-data/valid/licence-03.json +21 -0
- data/schemas/spec/sample-data/valid/licence-04.json +26 -0
- data/schemas/spec/sample-data/valid/primary-data-01.json +4 -0
- data/schemas/spec/sample-data/valid/primary-data-02.json +5 -0
- data/schemas/spec/sample-data/valid/simple-licence-01.json +10 -0
- data/schemas/spec/sample-data/valid/simple-licence-02.json +10 -0
- data/schemas/spec/sample-data/valid/simple-licence-03.json +12 -0
- data/schemas/spec/sample-data/valid/simple-subsidiary-01.json +13 -0
- data/schemas/spec/sample-data/valid/simple-subsidiary-02.json +13 -0
- data/schemas/spec/sample-data/valid/subsidiary-relationship-01.json +23 -0
- data/schemas/spec/spec_helper.rb +78 -0
- data/schemas/spec/validation_spec.rb +39 -0
- data/spec/lib/helpers/register_methods_spec.rb +1 -1
- data/spec/schemas/company-schema_spec.rb +4 -3
- data/spec/simple_openc_bot_spec.rb +9 -8
- metadata +164 -19
- data/schemas/includes/base-statement.json +0 -27
- data/schemas/subsidiary-relationship-schema.json +0 -19
@@ -0,0 +1,54 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"title": "Simple Licence Schema",
|
4
|
+
"type": "object",
|
5
|
+
"properties": {
|
6
|
+
"source_url": {
|
7
|
+
"description": "Place where this fact can be verified",
|
8
|
+
"type": "string"
|
9
|
+
},
|
10
|
+
"sample_date": {
|
11
|
+
"description": "Date on which this fact was known to be true",
|
12
|
+
"type": "string"
|
13
|
+
},
|
14
|
+
"confidence": {
|
15
|
+
"description": "Confidence in accuracy of data",
|
16
|
+
"type": "string",
|
17
|
+
"enum": ["HIGH", "MEDIUM", "LOW"]
|
18
|
+
},
|
19
|
+
"company_name": {
|
20
|
+
"description": "Name of the company holding the licence",
|
21
|
+
"type": "string"
|
22
|
+
},
|
23
|
+
"company_jurisdiction": {
|
24
|
+
"description": "Jurisdiction where company is based",
|
25
|
+
"type": "string"
|
26
|
+
},
|
27
|
+
"licence_number": {
|
28
|
+
"description": "Licence number or code",
|
29
|
+
"type": "string"
|
30
|
+
},
|
31
|
+
"jurisdiction_classification": {
|
32
|
+
"description": "Description of how regulator classifies licence",
|
33
|
+
"type": ["string", "array"]
|
34
|
+
},
|
35
|
+
"regulator": {
|
36
|
+
"description": "The regulating body that issued the licence",
|
37
|
+
"type": "string"
|
38
|
+
},
|
39
|
+
"licence_jurisdiction": {
|
40
|
+
"description": "Jurisdiction for which licence is issued",
|
41
|
+
"type": "string"
|
42
|
+
},
|
43
|
+
"status": {
|
44
|
+
"description": "Status of the licence",
|
45
|
+
"type": "string"
|
46
|
+
},
|
47
|
+
"category": {
|
48
|
+
"description": "Category of licence",
|
49
|
+
"type": "string",
|
50
|
+
"enum": ["Financial", "Business"]
|
51
|
+
}
|
52
|
+
},
|
53
|
+
"required": ["source_url", "sample_date", "company_name", "company_jurisdiction"]
|
54
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"title": "Simple Subsidiary Schema",
|
4
|
+
"type": "object",
|
5
|
+
"properties": {
|
6
|
+
"source_url": {
|
7
|
+
"description": "Place where this fact can be verified",
|
8
|
+
"type": "string"
|
9
|
+
},
|
10
|
+
"sample_date": {
|
11
|
+
"description": "Date on which this fact was known to be true",
|
12
|
+
"type": "string"
|
13
|
+
},
|
14
|
+
"start_date": {
|
15
|
+
"description": "Earliest known date this was known to be a subsidiary",
|
16
|
+
"type": "string"
|
17
|
+
},
|
18
|
+
"end_date": {
|
19
|
+
"description": "Latest known date this was known to be a subsidiary",
|
20
|
+
"type": "string"
|
21
|
+
},
|
22
|
+
"confidence": {
|
23
|
+
"description": "Confidence in accuracy of data",
|
24
|
+
"type": "string",
|
25
|
+
"enum": ["HIGH", "MEDIUM", "LOW"]
|
26
|
+
},
|
27
|
+
"parent_name": {
|
28
|
+
"description": "Name of the controlling company",
|
29
|
+
"type": "string"
|
30
|
+
},
|
31
|
+
"parent_jurisdiction": {
|
32
|
+
"description": "Jurisdiction where controlling company is based",
|
33
|
+
"type": "string"
|
34
|
+
},
|
35
|
+
"parent_identifier": {
|
36
|
+
"description": "Any unique ID for the controlling company",
|
37
|
+
"type": "string"
|
38
|
+
},
|
39
|
+
"direct": {
|
40
|
+
"description": "Is the control relationship direct or indirect (if unknown, leave blank)?",
|
41
|
+
"type": "boolean"
|
42
|
+
},
|
43
|
+
"percentage_controlled": {
|
44
|
+
"description": "Percentage of the subsidiary that is controlled (if known), either directly or indirectly",
|
45
|
+
"type": "string",
|
46
|
+
"pattern": "^[0-9]{1,2}[.]?[0-9]{0,2}$"
|
47
|
+
},
|
48
|
+
"subsidiary_name": {
|
49
|
+
"description": "The name of the subsidiary",
|
50
|
+
"type": "string"
|
51
|
+
},
|
52
|
+
"subsidiary_jurisdiction": {
|
53
|
+
"description": "Jurisdiction of the subsidiary",
|
54
|
+
"type": "string"
|
55
|
+
},
|
56
|
+
"subsidiary_identifier": {
|
57
|
+
"description": "Any unique id for the subsidiary that might be provided in the source",
|
58
|
+
"type": "string"
|
59
|
+
}
|
60
|
+
},
|
61
|
+
"required": ["source_url", "sample_date", "parent_name", "parent_jurisdiction", "subsidiary_name", "subsidiary_jurisdiction"]
|
62
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"title": "Subsidiary Relationship",
|
3
|
+
"description": "A relationship of control between two companies",
|
4
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
5
|
+
"type": "object",
|
6
|
+
"properties": {
|
7
|
+
"source_jurisdiction": {
|
8
|
+
"description": "Jurisdiction of the source of the data",
|
9
|
+
"type": "string"
|
10
|
+
},
|
11
|
+
"company": {
|
12
|
+
"$ref": "includes/company.json"
|
13
|
+
},
|
14
|
+
"data": {
|
15
|
+
"type": "array",
|
16
|
+
"description": "This is an array of data objects, that is the objects which actually contain the data about the datum. Generally there will only be one element in this, although in for some types of data_types there may naturally be several releated to the same company, e.g. shareholders",
|
17
|
+
"items": {
|
18
|
+
"$ref": "includes/subsidiary-relationship-data.json"
|
19
|
+
},
|
20
|
+
"additionalItems": false
|
21
|
+
}
|
22
|
+
},
|
23
|
+
"required": [
|
24
|
+
"company",
|
25
|
+
"data"
|
26
|
+
]
|
27
|
+
}
|