Entity.json 4.52 KB
Newer Older
1
2
3
4
5
6
{
  "$schema": "http://json-schema.org/schema#",
  "id": "https://uri.etsi.org/ngsi-ld/schema/Entity.json",
  "title": "NGSI-LD Entity",
  "description": "NGSI-LD Entity",
  "definitions": {
canterafonsj's avatar
canterafonsj committed
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
    "LdContext": {
      "anyOf": [
        {
          "type": "object"
        },
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "object"
              }
            ]
          }
        }
      ]
    },
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    "observedAt": {
      "type": "string",
      "format": "date-time"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "modifiedAt": {
      "type": "string",
      "format": "date-time"
    },
    "datasetId": {
      "type": "string",
      "format": "uri"
    },
    "instanceId": {
      "type": "string",
      "format": "uri"
    },
    "Property": {
53
54
      "type": "object",
      "properties": {
55
        "type": {
56
          "type": "string",
57
58
59
60
61
62
63
          "const": "Property"
        },
        "value": {
          "type": "any"
        },
        "observedAt": {
          "$ref": "#/definitions/observedAt"
64
65
        },
        "createdAt": {
66
          "$ref": "#/definitions/createdAt"
67
68
        },
        "modifiedAt": {
69
          "$ref": "#/definitions/modifiedAt"
70
        },
71
        "datasetId": {
72
          "$ref": "#/definitions/datasetId"
73
74
        },
        "instanceId": {
75
          "$ref": "#/definitions/instanceId"
76
        }
77
78
79
80
81
82
83
84
85
      },
      "required": [
        "type",
        "value"
      ],
      "additionalProperties": {
        "anyOf": [
          {
            "$ref": "#/definitions/Property"
86
          },
87
88
          {
            "$ref": "#/definitions/Relationship"
canterafonsj's avatar
canterafonsj committed
89
          }
90
91
        ]
      }
canterafonsj's avatar
canterafonsj committed
92
93
    },
    "Relationship": {
94
95
96
97
98
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Relationship"
canterafonsj's avatar
canterafonsj committed
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
        "object": {
          "type": "string",
          "format": "uri"
        },
        "observedAt": {
          "$ref": "#/definitions/observedAt"
        },
        "createdAt": {
          "$ref": "#/definitions/createdAt"
        },
        "modifiedAt": {
          "$ref": "#/definitions/modifiedAt"
        },
        "datasetId": {
          "$ref": "#/definitions/datasetId"
        },
        "instanceId": {
          "$ref": "#/definitions/instanceId"
        }
      },
      "required": [
        "type",
        "object"
      ],
      "additionalProperties": {
        "anyOf": [
          {
            "$ref": "#/definitions/Property"
canterafonsj's avatar
canterafonsj committed
128
          },
129
130
          {
            "$ref": "#/definitions/Relationship"
131
          }
132
133
        ]
      }
canterafonsj's avatar
canterafonsj committed
134
135
    },
    "GeoProperty": {
136
137
138
139
140
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "GeoProperty"
canterafonsj's avatar
canterafonsj committed
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
        "value": {
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#"
        },
        "createdAt": {
          "$ref": "#/definitions/createdAt"
        },
        "modifiedAt": {
          "$ref": "#/definitions/modifiedAt"
        },
        "datasetId": {
          "$ref": "#/definitions/datasetId"
        },
        "instanceId": {
          "$ref": "#/definitions/instanceId"
        }
      },
      "required": [
        "type",
        "value"
      ],
      "additionalProperties": {
        "anyOf": [
          {
            "$ref": "#/definitions/Property"
canterafonsj's avatar
canterafonsj committed
166
          },
167
168
          {
            "$ref": "#/definitions/Relationship"
canterafonsj's avatar
canterafonsj committed
169
          }
170
171
        ]
      }
172
173
174
175
176
177
178
179
180
181
182
    }
  },
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uri"
    },
    "type": {
      "type": "string",
      "description": "NGSI Entity type"
canterafonsj's avatar
canterafonsj committed
183
184
185
    },
    "@context": {
      "$ref": "#/definitions/LdContext"
186
187
188
189
190
191
192
193
194
    },
    "location": {
      "$ref": "#/definitions/GeoProperty"
    },
    "observationSpace": {
      "$ref": "#/definitions/GeoProperty"
    },
    "operationSpace": {
      "$ref": "#/definitions/GeoProperty"
195
196
197
198
199
200
    },
    "createdAt": {
      "$ref": "#/definitions/createdAt"
    },
    "modifiedAt": {
      "$ref": "#/definitions/modifiedAt"
201
202
203
204
205
206
207
    }
  },
  "required": [
    "id",
    "type"
  ],
  "additionalProperties": {
canterafonsj's avatar
canterafonsj committed
208
209
210
211
212
213
    "anyOf": [
      {
        "$ref": "#/definitions/Property"
      },
      {
        "$ref": "#/definitions/Relationship"
canterafonsj's avatar
canterafonsj committed
214
215
216
      },
      {
        "$ref": "#/definitions/GeoProperty"
canterafonsj's avatar
canterafonsj committed
217
218
      }
    ]
219
  }
220
}