-
Notifications
You must be signed in to change notification settings - Fork 3
/
Temporal.json
77 lines (77 loc) · 2.66 KB
/
Temporal.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
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://raw.githubusercontent.com/peterataylor/om-json/master/Temporal.json",
"title": "Temporal",
"description": "Temporal objects",
"definitions": {
"date-time": {
"title": "date-time",
"type": "string",
"pattern": "^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$"
},
"date": {
"title": "date",
"type": "string",
"pattern": "^([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?$"
},
"g-year-month": {
"title": "g-year-month",
"type": "string",
"pattern": "^([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?$"
},
"g-year": {
"title": "g-year",
"type": "string",
"pattern": "^([1-9][0-9]{3,}|0[0-9]{3})(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?$"
},
"dateTimePosition": {
"title": "dateTime",
"oneOf": [
{ "$ref": "#/definitions/date-time" }
]
},
"dateTimeInstant": {
"title": "dateTimeInstant",
"type": "object",
"properties": {
"instant": { "$ref": "#/definitions/dateTimePosition" }
},
"required": [ "instant" ],
"additionalProperties": false
},
"dateTimeInterval": {
"title": "dateTimeInterval",
"description": "A time period has a begin and end. Either may be omitted for a single-ended interval.",
"type": "object",
"properties": {
"begin": { "$ref": "#/definitions/dateTimePosition" },
"end": { "$ref": "#/definitions/dateTimePosition" }
},
"additionalProperties": false
},
"temporalPrimitive": {
"title": "temporalPrimitive",
"oneOf": [
{ "$ref": "#/definitions/dateTimeInstant" },
{ "$ref": "#/definitions/dateTimeInterval" }
]
},
"duration": {
"title": "duration",
"type": "string",
"pattern": "-?P[0-9]+Y?([0-9]+M)?([0-9]+D)?(T([0-9]+H)?([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?)?"
},
"temporalObject": {
"title": "temporalObject",
"oneOf": [
{ "$ref": "#/definitions/duration" },
{ "$ref": "#/definitions/dateTimeInstant" },
{ "$ref": "#/definitions/dateTimeInterval" }
]
}
},
"properties": {
"time": { "$ref": "#/definitions/temporalObject" }
},
"required": [ "time" ]
}