Entity_temporalValues.json 2.48 KB
Newer Older
canterafonsj's avatar
canterafonsj committed
{
  "title": "NGSI-LD Entity Temporal Values",
  "description": "NGSI-LD Simplified Temporal Representation of Entities",
  "definitions": {
    "TimestampOrEmpty": {
      "oneOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "string",
          "minLength": 0,
          "maxLength": 0
        }
      ]
    },
    "TemporalValue": {
      "type": "array",
      "items": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "object",
            "array"
          ]
        },
        {
          "$ref": "#/definitions/TimestampOrEmpty"
        }
      ],
      "minTems": 2,
      "maxItems": 2
    },
    "TemporalObject": {
      "type": "array",
      "items": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "$ref": "#/definitions/TimestampOrEmpty"
        }
      ],
      "minTems": 2,
      "maxItems": 2
    },
    "PropertyTemporalValues": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Property"
        },
        "values": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TemporalValue"
          }
        }
      }
    },
    "RelationshipTemporalValues": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "Relationship"
        },
        "objects": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TemporalObject"
          }
        }
      }
    }
  },
  "type": "object",
  "properties": {
    "id": {
canterafonsj's avatar
canterafonsj committed
      "type": "string",
      "format": "uri"
    },
    "type": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
      "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name"
canterafonsj's avatar
canterafonsj committed
    },
    "@context": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
      "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
canterafonsj's avatar
canterafonsj committed
    },
    "createdAt": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
      "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
canterafonsj's avatar
canterafonsj committed
    },
    "modifiedAt": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
      "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
canterafonsj's avatar
canterafonsj committed
    }
  },
  "required": [
    "type",
    "id"
  ],
  "additionalProperties": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
    "oneOf": [
canterafonsj's avatar
canterafonsj committed
      {
        "$ref": "#/definitions/PropertyTemporalValues"
      },
      {
        "$ref": "#/definitions/RelationshipTemporalValues"
      }
    ]
  }
Stefan Wiedemann's avatar
Stefan Wiedemann committed
}