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,36 +1,63 @@
1
1
  {
2
- "name": "Licence Data",
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
3
  "type": "object",
4
4
  "properties": {
5
- "data_type": { "enum": [ "licence" ] },
5
+ "data_type": {
6
+ "enum": [
7
+ "licence"
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
  "regulator": {
14
20
  "description": "The regulating body that issued the licence",
15
- "type": "string"},
21
+ "type": "string"
22
+ },
16
23
  "category": {
17
24
  "description": "The category of licence. Current possible values are: 'Financial','Business'",
18
- "enum": [ "Financial", "Business" ]},
25
+ "enum": [
26
+ "Financial",
27
+ "Business"
28
+ ]
29
+ },
19
30
  "jurisdiction_code": {
20
31
  "description": "The jurisdiction for which licence was issued",
21
- "type": "string"},
32
+ "type": "string"
33
+ },
22
34
  "licence_number": {
23
35
  "description": "Licence number or code (can be null)",
24
- "type": ["string",null]},
36
+ "type": [
37
+ "string",
38
+ null
39
+ ]
40
+ },
25
41
  "jurisdiction_classification": {
26
42
  "type": "array",
27
43
  "description": "The local classification given by the regulator",
28
- "minItems": 1},
44
+ "minItems": 1
45
+ },
29
46
  "oc_classification": {
30
- "type": "array"}
47
+ "type": "array"
48
+ }
31
49
  },
32
- "required": [ "jurisdiction_code", "jurisdiction_classification", "category" ]
50
+ "required": [
51
+ "jurisdiction_code",
52
+ "jurisdiction_classification",
53
+ "category"
54
+ ]
33
55
  }
34
56
  },
35
- "required": [ "data_type", "properties","source_url","confidence" ]
36
- }
57
+ "required": [
58
+ "data_type",
59
+ "properties",
60
+ "source_url",
61
+ "confidence"
62
+ ]
63
+ }
@@ -1,50 +1,70 @@
1
1
  {
2
- "name": "Officer",
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
3
  "description": "An officer (director, senior executive) of a company",
4
4
  "type": "object",
5
- "properties": { "name": { "type": "string", "minLength": 1 },
6
- "start_date": {
7
- "anyOf": [
8
- {"type":"string","format": "date"},
9
- {"type":"null"}
10
- ]
11
- },
12
- "end_date": {
13
- "anyOf": [
14
- {"type":"string","format": "date"},
15
- {"type":"null"}
16
- ]
17
- },
18
- "position": { "type": "string" },
19
- "other_attributes": {
20
- "type": "object",
21
- "properties": {
22
- "date_of_birth": {
23
- "type": "string",
24
- "format": "date"
25
- },
26
- "nationality": {
27
- "type": "string"
28
- },
29
- "person_uid": {
30
- "type": "string",
31
- "description": "a unique identifier given to the individual (as opposed to the officership)"
32
- },
33
- "address": {
34
- "type": "string"
35
- },
36
- "type": {
37
- "type": "string",
38
- "enum": ["Person", "Company"],
39
- "description": "The type of entity that is the officer (either 'Person' or 'Company')"
40
- }
41
- }
42
- },
43
- "uid": {
44
- "type": "string",
45
- "description": "a unique identifier given to the officership"
46
- }
5
+ "properties": {
6
+ "name": {
7
+ "type": "string",
8
+ "minLength": 1
9
+ },
10
+ "start_date": {
11
+ "anyOf": [
12
+ {
13
+ "type": "string",
14
+ "format": "date"
15
+ },
16
+ {
17
+ "type": "null"
18
+ }
19
+ ]
20
+ },
21
+ "end_date": {
22
+ "anyOf": [
23
+ {
24
+ "type": "string",
25
+ "format": "date"
26
+ },
27
+ {
28
+ "type": "null"
29
+ }
30
+ ]
31
+ },
32
+ "position": {
33
+ "type": "string"
34
+ },
35
+ "uid": {
36
+ "type": "string",
37
+ "description": "a unique identifier given to the officership"
38
+ },
39
+ "other_attributes": {
40
+ "type": "object",
41
+ "properties": {
42
+ "date_of_birth": {
43
+ "type": "string",
44
+ "format": "date"
45
+ },
46
+ "nationality": {
47
+ "type": "string"
48
+ },
49
+ "person_uid": {
50
+ "type": "string",
51
+ "description": "a unique identifier given to the individual (as opposed to the officership)"
52
+ },
53
+ "address": {
54
+ "type": "string"
55
+ },
56
+ "type": {
57
+ "type": "string",
58
+ "enum": [
59
+ "Person",
60
+ "Company"
61
+ ],
62
+ "description": "The type of entity that is the officer (either 'Person' or 'Company')"
63
+ }
64
+ }
65
+ }
47
66
  },
48
- "required": [ "name" ]
49
- }
50
-
67
+ "required": [
68
+ "name"
69
+ ]
70
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
- "title": "Organisation",
3
- "type": "object",
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
4
3
  "description": "An entity which is a distinct organisation, but is not a company nor an individual. Examples include governments and governmental entities (e.g. Multilateral Devoelpment Banks, Government Departments, municipalities, etc), and also membership organisations",
4
+ "type": "object",
5
5
  "properties": {
6
6
  "name": {
7
7
  "type": "string",
@@ -52,6 +52,7 @@
52
52
  }
53
53
  }
54
54
  },
