turbot-runner 0.1.23 → 0.1.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +8 -8
  2. data/lib/turbot_runner.rb +0 -2
  3. data/lib/turbot_runner/processor.rb +7 -70
  4. data/lib/turbot_runner/version.rb +1 -1
  5. data/schema/schemas/company-schema.json +69 -22
  6. data/schema/schemas/financial-payment-schema.json +12 -5
  7. data/schema/schemas/includes/address.json +36 -13
  8. data/schema/schemas/includes/alternative_name.json +32 -9
  9. data/schema/schemas/includes/company-for-nesting.json +70 -23
  10. data/schema/schemas/includes/company.json +15 -6
  11. data/schema/schemas/includes/filing.json +48 -16
  12. data/schema/schemas/includes/financial-payment-data-object.json +73 -21
  13. data/schema/schemas/includes/identifier.json +14 -8
  14. data/schema/schemas/includes/industry_code.json +25 -12
  15. data/schema/schemas/includes/licence-data-object.json +40 -13
  16. data/schema/schemas/includes/officer.json +66 -46
  17. data/schema/schemas/includes/organisation.json +6 -5
  18. data/schema/schemas/includes/permission.json +36 -17
  19. data/schema/schemas/includes/person.json +14 -13
  20. data/schema/schemas/includes/person_name.json +36 -12
  21. data/schema/schemas/includes/previous_name.json +19 -9
  22. data/schema/schemas/includes/share-parcel-data.json +55 -40
  23. data/schema/schemas/includes/share-parcel.json +71 -56
  24. data/schema/schemas/includes/subsidiary-relationship-data.json +19 -8
  25. data/schema/schemas/includes/total-shares.json +13 -6
  26. data/schema/schemas/includes/unknown_entity_type.json +6 -5
  27. data/schema/schemas/licence-schema.json +157 -17
  28. data/schema/schemas/primary-data-schema.json +18 -16
  29. data/schema/schemas/share-parcel-schema.json +8 -7
  30. data/schema/schemas/simple-financial-payment-schema.json +47 -11
  31. data/schema/schemas/simple-licence-schema.json +21 -6
  32. data/schema/schemas/simple-subsidiary-schema.json +15 -4
  33. data/schema/schemas/subsidiary-relationship-schema.json +26 -7
  34. data/spec/lib/processor_spec.rb +3 -75
  35. metadata +5 -10
  36. data/lib/turbot_runner/validator.rb +0 -77
  37. data/lib/turbot_runner/validators.rb +0 -12
  38. data/schema/schemas/rich-licence-schema.json +0 -103
  39. data/spec/lib/validator_spec.rb +0 -235
  40. data/spec/lib/validators_spec.rb +0 -48
