Entity.json 5.09 KB
Newer Older
1
2
{
  "$schema": "http://json-schema.org/schema#",
canterafonsj's avatar
canterafonsj committed
3
  "id": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/Entity.json",
4
5
6
  "title": "NGSI-LD Entity",
  "description": "NGSI-LD Entity",
  "definitions": {
canterafonsj's avatar
canterafonsj committed
7
8
9
10
11
12
    "EntityType": {
      "type": "string",
      "pattern": "^(\\d|[a-zA-Z]|_)+$",
      "minLength": 1,
      "description": "NGSI Entity type"
    },
13
14
15
16
17
18
19
20
21
    "datasetId": {
      "type": "string",
      "format": "uri"
    },
    "instanceId": {
      "type": "string",
      "format": "uri"
    },
    "Property": {
22
23
      "type": "object",
      "properties": {
24
        "type": {
25
          "type": "string",
26
27
28
          "const": "Property"
        },
        "value": {
canterafonsj's avatar
canterafonsj committed
29
          "type": ["string","number","boolean","array","object"]
30
31
        },
        "observedAt": {
canterafonsj's avatar
canterafonsj committed
32
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/observedAt"
33
34
        },
        "createdAt": {
canterafonsj's avatar
canterafonsj committed
35
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
36
37
        },
        "modifiedAt": {
canterafonsj's avatar
canterafonsj committed
38
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
39
        },
canterafonsj's avatar
canterafonsj committed
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": {
canterafonsj's avatar
canterafonsj committed
74
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/observedAt"
75
76
        },
        "createdAt": {
canterafonsj's avatar
canterafonsj committed
77
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
78
79
        },
        "modifiedAt": {
canterafonsj's avatar
canterafonsj committed
80
          "$ref": "https://forge.etsi.org/gitlab/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": {
canterafonsj's avatar
canterafonsj committed
112
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#"
113
        },
canterafonsj's avatar
canterafonsj committed
114
115
116
        "observedAt": {
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/observedAt"
        },
117
        "createdAt": {
canterafonsj's avatar
canterafonsj committed
118
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
119
120
        },
        "modifiedAt": {
canterafonsj's avatar
canterafonsj committed
121
          "$ref": "https://forge.etsi.org/gitlab/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
146
147
148
149
150
151
152
    }
  },
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uri"
    },
    "type": {
canterafonsj's avatar
canterafonsj committed
153
      "$ref": "#/definitions/EntityType"
canterafonsj's avatar
canterafonsj committed
154
155
    },
    "@context": {
canterafonsj's avatar
canterafonsj committed
156
      "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
157
158
159
160
161
162
163
164
165
    },
    "location": {
      "$ref": "#/definitions/GeoProperty"
    },
    "observationSpace": {
      "$ref": "#/definitions/GeoProperty"
    },
    "operationSpace": {
      "$ref": "#/definitions/GeoProperty"
166
167
    },
    "createdAt": {
canterafonsj's avatar
canterafonsj committed
168
      "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
169
170
    },
    "modifiedAt": {
canterafonsj's avatar
canterafonsj committed
171
      "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
172
173
174
175
176
177
178
    }
  },
  "required": [
    "id",
    "type"
  ],
  "additionalProperties": {
canterafonsj's avatar
canterafonsj committed
179
180
181
182
183
184
    "anyOf": [
      {
        "$ref": "#/definitions/Property"
      },
      {
        "$ref": "#/definitions/Relationship"
canterafonsj's avatar
canterafonsj committed
185
186
187
      },
      {
        "$ref": "#/definitions/GeoProperty"
canterafonsj's avatar
canterafonsj committed
188
189
      }
    ]
canterafonsj's avatar
canterafonsj committed
190
191
192
193
  },
  "propertyNames": {
    "type": "string",
    "pattern": "^((\\d|[a-zA-Z]|_)+(#\\d+)?)$"
194
  }
canterafonsj's avatar
canterafonsj committed
195
}