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_CALLBACK, |
116
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_RANGE', |
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_FORCE_ARRAY |
143
|
|
|
), |
144
|
|
|
'isicV4' => array( |
145
|
|
|
'filter' => FILTER_VALIDATE_REGEXP, |
146
|
|
|
'options' => array('regexp'=>'/^[0-9]{4}$/'), |
147
|
|
|
'flags' => FILTER_FORCE_ARRAY |
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_FORCE_ARRAY, |
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_FORCE_ARRAY |
342
|
|
|
), |
343
|
|
|
'hasServerVirtualizationManufacturer' => array( |
344
|
|
|
'filter' => FILTER_DEFAULT, |
345
|
|
|
'flags' => FILTER_FORCE_ARRAY |
346
|
|
|
), |
347
|
|
|
'hasDASManufacturer' => array( |
348
|
|
|
'filter' => FILTER_DEFAULT, |
349
|
|
|
'flags' => FILTER_FORCE_ARRAY |
350
|
|
|
), |
351
|
|
|
'hasNASManufacturer' => array( |
352
|
|
|
'filter' => FILTER_DEFAULT, |
353
|
|
|
'flags' => FILTER_FORCE_ARRAY |
354
|
|
|
), |
355
|
|
|
'hasSANManufacturer' => array( |
356
|
|
|
'filter' => FILTER_DEFAULT, |
357
|
|
|
'flags' => FILTER_FORCE_ARRAY |
358
|
|
|
), |
359
|
|
|
'hasTapeLibraryManufacturer' => array( |
360
|
|
|
'filter' => FILTER_DEFAULT, |
361
|
|
|
'flags' => FILTER_FORCE_ARRAY |
362
|
|
|
), |
363
|
|
|
'hasStorageVirtualizationManufacturer' => array( |
364
|
|
|
'filter' => FILTER_DEFAULT, |
365
|
|
|
'flags' => FILTER_FORCE_ARRAY |
366
|
|
|
), |
367
|
|
|
'naics' => array( |
368
|
|
|
'filter' => FILTER_DEFAULT, |
369
|
|
|
'flags' => FILTER_FORCE_ARRAY |
370
|
|
|
), |
371
|
|
|
'hasNAFCode' => array( |
372
|
|
|
'filter' => FILTER_DEFAULT, |
373
|
|
|
'flags' => FILTER_FORCE_ARRAY |
374
|
|
|
), |
375
|
|
|
'hasServerSeries' => array( |
376
|
|
|
'filter' => FILTER_DEFAULT, |
377
|
|
|
'flags' => FILTER_FORCE_ARRAY |
378
|
|
|
), |
379
|
|
|
'hasDesktopManufacturer' => array( |
380
|
|
|
'filter' => FILTER_DEFAULT, |
381
|
|
|
'flags' => FILTER_FORCE_ARRAY |
382
|
|
|
), |
383
|
|
|
'hasLaptopManufacturer' => array( |
384
|
|
|
'filter' => FILTER_DEFAULT, |
385
|
|
|
'flags' => FILTER_FORCE_ARRAY |
386
|
|
|
), |
387
|
|
|
'hasDesktopVirtualizationManufacturer' => array( |
388
|
|
|
'filter' => FILTER_DEFAULT, |
389
|
|
|
'flags' => FILTER_FORCE_ARRAY |
390
|
|
|
), |
391
|
|
|
'hasWorkstationManufacturer' => array( |
392
|
|
|
'filter' => FILTER_DEFAULT, |
393
|
|
|
'flags' => FILTER_FORCE_ARRAY |
394
|
|
|
), |
395
|
|
|
'hasNetworkPrinterManufacturer' => array( |
396
|
|
|
'filter' => FILTER_DEFAULT, |
397
|
|
|
'flags' => FILTER_FORCE_ARRAY |
398
|
|
|
), |
399
|
|
|
'hasHighVolumePrinterManufacturer' => array( |
400
|
|
|
'filter' => FILTER_DEFAULT, |
401
|
|
|
'flags' => FILTER_FORCE_ARRAY |
402
|
|
|
), |
403
|
|
|
'hasCopierManufacturer' => array( |
404
|
|
|
'filter' => FILTER_DEFAULT, |
405
|
|
|
'flags' => FILTER_FORCE_ARRAY |
406
|
|
|
), |
407
|
|
|
'hasUPSManufacturer' => array( |
408
|
|
|
'filter' => FILTER_DEFAULT, |
409
|
|
|
'flags' => FILTER_FORCE_ARRAY |
410
|
|
|
), |
411
|
|
|
'hasERPSuiteVendor' => array( |
412
|
|
|
'filter' => FILTER_DEFAULT, |
413
|
|
|
'flags' => FILTER_FORCE_ARRAY |
414
|
|
|
), |
415
|
|
|
'hasERPSoftwareasaServiceManufacturer' => array( |
416
|
|
|
'filter' => FILTER_DEFAULT, |
417
|
|
|
'flags' => FILTER_FORCE_ARRAY |
418
|
|
|
), |
419
|
|
|
'hasAppServerSoftwareVendor' => array( |
420
|
|
|
'filter' => FILTER_DEFAULT, |
421
|
|
|
'flags' => FILTER_FORCE_ARRAY |
422
|
|
|
), |
423
|
|
|
'hasBusIntellSoftwareVendor' => array( |
424
|
|
|
'filter' => FILTER_DEFAULT, |
425
|
|
|
'flags' => FILTER_FORCE_ARRAY |
426
|
|
|
), |
427
|
|
|
'hasCollaborativeSoftwareVendor' => array( |
428
|
|
|
'filter' => FILTER_DEFAULT, |
429
|
|
|
'flags' => FILTER_FORCE_ARRAY |
430
|
|
|
), |
431
|
|
|
'hasCRMSoftwareVendor' => array( |
432
|
|
|
'filter' => FILTER_DEFAULT, |
433
|
|
|
'flags' => FILTER_FORCE_ARRAY |
434
|
|
|
), |
435
|
|
|
'hasCRMSoftwareasaServiceManufacturer' => array( |
436
|
|
|
'filter' => FILTER_DEFAULT, |
437
|
|
|
'flags' => FILTER_FORCE_ARRAY |
438
|
|
|
), |
439
|
|
|
'hasDocumentMgmtSoftwareVendor' => array( |
440
|
|
|
'filter' => FILTER_DEFAULT, |
441
|
|
|
'flags' => FILTER_FORCE_ARRAY |
442
|
|
|
), |
443
|
|
|
'hasAppConsolidationSoftwareVendor' => array( |
444
|
|
|
'filter' => FILTER_DEFAULT, |
445
|
|
|
'flags' => FILTER_FORCE_ARRAY |
446
|
|
|
), |
447
|
|
|
'hasHumanResourceSoftwareVendor' => array( |
448
|
|
|
'filter' => FILTER_DEFAULT, |
449
|
|
|
'flags' => FILTER_FORCE_ARRAY |
450
|
|
|
), |
451
|
|
|
'hasSupplyChainSoftwareVendor' => array( |
452
|
|
|
'filter' => FILTER_DEFAULT, |
453
|
|
|
'flags' => FILTER_FORCE_ARRAY |
454
|
|
|
), |
455
|
|
|
'hasWebServiceSoftwareVendor' => array( |
456
|
|
|
'filter' => FILTER_DEFAULT, |
457
|
|
|
'flags' => FILTER_FORCE_ARRAY |
458
|
|
|
), |
459
|
|
|
'hasDatawarehouseSoftwareVendor' => array( |
460
|
|
|
'filter' => FILTER_DEFAULT, |
461
|
|
|
'flags' => FILTER_FORCE_ARRAY |
462
|
|
|
), |
463
|
|
|
'hasSaaSVendor' => array( |
464
|
|
|
'filter' => FILTER_DEFAULT, |
465
|
|
|
'flags' => FILTER_FORCE_ARRAY |
466
|
|
|
), |
467
|
|
|
'hasEmailMessagingVendor' => array( |
468
|
|
|
'filter' => FILTER_DEFAULT, |
469
|
|
|
'flags' => FILTER_FORCE_ARRAY |
470
|
|
|
), |
471
|
|
|
'hasEmailSaaSManufacturer' => array( |
472
|
|
|
'filter' => FILTER_DEFAULT, |
473
|
|
|
'flags' => FILTER_FORCE_ARRAY |
474
|
|
|
), |
475
|
|
|
'hasOSVendor' => array( |
476
|
|
|
'filter' => FILTER_DEFAULT, |
477
|
|
|
'flags' => FILTER_FORCE_ARRAY |
478
|
|
|
), |
479
|
|
|
'hasOSModel' => array( |
480
|
|
|
'filter' => FILTER_DEFAULT, |
481
|
|
|
'flags' => FILTER_FORCE_ARRAY |
482
|
|
|
), |
483
|
|
|
'hasDBMSVendor' => array( |
484
|
|
|
'filter' => FILTER_DEFAULT, |
485
|
|
|
'flags' => FILTER_FORCE_ARRAY |
486
|
|
|
), |
487
|
|
|
'hasAcctingVendor' => array( |
488
|
|
|
'filter' => FILTER_DEFAULT, |
489
|
|
|
'flags' => FILTER_FORCE_ARRAY |
490
|
|
|
), |
491
|
|
|
'hasAntiVirusVendor' => array( |
492
|
|
|
'filter' => FILTER_DEFAULT, |
493
|
|
|
'flags' => FILTER_FORCE_ARRAY |
494
|
|
|
), |
495
|
|
|
'hasAssetManagementSoftwareVendor' => array( |
496
|
|
|
'filter' => FILTER_DEFAULT, |
497
|
|
|
'flags' => FILTER_FORCE_ARRAY |
498
|
|
|
), |
499
|
|
|
'hasEnterpriseManagementSoftwareVendor' => array( |
500
|
|
|
'filter' => FILTER_DEFAULT, |
501
|
|
|
'flags' => FILTER_FORCE_ARRAY |
502
|
|
|
), |
503
|
|
|
'hasIDAccessSoftwareVendor' => array( |
504
|
|
|
'filter' => FILTER_DEFAULT, |
505
|
|
|
'flags' => FILTER_FORCE_ARRAY |
506
|
|
|
), |
507
|
|
|
'hasStorageManagementSoftwareVendor' => array( |
508
|
|
|
'filter' => FILTER_DEFAULT, |
509
|
|
|
'flags' => FILTER_FORCE_ARRAY |
510
|
|
|
), |
511
|
|
|
'hasStorageSaaSManufacturer' => array( |
512
|
|
|
'filter' => FILTER_DEFAULT, |
513
|
|
|
'flags' => FILTER_FORCE_ARRAY |
514
|
|
|
), |
515
|
|
|
'hasEthernetTechnology' => array( |
516
|
|
|
'filter' => FILTER_DEFAULT, |
517
|
|
|
'flags' => FILTER_FORCE_ARRAY |
518
|
|
|
), |
519
|
|
|
'haseCommerceType' => array( |
520
|
|
|
'filter' => FILTER_DEFAULT, |
521
|
|
|
'flags' => FILTER_FORCE_ARRAY |
522
|
|
|
), |
523
|
|
|
'hasHostorRemoteStatus' => array( |
524
|
|
|
'filter' => FILTER_DEFAULT, |
525
|
|
|
'flags' => FILTER_FORCE_ARRAY |
526
|
|
|
), |
527
|
|
|
'hasNetworkLineCarrier' => array( |
528
|
|
|
'filter' => FILTER_DEFAULT, |
529
|
|
|
'flags' => FILTER_FORCE_ARRAY |
530
|
|
|
), |
531
|
|
|
'hasVideoConfServicesProvider' => array( |
532
|
|
|
'filter' => FILTER_DEFAULT, |
533
|
|
|
'flags' => FILTER_FORCE_ARRAY |
534
|
|
|
), |
535
|
|
|
'hasUnifiedCommSvcProvider' => array( |
536
|
|
|
'filter' => FILTER_DEFAULT, |
537
|
|
|
'flags' => FILTER_FORCE_ARRAY |
538
|
|
|
), |
539
|
|
|
'hasRouterManufacturer' => array( |
540
|
|
|
'filter' => FILTER_DEFAULT, |
541
|
|
|
'flags' => FILTER_FORCE_ARRAY |
542
|
|
|
), |
543
|
|
|
'hasSwitchManufacturer' => array( |
544
|
|
|
'filter' => FILTER_DEFAULT, |
545
|
|
|
'flags' => FILTER_FORCE_ARRAY |
546
|
|
|
), |
547
|
|
|
'hasVPNManufacturer' => array( |
548
|
|
|
'filter' => FILTER_DEFAULT, |
549
|
|
|
'flags' => FILTER_FORCE_ARRAY |
550
|
|
|
), |
551
|
|
|
'hasISP' => array( |
552
|
|
|
'filter' => FILTER_DEFAULT, |
553
|
|
|
'flags' => FILTER_FORCE_ARRAY |
554
|
|
|
), |
555
|
|
|
'hasNetworkServiceProvider' => array( |
556
|
|
|
'filter' => FILTER_DEFAULT, |
557
|
|
|
'flags' => FILTER_FORCE_ARRAY |
558
|
|
|
), |
559
|
|
|
'hasPhoneSystemManufacturer' => array( |
560
|
|
|
'filter' => FILTER_DEFAULT, |
561
|
|
|
'flags' => FILTER_FORCE_ARRAY |
562
|
|
|
), |
563
|
|
|
'hasVoIPManufacturer' => array( |
564
|
|
|
'filter' => FILTER_DEFAULT, |
565
|
|
|
'flags' => FILTER_FORCE_ARRAY |
566
|
|
|
), |
567
|
|
|
'hasVoIPHosting' => array( |
568
|
|
|
'filter' => FILTER_DEFAULT, |
569
|
|
|
'flags' => FILTER_FORCE_ARRAY |
570
|
|
|
), |
571
|
|
|
'hasLongDistanceCarrier' => array( |
572
|
|
|
'filter' => FILTER_DEFAULT, |
573
|
|
|
'flags' => FILTER_FORCE_ARRAY |
574
|
|
|
), |
575
|
|
|
'hasWirelessProvider' => array( |
576
|
|
|
'filter' => FILTER_DEFAULT, |
577
|
|
|
'flags' => FILTER_FORCE_ARRAY |
578
|
|
|
), |
579
|
|
|
'hasPhoneSystemMaintenanceProvider' => array( |
580
|
|
|
'filter' => FILTER_DEFAULT, |
581
|
|
|
'flags' => FILTER_FORCE_ARRAY |
582
|
|
|
), |
583
|
|
|
'hasSmartphoneManufacturer' => array( |
584
|
|
|
'filter' => FILTER_DEFAULT, |
585
|
|
|
'flags' => FILTER_FORCE_ARRAY |
586
|
|
|
), |
587
|
|
|
'hasSmartphoneOS' => array( |
588
|
|
|
'filter' => FILTER_DEFAULT, |
589
|
|
|
'flags' => FILTER_FORCE_ARRAY |
590
|
|
|
), |
591
|
|
|
'hasFYE' => array( |
592
|
|
|
'filter' => FILTER_VALIDATE_REGEXP, |
593
|
|
|
'options' => array('regexp'=>'/^[A-Z]{3}$/'), |
594
|
|
|
'flags' => FILTER_REQUIRE_SCALAR |
595
|
|
|
), |
596
|
|
|
'foundingDate' => array( |
597
|
|
|
'filter' => FILTER_CALLBACK, |
598
|
|
|
'options' => '\BOTK\Filters::FILTER_SANITIZE_DATETIME', |
599
|
|
|
'flags' => FILTER_REQUIRE_SCALAR, |
600
|
|
|
), |
601
|
|
|
); |
602
|
|
|
|
603
|
|
|
/** |
604
|
|
|
* Redefine protected constructor to add address description as dynamic property |
605
|
|
|
*/ |
606
|
13 |
|
protected function __construct(array $data = array(), array $customOptions = array()) |
607
|
|
|
{ |
608
|
13 |
|
parent::__construct($data, $customOptions); |
609
|
13 |
|
$this->addAddressDescription(); |
610
|
13 |
|
} |
611
|
|
|
|
612
|
|
|
|
613
|
|
|
/** |
614
|
|
|
* If not existing, create an address description as a normalized address from following data properties: |
615
|
|
|
* 'addressLocality', |
616
|
|
|
* 'addressRegion', |
617
|
|
|
* 'streetAddress', |
618
|
|
|
* 'postalCode', |
619
|
|
|
*/ |
620
|
13 |
|
private function addAddressDescription() |
621
|
|
|
{ |
622
|
13 |
|
if(empty($this->data['addressDescription'])){ |
623
|
10 |
|
if( !empty($this->data['streetAddress']) && ( !empty($this->data['addressLocality']) || !empty($this->data['postalCode']))){ |
624
|
4 |
|
$this->data['addressDescription'] = "{$this->data['streetAddress']} ,"; |
625
|
4 |
|
if(!empty($this->data['postalCode'])) { $this->data['addressDescription'].= " {$this->data['postalCode']}";} |
626
|
4 |
|
if(!empty($this->data['addressLocality'])) { $this->data['addressDescription'].= " {$this->data['addressLocality']}"; } |
627
|
4 |
|
if(!empty($this->data['addressRegion'])) { $this->data['addressDescription'].= " ({$this->data['addressRegion']})"; } |
628
|
|
|
} |
629
|
|
|
} |
630
|
13 |
|
if(!empty($this->data['addressDescription'])){ |
631
|
7 |
|
$this->data['addressDescription'] = \BOTK\Filters::FILTER_SANITIZE_ADDRESS($this->data['addressDescription']); |
632
|
|
|
} |
633
|
13 |
|
} |
634
|
|
|
|
635
|
|
|
|
636
|
|
|
/** |
637
|
|
|
* return a structured info to generate rdf code for quantitative values |
638
|
|
|
*/ |
639
|
4 |
|
private function getParsedQuantitativeVars() |
640
|
|
|
{ |
641
|
4 |
|
static $quantitativeValuesVar = array( |
642
|
|
|
'numberOfEmployees' => 'schema:numberOfEmployees', |
643
|
|
|
'annualTurnover' => 'botk:annualTurnover', |
644
|
|
|
'ebitda' => 'botk:ebitda' , |
645
|
|
|
'netProfit' => 'botk:netProfit', |
646
|
|
|
'hasTotDevelopers' => 'botk:hasTotDevelopers', |
647
|
|
|
'itBudget' => 'botk:itBudget', |
648
|
|
|
'itStorageBudget' => 'botk:itStorageBudget', |
649
|
|
|
'itHardwareBudget' => 'botk:itHardwareBudget', |
650
|
|
|
'itServerBudget' => 'botk:itServerBudget', |
651
|
|
|
'softwareBudget' => 'botk:softwareBudget', |
652
|
|
|
'hasITEmployees' => 'botk:hasITEmployees', |
653
|
|
|
'hasNumberOfPCs' => 'botk:hasNumberOfPCs', |
654
|
|
|
'hasITBudget' => 'botk:hasITBudget', |
655
|
|
|
'hasTablets' => 'botk:hasTablets', |
656
|
|
|
'hasWorkstations' => 'botk:hasWorkstations', |
657
|
|
|
'hasStorageBudget' => 'botk:hasStorageBudget', |
658
|
|
|
'hasServerBudget' => 'botk:hasServerBudget', |
659
|
|
|
'hasServers' => 'botk:hasServers', |
660
|
|
|
'hasDesktop' => 'botk:hasDesktop', |
661
|
|
|
'hasLaptops' => 'botk:hasLaptops', |
662
|
|
|
'hasPrinters' => 'botk:hasPrinters', |
663
|
|
|
'hasMultifunctionPrinters' => 'botk:hasMultifunctionPrinters', |
664
|
|
|
'hasColorPrinter' => 'botk:hasColorPrinter', |
665
|
|
|
'hasInternetUsers' => 'botk:hasInternetUsers', |
666
|
|
|
'hasWirelessUsers' => 'botk:hasWirelessUsers', |
667
|
|
|
'hasNetworkLines' => 'botk:hasNetworkLines', |
668
|
|
|
'hasRouters' => 'botk:hasRouters', |
669
|
|
|
'hasStorageCapacity' => 'botk:hasStorageCapacity', |
670
|
|
|
'hasExtensions' => 'botk:hasExtensions', |
671
|
|
|
'hasTotCallCenterCallers' => 'botk:hasTotCallCenterCallers', |
672
|
|
|
'hasThinPC' => 'botk:hasThinPC', |
673
|
|
|
'hasSalesforce' => 'botk:hasSalesforce', |
674
|
|
|
'hasRevenue' => 'botk:hasRevenue', |
675
|
|
|
'hasCommercialBudget' => 'botk:hasCommercialBudget', |
676
|
|
|
'hasHardwareBudget' => 'botk:hasHardwareBudget', |
677
|
|
|
'hasSoftwareBudget' => 'botk:hasSoftwareBudget', |
678
|
|
|
'hasOutsrcingBudget' => 'botk:hasOutsrcingBudget', |
679
|
|
|
'hasOtherHardwareBudget' => 'botk:hasOtherHardwareBudget', |
680
|
|
|
'hasPCBudget' => 'botk:hasPCBudget', |
681
|
|
|
'hasPrinterBudget' => 'botk:hasPrinterBudget', |
682
|
|
|
'hasTerminalBudget' => 'botk:hasTerminalBudget', |
683
|
|
|
'hasPeripheralBudget' => 'botk:hasPeripheralBudget', |
684
|
|
|
'hasDesktopPrinters' => 'botk:hasDesktopPrinters', |
685
|
|
|
'hasNetworkPrinters' => 'botk:hasNetworkPrinters', |
686
|
|
|
'hasSmartphoneUsers' => 'botk:hasSmartphoneUsers', |
687
|
|
|
'hasEnterpriseSmartphoneUsers' => 'botk:hasSmartphoneUsers', |
688
|
|
|
); |
689
|
|
|
|
690
|
4 |
|
$parsedVars=array(); |
691
|
4 |
|
foreach ($quantitativeValuesVar as $statVar => $property){ |
692
|
4 |
|
if(!empty($this->data[$statVar])&& ($range=\BOTK\Filters::PARSE_QUANTITATIVE_VALUE($this->data[$statVar])) ){ |
693
|
1 |
|
list($min,$max)=$range; |
694
|
1 |
|
if( $min===$max){ |
695
|
1 |
|
$statUri = "{$this->data['base']}{$min}"; |
696
|
1 |
|
$turtleString = "<$statUri> schema:value $min ."; |
697
|
1 |
|
$tripleCounter = 1; |
698
|
|
|
} else { |
699
|
|
|
$statUri = "{$this->data['base']}{$min}to{$max}"; |
700
|
|
|
$turtleString = "<$statUri> schema:minValue $min ;schema:maxValue $max ."; |
701
|
|
|
$tripleCounter = 2; |
702
|
|
|
} |
703
|
4 |
|
$parsedVars[$statVar] = array($property,$statUri,$turtleString,$tripleCounter); |
704
|
|
|
} |
705
|
|
|
} |
706
|
4 |
|
return $parsedVars; |
707
|
|
|
} |
708
|
|
|
|
709
|
|
|
|
710
|
4 |
|
public function asTurtleFragment() |
711
|
|
|
{ |
712
|
4 |
|
static $uriVars = array( |
713
|
|
|
'parentOrganization' => 'schema:parentOrganization', |
714
|
|
|
'email' => 'schema:email', |
715
|
|
|
'geoUri' => 'schema:geo', |
716
|
|
|
'$hasMap' => 'schema:hasMap', |
717
|
|
|
); |
718
|
4 |
|
static $stringVars = array( |
719
|
|
|
'businessType' => 'a', |
720
|
|
|
'vatID' => 'schema:vatID', |
721
|
|
|
'taxtID' => 'schema:taxtID', |
722
|
|
|
'legalName' => 'schema:legalName', |
723
|
|
|
'businessName' => 'schema:alternateName', |
724
|
|
|
'telephone' => 'schema:telephone', |
725
|
|
|
'faxNumber' => 'schema:faxNumber', |
726
|
|
|
'openingHours' => 'schema:openingHours ', |
727
|
|
|
'disambiguatingDescription' => 'schema:disambiguatingDescription', |
728
|
|
|
'ateco2007' => 'botk:ateco2007', |
729
|
|
|
'naceV2' => 'botk:naceV2', |
730
|
|
|
'isicV4' => 'schema:isicV4', |
731
|
|
|
'hasServerManufacturer' => 'botk:hasServerManufacturer', |
732
|
|
|
'hasServerVirtualizationManufacturer' => 'botk:hasServerVirtualizationManufacturer', |
733
|
|
|
'hasDASManufacturer' => 'botk:hasDASManufacturer', |
734
|
|
|
'hasNASManufacturer' => 'botk:hasNASManufacturer', |
735
|
|
|
'hasSANManufacturer' => 'botk:hasSANManufacturer', |
736
|
|
|
'hasTapeLibraryManufacturer' => 'botk:hasTapeLibraryManufacturer', |
737
|
|
|
'hasStorageVirtualizationManufacturer' => 'botk:hasStorageVirtualizationManufacturer', |
738
|
|
|
'naics' => 'botk:naics', |
739
|
|
|
'hasNAFCode' => 'botk:hasNAFCode', |
740
|
|
|
'hasServerSeries' => 'botk:hasServerSeries', |
741
|
|
|
'hasDesktopManufacturer' => 'botk:hasDesktopManufacturer', |
742
|
|
|
'hasLaptopManufacturer' => 'botk:hasLaptopManufacturer', |
743
|
|
|
'hasDesktopVirtualizationManufacturer' => 'botk:hasDesktopVirtualizationManufacturer', |
744
|
|
|
'hasWorkstationManufacturer' => 'botk:hasWorkstationManufacturer', |
745
|
|
|
'hasNetworkPrinterManufacturer' => 'botk:hasNetworkPrinterManufacturer', |
746
|
|
|
'hasHighVolumePrinterManufacturer' => 'botk:hasHighVolumePrinterManufacturer', |
747
|
|
|
'hasCopierManufacturer' => 'botk:hasCopierManufacturer', |
748
|
|
|
'hasUPSManufacturer' => 'botk:hasUPSManufacturer', |
749
|
|
|
'hasERPSuiteVendor' => 'botk:hasERPSuiteVendor', |
750
|
|
|
'hasERPSoftwareasaServiceManufacturer' => 'botk:hasERPSoftwareasaServiceManufacturer', |
751
|
|
|
'hasAppServerSoftwareVendor' => 'botk:hasAppServerSoftwareVendor', |
752
|
|
|
'hasBusIntellSoftwareVendor' => 'botk:hasBusIntellSoftwareVendor', |
753
|
|
|
'hasCollaborativeSoftwareVendor' => 'botk:hasCollaborativeSoftwareVendor', |
754
|
|
|
'hasCRMSoftwareVendor' => 'botk:hasCRMSoftwareVendor', |
755
|
|
|
'hasCRMSoftwareasaServiceManufacturer' => 'botk:hasCRMSoftwareasaServiceManufacturer', |
756
|
|
|
'hasDocumentMgmtSoftwareVendor' => 'botk:hasDocumentMgmtSoftwareVendor', |
757
|
|
|
'hasAppConsolidationSoftwareVendor' => 'botk:hasAppConsolidationSoftwareVendor', |
758
|
|
|
'hasHumanResourceSoftwareVendor' => 'botk:hasHumanResourceSoftwareVendor', |
759
|
|
|
'hasSupplyChainSoftwareVendor' => 'botk:hasSupplyChainSoftwareVendor', |
760
|
|
|
'hasWebServiceSoftwareVendor' => 'botk:hasWebServiceSoftwareVendor', |
761
|
|
|
'hasDatawarehouseSoftwareVendor' => 'botk:hasDatawarehouseSoftwareVendor', |
762
|
|
|
'hasSaaSVendor' => 'botk:hasSaaSVendor', |
763
|
|
|
'hasEmailMessagingVendor' => 'botk:hasEmailMessagingVendor', |
764
|
|
|
'hasEmailSaaSManufacturer' => 'botk:hasEmailSaaSManufacturer', |
765
|
|
|
'hasOSVendor' => 'botk:hasOSVendor', |
766
|
|
|
'hasOSModel' => 'botk:hasOSModel', |
767
|
|
|
'hasDBMSVendor' => 'botk:hasDBMSVendor', |
768
|
|
|
'hasAcctingVendor' => 'botk:hasAcctingVendor', |
769
|
|
|
'hasAntiVirusVendor' => 'botk:hasAntiVirusVendor', |
770
|
|
|
'hasAssetManagementSoftwareVendor' => 'botk:hasAssetManagementSoftwareVendor', |
771
|
|
|
'hasEnterpriseManagementSoftwareVendor' => 'botk:hasEnterpriseManagementSoftwareVendor', |
772
|
|
|
'hasIDAccessSoftwareVendor' => 'botk:hasIDAccessSoftwareVendor', |
773
|
|
|
'hasStorageManagementSoftwareVendor' => 'botk:hasStorageManagementSoftwareVendor', |
774
|
|
|
'hasStorageSaaSManufacturer' => 'botk:hasStorageSaaSManufacturer', |
775
|
|
|
'hasEthernetTechnology' => 'botk:hasEthernetTechnology', |
776
|
|
|
'haseCommerceType' => 'botk:haseCommerceType', |
777
|
|
|
'hasHostorRemoteStatus' => 'botk:hasHostorRemoteStatus', |
778
|
|
|
'hasNetworkLineCarrier' => 'botk:hasNetworkLineCarrier', |
779
|
|
|
'hasVideoConfServicesProvider' => 'botk:hasVideoConfServicesProvider', |
780
|
|
|
'hasUnifiedCommSvcProvider' => 'botk:hasUnifiedCommSvcProvider', |
781
|
|
|
'hasRouterManufacturer' => 'botk:hasRouterManufacturer', |
782
|
|
|
'hasSwitchManufacturer' => 'botk:hasSwitchManufacturer', |
783
|
|
|
'hasVPNManufacturer' => 'botk:hasVPNManufacturer', |
784
|
|
|
'hasISP' => 'botk:hasISP', |
785
|
|
|
'hasNetworkServiceProvider' => 'botk:hasNetworkServiceProvider', |
786
|
|
|
'hasPhoneSystemManufacturer' => 'botk:hasPhoneSystemManufacturer', |
787
|
|
|
'hasVoIPManufacturer' => 'botk:hasVoIPManufacturer', |
788
|
|
|
'hasVoIPHosting' => 'botk:hasVoIPHosting', |
789
|
|
|
'hasLongDistanceCarrier' => 'botk:hasLongDistanceCarrier', |
790
|
|
|
'hasWirelessProvider' => 'botk:hasWirelessProvider', |
791
|
|
|
'hasPhoneSystemMaintenanceProvider' => 'botk:hasPhoneSystemMaintenanceProvider', |
792
|
|
|
'hasSmartphoneManufacturer' => 'botk:hasSmartphoneManufacturer', |
793
|
|
|
'hasSmartphoneOS' => 'botk:hasSmartphoneOS', |
794
|
|
|
'hasFYE'=> 'botk:hasFYE', |
795
|
|
|
); |
796
|
4 |
|
static $addressVars= array( |
797
|
|
|
'addressDescription' => 'schema:description', |
798
|
|
|
'streetAddress' => 'schema:streetAddress', |
799
|
|
|
'postalCode' => 'schema:postalCode', |
800
|
|
|
'addressLocality' => 'schema:addressLocality', |
801
|
|
|
'addressRegion' => 'schema:addressRegion', |
802
|
|
|
'addressCountry' => 'schema:addressCountry', |
803
|
|
|
); |
804
|
4 |
|
static $dateTimeVars= array( |
805
|
|
|
'foundingDate' => 'schema:foundingDate', |
806
|
|
|
); |
807
|
|
|
|
808
|
|
|
|
809
|
4 |
|
if(is_null($this->rdf)) { |
810
|
|
|
|
811
|
4 |
|
$this->rdf=parent::asTurtleFragment(); |
812
|
|
|
|
813
|
|
|
// create uris |
814
|
4 |
|
$organizationUri = $this->getUri(); |
815
|
4 |
|
$addressUri = $organizationUri.'_address'; |
816
|
4 |
|
$geoUri = ( !empty( $this->data['lat']) && !empty( $this->data['long']) )?"geo:{$this->data['lat']},{$this->data['long']}":null; |
817
|
|
|
|
818
|
|
|
|
819
|
4 |
|
$parsedQuantitativeVars=$this->getParsedQuantitativeVars(); |
820
|
|
|
|
821
|
|
|
// serializes LocalBusiness properties |
822
|
4 |
|
$this->addFragment('<%s> a schema:LocalBusiness;', $organizationUri); |
823
|
4 |
|
foreach ( $uriVars as $uriVar => $property) { |
824
|
4 |
|
if(!empty($this->data[$uriVar])){ |
825
|
4 |
|
$this->addFragment("$property <%s>;", $this->data[$uriVar],false); |
826
|
|
|
} |
827
|
|
|
} |
828
|
4 |
|
foreach ( $parsedQuantitativeVars as $quantitativeVar => $parsedVal) { |
829
|
1 |
|
list($property,$statUri,,)=$parsedVal; |
830
|
1 |
|
$this->addFragment("$property <%s>;", $statUri,false); |
831
|
|
|
} |
832
|
4 |
|
foreach ($stringVars as $stringVar => $property) { |
833
|
4 |
|
if(!empty($this->data[$stringVar])){ |
834
|
4 |
|
$this->addFragment("$property \"%s\";", $this->data[$stringVar]); |
835
|
|
|
} |
836
|
|
|
} |
837
|
4 |
|
foreach ($dateTimeVars as $dateVar => $property) { |
838
|
4 |
|
if(!empty($this->data[$dateVar])){ |
839
|
4 |
|
$this->addFragment("$property \"%s\"^^xsd:dateTime;", $this->data[$dateVar]); |
840
|
|
|
} |
841
|
|
|
} |
842
|
4 |
|
$this->addFragment('schema:address <%s>. ', $addressUri); |
843
|
|
|
|
844
|
|
|
// serializes postal address properies |
845
|
4 |
|
$this->rdf .= "<$addressUri> "; |
846
|
4 |
|
foreach( $addressVars as $stringVar=>$property) { |
847
|
4 |
|
if(!empty($this->data[$stringVar])){ |
848
|
4 |
|
$this->addFragment("$property \"%s\";", $this->data[$stringVar]); |
849
|
|
|
} |
850
|
|
|
} |
851
|
4 |
|
$this->rdf .= " a schema:PostalAddress."; |
852
|
4 |
|
$this->tripleCount++; |
853
|
|
|
|
854
|
|
|
// serializes quantitative values |
855
|
4 |
|
foreach ( $parsedQuantitativeVars as $quantitativeVar => $parsedVal){ |
856
|
1 |
|
list(,,$ttl,$tc)=$parsedVal; |
857
|
1 |
|
$this->rdf.=$ttl; |
858
|
1 |
|
$this->tripleCount +=$tc; |
859
|
|
|
}; |
860
|
|
|
|
861
|
|
|
// serializes schema:GeoCoordinates |
862
|
4 |
|
if( !empty($geoUri)){ |
863
|
2 |
|
$this->rdf.="<$geoUri> schema:latitude \"{$this->data['lat']}\"^^xsd:float;schema:longitude \"{$this->data['long']}\"^^xsd:float."; |
864
|
2 |
|
$this->tripleCount +=2; |
865
|
|
|
} |
866
|
|
|
|
867
|
|
|
} |
868
|
|
|
|
869
|
4 |
|
return $this->rdf; |
870
|
|
|
} |
871
|
|
|
|
872
|
|
|
} |