@@ -1,7 +1,7 @@
1
1
  {
2
- "title": "Company Schema",
3
- "type": "object",
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
4
3
  "description": "A company in OpenCorporates",
4
+ "type": "object",
5
5
  "properties": {
6
6
  "company_number": {
7
7
  "type": "string",
@@ -20,13 +20,16 @@
20
20
  "maxLength": 5
21
21
  },
22
22
  "incorporation_date": {
23
- "type": "date"
23
+ "type": "string",
24
+ "format": "date"
24
25
  },
25
26
  "dissolution_date": {
26
- "type": "date"
27
+ "type": "string",
28
+ "format": "date"
27
29
  },
28
30
  "retrieved_at": {
29
- "type": "date-time"
31
+ "type": "string",
32
+ "format": "date-time"
30
33
  },
31
34
  "current_status": {
32
35
  "type": "string"
@@ -98,43 +101,71 @@
98
101
  }
99
102
  },
100
103
  "branch": {
101
- "type": ["string","null"],
104
+ "type": [
105
+ "string",
106
+ "null"
107
+ ],
102
108
  "description": "A flag to denote whether a company is a branch entity. This should only be set if the company is a type of branch (otherwise should be null). In general the only option here is 'F' for a 'Foreign' branch, i.e. an out-of-jurisdiction entity that has registered as having a presence in the jurisdiction. In the US this is sometimes called a Foreign Corporation",
103
- "enum": ["F", "L",null]
109
+ "enum": [
110
+ "F",
111
+ "L",
112
+ null
113
+ ]
104
114
  },
105
115
  "all_attributes": {
106
116
  "type": "object",
107
117
  "description": "Other arbitrary attributes for a given company",
108
118
  "properties": {
109
119
  "jurisdiction_of_origin": {
110
- "type": ["string","null"],
120
+ "type": [
121
+ "string",
122
+ "null"
123
+ ],
111
124
  "description": "The jurisdiction of the 'home' company if this is a branch",
112
125
  "minLength": 1
113
126
  },
114
127
  "home_company_number": {
115
- "type": ["string","null"],
128
+ "type": [
129
+ "string",
130
+ "null"
131
+ ],
116
132
  "description": "If the entity is a 'branch', this is the company_number of the 'home' company in the home company's jurisdiction",
117
133
  "minLength": 1
118
134
  },
119
135
  "home_legal_name": {
120
- "type": ["string","null"],
136
+ "type": [
137
+ "string",
138
+ "null"
139
+ ],
121
140
  "description": "The legal name of the 'home' company in its jurisdiction if this is a branch, and the name is different from the legal name of the branch",
122
141
  "minLength": 1
123
142
  },
124
143
  "registered_agent_address": {
125
- "type": ["string","null"],
144
+ "type": [
145
+ "string",
146
+ "null"
147
+ ],
126
148
  "description": "The address of the 'Agent', a public address to which legal papers can be served",
127
149
  "minLength": 1
128
150
  },
129
151
  "registered_agent_name": {
130
- "type": ["string","null"],
131
- "description": "The 'Agent' of the company \u2013 a person or entity that is empowered to accept service for the company",
152
+ "type": [
153
+ "string",
154
+ "null"
155
+ ],
156
+ "description": "The 'Agent' of the company – a person or entity that is empowered to accept service for the company",
132
157
  "minLength": 1
133
158
  },
134
159
  "number_of_employees": {
135
160
  "anyOf": [
136
- {"type":"string","minLength": 1},
137
- {"type":"number","minimum": 0}
161
+ {
162
+ "type": "string",
163
+ "minLength": 1
164
+ },
165
+ {
166
+ "type": "number",
167
+ "minimum": 0
168
+ }
138
169
  ],
139
170
  "description": "The number of employees"
140
171
  },
@@ -143,7 +174,9 @@
143
174
  "description": "Information on the merger of this company into a 'survivor' company",
144
175
  "properties": {
145
176
  "surviving_company": {
146
- "type": ["object"],
177
+ "type": [
178
+ "object"
179
+ ],
147
180
  "description": "the surviving_company that this has been merged into",
148
181
  "properties": {
149
182
  "name": {
@@ -162,21 +195,35 @@
162
195
  "minLength": 2
163
196
  }
164
197
  },
165
- "anyOf": [{"required": ["name"]},
166
- {"required": ["company_number"]}]
198
+ "anyOf": [
199
+ {
200
+ "required": [
201
+ "name"
202
+ ]
203
+ },
204
+ {
205
+ "required": [
206
+ "company_number"
207
+ ]
208
+ }
209
+ ]
167
210
  },
168
211
  "effective_date": {
212
+ "description": "The date of the merger",
169
213
  "type": "string",
170
- "format": "date",
171
- "description": "The date of the merger"
214
+ "format": "date"
172
215
  }
173
216
  },
174
217
  "additionalProperties": false,
175
- "required": ["surviving_company"]
218
+ "required": [
219
+ "surviving_company"
220
+ ]
176
221
  }
177
222
  }
178
223
  }
179
224
  },
180
225
  "additionalProperties": false,
