1{
2    "$schema": "http://json-schema.org/draft-04/schema#",
3    "id": "4.3.1-timeStateState.json",
4    "assertionType": "may",
5    "expectedResult": "valid",
6    "onUnexpectedResult" : "passAndContinue",
7    "errorMessage": "The description of a Specific Resource may include timeState State .",
8    "title": "Implements **Specific Resource Time State** - [model 4.3.1](https://www.w3.org/TR/annotation-model/#time-state)",
9    "description": "True when Annotation includes one or more Specific Resources, one or more of which includes a timeState State. (Section 4.3.1)",
10    "type": "object",
11    "anyOf":
12     [
13      { "properties":
14         { "body":
15            { "oneOf":
16               [
17                 { "type": "object",
18                   "oneOf":
19                    [
20                      { "$ref": "#/definitions/stateSchema" },
21                      { "$ref": "#/definitions/itemSchema" }
22                    ]
23                 },
24                 { "type": "array",
25                   "minItems": 1,
26                   "not":
27                    { "items":
28                       { "not":
29                          { "oneOf":
30                             [
31                               { "$ref": "#/definitions/stateSchema" },
32                               { "$ref": "#/definitions/itemSchema" }
33                             ]
34                          }
35                       }
36                    }
37                 }
38               ]
39            }
40         },
41         "required": [ "body" ]
42      },
43      { "properties":
44         { "target":
45            { "oneOf":
46               [
47                 { "type": "object",
48                   "oneOf":
49                    [
50                      { "$ref": "#/definitions/stateSchema" },
51                      { "$ref": "#/definitions/itemSchema" }
52                    ]
53                 },
54                 { "type": "array",
55                   "minItems": 1,
56                   "not":
57                    { "items":
58                        { "not":
59                           { "oneOf":
60                              [
61                                { "$ref": "#/definitions/stateSchema" },
62                                { "$ref": "#/definitions/itemSchema" }
63                              ]
64                           }
65                        }
66                    }
67                 }
68               ]
69            }
70         }
71       }
72     ],
73     "definitions":
74      {
75        "stateSchema":
76         { "type": "object",
77           "properties":
78            { "state":
79               { "oneOf":
80                  [
81                    { "type": "object",
82                      "$ref": "specificResource.json#/definitions/timeStateDetected"
83                    },
84                    { "type": "array",
85                      "minItems": 1,
86                      "not":
87                       { "items":
88                          { "not": { "$ref": "specificResource.json#/definitions/timeStateDetected" } }
89                       }
90                    }
91                  ]
92               }
93            },
94            "required": [ "state" ]
95         },
96
97        "itemSchema":
98         { "type": "object",
99           "properties":
100            { "items":
101               { "type": "array",
102                 "minItems": 1,
103                 "not":
104                  { "items":
105                      { "not": { "$ref": "#/definitions/stateSchema" } }
106                  }
107               }
108            },
109            "required": [ "items" ]
110         }
111      }
112}