Entity.json 5.51 KB
Newer Older
1
2
{
  "$schema": "http://json-schema.org/schema#",
André Costa's avatar
André Costa committed
3
  "$id": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/Entity.json",
4
5
6
  "title": "NGSI-LD Entity",
  "description": "NGSI-LD Entity",
  "definitions": {
7
8
9
10
11
12
13
14
15
    "datasetId": {
      "type": "string",
      "format": "uri"
    },
    "instanceId": {
      "type": "string",
      "format": "uri"
    },
    "Property": {
16
17
      "type": "object",
      "properties": {
18
        "type": {
19
          "type": "string",
20
21
22
          "const": "Property"
        },
        "value": {
canterafonsj's avatar
canterafonsj committed
23
24
25
26
27
28
29
          "type": [
            "string",
            "number",
            "boolean",
            "array",
            "object"
          ]
30
31
        },
        "observedAt": {
André Costa's avatar
André Costa committed
32
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/observedAt"
33
34
        },
        "createdAt": {
André Costa's avatar
André Costa committed
35
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
36
37
        },
        "modifiedAt": {
André Costa's avatar
André Costa committed
38
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
39
        },
40
        "datasetId": {
41
          "$ref": "#/definitions/datasetId"
42
43
        },
        "instanceId": {
44
          "$ref": "#/definitions/instanceId"
45
        }
46
47
48
49
50
51
52
53
54
      },
      "required": [
        "type",
        "value"
      ],
      "additionalProperties": {
        "anyOf": [
          {
            "$ref": "#/definitions/Property"
55
          },
56
57
          {
            "$ref": "#/definitions/Relationship"
canterafonsj's avatar
canterafonsj committed
58
          }
59
60
        ]
      }
canterafonsj's avatar
canterafonsj committed
61
62
    },
    "Relationship": {
63
64
65
66
67
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Relationship"
canterafonsj's avatar
canterafonsj committed
68
        },
69
70
71
72
73
        "object": {
          "type": "string",
          "format": "uri"
        },
        "observedAt": {
André Costa's avatar
André Costa committed
74
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/observedAt"
75
76
        },
        "createdAt": {
André Costa's avatar
André Costa committed
77
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
78
79
        },
        "modifiedAt": {
André Costa's avatar
André Costa committed
80
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
        },
        "datasetId": {
          "$ref": "#/definitions/datasetId"
        },
        "instanceId": {
          "$ref": "#/definitions/instanceId"
        }
      },
      "required": [
        "type",
        "object"
      ],
      "additionalProperties": {
        "anyOf": [
          {
            "$ref": "#/definitions/Property"
canterafonsj's avatar
canterafonsj committed
97
          },
98
99
          {
            "$ref": "#/definitions/Relationship"
100
          }
101
102
        ]
      }
canterafonsj's avatar
canterafonsj committed
103
104
    },
    "GeoProperty": {
105
106
107
108
109
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "GeoProperty"
canterafonsj's avatar
canterafonsj committed
110
        },
111
        "value": {
112
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#"
113
        },
canterafonsj's avatar
canterafonsj committed
114
        "observedAt": {
André Costa's avatar
André Costa committed
115
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/observedAt"
canterafonsj's avatar
canterafonsj committed
116
        },
117
        "createdAt": {
André Costa's avatar
André Costa committed
118
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
119
120
        },
        "modifiedAt": {
André Costa's avatar
André Costa committed
121
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
        },
        "datasetId": {
          "$ref": "#/definitions/datasetId"
        },
        "instanceId": {
          "$ref": "#/definitions/instanceId"
        }
      },
      "required": [
        "type",
        "value"
      ],
      "additionalProperties": {
        "anyOf": [
          {
            "$ref": "#/definitions/Property"
canterafonsj's avatar
canterafonsj committed
138
          },
139
140
          {
            "$ref": "#/definitions/Relationship"
canterafonsj's avatar
canterafonsj committed
141
          }
142
143
        ]
      }
144
    },
145
    "EntityFragment": {
canterafonsj's avatar
canterafonsj committed
146
147
148
      "type": "object",
      "properties": {
        "@context": {
André Costa's avatar
André Costa committed
149
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
canterafonsj's avatar
canterafonsj committed
150
151
152
153
154
155
156
157
158
        },
        "location": {
          "$ref": "#/definitions/GeoProperty"
        },
        "observationSpace": {
          "$ref": "#/definitions/GeoProperty"
        },
        "operationSpace": {
          "$ref": "#/definitions/GeoProperty"
159
        },
160
        "id": {
161
162
163
164
          "type": "string",
          "format": "uri"
        },
        "type": {
André Costa's avatar
André Costa committed
165
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name"
166
167
        },
        "createdAt": {
André Costa's avatar
André Costa committed
168
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
169
170
        },
        "modifiedAt": {
André Costa's avatar
André Costa committed
171
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
canterafonsj's avatar
canterafonsj committed
172
        }
canterafonsj's avatar
canterafonsj committed
173
      },
canterafonsj's avatar
canterafonsj committed
174
175
176
177
178
179
180
181
182
183
184
185
      "additionalProperties": {
        "anyOf": [
          {
            "$ref": "#/definitions/Property"
          },
          {
            "$ref": "#/definitions/Relationship"
          },
          {
            "$ref": "#/definitions/GeoProperty"
          }
        ]
canterafonsj's avatar
canterafonsj committed
186
      },
canterafonsj's avatar
canterafonsj committed
187
      "propertyNames": {
André Costa's avatar
André Costa committed
188
        "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/PropertyNames"
canterafonsj's avatar
canterafonsj committed
189
      }
190
191
192
193
194
195
196
197
198
199
200
201
202
    },
    "Entity": {
      "allOf": [
        {
          "required": [
            "id",
            "type"
          ]
        },
        {
          "$ref": "#/definitions/EntityFragment"
        }
      ]
canterafonsj's avatar
canterafonsj committed
203
204
    }
  },
canterafonsj's avatar
canterafonsj committed
205
206
207
208
209
  "allOf": [
    {
      "$ref": "#/definitions/Entity"
    }
  ]
André Costa's avatar
André Costa committed
210
}