181
- "required": ["name"]
182
- }
226
+ "required": [
227
+ "name"
228
+ ]
229
+ }
@@ -1,16 +1,25 @@
1
1
  {
2
- "name": "Company",
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
3
  "description": "A company which is the subject of a statement",
4
4
  "type": "object",
5
5
  "properties": {
6
- "name": { "type": "string" },
7
- "jurisdiction": { "type": "string" },
8
- "company_number": { "type": "string" },
6
+ "name": {
7
+ "type": "string"
8
+ },
9
+ "jurisdiction": {
10
+ "type": "string"
11
+ },
12
+ "company_number": {
13
+ "type": "string"
14
+ },
9
15
  "identifier": {
10
16
  "type": "string",
11
17
  "description": "An official identifier paired with a code for the issuer of the identifier, e.g sec/12345",
12
18
  "pattern": "^[^/]+/[^/]+$"
13
19
  }
14
20
  },
15
- "required": [ "name", "jurisdiction" ]
16
- }
21
+ "required": [
22
+ "name",
23
+ "jurisdiction"
24
+ ]
25
+ }
@@ -1,20 +1,52 @@
1
1
  {
2
- "name": "Filing",
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
3
  "description": "A statutory filing",
4
4
  "type": "object",
5
- "properties": { "title": { "type": "string" },
6
- "date": {"type":"string","format": "date"},
7
- "description": { "type": "string" },
8
- "uid": { "type": "string" },
9
- "url": { "type": "string" },
10
- "filing_type_code": { "type": "string" },
11
- "filing_type_name": { "type": "string" },
12
- "other_attributes": { "type": "object" }
5
+ "properties": {
6
+ "title": {
7
+ "type": "string"
8
+ },
9
+ "date": {
10
+ "type": "string",
11
+ "format": "date"
12
+ },
13
+ "description": {
14
+ "type": "string"
15
+ },
16
+ "uid": {
17
+ "type": "string"
18
+ },
19
+ "url": {
20
+ "type": "string"
21
+ },
22
+ "filing_type_code": {
23
+ "type": "string"
24
+ },
25
+ "filing_type_name": {
26
+ "type": "string"
27
+ },
28
+ "other_attributes": {
29
+ "type": "object"
30
+ }
13
31
  },
14
- "required": [ "date" ],
15
- "anyOf": [ { "required": ["title"] },
16
- { "required": ["description"] },
17
- { "required": ["filing_type_name"] }
18
- ]
19
- }
20
-
32
+ "required": [
33
+ "date"
34
+ ],
35
+ "anyOf": [
36
+ {
37
+ "required": [
38
+ "title"
39
+ ]
40
+ },
41
+ {
42
+ "required": [
43
+ "description"
44
+ ]
45
+ },
46
+ {
47
+ "required": [
48
+ "filing_type_name"
49
+ ]
50
+ }
51
+ ]
52
+ }
@@ -1,60 +1,112 @@
1
1
  {
2
- "name": "Financial Payment Datum",
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
3
  "type": "object",
4
4
  "properties": {
5
- "data_type": { "enum": [ "financial_payment" ] },
5
+ "data_type": {
6
+ "enum": [
7
+ "financial_payment"
8
+ ]
9
+ },
6
10
  "source_url": {
7
- "type": "string"},
11
+ "type": "string"
12
+ },
8
13
  "confidence": {
9
- "type": "string"},
14
+ "type": "string"
15
+ },
10
16
  "properties": {
11
17
  "type": "object",
12
18
  "properties": {
13
19
  "value": {
14
20
  "description": "The amount transacted (e.g. 19.95)",
15
- "type": "string"},
21
+ "type": "string"
22
+ },
16
23
  "payee_name": {
17
24
  "description": "The name of the payee (the entity that received the money)",
18
- "type": "string"},
25
+ "type": "string"
26
+ },
19
27
  "currency": {
20
28
  "description": "The currency of the payment (three letter symbol, e.g. USD, GBP, EUR)",
21
- "type": "string"},
29
+ "type": "string"
30
+ },
22
31
  "date": {
23
32
  "description": "The date on which the payment was made",
24
- "type": "date"},
33
+ "type": "date"
34
+ },
25
35
  "transaction_number": {
26
36
  "description": "The unique identifier for the transaction, scoped to this bot",
27
- "type": "string"},
37
+ "type": "string"
38
+ },
28
39
  "jurisdiction": {
29
40
  "description": "The jurisdiction of the body that made the payment, eg. UK, France, Delaware, Manchester",
30
- "type": "string"},
41
+ "type": "string"
42
+ },
31
43
  "more_details_url": {
32
44
  "description": "A url from which more details can be seen (may be the same as the source_url)",
33
- "type": ["string",null]},
45
+ "type": [
46
+ "string",
47
+ null
48
+ ]
49
+ },
34
50
  "description": {
35
51
  "description": "The description of the transaction as given in the raw data",
36
- "type": ["string",null]},
52
+ "type": [
53
+ "string",
54
+ null
55
+ ]
56
+ },
37
57
  "expense_type": {
38
58
  "description": "The type of expense -- can be either capital, revenue (i.e. current expenditure) or null",
39
- "enum": ["capital","revenue",null]},
59
+ "enum": [
60
+ "capital",
61
+ "revenue",
62
+ null
63
+ ]
64
+ },
40
65
  "expense_area": {
41
66
  "description": "category (in words) of the expenditure",
42
- "type": ["string",null]},
67
+ "type": [
68
+ "string",
69
+ null
70
+ ]
71
+ },
43
72
  "entity_name": {
44
73
  "description": "The name of the government entity that made the payment, e.g. Environment Agency",
45
- "type": "string"},
74
+ "type": "string"
75
+ },
46
76
  "entity_uri": {
47
77
  "description": "A unique URL (ideally a dereferencable URI) for the government entity",
48
- "type": ["string",null]},
78
+ "type": [
79
+ "string",
80
+ null
81
+ ]
82
+ },
49
83
  "department_name": {
50
84
  "description": "The name of the government department which the entity belongs to (if relevant), e.g. Department of Health",
51
- "type": ["string",null]},
85
+ "type": [
86
+ "string",
87
+ null
88
+ ]
89
+ },
52
90
  "csv_line_number": {
53
91
  "description": "If the source for the data is a CSV file, you can optionally include the line number of the CSV from which this data was retrieved",
54
- "type": ["string",null]}
92
+ "type": [
93
+ "string",
94
+ null
95
+ ]
96
+ }
55
97
  },