55
- "required": ["name"]
56
- }
57
-
55
+ "required": [
56
+ "name"
57
+ ]
58
+ }
@@ -1,27 +1,46 @@
1
- { "oneOf":
2
- [
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "oneOf": [
3
4
  {
4
- "type": ["string","null"],
5
+ "type": [
6
+ "string",
7
+ "null"
8
+ ],
5
9
  "minLength": 2
6
10
  },
7
11
  {
8
12
  "name": "Permission",
9
13
  "description": "A permission issued by a government or regulatory body to an entity to do something. This may be fine grained,e.g. to sell liquor, to accept customer deposits, or broader, e.g to operate as a bank, a restaurant. It may also be permission to do something physical, such as explore for oil in a given area, or mine for iron ore",
10
14
  "type": "object",
11
- "properties": { "activity_name": { "type": "string" },
12
- "activity_id": { "type":"string" },
13
- "permission_type": {
14
- "enum": ["operating", "exploration", "exploitation"],
15
- "description":"types of permission, such as 'operating', 'exploration', 'exploitation'"
16
- },
17
- "restrictions": { "type":"array",
18
- "description":"conditions or restrictions on the permissions",
19
- "items": { "type":"string" }
20
- },
21
- "other_attributes": { }
15
+ "properties": {
16
+ "activity_name": {
17
+ "type": "string"
18
+ },
19
+ "activity_id": {
20
+ "type": "string"
21
+ },
22
+ "permission_type": {
23
+ "enum": [
24
+ "operating",
25
+ "exploration",
26
+ "exploitation"
27
+ ],
28
+ "description": "types of permission, such as 'operating', 'exploration', 'exploitation'"
29
+ },
30
+ "restrictions": {
31
+ "type": "array",
32
+ "description": "conditions or restrictions on the permissions",
33
+ "items": {
34
+ "type": "string"
35
+ }
36
+ },
37
+ "other_attributes": {
38
+ "type": "object"
39
+ }
22
40
  },
23
- "required": ["activity_name"]
41
+ "required": [
42
+ "activity_name"
43
+ ]
24
44
  }
25
45
  ]
26
- }
27
-
46
+ }
@@ -1,15 +1,10 @@
1
1
  {
2
- "title": "Person",
3
- "type": "object",
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
4
3
  "description": "A person, for example, referenced in some other context, e.g. director of a company, shareholder, licence-holder, lobbyist. This should be used only if the person is the subject of the datum",
4
+ "type": "object",
5
5
  "properties": {
6
6
  "name": {
7
- "oneOf": [
8
- { "type": "string",
9
- "minLength": 1
10
- },
11
- { "$ref": "person_name.json" }
12
- ]
7
+ "$ref": "person_name.json"
13
8
  },
14
9
  "jurisdiction": {
15
10
  "type": "string",
@@ -17,10 +12,15 @@
17
12
  },
18
13
  "company": {
19
14
  "description": "Company the person is representing. NB If the licence holder is a company, and the individual is a just a contact, then use the company-schema for the entity. This is where the individual themselves are the licence holder",
20
- "$ref": "../company-schema.json"
15
+ "$ref": "company-for-nesting.json"
21
16
  },
22
17
  "relationship_with_company": {
23
- "enum": ["employee", "director", "shareholder", null]
18
+ "enum": [
19
+ "employee",
20
+ "director",
21
+ "shareholder",
22
+ null
23
+ ]
24
24
  },
25
25
  "website": {
26
26
  "type": "string",
@@ -56,6 +56,7 @@
56
56
  }
57
57
  }
58
58
  },
59
- "required": ["name"]
60
- }
61
-
59
+ "required": [
60
+ "name"
61
+ ]
62
+ }
@@ -1,7 +1,11 @@
1
- { "oneOf":
2
- [
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "oneOf": [
3
4
  {
4
- "type": ["string",null],
5
+ "type": [
6
+ "string",
7
+ "null"
8
+ ],
5
9
  "minLength": 2
6
10
  },
7
11
  {
@@ -9,39 +13,59 @@
9
13
  "type": "object",
10
14
  "properties": {
11
15
  "given_name": {
12
- "type": ["string",null],
16
+ "type": [
17
+ "string",
18
+ "null"
19
+ ],
13
20
  "description": "The given name (often first name) of a person, as opposed to their family name. Following FOAF practice, this is preferred to first_name",
14
21
  "minLength": 1
15
22
  },
16
23
  "family_name": {
17
- "type": ["string",null],
24
+ "type": [
25
+ "string",
26
+ "null"
27
+ ],
18
28
  "description": "The family name (often last name) of a person, as opposed to their family name. Following FOAF practice, this is preferred to last_name",
19
29
  "minLength": 1
20
30
  },
21
31
  "first_name": {
22
- "type": ["string",null],
32
+ "type": [
33
+ "string",
34
+ "null"
35
+ ],
23
36
  "minLength": 1
24
37
  },
25
38
  "middle_name": {
26
- "type": ["string",null],
39
+ "type": [
40
+ "string",
41
+ "null"
42
+ ],
27
43
  "minLength": 1
28
44
  },
29
45
  "last_name": {
30
- "type": ["string",null],
46
+ "type": [
47
+ "string",
48
+ "null"
49
+ ],
31
50
  "minLength": 1
32
51
  },
33
52
  "title": {
34
- "type": ["string",null],
53
+ "type": [
54
+ "string",
55
+ "null"
56
+ ],
35
57
  "description": "Title such as Mr, Ms, Dr etc",
36
58
  "minLength": 1
37
59
  },
38
60
  "suffixes": {
39
- "type": ["string",null],
61
+ "type": [
62
+ "string",
63
+ "null"
64
+ ],
40
65
  "description": "Any suffixes, including degrees, honours (OBE), ordinals (John Smith Jr, Bill Jones II) etc",
41
66
  "minLength": 1
42
67
  }
43
68
  }
44
69
  }
45
70
  ]
46
- }
47
-
71
+ }
@@ -1,14 +1,24 @@
1
1
  {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
2
3
  "name": "PreviousName",
3
4
  "description": "A previous name of a company",
4
5
  "type": "object",
5
- "properties": { "company_name": { "type": "string", "minLength": 1 },
6
- "con_date": {
7
- "type": "date",
8
- "description": "The end (conversion) date of the name"
9
- },
10
- "start_date": {"type":"string","format": "date"}
6
+ "properties": {
7
+ "company_name": {
8
+ "type": "string",
9
+ "minLength": 1
10
+ },
11
+ "con_date": {
12
+ "type": "string",
13
+ "format": "date",
14
+ "description": "The end (conversion) date of the name"
15
+ },
16
+ "start_date": {
17
+ "type": "string",
18
+ "format": "date"
19
+ }
11
20
  },
12
- "required": [ "company_name" ]
13
- }
14
-
21
+ "required": [
22
+ "company_name"
23
+ ]
24
+ }
@@ -1,15 +1,22 @@
1
1
  {
2
- "name": "Share Parcel Data",
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
3
  "type": "object",
4
4
  "properties": {
5
- "data_type": { "enum": [ "share_parcel" ] },
5
+ "data_type": {
6
+ "enum": [
7
+ "share_parcel"
8
+ ]
9
+ },
6
10
  "properties": {
7
11
  "type": "object",
8
- "required": ["shareholders"],
12
+ "required": [
13
+ "shareholders"
14
+ ],
9
15
  "properties": {
10
16
  "number_of_shares": {
11
17
  "description": "Number of shares, if known",
12
- "type": "integer"},
18
+ "type": "integer"
19
+ },
13
20
  "percentage_of_shares": {
14
21
  "description": "Percentage of shares, if known",
15
22
  "type": "number",
@@ -22,40 +29,45 @@
22
29
  "minItems": 1,
23
30
  "items": {
24
31
  "anyOf": [
25
- {"type": "object",
26
- "name": "person",
27
- "required": ["name"],
28
- "properties": {
29
- "name": {
30
- "description": "Name of natural person or company",
31
- "type": "string"
32
- },
33
- "jurisdiction": {
34
- "description": "Jurisdiction of registration, if company",
35
- "type": "string"
36
- },
37
- "company_number": {
38
- "description": "Company number, if company and known",
39
- "type": "string"
40
- },
41
- "identifier": {
42
- "description": "Unique identifier of person",
43
- "type": "string"
44
- },
45
- "type": {
46
- "description": "Type of person if known (company or natural person)",
47
- "enum" : ["Company", "Person"]
48
- },
49
- "address": {
50
- "description": "Address given for owner of parcel",
51
- "type": "string"
52
- },
53
- "address_country": {
54
- "description": "Country part of owner's address",
55
- "type": "string"
56
- }
57
-
58
- }
32
+ {
33
+ "type": "object",
34
+ "name": "person",
35
+ "required": [
36
+ "name"
37
+ ],
38
+ "properties": {
39
+ "name": {
40
+ "description": "Name of natural person or company",
41
+ "type": "string"
42
+ },
43
+ "jurisdiction": {
44
+ "description": "Jurisdiction of registration, if company",
45
+ "type": "string"
46
+ },
47
+ "company_number": {
48
+ "description": "Company number, if company and known",
49
+ "type": "string"
50
+ },
51
+ "identifier": {
52
+ "description": "Unique identifier of person",
53
+ "type": "string"
54
+ },
55
+ "type": {
56
+ "description": "Type of person if known (company or natural person)",
57
+ "enum": [
58
+ "Company",
59
+ "Person"
60
+ ]
61
+ },
62
+ "address": {
63
+ "description": "Address given for owner of parcel",
64
+ "type": "string"
65
+ },
66
+ "address_country": {
67
+ "description": "Country part of owner's address",
68
+ "type": "string"
69
+ }
70
+ }
59
71
  }
60
72
  ]
61
73
  }
@@ -63,5 +75,8 @@
63
75
  }
64
76
  }
65
77
  },
66
- "required": [ "data_type", "properties" ]
67
- }
78
+ "required": [
79
+ "data_type",
80
+ "properties"
81
+ ]
82
+ }