|
1
|
|
|
<?php |
|
2
|
|
|
namespace BOTK\Model; |
|
3
|
|
|
|
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* An ibrid class that merge the semantic of schema:organization, schema:place and schema:geo. |
|
7
|
|
|
* It is similar to schema:LocalBusiness. |
|
8
|
|
|
*/ |
|
9
|
|
|
class LocalBusiness extends Thing |
|
10
|
|
|
{ |
|
11
|
|
|
|
|
12
|
|
|
protected static $DEFAULT_OPTIONS = array ( |
|
13
|
|
|
|
|
14
|
|
|
'businessType' => array( |
|
15
|
|
|
'filter' => FILTER_DEFAULT, |
|
16
|
|
|
'flags' => FILTER_FORCE_ARRAY |
|
17
|
|
|
), |
|
18
|
|
|
'taxID' => array( |
|
19
|
|
|
'filter' => FILTER_CALLBACK, |
|
20
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_TOKEN', |
|
21
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
22
|
|
|
), |
|
23
|
|
|
'vatID' => array( // italian rules |
|
24
|
|
|
'filter' => FILTER_VALIDATE_REGEXP, |
|
25
|
|
|
'options' => array('regexp'=>'/^[0-9]{11}$/'), |
|
26
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
27
|
|
|
), |
|
28
|
|
|
'legalName' => array( |
|
29
|
|
|
'filter' => FILTER_CALLBACK, |
|
30
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_ADDRESS', |
|
31
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
32
|
|
|
), |
|
33
|
|
|
'businessName' => array( |
|
34
|
|
|
'filter' => FILTER_DEFAULT, |
|
35
|
|
|
'flags' => FILTER_FORCE_ARRAY |
|
36
|
|
|
), |
|
37
|
|
|
'addressDescription'=> array( // |
|
38
|
|
|
'filter' => FILTER_CALLBACK, |
|
39
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_ADDRESS', |
|
40
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
41
|
|
|
), |
|
42
|
|
|
'addressCountry' => array( |
|
43
|
|
|
'default' => 'IT', |
|
44
|
|
|
'filter' => FILTER_VALIDATE_REGEXP, |
|
45
|
|
|
'options' => array('regexp'=>'/^[A-Z]{2}$/'), |
|
46
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
47
|
|
|
), |
|
48
|
|
|
'addressLocality' => array( |
|
49
|
|
|
'filter' => FILTER_CALLBACK, |
|
50
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_ADDRESS', |
|
51
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
52
|
|
|
), |
|
53
|
|
|
'addressRegion' => array( |
|
54
|
|
|
'filter' => FILTER_CALLBACK, |
|
55
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_ADDRESS', |
|
56
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
57
|
|
|
), |
|
58
|
|
|
'streetAddress' => array( |
|
59
|
|
|
'filter' => FILTER_CALLBACK, |
|
60
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_ADDRESS', |
|
61
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
62
|
|
|
), |
|
63
|
|
|
'postalCode' => array( // italian rules |
|
64
|
|
|
'filter' => FILTER_VALIDATE_REGEXP, |
|
65
|
|
|
'options' => array('regexp'=>'/^[0-9]{5}$/'), |
|
66
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
67
|
|
|
), |
|
68
|
|
|
'telephone' => array( |
|
69
|
|
|
'filter' => FILTER_CALLBACK, |
|
70
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_TELEPHONE', |
|
71
|
|
|
'flags' => FILTER_FORCE_ARRAY |
|
72
|
|
|
), |
|
73
|
|
|
'faxNumber' => array( |
|
74
|
|
|
'filter' => FILTER_CALLBACK, |
|
75
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_TELEPHONE', |
|
76
|
|
|
'flags' => FILTER_FORCE_ARRAY |
|
77
|
|
|
), |
|
78
|
|
|
'email' => array( |
|
79
|
|
|
'filter' => FILTER_CALLBACK, |
|
80
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_EMAIL', |
|
81
|
|
|
'flags' => FILTER_FORCE_ARRAY |
|
82
|
|
|
), |
|
83
|
|
|
'lat' => array( |
|
84
|
|
|
'filter' => FILTER_CALLBACK, |
|
85
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_GEO' |
|
86
|
|
|
), |
|
87
|
|
|
'long' => array( |
|
88
|
|
|
'filter' => FILTER_CALLBACK, |
|
89
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_GEO' |
|
90
|
|
|
), |
|
91
|
|
|
'similarStreet' => array( |
|
92
|
|
|
'filter' => FILTER_CALLBACK, |
|
93
|
|
|
'options' => '\BOTK\Filters::FILTER_VALIDATE_URI', |
|
94
|
|
|
'flags' => FILTER_FORCE_ARRAY |
|
95
|
|
|
), |
|
96
|
|
|
'hasMap' => array( |
|
97
|
|
|
'filter' => FILTER_CALLBACK, |
|
98
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_HTTP_URL', |
|
99
|
|
|
'flags' => FILTER_FORCE_ARRAY |
|
100
|
|
|
), |
|
101
|
|
|
'aggregateRatingValue' => array( |
|
102
|
|
|
'filter' => FILTER_VALIDATE_FLOAT, |
|
103
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
104
|
|
|
), |
|
105
|
|
|
'openingHours' => array( |
|
106
|
|
|
'filter' => FILTER_DEFAULT, |
|
107
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
108
|
|
|
), |
|
109
|
|
|
'near' => array( |
|
110
|
|
|
'filter' => FILTER_CALLBACK, |
|
111
|
|
|
'options' => '\BOTK\Filters::FILTER_VALIDATE_URI', |
|
112
|
|
|
'flags' => FILTER_FORCE_ARRAY |
|
113
|
|
|
), |
|
114
|
|
|
'numberOfEmployees' => array( |
|
115
|
|
|
'filter' => FILTER_VALIDATE_REGEXP, |
|
116
|
|
|
'options' => array('regexp'=>'/^[0-9]+\s*-?\s*[0-9]*$/'), |
|
117
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
118
|
|
|
), |
|
119
|
|
|
'annualTurnover' => array( |
|
120
|
|
|
'filter' => FILTER_CALLBACK, |
|
121
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
122
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
123
|
|
|
), |
|
124
|
|
|
'ateco2007' => array( |
|
125
|
|
|
'filter' => FILTER_VALIDATE_REGEXP, |
|
126
|
|
|
'options' => array('regexp'=>'/^[0-9]{6}$/'), |
|
127
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
128
|
|
|
), |
|
129
|
|
|
'ebitda' => array( |
|
130
|
|
|
'filter' => FILTER_CALLBACK, |
|
131
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
132
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
133
|
|
|
), |
|
134
|
|
|
'netProfit' => array( |
|
135
|
|
|
'filter' => FILTER_CALLBACK, |
|
136
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
137
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
138
|
|
|
), |
|
139
|
|
|
'naceV2' => array( |
|
140
|
|
|
'filter' => FILTER_VALIDATE_REGEXP, |
|
141
|
|
|
'options' => array('regexp'=>'/^[0-9]{2}[.]?[0-9]{1,2}$/'), |
|
142
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
143
|
|
|
), |
|
144
|
|
|
'isicV4' => array( |
|
145
|
|
|
'filter' => FILTER_VALIDATE_REGEXP, |
|
146
|
|
|
'options' => array('regexp'=>'/^[0-9]{4}$/'), |
|
147
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
148
|
|
|
), |
|
149
|
|
|
'hasTotDevelopers' => array( |
|
150
|
|
|
'filter' => FILTER_CALLBACK, |
|
151
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
152
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
153
|
|
|
), |
|
154
|
|
|
'parentOrganization' => array( |
|
155
|
|
|
'filter' => FILTER_CALLBACK, |
|
156
|
|
|
'options' => '\BOTK\Filters::FILTER_VALIDATE_URI', |
|
157
|
|
|
'flags' => FILTER_REQUIRE_SCALAR, |
|
158
|
|
|
), |
|
159
|
|
|
'hasITEmployees' => array( |
|
160
|
|
|
'filter' => FILTER_CALLBACK, |
|
161
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
162
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
163
|
|
|
), |
|
164
|
|
|
'hasNumberOfPCs' => array( |
|
165
|
|
|
'filter' => FILTER_CALLBACK, |
|
166
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
167
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
168
|
|
|
), |
|
169
|
|
|
'hasITBudget' => array( |
|
170
|
|
|
'filter' => FILTER_CALLBACK, |
|
171
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
172
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
173
|
|
|
), |
|
174
|
|
|
'hasTablets' => array( |
|
175
|
|
|
'filter' => FILTER_CALLBACK, |
|
176
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
177
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
178
|
|
|
), |
|
179
|
|
|
'hasWorkstations' => array( |
|
180
|
|
|
'filter' => FILTER_CALLBACK, |
|
181
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
182
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
183
|
|
|
), |
|
184
|
|
|
'hasStorageBudget' => array( |
|
185
|
|
|
'filter' => FILTER_CALLBACK, |
|
186
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
187
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
188
|
|
|
), |
|
189
|
|
|
'hasServerBudget' => array( |
|
190
|
|
|
'filter' => FILTER_CALLBACK, |
|
191
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
192
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
193
|
|
|
), |
|
194
|
|
|
'hasServers' => array( |
|
195
|
|
|
'filter' => FILTER_CALLBACK, |
|
196
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
197
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
198
|
|
|
), |
|
199
|
|
|
'hasDesktop' => array( |
|
200
|
|
|
'filter' => FILTER_CALLBACK, |
|
201
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
202
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
203
|
|
|
), |
|
204
|
|
|
'hasLaptops' => array( |
|
205
|
|
|
'filter' => FILTER_CALLBACK, |
|
206
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
207
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
208
|
|
|
), |
|
209
|
|
|
'hasPrinters' => array( |
|
210
|
|
|
'filter' => FILTER_CALLBACK, |
|
211
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
212
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
213
|
|
|
), |
|
214
|
|
|
'hasMultifunctionPrinters' => array( |
|
215
|
|
|
'filter' => FILTER_CALLBACK, |
|
216
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
217
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
218
|
|
|
), |
|
219
|
|
|
'hasColorPrinter' => array( |
|
220
|
|
|
'filter' => FILTER_CALLBACK, |
|
221
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
222
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
223
|
|
|
), |
|
224
|
|
|
'hasInternetUsers' => array( |
|
225
|
|
|
'filter' => FILTER_CALLBACK, |
|
226
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
227
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
228
|
|
|
), |
|
229
|
|
|
'hasWirelessUsers' => array( |
|
230
|
|
|
'filter' => FILTER_CALLBACK, |
|
231
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
232
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
233
|
|
|
), |
|
234
|
|
|
'hasNetworkLines' => array( |
|
235
|
|
|
'filter' => FILTER_CALLBACK, |
|
236
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
237
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
238
|
|
|
), |
|
239
|
|
|
'hasRouters' => array( |
|
240
|
|
|
'filter' => FILTER_CALLBACK, |
|
241
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
242
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
243
|
|
|
), |
|
244
|
|
|
'hasStorageCapacity' => array( |
|
245
|
|
|
'filter' => FILTER_CALLBACK, |
|
246
|
|
|
'options' => '\BOTK\Filters::SANITIZE_STORAGE_CAPACITY', |
|
247
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
248
|
|
|
), |
|
249
|
|
|
'hasExtensions' => array( |
|
250
|
|
|
'filter' => FILTER_CALLBACK, |
|
251
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
252
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
253
|
|
|
), |
|
254
|
|
|
'hasTotCallCenterCallers' => array( |
|
255
|
|
|
'filter' => FILTER_CALLBACK, |
|
256
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
257
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
258
|
|
|
), |
|
259
|
|
|
'hasThinPC' => array( |
|
260
|
|
|
'filter' => FILTER_CALLBACK, |
|
261
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
262
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
263
|
|
|
), |
|
264
|
|
|
'hasSalesforce' => array( |
|
265
|
|
|
'filter' => FILTER_CALLBACK, |
|
266
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
267
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
268
|
|
|
), |
|
269
|
|
|
'hasRevenue' => array( |
|
270
|
|
|
'filter' => FILTER_CALLBACK, |
|
271
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
272
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
273
|
|
|
), |
|
274
|
|
|
'hasCommercialBudget' => array( |
|
275
|
|
|
'filter' => FILTER_CALLBACK, |
|
276
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
277
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
278
|
|
|
), |
|
279
|
|
|
'hasHardwareBudget' => array( |
|
280
|
|
|
'filter' => FILTER_CALLBACK, |
|
281
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
282
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
283
|
|
|
), |
|
284
|
|
|
'hasSoftwareBudget' => array( |
|
285
|
|
|
'filter' => FILTER_CALLBACK, |
|
286
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
287
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
288
|
|
|
), |
|
289
|
|
|
'hasOutsrcingBudget' => array( |
|
290
|
|
|
'filter' => FILTER_CALLBACK, |
|
291
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
292
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
293
|
|
|
), |
|
294
|
|
|
'hasOtherHardwareBudget' => array( |
|
295
|
|
|
'filter' => FILTER_CALLBACK, |
|
296
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
297
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
298
|
|
|
), |
|
299
|
|
|
'hasPCBudget' => array( |
|
300
|
|
|
'filter' => FILTER_CALLBACK, |
|
301
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
302
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
303
|
|
|
), |
|
304
|
|
|
'hasPrinterBudget' => array( |
|
305
|
|
|
'filter' => FILTER_CALLBACK, |
|
306
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
307
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
308
|
|
|
), |
|
309
|
|
|
'hasTerminalBudget' => array( |
|
310
|
|
|
'filter' => FILTER_CALLBACK, |
|
311
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
312
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
313
|
|
|
), |
|
314
|
|
|
'hasPeripheralBudget' => array( |
|
315
|
|
|
'filter' => FILTER_CALLBACK, |
|
316
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
317
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
318
|
|
|
), |
|
319
|
|
|
'hasDesktopPrinters' => array( |
|
320
|
|
|
'filter' => FILTER_CALLBACK, |
|
321
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
322
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
323
|
|
|
), |
|
324
|
|
|
'hasNetworkPrinters' => array( |
|
325
|
|
|
'filter' => FILTER_CALLBACK, |
|
326
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
327
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
328
|
|
|
), |
|
329
|
|
|
'hasSmartphoneUsers' => array( |
|
330
|
|
|
'filter' => FILTER_CALLBACK, |
|
331
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
332
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
333
|
|
|
), |
|
334
|
|
|
'hasEnterpriseSmartphoneUsers' => array( |
|
335
|
|
|
'filter' => FILTER_CALLBACK, |
|
336
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
|
337
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
338
|
|
|
), |
|
339
|
|
|
'hasServerManufacturer' => array( |
|
340
|
|
|
'filter' => FILTER_DEFAULT, |
|
341
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
342
|
|
|
), |
|
343
|
|
|
'hasServerVirtualizationManufacturer' => array( |
|
344
|
|
|
'filter' => FILTER_DEFAULT, |
|
345
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
346
|
|
|
), |
|
347
|
|
|
'hasDASManufacturer' => array( |
|
348
|
|
|
'filter' => FILTER_DEFAULT, |
|
349
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
350
|
|
|
), |
|
351
|
|
|
'hasNASManufacturer' => array( |
|
352
|
|
|
'filter' => FILTER_DEFAULT, |
|
353
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
354
|
|
|
), |
|
355
|
|
|
'hasSANManufacturer' => array( |
|
356
|
|
|
'filter' => FILTER_DEFAULT, |
|
357
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
358
|
|
|
), |
|
359
|
|
|
'hasTapeLibraryManufacturer' => array( |
|
360
|
|
|
'filter' => FILTER_DEFAULT, |
|
361
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
362
|
|
|
), |
|
363
|
|
|
'hasStorageVirtualizationManufacturer' => array( |
|
364
|
|
|
'filter' => FILTER_DEFAULT, |
|
365
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
366
|
|
|
), |
|
367
|
|
|
'naics' => array( |
|
368
|
|
|
'filter' => FILTER_DEFAULT, |
|
369
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
370
|
|
|
), |
|
371
|
|
|
'hasNAFCode' => array( |
|
372
|
|
|
'filter' => FILTER_DEFAULT, |
|
373
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
374
|
|
|
), |
|
375
|
|
|
'hasServerSeries' => array( |
|
376
|
|
|
'filter' => FILTER_DEFAULT, |
|
377
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
378
|
|
|
), |
|
379
|
|
|
'hasDesktopManufacturer' => array( |
|
380
|
|
|
'filter' => FILTER_DEFAULT, |
|
381
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
382
|
|
|
), |
|
383
|
|
|
'hasLaptopManufacturer' => array( |
|
384
|
|
|
'filter' => FILTER_DEFAULT, |
|
385
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
386
|
|
|
), |
|
387
|
|
|
'hasDesktopVirtualizationManufacturer' => array( |
|
388
|
|
|
'filter' => FILTER_DEFAULT, |
|
389
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
390
|
|
|
), |
|
391
|
|
|
'hasWorkstationManufacturer' => array( |
|
392
|
|
|
'filter' => FILTER_DEFAULT, |
|
393
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
394
|
|
|
), |
|
395
|
|
|
'hasNetworkPrinterManufacturer' => array( |
|
396
|
|
|
'filter' => FILTER_DEFAULT, |
|
397
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
398
|
|
|
), |
|
399
|
|
|
'hasHighVolumePrinterManufacturer' => array( |
|
400
|
|
|
'filter' => FILTER_DEFAULT, |
|
401
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
402
|
|
|
), |
|
403
|
|
|
'hasCopierManufacturer' => array( |
|
404
|
|
|
'filter' => FILTER_DEFAULT, |
|
405
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
406
|
|
|
), |
|
407
|
|
|
'hasUPSManufacturer' => array( |
|
408
|
|
|
'filter' => FILTER_DEFAULT, |
|
409
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
410
|
|
|
), |
|
411
|
|
|
'hasERPSuiteVendor' => array( |
|
412
|
|
|
'filter' => FILTER_DEFAULT, |
|
413
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
414
|
|
|
), |
|
415
|
|
|
'hasERPSoftwareasaServiceManufacturer' => array( |
|
416
|
|
|
'filter' => FILTER_DEFAULT, |
|
417
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
418
|
|
|
), |
|
419
|
|
|
'hasAppServerSoftwareVendor' => array( |
|
420
|
|
|
'filter' => FILTER_DEFAULT, |
|
421
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
422
|
|
|
), |
|
423
|
|
|
'hasBusIntellSoftwareVendor' => array( |
|
424
|
|
|
'filter' => FILTER_DEFAULT, |
|
425
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
426
|
|
|
), |
|
427
|
|
|
'hasCollaborativeSoftwareVendor' => array( |
|
428
|
|
|
'filter' => FILTER_DEFAULT, |
|
429
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
430
|
|
|
), |
|
431
|
|
|
'hasCRMSoftwareVendor' => array( |
|
432
|
|
|
'filter' => FILTER_DEFAULT, |
|
433
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
434
|
|
|
), |
|
435
|
|
|
'hasCRMSoftwareasaServiceManufacturer' => array( |
|
436
|
|
|
'filter' => FILTER_DEFAULT, |
|
437
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
438
|
|
|
), |
|
439
|
|
|
'hasDocumentMgmtSoftwareVendor' => array( |
|
440
|
|
|
'filter' => FILTER_DEFAULT, |
|
441
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
442
|
|
|
), |
|
443
|
|
|
'hasAppConsolidationSoftwareVendor' => array( |
|
444
|
|
|
'filter' => FILTER_DEFAULT, |
|
445
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
446
|
|
|
), |
|
447
|
|
|
'hasHumanResourceSoftwareVendor' => array( |
|
448
|
|
|
'filter' => FILTER_DEFAULT, |
|
449
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
450
|
|
|
), |
|
451
|
|
|
'hasSupplyChainSoftwareVendor' => array( |
|
452
|
|
|
'filter' => FILTER_DEFAULT, |
|
453
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
454
|
|
|
), |
|
455
|
|
|
'hasWebServiceSoftwareVendor' => array( |
|
456
|
|
|
'filter' => FILTER_DEFAULT, |
|
457
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
458
|
|
|
), |
|
459
|
|
|
'hasDatawarehouseSoftwareVendor' => array( |
|
460
|
|
|
'filter' => FILTER_DEFAULT, |
|
461
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
462
|
|
|
), |
|
463
|
|
|
'hasSaaSVendor' => array( |
|
464
|
|
|
'filter' => FILTER_DEFAULT, |
|
465
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
466
|
|
|
), |
|
467
|
|
|
'hasEmailMessagingVendor' => array( |
|
468
|
|
|
'filter' => FILTER_DEFAULT, |
|
469
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
470
|
|
|
), |
|
471
|
|
|
'hasEmailSaaSManufacturer' => array( |
|
472
|
|
|
'filter' => FILTER_DEFAULT, |
|
473
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
474
|
|
|
), |
|
475
|
|
|
'hasOSVendor' => array( |
|
476
|
|
|
'filter' => FILTER_DEFAULT, |
|
477
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
478
|
|
|
), |
|
479
|
|
|
'hasOSModel' => array( |
|
480
|
|
|
'filter' => FILTER_DEFAULT, |
|
481
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
482
|
|
|
), |
|
483
|
|
|
'hasDBMSVendor' => array( |
|
484
|
|
|
'filter' => FILTER_DEFAULT, |
|
485
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
486
|
|
|
), |
|
487
|
|
|
'hasAcctingVendor' => array( |
|
488
|
|
|
'filter' => FILTER_DEFAULT, |
|
489
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
490
|
|
|
), |
|
491
|
|
|
'hasAntiVirusVendor' => array( |
|
492
|
|
|
'filter' => FILTER_DEFAULT, |
|
493
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
494
|
|
|
), |
|
495
|
|
|
'hasAssetManagementSoftwareVendor' => array( |
|
496
|
|
|
'filter' => FILTER_DEFAULT, |
|
497
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
498
|
|
|
), |
|
499
|
|
|
'hasEnterpriseManagementSoftwareVendor' => array( |
|
500
|
|
|
'filter' => FILTER_DEFAULT, |
|
501
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
502
|
|
|
), |
|
503
|
|
|
'hasIDAccessSoftwareVendor' => array( |
|
504
|
|
|
'filter' => FILTER_DEFAULT, |
|
505
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
506
|
|
|
), |
|
507
|
|
|
'hasStorageManagementSoftwareVendor' => array( |
|
508
|
|
|
'filter' => FILTER_DEFAULT, |
|
509
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
510
|
|
|
), |
|
511
|
|
|
'hasStorageSaaSManufacturer' => array( |
|
512
|
|
|
'filter' => FILTER_DEFAULT, |
|
513
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
514
|
|
|
), |
|
515
|
|
|
'hasEthernetTechnology' => array( |
|
516
|
|
|
'filter' => FILTER_DEFAULT, |
|
517
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
518
|
|
|
), |
|
519
|
|
|
'haseCommerceType' => array( |
|
520
|
|
|
'filter' => FILTER_DEFAULT, |
|
521
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
522
|
|
|
), |
|
523
|
|
|
'hasHostorRemoteStatus' => array( |
|
524
|
|
|
'filter' => FILTER_DEFAULT, |
|
525
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
526
|
|
|
), |
|
527
|
|
|
'hasNetworkLineCarrier' => array( |
|
528
|
|
|
'filter' => FILTER_DEFAULT, |
|
529
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
530
|
|
|
), |
|
531
|
|
|
'hasVideoConfServicesProvider' => array( |
|
532
|
|
|
'filter' => FILTER_DEFAULT, |
|
533
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
534
|
|
|
), |
|
535
|
|
|
'hasUnifiedCommSvcProvider' => array( |
|
536
|
|
|
'filter' => FILTER_DEFAULT, |
|
537
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
538
|
|
|
), |
|
539
|
|
|
'hasRouterManufacturer' => array( |
|
540
|
|
|
'filter' => FILTER_DEFAULT, |
|
541
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
542
|
|
|
), |
|
543
|
|
|
'hasSwitchManufacturer' => array( |
|
544
|
|
|
'filter' => FILTER_DEFAULT, |
|
545
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
546
|
|
|
), |
|
547
|
|
|
'hasVPNManufacturer' => array( |
|
548
|
|
|
'filter' => FILTER_DEFAULT, |
|
549
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
550
|
|
|
), |
|
551
|
|
|
'hasISP' => array( |
|
552
|
|
|
'filter' => FILTER_DEFAULT, |
|
553
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
554
|
|
|
), |
|
555
|
|
|
'hasNetworkServiceProvider' => array( |
|
556
|
|
|
'filter' => FILTER_DEFAULT, |
|
557
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
558
|
|
|
), |
|
559
|
|
|
'hasPhoneSystemManufacturer' => array( |
|
560
|
|
|
'filter' => FILTER_DEFAULT, |
|
561
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
562
|
|
|
), |
|
563
|
|
|
'hasVoIPManufacturer' => array( |
|
564
|
|
|
'filter' => FILTER_DEFAULT, |
|
565
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
566
|
|
|
), |
|
567
|
|
|
'hasVoIPHosting' => array( |
|
568
|
|
|
'filter' => FILTER_DEFAULT, |
|
569
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
570
|
|
|
), |
|
571
|
|
|
'hasLongDistanceCarrier' => array( |
|
572
|
|
|
'filter' => FILTER_DEFAULT, |
|
573
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
574
|
|
|
), |
|
575
|
|
|
'hasWirelessProvider' => array( |
|
576
|
|
|
'filter' => FILTER_DEFAULT, |
|
577
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
578
|
|
|
), |
|
579
|
|
|
'hasPhoneSystemMaintenanceProvider' => array( |
|
580
|
|
|
'filter' => FILTER_DEFAULT, |
|
581
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
582
|
|
|
), |
|
583
|
|
|
'hasSmartphoneManufacturer' => array( |
|
584
|
|
|
'filter' => FILTER_DEFAULT, |
|
585
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
586
|
|
|
), |
|
587
|
|
|
'hasSmartphoneOS' => array( |
|
588
|
|
|
'filter' => FILTER_DEFAULT, |
|
589
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
590
|
|
|
), |
|
591
|
|
|
'hasFYE' => array( |
|
592
|
|
|
'filter' => FILTER_VALIDATE_REGEXP, |
|
593
|
|
|
'options' => array('regexp'=>'/^[A-Z]{3}$/'), |
|
594
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
|
595
|
|
|
) |
|
596
|
|
|
); |
|
597
|
|
|
|
|
598
|
|
|
/** |
|
599
|
|
|
* Redefine protected constructor to add address description as dynamic property |
|
600
|
|
|
*/ |
|
601
|
13 |
|
protected function __construct(array $data = array(), array $customOptions = array()) |
|
602
|
|
|
{ |
|
603
|
13 |
|
parent::__construct($data, $customOptions); |
|
604
|
13 |
|
$this->addAddressDescription(); |
|
605
|
13 |
|
} |
|
606
|
|
|
|
|
607
|
|
|
|
|
608
|
|
|
/** |
|
609
|
|
|
* If not existing, create an address description as a normalized address from following data properties: |
|
610
|
|
|
* 'addressLocality', |
|
611
|
|
|
* 'addressRegion', |
|
612
|
|
|
* 'streetAddress', |
|
613
|
|
|
* 'postalCode', |
|
614
|
|
|
*/ |
|
615
|
13 |
|
private function addAddressDescription() |
|
616
|
|
|
{ |
|
617
|
13 |
|
if(empty($this->data['addressDescription'])){ |
|
618
|
10 |
|
if( !empty($this->data['streetAddress']) && ( !empty($this->data['addressLocality']) || !empty($this->data['postalCode']))){ |
|
619
|
4 |
|
$this->data['addressDescription'] = "{$this->data['streetAddress']} ,"; |
|
620
|
4 |
|
if(!empty($this->data['postalCode'])) { $this->data['addressDescription'].= " {$this->data['postalCode']}";} |
|
621
|
4 |
|
if(!empty($this->data['addressLocality'])) { $this->data['addressDescription'].= " {$this->data['addressLocality']}"; } |
|
622
|
4 |
|
if(!empty($this->data['addressRegion'])) { $this->data['addressDescription'].= " ({$this->data['addressRegion']})"; } |
|
623
|
|
|
} |
|
624
|
|
|
} |
|
625
|
13 |
|
if(!empty($this->data['addressDescription'])){ |
|
626
|
7 |
|
$this->data['addressDescription'] = \BOTK\Filters::FILTER_SANITIZE_ADDRESS($this->data['addressDescription']); |
|
627
|
|
|
} |
|
628
|
13 |
|
} |
|
629
|
|
|
|
|
630
|
|
|
|
|
631
|
|
|
/** |
|
632
|
|
|
* return a structured info to generate rdf code for quantitative values |
|
633
|
|
|
*/ |
|
634
|
4 |
|
private function getParsedQuantitativeVars() |
|
635
|
|
|
{ |
|
636
|
4 |
|
static $quantitativeValuesVar = array( |
|
637
|
|
|
'numberOfEmployees' => 'schema:numberOfEmployees', |
|
638
|
|
|
'annualTurnover' => 'botk:annualTurnover', |
|
639
|
|
|
'ebitda' => 'botk:ebitda' , |
|
640
|
|
|
'netProfit' => 'botk:netProfit', |
|
641
|
|
|
'hasTotDevelopers' => 'botk:hasTotDevelopers', |
|
642
|
|
|
'itBudget' => 'botk:itBudget', |
|
643
|
|
|
'itStorageBudget' => 'botk:itStorageBudget', |
|
644
|
|
|
'itHardwareBudget' => 'botk:itHardwareBudget', |
|
645
|
|
|
'itServerBudget' => 'botk:itServerBudget', |
|
646
|
|
|
'softwareBudget' => 'botk:softwareBudget', |
|
647
|
|
|
'hasITEmployees' => 'botk:hasITEmployees', |
|
648
|
|
|
'hasNumberOfPCs' => 'botk:hasNumberOfPCs', |
|
649
|
|
|
'hasITBudget' => 'botk:hasITBudget', |
|
650
|
|
|
'hasTablets' => 'botk:hasTablets', |
|
651
|
|
|
'hasWorkstations' => 'botk:hasWorkstations', |
|
652
|
|
|
'hasStorageBudget' => 'botk:hasStorageBudget', |
|
653
|
|
|
'hasServerBudget' => 'botk:hasServerBudget', |
|
654
|
|
|
'hasServers' => 'botk:hasServers', |
|
655
|
|
|
'hasDesktop' => 'botk:hasDesktop', |
|
656
|
|
|
'hasLaptops' => 'botk:hasLaptops', |
|
657
|
|
|
'hasPrinters' => 'botk:hasPrinters', |
|
658
|
|
|
'hasMultifunctionPrinters' => 'botk:hasMultifunctionPrinters', |
|
659
|
|
|
'hasColorPrinter' => 'botk:hasColorPrinter', |
|
660
|
|
|
'hasInternetUsers' => 'botk:hasInternetUsers', |
|
661
|
|
|
'hasWirelessUsers' => 'botk:hasWirelessUsers', |
|
662
|
|
|
'hasNetworkLines' => 'botk:hasNetworkLines', |
|
663
|
|
|
'hasRouters' => 'botk:hasRouters', |
|
664
|
|
|
'hasStorageCapacity' => 'botk:hasStorageCapacity', |
|
665
|
|
|
'hasExtensions' => 'botk:hasExtensions', |
|
666
|
|
|
'hasTotCallCenterCallers' => 'botk:hasTotCallCenterCallers', |
|
667
|
|
|
'hasThinPC' => 'botk:hasThinPC', |
|
668
|
|
|
'hasSalesforce' => 'botk:hasSalesforce', |
|
669
|
|
|
'hasRevenue' => 'botk:hasRevenue', |
|
670
|
|
|
'hasCommercialBudget' => 'botk:hasCommercialBudget', |
|
671
|
|
|
'hasHardwareBudget' => 'botk:hasHardwareBudget', |
|
672
|
|
|
'hasSoftwareBudget' => 'botk:hasSoftwareBudget', |
|
673
|
|
|
'hasOutsrcingBudget' => 'botk:hasOutsrcingBudget', |
|
674
|
|
|
'hasOtherHardwareBudget' => 'botk:hasOtherHardwareBudget', |
|
675
|
|
|
'hasPCBudget' => 'botk:hasPCBudget', |
|
676
|
|
|
'hasPrinterBudget' => 'botk:hasPrinterBudget', |
|
677
|
|
|
'hasTerminalBudget' => 'botk:hasTerminalBudget', |
|
678
|
|
|
'hasPeripheralBudget' => 'botk:hasPeripheralBudget', |
|
679
|
|
|
'hasDesktopPrinters' => 'botk:hasDesktopPrinters', |
|
680
|
|
|
'hasNetworkPrinters' => 'botk:hasNetworkPrinters', |
|
681
|
|
|
'hasSmartphoneUsers' => 'botk:hasSmartphoneUsers', |
|
682
|
|
|
'hasEnterpriseSmartphoneUsers' => 'botk:hasSmartphoneUsers', |
|
683
|
|
|
); |
|
684
|
|
|
|
|
685
|
4 |
|
$parsedVars=array(); |
|
686
|
4 |
|
foreach ($quantitativeValuesVar as $statVar => $property){ |
|
687
|
4 |
|
if(!empty($this->data[$statVar])&& ($range=\BOTK\Filters::PARSE_QUANTITATIVE_VALUE($this->data[$statVar])) ){ |
|
688
|
1 |
|
list($min,$max)=$range; |
|
689
|
1 |
|
if( $min===$max){ |
|
690
|
1 |
|
$statUri = "{$this->data['base']}{$min}"; |
|
691
|
1 |
|
$turtleString = "<$statUri> schema:value $min ."; |
|
692
|
1 |
|
$tripleCounter = 1; |
|
693
|
|
|
} else { |
|
694
|
|
|
$statUri = "{$this->data['base']}{$min}to{$max}"; |
|
695
|
|
|
$turtleString = "<$statUri> schema:minValue $min ;schema:maxValue $max ."; |
|
696
|
|
|
$tripleCounter = 2; |
|
697
|
|
|
} |
|
698
|
4 |
|
$parsedVars[$statVar] = array($property,$statUri,$turtleString,$tripleCounter); |
|
699
|
|
|
} |
|
700
|
|
|
} |
|
701
|
4 |
|
return $parsedVars; |
|
702
|
|
|
} |
|
703
|
|
|
|
|
704
|
|
|
|
|
705
|
4 |
|
public function asTurtleFragment() |
|
706
|
|
|
{ |
|
707
|
4 |
|
static $uriVars = array( |
|
708
|
|
|
'parentOrganization' => 'schema:parentOrganization', |
|
709
|
|
|
'email' => 'schema:email', |
|
710
|
|
|
'geoUri' => 'schema:geo', |
|
711
|
|
|
'$hasMap' => 'schema:hasMap', |
|
712
|
|
|
); |
|
713
|
4 |
|
static $stringVars = array( |
|
714
|
|
|
'businessType' => 'a', |
|
715
|
|
|
'vatID' => 'schema:vatID', |
|
716
|
|
|
'taxtID' => 'schema:taxtID', |
|
717
|
|
|
'legalName' => 'schema:legalName', |
|
718
|
|
|
'businessName' => 'schema:alternateName', |
|
719
|
|
|
'telephone' => 'schema:telephone', |
|
720
|
|
|
'faxNumber' => 'schema:faxNumber', |
|
721
|
|
|
'openingHours' => 'schema:openingHours ', |
|
722
|
|
|
'disambiguatingDescription' => 'schema:disambiguatingDescription', |
|
723
|
|
|
'ateco2007' => 'botk:ateco2007', |
|
724
|
|
|
'naceV2' => 'botk:naceV2', |
|
725
|
|
|
'isicV4' => 'schema:isicV4', |
|
726
|
|
|
'hasServerManufacturer' => 'botk:hasServerManufacturer', |
|
727
|
|
|
'hasServerVirtualizationManufacturer' => 'botk:hasServerVirtualizationManufacturer', |
|
728
|
|
|
'hasDASManufacturer' => 'botk:hasDASManufacturer', |
|
729
|
|
|
'hasNASManufacturer' => 'botk:hasNASManufacturer', |
|
730
|
|
|
'hasSANManufacturer' => 'botk:hasSANManufacturer', |
|
731
|
|
|
'hasTapeLibraryManufacturer' => 'botk:hasTapeLibraryManufacturer', |
|
732
|
|
|
'hasStorageVirtualizationManufacturer' => 'botk:hasStorageVirtualizationManufacturer', |
|
733
|
|
|
'naics' => 'botk:naics', |
|
734
|
|
|
'hasNAFCode' => 'botk:hasNAFCode', |
|
735
|
|
|
'hasServerSeries' => 'botk:hasServerSeries', |
|
736
|
|
|
'hasDesktopManufacturer' => 'botk:hasDesktopManufacturer', |
|
737
|
|
|
'hasLaptopManufacturer' => 'botk:hasLaptopManufacturer', |
|
738
|
|
|
'hasDesktopVirtualizationManufacturer' => 'botk:hasDesktopVirtualizationManufacturer', |
|
739
|
|
|
'hasWorkstationManufacturer' => 'botk:hasWorkstationManufacturer', |
|
740
|
|
|
'hasNetworkPrinterManufacturer' => 'botk:hasNetworkPrinterManufacturer', |
|
741
|
|
|
'hasHighVolumePrinterManufacturer' => 'botk:hasHighVolumePrinterManufacturer', |
|
742
|
|
|
'hasCopierManufacturer' => 'botk:hasCopierManufacturer', |
|
743
|
|
|
'hasUPSManufacturer' => 'botk:hasUPSManufacturer', |
|
744
|
|
|
'hasERPSuiteVendor' => 'botk:hasERPSuiteVendor', |
|
745
|
|
|
'hasERPSoftwareasaServiceManufacturer' => 'botk:hasERPSoftwareasaServiceManufacturer', |
|
746
|
|
|
'hasAppServerSoftwareVendor' => 'botk:hasAppServerSoftwareVendor', |
|
747
|
|
|
'hasBusIntellSoftwareVendor' => 'botk:hasBusIntellSoftwareVendor', |
|
748
|
|
|
'hasCollaborativeSoftwareVendor' => 'botk:hasCollaborativeSoftwareVendor', |
|
749
|
|
|
'hasCRMSoftwareVendor' => 'botk:hasCRMSoftwareVendor', |
|
750
|
|
|
'hasCRMSoftwareasaServiceManufacturer' => 'botk:hasCRMSoftwareasaServiceManufacturer', |
|
751
|
|
|
'hasDocumentMgmtSoftwareVendor' => 'botk:hasDocumentMgmtSoftwareVendor', |
|
752
|
|
|
'hasAppConsolidationSoftwareVendor' => 'botk:hasAppConsolidationSoftwareVendor', |
|
753
|
|
|
'hasHumanResourceSoftwareVendor' => 'botk:hasHumanResourceSoftwareVendor', |
|
754
|
|
|
'hasSupplyChainSoftwareVendor' => 'botk:hasSupplyChainSoftwareVendor', |
|
755
|
|
|
'hasWebServiceSoftwareVendor' => 'botk:hasWebServiceSoftwareVendor', |
|
756
|
|
|
'hasDatawarehouseSoftwareVendor' => 'botk:hasDatawarehouseSoftwareVendor', |
|
757
|
|
|
'hasSaaSVendor' => 'botk:hasSaaSVendor', |
|
758
|
|
|
'hasEmailMessagingVendor' => 'botk:hasEmailMessagingVendor', |
|
759
|
|
|
'hasEmailSaaSManufacturer' => 'botk:hasEmailSaaSManufacturer', |
|
760
|
|
|
'hasOSVendor' => 'botk:hasOSVendor', |
|
761
|
|
|
'hasOSModel' => 'botk:hasOSModel', |
|
762
|
|
|
'hasDBMSVendor' => 'botk:hasDBMSVendor', |
|
763
|
|
|
'hasAcctingVendor' => 'botk:hasAcctingVendor', |
|
764
|
|
|
'hasAntiVirusVendor' => 'botk:hasAntiVirusVendor', |
|
765
|
|
|
'hasAssetManagementSoftwareVendor' => 'botk:hasAssetManagementSoftwareVendor', |
|
766
|
|
|
'hasEnterpriseManagementSoftwareVendor' => 'botk:hasEnterpriseManagementSoftwareVendor', |
|
767
|
|
|
'hasIDAccessSoftwareVendor' => 'botk:hasIDAccessSoftwareVendor', |
|
768
|
|
|
'hasStorageManagementSoftwareVendor' => 'botk:hasStorageManagementSoftwareVendor', |
|
769
|
|
|
'hasStorageSaaSManufacturer' => 'botk:hasStorageSaaSManufacturer', |
|
770
|
|
|
'hasEthernetTechnology' => 'botk:hasEthernetTechnology', |
|
771
|
|
|
'haseCommerceType' => 'botk:haseCommerceType', |
|
772
|
|
|
'hasHostorRemoteStatus' => 'botk:hasHostorRemoteStatus', |
|
773
|
|
|
'hasNetworkLineCarrier' => 'botk:hasNetworkLineCarrier', |
|
774
|
|
|
'hasVideoConfServicesProvider' => 'botk:hasVideoConfServicesProvider', |
|
775
|
|
|
'hasUnifiedCommSvcProvider' => 'botk:hasUnifiedCommSvcProvider', |
|
776
|
|
|
'hasRouterManufacturer' => 'botk:hasRouterManufacturer', |
|
777
|
|
|
'hasSwitchManufacturer' => 'botk:hasSwitchManufacturer', |
|
778
|
|
|
'hasVPNManufacturer' => 'botk:hasVPNManufacturer', |
|
779
|
|
|
'hasISP' => 'botk:hasISP', |
|
780
|
|
|
'hasNetworkServiceProvider' => 'botk:hasNetworkServiceProvider', |
|
781
|
|
|
'hasPhoneSystemManufacturer' => 'botk:hasPhoneSystemManufacturer', |
|
782
|
|
|
'hasVoIPManufacturer' => 'botk:hasVoIPManufacturer', |
|
783
|
|
|
'hasVoIPHosting' => 'botk:hasVoIPHosting', |
|
784
|
|
|
'hasLongDistanceCarrier' => 'botk:hasLongDistanceCarrier', |
|
785
|
|
|
'hasWirelessProvider' => 'botk:hasWirelessProvider', |
|
786
|
|
|
'hasPhoneSystemMaintenanceProvider' => 'botk:hasPhoneSystemMaintenanceProvider', |
|
787
|
|
|
'hasSmartphoneManufacturer' => 'botk:hasSmartphoneManufacturer', |
|
788
|
|
|
'hasSmartphoneOS' => 'botk:hasSmartphoneOS', |
|
789
|
|
|
'hasFYE'=> 'botk:hasFYE', |
|
790
|
|
|
); |
|
791
|
4 |
|
static $addressVars= array( |
|
792
|
|
|
'addressDescription' => 'schema:description', |
|
793
|
|
|
'streetAddress' => 'schema:streetAddress', |
|
794
|
|
|
'postalCode' => 'schema:postalCode', |
|
795
|
|
|
'addressLocality' => 'schema:addressLocality', |
|
796
|
|
|
'addressRegion' => 'schema:addressRegion', |
|
797
|
|
|
'addressCountry' => 'schema:addressCountry', |
|
798
|
|
|
); |
|
799
|
|
|
|
|
800
|
4 |
|
$parsedQuantitativeVars=$this->getParsedQuantitativeVars(); |
|
801
|
|
|
|
|
802
|
4 |
|
if(is_null($this->rdf)) { |
|
803
|
|
|
// create uris |
|
804
|
4 |
|
$organizationUri = $this->getUri(); |
|
805
|
4 |
|
$addressUri = $organizationUri.'_address'; |
|
806
|
4 |
|
$geoUri = ( !empty( $this->data['lat']) && !empty( $this->data['long']) )?"geo:{$this->data['lat']},{$this->data['long']}":null; |
|
807
|
|
|
|
|
808
|
4 |
|
$turtleString=parent::asTurtleFragment(); |
|
809
|
4 |
|
$tripleCounter = $this->tripleCount; |
|
810
|
|
|
|
|
811
|
|
|
// define $_ as a macro to write simple rdf |
|
812
|
4 |
|
$_= function($format, $var,$sanitize=true) use(&$turtleString, &$tripleCounter){ |
|
813
|
4 |
|
foreach((array)$var as $v){ |
|
814
|
4 |
|
if($var){ |
|
815
|
4 |
|
$turtleString.= sprintf($format,$sanitize?\BOTK\Filters::FILTER_SANITIZE_TURTLE_STRING($v):$v); |
|
816
|
4 |
|
$tripleCounter++; |
|
817
|
|
|
} |
|
818
|
|
|
} |
|
819
|
4 |
|
}; |
|
820
|
|
|
|
|
821
|
|
|
// serializes LocalBusiness properties |
|
822
|
|
|
$_('<%s> a schema:LocalBusiness;', $organizationUri); |
|
823
|
|
|
foreach ( $uriVars as $uriVar => $property) { |
|
824
|
|
|
if(!empty($this->data[$uriVar])){ |
|
825
|
|
|
$_("$property <%s>;", $this->data[$uriVar],false); |
|
826
|
|
|
} |
|
827
|
|
|
} |
|
828
|
|
|
foreach ( $parsedQuantitativeVars as $quantitativeVar => $parsedVal) { |
|
829
|
|
|
list($property,$statUri,,)=$parsedVal; |
|
830
|
|
|
$_("$property <%s>;", $statUri,false); |
|
831
|
|
|
} |
|
832
|
|
|
foreach ($stringVars as $stringVar => $property) { |
|
833
|
|
|
if(!empty($this->data[$stringVar])){ |
|
834
|
|
|
$_("$property \"%s\";", $this->data[$stringVar]); |
|
835
|
|
|
} |
|
836
|
|
|
} |
|
837
|
|
|
$_('schema:address <%s>. ', $addressUri); |
|
838
|
|
|
|
|
839
|
|
|
// serializes postal address properies |
|
840
|
|
|
$turtleString .= "<$addressUri> "; |
|
841
|
|
|
foreach( $addressVars as $stringVar=>$property) { |
|
842
|
|
|
if(!empty($this->data[$stringVar])){ |
|
843
|
|
|
$_("$property \"%s\";", $this->data[$stringVar]); |
|
844
|
|
|
} |
|
845
|
|
|
} |
|
846
|
|
|
$turtleString .= " a schema:PostalAddress."; |
|
847
|
|
|
$tripleCounter++; |
|
848
|
|
|
|
|
849
|
|
|
// serializes quantitative values |
|
850
|
|
|
foreach ( $parsedQuantitativeVars as $quantitativeVar => $parsedVal){ |
|
851
|
|
|
list(,,$ttl,$tc)=$parsedVal; |
|
852
|
|
|
$turtleString.=$ttl; |
|
853
|
|
|
$tripleCounter +=$tc; |
|
854
|
|
|
}; |
|
855
|
|
|
|
|
856
|
|
|
// serializes schema:GeoCoordinates |
|
857
|
|
|
if( !empty($geoUri)){ |
|
858
|
|
|
$turtleString.="<$geoUri> schema:latitude \"{$this->data['lat']}\"^^xsd:float;schema:longitude \"{$this->data['long']}\"^^xsd:float."; |
|
859
|
|
|
$tripleCounter +=2; |
|
860
|
|
|
} |
|
861
|
|
|
|
|
862
|
|
|
$this->rdf = $turtleString; |
|
863
|
|
|
$this->tripleCount = $tripleCounter; |
|
864
|
|
|
} |
|
865
|
|
|
|
|
866
|
|
|
return $this->rdf; |
|
867
|
|
|
} |
|
868
|
|
|
|
|
869
|
|
|
} |