turbot-runner-morph 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/bin/rspec +16 -0
- data/lib/turbot_runner.rb +28 -0
- data/lib/turbot_runner/base_handler.rb +15 -0
- data/lib/turbot_runner/exceptions.rb +4 -0
- data/lib/turbot_runner/prerun.rb +3 -0
- data/lib/turbot_runner/processor.rb +53 -0
- data/lib/turbot_runner/runner.rb +179 -0
- data/lib/turbot_runner/script_runner.rb +98 -0
- data/lib/turbot_runner/utils.rb +47 -0
- data/lib/turbot_runner/validator.rb +28 -0
- data/lib/turbot_runner/version.rb +3 -0
- data/schema/schemas/company-schema.json +243 -0
- data/schema/schemas/financial-payment-schema.json +32 -0
- data/schema/schemas/includes/address.json +53 -0
- data/schema/schemas/includes/alternative_name.json +36 -0
- data/schema/schemas/includes/company-for-nesting.json +245 -0
- data/schema/schemas/includes/company.json +25 -0
- data/schema/schemas/includes/entity.json +58 -0
- data/schema/schemas/includes/filing.json +52 -0
- data/schema/schemas/includes/financial-payment-data-object.json +112 -0
- data/schema/schemas/includes/identifier.json +20 -0
- data/schema/schemas/includes/industry_code.json +29 -0
- data/schema/schemas/includes/licence-data-object.json +63 -0
- data/schema/schemas/includes/officer.json +70 -0
- data/schema/schemas/includes/organisation.json +58 -0
- data/schema/schemas/includes/permission.json +46 -0
- data/schema/schemas/includes/person.json +62 -0
- data/schema/schemas/includes/person_name.json +71 -0
- data/schema/schemas/includes/previous_name.json +24 -0
- data/schema/schemas/includes/share-parcel-data.json +82 -0
- data/schema/schemas/includes/share-parcel.json +78 -0
- data/schema/schemas/includes/subsidiary-relationship-data.json +58 -0
- data/schema/schemas/includes/total-shares.json +17 -0
- data/schema/schemas/includes/unknown_entity_type.json +58 -0
- data/schema/schemas/licence-schema.json +105 -0
- data/schema/schemas/primary-data-schema.json +20 -0
- data/schema/schemas/share-parcel-schema.json +22 -0
- data/schema/schemas/simple-financial-payment-schema.json +122 -0
- data/schema/schemas/simple-licence-schema.json +82 -0
- data/schema/schemas/simple-subsidiary-schema.json +85 -0
- data/schema/schemas/subsidiary-relationship-schema.json +46 -0
- data/spec/bots/bot-that-crashes-immediately/manifest.json +15 -0
- data/spec/bots/bot-that-crashes-immediately/scraper.rb +1 -0
- data/spec/bots/bot-that-crashes-immediately/transformer1.rb +15 -0
- data/spec/bots/bot-that-crashes-in-scraper/manifest.json +15 -0
- data/spec/bots/bot-that-crashes-in-scraper/scraper.rb +11 -0
- data/spec/bots/bot-that-crashes-in-scraper/transformer1.rb +15 -0
- data/spec/bots/bot-that-crashes-in-transformer/manifest.json +20 -0
- data/spec/bots/bot-that-crashes-in-transformer/scraper.rb +10 -0
- data/spec/bots/bot-that-crashes-in-transformer/transformer1.rb +15 -0
- data/spec/bots/bot-that-crashes-in-transformer/transformer2.rb +17 -0
- data/spec/bots/bot-that-emits-run-ended/manifest.json +8 -0
- data/spec/bots/bot-that-emits-run-ended/scraper.rb +11 -0
- data/spec/bots/bot-that-expects-file/manifest.json +8 -0
- data/spec/bots/bot-that-expects-file/scraper.rb +11 -0
- data/spec/bots/bot-that-expects-file/something.txt +1 -0
- data/spec/bots/bot-with-invalid-data-type/manifest.json +8 -0
- data/spec/bots/bot-with-invalid-data-type/scraper.rb +10 -0
- data/spec/bots/bot-with-invalid-sample-date/manifest.json +8 -0
- data/spec/bots/bot-with-invalid-sample-date/scraper.rb +10 -0
- data/spec/bots/bot-with-pause/manifest.json +8 -0
- data/spec/bots/bot-with-pause/scraper.rb +16 -0
- data/spec/bots/bot-with-transformer/manifest.json +15 -0
- data/spec/bots/bot-with-transformer/scraper.rb +10 -0
- data/spec/bots/bot-with-transformer/transformer.rb +15 -0
- data/spec/bots/bot-with-transformers/manifest.json +20 -0
- data/spec/bots/bot-with-transformers/scraper.rb +10 -0
- data/spec/bots/bot-with-transformers/transformer1.rb +15 -0
- data/spec/bots/bot-with-transformers/transformer2.rb +15 -0
- data/spec/bots/invalid-json-bot/manifest.json +8 -0
- data/spec/bots/invalid-json-bot/scraper.rb +11 -0
- data/spec/bots/invalid-record-bot/manifest.json +8 -0
- data/spec/bots/invalid-record-bot/scraper.rb +11 -0
- data/spec/bots/logging-bot/manifest.json +8 -0
- data/spec/bots/logging-bot/scraper.rb +14 -0
- data/spec/bots/python-bot/manifest.json +8 -0
- data/spec/bots/python-bot/scraper.py +11 -0
- data/spec/bots/ruby-bot/manifest.json +8 -0
- data/spec/bots/ruby-bot/scraper.rb +10 -0
- data/spec/bots/slow-bot/manifest.json +8 -0
- data/spec/bots/slow-bot/scraper.rb +11 -0
- data/spec/lib/processor_spec.rb +181 -0
- data/spec/lib/runner_spec.rb +330 -0
- data/spec/lib/utils_spec.rb +23 -0
- data/spec/lib/validator_spec.rb +89 -0
- data/spec/manual_spec.rb +57 -0
- data/spec/outputs/full-scraper.out +10 -0
- data/spec/outputs/full-transformer.out +10 -0
- data/spec/outputs/truncated-scraper.out +5 -0
- data/spec/spec_helper.rb +20 -0
- metadata +148 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
module TurbotRunner
|
2
|
+
module Validator
|
3
|
+
extend self
|
4
|
+
|
5
|
+
def validate(data_type, record, identifying_fields)
|
6
|
+
schema_path = TurbotRunner.schema_path(data_type)
|
7
|
+
error = Openc::JsonSchema.validate(schema_path, record)
|
8
|
+
|
9
|
+
message = nil
|
10
|
+
|
11
|
+
if error.nil?
|
12
|
+
flattened_record = TurbotRunner::Utils.flatten(record)
|
13
|
+
|
14
|
+
identifying_attributes = flattened_record.reject do |k, v|
|
15
|
+
!identifying_fields.include?(k) || v.nil? || v == ''
|
16
|
+
end
|
17
|
+
|
18
|
+
if identifying_attributes.empty?
|
19
|
+
message = "There were no values provided for any of the identifying fields: #{identifying_fields.join(', ')}"
|
20
|
+
end
|
21
|
+
else
|
22
|
+
message = error[:message]
|
23
|
+
end
|
24
|
+
|
25
|
+
message
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,243 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"description": "A company in OpenCorporates",
|
4
|
+
"type": "object",
|
5
|
+
"properties": {
|
6
|
+
"company_number": {
|
7
|
+
"type": "string",
|
8
|
+
"description": "unique identifier given by the corporate register with which it is incorporated",
|
9
|
+
"minLength": 1
|
10
|
+
},
|
11
|
+
"name": {
|
12
|
+
"type": "string",
|
13
|
+
"description": "Legal name of the company",
|
14
|
+
"minLength": 1
|
15
|
+
},
|
16
|
+
"jurisdiction_code": {
|
17
|
+
"type": "string",
|
18
|
+
"description": "Code representing the jurisdiction/company register which is the canonical record of the company’s existence. Uses underscored ISO 3166-2 to represent it, e.g. es for Spain, us_de for Delaware",
|
19
|
+
"minLength": 2,
|
20
|
+
"maxLength": 5
|
21
|
+
},
|
22
|
+
"incorporation_date": {
|
23
|
+
"type": "string",
|
24
|
+
"format": "date"
|
25
|
+
},
|
26
|
+
"dissolution_date": {
|
27
|
+
"type": "string",
|
28
|
+
"format": "date"
|
29
|
+
},
|
30
|
+
"retrieved_at": {
|
31
|
+
"type": "string",
|
32
|
+
"format": "date-time"
|
33
|
+
},
|
34
|
+
"current_status": {
|
35
|
+
"type": [
|
36
|
+
"string",
|
37
|
+
"null"
|
38
|
+
]
|
39
|
+
},
|
40
|
+
"company_type": {
|
41
|
+
"type": [
|
42
|
+
"string",
|
43
|
+
"null"
|
44
|
+
]
|
45
|
+
},
|
46
|
+
"registry_url": {
|
47
|
+
"type": "string"
|
48
|
+
},
|
49
|
+
"website": {
|
50
|
+
"type": "string",
|
51
|
+
"minLength": 5
|
52
|
+
},
|
53
|
+
"telephone_number": {
|
54
|
+
"type": "string",
|
55
|
+
"minLength": 4
|
56
|
+
},
|
57
|
+
"fax_number": {
|
58
|
+
"type": "string",
|
59
|
+
"minLength": 4
|
60
|
+
},
|
61
|
+
"registered_address": {
|
62
|
+
"$ref": "includes/address.json"
|
63
|
+
},
|
64
|
+
"headquarters_address": {
|
65
|
+
"$ref": "includes/address.json"
|
66
|
+
},
|
67
|
+
"mailing_address": {
|
68
|
+
"$ref": "includes/address.json"
|
69
|
+
},
|
70
|
+
"officers": {
|
71
|
+
"type": "array",
|
72
|
+
"items": {
|
73
|
+
"$ref": "includes/officer.json"
|
74
|
+
}
|
75
|
+
},
|
76
|
+
"share_parcels": {
|
77
|
+
"type": "array",
|
78
|
+
"items": {
|
79
|
+
"$ref": "includes/share-parcel.json"
|
80
|
+
}
|
81
|
+
},
|
82
|
+
"total_shares": {
|
83
|
+
"$ref": "includes/total-shares.json"
|
84
|
+
},
|
85
|
+
"filings": {
|
86
|
+
"type": "array",
|
87
|
+
"items": {
|
88
|
+
"$ref": "includes/filing.json"
|
89
|
+
}
|
90
|
+
},
|
91
|
+
"identifiers": {
|
92
|
+
"type": "array",
|
93
|
+
"items": {
|
94
|
+
"$ref": "includes/identifier.json"
|
95
|
+
}
|
96
|
+
},
|
97
|
+
"industry_codes": {
|
98
|
+
"type": "array",
|
99
|
+
"items": {
|
100
|
+
"$ref": "includes/industry_code.json"
|
101
|
+
}
|
102
|
+
},
|
103
|
+
"previous_names": {
|
104
|
+
"type": "array",
|
105
|
+
"items": {
|
106
|
+
"$ref": "includes/previous_name.json"
|
107
|
+
}
|
108
|
+
},
|
109
|
+
"alternative_names": {
|
110
|
+
"type": "array",
|
111
|
+
"items": {
|
112
|
+
"$ref": "includes/alternative_name.json"
|
113
|
+
}
|
114
|
+
},
|
115
|
+
"branch": {
|
116
|
+
"type": [
|
117
|
+
"string",
|
118
|
+
"null"
|
119
|
+
],
|
120
|
+
"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",
|
121
|
+
"enum": [
|
122
|
+
"F",
|
123
|
+
"L",
|
124
|
+
null
|
125
|
+
]
|
126
|
+
},
|
127
|
+
"all_attributes": {
|
128
|
+
"type": "object",
|
129
|
+
"description": "Other arbitrary attributes for a given company",
|
130
|
+
"properties": {
|
131
|
+
"jurisdiction_of_origin": {
|
132
|
+
"type": [
|
133
|
+
"string",
|
134
|
+
"null"
|
135
|
+
],
|
136
|
+
"description": "The jurisdiction of the 'home' company if this is a branch",
|
137
|
+
"minLength": 1
|
138
|
+
},
|
139
|
+
"home_company_number": {
|
140
|
+
"type": [
|
141
|
+
"string",
|
142
|
+
"null"
|
143
|
+
],
|
144
|
+
"description": "If the entity is a 'branch', this is the company_number of the 'home' company in the home company's jurisdiction",
|
145
|
+
"minLength": 1
|
146
|
+
},
|
147
|
+
"home_legal_name": {
|
148
|
+
"type": [
|
149
|
+
"string",
|
150
|
+
"null"
|
151
|
+
],
|
152
|
+
"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",
|
153
|
+
"minLength": 1
|
154
|
+
},
|
155
|
+
"registered_agent_address": {
|
156
|
+
"type": [
|
157
|
+
"string",
|
158
|
+
"null"
|
159
|
+
],
|
160
|
+
"description": "The address of the 'Agent', a public address to which legal papers can be served",
|
161
|
+
"minLength": 1
|
162
|
+
},
|
163
|
+
"registered_agent_name": {
|
164
|
+
"type": [
|
165
|
+
"string",
|
166
|
+
"null"
|
167
|
+
],
|
168
|
+
"description": "The 'Agent' of the company – a person or entity that is empowered to accept service for the company",
|
169
|
+
"minLength": 1
|
170
|
+
},
|
171
|
+
"number_of_employees": {
|
172
|
+
"anyOf": [
|
173
|
+
{
|
174
|
+
"type": "string",
|
175
|
+
"minLength": 1
|
176
|
+
},
|
177
|
+
{
|
178
|
+
"type": "number",
|
179
|
+
"minimum": 0
|
180
|
+
}
|
181
|
+
],
|
182
|
+
"description": "The number of employees"
|
183
|
+
},
|
184
|
+
"merged_into": {
|
185
|
+
"type": "object",
|
186
|
+
"description": "Information on the merger of this company into a 'survivor' company",
|
187
|
+
"properties": {
|
188
|
+
"surviving_company": {
|
189
|
+
"type": [
|
190
|
+
"object"
|
191
|
+
],
|
192
|
+
"description": "the surviving_company that this has been merged into",
|
193
|
+
"properties": {
|
194
|
+
"name": {
|
195
|
+
"type": "string",
|
196
|
+
"description": "The legal name of the surviving company",
|
197
|
+
"minLength": 1
|
198
|
+
},
|
199
|
+
"company_number": {
|
200
|
+
"type": "string",
|
201
|
+
"description": "The company_number of the surviving company, if known",
|
202
|
+
"minLength": 1
|
203
|
+
},
|
204
|
+
"jurisdiction": {
|
205
|
+
"type": "string",
|
206
|
+
"description": "The jurisdiction of incorporation of the surviving company",
|
207
|
+
"minLength": 2
|
208
|
+
}
|
209
|
+
},
|
210
|
+
"anyOf": [
|
211
|
+
{
|
212
|
+
"required": [
|
213
|
+
"name"
|
214
|
+
]
|
215
|
+
},
|
216
|
+
{
|
217
|
+
"required": [
|
218
|
+
"company_number"
|
219
|
+
]
|
220
|
+
}
|
221
|
+
]
|
222
|
+
},
|
223
|
+
"effective_date": {
|
224
|
+
"type": "string",
|
225
|
+
"format": "date",
|
226
|
+
"description": "The date of the merger"
|
227
|
+
}
|
228
|
+
},
|
229
|
+
"additionalProperties": false,
|
230
|
+
"required": [
|
231
|
+
"surviving_company"
|
232
|
+
]
|
233
|
+
}
|
234
|
+
}
|
235
|
+
}
|
236
|
+
},
|
237
|
+
"additionalProperties": false,
|
238
|
+
"required": [
|
239
|
+
"company_number",
|
240
|
+
"name",
|
241
|
+
"jurisdiction_code"
|
242
|
+
]
|
243
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"description": "A Financial-Payment is a payment from government to a recipient",
|
4
|
+
"type": "object",
|
5
|
+
"properties": {
|
6
|
+
"sample_date": {
|
7
|
+
"type": "string",
|
8
|
+
"format": "date"
|
9
|
+
},
|
10
|
+
"source_jurisdiction": {
|
11
|
+
"description": "Jurisdiction of the source of the data",
|
12
|
+
"type": "string"
|
13
|
+
},
|
14
|
+
"company": {
|
15
|
+
"$ref": "includes/company.json"
|
16
|
+
},
|
17
|
+
"data": {
|
18
|
+
"type": "array",
|
19
|
+
"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",
|
20
|
+
"items": {
|
21
|
+
"$ref": "includes/financial-payment-data-object.json"
|
22
|
+
},
|
23
|
+
"additionalItems": false
|
24
|
+
}
|
25
|
+
},
|
26
|
+
"additionalProperties": false,
|
27
|
+
"required": [
|
28
|
+
"company",
|
29
|
+
"data",
|
30
|
+
"sample_date"
|
31
|
+
]
|
32
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"oneOf": [
|
4
|
+
{
|
5
|
+
"type": [
|
6
|
+
"string",
|
7
|
+
"null"
|
8
|
+
],
|
9
|
+
"minLength": 2
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"name": "Address",
|
13
|
+
"description": "An address object",
|
14
|
+
"type": "object",
|
15
|
+
"properties": {
|
16
|
+
"street_address": {
|
17
|
+
"type": "string"
|
18
|
+
},
|
19
|
+
"locality": {
|
20
|
+
"type": "string"
|
21
|
+
},
|
22
|
+
"region": {
|
23
|
+
"type": "string"
|
24
|
+
},
|
25
|
+
"postal_code": {
|
26
|
+
"type": "string"
|
27
|
+
},
|
28
|
+
"country": {
|
29
|
+
"type": "string"
|
30
|
+
}
|
31
|
+
},
|
32
|
+
"anyOf": [
|
33
|
+
{
|
34
|
+
"required": [
|
35
|
+
"street_address"
|
36
|
+
]
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"required": [
|
40
|
+
"postal_code"
|
41
|
+
]
|
42
|
+
}
|
43
|
+
,
|
44
|
+
{
|
45
|
+
"required": [
|
46
|
+
"locality",
|
47
|
+
"country"
|
48
|
+
]
|
49
|
+
}
|
50
|
+
]
|
51
|
+
}
|
52
|
+
]
|
53
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"description": "An alternative name of a company, e.g. abbreviation, trading (including dba or doing business as), legal. As well as trading names etc, it can be used for storing alternative language representations of the legal name, in which case the language should be represented as two-letter ISO-639 code",
|
4
|
+
"type": "object",
|
5
|
+
"properties": {
|
6
|
+
"company_name": {
|
7
|
+
"type": "string",
|
8
|
+
"minLength": 1
|
9
|
+
},
|
10
|
+
"start_date": {
|
11
|
+
"type": "string",
|
12
|
+
"format": "date"
|
13
|
+
},
|
14
|
+
"end_date": {
|
15
|
+
"type": "string",
|
16
|
+
"format": "date"
|
17
|
+
},
|
18
|
+
"language": {
|
19
|
+
"type": "string",
|
20
|
+
"minLength": 2,
|
21
|
+
"maxLength": 2
|
22
|
+
},
|
23
|
+
"type": {
|
24
|
+
"type": "string",
|
25
|
+
"enum": [
|
26
|
+
"trading",
|
27
|
+
"abbreviation",
|
28
|
+
"legal"
|
29
|
+
]
|
30
|
+
}
|
31
|
+
},
|
32
|
+
"required": [
|
33
|
+
"company_name",
|
34
|
+
"type"
|
35
|
+
]
|
36
|
+
}
|
@@ -0,0 +1,245 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"description": "A company in OpenCorporates",
|
4
|
+
"type": "object",
|
5
|
+
"properties": {
|
6
|
+
"company_number": {
|
7
|
+
"type": "string",
|
8
|
+
"description": "unique identifier given by the corporate register with which it is incorporated",
|
9
|
+
"minLength": 1
|
10
|
+
},
|
11
|
+
"name": {
|
12
|
+
"type": "string",
|
13
|
+
"description": "Legal name of the company",
|
14
|
+
"minLength": 1
|
15
|
+
},
|
16
|
+
"jurisdiction": {
|
17
|
+
"type": "string",
|
18
|
+
"description": "A free text field for the jurisdiction where the company is registered – this can be either the ISO 3166-2 code, the underscored version, or the standard name for the jurisdiction, e.g. France"
|
19
|
+
},
|
20
|
+
"jurisdiction_code": {
|
21
|
+
"type": "string",
|
22
|
+
"description": "Code representing the jurisdiction/company register which is the canonical record of the company’s existence. Uses underscored ISO 3166-2 to represent it, e.g. es for Spain, us_de for Delaware",
|
23
|
+
"minLength": 2,
|
24
|
+
"maxLength": 5
|
25
|
+
},
|
26
|
+
"incorporation_date": {
|
27
|
+
"type": "string",
|
28
|
+
"format": "date"
|
29
|
+
},
|
30
|
+
"dissolution_date": {
|
31
|
+
"type": "string",
|
32
|
+
"format": "date"
|
33
|
+
},
|
34
|
+
"retrieved_at": {
|
35
|
+
"type": "string",
|
36
|
+
"format": "date-time"
|
37
|
+
},
|
38
|
+
"current_status": {
|
39
|
+
"type": [
|
40
|
+
"string",
|
41
|
+
"null"
|
42
|
+
]
|
43
|
+
},
|
44
|
+
"company_type": {
|
45
|
+
"type": [
|
46
|
+
"string",
|
47
|
+
"null"
|
48
|
+
]
|
49
|
+
},
|
50
|
+
"registry_url": {
|
51
|
+
"type": "string"
|
52
|
+
},
|
53
|
+
"website": {
|
54
|
+
"type": "string",
|
55
|
+
"minLength": 5
|
56
|
+
},
|
57
|
+
"telephone_number": {
|
58
|
+
"type": "string",
|
59
|
+
"minLength": 4
|
60
|
+
},
|
61
|
+
"fax_number": {
|
62
|
+
"type": "string",
|
63
|
+
"minLength": 4
|
64
|
+
},
|
65
|
+
"registered_address": {
|
66
|
+
"$ref": "address.json"
|
67
|
+
},
|
68
|
+
"headquarters_address": {
|
69
|
+
"$ref": "address.json"
|
70
|
+
},
|
71
|
+
"mailing_address": {
|
72
|
+
"$ref": "address.json"
|
73
|
+
},
|
74
|
+
"officers": {
|
75
|
+
"type": "array",
|
76
|
+
"items": {
|
77
|
+
"$ref": "officer.json"
|
78
|
+
}
|
79
|
+
},
|
80
|
+
"share_parcels": {
|
81
|
+
"type": "array",
|
82
|
+
"items": {
|
83
|
+
"$ref": "share-parcel.json"
|
84
|
+
}
|
85
|
+
},
|
86
|
+
"total_shares": {
|
87
|
+
"$ref": "total-shares.json"
|
88
|
+
},
|
89
|
+
"filings": {
|
90
|
+
"type": "array",
|
91
|
+
"items": {
|
92
|
+
"$ref": "filing.json"
|
93
|
+
}
|
94
|
+
},
|
95
|
+
"identifiers": {
|
96
|
+
"type": "array",
|
97
|
+
"items": {
|
98
|
+
"$ref": "identifier.json"
|
99
|
+
}
|
100
|
+
},
|
101
|
+
"industry_codes": {
|
102
|
+
"type": "array",
|
103
|
+
"items": {
|
104
|
+
"$ref": "industry_code.json"
|
105
|
+
}
|
106
|
+
},
|
107
|
+
"previous_names": {
|
108
|
+
"type": "array",
|
109
|
+
"items": {
|
110
|
+
"$ref": "previous_name.json"
|
111
|
+
}
|
112
|
+
},
|
113
|
+
"alternative_names": {
|
114
|
+
"type": "array",
|
115
|
+
"items": {
|
116
|
+
"$ref": "alternative_name.json"
|
117
|
+
}
|
118
|
+
},
|
119
|
+
"branch": {
|
120
|
+
"type": [
|
121
|
+
"string",
|
122
|
+
"null"
|
123
|
+
],
|
124
|
+
"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",
|
125
|
+
"enum": [
|
126
|
+
"F",
|
127
|
+
"L",
|
128
|
+
null
|
129
|
+
]
|
130
|
+
},
|
131
|
+
"all_attributes": {
|
132
|
+
"type": "object",
|
133
|
+
"description": "Other arbitrary attributes for a given company",
|
134
|
+
"properties": {
|
135
|
+
"jurisdiction_of_origin": {
|
136
|
+
"type": [
|
137
|
+
"string",
|
138
|
+
"null"
|
139
|
+
],
|
140
|
+
"description": "The jurisdiction of the 'home' company if this is a branch",
|
141
|
+
"minLength": 1
|
142
|
+
},
|
143
|
+
"home_company_number": {
|
144
|
+
"type": [
|
145
|
+
"string",
|
146
|
+
"null"
|
147
|
+
],
|
148
|
+
"description": "If the entity is a 'branch', this is the company_number of the 'home' company in the home company's jurisdiction",
|
149
|
+
"minLength": 1
|
150
|
+
},
|
151
|
+
"home_legal_name": {
|
152
|
+
"type": [
|
153
|
+
"string",
|
154
|
+
"null"
|
155
|
+
],
|
156
|
+
"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",
|
157
|
+
"minLength": 1
|
158
|
+
},
|
159
|
+
"registered_agent_address": {
|
160
|
+
"type": [
|
161
|
+
"string",
|
162
|
+
"null"
|
163
|
+
],
|
164
|
+
"description": "The address of the 'Agent', a public address to which legal papers can be served",
|
165
|
+
"minLength": 1
|
166
|
+
},
|
167
|
+
"registered_agent_name": {
|
168
|
+
"type": [
|
169
|
+
"string",
|
170
|
+
"null"
|
171
|
+
],
|
172
|
+
"description": "The 'Agent' of the company – a person or entity that is empowered to accept service for the company",
|
173
|
+
"minLength": 1
|
174
|
+
},
|
175
|
+
"number_of_employees": {
|
176
|
+
"anyOf": [
|
177
|
+
{
|
178
|
+
"type": "string",
|
179
|
+
"minLength": 1
|
180
|
+
},
|
181
|
+
{
|
182
|
+
"type": "number",
|
183
|
+
"minimum": 0
|
184
|
+
}
|
185
|
+
],
|
186
|
+
"description": "The number of employees"
|
187
|
+
},
|
188
|
+
"merged_into": {
|
189
|
+
"type": "object",
|
190
|
+
"description": "Information on the merger of this company into a 'survivor' company",
|
191
|
+
"properties": {
|
192
|
+
"surviving_company": {
|
193
|
+
"type": [
|
194
|
+
"object"
|
195
|
+
],
|
196
|
+
"description": "the surviving_company that this has been merged into",
|
197
|
+
"properties": {
|
198
|
+
"name": {
|
199
|
+
"type": "string",
|
200
|
+
"description": "The legal name of the surviving company",
|
201
|
+
"minLength": 1
|
202
|
+
},
|
203
|
+
"company_number": {
|
204
|
+
"type": "string",
|
205
|
+
"description": "The company_number of the surviving company, if known",
|
206
|
+
"minLength": 1
|
207
|
+
},
|
208
|
+
"jurisdiction": {
|
209
|
+
"type": "string",
|
210
|
+
"description": "The jurisdiction of incorporation of the surviving company",
|
211
|
+
"minLength": 2
|
212
|
+
}
|
213
|
+
},
|
214
|
+
"anyOf": [
|
215
|
+
{
|
216
|
+
"required": [
|
217
|
+
"name"
|
218
|
+
]
|
219
|
+
},
|
220
|
+
{
|
221
|
+
"required": [
|
222
|
+
"company_number"
|
223
|
+
]
|
224
|
+
}
|
225
|
+
]
|
226
|
+
},
|
227
|
+
"effective_date": {
|
228
|
+
"description": "The date of the merger",
|
229
|
+
"type": "string",
|
230
|
+
"format": "date"
|
231
|
+
}
|
232
|
+
},
|
233
|
+
"additionalProperties": false,
|
234
|
+
"required": [
|
235
|
+
"surviving_company"
|
236
|
+
]
|
237
|
+
}
|
238
|
+
}
|
239
|
+
}
|
240
|
+
},
|
241
|
+
"additionalProperties": false,
|
242
|
+
"required": [
|
243
|
+
"name"
|
244
|
+
]
|
245
|
+
}
|