Entity.json 4.15 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": {
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
    "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": {
28
29
      "type": "object",
      "properties": {
30
        "type": {
31
          "type": "string",
32
33
34
35
36
37
38
          "const": "Property"
        },
        "value": {
          "type": "any"
        },
        "observedAt": {
          "$ref": "#/definitions/observedAt"
39
40
        },
        "createdAt": {
41
          "$ref": "#/definitions/createdAt"
42
43
        },
        "modifiedAt": {
44
          "$ref": "#/definitions/modifiedAt"
45
        },
46
        "datasetId": {
47
          "$ref": "#/definitions/datasetId"
48
49
        },
        "instanceId": {
50
          "$ref": "#/definitions/instanceId"
51
        }
52
53
54
55
56
57
58
59
60
      },
      "required": [
        "type",
        "value"
      ],
      "additionalProperties": {
        "anyOf": [
          {
            "$ref": "#/definitions/Property"
61
          },
62
63
          {
            "$ref": "#/definitions/Relationship"
canterafonsj's avatar
canterafonsj committed
64
          }
65
66
        ]
      }
canterafonsj's avatar
canterafonsj committed
67
68
    },
    "Relationship": {
69
70
71
72
73
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Relationship"
canterafonsj's avatar
canterafonsj committed
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
        "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
103
          },
104
105
          {
            "$ref": "#/definitions/Relationship"
106
          }
107
108
        ]
      }
canterafonsj's avatar
canterafonsj committed
109
110
    },
    "GeoProperty": {
111
112
113
114
115
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "GeoProperty"
canterafonsj's avatar
canterafonsj committed
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
        "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
141
          },
142
143
          {
            "$ref": "#/definitions/Relationship"
canterafonsj's avatar
canterafonsj committed
144
          }
145
146
        ]
      }
147
148
149
150
151
152
153
154
155
156
157
    }
  },
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uri"
    },
    "type": {
      "type": "string",
      "description": "NGSI Entity type"
canterafonsj's avatar
canterafonsj committed
158
159
    },
    "@context": {
canterafonsj's avatar
canterafonsj committed
160
      "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
161
162
163
164
165
166
167
168
169
    },
    "location": {
      "$ref": "#/definitions/GeoProperty"
    },
    "observationSpace": {
      "$ref": "#/definitions/GeoProperty"
    },
    "operationSpace": {
      "$ref": "#/definitions/GeoProperty"
170
171
172
173
174
175
    },
    "createdAt": {
      "$ref": "#/definitions/createdAt"
    },
    "modifiedAt": {
      "$ref": "#/definitions/modifiedAt"
176
177
178
179
180
181
182
    }
  },
  "required": [
    "id",
    "type"
  ],
  "additionalProperties": {
canterafonsj's avatar
canterafonsj committed
183
184
185
186
187
188
    "anyOf": [
      {
        "$ref": "#/definitions/Property"
      },
      {
        "$ref": "#/definitions/Relationship"
canterafonsj's avatar
canterafonsj committed
189
190
191
      },
      {
        "$ref": "#/definitions/GeoProperty"
canterafonsj's avatar
canterafonsj committed
192
193
      }
    ]
194
  }
195
}