forked from smart-data-models/data-models
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon-schema.json
682 lines (682 loc) · 24.9 KB
/
common-schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
{
"$schema": "http://json-schema.org/schema#",
"$id": "https://smart-data-models.github.io/data-models/common-schema.json",
"title": "Common definitions for Harmonized Data Models",
"definitions": {
"EntityIdentifierType": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 256,
"pattern": "^[\\w\\-\\.\\{\\}\\$\\+\\*\\[\\]`|~^@!,:\\\\]+$",
"description": "Property. Identifier format of any NGSI entity"
},
{
"type": "string",
"format": "uri",
"description": "Property. Identifier format of any NGSI entity"
}
],
"description": "Property. Unique identifier of the entity"
},
"email": {
"type": "string",
"format": "idn-email",
"description": "Property. Email address of owner."
},
"userAlias": {
"type": "string",
"description": "Property. An anonymous alias of a user."
},
"tag": {
"type": "string",
"description": "Property. Model:'https://schema.org/Text'. An optional text string used to qualify an item"
},
"timeInstant": {
"type": "string",
"format": "date-time",
"description": "Property. Model:'https://schema.org/Datetime'. Timestamp of the payload . There can be production environments where the attribute type is equal to the `ISO8601` string. If so, it must be considered as a synonym of `DateTime`. This attribute is kept for backwards compatibility with old FIWARE reference implementations."
},
"dateObserved": {
"type": "string",
"format": "date-time",
"description": "Property. Date of the observed entity defined by the user."
},
"dateYearLess": {
"type": "string",
"pattern": "^--((0[13578]|1[02])-31|(0[1,3-9]|1[0-2])-30|(0\\d|1[0-2])-([0-2]\\d))$"
},
"GSMA-Commons": {
"type": "object",
"properties": {
"id": {
"$ref": "#/definitions/EntityIdentifierType"
},
"dateCreated": {
"type": "string",
"format": "date-time",
"description": "Property. Entity creation timestamp. This will usually be allocated by the storage platform."
},
"dateModified": {
"type": "string",
"format": "date-time",
"description": "Property. Timestamp of the last modification of the entity. This will usually be allocated by the storage platform."
},
"source": {
"type": "string",
"description": "Property. A sequence of characters giving the original source of the entity data as a URL. Recommended to be the fully qualified domain name of the source provider, or the URL to the source object."
},
"name": {
"type": "string",
"description": "Property. The name of this item."
},
"alternateName": {
"type": "string",
"description": "Property. An alternative name for this item"
},
"description": {
"type": "string",
"description": "Property. A description of this item"
},
"dataProvider": {
"type": "string",
"description": "Property. A sequence of characters identifying the provider of the harmonised data entity."
},
"owner": {
"type": "array",
"description": "Property. A List containing a JSON encoded sequence of characters referencing the unique Ids of the owner(s)",
"items": {
"$ref": "https://smart-data-models.github.io/data-models/common-schema.json#/definitions/EntityIdentifierType"
}
},
"seeAlso": {
"oneOf": [
{
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"format": "uri"
}
},
{
"type": "string",
"format": "uri"
}
],
"description": "Property. list of uri pointing to additional resources about the item"
}
}
},
"Location-Commons": {
"type": "object",
"properties": {
"location": {
"oneOf": [
{
"title": "GeoJSON Point",
"type": "object",
"required": [
"type",
"coordinates"
],
"description": "Geoproperty. Geojson reference to the item. Point",
"properties": {
"type": {
"type": "string",
"enum": [
"Point"
]
},
"coordinates": {
"type": "array",
"minItems": 2,
"items": {
"type": "number"
}
},
"bbox": {
"type": "array",
"minItems": 4,
"items": {
"type": "number"
}
}
}
},
{
"title": "GeoJSON LineString",
"type": "object",
"required": [
"type",
"coordinates"
],
"description": "Geoproperty. Geojson reference to the item. LineString",
"properties": {
"type": {
"type": "string",
"enum": [
"LineString"
]
},
"coordinates": {
"type": "array",
"minItems": 2,
"items": {
"type": "array",
"minItems": 2,
"items": {
"type": "number"
}
}
},
"bbox": {
"type": "array",
"minItems": 4,
"items": {
"type": "number"
}
}
}
},
{
"title": "GeoJSON Polygon",
"type": "object",
"required": [
"type",
"coordinates"
],
"description": "Geoproperty. Geojson reference to the item. Polygon",
"properties": {
"type": {
"type": "string",
"enum": [
"Polygon"
]
},
"coordinates": {
"type": "array",
"items": {
"type": "array",
"minItems": 4,
"items": {
"type": "array",
"minItems": 2,
"items": {
"type": "number"
}
}
}
},
"bbox": {
"type": "array",
"minItems": 4,
"items": {
"type": "number"
}
}
}
},
{
"title": "GeoJSON MultiPoint",
"type": "object",
"required": [
"type",
"coordinates"
],
"description": "Geoproperty. Geojson reference to the item. MultiPoint",
"properties": {
"type": {
"type": "string",
"enum": [
"MultiPoint"
]
},
"coordinates": {
"type": "array",
"items": {
"type": "array",
"minItems": 2,
"items": {
"type": "number"
}
}
},
"bbox": {
"type": "array",
"minItems": 4,
"items": {
"type": "number"
}
}
}
},
{
"title": "GeoJSON MultiLineString",
"type": "object",
"required": [
"type",
"coordinates"
],
"description": "Geoproperty. Geojson reference to the item. MultiLineString",
"properties": {
"type": {
"type": "string",
"enum": [
"MultiLineString"
]
},
"coordinates": {
"type": "array",
"items": {
"type": "array",
"minItems": 2,
"items": {
"type": "array",
"minItems": 2,
"items": {
"type": "number"
}
}
}
},
"bbox": {
"type": "array",
"minItems": 4,
"items": {
"type": "number"
}
}
}
},
{
"title": "GeoJSON MultiPolygon",
"type": "object",
"required": [
"type",
"coordinates"
],
"description": "Geoproperty. Geojson reference to the item. MultiLineString",
"properties": {
"type": {
"type": "string",
"enum": [
"MultiPolygon"
]
},
"coordinates": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "array",
"minItems": 4,
"items": {
"type": "array",
"minItems": 2,
"items": {
"type": "number"
}
}
}
}
},
"bbox": {
"type": "array",
"minItems": 4,
"items": {
"type": "number"
}
}
}
}
],
"description": "Geoproperty. Geojson reference to the item. It can be Point, LineString, Polygon, MultiPoint, MultiLineString or MultiPolygon"
},
"address": {
"type": "object",
"description": "Property. The mailing address. Model:'https://schema.org/address'",
"properties": {
"streetAddress": {
"type": "string",
"description": "Property. The street address. Model:'https://schema.org/streetAddress'"
},
"addressLocality": {
"type": "string",
"description": "Property. The locality in which the street address is, and which is in the region. Model:'https://schema.org/addressLocality'"
},
"addressRegion": {
"type": "string",
"description": "Property. The region in which the locality is, and which is in the country. Model:'https://schema.org/addressRegion'"
},
"addressCountry": {
"type": "string",
"description": "Property. The country. For example, Spain. Model:'https://schema.org/addressCountry'"
},
"postalCode": {
"type": "string",
"description": "Property. The postal code. For example, 24004. Model:'https://schema.org/https://schema.org/postalCode'"
},
"postOfficeBoxNumber": {
"type": "string",
"description": "Property. The post office box number for PO box addresses. For example, 03578. Model:'https://schema.org/postOfficeBoxNumber'"
}
}
},
"areaServed": {
"type": "string",
"description": "Property. The geographic area where a service or offered item is provided. Model:'https://schema.org/Text'"
}
}
},
"PhysicalObject-Commons": {
"type": "object",
"properties": {
"color": {
"type": "string",
"description": "Property. The color of the product. Model:'https://schema.org/color'"
},
"image": {
"type": "string",
"format": "uri",
"description": "Property. An image of the item. Model:'https://schema.org/URL'"
},
"annotations": {
"type": "array",
"description": "Property. Annotations about the item. Model:'https://schema.org/Text'",
"items": {
"type": "string"
}
}
}
},
"DateTime-Commons": {
"type": "object",
"description": "Property. All date-time elements in data models unless explicitly stated are ISO 8601 compliant",
"properties": {
"openingHoursSpecification": {
"type": "array",
"description": "Property. A structured value providing information about the opening hours of a place or a certain service inside a place. Model:'https://schema.org/openingHoursSpecification'",
"items": {
"type": "object",
"properties": {
"opens": {
"type": "string",
"format": "time"
},
"closes": {
"type": "string",
"format": "time"
},
"dayOfWeek": {
"type": "string",
"description": "Property. Model:'http://schema.org/dayOfWeek'. The day of the week for which these opening hours are valid. URLs from GoodRelations (http://purl.org/goodrelations/v1) are used (for Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday plus a special entry for PublicHolidays).",
"anyOf": [
{
"type": "string",
"description": "Property. Array of days of the week.",
"enum": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday",
"PublicHolidays"
]
},
{
"type": "string",
"description": "Property. Array of days of the week.",
"enum": [
"https://schema.org/Monday",
"https://schema.org/Tuesday",
"https://schema.org/Wednesday",
"https://schema.org/Thursday",
"https://schema.org/Friday",
"https://schema.org/Saturday",
"https://schema.org/Sunday",
"https://schema.org/PublicHolidays"
]
}
]
},
"validFrom": {
"description": "Property. The date when the item becomes valid. A date value in the form CCYY-MM-DD or a combination of date and time of day in the form [-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm] in ISO 8601 date format.",
"anyOf": [
{
"type": "string",
"format": "date",
"description": "Property. Model:'http://schema.org/Date."
},
{
"type": "string",
"format": "date-time",
"description": "Property. Model:'http://schema.org/DateTime."
}
]
},
"validThrough": {
"type": "string",
"description": "Property. The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours. A date value in the form CCYY-MM-DD or a combination of date and time of day in the form [-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm] in ISO 8601 date format.",
"anyOf": [
{
"type": "string",
"format": "date",
"description": "Property. Model:'http://schema.org/Date."
},
{
"type": "string",
"format": "date-time",
"description": "Property. Model:'http://schema.org/DateTime."
}
]
}
}
},
"minItems": 1
}
},
"openingHours": {
"type": "string",
"description": "Property. Model:'https://schema.org/openingHours'. The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas ',' separating each day. Day or time ranges are specified using a hyphen '-'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 format. For example, 3pm is specified as 15:00, 10am as 10:00. Here is an example: <time itemprop='openingHours' datetime='Tu,Th 16:00-20:00'>Tuesdays and Thursdays 4-8pm</time>. If a business is open 7 days a week, then it can be specified as <time itemprop='openingHours' datetime='Mo-Su'>Monday through Sunday, all day</time>."
}
},
"Contact-Commons": {
"description": "Property. All contact elements in data models unless explicitly stated according to schema.org",
"type": "object",
"properties": {
"contactPoint": {
"type": "object",
"description": "Property. Model:'https://schema.org/ContactPoint'. The details to contact with the item.",
"properties": {
"contactType": {
"type": "string",
"description": "Property. Contact type of this item."
},
"email": {
"$ref": "#/definitions/email"
},
"telephone": {
"type": "string",
"description": "Property. Telephone of this contact."
},
"name": {
"type": "string",
"description": "Property. The name of this item."
},
"url": {
"type": "string",
"format": "uri",
"description": "Property. URL which provides a description or further information about this item."
},
"areaServed": {
"type": "string",
"description": "Property. The geographic area where a service or offered item is provided. Supersedes serviceArea."
},
"availableLanguage": {
"description": "Property. Model:'http://schema.org/availableLanguage'. A language someone may use with or at the item, service or place. Please use one of the language codes from the IETF BCP 47 standard. It is implemented the Text option but it could be also Language",
"anyOf": [
{
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
]
},
"contactOption": {
"description": "Property. Model:'http://schema.org/contactOption'. An option available on this contact point (e.g. a toll-free number or support for hearing-impaired callers).",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"faxNumber": {
"type": "string",
"description": "Property. Model:'http://schema.org/Text'. The fax number."
},
"productSupported": {
"type": "string",
"description": "Property. Model:'http://schema.org/Text'. The product or service this support contact point is related to (such as product support for a particular product line). This can be a specific product or product line (e.g. \"iPhone\") or a general category of products or services (e.g. \"smartphones\")."
},
"availabilityRestriction": {
"description": "Relationship. Model:'http://schema.org/hoursAvailable'. This property links a contact point to information about when the contact point is not available. The details are provided using the Opening Hours Specification class.",
"anyOf": [
{
"type": "array",
"description": "Property. Array of identifiers format of any NGSI entity.",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 256,
"pattern": "^[\\w\\-\\.\\{\\}\\$\\+\\*\\[\\]`|~^@!,:\\\\]+$"
}
},
{
"type": "array",
"description": "Property. Array of identifiers format of any NGSI entity.",
"items": {
"type": "string",
"format": "uri"
}
}
]
}
}
}
}
},
"Person-Commons": {
"description": "Property. All properties to identify a person according to schema.org",
"type": "object",
"properties": {
"person": {
"type": "object",
"description": "Property. Model:'https://schema.org/Person'. A person (alive, dead, undead, or fictional).",
"properties": {
"additionalName": {
"type": "string",
"description": "Property. Model:'https://schema.org/Text'. An additional name for a Person, can be used for a middle name."
},
"familyName": {
"type": "string",
"description": "Property. Model:'https://schema.org/Text'. Family name. In the U.S., the last name of a Person."
},
"givenName": {
"type": "string",
"description": "Property. Model:'https://schema.org/Text'. Given name. In the U.S., the first name of a Person."
},
"telephone": {
"type": "string",
"description": "Property. Model:'https://schema.org/Text'. The telephone number."
},
"email": {
"$ref": "#/definitions/email"
}
}
}
}
},
"Extensible-Commons": {
"description": "Property. All properties to allow interoperability with TMForum Open-APIs",
"type": "object",
"properties": {
"Addressable": {
"type": "object",
"description": "Base schema for addressable entities",
"properties": {
"href": {
"type": "string",
"format": "uri",
"description": "Hyperlink reference"
},
"id": {
"type": "string",
"description": "unique identifier"
}
}
},
"Extensible": {
"type": "object",
"description": "Base Extensible schema for use in TMForum Open-APIs",
"properties": {
"@schemaLocation": {
"type": "string",
"format": "uri",
"description": "A URI to a JSON-Schema file that defines additional attributes and relationships"
},
"@baseType": {
"type": "string",
"description": "When sub-classing, this defines the super-class"
},
"@type": {
"type": "string",
"description": "When sub-classing, this defines the sub-class Extensible name"
}
},
"dependencies": {
"@schemaLocation": [
"@baseType",
"@type"
]
}
}
}
},
"TimeSeriesAggregation": {
"type": "object",
"description": "Property. Object defining the temporal processing of a basic property during a period. It provides Maximum, minimum, instant value and average. Attributes using this should be named with the suffix TSA",
"properties": {
"avgOverTime": {
"type": "number"
},
"minOverTime": {
"type": "number"
},
"maxOverTime": {
"type": "number"
},
"instValue": {
"type": "number"
}
}
}
}
}