56
- "required": [ "value", "payee_name", "date","currency" ]
98
+ "required": [
99
+ "value",
100
+ "payee_name",
101
+ "date",
102
+ "currency"
103
+ ]
57
104
  }
58
105
  },
59
- "required": [ "data_type", "properties","source_url","confidence" ]
60
- }
106
+ "required": [
107
+ "data_type",
108
+ "properties",
109
+ "source_url",
110
+ "confidence"
111
+ ]
112
+ }
@@ -1,12 +1,18 @@
1
1
  {
2
- "name": "Identifier",
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
3
  "description": "An identifier for an entity (possibly other things, e.g. securities in the future). Examples are tax IDs, non-profit IDs, SEC CIK numbers, Federal Reserve RSSD id. The main requirements for an identifier is that they should be well-defined, and issued by a government or have statutory standing",
4
4
  "type": "object",
5
- "properties": { "code": { "type": "string" },
6
- "code_scheme_id": {
7
- "type": "string",
8
- "description": "An identifier representing the identifier scheme. Some examples of this are us_fein (US Federal tax number), us_sec_cik (US Securities and Exchange Commission CIK), gb_ccew (Charity Commission of England & Wales), lei (Global Legal Entity Identifier Schems)"
9
- }
5
+ "properties": {
6
+ "uid": {
7
+ "type": "string"
8
+ },
9
+ "identifier_system_code": {
10
+ "type": "string",
11
+ "description": "An identifier representing the identifier scheme. Some examples of this are us_fein (US Federal tax number), us_sec_cik (US Securities and Exchange Commission CIK), gb_ccew (Charity Commission of England & Wales), lei (Global Legal Entity Identifier Schems)"
12
+ }
10
13
  },
11
- "required": [ "code", "code_scheme_id" ]
12
- }
14
+ "required": [
15
+ "code",
16
+ "code_scheme_id"
17
+ ]
18
+ }
@@ -1,16 +1,29 @@
1
1
  {
2
- "name": "IndustryCode",
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
3
  "description": "An industry code from a standard code list (e.g. NAICS 2007 or NACE 2)",
4
4
  "type": "object",
5
- "properties": { "name": { "type": "string" },
6
- "code": { "type": "string" },
7
- "code_scheme_id": {
8
- "type": "string",
9
- "description": "An identifier representing industry code scheme. At the moment these are eu_nace_2, uk_sic_2003, uk_sic_2007, us_naics_2002, us_naics_2007, be_nace_2008, dk_db_2007, nz_bic_2006, no_sic_2007, anz_sic_2006, nz_bic_2006, in_nic_2004_mca, ca_qc_cae, lu_nace_2. For other code schemes, or details of these, contact info@opencorporates.com"
10
- },
11
- "start_date": {"type":"string","format": "date"},
12
- "end_date": {"type":"string","format": "date"}
5
+ "properties": {
6
+ "name": {
7
+ "type": "string"
8
+ },
9
+ "code": {
10
+ "type": "string"
11
+ },
12
+ "code_scheme_id": {
13
+ "type": "string",
14
+ "description": "An identifier representing industry code scheme. At the moment these are eu_nace_2, uk_sic_2003, uk_sic_2007, us_naics_2002, us_naics_2007, be_nace_2008, dk_db_2007, nz_bic_2006, no_sic_2007, anz_sic_2006, nz_bic_2006, in_nic_2004_mca, ca_qc_cae, lu_nace_2. For other code schemes, or details of these, contact info@opencorporates.com"
15
+ },
16
+ "start_date": {
17
+ "type": "string",
18
+ "format": "date"
19
+ },
20
+ "end_date": {
21
+ "type": "string",
22
+ "format": "date"
23
+ }
13
24
  },
14
- "required": [ "code", "code_scheme_id" ]
15
- }
16
-
25
+ "required": [
26
+ "code",
27
+ "code_scheme_id"
28
+ ]
29
+ }