Skip to content
ContextSourceRegistration.json 4.04 KiB
Newer Older
{
  "$schema": "http://json-schema.org/schema#",
canterafonsj's avatar
canterafonsj committed
  "$id": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/registrations/ContextSourceRegistration.json",
  "title": "NGSI-LD Context Source Registration",
  "description": "NGSI-LD Context Source Registration",
  "definitions": {
    "RegistrationInfo": {
      "type": "object",
	  "anyOf": [
		{"required": ["entities"]},
		{"required": ["properties"]},
		{"required": ["relationships"]}
      ],
      "properties": {
        "entities": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/EntityInfo"
          }
        },
        "properties": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name"
          },
          "uniqueItems": true
        },
        "relationships": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name"
          },
          "uniqueItems": true
        }
      }
    },
    "TimeInterval": {
      "type": "object",
      "required": [
        "start"
      ],
      "properties": {
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "end": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
canterafonsj's avatar
canterafonsj committed
    "ContextSourceRegistrationFragment": {
      "type": "object",
      "properties": {
        "@context": {
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
        },
        "information": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/definitions/RegistrationInfo"
          }
        },
        "observationInterval": {
          "$ref": "#/definitions/TimeInterval"
        },
        "managementInterval": {
          "$ref": "#/definitions/TimeInterval"
canterafonsj's avatar
canterafonsj committed
        },
        "location": {
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#"
        },
		"observationSpace": {
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#"
        },
		"operationSpace": {
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#"
canterafonsj's avatar
canterafonsj committed
        },
        "expires": {
          "type": "string",
          "format": "date-time"
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string",
          "minLength": 1
        },
        "endpoint": {
          "type": "string",
          "format": "uri"
        }
      },
      "additionalProperties": {
        "type": [
          "string",
          "number",
          "boolean",
          "array",
          "object"
        ]
canterafonsj's avatar
canterafonsj committed
    "ContextSourceRegistration": {
      "allOf": [
        {
          "$ref": "#/definitions/ContextSourceRegistrationFragment"
        },
        {
          "type": "object",
          "properties": {
canterafonsj's avatar
canterafonsj committed
            "$id": {
canterafonsj's avatar
canterafonsj committed
              "type": "string",
              "format": "uri"
            },
            "type": {
              "type": "string",
              "const": "ContextSourceRegistration"
            },
            "createdAt": {
              "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
            },
            "modifiedAt": {
              "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
            }
          },
          "required": [
            "id",
            "type",
            "endpoint",
            "information"
          ]
        }
      ]
canterafonsj's avatar
canterafonsj committed
  "allOf": [
    {
      "$ref": "#/definitions/ContextSourceRegistration"
    }